incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1403730 - in /incubator/ooo/trunk/main/svgio: inc/svgio/svgreader/svgstyleattributes.hxx source/svgreader/svgstyleattributes.cxx
Date Tue, 30 Oct 2012 15:05:54 GMT
Author: alg
Date: Tue Oct 30 15:05:53 2012
New Revision: 1403730

URL: http://svn.apache.org/viewvc?rev=1403730&view=rev
Log:
#121221# added boolean state to remember when the StrokeDasharray was set to empty by purpose

Modified:
    incubator/ooo/trunk/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
    incubator/ooo/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx

Modified: incubator/ooo/trunk/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx?rev=1403730&r1=1403729&r2=1403730&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx (original)
+++ incubator/ooo/trunk/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx Tue Oct 30 15:05:53
2012
@@ -206,6 +206,9 @@ namespace svgio
             // vaules for fill, stroke, strokeWidth and others
             bool                        mbIsClipPathContent : 1;
 
+            // #121221# Defines if evtl. an empty array *is* set
+            bool                        mbStrokeDasharraySet : 1;
+
             /// internal helpers
             void add_fillGradient(
                 const basegfx::B2DPolyPolygon& rPath, 
@@ -322,6 +325,10 @@ namespace svgio
             const SvgNumberVector& getStrokeDasharray() const;
             void setStrokeDasharray(const SvgNumberVector& rStrokeDasharray = SvgNumberVector())
{ maStrokeDasharray = rStrokeDasharray; }
 
+            /// #121221# StrokeDasharray needs a set state, it *may* be set to empty by purpose
+            bool getStrokeDasharraySet() const { return mbStrokeDasharraySet; }
+            void setStrokeDasharraySet(bool bNew) { mbStrokeDasharraySet = bNew; }
+
             /// StrokeDashOffset content
             const SvgNumber getStrokeDashOffset() const;
             void setStrokeDashOffset(const SvgNumber& rStrokeDashOffset = SvgNumber())
{ maStrokeDashOffset = rStrokeDashOffset; }

Modified: incubator/ooo/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx?rev=1403730&r1=1403729&r2=1403730&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx (original)
+++ incubator/ooo/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx Tue Oct 30 15:05:53
2012
@@ -1165,7 +1165,8 @@ namespace svgio
             mpMarkerEndXLink(0),
             maFillRule(FillRule_notset),
             maClipRule(FillRule_nonzero),
-            mbIsClipPathContent(SVGTokenClipPathNode == mrOwner.getType())
+            mbIsClipPathContent(SVGTokenClipPathNode == mrOwner.getType()),
+            mbStrokeDasharraySet(false)
         {
             if(!mbIsClipPathContent)
             {
@@ -1272,9 +1273,18 @@ namespace svgio
                 {
                     if(aContent.getLength())
                     {
+                        static rtl::OUString aStrNone(rtl::OUString::createFromAscii("none"));
                         SvgNumberVector aVector;
 
-                        if(readSvgNumberVector(aContent, aVector))
+                        if(aContent.match(aStrNone))
+                        {
+                            // #121221# The special value 'none' needs to be handled
+                            // in the sense that *when* it is set, the parent shall not
+                            // be used. Before this was only dependent on the array being
+                            // empty
+                            setStrokeDasharraySet(true);
+                        }
+                        else if(readSvgNumberVector(aContent, aVector))
                         {
                             setStrokeDasharray(aVector);
                         }
@@ -2029,7 +2039,12 @@ namespace svgio
             {
                 return maStrokeDasharray;
             }
-            
+            else if(getStrokeDasharraySet())
+            {
+                // #121221# is set to empty *by purpose*, do not visit parent styles
+                return maStrokeDasharray;
+            }
+
             const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle();
 
             if(pSvgStyleAttributes)



Mime
View raw message