summaryrefslogtreecommitdiffstats
path: root/oox
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-12 16:45:19 +0200
commit3d5fb88cc0aa8ee6be6cec5ce0255f1412368519 (patch)
tree0012bc220f6ceae11e9126f83a3ac5d1ce49fae0 /oox
parentRelated: #i122453# Initialize and update units of PosSize panel spin fields (diff)
downloadcore-3d5fb88cc0aa8ee6be6cec5ce0255f1412368519.tar.gz
core-3d5fb88cc0aa8ee6be6cec5ce0255f1412368519.zip
n#779642: 0 width or height in //v:shape[@style] produces weird results
Change-Id: I37ba59dd54ac692f234f3228e442799c5a5f450b
Diffstat (limited to 'oox')
-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 35ad93d04731..92a026e47ada 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -189,11 +189,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 );
}
// ============================================================================