sd/qa/unit/data/odp/tdf169675_3d_object_anim.odp  |binary
 sd/qa/unit/export-tests-ooxml4.cxx                |   18 ++++++++++++++++++
 sd/source/filter/eppt/pptx-animations-nodectx.cxx |    3 ++-
 3 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit c63a08ba968ca7e208737a5b41188fad15e26247
Author:     Aron Budea <[email protected]>
AuthorDate: Wed Nov 26 17:19:20 2025 +1030
Commit:     Mike Kaganski <[email protected]>
CommitDate: Wed Dec 3 11:27:41 2025 +0100

    tdf#169675 sd: animation on 3D object results in invalid PPTX
    
    3D objects are only supported in ODP, and don't get exported
    to PPTX. Animations on them did get exported, resulting in
    invalid 'spid' (-1) and invalid OOXML.
    
    Reuse ShapeExport::IsShapeTypeKnown(...) introduced in
    ab45b8d9959f8f392a10d0874c50f26b816a4da8.
    Note the extra entries in
    PowerPointShapeExport::WriteUnknownShape(...), these are
    already covered by the second half of isValidTarget(...).
    
    Change-Id: Ieb1dc1475b036fe4f24d84cee17b9af544c5bb18
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194543
    Reviewed-by: Mike Kaganski <[email protected]>
    Code-Style: Aron Budea <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 2f32f2a9a84ff0d66b5dd608fb20fdeb7b7f99a3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194637
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sd/qa/unit/data/odp/tdf169675_3d_object_anim.odp 
b/sd/qa/unit/data/odp/tdf169675_3d_object_anim.odp
new file mode 100644
index 000000000000..4873dc336d1d
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf169675_3d_object_anim.odp 
differ
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx 
b/sd/qa/unit/export-tests-ooxml4.cxx
index e1de2ed4c138..7edcb3fca05c 100644
--- a/sd/qa/unit/export-tests-ooxml4.cxx
+++ b/sd/qa/unit/export-tests-ooxml4.cxx
@@ -146,6 +146,24 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, 
testTdf168755_anim_on_SmartArt)
                                  aSpTgtId);
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testtdf169675_3d_object_anim)
+{
+    createSdImpressDoc("odp/tdf169675_3d_object_anim.odp");
+    save(u"Impress Office Open XML"_ustr);
+
+    xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr);
+
+    OUString aSpTgtId
+        = getXPath(pXmlDoc,
+                   
"//p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/"
+                   
"p:par[1]/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/"
+                   "p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt",
+                   "spid");
+    // Before the fix spid would be -1, because animations for not exported 
targets (3D objects)
+    // would be written, now those are omitted
+    CPPUNIT_ASSERT_MESSAGE("Shape id in animation target can't be -1", 
aSpTgtId != "-1");
+}
+
 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125346)
 {
     // There are two themes in the test document, make sure we use the right 
theme
diff --git a/sd/source/filter/eppt/pptx-animations-nodectx.cxx 
b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
index 149e9a266c9e..07c8bd618f78 100644
--- a/sd/source/filter/eppt/pptx-animations-nodectx.cxx
+++ b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
@@ -8,6 +8,7 @@
  */
 
 #include "pptx-animations-nodectx.hxx"
+#include <oox/export/shapes.hxx>
 #include <com/sun/star/animations/AnimationNodeType.hpp>
 #include <com/sun/star/animations/XAnimate.hpp>
 #include <com/sun/star/animations/XAnimationNode.hpp>
@@ -43,7 +44,7 @@ bool isValidTarget(const Any& rTarget)
 {
     Reference<XShape> xShape;
 
-    if ((rTarget >>= xShape) && xShape.is())
+    if ((rTarget >>= xShape) && 
drawingml::ShapeExport::IsShapeTypeKnown(xShape))
         return true;
 
     ParagraphTarget aParagraphTarget;

Reply via email to