summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-06-12 16:01:00 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-06-19 10:56:13 +0200
commit666482ebbd1f459bf8ace91c9374590b1bfaa978 (patch)
tree386f7b724fbe231bae7649b5e21432162433e3ba
parentf2100b09abdf7893104f23f33cf77cc0848b55cb (diff)
n#779642: 0 width or height in //v:shape[@style] produces weird results
(cherry picked from commit b7144acb2bfa369fb89146d060dbd8ddd547f4c1) Conflicts: oox/source/vml/vmlshape.cxx Change-Id: I37ba59dd54ac692f234f3228e442799c5a5f450b (cherry picked from commit 3ad1d411f658b0c2bc8e318aebb999ab75675327)
-rw-r--r--oox/source/vml/vmlshape.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 32ab75672679..bf4218632d4e 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -192,11 +192,18 @@ awt::Rectangle ShapeType::getAbsRectangle() const
awt::Rectangle ShapeType::getRelRectangle() const
{
+ sal_Int32 nWidth = maTypeModel.maWidth.toInt32();
+ if ( nWidth == 0 )
+ nWidth = 1;
+
+ sal_Int32 nHeight = maTypeModel.maHeight.toInt32();
+ if ( nHeight == 0 )
+ nHeight = 1;
+
return awt::Rectangle(
maTypeModel.maLeft.toInt32(),
maTypeModel.maTop.toInt32(),
- maTypeModel.maWidth.toInt32(),
- maTypeModel.maHeight.toInt32() );
+ nWidth, nHeight );
}
// ============================================================================