filter/source/svg/svgwriter.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 877b605bf519f20179e5de1beb5bb16cd431aa89
Author: Marco Cecchetti <marco.cecche...@collabora.com>
Date:   Mon May 22 12:57:38 2017 +0200

    tdf#107998 - svg export: shapes are uncorrect both in Draw and Impress
    
    Start Draw, draw a rectangle, export it to a SVG document.
    
    Open the SVG document with a browser or Inkscape: instead of a
    rectangle, you will see a self-crossing polygon.
    
    This issue is due to a clean up commit
    (9d8c206ee4a5c130e11a4e786b4286f3362f9ca1) about string concatenation
    which has not taken into account that operations are performed from
    right to left.
    
    Change-Id: Ib1c0d872b6bd95abe98bb5e22ef69f6b2d5c163b
    Reviewed-on: https://gerrit.libreoffice.org/37899
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 93329daf02f9..c9a9115bb509 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1816,8 +1816,9 @@ OUString SVGActionWriter::GetPathString( const 
tools::PolyPolygon& rPolyPoly, bo
 
         if( nSize > 1 )
         {
+            aPolyPoint = rPoly[ 0 ];
             aPathData += "M "
-                        + OUString::number( ( aPolyPoint = rPoly[ 0 ] ).X() )
+                        + OUString::number( aPolyPoint.X() )
                         + aComma
                         + OUString::number( aPolyPoint.Y() );
 
@@ -1838,7 +1839,9 @@ OUString SVGActionWriter::GetPathString( const 
tools::PolyPolygon& rPolyPoly, bo
                     {
                         if ( j )
                             aPathData += aBlank;
-                        aPathData += OUString::number( ( aPolyPoint = rPoly[ 
n++ ] ).X() )
+
+                        aPolyPoint = rPoly[ n++ ];
+                        aPathData += OUString::number( aPolyPoint.X() )
                                     + aComma
                                     + OUString::number( aPolyPoint.Y() );
                     }
@@ -1850,7 +1853,9 @@ OUString SVGActionWriter::GetPathString( const 
tools::PolyPolygon& rPolyPoly, bo
                         nCurrentMode = 'L';
                         aPathData += "L ";
                     }
-                    aPathData += OUString::number( ( aPolyPoint = rPoly[ n++ ] 
).X() )
+
+                    aPolyPoint = rPoly[ n++ ];
+                    aPathData += OUString::number( aPolyPoint.X() )
                                 + aComma
                                 + OUString::number( aPolyPoint.Y() );
                 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to