diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2015-11-06 01:50:01 +0100 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2015-11-08 19:39:14 +0100 |
commit | 4115cb18362810d7b92c5a259fe3399c5e760970 (patch) | |
tree | bfd4eec391f8730c4101ef794431c3784ae52431 | |
parent | 6c4247979d32d7765c0fa892024f62bdae6dfd48 (diff) |
pptx: import/export of "cut through black" transition
"Cut through black" is not supported in ppt so we detectit only
in pptx specific export code. This needed some changes in the
pptx code for exporting transitions.
Change-Id: Ibc7361311017b3ffadd289db4e8ae233e1101ea8
-rw-r--r-- | oox/source/ppt/slidetransition.cxx | 4 | ||||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 209 |
3 files changed, 121 insertions, 95 deletions
diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx index e4950c419edf..4380bbd054c6 100644 --- a/oox/source/ppt/slidetransition.cxx +++ b/oox/source/ppt/slidetransition.cxx @@ -288,11 +288,9 @@ namespace oox { namespace ppt { mbTransitionDirectionNormal = false; break; case PPT_TOKEN( cut ): - // The binfilter seems to ignore this transition. - // Fade to black instead if thrBlk is true. if( param1 ) { - mnTransitionType = TransitionType::FADE; + mnTransitionType = TransitionType::BARWIPE; mnTransitionSubType = TransitionSubType::FADEOVERCOLOR; } OSL_TRACE( "OOX: cut transition fallback." ); diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 73901a089c30..7586d76eebc0 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -1401,6 +1401,9 @@ void SdExportTest::testExportTransitionsPPTX() CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 03, TransitionType::BARWIPE, TransitionSubType::LEFTTORIGHT, false)); CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 04, TransitionType::BARWIPE, TransitionSubType::TOPTOBOTTOM, true)); + // CUT THROUGH BLACK + CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 31, TransitionType::BARWIPE, TransitionSubType::FADEOVERCOLOR)); + // COMB CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 41, TransitionType::PUSHWIPE, TransitionSubType::COMBHORIZONTAL)); CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 42, TransitionType::PUSHWIPE, TransitionSubType::COMBVERTICAL)); diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 7ffae976664e..2cbbbee63971 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -515,7 +515,34 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS ) if( !nPPTTransitionType && eFadeEffect != FadeEffect_NONE ) nPPTTransitionType = GetTransition( eFadeEffect, nDirection ); - if( nPPTTransitionType ) { + bool bOOXmlSpecificTransition = false; + + sal_Int32 nTransition = 0; + const char* pDirection = NULL; + const char* pOrientation = NULL; + const char* pThruBlk = NULL; + const char* pSpokes = NULL; + char pSpokesTmp[2] = "0"; + + if (!nPPTTransitionType) + { + switch(nTransitionType) + { + case animations::TransitionType::BARWIPE: + { + if (animations::TransitionSubType::FADEOVERCOLOR) + { + nTransition = XML_cut; + pThruBlk = "true"; + bOOXmlSpecificTransition = true; + } + } + break; + } + } + + if (nPPTTransitionType || bOOXmlSpecificTransition) + { AnimationSpeed animationSpeed = AnimationSpeed_MEDIUM; const char* speed = NULL; sal_Int32 advanceTiming = -1; @@ -549,99 +576,97 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS ) XML_advTm, advanceTiming != -1 ? I32S( advanceTiming*1000 ) : NULL, FSEND ); - sal_Int32 nTransition = 0; - const char* pDirection = NULL; - const char* pOrientation = NULL; - const char* pThruBlk = NULL; - const char* pSpokes = NULL; - char pSpokesTmp[2] = "0"; - switch( nPPTTransitionType ) { - case PPT_TRANSITION_TYPE_BLINDS: - nTransition = XML_blinds; - pDirection = ( nDirection == 0) ? "vert" : "horz"; - break; - case PPT_TRANSITION_TYPE_CHECKER: - nTransition = XML_checker; - pDirection = ( nDirection == 1) ? "vert" : "horz"; - break; - case PPT_TRANSITION_TYPE_CIRCLE: - nTransition = XML_circle; - break; - case PPT_TRANSITION_TYPE_COMB: - nTransition = XML_comb; - pDirection = ( nDirection == 1) ? "vert" : "horz"; - break; - case PPT_TRANSITION_TYPE_COVER: - nTransition = XML_cover; - pDirection = Get8Direction( nDirection ); - break; - case PPT_TRANSITION_TYPE_DIAMOND: - nTransition = XML_diamond; - break; - case PPT_TRANSITION_TYPE_DISSOLVE: - nTransition = XML_dissolve; - break; - case PPT_TRANSITION_TYPE_FADE: - nTransition = XML_fade; - pThruBlk = "true"; - break; - case PPT_TRANSITION_TYPE_SMOOTHFADE: - nTransition = XML_fade; - break; - case PPT_TRANSITION_TYPE_NEWSFLASH: - nTransition = XML_newsflash; - break; - case PPT_TRANSITION_TYPE_PLUS: - nTransition = XML_plus; - break; - case PPT_TRANSITION_TYPE_PULL: - nTransition = XML_pull; - pDirection = Get8Direction( nDirection ); - break; - case PPT_TRANSITION_TYPE_PUSH: - nTransition = XML_push; - pDirection = GetSideDirection( nDirection ); - break; - case PPT_TRANSITION_TYPE_RANDOM: - nTransition = XML_random; - break; - case PPT_TRANSITION_TYPE_RANDOM_BARS: - nTransition = XML_randomBar; - pDirection = ( nDirection == 1) ? "vert" : "horz"; - break; - case PPT_TRANSITION_TYPE_SPLIT: - nTransition = XML_split; - pDirection = ( nDirection & 1) ? "in" : "out"; - pOrientation = ( nDirection < 2) ? "horz" : "vert"; - break; - case PPT_TRANSITION_TYPE_STRIPS: - nTransition = XML_strips; - pDirection = GetCornerDirection( nDirection ); - break; - case PPT_TRANSITION_TYPE_WEDGE: - nTransition = XML_wedge; - break; - case PPT_TRANSITION_TYPE_WHEEL: - nTransition = XML_wheel; - if( nDirection != 4 && nDirection <= 9 ) { - pSpokesTmp[0] = '0' + nDirection; - pSpokes = pSpokesTmp; + if (!bOOXmlSpecificTransition) + { + switch(nPPTTransitionType) + { + case PPT_TRANSITION_TYPE_BLINDS: + nTransition = XML_blinds; + pDirection = (nDirection == 0) ? "vert" : "horz"; + break; + case PPT_TRANSITION_TYPE_CHECKER: + nTransition = XML_checker; + pDirection = ( nDirection == 1) ? "vert" : "horz"; + break; + case PPT_TRANSITION_TYPE_CIRCLE: + nTransition = XML_circle; + break; + case PPT_TRANSITION_TYPE_COMB: + nTransition = XML_comb; + pDirection = (nDirection == 1) ? "vert" : "horz"; + break; + case PPT_TRANSITION_TYPE_COVER: + nTransition = XML_cover; + pDirection = Get8Direction( nDirection ); + break; + case PPT_TRANSITION_TYPE_DIAMOND: + nTransition = XML_diamond; + break; + case PPT_TRANSITION_TYPE_DISSOLVE: + nTransition = XML_dissolve; + break; + case PPT_TRANSITION_TYPE_FADE: + nTransition = XML_fade; + pThruBlk = "true"; + break; + case PPT_TRANSITION_TYPE_SMOOTHFADE: + nTransition = XML_fade; + break; + case PPT_TRANSITION_TYPE_NEWSFLASH: + nTransition = XML_newsflash; + break; + case PPT_TRANSITION_TYPE_PLUS: + nTransition = XML_plus; + break; + case PPT_TRANSITION_TYPE_PULL: + nTransition = XML_pull; + pDirection = Get8Direction(nDirection); + break; + case PPT_TRANSITION_TYPE_PUSH: + nTransition = XML_push; + pDirection = GetSideDirection(nDirection); + break; + case PPT_TRANSITION_TYPE_RANDOM: + nTransition = XML_random; + break; + case PPT_TRANSITION_TYPE_RANDOM_BARS: + nTransition = XML_randomBar; + pDirection = (nDirection == 1) ? "vert" : "horz"; + break; + case PPT_TRANSITION_TYPE_SPLIT: + nTransition = XML_split; + pDirection = (nDirection & 1) ? "in" : "out"; + pOrientation = (nDirection < 2) ? "horz" : "vert"; + break; + case PPT_TRANSITION_TYPE_STRIPS: + nTransition = XML_strips; + pDirection = GetCornerDirection( nDirection ); + break; + case PPT_TRANSITION_TYPE_WEDGE: + nTransition = XML_wedge; + break; + case PPT_TRANSITION_TYPE_WHEEL: + nTransition = XML_wheel; + if( nDirection != 4 && nDirection <= 9 ) { + pSpokesTmp[0] = '0' + nDirection; + pSpokes = pSpokesTmp; + } + break; + case PPT_TRANSITION_TYPE_WIPE: + nTransition = XML_wipe; + pDirection = GetSideDirection( nDirection ); + break; + case PPT_TRANSITION_TYPE_ZOOM: + nTransition = XML_zoom; + pDirection = (nDirection == 1) ? "in" : "out"; + break; + // coverity[dead_error_line] - following conditions exist to avoid compiler warning + case PPT_TRANSITION_TYPE_NONE: + default: + nTransition = 0; + break; } - break; - case PPT_TRANSITION_TYPE_WIPE: - nTransition = XML_wipe; - pDirection = GetSideDirection( nDirection ); - break; - case PPT_TRANSITION_TYPE_ZOOM: - nTransition = XML_zoom; - pDirection = ( nDirection == 1) ? "in" : "out"; - break; - // coverity[dead_error_line] - following conditions exist to avoid compiler warning - case PPT_TRANSITION_TYPE_NONE: - default: - nTransition = 0; - break; } if( nTransition ) |