From d1027af3c74529827d53e8cf7b0d42a0ee47d1ba Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Fri, 23 Feb 2018 16:57:41 +0100 Subject: OperationSmiley: Added support for using same FillGeometry It is now possible to use a single FillGeometry to fill objects that are made of multiple filled objects (e.g. CustomShapes) so that they look as using a single fill. This is used for CustomShapes, but may later be 'extended' to be used for more cases. The basic functionality was already in the primitives, but had to be added to SDrObject due to these being used for CustomShapeVisualization (currently - would be better to change this to primitives, too). Change-Id: I1d9fb158191a9ec663e46f3911213be2f3d88986 --- svx/source/customshapes/EnhancedCustomShape2d.cxx | 26 +++++++++-------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'svx/source/customshapes/EnhancedCustomShape2d.cxx') diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index b50836fd138f..39d694b112a8 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -1963,22 +1963,6 @@ void EnhancedCustomShape2d::CreateSubPath( if(aNewB2DPolyPolygon.count()) { - if( !bLineGeometryNeededOnly ) - { - // hack aNewB2DPolyPolygon to fill logic rect - this is - // needed to produce gradient fills that look like mso - aNewB2DPolygon.clear(); - aNewB2DPolygon.append(basegfx::B2DPoint(0,0)); - aNewB2DPolygon.setClosed(true); - aNewB2DPolyPolygon.append(aNewB2DPolygon); - - aNewB2DPolygon.clear(); - aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(), - aLogicRect.GetHeight())); - aNewB2DPolygon.setClosed(true); - aNewB2DPolyPolygon.append(aNewB2DPolygon); - } - // #i37011# bool bForceCreateTwoObjects(false); @@ -2335,6 +2319,16 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( bool bLineGeometryNeededOnly ) rCustomShapeSet, nColorIndex, nColorCount); + + // OperationSmiley: when we have access to the SdrObjCustomShape and the + // CustomShape is built with more than a single filled Geometry, use it + // to define that all helper geometites defined here (SdrObjects currently) + // will use the same FillGeometryDefinition (from the referenced SdrObjCustomShape). + // This will all same-filled objects look like filled smoothly with the same style. + if(pCustomShapeObj) + { + pObj->setFillGeometryDefiningShape(pCustomShapeObj); + } } } -- cgit