From 1093c931e9e4c86a47ea5972217719d5fa169b71 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 26 Jan 2021 17:38:23 +0100 Subject: [API CHANGE] PPTX filter: fix lost hide-while-show prop for slide narrations The OOXML markup is , but the UI uses "Hide During Show", which is easier to understand, so use the second naming in the code. With this, the PPTX no longer makes the speaker bitmaps on slides visible while projecting. API change, because the animation node is only available via UNO, though it's likely that no actual external code would ever interact with it directly. (And also add a stub Narration attribute, so that can be implemented in a follow-up commit without an API change.) Change-Id: Ia90a2fb30c2bfdb4cff2901fe11bdf1d4ab38261 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109969 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sd/qa/unit/export-tests-ooxml1.cxx | 5 +++++ sd/source/filter/eppt/pptx-animations.cxx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'sd') diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 392aa4a8b32e..b8189c73a87e 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -1353,6 +1353,11 @@ void SdOOXMLExportTest1::testNarrationMimeType() // i.e. had no children, the whole audio animation node was lost. assertXPath(pSlideDoc, "//p:childTnLst/p:audio/p:cMediaNode", 1); + // Without the accompanying fix in place, this test would have failed with: + // - ... no attribute 'showWhenStopped' exist + // i.e. had the default visibility -> bitmap was visible during slideshow. + assertXPath(pSlideDoc, "//p:childTnLst/p:audio/p:cMediaNode", "showWhenStopped", "0"); + xDocShRef->DoClose(); } diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx index e45ed5783c30..7b64ed365b55 100644 --- a/sd/source/filter/eppt/pptx-animations.cxx +++ b/sd/source/filter/eppt/pptx-animations.cxx @@ -1236,7 +1236,8 @@ void PPTXAnimationExport::WriteAnimationNodeAudio() } mpFS->startElementNS(XML_p, XML_audio); - mpFS->startElementNS(XML_p, XML_cMediaNode); + bool bHideDuringShow = xAudio->getHideDuringShow(); + mpFS->startElementNS(XML_p, XML_cMediaNode, XML_showWhenStopped, bHideDuringShow ? "0" : "1"); mpFS->startElementNS(XML_p, XML_cTn); WriteAnimationCondList(mpContext->getCondition(true), XML_stCondLst); -- cgit