From 2dbd2cb9a55c90f4f3db3a781526cc2246d0bdd7 Mon Sep 17 00:00:00 2001 From: Joren De Cuyper Date: Tue, 15 Jul 2014 13:52:10 +0200 Subject: Avoid infinite loop when gathering "g" element styles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same way of how fdo#74743 is fixed 3b7472b284131c09d91b69f26d5d26d54648f939 Change-Id: If6cc8eb6ff89b0081f27ff75a9b60a3e81cff1bd Reviewed-on: https://gerrit.libreoffice.org/10326 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl --- svgio/source/svgreader/svggnode.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'svgio/source/svgreader') diff --git a/svgio/source/svgreader/svggnode.cxx b/svgio/source/svgreader/svggnode.cxx index 82d3d5d124f2..45fa6a31ec53 100644 --- a/svgio/source/svgreader/svggnode.cxx +++ b/svgio/source/svgreader/svggnode.cxx @@ -43,7 +43,13 @@ namespace svgio const SvgStyleAttributes* SvgGNode::getSvgStyleAttributes() const { - return checkForCssStyle(OUString("g"), maSvgStyleAttributes); + const SvgStyleAttributes* aCheckCssStyle = checkForCssStyle(OUString("g"), maSvgStyleAttributes); + const SvgStyleAttributes* aGetCssStyleParent = maSvgStyleAttributes.getCssStyleParent(); + + if (aGetCssStyleParent == NULL) + return aCheckCssStyle; + + return aGetCssStyleParent; } void SvgGNode::parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) -- cgit