oox/source/export/shapes.cxx          |   19 ++++++++++-------
 sd/qa/unit/data/ppt/novell6655408.ppt |binary
 sd/qa/unit/data/ppt/tdf168736-1.ppt   |binary
 sd/qa/unit/data/ppt/tdf168736-2.ppt   |binary
 sd/qa/unit/export-tests-ooxml3.cxx    |   38 ++++++++++++++++++++++++++++++++++
 5 files changed, 50 insertions(+), 7 deletions(-)

New commits:
commit 0b94f192daf0b0d0b97432da411ba27000417df9
Author:     Karthik <[email protected]>
AuthorDate: Mon Oct 27 14:09:35 2025 +0530
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Nov 24 13:26:44 2025 +0100

    tdf#168736: Fix interop: PPT->PPTX images with internal-links
    
    When PPT files with pictures containing links to internal slides are
    saved as PPTX, it results in corrupted XML output.
    
    Change-Id: Ie5ec67d342d64e2412eb6979e6c2cb58d4a8f97a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193017
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit b19957e1bbd596462a6601847833c5435c57afd0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194234
    Tested-by: Jenkins
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194435

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index f73adbaf0660..6ea2b034922f 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -749,7 +749,8 @@ static OUString lcl_GetTarget(const 
css::uno::Reference<css::frame::XModel>& xMo
         if (!xNamed)
             continue;
         OUString sSlideName = "#" + xNamed->getName();
-        if (rURL == sSlideName)
+        OUString sApiName = "#page" + OUString::number(i + 1);
+        if (rURL == sSlideName || rURL == sApiName)
         {
             sTarget = "slide" + OUString::number(i + 1) + ".xml";
             break;
@@ -1487,16 +1488,20 @@ void ShapeExport::WriteGraphicObjectShapePart( const 
Reference< XShape >& xShape
         bool bExtURL = URLTransformer().isExternalURL(sBookmark);
         sBookmark = bExtURL ? sBookmark : lcl_GetTarget(GetFB()->getModel(), 
sBookmark);
 
-        OUString sRelId = mpFB->addRelation(mpFS->getOutputStream(),
-                                            bExtURL ? 
oox::getRelationship(Relationship::HYPERLINK)
-                                                    : 
oox::getRelationship(Relationship::SLIDE),
-                                            sBookmark, bExtURL);
-
+        OUString sRelId;
+        if (!sBookmark.isEmpty())
+        {
+            sRelId = mpFB->addRelation(mpFS->getOutputStream(),
+                                       bExtURL ? 
oox::getRelationship(Relationship::HYPERLINK)
+                                               : 
oox::getRelationship(Relationship::SLIDE),
+                                       sBookmark, bExtURL);
+        }
         if (bExtURL)
             mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), 
sRelId);
         else
             mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), 
sRelId, XML_action,
-                                  "ppaction://hlinksldjump");
+                                  sBookmark.isEmpty() ? "ppaction://noaction"
+                                                      : 
"ppaction://hlinksldjump");
     }
     AddExtLst(pFS, xShapeProps);
     pFS->endElementNS(mnXmlNamespace, XML_cNvPr);
diff --git a/sd/qa/unit/data/ppt/tdf168736-1.ppt 
b/sd/qa/unit/data/ppt/tdf168736-1.ppt
new file mode 100644
index 000000000000..dc4bf7071ecc
Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf168736-1.ppt differ
diff --git a/sd/qa/unit/data/ppt/tdf168736-2.ppt 
b/sd/qa/unit/data/ppt/tdf168736-2.ppt
new file mode 100644
index 000000000000..1d08f151ad0c
Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf168736-2.ppt differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index adf2b35d6c3b..205177ea3df4 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1046,6 +1046,26 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, 
testNegativeTimeAnimateValue)
     assertXPath(pXmlDoc, sPath + "[@tm]", 0);
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf168736)
+{
+    createSdImpressDoc("ppt/tdf168736-1.ppt");
+    save(u"Impress Office Open XML"_ustr);
+
+    xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr);
+
+    // Verify hyperlink to nextslide is properly exported the Relationship has 
Target attribute
+    assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:sp[3]/p:txBody/a:p/a:r/a:rPr/a:hlinkClick",
+                "action", u"ppaction://hlinkshowjump?jump=nextslide");
+
+    createSdImpressDoc("ppt/tdf168736-2.ppt");
+    save(u"Impress Office Open XML"_ustr);
+
+    xmlDocUniquePtr pXmlDocRels = 
parseExport(u"ppt/slides/_rels/slide2.xml.rels"_ustr);
+
+    // Verify that the Relationship has Target attribute
+    assertXPath(pXmlDocRels, "/rels:Relationships/rels:Relationship[1]", 
"Target", u"slide1.xml");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit d7629d7f843e5a02c1188efc94cb44b66f576d8b
Author:     Karthik Godha <[email protected]>
AuthorDate: Fri Oct 31 08:34:27 2025 +0530
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Nov 24 13:26:38 2025 +0100

    Impress Unit Test: Test to check proper export of TimeAnimateValue
    
    Test related to the following commit
    06df3ad0b2fa771757c90f53dd1f33265a3912dc
    
    Change-Id: I9256e94af6fb495ddb2694ee6b0a03243219fc0b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193232
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194434

diff --git a/sd/qa/unit/data/ppt/novell6655408.ppt 
b/sd/qa/unit/data/ppt/novell6655408.ppt
new file mode 100644
index 000000000000..12708bee78bc
Binary files /dev/null and b/sd/qa/unit/data/ppt/novell6655408.ppt differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 639a64555566..adf2b35d6c3b 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1028,6 +1028,24 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf135843)
     assertXPath(pXmlDoc, sPathStart + 
"/a:tr[3]/a:tc[1]/a:tcPr/a:lnB/a:solidFill");
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testNegativeTimeAnimateValue)
+{
+    createSdImpressDoc("ppt/novell6655408.ppt");
+    save(u"Impress Office Open XML"_ustr);
+
+    xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr);
+
+    static constexpr OString sPath(
+        
"/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:anim/p:tavLst/p:tav[2]"_ostr);
+
+    // Verify `tav` exists
+    assertXPath(pXmlDoc, sPath, 2);
+    // Verify `tm` doesn't exist
+    assertXPath(pXmlDoc, sPath + "[@tm]", 0);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to