diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-06-26 18:43:54 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-06-26 18:54:33 +0200 |
commit | a59b055d29d54d62ec52aaa43341a65303322d7c (patch) | |
tree | f8733aee816d4e31b2706b0a1b5177fd59c9960e /oox | |
parent | 0a686a9bb54b5c1b3a45810e2601a098c0272c33 (diff) |
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
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 2dc40c46605c..358fe16f4461 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 ); } |