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 --- oox/source/ppt/timenode.cxx | 6 ++++++ oox/source/ppt/timenodelistcontext.cxx | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'oox/source') diff --git a/oox/source/ppt/timenode.cxx b/oox/source/ppt/timenode.cxx index 132c54b79f4a..978c24a0eabe 100644 --- a/oox/source/ppt/timenode.cxx +++ b/oox/source/ppt/timenode.cxx @@ -336,6 +336,12 @@ namespace oox::ppt { if( xAnimate.is() ) xAnimate->setBy( aValue ); break; + case NP_HIDEDURINGSHOW: + if (xAudio.is() && (aValue >>= bBool)) + { + xAudio->setHideDuringShow(bBool); + } + break; case NP_TARGET: if (xParent.is() && xParent->getType() == AnimationNodeType::ITERATE) diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx index 3b40af62f2d0..d30e69f53be1 100644 --- a/oox/source/ppt/timenodelistcontext.cxx +++ b/oox/source/ppt/timenodelistcontext.cxx @@ -152,6 +152,7 @@ namespace oox::ppt { : TimeNodeContext( rParent, aElement, pNode ) , mbIsNarration( false ) , mbFullScrn( false ) + , mbHideDuringShow(false) { AttributeList attribs( xAttribs ); @@ -179,6 +180,10 @@ namespace oox::ppt { { // TODO deal with mbFullScrn } + else if (aElement == PPT_TOKEN(cMediaNode)) + { + mpNode->getNodeProperties()[NP_HIDEDURINGSHOW] <<= mbHideDuringShow; + } } virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs) override @@ -189,6 +194,9 @@ namespace oox::ppt { return new CommonTimeNodeContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode ); case PPT_TOKEN( tgtEl ): return new TimeTargetElementContext( *this, mpNode->getTarget() ); + case PPT_TOKEN(cMediaNode): + mbHideDuringShow = !rAttribs.getBool(XML_showWhenStopped, true); + break; default: break; } @@ -199,6 +207,7 @@ namespace oox::ppt { private: bool mbIsNarration; bool mbFullScrn; + bool mbHideDuringShow; }; /** CT_TLSetBehavior -- cgit