diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-05 09:08:21 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-05 10:05:58 +0100 |
commit | 627c2469843c9461b665c4571f1214aca7fc36a4 (patch) | |
tree | 5394782ae6aab87c3055a186408a67db64879fd1 /oox | |
parent | f44bd6b0547c99b324e1a3f196c2296294e27b3c (diff) |
tdf#96674 drawingML import: fix handling of zero width/height lines
Change-Id: If3d9f6272031e08ab228cfa58963d60ceede2498
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 13 |
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 |