diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de (CIB)> | 2018-02-23 16:57:41 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de (CIB)> | 2018-03-17 23:15:49 +0100 |
commit | d1027af3c74529827d53e8cf7b0d42a0ee47d1ba (patch) | |
tree | 488efdfb60e5e9bd01af54679872a8b91b0e14c4 /svx/source/customshapes/EnhancedCustomShape2d.cxx | |
parent | 9886a69c472f212d88f11cfa0f3835e5dcf485b2 (diff) |
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
Diffstat (limited to 'svx/source/customshapes/EnhancedCustomShape2d.cxx')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape2d.cxx | 26 |
1 files changed, 10 insertions, 16 deletions
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); + } } } |