summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2011-05-03 18:23:32 -0430
committerJoseph Powers <jpowers27@cox.net>2011-05-04 05:15:19 -0700
commite8f7f4c38326d7113df2ad898ff864f480336341 (patch)
treef8b24e4c144201c14289eb2514bd97e646f3d0d8
parent62e4b2e2fa9319d3db123226d23a3c41f14dcae5 (diff)
Remove List sd::View::mpLockedRedraws
-rw-r--r--sd/source/ui/inc/View.hxx4
-rw-r--r--sd/source/ui/view/sdview.cxx18
-rw-r--r--sd/source/ui/view/sdview4.cxx32
3 files changed, 19 insertions, 35 deletions
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index efcc6c267777..1387f461cc36 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -29,6 +29,8 @@
#ifndef SD_VIEW_HXX
#define SD_VIEW_HXX
+#include <boost/ptr_container/ptr_vector.hpp>
+
#include "pres.hxx"
#include <tools/gen.hxx>
#include <svtools/transfer.hxx>
@@ -224,7 +226,7 @@ protected:
Timer maDropErrorTimer;
Timer maDropInsertFileTimer;
sal_uInt16 mnLockRedrawSmph;
- List* mpLockedRedraws;
+ boost::ptr_vector<SdViewRedrawRec> maLockedRedraws;
bool mbIsDropAllowed;
DECL_LINK( DropErrorHdl, Timer* );
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index bfd4e48564af..8670778981ee 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -128,7 +128,6 @@ View::View(SdDrawDocument* pDrawDoc, OutputDevice* pOutDev,
mnDragSrcPgNum(SDRPAGE_NOTFOUND),
mnAction(DND_ACTION_NONE),
mnLockRedrawSmph(0),
- mpLockedRedraws(NULL),
mbIsDropAllowed(sal_True),
maSmartTags(*this),
mpClipboard (new ViewClipboard (*this))
@@ -190,18 +189,6 @@ View::~View()
// Alle angemeldeten OutDevs entfernen
DeleteWindowFromPaintView(GetFirstOutputDevice() /*GetWin(0)*/);
}
-
- // gespeicherte Redraws loeschen
- if (mpLockedRedraws)
- {
- SdViewRedrawRec* pRec = (SdViewRedrawRec*)mpLockedRedraws->First();
- while (pRec)
- {
- delete pRec;
- pRec = (SdViewRedrawRec*)mpLockedRedraws->Next();
- }
- delete mpLockedRedraws;
- }
}
@@ -543,13 +530,10 @@ void View::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contac
// oder speichern?
else
{
- if (!mpLockedRedraws)
- mpLockedRedraws = new List;
-
SdViewRedrawRec* pRec = new SdViewRedrawRec;
pRec->mpOut = pOutDev;
pRec->aRect = rReg.GetBoundRect();
- mpLockedRedraws->Insert(pRec, LIST_APPEND);
+ maLockedRedraws.push_back(pRec);
}
}
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index ccabe02c086b..0d389004e8ac 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -585,34 +585,32 @@ void View::LockRedraw(sal_Bool bLock)
// alle gespeicherten Redraws ausfuehren
if (!mnLockRedrawSmph)
{
- while (mpLockedRedraws && mpLockedRedraws->Count())
+ boost::ptr_vector<SdViewRedrawRec>::iterator iter;
+
+ while (!maLockedRedraws.empty())
{
- SdViewRedrawRec* pRec = (SdViewRedrawRec*)mpLockedRedraws->First();
- OutputDevice* pCurrentOut = pRec->mpOut;
- Rectangle aBoundRect(pRec->aRect);
- mpLockedRedraws->Remove(pRec);
- delete pRec;
-
- pRec = (SdViewRedrawRec*)mpLockedRedraws->First();
- while (pRec)
+ iter = maLockedRedraws.begin();
+
+ OutputDevice* pCurrentOut = iter->mpOut;
+ Rectangle aBoundRect(iter->aRect);
+
+ iter = maLockedRedraws.erase(iter);
+
+ while (iter != maLockedRedraws.end())
{
- if (pRec->mpOut == pCurrentOut)
+ if (iter->mpOut == pCurrentOut)
{
- aBoundRect.Union(pRec->aRect);
- mpLockedRedraws->Remove(pRec);
- delete pRec;
- pRec = (SdViewRedrawRec*)mpLockedRedraws->GetCurObject();
+ aBoundRect.Union(iter->aRect);
+ iter = maLockedRedraws.erase(iter);
}
else
{
- pRec = (SdViewRedrawRec*)mpLockedRedraws->Next();
+ ++iter;
}
}
CompleteRedraw(pCurrentOut, Region(aBoundRect));
}
- delete mpLockedRedraws;
- mpLockedRedraws = NULL;
}
}
}