oox/source/export/shapes.cxx        |    4 +++-
 sd/qa/unit/data/pptx/tdf169088.pptx |binary
 sd/qa/unit/export-tests-ooxml4.cxx  |   24 ++++++++++++++++++++++++
 3 files changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 2feb36d92e270240019ff5681466fc4ac97a5405
Author:     Karthik <[email protected]>
AuthorDate: Tue Oct 28 22:14:58 2025 +0530
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Nov 11 06:50:51 2025 +0100

    tdf#169088 Fix PPTX export of OLE animations
    
    Presentations with OLE animations when saved as PPTX can't be opened
    in PowerPoint.
    
    When exporting OLE animations, the target of the animation is set to
    the `pic` inside the OLE instead of OLE.
    
    Change-Id: Ic3e870fff2e896404960f475c67f44df0aef1860
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193110
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit be36f4c40bb7b0c1b8ceb974c932a687f5c488be)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193736
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index d2413cfcae20..08addb42cedc 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -3009,7 +3009,9 @@ sal_Int32 ShapeExport::GetNewShapeID( const Reference< 
XShape >& rXShape, XmlFil
 
     sal_Int32 nID = pFB->GetUniqueId();
 
-    (*mpShapeMap)[ rXShape ] = nID;
+    auto it = mpShapeMap->find(rXShape);
+    if (it == mpShapeMap->end())
+        (*mpShapeMap)[rXShape] = nID;
 
     return nID;
 }
diff --git a/sd/qa/unit/data/pptx/tdf169088.pptx 
b/sd/qa/unit/data/pptx/tdf169088.pptx
new file mode 100644
index 000000000000..6b290d6f43bb
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf169088.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx 
b/sd/qa/unit/export-tests-ooxml4.cxx
index 833653d0c7de..25b42f4c206f 100644
--- a/sd/qa/unit/export-tests-ooxml4.cxx
+++ b/sd/qa/unit/export-tests-ooxml4.cxx
@@ -1560,6 +1560,30 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, 
testTextAlignLeft)
     assertXPath(pXmlDocRels, 
"/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:pPr", "algn", u"l");
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testOLEObjectAnimationTarget)
+{
+    createSdImpressDoc("pptx/tdf169088.pptx");
+    save(u"Impress Office Open XML"_ustr);
+
+    xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr);
+
+    const OUString sOleId = getXPath(
+        pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:graphicFrame/p:nvGraphicFramePr/p:cNvPr", "id");
+
+    // Check animation target spid matches OLE object id
+    assertXPath(pXmlDoc,
+                
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/"
+                
"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", sOleId);
+
+    assertXPath(pXmlDoc,
+                
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/"
+                
"p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animEffect/"
+                "p:cBhvr/p:tgtEl/p:spTgt",
+                "spid", sOleId);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to