summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2012-12-19 20:03:51 +0530
committerNoel Power <noel.power@suse.com>2013-01-15 13:01:05 +0000
commitfb3becfdb10cde48b6ee5d6fdc9337bf71796fd6 (patch)
treea2fa9fc28a33dd6e198012b1fd1edd99de0fdef4 /oox
parent4a6f6d761263a7dc5eb1091efa252b8dc4ccf538 (diff)
n#794350: [PPTX] Flip gradient fill as well.
Signed-off-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/drawingml/fillproperties.hxx4
-rw-r--r--oox/source/drawingml/fillproperties.cxx9
-rw-r--r--oox/source/drawingml/shape.cxx2
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 a7072d9bcb71..a400cce8c65e 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -182,7 +182,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() )
{
@@ -226,6 +227,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 6debbcbd4291..fa5f8e08c4b3 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -534,7 +534,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 );
aEffectProperties.pushToPropMap( aShapeProps, rGraphicHelper );