sd/source/filter/eppt/pptx-animations.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
New commits: commit 1ad4cb809dac79449cf80fcc2932b0500ddf5539 Author: Karthik Godha <[email protected]> AuthorDate: Fri Nov 14 16:10:53 2025 +0530 Commit: Michael Stahl <[email protected]> CommitDate: Mon Dec 15 15:51:43 2025 +0100 tdf#169438: Fix PPT->PPTX audio in animations Don't export audio in animations which are not in use. Change-Id: I7c5f4e90b36d0c0104a95958c5508dc6b24b2a00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194018 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> (cherry picked from commit 3e9a1086bd87e8a3edba9417cdfdc09ed1cad63d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194229 Tested-by: Jenkins (cherry picked from commit b8eb27b3b087dc1952c8f72d37519c2345770a33) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195639 Tested-by: Michael Stahl <[email protected]> diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx index d8407b09c093..4a3af6a43bb2 100644 --- a/sd/source/filter/eppt/pptx-animations.cxx +++ b/sd/source/filter/eppt/pptx-animations.cxx @@ -491,7 +491,7 @@ class PPTXAnimationExport void WriteAnimationNodeEffect(); void WriteAnimationNodeCommand(); /// Handles XAudio nodes, used for both video and audio. - void WriteAnimationNodeMedia(); + void WriteAnimationNodeMedia(const sal_Int16 nParentNodeType); void WriteAnimationNodeCommonPropsStart(); void WriteAnimationTarget(const Any& rTarget); void WriteAnimationCondList(const std::vector<Cond>& rList, sal_Int32 nToken); @@ -1064,7 +1064,7 @@ void PPTXAnimationExport::WriteAnimationNodeCommand() mpFS->endElementNS(XML_p, XML_cmd); } -void PPTXAnimationExport::WriteAnimationNodeMedia() +void PPTXAnimationExport::WriteAnimationNodeMedia(const sal_Int16 nParentNodeType) { SAL_INFO("sd.eppt", "write animation node media"); Reference<XAudio> xAudio(getCurrentNode(), UNO_QUERY); @@ -1116,6 +1116,10 @@ void PPTXAnimationExport::WriteAnimationNodeMedia() } else { + // Don't export audio node if the context doesn't have any triggers + if (!convertEffectNodeType(nParentNodeType)) + return; + bool bNarration = xAudio->getNarration(); mpFS->startElementNS(XML_p, XML_audio, XML_isNarration, bNarration ? "1" : "0"); bool bHideDuringShow = xAudio->getHideDuringShow(); @@ -1198,7 +1202,7 @@ void PPTXAnimationExport::WriteAnimationNode(const NodeContextPtr& pContext) WriteAnimationNodeCommand(); break; case XML_audio: - WriteAnimationNodeMedia(); + WriteAnimationNodeMedia(pSavedContext->getEffectNodeType()); break; default: SAL_WARN("sd.eppt", "export ooxml node type: " << xmlNodeType);
