summaryrefslogtreecommitdiff
path: root/oox/qa/unit
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2024-03-26 23:52:34 +0100
committerRegina Henschel <rb.henschel@t-online.de>2024-03-27 16:48:20 +0100
commit207876cdcd7a4c19940d769a52d118751059dfe0 (patch)
tree81e0a19572cd93e378ad18e9fca9ef46791aee86 /oox/qa/unit
parent88f051257ebec4341864027f3af02e0f44df2367 (diff)
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 <rb.henschel@t-online.de>
Diffstat (limited to 'oox/qa/unit')
-rw-r--r--oox/qa/unit/data/Scene3d_shape_rotation.pptxbin0 -> 14517 bytes
-rw-r--r--oox/qa/unit/testscene3d.cxx12
2 files changed, 12 insertions, 0 deletions
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
--- /dev/null
+++ b/oox/qa/unit/data/Scene3d_shape_rotation.pptx
Binary files 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<drawing::XShape> 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: */