diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-05-07 17:46:01 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-05-08 17:37:26 +0200 |
commit | e3d7fdff5ce3089b24b755063da95a3462b0fc30 (patch) | |
tree | e15fc59e9af4439a6f22acea1401cc687c4b3237 /sd | |
parent | 320cba92847242cfaf34966c3fc32c4e76d45f03 (diff) |
implement PowerPoint 'flash' slide transition (API CHANGE)
It's like 'fade', but using white instead of black. It's a separate
type in the pptx file (although I actually cannot find it
in the spec OOXML, but PowerPoint 2013 generates it).
The API change in XTransitionFactory should be fine, I doubt
there's anything external using it.
Change-Id: I3479840f265ed8227b3b8301ecff56a63d57f493
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93668
Tested-by: Luboš Luňák <l.lunak@collabora.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/eppt/eppt.cxx | 2 | ||||
-rw-r--r-- | sd/source/filter/eppt/epptbase.hxx | 3 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptbase.cxx | 10 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 13 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptanimations.hxx | 3 | ||||
-rw-r--r-- | sd/xml/transitions.xml | 3 |
6 files changed, 29 insertions, 5 deletions
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index a6259824f49c..26f0dae9f234 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -254,7 +254,7 @@ void PPTWriter::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_ sal_Int16 nTST = 0; if ( GetPropertyValue( aAny, mXPagePropSet, "TransitionSubtype" ) && ( aAny >>= nTST ) ) - nTransitionType = GetTransition( nTT, nTST, eFe, nDirection ); + nTransitionType = GetTransition( nTT, nTST, eFe, 0, nDirection ); } if ( !nTransitionType ) diff --git a/sd/source/filter/eppt/epptbase.hxx b/sd/source/filter/eppt/epptbase.hxx index 3a469e7b0611..a5c1a4842f5b 100644 --- a/sd/source/filter/eppt/epptbase.hxx +++ b/sd/source/filter/eppt/epptbase.hxx @@ -405,7 +405,8 @@ public: bool CreateSlideMaster( sal_uInt32 nPageNum ); bool CreateNotes( sal_uInt32 nPageNum ); - static sal_Int8 GetTransition( sal_Int16 nTransitionType, sal_Int16 nTransitionSubtype, css::presentation::FadeEffect eEffect, sal_uInt8& nDirection ); + static sal_Int8 GetTransition( sal_Int16 nTransitionType, sal_Int16 nTransitionSubtype, css::presentation::FadeEffect eEffect, + sal_Int32 nTransitionFadeColor, sal_uInt8& nDirection ); static sal_Int8 GetTransition( css::presentation::FadeEffect eEffect, sal_uInt8& nDirection ); }; diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx index acd5df022a4f..13651f0e8f8b 100644 --- a/sd/source/filter/eppt/pptx-epptbase.cxx +++ b/sd/source/filter/eppt/pptx-epptbase.cxx @@ -711,7 +711,8 @@ bool PPTWriterBase::GetShapeByIndex( sal_uInt32 nIndex, bool bGroup ) return false; } -sal_Int8 PPTWriterBase::GetTransition( sal_Int16 nTransitionType, sal_Int16 nTransitionSubtype, FadeEffect eEffect, sal_uInt8& nDirection ) +sal_Int8 PPTWriterBase::GetTransition( sal_Int16 nTransitionType, sal_Int16 nTransitionSubtype, FadeEffect eEffect, + sal_Int32 nTransitionFadeColor, sal_uInt8& nDirection ) { sal_Int8 nPPTTransitionType = 0; nDirection = 0; @@ -723,7 +724,12 @@ sal_Int8 PPTWriterBase::GetTransition( sal_Int16 nTransitionType, sal_Int16 nTra if ( nTransitionSubtype == TransitionSubType::CROSSFADE ) nPPTTransitionType = PPT_TRANSITION_TYPE_SMOOTHFADE; else if ( nTransitionSubtype == TransitionSubType::FADEOVERCOLOR ) - nPPTTransitionType = PPT_TRANSITION_TYPE_FADE; + { + if( nTransitionFadeColor == static_cast<sal_Int32>(COL_WHITE) ) + nPPTTransitionType = PPT_TRANSITION_TYPE_FLASH; + else + nPPTTransitionType = PPT_TRANSITION_TYPE_FADE; + } } break; case TransitionType::PUSHWIPE : diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 272c5fc31d97..d2fca1e919c7 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -565,7 +565,13 @@ void PowerPointExport::WriteTransition(const FSHelperPtr& pFS) if (ImplGetPropertyValue(mXPagePropSet, "TransitionType") && (mAny >>= nTransitionType) && ImplGetPropertyValue(mXPagePropSet, "TransitionSubtype") && (mAny >>= nTransitionSubtype)) - nPPTTransitionType = GetTransition(nTransitionType, nTransitionSubtype, eFadeEffect, nDirection); + { + // FADEOVERCOLOR with black -> fade, with white -> flash + sal_Int32 nTransitionFadeColor = 0; + if( ImplGetPropertyValue(mXPagePropSet, "TransitionFadeColor")) + mAny >>= nTransitionFadeColor; + nPPTTransitionType = GetTransition(nTransitionType, nTransitionSubtype, eFadeEffect, nTransitionFadeColor, nDirection); + } if (!nPPTTransitionType && eFadeEffect != FadeEffect_NONE) nPPTTransitionType = GetTransition(eFadeEffect, nDirection); @@ -817,6 +823,11 @@ void PowerPointExport::WriteTransition(const FSHelperPtr& pFS) nTransition = XML_zoom; pDirection = (nDirection == 1) ? "in" : "out"; break; + case PPT_TRANSITION_TYPE_FLASH: + nTransition14 = XML_flash; + nTransition = XML_fade; + bOOXmlSpecificTransition = true; + break; // coverity[dead_error_line] - following conditions exist to avoid compiler warning case PPT_TRANSITION_TYPE_NONE: default: diff --git a/sd/source/filter/ppt/pptanimations.hxx b/sd/source/filter/ppt/pptanimations.hxx index 84d168bfaf43..a35f742f53ca 100644 --- a/sd/source/filter/ppt/pptanimations.hxx +++ b/sd/source/filter/ppt/pptanimations.hxx @@ -56,6 +56,9 @@ namespace ppt #define PPT_TRANSITION_TYPE_WHEEL 26 #define PPT_TRANSITION_TYPE_CIRCLE 27 +// undocumented(?) +#define PPT_TRANSITION_TYPE_FLASH 30 + // atoms #define DFF_msofbtAnimEvent 0xf125 #define DFF_msofbtAnimNode 0xf127 diff --git a/sd/xml/transitions.xml b/sd/xml/transitions.xml index cefcab31cf36..78a4d213a029 100644 --- a/sd/xml/transitions.xml +++ b/sd/xml/transitions.xml @@ -134,6 +134,9 @@ <anim:par pres:preset-id="fade-through-black"> <anim:transitionFilter smil:type="fade" smil:subtype="fadeOverColor" smil:fadeColor="#000000"/> </anim:par> + <anim:par pres:preset-id="fade-through-white"> + <anim:transitionFilter smil:type="fade" smil:subtype="fadeOverColor" smil:fadeColor="#FFFFFF"/> + </anim:par> <anim:par pres:preset-id="cut-through-black"> <anim:transitionFilter smil:type="barWipe" smil:subtype="fadeOverColor" smil:fadeColor="#000000"/> </anim:par> |