sd/source/filter/eppt/pptx-animations.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
New commits: commit eea3114b44d5caf664522101e41e7096b6d6f208 Author: Karthik Godha <[email protected]> AuthorDate: Fri Nov 14 16:10:53 2025 +0530 Commit: Adolfo Jayme Barrientos <[email protected]> CommitDate: Mon Nov 24 10:05:05 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 Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194281 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx index e4824a6d3dd1..48c3376cd1bf 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); @@ -1074,7 +1074,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); @@ -1126,6 +1126,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(); @@ -1208,7 +1212,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);
