LibreOffice Module svgio (master) 1
svgnode.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <svgdocument.hxx>
21#include <svgnode.hxx>
24#include <o3tl/string_view.hxx>
25#include <osl/diagnose.h>
26#include <tools/urlobj.hxx>
27
28
29namespace svgio::svgreader
30{
33 {
34 return true;
35 }
36
38 {
39 return nullptr;
40 }
41
42 void SvgNode::addCssStyle(const SvgDocument& rDocument, const OUString& aConcatenated)
43 {
44 const SvgStyleAttributes* pNew = rDocument.findGlobalCssStyleAttributes(aConcatenated);
45
46 if(pNew)
47 {
48 // add CssStyle if found
49 maCssStyleVector.push_back(pNew);
50 }
51 }
52
53namespace {
54 std::vector< OUString > parseClass(const SvgNode& rNode)
55 {
56 std::vector< OUString > aParts;
57
58 // check for 'class' references (a list of entries is allowed)
59 if(rNode.getClass())
60 {
61 const OUString& rClassList = *rNode.getClass();
62 const sal_Int32 nLen(rClassList.getLength());
63
64 if(nLen)
65 {
66 sal_Int32 nPos(0);
67 OUStringBuffer aToken;
68
69 while(nPos < nLen)
70 {
71 const sal_Int32 nInitPos(nPos);
72 copyToLimiter(rClassList, u' ', nPos, aToken, nLen);
73 skip_char(rClassList, u' ', nPos, nLen);
74 const OUString aPart(o3tl::trim(aToken));
75 aToken.setLength(0);
76
77 if(aPart.getLength())
78 {
79 aParts.push_back(aPart);
80 }
81
82 if(nInitPos == nPos)
83 {
84 OSL_ENSURE(false, "Could not interpret on current position (!)");
85 nPos++;
86 }
87 }
88 }
89 }
90
91 return aParts;
92 }
93} //namespace
94
96 const SvgNode& rCurrent,
97 const OUString& aConcatenated)
98 {
99 const SvgDocument& rDocument = getDocument();
100
101 if(!rDocument.hasGlobalCssStyleAttributes())
102 return;
103
104 const SvgNode* pParent = rCurrent.getParent();
105
106 // check for ID (highest priority)
107 if(rCurrent.getId())
108 {
109 const OUString& rId = *rCurrent.getId();
110
111 if(rId.getLength())
112 {
113 const OUString aNewConcatenated(
114 "#" + rId + aConcatenated);
115 if(pParent)
116 {
117 // check for combined selectors at parent first so that higher specificity will be in front
118 fillCssStyleVectorUsingHierarchyAndSelectors(*pParent, aNewConcatenated);
119 }
120 addCssStyle(rDocument, aNewConcatenated);
121
122 // look further up in the hierarchy
123 if(!aConcatenated.isEmpty() && pParent && pParent->getId())
124 {
125 const OUString& rParentId = pParent->getId().value();
126 addCssStyle(rDocument, "#" + rParentId + aConcatenated);
127 }
128 }
129 }
130
131 std::vector <OUString> aClasses = parseClass(rCurrent);
132 for(const auto &aClass : aClasses)
133 {
134 const OUString aNewConcatenated("." + aClass + aConcatenated);
135 if(pParent)
136 {
137 // check for combined selectors at parent first so that higher specificity will be in front
138 fillCssStyleVectorUsingHierarchyAndSelectors(*pParent, aNewConcatenated);
139 }
140 addCssStyle(rDocument, aNewConcatenated);
141
142 // look further up in the hierarchy
143 if(!aConcatenated.isEmpty() && pParent)
144 {
145 std::vector <OUString> aParentClasses = parseClass(*pParent);
146 for(const auto &aParentClass : aParentClasses)
147 {
148 addCssStyle(rDocument, "." + aParentClass + aConcatenated);
149 }
150 }
151 }
152
153 OUString sCurrentType(SVGTokenToStr(getType()));
154
155 // check for class-dependent references to CssStyles
156 if(sCurrentType.isEmpty())
157 return;
158
159 OUString aNewConcatenated(aConcatenated);
160
161 if(!rCurrent.getId() && !rCurrent.getClass() && 0 == aConcatenated.indexOf(sCurrentType))
162 {
163 // no new CssStyle Selector and already starts with sCurrentType, do not concatenate;
164 // we pass an 'empty' node (in the sense of CssStyle Selector)
165 }
166 else
167 {
168 aNewConcatenated = sCurrentType + aConcatenated;
169 }
170
171 if(pParent)
172 {
173 // check for combined selectors at parent first so that higher specificity will be in front
174 fillCssStyleVectorUsingHierarchyAndSelectors(*pParent, aNewConcatenated);
175 }
176
177 addCssStyle(rDocument, aNewConcatenated);
178
179 // check if there is a css style with element inside element
180 if(pParent)
181 {
182 OUString sParentType(SVGTokenToStr(pParent->getType()));
183 addCssStyle(rDocument, sParentType + sCurrentType);
184 }
185 }
186
188 {
189 const SvgDocument& rDocument = getDocument();
190
191 if(!rDocument.hasGlobalCssStyleAttributes())
192 return;
193
194 const SvgNode* pParent = rCurrent.getParent();
195
196 if (!pParent)
197 return;
198
199 OUString sParentId;
200 if (pParent->getId().has_value())
201 {
202 sParentId = pParent->getId().value();
203 }
204 std::vector <OUString> aParentClasses = parseClass(*pParent);
205 OUString sParentType(SVGTokenToStr(pParent->getType()));
206
207 if(rCurrent.getId())
208 {
209 const OUString& rId = *rCurrent.getId();
210
211 if(!rId.isEmpty())
212 {
213 if (!sParentId.isEmpty())
214 {
215 const OUString aConcatenated("#" + sParentId + ">#" + rId);
216 addCssStyle(rDocument, aConcatenated);
217 }
218
219 for(const auto &aParentClass : aParentClasses)
220 {
221 const OUString aConcatenated("." + aParentClass + ">#" + rId);
222 addCssStyle(rDocument, aConcatenated);
223 }
224
225 if (!sParentType.isEmpty())
226 {
227 const OUString aConcatenated(sParentType + ">#" + rId);
228 addCssStyle(rDocument, aConcatenated);
229 }
230 }
231
232 }
233
234 std::vector <OUString> aClasses = parseClass(rCurrent);
235 for(const auto &aClass : aClasses)
236 {
237
238 if (!sParentId.isEmpty())
239 {
240 const OUString aConcatenated("#" + sParentId + ">." + aClass);
241 addCssStyle(rDocument, aConcatenated);
242 }
243
244 for(const auto &aParentClass : aParentClasses)
245 {
246 const OUString aConcatenated("." + aParentClass + ">." + aClass);
247 addCssStyle(rDocument, aConcatenated);
248 }
249
250 if (!sParentType.isEmpty())
251 {
252 const OUString aConcatenated(sParentType + ">." + aClass);
253 addCssStyle(rDocument, aConcatenated);
254 }
255 }
256
257 OUString sCurrentType(SVGTokenToStr(getType()));
258
259 if(!sCurrentType.isEmpty())
260 {
261 if (!sParentId.isEmpty())
262 {
263 const OUString aConcatenated("#" + sParentId + ">" + sCurrentType);
264 addCssStyle(rDocument, aConcatenated);
265 }
266
267 for(const auto &aParentClass : aParentClasses)
268 {
269 const OUString aConcatenated("." + aParentClass + ">" + sCurrentType);
270 addCssStyle(rDocument, aConcatenated);
271 }
272
273 if (!sParentType.isEmpty())
274 {
275 const OUString aConcatenated(sParentType + ">" + sCurrentType);
276 addCssStyle(rDocument, aConcatenated);
277 }
278 }
279 }
280
282 {
283 OSL_ENSURE(!mbCssStyleVectorBuilt, "OOps, fillCssStyleVector called double ?!?");
285
286 // #i125293# If we have CssStyles we need to build a linked list of SvgStyleAttributes
287 // which represent this for the current object. There are various methods to
288 // specify CssStyles which need to be taken into account in a given order:
289 // - local CssStyle (independent from global CssStyles at SvgDocument)
290 // - 'id' CssStyle
291 // - 'class' CssStyle(s)
292 // - type-dependent elements (e..g. 'rect' for all rect elements)
293 // - Css selector '*'
294 // - local attributes (rOriginal)
295 // - inherited attributes (up the hierarchy)
296 // The first four will be collected in maCssStyleVector for the current element
297 // (once, this will not change) and be linked in the needed order using the
298 // get/setCssStyleParent at the SvgStyleAttributes which will be used preferred in
299 // member evaluation over the existing parent hierarchy
300
301 // check for local CssStyle with highest priority
303 {
304 // if we have one, use as first entry
305 maCssStyleVector.push_back(mpLocalCssStyle.get());
306 }
307
308 // tdf#156038 check for child combinator
310
311 // check the hierarchy for concatenated patterns of Selectors
313
314
315 // tdf#99115, Add css selector '*' style only if the element is on top of the hierarchy
316 // meaning its parent is <svg>
317 const SvgNode* pParent = this->getParent();
318
319 if(pParent && pParent->getType() == SVGToken::Svg)
320 {
321 // #i125329# find Css selector '*', add as last element if found
323
324 if(pNew)
325 {
326 // add CssStyle for selector '*' if found
327 maCssStyleVector.push_back(pNew);
328 }
329 }
330
331 //local attributes
332 maCssStyleVector.push_back(&rOriginal);
333 }
334
336 {
338 {
339 // build needed CssStyleVector for local node
340 const_cast< SvgNode* >(this)->fillCssStyleVector(rOriginal);
341 }
342
343 if(maCssStyleVector.empty())
344 {
345 // return given original if no CssStyles found
346 return &rOriginal;
347 }
348 else
349 {
350 // #i125293# rOriginal will be the last element in the linked list; use no CssStyleParent
351 // there (reset it) to ensure that the parent hierarchy will be used when it's base
352 // is referenced. This new chaining inserts the CssStyles before the original style,
353 // this makes the whole process much safer since the original style when used will
354 // be not different to the situation without CssStyles; thus loops which may be caused
355 // by trying to use the parent hierarchy of the owner of the style will be avoided
356 // already in this mechanism. It's still good to keep the supportsParentStyle
357 // from #i125258# in place, though.
358 // This chain building using pointers will be done every time when checkForCssStyle
359 // is used (not the search, only the chaining). This is needed since the CssStyles
360 // themselves will be potentially used multiple times. It is not expensive since it's
361 // only changing some pointers.
362 // The alternative would be to create the style hierarchy for every element (or even
363 // for the element containing the hierarchy) in a vector of pointers and to use that.
364 // Resetting the CssStyleParent on rOriginal is probably not needed
365 // but simply safer to do.
366
367 // loop over the existing CssStyles and link them. There is a first one, take
368 // as current
369 SvgStyleAttributes* pCurrent = const_cast< SvgStyleAttributes* >(maCssStyleVector[0]);
370
371 for(size_t a(1); a < maCssStyleVector.size(); a++)
372 {
374
375 pCurrent->setCssStyleParent(pNext);
376 pCurrent = pNext;
377 }
378
379 // return 1st CssStyle as style chain start element (only for the
380 // local element, still no hierarchy used here)
381 return maCssStyleVector[0];
382 }
383 }
384
386 SVGToken aType,
387 SvgDocument& rDocument,
388 SvgNode* pParent)
389 : maType(aType),
390 mrDocument(rDocument),
391 mpParent(pParent),
392 mpAlternativeParent(nullptr),
393 maXmlSpace(XmlSpace::NotSet),
394 maDisplay(Display::Inline),
395 mbDecomposing(false),
396 mbCssStyleVectorBuilt(false)
397 {
398 if (pParent)
399 {
400 // tdf#150124 ignore when parent is unknown
401 if (pParent->getType() != SVGToken::Unknown)
402 pParent->maChildren.emplace_back(this);
403 else
405 }
406 }
407
409 {
410 }
411
412 void SvgNode::readLocalCssStyle(std::u16string_view aContent)
413 {
414 if(!mpLocalCssStyle)
415 {
416 // create LocalCssStyle if needed but not yet added
417 mpLocalCssStyle.reset(new SvgStyleAttributes(*this));
418 }
419 else
420 {
421 // 2nd fill would be an error
422 OSL_ENSURE(false, "Svg node has two local CssStyles, this may lead to problems (!)");
423 }
424
426 {
427 // parse and set values to it
428 mpLocalCssStyle->readCssStyle(aContent);
429 }
430 else
431 {
432 OSL_ENSURE(false, "Could not get/create a local CssStyle for a node (!)");
433 }
434 }
435
436 void SvgNode::parseAttributes(const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs)
437 {
438 // no longer need to pre-sort moving 'style' entries to the back so that
439 // values get overwritten - that was the previous, not complete solution for
440 // handling the priorities between svg and Css properties
441 const sal_uInt32 nAttributes(xAttribs->getLength());
442
443 for(sal_uInt32 a(0); a < nAttributes; a++)
444 {
445 const OUString aTokenName(xAttribs->getNameByIndex(a));
446 const SVGToken aSVGToken(StrToSVGToken(aTokenName, false));
447
448 parseAttribute(aTokenName, aSVGToken, xAttribs->getValueByIndex(a));
449 }
450 }
451
452 Display getDisplayFromContent(std::u16string_view aContent)
453 {
454 if(!aContent.empty())
455 {
456 if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"inline"))
457 {
458 return Display::Inline;
459 }
460 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"none"))
461 {
462 return Display::None;
463 }
464 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"inherit"))
465 {
466 return Display::Inherit;
467 }
468 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"block"))
469 {
470 return Display::Block;
471 }
472 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"list-item"))
473 {
474 return Display::ListItem;
475 }
476 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"run-in"))
477 {
478 return Display::RunIn;
479 }
480 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"compact"))
481 {
482 return Display::Compact;
483 }
484 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"marker"))
485 {
486 return Display::Marker;
487 }
488 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"table"))
489 {
490 return Display::Table;
491 }
492 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"inline-table"))
493 {
495 }
496 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"table-row-group"))
497 {
499 }
500 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"table-header-group"))
501 {
503 }
504 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"table-footer-group"))
505 {
507 }
508 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"table-row"))
509 {
510 return Display::TableRow;
511 }
512 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"table-column-group"))
513 {
515 }
516 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"table-column"))
517 {
519 }
520 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"table-cell"))
521 {
522 return Display::TableCell;
523 }
524 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"table-caption"))
525 {
527 }
528 }
529
530 // return the default
531 return Display::Inline;
532 }
533
534 void SvgNode::parseAttribute(const OUString& /*rTokenName*/, SVGToken aSVGToken, const OUString& aContent)
535 {
536 switch(aSVGToken)
537 {
538 case SVGToken::Id:
539 {
540 if(!aContent.isEmpty())
541 {
542 setId(aContent);
543 }
544 break;
545 }
546 case SVGToken::Class:
547 {
548 if(!aContent.isEmpty())
549 {
550 setClass(aContent);
551 }
552 break;
553 }
555 {
556 if(!aContent.isEmpty())
557 {
558 if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"default"))
559 {
561 }
562 else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"preserve"))
563 {
565 }
566 }
567 break;
568 }
570 {
571 if(!aContent.isEmpty())
572 {
574 }
575 break;
576 }
577 default:
578 {
579 break;
580 }
581 }
582 }
583
585 {
586 if (mbDecomposing) //guard against infinite recurse
587 return;
588
590 {
591 return;
592 }
593
594 if(!bReferenced)
595 {
596 if(SVGToken::Defs == getType() ||
599 SVGToken::Mask == getType() ||
602 {
603 // do not decompose defs or symbol nodes (these hold only style-like
604 // objects which may be used by referencing them) except when doing
605 // so controlled referenced
606
607 // also do not decompose ClipPaths and Masks. These should be embedded
608 // in a defs node (which gets not decomposed by itself), but you never
609 // know
610
611 // also not directly used are Markers and Patterns, only indirectly used
612 // by reference
613
614 // #i121656# also do not decompose nodes which have display="none" set
615 // as property
616 return;
617 }
618 }
619
620 const auto& rChildren = getChildren();
621
622 if(rChildren.empty())
623 return;
624
625 mbDecomposing = true;
626
627 const sal_uInt32 nCount(rChildren.size());
628
629 for(sal_uInt32 a(0); a < nCount; a++)
630 {
631 SvgNode* pCandidate = rChildren[a].get();
632
633 if(pCandidate && Display::None != pCandidate->getDisplay())
634 {
635 const auto& rGrandChildren = pCandidate->getChildren();
636 const SvgStyleAttributes* pChildStyles = pCandidate->getSvgStyleAttributes();
637 // decompose:
638 // - visible terminal nodes
639 // - all non-terminal nodes (might contain visible nodes down the hierarchy)
640 if( !rGrandChildren.empty() || ( pChildStyles && (Visibility::visible == pChildStyles->getVisibility())) )
641 {
643 pCandidate->decomposeSvgNode(aNewTarget, bReferenced);
644
645 if(!aNewTarget.empty())
646 {
647 rTarget.append(aNewTarget);
648 }
649 }
650 }
651 else if(!pCandidate)
652 {
653 OSL_ENSURE(false, "Null-Pointer in child node list (!)");
654 }
655 }
656
657 if(!rTarget.empty())
658 {
659 const SvgStyleAttributes* pStyles = getSvgStyleAttributes();
660 if(pStyles)
661 {
662 // check if we have Title or Desc
663 const OUString& rTitle = pStyles->getTitle();
664 const OUString& rDesc = pStyles->getDesc();
665
666 if(!rTitle.isEmpty() || !rDesc.isEmpty())
667 {
668 // default object name is empty
669 OUString aObjectName;
670
671 // use path as object name when outmost element
672 if (SVGToken::Svg == getType())
673 {
674 aObjectName = getDocument().getAbsolutePath();
675
676 if(!aObjectName.isEmpty())
677 {
678 INetURLObject aURL(aObjectName);
679
680 aObjectName = aURL.getName(
682 true,
684 }
685 }
686
687 // pack in ObjectInfoPrimitive2D group
690 std::move(rTarget),
691 aObjectName,
692 rTitle,
693 rDesc));
694
696 }
697 }
698 }
699 mbDecomposing = false;
700 }
701
703 {
704 if(getParent())
705 {
706 return getParent()->getCurrentViewPort();
707 }
708 else
709 {
710 return basegfx::B2DRange(); // return empty B2DRange
711 }
712 }
713
715 {
716 if(getParent())
717 {
718 return getParent()->getCurrentFontSize();
719 }
720 else
721 {
722 return 0.0;
723 }
724 }
725
727 {
730
732 }
733
735 {
736 if(getParent())
737 {
738 return getParent()->getCurrentXHeight();
739 }
740 else
741 {
742 return 0.0;
743 }
744 }
745
747 {
749 // for XHeight, use FontSize currently
751
753 }
754
755 void SvgNode::setId(OUString const & rId)
756 {
757 if(mpId)
758 {
760 mpId.reset();
761 }
762
763 mpId = rId;
765 }
766
767 void SvgNode::setClass(OUString const & rClass)
768 {
769 if(mpClass)
770 {
772 mpClass.reset();
773 }
774
775 mpClass = rClass;
777 }
778
780 {
782 {
783 return maXmlSpace;
784 }
785
786 if(getParent())
787 {
788 return getParent()->getXmlSpace();
789 }
790
791 // default is XmlSpace::Default
792 return XmlSpace::Default;
793 }
794
795 void SvgNode::accept(Visitor & rVisitor)
796 {
797 rVisitor.visit(*this);
798 }
799} // end of namespace svgio
800
801
802/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void removeSvgNodeFromMapper(const OUString &rStr)
Definition: svgdocument.cxx:48
void addSvgNodeToMapper(const OUString &rStr, const SvgNode &rNode)
add/remove nodes with Id to mapper
Definition: svgdocument.cxx:40
const OUString & getAbsolutePath() const
Definition: svgdocument.hxx:77
const SvgStyleAttributes * findGlobalCssStyleAttributes(const OUString &rStr) const
Definition: svgdocument.cxx:78
void addOrphanNode(SvgNode *pOrphan)
invalid nodes that have no parent
Definition: svgdocument.hxx:80
bool hasGlobalCssStyleAttributes() const
find a style by its Id
Definition: svgdocument.hxx:72
void parseAttributes(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs)
style helpers
Definition: svgnode.cxx:436
virtual ~SvgNode() override
Definition: svgnode.cxx:408
virtual bool supportsParentStyle() const
#i125258# tell if this node is allowed to have a parent style (e.g. defs do not)
Definition: svgnode.cxx:32
std::optional< OUString > const & getId() const
Id access.
Definition: svgnode.hxx:170
std::unique_ptr< SvgStyleAttributes > mpLocalCssStyle
possible local CssStyle, e.g. style="fill:red; stroke:red;"
Definition: svgnode.hxx:110
const std::vector< std::unique_ptr< SvgNode > > & getChildren() const
Definition: svgnode.hxx:159
Display getDisplay() const
Display access #i121656#.
Definition: svgnode.hxx:182
virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer &rTarget, bool bReferenced) const
Definition: svgnode.cxx:584
SVGToken getType() const
basic data read access
Definition: svgnode.hxx:156
SvgNode(SVGToken aType, SvgDocument &rDocument, SvgNode *pParent)
Definition: svgnode.cxx:385
void fillCssStyleVectorUsingHierarchyAndSelectors(const SvgNode &rCurrent, const OUString &aConcatenated)
Definition: svgnode.cxx:95
const SvgStyleAttributes * checkForCssStyle(const SvgStyleAttributes &rOriginal) const
helper to evtl. link to css style
Definition: svgnode.cxx:335
void setXmlSpace(XmlSpace eXmlSpace)
Definition: svgnode.hxx:179
std::vector< std::unique_ptr< SvgNode > > maChildren
sub hierarchy
Definition: svgnode.hxx:90
XmlSpace getXmlSpace() const
XmlSpace access.
Definition: svgnode.cxx:779
void setClass(OUString const &)
Definition: svgnode.cxx:767
XmlSpace maXmlSpace
XmlSpace value.
Definition: svgnode.hxx:99
virtual double getCurrentXHeightInherited() const override
return xheight of node inherited from parents
Definition: svgnode.cxx:734
double getCurrentXHeight() const
Definition: svgnode.cxx:746
::std::vector< const SvgStyleAttributes * > maCssStyleVector
Definition: svgnode.hxx:107
const SvgNode * getParent() const
Definition: svgnode.hxx:158
std::optional< OUString > mpId
Id svan value.
Definition: svgnode.hxx:93
std::optional< OUString > mpClass
Class svan value.
Definition: svgnode.hxx:96
void fillCssStyleVector(const SvgStyleAttributes &rOriginal)
helper for filling the CssStyle vector once dependent on mbCssStyleVectorBuilt
Definition: svgnode.cxx:281
virtual double getCurrentFontSizeInherited() const override
return font size of node inherited from parents
Definition: svgnode.cxx:714
std::optional< OUString > const & getClass() const
Class access.
Definition: svgnode.hxx:174
virtual basegfx::B2DRange getCurrentViewPort() const override
InfoProvider support for %, em and ex values.
Definition: svgnode.cxx:702
void fillCssStyleVectorUsingParent(const SvgNode &rCurrent)
Definition: svgnode.cxx:187
SvgDocument & mrDocument
Definition: svgnode.hxx:85
double getCurrentFontSize() const
Definition: svgnode.cxx:726
void addCssStyle(const SvgDocument &rDocument, const OUString &aConcatenated)
Definition: svgnode.cxx:42
virtual void parseAttribute(const OUString &rTokenName, SVGToken aSVGToken, const OUString &aContent)
Definition: svgnode.cxx:534
void accept(Visitor &rVisitor)
Definition: svgnode.cxx:795
void setId(OUString const &)
Definition: svgnode.cxx:755
void readLocalCssStyle(std::u16string_view aContent)
scan helper to read and interpret a local CssStyle to mpLocalCssStyle
Definition: svgnode.cxx:412
virtual const SvgStyleAttributes * getSvgStyleAttributes() const
Definition: svgnode.cxx:37
const SvgDocument & getDocument() const
Definition: svgnode.hxx:157
void setDisplay(Display eDisplay)
Definition: svgnode.hxx:183
double solve(const InfoProvider &rInfoProvider, NumberType aNumberType=NumberType::length) const
Definition: SvgNumber.cxx:69
Visibility getVisibility() const
Visibility.
void setCssStyleParent(const SvgStyleAttributes *pNew)
helper to set mpCssStyleParent temporarily for CSS style hierarchies
virtual void visit(SvgNode const &pNode)=0
int nCount
URL aURL
RegionData_Impl * mpParent
float u
FilterGroup & rTarget
uno_Any a
sal_uInt16 nPos
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
OUString SVGTokenToStr(const SVGToken &rToken)
Definition: svgtoken.cxx:369
void skip_char(std::u16string_view rCandidate, sal_Unicode nChar, sal_Int32 &nPos, const sal_Int32 nLen)
Definition: svgtools.cxx:292
SVGToken StrToSVGToken(const OUString &rStr, bool bCaseIndependent)
Definition: svgtoken.cxx:343
void copyToLimiter(std::u16string_view rCandidate, sal_Unicode nLimiter, sal_Int32 &nPos, OUStringBuffer &rTarget, const sal_Int32 nLen)
Definition: svgtools.cxx:380
Display getDisplayFromContent(std::u16string_view aContent)
Definition: svgnode.cxx:452
sal_Int16 nAttributes
OUString maType