[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - svgio/source
Armin Le Grand
alg at apache.org
Wed Feb 5 13:45:47 PST 2014
svgio/source/svgreader/svgnode.cxx | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
New commits:
commit 8335b5b2c930cd2336973d73506128e8ae5b3850
Author: Armin Le Grand <alg at apache.org>
Date: Wed Oct 30 11:22:20 2013 +0000
Resolves: fdo#69271 i#123510 changed priority in style preparation
(cherry picked from commit 86459550d81c3eae067e89d9af1b6e872215a588)
(cherry picked from commit 8b2fb0e153fa846a171105b7801c398ffbe3d595)
Change-Id: Ia567666cd76dce646479003a830d969f4962da71
Signed-off-by: Michael Stahl <mstahl at redhat.com>
diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx
index 262ec56..f1e7ea8 100644
--- a/svgio/source/svgreader/svgnode.cxx
+++ b/svgio/source/svgreader/svgnode.cxx
@@ -106,14 +106,12 @@ namespace svgio
}
}
- if(maCssStyleVector.empty())
+ if(!maCssStyleVector.empty())
{
- return &rOriginal;
- }
- else
- {
- // set CssStyleParent at maCssStyleVector members to hang them in front of
- // the existing style. Build a style chain, reset parent of original for security.
+ // #i123510# if CSS styles were found, create a linked list with rOriginal as parent
+ // and all CSS styles as linked children, so that the style attribute has
+ // priority over the CSS style. If there is no style attribute this means that
+ // no values are set at rOriginal, thus it is still correct to have that order.
// Repeated style requests should only be issued from sub-Text nodes and I'm not
// sure if in-between text nodes may build other chains (should not happen). But
// it's only a re-chaining with pointers (cheap), so allow to do it every time.
@@ -122,14 +120,15 @@ namespace svgio
for(sal_uInt32 a(0); a < maCssStyleVector.size(); a++)
{
- SvgStyleAttributes* pCandidate = const_cast< SvgStyleAttributes* >(maCssStyleVector[maCssStyleVector.size() - a - 1]);
+ SvgStyleAttributes* pNext = const_cast< SvgStyleAttributes* >(maCssStyleVector[a]);
- pCandidate->setCssStyleParent(pCurrent);
- pCurrent = pCandidate;
+ pCurrent->setCssStyleParent(pNext);
+ pCurrent = pNext;
+ pCurrent->setCssStyleParent(0);
}
-
- return pCurrent;
}
+
+ return &rOriginal;
}
SvgNode::SvgNode(
More information about the Libreoffice-commits
mailing list