From 36bade04d3780bc54c51b46bb0b63e69789658a5 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Thu, 28 Jun 2018 19:48:59 +0200 Subject: tdf106792 Get rid of SvxShapePolyPolygonBezier SvxShapePolyPolygonBezier was an implementation for the UNO Shape group of polygons with bezier parts (filled/unfilled/ closed/open), e.g. com.sun.star.drawing.OpenBezierShape. It was differing from SvxShapePolyPolygon just by supporting drawing::PolyPolygonBezierCoords instead of the simple drawing::PointSequenceSequence and some details. This leads to problems - the ShapeType *does change* e.g. when you edit a non-bezier Shape in Draw/Impress and change parts to curve (also when closing, see ShapeTypes above). This is why SvxShape::getShapeType() already detects this identifier by using thze internal ShapePolyType (e.g. OBJ_PATHLINE). So there is no reason to have two separate UNO API imple- mentations for sthe same type of SvxShape at all. Get rid of the extra one and unify this implementation detail. Also cleaned up double basegfx tooling for conversions of UNO API Poly/bezier data and B2DPolygon. Adapted test for "tdf113946.docx", see comment there. Adapted test for "tdf90097.rtf", see comment there. Also needed to use the Linux values, also check comment there. Adapted test for "tdf105127.docx", see comment there. Adapted test for "tdf85232.docx", see comment there. Had to fic a problem with test for "tdf96674.docx"- the adaption of the RotateAngle for line objects goes havoc together with the UNO API when scaling is involved. That old aGeo rotate stuff just kills the existing rotation due to numerical inprecise stuff. The UNP API - in trying not just to apply a rptation, but manipulate the existing one then goes wrong in not re-getting the current rotation value anymore. ARGH! This is the original reason for the ols tdf#96674 task - 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. Change-Id: I2bb8d4cfe33fee3671f3dad60e5c18609a394f9d Reviewed-on: https://gerrit.libreoffice.org/56614 Tested-by: Jenkins Reviewed-by: Armin Le Grand --- oox/source/drawingml/shape.cxx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'oox') diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 3aac4273fc4c..5c2e44a38fa3 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -579,17 +579,10 @@ Reference< XShape > const & Shape::createAndInsert( bool bIsWriter = xModelInfo->supportsService("com.sun.star.text.TextDocument"); for( i = 0; i < nNumPoints; ++i ) { - basegfx::B2DPoint aPoint( aPoly.getB2DPoint( i ) ); + const 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.getY() == 0) - aPoint.setY(aPoint.getY() + 1); - } + // tdf#106792 Not needed anymore due to the change in SdrPathObj::NbcResize: + // tdf#96674: Guard against zero width or height. if (bIsWriter && bInGroup) // Writer's draw page is in twips, and these points get passed -- cgit