diff options
author | Armin Le Grand <alg@apache.org> | 2013-10-30 11:22:20 +0000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-02-05 22:23:54 +0100 |
commit | 8335b5b2c930cd2336973d73506128e8ae5b3850 (patch) | |
tree | 8a799fe8c215fb272bbed8b18a550dd6ace1eb35 | |
parent | 24c01fae1c9ad1ced40f29660468f4464ce35e26 (diff) |
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@redhat.com>
-rw-r--r-- | svgio/source/svgreader/svgnode.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx index 262ec5645f77..f1e7ea81a2f9 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( |