diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-03-25 17:38:20 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-03-26 11:14:58 +0100 |
commit | 11d344f6271e4171f8006c2cb29372f612cbdc00 (patch) | |
tree | d85f1699c24abe7537d019eb3df0ec36d4065fcc /oox | |
parent | 9436ab24a7d08540a7c192df86956d53673c9a08 (diff) |
tdf#122717: fix handling of zero width/height lines
The code was introduced in 627c2469843c9461b665c4571f1214aca7fc36a4
< tdf#96674 drawingML import: fix handling of zero width/height lines >
and later on removed by 36bade04d3780bc54c51b46bb0b63e69789658a5
< tdf106792 Get rid of SvxShapePolyPolygonBezier > with the comment
"I doubt that the additional code to make a line not exactly hor/ver is needed.
Checked and it is not needed, thus removed the change from
tdf#96674 in shape.cxx."
it turned out, it's still needed
Change-Id: Ib64ee17227e3e588e94381abeabe5a2ff2e0b7d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113102
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 3e4eb070787d4d44b3bdc95046e5b231dbbef42b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113119
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index ffa7fb017aca..09dbab93850e 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -848,10 +848,17 @@ Reference< XShape > const & Shape::createAndInsert( uno::Reference<lang::XServiceInfo> xModelInfo(rFilterBase.getModel(), uno::UNO_QUERY); for( i = 0; i < nNumPoints; ++i ) { - const basegfx::B2DPoint aPoint( aPoly.getB2DPoint( i ) ); + basegfx::B2DPoint aPoint( aPoly.getB2DPoint( i ) ); - // tdf#106792 Not needed anymore due to the change in SdrPathObj::NbcResize: - // tdf#96674: Guard against zero width or height. + // 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.getY() == 0) + aPoint.setY(aPoint.getY() + 1); + } pPoints[i] = awt::Point(static_cast<sal_Int32>(aPoint.getX()), static_cast<sal_Int32>(aPoint.getY())); } |