summaryrefslogtreecommitdiff
path: root/svgio/source/svgreader/svggnode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svgio/source/svgreader/svggnode.cxx')
-rw-r--r--svgio/source/svgreader/svggnode.cxx48
1 files changed, 30 insertions, 18 deletions
diff --git a/svgio/source/svgreader/svggnode.cxx b/svgio/source/svgreader/svggnode.cxx
index 45fa6a31ec53..c3957c729fa9 100644
--- a/svgio/source/svgreader/svggnode.cxx
+++ b/svgio/source/svgreader/svggnode.cxx
@@ -43,13 +43,16 @@ namespace svgio
const SvgStyleAttributes* SvgGNode::getSvgStyleAttributes() const
{
- const SvgStyleAttributes* aCheckCssStyle = checkForCssStyle(OUString("g"), maSvgStyleAttributes);
- const SvgStyleAttributes* aGetCssStyleParent = maSvgStyleAttributes.getCssStyleParent();
-
- if (aGetCssStyleParent == NULL)
- return aCheckCssStyle;
-
- return aGetCssStyleParent;
+ if (SVGTokenDefs == getType())
+ {
+ // #i125258# call parent for SVGTokenDefs
+ return SvgNode::getSvgStyleAttributes();
+ }
+ else
+ {
+ // #i125258# for SVGTokenG take CssStyles into account
+ return checkForCssStyle(OUString("g"), maSvgStyleAttributes);
+ }
}
void SvgGNode::parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent)
@@ -87,22 +90,31 @@ namespace svgio
void SvgGNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
- const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
-
- if(pStyle)
+ if(SVGTokenDefs == getType())
+ {
+ // #i125258# no decompose needed for defs element, call parent for SVGTokenDefs
+ SvgNode::decomposeSvgNode(rTarget, bReferenced);
+ }
+ else
{
- const double fOpacity(pStyle->getOpacity().getNumber());
+ // #i125258# for SVGTokenG decompose childs
+ const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
- if(fOpacity > 0.0 && Display_none != getDisplay())
+ if(pStyle)
{
- drawinglayer::primitive2d::Primitive2DSequence aContent;
+ const double fOpacity(pStyle->getOpacity().getNumber());
- // decompose children
- SvgNode::decomposeSvgNode(aContent, bReferenced);
-
- if(aContent.hasElements())
+ if(fOpacity > 0.0 && Display_none != getDisplay())
{
- pStyle->add_postProcess(rTarget, aContent, getTransform());
+ drawinglayer::primitive2d::Primitive2DSequence aContent;
+
+ // decompose children
+ SvgNode::decomposeSvgNode(aContent, bReferenced);
+
+ if(aContent.hasElements())
+ {
+ pStyle->add_postProcess(rTarget, aContent, getTransform());
+ }
}
}
}