From 207876cdcd7a4c19940d769a52d118751059dfe0 Mon Sep 17 00:00:00 2001 From: Regina Henschel Date: Tue, 26 Mar 2024 23:52:34 +0100 Subject: Restore shape rotation on roundtrip of pptx 3D shape As long as our support for extruded custom shapes from MS Office is rudimentary, we should restore the original values in case of saving to pptx. The patch uses the angle out of the interopGrabBag even if the user has changed the shape rotation. Considering a different angle would require to calculate camera, light rig and shape rotations. The effort for that is too large. Change-Id: Ib0549acc4ae13badd44fe9ae221a56ad21d28e1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165359 Tested-by: Jenkins Reviewed-by: Regina Henschel --- oox/qa/unit/data/Scene3d_shape_rotation.pptx | Bin 0 -> 14517 bytes oox/qa/unit/testscene3d.cxx | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 oox/qa/unit/data/Scene3d_shape_rotation.pptx (limited to 'oox/qa/unit') diff --git a/oox/qa/unit/data/Scene3d_shape_rotation.pptx b/oox/qa/unit/data/Scene3d_shape_rotation.pptx new file mode 100644 index 000000000000..c8645e8a3780 Binary files /dev/null and b/oox/qa/unit/data/Scene3d_shape_rotation.pptx differ diff --git a/oox/qa/unit/testscene3d.cxx b/oox/qa/unit/testscene3d.cxx index 4b6415424515..fdad25be2cea 100644 --- a/oox/qa/unit/testscene3d.cxx +++ b/oox/qa/unit/testscene3d.cxx @@ -623,6 +623,18 @@ CPPUNIT_TEST_FIXTURE(TestScene3d, test_pureImage) CPPUNIT_ASSERT_EQUAL(sal_Int32(27000), nZRotate); } +CPPUNIT_TEST_FIXTURE(TestScene3d, test_shape_rotation) +{ + // Given a document with a shape in 3D mode with shape rotation rot="300000". + loadFromFile(u"Scene3d_shape_rotation.pptx"); + uno::Reference xShape(getShape(0, 0)); + + // Make sure that the immediate export to pptx has the same shape rotation + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + assertXPath(pXmlDoc, "//p:spPr/a:xfrm"_ostr, "rot"_ostr, "300000"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit