summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2012-04-09 18:24:11 +0530
committerIvan Timofeev <timofeev.i.s@gmail.com>2012-04-09 19:37:14 +0400
commitd2e74fcd33c36d190c0cefa9615e810e2e713a24 (patch)
tree3a747b717d778f67d42f9460f6b195f674c55a10 /svx
parent0e074c5b099fdaadeed9d9803c3e33437245357b (diff)
fdo43752: PPTX import fix affected odp imports.
Related bugs: n#719989, n#719997 (cherry picked from commit 1c44b263d789b4c20e9178c6432300e301df94d6) Signed-off-by: Ivan Timofeev <timofeev.i.s@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/EnhancedCustomShape2d.hxx1
-rw-r--r--svx/inc/svx/svdoashp.hxx1
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx5
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx10
-rw-r--r--svx/source/svdraw/svdoashp.cxx12
5 files changed, 27 insertions, 2 deletions
diff --git a/svx/inc/svx/EnhancedCustomShape2d.hxx b/svx/inc/svx/EnhancedCustomShape2d.hxx
index 415385cea83f..0d9da95a5d68 100644
--- a/svx/inc/svx/EnhancedCustomShape2d.hxx
+++ b/svx/inc/svx/EnhancedCustomShape2d.hxx
@@ -182,6 +182,7 @@ class EnhancedCustomShape2d : public SfxItemSet
sal_Bool IsFlipVert() { return bFlipV; };
sal_Bool IsFlipHorz() { return bFlipH; };
sal_Int32 GetRotateAngle() { return nRotateAngle; };
+ SVX_DLLPUBLIC bool IsPostRotate() const;
SVX_DLLPUBLIC SdrObject* CreateLineGeometry();
SVX_DLLPUBLIC SdrObject* CreateObject( sal_Bool bLineGeometryNeededOnly );
diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx
index 013e1508239b..0f540190493a 100644
--- a/svx/inc/svx/svdoashp.hxx
+++ b/svx/inc/svx/svdoashp.hxx
@@ -145,6 +145,7 @@ public:
sal_Bool IsMirroredX() const;
sal_Bool IsMirroredY() const;
+ bool IsPostRotate() const;
void SetMirroredX( const sal_Bool bMirroredX );
void SetMirroredY( const sal_Bool bMirroredY );
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 3e5f340802df..d0fa902ca6f6 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -2330,6 +2330,11 @@ void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj )
}
}
+bool EnhancedCustomShape2d::IsPostRotate() const
+{
+ return pCustomShapeObj->ISA( SdrObjCustomShape ) ? ((SdrObjCustomShape*)pCustomShapeObj)->IsPostRotate() : false;
+}
+
SdrObject* EnhancedCustomShape2d::CreateLineGeometry()
{
return CreateObject( sal_True );
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index a92a962e591e..b8a2be007424 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -276,6 +276,7 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
EnhancedCustomShape2d aCustomShape2d( pSdrObjCustomShape );
sal_Int32 nRotateAngle = aCustomShape2d.GetRotateAngle();
+ bool bPostRotateAngle = aCustomShape2d.IsPostRotate();
sal_Bool bFlipV = aCustomShape2d.IsFlipVert();
sal_Bool bFlipH = aCustomShape2d.IsFlipHorz();
@@ -315,6 +316,11 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
}
pRenderedShape->Shear( pSdrObjCustomShape->GetSnapRect().Center(), nShearWink, nTan, sal_False);
}
+ if( !bPostRotateAngle && nRotateAngle )
+ {
+ double a = nRotateAngle * F_PI18000;
+ pRenderedShape->NbcRotate( pSdrObjCustomShape->GetSnapRect().Center(), nRotateAngle, sin( a ), cos( a ) );
+ }
if ( bFlipV )
{
Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
@@ -327,8 +333,8 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
Point aBottom( aTop.X(), aTop.Y() + 1000 );
pRenderedShape->NbcMirror( aTop, aBottom );
}
- // Note that the rotation needs be done after flipping
- if( nRotateAngle )
+ // Specifically for pptx imports
+ if( bPostRotateAngle && nRotateAngle )
{
double a = nRotateAngle * F_PI18000;
pRenderedShape->NbcRotate( pSdrObjCustomShape->GetSnapRect().Center(), nRotateAngle, sin( a ), cos( a ) );
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 48720080d75d..4c4ff867503d 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -538,6 +538,18 @@ double SdrObjCustomShape::GetObjectRotation() const
return fObjectRotation;
}
+bool SdrObjCustomShape::IsPostRotate() const
+{
+ const com::sun::star::uno::Any* pAny;
+ bool bPostRotate = false;
+ SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
+ const rtl::OUString sIsPostRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "IsPostRotateAngle" ) );
+ pAny = rGeometryItem.GetPropertyValueByName( sIsPostRotateAngle );
+ if ( pAny )
+ *pAny >>= bPostRotate;
+ return bPostRotate;
+}
+
double SdrObjCustomShape::GetExtraTextRotation( const bool bPreRotation ) const
{
const com::sun::star::uno::Any* pAny;