diff options
Diffstat (limited to 'svgio/source/svgreader/svgusenode.cxx')
-rw-r--r-- | svgio/source/svgreader/svgusenode.cxx | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/svgio/source/svgreader/svgusenode.cxx b/svgio/source/svgreader/svgusenode.cxx index 5904a143068a..a54c9fb46c3e 100644 --- a/svgio/source/svgreader/svgusenode.cxx +++ b/svgio/source/svgreader/svgusenode.cxx @@ -142,50 +142,50 @@ namespace svgio // try to access link to content const SvgNode* pXLink = getDocument().findSvgNodeById(maXLink); - if (pXLink && Display_none != pXLink->getDisplay() && !mbDecomposingSvgNode) - { - // decompose children - drawinglayer::primitive2d::Primitive2DContainer aNewTarget; - - // todo: in case mpXLink is a SVGTokenSvg or SVGTokenSymbol the - // SVG docs want the getWidth() and getHeight() from this node - // to be valid for the subtree. - mbDecomposingSvgNode = true; - const_cast< SvgNode* >(pXLink)->setAlternativeParent(this); - pXLink->decomposeSvgNode(aNewTarget, true); - const_cast< SvgNode* >(pXLink)->setAlternativeParent(); - mbDecomposingSvgNode = false; - - if(!aNewTarget.empty()) - { - basegfx::B2DHomMatrix aTransform; + if (!(pXLink && Display_none != pXLink->getDisplay() && !mbDecomposingSvgNode)) + return; - if(getX().isSet() || getY().isSet()) - { - aTransform.translate( - getX().solve(*this, xcoordinate), - getY().solve(*this, ycoordinate)); - } + // decompose children + drawinglayer::primitive2d::Primitive2DContainer aNewTarget; - if(getTransform()) - { - aTransform = *getTransform() * aTransform; - } + // todo: in case mpXLink is a SVGTokenSvg or SVGTokenSymbol the + // SVG docs want the getWidth() and getHeight() from this node + // to be valid for the subtree. + mbDecomposingSvgNode = true; + const_cast< SvgNode* >(pXLink)->setAlternativeParent(this); + pXLink->decomposeSvgNode(aNewTarget, true); + const_cast< SvgNode* >(pXLink)->setAlternativeParent(); + mbDecomposingSvgNode = false; - if(!aTransform.isIdentity()) - { - const drawinglayer::primitive2d::Primitive2DReference xRef( - new drawinglayer::primitive2d::TransformPrimitive2D( - aTransform, - aNewTarget)); + if(aNewTarget.empty()) + return; - rTarget.push_back(xRef); - } - else - { - rTarget.append(aNewTarget); - } - } + basegfx::B2DHomMatrix aTransform; + + if(getX().isSet() || getY().isSet()) + { + aTransform.translate( + getX().solve(*this, xcoordinate), + getY().solve(*this, ycoordinate)); + } + + if(getTransform()) + { + aTransform = *getTransform() * aTransform; + } + + if(!aTransform.isIdentity()) + { + const drawinglayer::primitive2d::Primitive2DReference xRef( + new drawinglayer::primitive2d::TransformPrimitive2D( + aTransform, + aNewTarget)); + + rTarget.push_back(xRef); + } + else + { + rTarget.append(aNewTarget); } } |