svgnode.cxx (a275c134) svgnode.cxx (01e92ad6)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 180 unchanged lines hidden (view full) ---

189 for(sal_uInt32 a(0); a < nAttributes; a++)
190 {
191 const ::rtl::OUString aTokenName(xAttribs->getNameByIndex(a));
192
193 parseAttribute(aTokenName, StrToSVGToken(aTokenName), xAttribs->getValueByIndex(a));
194 }
195 }
196
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 180 unchanged lines hidden (view full) ---

189 for(sal_uInt32 a(0); a < nAttributes; a++)
190 {
191 const ::rtl::OUString aTokenName(xAttribs->getNameByIndex(a));
192
193 parseAttribute(aTokenName, StrToSVGToken(aTokenName), xAttribs->getValueByIndex(a));
194 }
195 }
196
197 Display getDisplayFromContent(const rtl::OUString& aContent)
198 {
199 if(aContent.getLength())
200 {
201 static rtl::OUString aStrInline(rtl::OUString::createFromAscii("inline"));
202 static rtl::OUString aStrBlock(rtl::OUString::createFromAscii("block"));
203 static rtl::OUString aStrList_item(rtl::OUString::createFromAscii("list-item"));
204 static rtl::OUString aStrRun_in(rtl::OUString::createFromAscii("run-in"));
205 static rtl::OUString aStrCompact(rtl::OUString::createFromAscii("compact"));
206 static rtl::OUString aStrMarker(rtl::OUString::createFromAscii("marker"));
207 static rtl::OUString aStrTable(rtl::OUString::createFromAscii("table"));
208 static rtl::OUString aStrInline_table(rtl::OUString::createFromAscii("inline-table"));
209 static rtl::OUString aStrTable_row_group(rtl::OUString::createFromAscii("table-row-group"));
210 static rtl::OUString aStrTable_header_group(rtl::OUString::createFromAscii("table-header-group"));
211 static rtl::OUString aStrTable_footer_group(rtl::OUString::createFromAscii("table-footer-group"));
212 static rtl::OUString aStrTable_row(rtl::OUString::createFromAscii("table-row"));
213 static rtl::OUString aStrTable_column_group(rtl::OUString::createFromAscii("table-column-group"));
214 static rtl::OUString aStrTable_column(rtl::OUString::createFromAscii("table-column"));
215 static rtl::OUString aStrTable_cell(rtl::OUString::createFromAscii("table-cell"));
216 static rtl::OUString aStrTable_caption(rtl::OUString::createFromAscii("table-caption"));
217 static rtl::OUString aStrNone(rtl::OUString::createFromAscii("none"));
218 static rtl::OUString aStrInherit(rtl::OUString::createFromAscii("inherit"));
219
220 if(aContent.match(aStrInline))
221 {
222 return Display_inline;
223 }
224 else if(aContent.match(aStrNone))
225 {
226 return Display_none;
227 }
228 else if(aContent.match(aStrInherit))
229 {
230 return Display_inherit;
231 }
232 else if(aContent.match(aStrBlock))
233 {
234 return Display_block;
235 }
236 else if(aContent.match(aStrList_item))
237 {
238 return Display_list_item;
239 }
240 else if(aContent.match(aStrRun_in))
241 {
242 return Display_run_in;
243 }
244 else if(aContent.match(aStrCompact))
245 {
246 return Display_compact;
247 }
248 else if(aContent.match(aStrMarker))
249 {
250 return Display_marker;
251 }
252 else if(aContent.match(aStrTable))
253 {
254 return Display_table;
255 }
256 else if(aContent.match(aStrInline_table))
257 {
258 return Display_inline_table;
259 }
260 else if(aContent.match(aStrTable_row_group))
261 {
262 return Display_table_row_group;
263 }
264 else if(aContent.match(aStrTable_header_group))
265 {
266 return Display_table_header_group;
267 }
268 else if(aContent.match(aStrTable_footer_group))
269 {
270 return Display_table_footer_group;
271 }
272 else if(aContent.match(aStrTable_row))
273 {
274 return Display_table_row;
275 }
276 else if(aContent.match(aStrTable_column_group))
277 {
278 return Display_table_column_group;
279 }
280 else if(aContent.match(aStrTable_column))
281 {
282 return Display_table_column;
283 }
284 else if(aContent.match(aStrTable_cell))
285 {
286 return Display_table_cell;
287 }
288 else if(aContent.match(aStrTable_caption))
289 {
290 return Display_table_caption;
291 }
292 }
293
294 // return the default
295 return Display_inline;
296 }
297
197 void SvgNode::parseAttribute(const rtl::OUString& /*rTokenName*/, SVGToken aSVGToken, const rtl::OUString& aContent)
198 {
199 switch(aSVGToken)
200 {
201 case SVGTokenId:
202 {
203 if(aContent.getLength())
204 {

--- 26 unchanged lines hidden (view full) ---

231 }
232 }
233 break;
234 }
235 case SVGTokenDisplay:
236 {
237 if(aContent.getLength())
238 {
298 void SvgNode::parseAttribute(const rtl::OUString& /*rTokenName*/, SVGToken aSVGToken, const rtl::OUString& aContent)
299 {
300 switch(aSVGToken)
301 {
302 case SVGTokenId:
303 {
304 if(aContent.getLength())
305 {

--- 26 unchanged lines hidden (view full) ---

332 }
333 }
334 break;
335 }
336 case SVGTokenDisplay:
337 {
338 if(aContent.getLength())
339 {
239 static rtl::OUString aStrInline(rtl::OUString::createFromAscii("inline"));
240 static rtl::OUString aStrBlock(rtl::OUString::createFromAscii("block"));
241 static rtl::OUString aStrList_item(rtl::OUString::createFromAscii("list-item"));
242 static rtl::OUString aStrRun_in(rtl::OUString::createFromAscii("run-in"));
243 static rtl::OUString aStrCompact(rtl::OUString::createFromAscii("compact"));
244 static rtl::OUString aStrMarker(rtl::OUString::createFromAscii("marker"));
245 static rtl::OUString aStrTable(rtl::OUString::createFromAscii("table"));
246 static rtl::OUString aStrInline_table(rtl::OUString::createFromAscii("inline-table"));
247 static rtl::OUString aStrTable_row_group(rtl::OUString::createFromAscii("table-row-group"));
248 static rtl::OUString aStrTable_header_group(rtl::OUString::createFromAscii("table-header-group"));
249 static rtl::OUString aStrTable_footer_group(rtl::OUString::createFromAscii("table-footer-group"));
250 static rtl::OUString aStrTable_row(rtl::OUString::createFromAscii("table-row"));
251 static rtl::OUString aStrTable_column_group(rtl::OUString::createFromAscii("table-column-group"));
252 static rtl::OUString aStrTable_column(rtl::OUString::createFromAscii("table-column"));
253 static rtl::OUString aStrTable_cell(rtl::OUString::createFromAscii("table-cell"));
254 static rtl::OUString aStrTable_caption(rtl::OUString::createFromAscii("table-caption"));
255 static rtl::OUString aStrNone(rtl::OUString::createFromAscii("none"));
256 static rtl::OUString aStrInherit(rtl::OUString::createFromAscii("inherit"));
257
258 if(aContent.match(aStrInline))
259 {
260 setDisplay(Display_inline);
261 }
262 else if(aContent.match(aStrNone))
263 {
264 setDisplay(Display_none);
265 }
266 else if(aContent.match(aStrInherit))
267 {
268 setDisplay(Display_inherit);
269 }
270 else if(aContent.match(aStrBlock))
271 {
272 setDisplay(Display_block);
273 }
274 else if(aContent.match(aStrList_item))
275 {
276 setDisplay(Display_list_item);
277 }
278 else if(aContent.match(aStrRun_in))
279 {
280 setDisplay(Display_run_in);
281 }
282 else if(aContent.match(aStrCompact))
283 {
284 setDisplay(Display_compact);
285 }
286 else if(aContent.match(aStrMarker))
287 {
288 setDisplay(Display_marker);
289 }
290 else if(aContent.match(aStrTable))
291 {
292 setDisplay(Display_table);
293 }
294 else if(aContent.match(aStrInline_table))
295 {
296 setDisplay(Display_inline_table);
297 }
298 else if(aContent.match(aStrTable_row_group))
299 {
300 setDisplay(Display_table_row_group);
301 }
302 else if(aContent.match(aStrTable_header_group))
303 {
304 setDisplay(Display_table_header_group);
305 }
306 else if(aContent.match(aStrTable_footer_group))
307 {
308 setDisplay(Display_table_footer_group);
309 }
310 else if(aContent.match(aStrTable_row))
311 {
312 setDisplay(Display_table_row);
313 }
314 else if(aContent.match(aStrTable_column_group))
315 {
316 setDisplay(Display_table_column_group);
317 }
318 else if(aContent.match(aStrTable_column))
319 {
320 setDisplay(Display_table_column);
321 }
322 else if(aContent.match(aStrTable_cell))
323 {
324 setDisplay(Display_table_cell);
325 }
326 else if(aContent.match(aStrTable_caption))
327 {
328 setDisplay(Display_table_caption);
329 }
340 setDisplay(getDisplayFromContent(aContent));
330 }
331 break;
332 }
333 default:
334 {
335 break;
336 }
337 }

--- 206 unchanged lines hidden ---
341 }
342 break;
343 }
344 default:
345 {
346 break;
347 }
348 }

--- 206 unchanged lines hidden ---