summaryrefslogtreecommitdiff
path: root/sd/source/ui/dlg/animobjs.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-26 18:48:32 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-26 21:54:38 +0200
commit868158d6b21a8446d75f1601fa39366b1f54d52c (patch)
tree1eb7589f67c797cb8ee6dc243304031c8f5c09c9 /sd/source/ui/dlg/animobjs.cxx
parent6bcb6e7dcb9f06f4a2b709b26f33d2b07f0d711c (diff)
cid#1608133 Overflowed constant
Change-Id: I38651265938cf076078c34f359b7f3f9ea3728c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175684 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sd/source/ui/dlg/animobjs.cxx')
-rw-r--r--sd/source/ui/dlg/animobjs.cxx79
1 files changed, 42 insertions, 37 deletions
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index fd58db937d89..daf5011aa7de 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -280,55 +280,60 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, weld::Button&, rButton, void )
sal_uLong nTmpTime = 0;
size_t i = 0;
bool bCount = i < nCount;
- if( bReverse )
+ if (bCount)
{
- i = nCount - 1;
- }
- while( bCount && bMovie )
- {
- // make list and view consistent
- assert(i < m_FrameList.size());
- m_nCurrentFrame = i;
-
- UpdateControl(bDisableCtrls);
+ if( bReverse )
+ i = nCount - 1;
- if( m_xRbtBitmap->get_active() )
+ while (bMovie)
{
- ::tools::Time const & rTime = m_FrameList[i].second;
+ // make list and view consistent
+ assert(i < m_FrameList.size());
+ m_nCurrentFrame = i;
- m_xFormatter->SetTime( rTime );
- sal_uLong nTime = rTime.GetMSFromTime();
+ UpdateControl(bDisableCtrls);
- WaitInEffect( nTime, nTmpTime, pProgress.get() );
- nTmpTime += nTime;
- }
- else
- {
- WaitInEffect( 100, nTmpTime, pProgress.get() );
- nTmpTime += 100;
- }
- if( bReverse )
- {
- if (i == 0)
+ if( m_xRbtBitmap->get_active() )
{
- // Terminate loop.
- bCount = false;
+ ::tools::Time const & rTime = m_FrameList[i].second;
+
+ m_xFormatter->SetTime( rTime );
+ sal_uLong nTime = rTime.GetMSFromTime();
+
+ WaitInEffect( nTime, nTmpTime, pProgress.get() );
+ nTmpTime += nTime;
}
else
{
- --i;
+ WaitInEffect( 100, nTmpTime, pProgress.get() );
+ nTmpTime += 100;
}
- }
- else
- {
- i++;
- if (i >= nCount)
+ if( bReverse )
+ {
+ if (i == 0)
+ {
+ // Terminate loop.
+ bCount = false;
+ }
+ else
+ {
+ --i;
+ }
+ }
+ else
{
- // Terminate loop.
- bCount = false;
- // Move i back into valid range.
- i = nCount - 1;
+ i++;
+ if (i >= nCount)
+ {
+ // Terminate loop.
+ bCount = false;
+ // Move i back into valid range.
+ i = nCount - 1;
+ }
}
+
+ if (!bCount)
+ break;
}
}