diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-05 09:08:21 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-01-08 20:27:37 +0000 |
commit | 9be39a75053be54214efd1fc4c2811913659c30e (patch) | |
tree | 5a34033c91d600575a5b0bc420e69953723fd3b7 /oox | |
parent | 19131619fdcb44267b1f12722e5c7154990dc303 (diff) |
tdf#96674 drawingML import: fix handling of zero width/height lines
(cherry picked from commit 627c2469843c9461b665c4571f1214aca7fc36a4)
Change-Id: If3d9f6272031e08ab228cfa58963d60ceede2498
Reviewed-on: https://gerrit.libreoffice.org/21115
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
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 |