Kaydet (Commit) 602a07e1 authored tarafından Noel Grandin's avatar Noel Grandin

drop CycleMode enum

since we only ever used the CYCLE_LOOP enumerator

Change-Id: I181be1e1bba7f72f64420ab22e119d2bffad2d37
üst dd803c6e
......@@ -383,7 +383,6 @@ namespace slideshow
maSubsetting(),
mnIsAnimatedCount(0),
mnAnimationLoopCount(0),
meCycleMode(CYCLE_LOOP),
mbIsVisible( true ),
mbForceUpdate( false ),
mbAttributeLayerRevoked( false ),
......@@ -443,7 +442,6 @@ namespace slideshow
maSubsetting(),
mnIsAnimatedCount(0),
mnAnimationLoopCount(0),
meCycleMode(CYCLE_LOOP),
mbIsVisible( true ),
mbForceUpdate( false ),
mbAttributeLayerRevoked( false ),
......@@ -454,7 +452,6 @@ namespace slideshow
getAnimationFromGraphic( maAnimationFrames,
mnAnimationLoopCount,
meCycleMode,
rGraphic );
ENSURE_OR_THROW( !maAnimationFrames.empty() &&
......@@ -495,7 +492,6 @@ namespace slideshow
maSubsetting( rTreeNode, mpCurrMtf ),
mnIsAnimatedCount(0),
mnAnimationLoopCount(0),
meCycleMode(CYCLE_LOOP),
mbIsVisible( rSrc.mbIsVisible ),
mbForceUpdate( false ),
mbAttributeLayerRevoked( false ),
......@@ -580,8 +576,7 @@ namespace slideshow
pShape,
pWakeupEvent,
aTimeout,
pShape->mnAnimationLoopCount,
pShape->meCycleMode);
pShape->mnAnimationLoopCount);
pWakeupEvent->setActivity( pActivity );
pShape->mpIntrinsicAnimationActivity = pActivity;
......
......@@ -339,9 +339,6 @@ namespace slideshow
/// Number of times the bitmap animation shall loop
::std::size_t mnAnimationLoopCount;
/// Cycle mode for bitmap animation
CycleMode meCycleMode;
/// Whether shape is visible (without attribute layers)
bool mbIsVisible;
......
......@@ -264,7 +264,6 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct )
bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
::std::size_t& o_rLoopCount,
CycleMode& o_eCycleMode,
const Graphic& rGraphic )
{
o_rFrames.clear();
......@@ -291,7 +290,6 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
pVDevMask->EnableMapMode( false );
o_rLoopCount = aAnimation.GetLoopCount();
o_eCycleMode = CYCLE_LOOP;
for( sal_uInt16 i=0, nCount=aAnimation.Count(); i<nCount; ++i )
{
......
......@@ -109,15 +109,11 @@ namespace slideshow
@param o_rLoopCount
Number of times the bitmap animation shall be repeated
@param o_eCycleMode
Repeat mode (normal, or ping-pong mode)
@param rGraphic
Input graphic object, to extract animations from
*/
bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
::std::size_t& o_rLoopCount,
CycleMode& o_eCycleMode,
const Graphic& rGraphic );
/** Retrieve scroll text animation rectangles from given metafile
......
......@@ -65,8 +65,7 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts,
::std::size_t nNumLoops,
CycleMode eCycleMode );
::std::size_t nNumLoops );
IntrinsicAnimationActivity(const IntrinsicAnimationActivity&) = delete;
IntrinsicAnimationActivity& operator=(const IntrinsicAnimationActivity&) = delete;
......@@ -85,7 +84,6 @@ namespace slideshow
WakeupEventSharedPtr mpWakeupEvent;
IntrinsicAnimationEventHandlerSharedPtr mpListener;
::std::vector<double> maTimeouts;
CycleMode meCycleMode;
::std::size_t mnCurrIndex;
::std::size_t mnNumLoops;
::std::size_t mnLoopCount;
......@@ -115,14 +113,12 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts,
::std::size_t nNumLoops,
CycleMode eCycleMode ) :
::std::size_t nNumLoops ) :
maContext( rContext ),
mpDrawShape( rDrawShape ),
mpWakeupEvent( rWakeupEvent ),
mpListener( new IntrinsicAnimationListener(*this) ),
maTimeouts( rTimeouts ),
meCycleMode( eCycleMode ),
mnCurrIndex(0),
mnNumLoops(nNumLoops),
mnLoopCount(0),
......@@ -192,35 +188,14 @@ namespace slideshow
::std::size_t nNewIndex = 0;
const ::std::size_t nNumFrames(maTimeouts.size());
switch( meCycleMode )
{
case CYCLE_LOOP:
{
pDrawShape->setIntrinsicAnimationFrame( mnCurrIndex );
mpWakeupEvent->start();
mpWakeupEvent->setNextTimeout( maTimeouts[mnCurrIndex] );
mnLoopCount += (mnCurrIndex + 1) / nNumFrames;
nNewIndex = (mnCurrIndex + 1) % nNumFrames;
break;
}
case CYCLE_PINGPONGLOOP:
{
::std::size_t nTrueIndex( mnCurrIndex < nNumFrames ?
mnCurrIndex :
2*nNumFrames - mnCurrIndex - 1 );
pDrawShape->setIntrinsicAnimationFrame( nTrueIndex );
mpWakeupEvent->start();
mpWakeupEvent->setNextTimeout( maTimeouts[nTrueIndex] );
mnLoopCount += (mnCurrIndex + 1) / (2*nNumFrames);
nNewIndex = (mnCurrIndex + 1) % 2*nNumFrames;
break;
}
}
pDrawShape->setIntrinsicAnimationFrame( mnCurrIndex );
mpWakeupEvent->start();
mpWakeupEvent->setNextTimeout( maTimeouts[mnCurrIndex] );
mnLoopCount += (mnCurrIndex + 1) / nNumFrames;
nNewIndex = (mnCurrIndex + 1) % nNumFrames;
maContext.mrEventQueue.addEvent( mpWakeupEvent );
maContext.mpSubsettableShapeManager->notifyShapeUpdate( pDrawShape );
......@@ -259,16 +234,14 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts,
::std::size_t nNumLoops,
CycleMode eCycleMode )
::std::size_t nNumLoops )
{
return ActivitySharedPtr(
new IntrinsicAnimationActivity(rContext,
rDrawShape,
rWakeupEvent,
rTimeouts,
nNumLoops,
eCycleMode) );
nNumLoops) );
}
}
}
......
......@@ -60,8 +60,7 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts,
::std::size_t nNumLoops,
CycleMode eCycleMode );
::std::size_t nNumLoops );
}
}
......
......@@ -105,17 +105,6 @@ namespace slideshow
{
namespace internal
{
/** Cycle mode of intrinsic animations
*/
enum CycleMode
{
/// loop the animation back to back
CYCLE_LOOP,
/// loop, but play backwards from end to start
CYCLE_PINGPONGLOOP
};
// Value extraction from Any
// =========================
......
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