sd/source/filter/eppt/pptx-animations-nodectx.cxx |   39 ++++++++++++----------
 sd/source/filter/eppt/pptx-animations-nodectx.hxx |    7 +++
 sd/source/filter/eppt/pptx-animations.cxx         |   16 +--------
 3 files changed, 32 insertions(+), 30 deletions(-)

New commits:
commit 063ca7de9b47cc92d1a5f10fae6e475e7693e165
Author:     Aron Budea <[email protected]>
AuthorDate: Fri Jan 2 21:50:24 2026 +1100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Jan 7 10:38:53 2026 +0100

    tdf#170202 avoid exporting ANIMATIONPHYSICS node types
    
    Implement cbf102d4c1ba73519b49df0d43a87ebdf9267538 differently.
    
    After previous commit, tdf136301-1.odp still contained
    animation elements in slide1.xml when converted to PPTX, and
    couldn't be opened in PP.
    
    Set such nodes invalid instead to avoid processing them at all.
    
    Change-Id: I799026c389681b89792bb9765b8f81562743deb4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196424
    Reviewed-by: Aron Budea <[email protected]>
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    (cherry picked from commit f3943837d75695bc351a55340addd362de33097b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196441
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit 8a7dcdc302c50b1357fef90359922a58b24f5e51)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196561

diff --git a/sd/source/filter/eppt/pptx-animations-nodectx.cxx 
b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
index af843d661b69..0e3c2ee3d4d5 100644
--- a/sd/source/filter/eppt/pptx-animations-nodectx.cxx
+++ b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
@@ -188,6 +188,11 @@ void NodeContext::initValid(bool bHasValidChild, bool 
bIsIterateChild)
             }
         }
     }
+    else if (nType == AnimationNodeType::ANIMATEPHYSICS)
+    {
+        // Ignore: we don't support exporting this node type
+        mbValid = false;
+    }
     else
     {
         Reference<XAnimate> xAnimate(mxNode, UNO_QUERY);
diff --git a/sd/source/filter/eppt/pptx-animations.cxx 
b/sd/source/filter/eppt/pptx-animations.cxx
index 08ecfaf49cdc..c85e1070b8cf 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -951,28 +951,18 @@ void 
PPTXAnimationExport::WriteAnimationNodeCommonPropsStart()
     if (!aChildNodes.empty())
     {
         bool bSubTnLst = false;
-        bool bWroteChildTnList = false;
+        mpFS->startElementNS(XML_p, XML_childTnLst);
         for (const NodeContextPtr& pChildContext : aChildNodes)
         {
             if (pChildContext->isValid())
             {
                 if (pChildContext->isOnSubTnLst())
                     bSubTnLst = true;
-                else if (pChildContext->getNode()->getType() == 
AnimationNodeType::ANIMATEPHYSICS)
-                    ; // ignore we don't support exporting this node type
                 else
-                {
-                    if (!bWroteChildTnList)
-                    {
-                        bWroteChildTnList = true;
-                        mpFS->startElementNS(XML_p, XML_childTnLst);
-                    }
                     WriteAnimationNode(pChildContext);
-                }
             }
         }
-        if (bWroteChildTnList)
-            mpFS->endElementNS(XML_p, XML_childTnLst);
+        mpFS->endElementNS(XML_p, XML_childTnLst);
 
         if (bSubTnLst)
         {
commit 6b5fbb953959beedc4ff3b0ea3de512559a6cfc5
Author:     Karthik Godha <[email protected]>
AuthorDate: Tue Dec 9 20:05:53 2025 +0530
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Jan 7 10:38:39 2026 +0100

    tdf#169911: ODP -> PPTX export invalid animations
    
    Empty/invalid OLE objects are skipped PPTX export, but animations
    attached to these OLE objects are exported.
    
    Add the slide itself as target for these animations
    
    Change-Id: I1e594d607cc37f58c0e56357f8f8d42d9139bec8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195306
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 064e42a069c9186919086904ced3100960bafb41)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196156
    Tested-by: Jenkins
    (cherry picked from commit d64f3e812bd6929b62d8c00b60b460aed2bf8e84)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196425
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit c371757d0c5a418b9932a5a01389280ca41f3b8a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196431

diff --git a/sd/source/filter/eppt/pptx-animations-nodectx.cxx 
b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
index 07c8bd618f78..af843d661b69 100644
--- a/sd/source/filter/eppt/pptx-animations-nodectx.cxx
+++ b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
@@ -40,18 +40,6 @@ namespace oox::core
 {
 namespace
 {
-bool isValidTarget(const Any& rTarget)
-{
-    Reference<XShape> xShape;
-
-    if ((rTarget >>= xShape) && 
drawingml::ShapeExport::IsShapeTypeKnown(xShape))
-        return true;
-
-    ParagraphTarget aParagraphTarget;
-
-    return (rTarget >>= aParagraphTarget) && aParagraphTarget.Shape.is();
-}
-
 bool IsAudioURL(std::u16string_view rURL)
 {
     return o3tl::endsWithIgnoreAsciiCase(rURL, ".wav")
@@ -95,10 +83,11 @@ bool initCondList(const Any& rAny, std::vector<Cond>& 
rList, bool bIsMainSeqChil
 }
 }
 
-NodeContext::NodeContext(const Reference<XAnimationNode>& xNode, bool 
bMainSeqChild,
-                         bool bIsIterateChild)
+NodeContext::NodeContext(const Reference<XAnimationNode>& xNode, 
PowerPointExport& rExport,
+                         bool bMainSeqChild, bool bIsIterateChild)
     : mxNode(xNode)
     , mbValid(true)
+    , mrPowerPointExport(rExport)
     , mbOnSubTnLst(false)
     , mnEffectNodeType(-1)
     , mnEffectPresetClass(css::presentation::EffectPresetClass::CUSTOM)
@@ -117,6 +106,19 @@ NodeContext::NodeContext(const Reference<XAnimationNode>& 
xNode, bool bMainSeqCh
     initCondList(getNodeForCondition()->getEnd(), maEndCondList, 
bMainSeqChild);
 }
 
+bool NodeContext::isValidTarget(const Any& rTarget)
+{
+    Reference<XShape> xShape;
+
+    if ((rTarget >>= xShape) && 
drawingml::ShapeExport::IsShapeTypeKnown(xShape)
+        && (mrPowerPointExport.GetShapeID(xShape) != -1))
+        return true;
+
+    ParagraphTarget aParagraphTarget;
+
+    return (rTarget >>= aParagraphTarget) && aParagraphTarget.Shape.is();
+}
+
 void NodeContext::initUserData()
 {
     assert(mxNode.is());
@@ -209,8 +211,8 @@ bool NodeContext::initChildNodes()
                 Reference<XAnimationNode> 
xChildNode(xEnumeration->nextElement(), UNO_QUERY);
                 if (xChildNode.is())
                 {
-                    auto pChildContext
-                        = std::make_unique<NodeContext>(xChildNode, 
bIsMainSeq, bIsIterateChild);
+                    auto pChildContext = std::make_unique<NodeContext>(
+                        xChildNode, mrPowerPointExport, bIsMainSeq, 
bIsIterateChild);
                     if (pChildContext->isValid())
                         bValid = true;
                     maChildNodes.push_back(std::move(pChildContext));
diff --git a/sd/source/filter/eppt/pptx-animations-nodectx.hxx 
b/sd/source/filter/eppt/pptx-animations-nodectx.hxx
index c25991a85a23..1830845ea5da 100644
--- a/sd/source/filter/eppt/pptx-animations-nodectx.hxx
+++ b/sd/source/filter/eppt/pptx-animations-nodectx.hxx
@@ -11,6 +11,7 @@
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/animations/XAnimationNode.hpp>
 #include <vector>
+#include "epptooxml.hxx"
 #include "pptx-animations-cond.hxx"
 
 namespace oox::core
@@ -28,6 +29,8 @@ class NodeContext
     std::vector<Cond> maEndCondList;
     // if the node has valid target or contains at least one valid target.
     bool mbValid;
+    // Required to check if the associated shape is present in export or not
+    PowerPointExport& mrPowerPointExport;
 
     // if the node should be on SubTnLst or ChildTnLst
     bool mbOnSubTnLst;
@@ -38,6 +41,8 @@ class NodeContext
     OUString msEffectPresetId;
     OUString msEffectPresetSubType;
 
+    bool isValidTarget(const css::uno::Any& rTarget);
+
     /// constructor helper for initializing user data.
     void initUserData();
 
@@ -50,7 +55,7 @@ class NodeContext
 
 public:
     NodeContext(const css::uno::Reference<css::animations::XAnimationNode>& 
xNode,
-                bool bMainSeqChild, bool bIsIterateChild);
+                PowerPointExport& rExport, bool bMainSeqChild, bool 
bIsIterateChild);
     const css::uno::Reference<css::animations::XAnimationNode>& getNode() 
const { return mxNode; }
     sal_Int16 getEffectNodeType() const { return mnEffectNodeType; }
     sal_Int16 getEffectPresetClass() const { return mnEffectPresetClass; }
diff --git a/sd/source/filter/eppt/pptx-animations.cxx 
b/sd/source/filter/eppt/pptx-animations.cxx
index 9d64fdb77acc..08ecfaf49cdc 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -1244,7 +1244,7 @@ void PPTXAnimationExport::WriteAnimations(const 
Reference<XDrawPage>& rXDrawPage
     if (!(xEnumeration.is() && xEnumeration->hasMoreElements()))
         return;
 
-    auto pNodeContext = std::make_unique<NodeContext>(xNode, false, false);
+    auto pNodeContext = std::make_unique<NodeContext>(xNode, 
mrPowerPointExport, false, false);
     if (pNodeContext->isValid())
     {
         mpFS->startElementNS(XML_p, XML_timing);

Reply via email to