You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/10/30 12:22:21 UTC

svn commit: r1537044 - /openoffice/trunk/main/svgio/source/svgreader/svgnode.cxx

Author: alg
Date: Wed Oct 30 11:22:20 2013
New Revision: 1537044

URL: http://svn.apache.org/r1537044
Log:
i123510 changed priority in style preparation

Modified:
    openoffice/trunk/main/svgio/source/svgreader/svgnode.cxx

Modified: openoffice/trunk/main/svgio/source/svgreader/svgnode.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svgio/source/svgreader/svgnode.cxx?rev=1537044&r1=1537043&r2=1537044&view=diff
==============================================================================
--- openoffice/trunk/main/svgio/source/svgreader/svgnode.cxx (original)
+++ openoffice/trunk/main/svgio/source/svgreader/svgnode.cxx Wed Oct 30 11:22:20 2013
@@ -112,14 +112,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.
+                // #123510# 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.
@@ -128,14 +126,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(