summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/shape.cxx
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2022-01-03 05:45:17 +0300
committerXisco Fauli <xiscofauli@libreoffice.org>2022-01-11 10:05:15 +0100
commitebc5d02a0d4a716fb4efb4ce17a622eb21cf7c9c (patch)
tree5e573c7028ab4716a56662d06634306a1244da85 /oox/source/drawingml/shape.cxx
parentf1fb66b02d72d4b2e6f3321fa5426c9f7c04c48c (diff)
tdf#146534 pptx import: make Z rotation work with rotation transform
Expands previous idea from a9c5c0d814a266096483572b84c72875ef8efd77 (tdf#133037 OOXML shape import: camera rotation along Z) and uses it also for shapes that have a true bUseRotationTransform flag Also fixes same Z rotation exporting twice from InteropGrabBag to both spPr and textBody causing text overrotating on roundtrip. Change-Id: If0f192af029ca86b932a63613f961be1f5003c5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127880 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128219
Diffstat (limited to 'oox/source/drawingml/shape.cxx')
-rw-r--r--oox/source/drawingml/shape.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 78a27f8a0c9c..d36f01ee7eab 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -875,8 +875,11 @@ Reference< XShape > const & Shape::createAndInsert(
// The flip contained in aParentScale will affect orientation of object rotation angle.
sal_Int16 nOrientation = ((aParentScale.getX() < 0) != (aParentScale.getY() < 0)) ? -1 : 1;
// ToDo: Not sure about the restrictions given by bUseRotationTransform.
- if (bUseRotationTransform && mnRotation != 0)
- lcl_RotateAtCenter(aTransformation, nOrientation * mnRotation);
+ // Since LibreOffice doesn't have 3D camera options for 2D shapes, rotate the shape opposite of
+ // the camera Z axis rotation, in order to produce the same visual result from MSO
+ const sal_Int32 nCameraRotation = get3DProperties().maCameraRotation.mnRevolution.get(0);
+ if (bUseRotationTransform && (mnRotation != 0 || nCameraRotation != 0))
+ lcl_RotateAtCenter(aTransformation, nOrientation * (mnRotation - nCameraRotation));
if (fParentRotate != 0.0)
aTransformation.rotate(fParentRotate);
@@ -1601,8 +1604,6 @@ Reference< XShape > const & Shape::createAndInsert(
getTextBody()->getTextProperties().pushVertSimulation();
// tdf#133037: a bit hackish: force Shape to rotate in the opposite direction the camera would rotate
- const sal_Int32 nCameraRotation = get3DProperties().maCameraRotation.mnRevolution.get(0);
-
PropertySet aPropertySet(mxShape);
if ( !bUseRotationTransform && (mnRotation != 0 || nCameraRotation != 0) )
{