update dev300-m57
[ooovba.git] / applied_patches / 0642-slideshow-cutblack.diff
blobe1d1116fa27c4ebc7cc5b22a8b132f17821a59f3
1 --- sd/source/filter/ppt/pptin.cxx
2 +++ sd/source/filter/ppt/pptin.cxx
3 @@ -1638,7 +1638,11 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const sal_Bool bNewAnimat
4 if ( nDirection == 0 )
5 pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_NONE ); // Direkt
6 else if ( nDirection == 1 )
7 - pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_NONE ); // Direkt ueber Schwarz
8 + {
9 + pPage->setTransitionType( animations::TransitionType::BARWIPE );
10 + pPage->setTransitionSubtype( animations::TransitionSubType::FADEOVERCOLOR );
11 + pPage->setTransitionFadeColor( 0 );
12 + }
14 else
15 pPage->setTransitionType( 0 );
16 diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
17 index 854467b..ec23e29 100644
18 --- slideshow/source/engine/transitions/slidetransitionfactory.cxx
19 +++ slideshow/source/engine/transitions/slidetransitionfactory.cxx
20 @@ -349,6 +349,89 @@ void FadingSlideChange::performOut(
24 +class CutSlideChange : public SlideChangeBase
26 +public:
27 + /** Create a new SlideChanger, for the given leaving and
28 + entering slides, which applies a cut effect.
29 + */
30 + CutSlideChange(
31 + boost::optional<SlideSharedPtr> const & leavingSlide,
32 + const SlideSharedPtr& pEnteringSlide,
33 + const RGBColor& rFadeColor,
34 + const SoundPlayerSharedPtr& pSoundPlayer,
35 + const UnoViewContainer& rViewContainer,
36 + ScreenUpdater& rScreenUpdater,
37 + EventMultiplexer& rEventMultiplexer )
38 + : SlideChangeBase( leavingSlide,
39 + pEnteringSlide,
40 + pSoundPlayer,
41 + rViewContainer,
42 + rScreenUpdater,
43 + rEventMultiplexer ),
44 + maFadeColor( rFadeColor ),
45 + mbFirstTurn( true )
46 + {}
48 + virtual void performIn(
49 + const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
50 + const ViewEntry& rViewEntry,
51 + const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas,
52 + double t );
54 + virtual void performOut(
55 + const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
56 + const ViewEntry& rViewEntry,
57 + const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas,
58 + double t );
60 +private:
61 + RGBColor maFadeColor;
62 + bool mbFirstTurn;
63 +};
65 +void CutSlideChange::performIn(
66 + const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
67 + const ViewEntry& /*rViewEntry*/,
68 + const ::cppcanvas::CanvasSharedPtr& /*rDestinationCanvas*/,
69 + double t )
71 + ENSURE_OR_THROW(
72 + rSprite,
73 + "CutSlideChange::performIn(): Invalid sprite" );
75 + // After 2/3rd of the active time, display new slide
76 + rSprite->setAlpha( t > 2/3.0 ? 1.0 : 0.0 );
79 +void CutSlideChange::performOut(
80 + const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
81 + const ViewEntry& rViewEntry,
82 + const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas,
83 + double t )
85 + ENSURE_OR_THROW(
86 + rSprite,
87 + "CutSlideChange::performOut(): Invalid sprite" );
88 + ENSURE_OR_THROW(
89 + rDestinationCanvas,
90 + "FadingSlideChange::performOut(): Invalid dest canvas" );
92 + if( mbFirstTurn )
93 + {
94 + mbFirstTurn = false;
96 + // clear page to given fade color. 'Leaving' slide is
97 + // painted atop of that
98 + fillPage( rDestinationCanvas,
99 + getEnteringSlideSizePixel( rViewEntry.mpView ),
100 + maFadeColor );
103 + // Until 1/3rd of the active time, display old slide.
104 + rSprite->setAlpha( t > 1/3.0 ? 0.0 : 1.0 );
107 class MovingSlideChange : public SlideChangeBase
109 /// Direction vector for leaving slide,
110 @@ -883,6 +966,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition(
111 pSoundPlayer );
114 + case animations::TransitionType::BARWIPE:
115 case animations::TransitionType::FADE:
117 // black page:
118 @@ -914,16 +998,27 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition(
119 "SlideTransitionFactory::createSlideTransition(): Unknown FADE subtype" );
122 - return NumberAnimationSharedPtr(
123 - new FadingSlideChange(
124 - leavingSlide,
125 - pEnteringSlide,
126 - comphelper::make_optional(
127 - rTransitionFadeColor),
128 - pSoundPlayer,
129 - rViewContainer,
130 - rScreenUpdater,
131 - rEventMultiplexer ));
132 + if( nTransitionType == animations::TransitionType::FADE )
133 + return NumberAnimationSharedPtr(
134 + new FadingSlideChange(
135 + leavingSlide,
136 + pEnteringSlide,
137 + comphelper::make_optional(
138 + rTransitionFadeColor),
139 + pSoundPlayer,
140 + rViewContainer,
141 + rScreenUpdater,
142 + rEventMultiplexer ));
143 + else
144 + return NumberAnimationSharedPtr(
145 + new CutSlideChange(
146 + leavingSlide,
147 + pEnteringSlide,
148 + rTransitionFadeColor,
149 + pSoundPlayer,
150 + rViewContainer,
151 + rScreenUpdater,
152 + rEventMultiplexer ));
156 diff --git a/slideshow/source/engine/transitions/transitionfactorytab.cxx b/slideshow/source/engine/transitions/transitionfactorytab.cxx
157 index d5be3d2..ed3f7dd 100644
158 --- slideshow/source/engine/transitions/transitionfactorytab.cxx
159 +++ slideshow/source/engine/transitions/transitionfactorytab.cxx
160 @@ -2018,6 +2018,20 @@ static const TransitionInfo lcl_transitionInfo[] =
161 true, // 'out' by parameter sweep inversion
162 false // scale isotrophically to target size
164 + // this is the cut through black fade (does not fade, but does a
165 + // hard cut)
167 + animations::TransitionType::BARWIPE,
168 + animations::TransitionSubType::FADEOVERCOLOR,
169 + TransitionInfo::TRANSITION_SPECIAL,
170 + // TODO(F2): Setup parameters
171 + 0.0, // no rotation
172 + 1.0, // no scaling
173 + 1.0, // no scaling
174 + TransitionInfo::REVERSEMETHOD_IGNORE,
175 + true, // 'out' by parameter sweep inversion
176 + false // scale isotrophically to target size
177 + },
180 // mapped to RandomWipe:
182 --- sd/xml/transitions.orig 2008-08-18 15:59:32.000000000 +0200
183 +++ sd/xml/transitions.xml 2008-08-18 16:23:48.000000000 +0200
184 @@ -111,6 +111,9 @@
185 <anim:par pres:preset-id="fade-through-black">
186 <anim:transitionFilter smil:type="fade" smil:subtype="fadeOverColor" smil:fadeColor="#000000"/>
187 </anim:par>
188 + <anim:par pres:preset-id="cut-through-black">
189 + <anim:transitionFilter smil:type="barWipe" smil:subtype="fadeOverColor" smil:fadeColor="#000000"/>
190 + </anim:par>
191 <anim:par pres:preset-id="cover-down">
192 <anim:transitionFilter smil:type="slideWipe" smil:subtype="fromTop"/>
193 </anim:par>