summaryrefslogtreecommitdiff
path: root/svx/source/customshapes
diff options
context:
space:
mode:
authorPaul Trojahn <paul.trojahn@gmail.com>2017-08-01 15:56:48 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-08-10 17:38:20 +0200
commit3e33a2551532806b99f6c8ca415136cd3f2f9256 (patch)
treebbb764d93b878d215b2c1e7fae12ea34789f9d58 /svx/source/customshapes
parent93a3739bf47ada4549b3c139c55a9b039c1db1ee (diff)
tdf#109317 Fix incorrect rotation of flipped custom OOXML shapes
The shape wasn't imported correctly because IsPostRotateAngle wasn't set. As a result the shape was flipped after it was rotated instead of before. This commit removes 1c44b263 and converts the rotation to the internal format instead. This also fixes that ooxml preset shapes can't be exported to odf correctly and that ooxml preset shapes rotate in the wrong direction when rotated in LO. Change-Id: I9691902fdfb2cfecc8fe50d6eb66ac3880ddd4e8 Reviewed-on: https://gerrit.libreoffice.org/40789 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'svx/source/customshapes')
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx5
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx9
2 files changed, 1 insertions, 13 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 90783f13089f..1180ffde845c 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -2386,11 +2386,6 @@ void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj )
}
}
-bool EnhancedCustomShape2d::IsPostRotate() const
-{
- return dynamic_cast<const SdrObjCustomShape*>( pCustomShapeObj) != nullptr && static_cast<SdrObjCustomShape*>(pCustomShapeObj)->IsPostRotate();
-}
-
SdrObject* EnhancedCustomShape2d::CreateLineGeometry()
{
return CreateObject( true );
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index a734d24c0c75..fc2f2dc7cb60 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -267,7 +267,6 @@ Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render()
EnhancedCustomShape2d aCustomShape2d( pSdrObjCustomShape );
sal_Int32 nRotateAngle = aCustomShape2d.GetRotateAngle();
- bool bPostRotateAngle = aCustomShape2d.IsPostRotate();
bool bFlipV = aCustomShape2d.IsFlipVert();
bool bFlipH = aCustomShape2d.IsFlipHorz();
@@ -307,7 +306,7 @@ Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render()
}
pRenderedShape->Shear( pSdrObjCustomShape->GetSnapRect().Center(), nShearAngle, nTan, false);
}
- if( !bPostRotateAngle && nRotateAngle )
+ if(nRotateAngle )
{
double a = nRotateAngle * F_PI18000;
pRenderedShape->NbcRotate( pSdrObjCustomShape->GetSnapRect().Center(), nRotateAngle, sin( a ), cos( a ) );
@@ -324,12 +323,6 @@ Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render()
Point aBottom( aTop.X(), aTop.Y() + 1000 );
pRenderedShape->NbcMirror( aTop, aBottom );
}
- // Specifically for pptx imports
- if( bPostRotateAngle && nRotateAngle )
- {
- double a = nRotateAngle * F_PI18000;
- pRenderedShape->NbcRotate( pSdrObjCustomShape->GetSnapRect().Center(), nRotateAngle, sin( a ), cos( a ) );
- }
pRenderedShape->NbcSetStyleSheet( pSdrObjCustomShape->GetStyleSheet(), true );
pRenderedShape->RecalcSnapRect();
}