[Libreoffice-commits] core.git: oox/source

Luboš Luňák l.lunak at suse.cz
Wed Jun 26 09:54:56 PDT 2013


 oox/source/vml/vmlshape.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit a59b055d29d54d62ec52aaa43341a65303322d7c
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Wed Jun 26 18:43:54 2013 +0200

    handle v:shape having coordsize with 0 (part of bnc#780044)
    
    There's a document which has coordsize="6094,0" path="m444,424r6094,e" ,
    where the 0 is somewhat questionable (and the spec doesn't seem to say
    anything about it), but given it's a horizontal line, vertical coordinate
    space size shouldn't matter, so treat it as 1, making the space visible
    and avoiding division by 0 in our code.
    
    Change-Id: I53725cd73a699b8e6d3c96e8fc39c276d082bc0c

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 2dc40c4..358fe16 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -154,6 +154,10 @@ awt::Rectangle ShapeType::getCoordSystem() const
 {
     Int32Pair aCoordPos = maTypeModel.moCoordPos.get( Int32Pair( 0, 0 ) );
     Int32Pair aCoordSize = maTypeModel.moCoordSize.get( Int32Pair( 1000, 1000 ) );
+    if( aCoordSize.first == 0 )
+        aCoordSize.first = 1;
+    if( aCoordSize.second == 0 )
+        aCoordSize.second = 1;
     return awt::Rectangle( aCoordPos.first, aCoordPos.second, aCoordSize.first, aCoordSize.second );
 }
 


More information about the Libreoffice-commits mailing list