Kaydet (Commit) 81047eae authored tarafından Caolán McNamara's avatar Caolán McNamara

make animation loop sal_uInt32 consistently

all this foo is ultimately animated gifs and the count there is
limited to unsigned 16bit

Change-Id: Ib6e6dde7355f3619bb7735743e686e6338a235ee
üst ae11dafc
...@@ -186,7 +186,7 @@ private: ...@@ -186,7 +186,7 @@ private:
OUString maUserData; OUString maUserData;
std::unique_ptr<Timer> mxSwapOutTimer; std::unique_ptr<Timer> mxSwapOutTimer;
std::unique_ptr<GrfSimpleCacheObj> mxSimpleCache; std::unique_ptr<GrfSimpleCacheObj> mxSimpleCache;
sal_uLong mnAnimationLoopCount; sal_uInt32 mnAnimationLoopCount;
// a unique increasing ID to be able to say which data change is older // a unique increasing ID to be able to say which data change is older
sal_uLong mnDataChangeTimeStamp; sal_uLong mnDataChangeTimeStamp;
......
...@@ -118,8 +118,8 @@ public: ...@@ -118,8 +118,8 @@ public:
const BitmapEx& GetBitmapEx() const { return maBitmapEx; } const BitmapEx& GetBitmapEx() const { return maBitmapEx; }
void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; } void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; }
sal_uLong GetLoopCount() const { return mnLoopCount; } sal_uInt32 GetLoopCount() const { return mnLoopCount; }
void SetLoopCount( const sal_uLong nLoopCount ); void SetLoopCount(const sal_uInt32 nLoopCount);
void ResetLoopCount(); void ResetLoopCount();
void SetNotifyHdl( const Link<Animation*,void>& rLink ) { maNotifyLink = rLink; } void SetNotifyHdl( const Link<Animation*,void>& rLink ) { maNotifyLink = rLink; }
...@@ -176,8 +176,8 @@ private: ...@@ -176,8 +176,8 @@ private:
BitmapEx maBitmapEx; BitmapEx maBitmapEx;
Timer maTimer; Timer maTimer;
Size maGlobalSize; Size maGlobalSize;
long mnLoopCount; sal_uInt32 mnLoopCount;
long mnLoops; sal_uInt32 mnLoops;
size_t mnPos; size_t mnPos;
bool mbIsInAnimation; bool mbIsInAnimation;
bool mbLoopTerminated; bool mbLoopTerminated;
......
...@@ -187,7 +187,7 @@ public: ...@@ -187,7 +187,7 @@ public:
void SetAnimationNotifyHdl( const Link<Animation*,void>& rLink ); void SetAnimationNotifyHdl( const Link<Animation*,void>& rLink );
Link<Animation*,void> GetAnimationNotifyHdl() const; Link<Animation*,void> GetAnimationNotifyHdl() const;
sal_uLong GetAnimationLoopCount() const; sal_uInt32 GetAnimationLoopCount() const;
BitmapChecksum GetChecksum() const; BitmapChecksum GetChecksum() const;
......
...@@ -744,7 +744,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) ...@@ -744,7 +744,7 @@ void AnimationWindow::AddObj (::sd::View& rView )
// LoopCount // LoopCount
if( i == 0 ) if( i == 0 )
{ {
long nLoopCount = aAnimation.GetLoopCount(); sal_uInt32 nLoopCount = aAnimation.GetLoopCount();
if( !nLoopCount ) // endless if( !nLoopCount ) // endless
m_pLbLoopCount->SelectEntryPos( m_pLbLoopCount->GetEntryCount() - 1); m_pLbLoopCount->SelectEntryPos( m_pLbLoopCount->GetEntryCount() - 1);
...@@ -980,11 +980,11 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) ...@@ -980,11 +980,11 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
// find LoopCount (number of passes) // find LoopCount (number of passes)
AnimationBitmap aAnimBmp; AnimationBitmap aAnimBmp;
long nLoopCount = 0L; sal_uInt32 nLoopCount = 0;
sal_Int32 nPos = m_pLbLoopCount->GetSelectEntryPos(); sal_Int32 nPos = m_pLbLoopCount->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND && nPos != m_pLbLoopCount->GetEntryCount() - 1 ) // endless if( nPos != LISTBOX_ENTRY_NOTFOUND && nPos != m_pLbLoopCount->GetEntryCount() - 1 ) // endless
nLoopCount = (long) m_pLbLoopCount->GetSelectEntry().toInt32(); nLoopCount = m_pLbLoopCount->GetSelectEntry().toUInt32();
aAnimBmp.aBmpEx = *pBitmapEx; aAnimBmp.aBmpEx = *pBitmapEx;
aAnimBmp.aPosPix = aPt; aAnimBmp.aPosPix = aPt;
......
...@@ -337,7 +337,7 @@ namespace slideshow ...@@ -337,7 +337,7 @@ namespace slideshow
int mnIsAnimatedCount; int mnIsAnimatedCount;
/// Number of times the bitmap animation shall loop /// Number of times the bitmap animation shall loop
::std::size_t mnAnimationLoopCount; sal_uInt32 mnAnimationLoopCount;
/// Whether shape is visible (without attribute layers) /// Whether shape is visible (without attribute layers)
bool mbIsVisible; bool mbIsVisible;
......
...@@ -263,7 +263,7 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct ) ...@@ -263,7 +263,7 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct )
} }
bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
::std::size_t& o_rLoopCount, sal_uInt32& o_rLoopCount,
const Graphic& rGraphic ) const Graphic& rGraphic )
{ {
o_rFrames.clear(); o_rFrames.clear();
......
...@@ -112,9 +112,9 @@ namespace slideshow ...@@ -112,9 +112,9 @@ namespace slideshow
@param rGraphic @param rGraphic
Input graphic object, to extract animations from Input graphic object, to extract animations from
*/ */
bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, bool getAnimationFromGraphic(VectorOfMtfAnimationFrames& o_rFrames,
::std::size_t& o_rLoopCount, sal_uInt32& o_rLoopCount,
const Graphic& rGraphic ); const Graphic& rGraphic);
/** Retrieve scroll text animation rectangles from given metafile /** Retrieve scroll text animation rectangles from given metafile
......
...@@ -237,7 +237,7 @@ namespace slideshow ...@@ -237,7 +237,7 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape, const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent, const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts, const ::std::vector<double>& rTimeouts,
::std::size_t nNumLoops ) sal_uInt32 nNumLoops)
{ {
return ActivitySharedPtr( return ActivitySharedPtr(
new IntrinsicAnimationActivity(rContext, new IntrinsicAnimationActivity(rContext,
......
...@@ -60,7 +60,7 @@ namespace slideshow ...@@ -60,7 +60,7 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape, const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent, const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts, const ::std::vector<double>& rTimeouts,
::std::size_t nNumLoops ); sal_uInt32 nNumLoops);
} }
} }
......
...@@ -115,7 +115,7 @@ private: ...@@ -115,7 +115,7 @@ private:
void ImplSetAnimationNotifyHdl( const Link<Animation*,void>& rLink ); void ImplSetAnimationNotifyHdl( const Link<Animation*,void>& rLink );
Link<Animation*,void> ImplGetAnimationNotifyHdl() const; Link<Animation*,void> ImplGetAnimationNotifyHdl() const;
sal_uLong ImplGetAnimationLoopCount() const; sal_uInt32 ImplGetAnimationLoopCount() const;
private: private:
......
...@@ -510,7 +510,7 @@ void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16 ...@@ -510,7 +510,7 @@ void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16
} }
} }
void Animation::SetLoopCount( const sal_uLong nLoopCount ) void Animation::SetLoopCount(const sal_uInt32 nLoopCount)
{ {
mnLoopCount = nLoopCount; mnLoopCount = nLoopCount;
ResetLoopCount(); ResetLoopCount();
...@@ -767,7 +767,7 @@ SvStream& ReadAnimation( SvStream& rIStm, Animation& rAnimation ) ...@@ -767,7 +767,7 @@ SvStream& ReadAnimation( SvStream& rIStm, Animation& rAnimation )
rIStm.ReadUInt16( nTmp16 ); aAnimBmp.nWait = ( ( 65535 == nTmp16 ) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16 ); rIStm.ReadUInt16( nTmp16 ); aAnimBmp.nWait = ( ( 65535 == nTmp16 ) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16 );
rIStm.ReadUInt16( nTmp16 ); aAnimBmp.eDisposal = ( Disposal) nTmp16; rIStm.ReadUInt16( nTmp16 ); aAnimBmp.eDisposal = ( Disposal) nTmp16;
rIStm.ReadCharAsBool( cTmp ); aAnimBmp.bUserInput = cTmp; rIStm.ReadCharAsBool( cTmp ); aAnimBmp.bUserInput = cTmp;
rIStm.ReadUInt32( nTmp32 ); rAnimation.mnLoopCount = (sal_uInt16) nTmp32; rIStm.ReadUInt32( rAnimation.mnLoopCount );
rIStm.ReadUInt32( nTmp32 ); // Unused rIStm.ReadUInt32( nTmp32 ); // Unused
rIStm.ReadUInt32( nTmp32 ); // Unused rIStm.ReadUInt32( nTmp32 ); // Unused
rIStm.ReadUInt32( nTmp32 ); // Unused rIStm.ReadUInt32( nTmp32 ); // Unused
......
...@@ -484,7 +484,7 @@ Link<Animation*,void> Graphic::GetAnimationNotifyHdl() const ...@@ -484,7 +484,7 @@ Link<Animation*,void> Graphic::GetAnimationNotifyHdl() const
return mxImpGraphic->ImplGetAnimationNotifyHdl(); return mxImpGraphic->ImplGetAnimationNotifyHdl();
} }
sal_uLong Graphic::GetAnimationLoopCount() const sal_uInt32 Graphic::GetAnimationLoopCount() const
{ {
return mxImpGraphic->ImplGetAnimationLoopCount(); return mxImpGraphic->ImplGetAnimationLoopCount();
} }
......
...@@ -947,12 +947,11 @@ Link<Animation*,void> ImpGraphic::ImplGetAnimationNotifyHdl() const ...@@ -947,12 +947,11 @@ Link<Animation*,void> ImpGraphic::ImplGetAnimationNotifyHdl() const
return aLink; return aLink;
} }
sal_uLong ImpGraphic::ImplGetAnimationLoopCount() const sal_uInt32 ImpGraphic::ImplGetAnimationLoopCount() const
{ {
return( mpAnimation ? mpAnimation->GetLoopCount() : 0UL ); return( mpAnimation ? mpAnimation->GetLoopCount() : 0 );
} }
void ImpGraphic::ImplSetContext( const std::shared_ptr<GraphicReader>& pReader ) void ImpGraphic::ImplSetContext( const std::shared_ptr<GraphicReader>& pReader )
{ {
mpContext = pReader; mpContext = pReader;
......
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