diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-16 17:31:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-16 20:25:17 +0000 |
commit | 1c32b8747e0a2051b9abcb1e681c3ca08c039269 (patch) | |
tree | ccc43816038cda5efdea8d48ddaa1113a4e02ed3 /sd | |
parent | org.libreoffice.android.DocumentLoader is not used for anything in LOAndroid3 (diff) | |
download | core-1c32b8747e0a2051b9abcb1e681c3ca08c039269.tar.gz core-1c32b8747e0a2051b9abcb1e681c3ca08c039269.zip |
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
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/animobjs.cxx | 22 | ||||
-rw-r--r-- | sd/source/ui/inc/animobjs.hxx | 2 |
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; |