diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-04-11 01:57:47 +0200 |
---|---|---|
committer | Xisco Faulí <anistenis@gmail.com> | 2016-04-12 12:13:25 +0000 |
commit | afe7392f88d8aa42f20a62788a14a132617f6602 (patch) | |
tree | c4626175b039be9a50155deff1380d5054b70d6f /svgio/source | |
parent | 31bddb874d2be54b81cdd7ea142b58db18e11a5b (diff) |
SVG: Clean up this code a litle bit
Change-Id: Ib941321d43a9a04d57f3c7c4a55528927fed5036
Reviewed-on: https://gerrit.libreoffice.org/24009
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
Diffstat (limited to 'svgio/source')
-rw-r--r-- | svgio/source/svgreader/svgnode.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
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]; |