summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-10-30 11:22:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-11-05 14:54:25 +0000
commit8b2fb0e153fa846a171105b7801c398ffbe3d595 (patch)
tree17f75d6fce051bd2cd9e1db97cf5efa866390dbc /svgio
parentdc30cdbc8d5e7772281511188ba2d2a7c4c8af51 (diff)
Resolves: #i123510# changed priority in style preparation
(cherry picked from commit 86459550d81c3eae067e89d9af1b6e872215a588) Change-Id: Ia567666cd76dce646479003a830d969f4962da71
Diffstat (limited to 'svgio')
-rw-r--r--svgio/source/svgreader/svgnode.cxx23
1 files changed, 11 insertions, 12 deletions
diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx
index d25f6daf3dbe..8e8f83d345a2 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(