Kaydet (Commit) 7f5ebf8b authored tarafından Thorsten Behrens's avatar Thorsten Behrens

MS interop: support for cutblack slidetransition added

Adds CUTBLACK slide transition to ppt import and slideshow
üst 8eddddda
...@@ -1622,7 +1622,11 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const sal_Bool bNewAnimat ...@@ -1622,7 +1622,11 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const sal_Bool bNewAnimat
if ( nDirection == 0 ) if ( nDirection == 0 )
pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_NONE ); // Direkt pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_NONE ); // Direkt
else if ( nDirection == 1 ) else if ( nDirection == 1 )
pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_NONE ); // Direkt ueber Schwarz {
pPage->setTransitionType( animations::TransitionType::BARWIPE );
pPage->setTransitionSubtype( animations::TransitionSubType::FADEOVERCOLOR );
pPage->setTransitionFadeColor( 0 );
}
} }
else else
pPage->setTransitionType( 0 ); pPage->setTransitionType( 0 );
......
...@@ -111,6 +111,9 @@ ...@@ -111,6 +111,9 @@
<anim:par pres:preset-id="fade-through-black"> <anim:par pres:preset-id="fade-through-black">
<anim:transitionFilter smil:type="fade" smil:subtype="fadeOverColor" smil:fadeColor="#000000"/> <anim:transitionFilter smil:type="fade" smil:subtype="fadeOverColor" smil:fadeColor="#000000"/>
</anim:par> </anim:par>
<anim:par pres:preset-id="cut-through-black">
<anim:transitionFilter smil:type="barWipe" smil:subtype="fadeOverColor" smil:fadeColor="#000000"/>
</anim:par>
<anim:par pres:preset-id="cover-down"> <anim:par pres:preset-id="cover-down">
<anim:transitionFilter smil:type="slideWipe" smil:subtype="fromTop"/> <anim:transitionFilter smil:type="slideWipe" smil:subtype="fromTop"/>
</anim:par> </anim:par>
......
...@@ -474,6 +474,89 @@ void FadingSlideChange::performOut( ...@@ -474,6 +474,89 @@ void FadingSlideChange::performOut(
} }
} }
class CutSlideChange : public SlideChangeBase
{
public:
/** Create a new SlideChanger, for the given leaving and
entering slides, which applies a cut effect.
*/
CutSlideChange(
boost::optional<SlideSharedPtr> const & leavingSlide,
const SlideSharedPtr& pEnteringSlide,
const RGBColor& rFadeColor,
const SoundPlayerSharedPtr& pSoundPlayer,
const UnoViewContainer& rViewContainer,
ScreenUpdater& rScreenUpdater,
EventMultiplexer& rEventMultiplexer )
: SlideChangeBase( leavingSlide,
pEnteringSlide,
pSoundPlayer,
rViewContainer,
rScreenUpdater,
rEventMultiplexer ),
maFadeColor( rFadeColor ),
mbFirstTurn( true )
{}
virtual void performIn(
const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
const ViewEntry& rViewEntry,
const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas,
double t );
virtual void performOut(
const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
const ViewEntry& rViewEntry,
const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas,
double t );
private:
RGBColor maFadeColor;
bool mbFirstTurn;
};
void CutSlideChange::performIn(
const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
const ViewEntry& /*rViewEntry*/,
const ::cppcanvas::CanvasSharedPtr& /*rDestinationCanvas*/,
double t )
{
ENSURE_OR_THROW(
rSprite,
"CutSlideChange::performIn(): Invalid sprite" );
// After 2/3rd of the active time, display new slide
rSprite->setAlpha( t > 2/3.0 ? 1.0 : 0.0 );
}
void CutSlideChange::performOut(
const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
const ViewEntry& rViewEntry,
const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas,
double t )
{
ENSURE_OR_THROW(
rSprite,
"CutSlideChange::performOut(): Invalid sprite" );
ENSURE_OR_THROW(
rDestinationCanvas,
"FadingSlideChange::performOut(): Invalid dest canvas" );
if( mbFirstTurn )
{
mbFirstTurn = false;
// clear page to given fade color. 'Leaving' slide is
// painted atop of that
fillPage( rDestinationCanvas,
getEnteringSlideSizePixel( rViewEntry.mpView ),
maFadeColor );
}
// Until 1/3rd of the active time, display old slide.
rSprite->setAlpha( t > 1/3.0 ? 0.0 : 1.0 );
}
class MovingSlideChange : public SlideChangeBase class MovingSlideChange : public SlideChangeBase
{ {
/// Direction vector for leaving slide, /// Direction vector for leaving slide,
...@@ -1008,6 +1091,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( ...@@ -1008,6 +1091,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition(
pSoundPlayer ); pSoundPlayer );
} }
case animations::TransitionType::BARWIPE:
case animations::TransitionType::FADE: case animations::TransitionType::FADE:
{ {
// black page: // black page:
...@@ -1039,16 +1123,27 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( ...@@ -1039,16 +1123,27 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition(
"SlideTransitionFactory::createSlideTransition(): Unknown FADE subtype" ); "SlideTransitionFactory::createSlideTransition(): Unknown FADE subtype" );
} }
return NumberAnimationSharedPtr( if( nTransitionType == animations::TransitionType::FADE )
new FadingSlideChange( return NumberAnimationSharedPtr(
leavingSlide, new FadingSlideChange(
pEnteringSlide, leavingSlide,
comphelper::make_optional( pEnteringSlide,
rTransitionFadeColor), comphelper::make_optional(
pSoundPlayer, rTransitionFadeColor),
rViewContainer, pSoundPlayer,
rScreenUpdater, rViewContainer,
rEventMultiplexer )); rScreenUpdater,
rEventMultiplexer ));
else
return NumberAnimationSharedPtr(
new CutSlideChange(
leavingSlide,
pEnteringSlide,
rTransitionFadeColor,
pSoundPlayer,
rViewContainer,
rScreenUpdater,
rEventMultiplexer ));
} }
} }
} }
......
...@@ -2016,6 +2016,20 @@ static const TransitionInfo lcl_transitionInfo[] = ...@@ -2016,6 +2016,20 @@ static const TransitionInfo lcl_transitionInfo[] =
true, // 'out' by parameter sweep inversion true, // 'out' by parameter sweep inversion
false // scale isotrophically to target size false // scale isotrophically to target size
}, },
// this is the cut through black fade (does not fade, but does a
// hard cut)
{
animations::TransitionType::BARWIPE,
animations::TransitionSubType::FADEOVERCOLOR,
TransitionInfo::TRANSITION_SPECIAL,
// TODO(F2): Setup parameters
0.0, // no rotation
1.0, // no scaling
1.0, // no scaling
TransitionInfo::REVERSEMETHOD_IGNORE,
true, // 'out' by parameter sweep inversion
false // scale isotrophically to target size
},
{ {
// mapped to RandomWipe: // mapped to RandomWipe:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment