summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-12-16 17:31:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-12-16 20:26:00 +0000
commit402e020c09ff0a003cfd8f84719ff3cde633a295 (patch)
treefb7a6a58bd5c1803ff207d663455a3bc252f3a4b
parente7f03c29a4c915674247be1946af2101b5a3d7d5 (diff)
this horror depends on unsigned max increment to wrap-around to 0
understandable dbgutil out of bounds iterator checking regression from commit 3af368f0f8e6691aa2eef177ccfcfcb95885c84b Date: Tue Aug 14 21:03:04 2012 +0200 AnimationWindow: convert List to std::vector Change-Id: I8ff3e0726cc0d6e643f2f4e08b0ca41e327e5efc (cherry picked from commit 1c32b8747e0a2051b9abcb1e681c3ca08c039269)
-rw-r--r--sd/source/ui/dlg/animobjs.cxx22
-rw-r--r--sd/source/ui/inc/animobjs.hxx2
2 files changed, 15 insertions, 9 deletions
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 67c292adcf4b..96375d2394c4 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -556,7 +556,8 @@ void AnimationWindow::UpdateControl(bool const bDisableCtrls)
if (!m_FrameList.empty() && !bMovie)
{
- aNumFldBitmap.SetValue(m_nCurrentFrame + 1);
+ size_t nIndex = m_nCurrentFrame + 1;
+ aNumFldBitmap.SetValue(nIndex);
// if there is at least 1 object in the list
aBtnFirst.Enable();
@@ -847,8 +848,9 @@ void AnimationWindow::AddObj (::sd::View& rView )
long nTime = rAnimBmp.nWait;
::tools::Time* pTime = new ::tools::Time( 0, 0, nTime / 100, nTime % 100 );
+ size_t nIndex = m_nCurrentFrame + 1;
m_FrameList.insert(
- m_FrameList.begin() + m_nCurrentFrame + 1,
+ m_FrameList.begin() + nIndex,
::std::make_pair(pBitmapEx, pTime));
// increment => next one inserted after this one
@@ -874,9 +876,9 @@ void AnimationWindow::AddObj (::sd::View& rView )
pSnapShot->GetModel(), pSnapShot).GetBitmapEx() );
::tools::Time* pTime = new ::tools::Time( aTimeField.GetTime() );
-
+ size_t nIndex = m_nCurrentFrame + 1;
m_FrameList.insert(
- m_FrameList.begin() + m_nCurrentFrame + 1,
+ m_FrameList.begin() + nIndex,
::std::make_pair(pBitmapEx, pTime));
// increment => next one inserted after this one
@@ -896,8 +898,9 @@ void AnimationWindow::AddObj (::sd::View& rView )
::tools::Time* pTime = new ::tools::Time( aTimeField.GetTime() );
+ size_t nIndex = m_nCurrentFrame + 1;
m_FrameList.insert(
- m_FrameList.begin() + m_nCurrentFrame + 1,
+ m_FrameList.begin() + nIndex,
::std::make_pair(pBitmapEx, pTime));
}
@@ -907,7 +910,8 @@ void AnimationWindow::AddObj (::sd::View& rView )
SdrMark* pMark = rMarkList.GetMark(0);
SdrObject* pObject = pMark->GetMarkedSdrObj();
SdrObject* pClone = pObject->Clone();
- pPage->InsertObject(pClone, m_nCurrentFrame + 1);
+ size_t nIndex = m_nCurrentFrame + 1;
+ pPage->InsertObject(pClone, nIndex);
}
// several objects: group the clones
else if (nMarkCount > 1)
@@ -926,8 +930,9 @@ void AnimationWindow::AddObj (::sd::View& rView )
::tools::Time* pTime = new ::tools::Time( aTimeField.GetTime() );
+ size_t nIndex = m_nCurrentFrame + 1;
m_FrameList.insert(
- m_FrameList.begin() + m_nCurrentFrame + 1,
+ m_FrameList.begin() + nIndex,
::std::make_pair(pBitmapEx, pTime));
// increment => next one inserted after this one
@@ -945,7 +950,8 @@ void AnimationWindow::AddObj (::sd::View& rView )
for (size_t nObject= 0; nObject < nMarkCount; ++nObject)
pObjList->InsertObject(rMarkList.GetMark(nObject)->GetMarkedSdrObj()->Clone());
- pPage->InsertObject(pCloneGroup, m_nCurrentFrame + 1);
+ size_t nIndex = m_nCurrentFrame + 1;
+ pPage->InsertObject(pCloneGroup, nIndex);
}
}
diff --git a/sd/source/ui/inc/animobjs.hxx b/sd/source/ui/inc/animobjs.hxx
index c4fe3bf9d337..44654b1c7e9f 100644
--- a/sd/source/ui/inc/animobjs.hxx
+++ b/sd/source/ui/inc/animobjs.hxx
@@ -125,7 +125,7 @@ private:
vcl::Window* pWin;
::std::vector< ::std::pair<BitmapEx*, ::tools::Time*> > m_FrameList;
- static const size_t EMPTY_FRAMELIST = ULONG_MAX;
+ static const size_t EMPTY_FRAMELIST = std::numeric_limits<size_t>::max();
size_t m_nCurrentFrame;
SdDrawDocument* pMyDoc;