summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2012-12-19 20:03:51 +0530
committerAndras Timar <atimar@suse.com>2013-01-21 12:50:53 +0100
commit21cc231fbebecfe65414505918932fe7675b4b7f (patch)
treee521a2d3ac7f1b061748f41f2df9c727dff52d0a
parent6a985438f7263e8d9fa84925520bcefecafb8b2f (diff)
n#794350: [PPTX] Flip gradient fill as well.
-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 dd30edf61e64..59dabba5eea2 100644
--- a/oox/inc/oox/drawingml/fillproperties.hxx
+++ b/oox/inc/oox/drawingml/fillproperties.hxx
@@ -129,7 +129,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 4a94c01fe6d6..dde28b5f4729 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -191,7 +191,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() )
{
@@ -235,6 +236,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 2a9eb5042804..156bc09fa97b 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -546,7 +546,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 );