summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/shape.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source/drawingml/shape.cxx')
-rw-r--r--oox/source/drawingml/shape.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 6f8475978a2b..2dc84e94052d 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -510,7 +510,18 @@ Reference< XShape > Shape::createAndInsert(
bool bIsWriter = xModelInfo->supportsService("com.sun.star.text.TextDocument");
for( i = 0; i < nNumPoints; ++i )
{
- const ::basegfx::B2DPoint aPoint( aPoly.getB2DPoint( i ) );
+ basegfx::B2DPoint aPoint( aPoly.getB2DPoint( i ) );
+
+ // Guard against zero width or height.
+ if (i)
+ {
+ const basegfx::B2DPoint& rPreviousPoint = aPoly.getB2DPoint(i - 1);
+ if (aPoint.getX() - rPreviousPoint.getX() == 0)
+ aPoint.setX(aPoint.getX() + 1);
+ if (aPoint.getY() - rPreviousPoint.getX() == 0)
+ aPoint.setY(aPoint.getY() + 1);
+ }
+
if (bIsWriter && bInGroup)
// Writer's draw page is in twips, and these points get passed
// to core without any unit conversion when Writer