[Libreoffice-commits] .: Branch 'libreoffice-3-5' - basegfx/source

Petr Mladek pmladek at kemper.freedesktop.org
Wed May 23 07:35:08 PDT 2012


 basegfx/source/polygon/b2dsvgpolypolygon.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit de4b790fa928f92bf40b2e2b2c2acb622f9ebd8b
Author: Chr. Rossmanith <ChrRossmanith at gmx.de>
Date:   Tue May 15 22:11:38 2012 +0200

    fdo#48068 fix parsing of path d-attribute
    
    Change-Id: I43a5f69a30b3766303e049ba4d66c4fd79b9de30
    Signed-off-by: Petr Mladek <pmladek at suse.cz>

diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index fa9e184..238a283 100644
--- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
@@ -67,7 +67,8 @@ namespace basegfx
             {
                 const bool bPredicate( (sal_Unicode('0') <= aChar && sal_Unicode('9') >= aChar)
                                        || (bSignAllowed && sal_Unicode('+') == aChar)
-                                       || (bSignAllowed && sal_Unicode('-') == aChar) );
+                                       || (bSignAllowed && sal_Unicode('-') == aChar)
+                                       || (sal_Unicode('.') == aChar) );
 
                 return bPredicate;
             }
@@ -85,6 +86,7 @@ namespace basegfx
             {
                 sal_Unicode aChar( rStr[io_rPos] );
                 ::rtl::OUStringBuffer sNumberString;
+                bool separator_seen=false;
 
                 if(sal_Unicode('+') == aChar || sal_Unicode('-') == aChar)
                 {
@@ -93,8 +95,9 @@ namespace basegfx
                 }
 
                 while((sal_Unicode('0') <= aChar && sal_Unicode('9') >= aChar)
-                      || sal_Unicode('.') == aChar)
+                      || (!separator_seen && sal_Unicode('.') == aChar))
                 {
+                    if (sal_Unicode('.') == aChar) separator_seen = true;
                     sNumberString.append(rStr[io_rPos]);
                     aChar = rStr[++io_rPos];
                 }


More information about the Libreoffice-commits mailing list