diff options
-rw-r--r-- | svgio/inc/svgio/svgreader/svgnode.hxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgnode.cxx | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/svgio/inc/svgio/svgreader/svgnode.hxx b/svgio/inc/svgio/svgreader/svgnode.hxx index 3ad7b0f3423d..0184f29d4136 100644 --- a/svgio/inc/svgio/svgreader/svgnode.hxx +++ b/svgio/inc/svgio/svgreader/svgnode.hxx @@ -123,7 +123,7 @@ namespace svgio const SvgStyleAttributes* checkForCssStyle(const OUString& rClassStr, const SvgStyleAttributes& rOriginal) const; /// helper for filling the CssStyle vector once dependent on mbCssStyleVectorBuilt - void fillCssStyleVector(const OUString& rClassStr); + void fillCssStyleVector(const OUString& rClassStr, const SvgStyleAttributes& rOriginal); void fillCssStyleVectorUsingHierarchyAndSelectors( const OUString& rClassStr, const SvgNode& rCurrent, diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx index b1de51d263fa..c9bd15adbdf1 100644 --- a/svgio/source/svgreader/svgnode.cxx +++ b/svgio/source/svgreader/svgnode.cxx @@ -162,7 +162,7 @@ namespace svgio } } - void SvgNode::fillCssStyleVector(const OUString& rClassStr) + void SvgNode::fillCssStyleVector(const OUString& rClassStr, const SvgStyleAttributes& rOriginal) { OSL_ENSURE(!mbCssStyleVectorBuilt, "OOps, fillCssStyleVector called double ?!?"); mbCssStyleVectorBuilt = true; @@ -199,6 +199,9 @@ namespace svgio // add CssStyle for selector '*' if found maCssStyleVector.push_back(pNew); } + + //local attributes + maCssStyleVector.push_back(&rOriginal); } const SvgStyleAttributes* SvgNode::checkForCssStyle(const OUString& rClassStr, const SvgStyleAttributes& rOriginal) const @@ -206,7 +209,7 @@ namespace svgio if(!mbCssStyleVectorBuilt) { // build needed CssStyleVector for local node - const_cast< SvgNode* >(this)->fillCssStyleVector(rClassStr); + const_cast< SvgNode* >(this)->fillCssStyleVector(rClassStr, rOriginal); } if(maCssStyleVector.empty()) @@ -232,7 +235,6 @@ namespace svgio // for the element containing the hierarchy) in a vector of pointers and to use that. // Resetting the CssStyleParent on rOriginal is probably not needed // but simply safer to do. - const_cast< SvgStyleAttributes& >(rOriginal).setCssStyleParent(nullptr); // loop over the existing CssStyles and link them. There is a first one, take // as current @@ -246,9 +248,6 @@ namespace svgio pCurrent = pNext; } - // pCurrent is the last used CssStyle, let it point to the original style - pCurrent->setCssStyleParent(&rOriginal); - // return 1st CssStyle as style chain start element (only for the // local element, still no hierarchy used here) return maCssStyleVector[0]; |