diff options
author | Muthu Subramanian <sumuthu@suse.com> | 2012-12-19 20:03:51 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@suse.com> | 2012-12-19 20:03:51 +0530 |
commit | abd87f5085267ea514ebd34b23e42fb9b4b6466b (patch) | |
tree | b178cfbb3ba347d7eec40843644554349c981656 | |
parent | eaf3c60194e440e8a9bebac46f8d55ba6246001a (diff) |
n#794350: [PPTX] Flip gradient fill as well.
-rw-r--r-- | oox/inc/oox/drawingml/fillproperties.hxx | 4 | ||||
-rw-r--r-- | oox/source/drawingml/fillproperties.cxx | 9 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/oox/inc/oox/drawingml/fillproperties.hxx b/oox/inc/oox/drawingml/fillproperties.hxx index 546766345a48..fb9aa849e92e 100644 --- a/oox/inc/oox/drawingml/fillproperties.hxx +++ b/oox/inc/oox/drawingml/fillproperties.hxx @@ -120,7 +120,9 @@ struct OOX_DLLPUBLIC FillProperties ShapePropertyMap& rPropMap, const GraphicHelper& rGraphicHelper, sal_Int32 nShapeRotation = 0, - sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const; + sal_Int32 nPhClr = API_RGB_TRANSPARENT, + bool bFlipH = false, + bool bFlipV = false ) const; }; // ============================================================================ diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index fb77ced256ed..caeab1b35cfd 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -181,7 +181,8 @@ Color FillProperties::getBestSolidColor() const } void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, - const GraphicHelper& rGraphicHelper, sal_Int32 nShapeRotation, sal_Int32 nPhClr ) const + const GraphicHelper& rGraphicHelper, sal_Int32 nShapeRotation, sal_Int32 nPhClr, + bool bFlipH, bool bFlipV ) const { if( moFillType.has() ) { @@ -225,6 +226,12 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, nStartTrans = maGradientProps.maGradientStops.begin()->second.getTransparency()*255/100; } + // Adjust for flips + if ( bFlipH ) + nShapeRotation = 180*60000 - nShapeRotation; + if ( bFlipV ) + nShapeRotation = -nShapeRotation; + // "rotate with shape" not set, or set to false -> do not rotate if ( !maGradientProps.moRotateWithShape.get( false ) ) nShapeRotation = 0; diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index e6a02060d9b9..ad8729eadeb6 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -535,7 +535,7 @@ Reference< XShape > Shape::createAndInsert( mpGraphicPropertiesPtr->pushToPropMap( aShapeProps, rGraphicHelper ); if ( mpTablePropertiesPtr.get() && aServiceName == "com.sun.star.drawing.TableShape" ) mpTablePropertiesPtr->pushToPropSet( rFilterBase, xSet, mpMasterTextListStyle ); - aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, mnRotation, nFillPhClr ); + aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, mnRotation, nFillPhClr, mbFlipH, mbFlipV ); aLineProperties.pushToPropMap( aShapeProps, rGraphicHelper, nLinePhClr ); // TODO: use ph color when applying effect properties aEffectProperties.pushToPropMap( aShapeProps, rGraphicHelper ); |