diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-13 16:23:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-13 17:30:58 +0200 |
commit | 304b16c3bf6fba2fa28e723d1cb58157201b5c1f (patch) | |
tree | 2d4d7d686f6ac27e00df13f66e68992a28ec8a2c /svgio/source | |
parent | d15d3d92a7297a57fafd9ed11c959bb8ec322b3a (diff) |
Resolves: tdf#108903 avoid recurse to death
Change-Id: Iadde719a024c5fce97aa0f4c58947a5012639a84
Reviewed-on: https://gerrit.libreoffice.org/39918
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svgio/source')
-rw-r--r-- | svgio/source/svgreader/svgusenode.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/svgio/source/svgreader/svgusenode.cxx b/svgio/source/svgreader/svgusenode.cxx index 104eb727bfed..bcde39f53e4a 100644 --- a/svgio/source/svgreader/svgusenode.cxx +++ b/svgio/source/svgreader/svgusenode.cxx @@ -35,7 +35,8 @@ namespace svgio maY(), maWidth(), maHeight(), - maXLink() + maXLink(), + mbDecomposingSvgNode(false) { } @@ -142,7 +143,7 @@ namespace svgio // try to access link to content const SvgNode* pXLink = getDocument().findSvgNodeById(maXLink); - if(pXLink && Display_none != pXLink->getDisplay()) + if (pXLink && Display_none != pXLink->getDisplay() && !mbDecomposingSvgNode) { // decompose children drawinglayer::primitive2d::Primitive2DContainer aNewTarget; @@ -150,9 +151,11 @@ namespace svgio // 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 = true; if(!aNewTarget.empty()) { |