summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-15 13:04:30 +0200
committerMichael Stahl <mstahl@redhat.com>2012-08-16 18:44:04 +0200
commit17afe4cea7e01aef1e5270cc09f438bc6fde3211 (patch)
tree5b209424e60a9aacd6ed76a495178127750b5e24
parented04025e10815c89fe02d0cf823253d540e21635 (diff)
Convert maPages field in SdrModel class from Container to std::vector
Change-Id: Id36c3c414429d8f0e16f8e479f9946511b1e377f
-rw-r--r--svx/inc/svx/svdmodel.hxx3
-rw-r--r--svx/source/svdraw/svdmodel.cxx35
2 files changed, 19 insertions, 19 deletions
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index 22926d59c06b..39daffeb9d98 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -33,7 +33,6 @@
#include <cppuhelper/weakref.hxx>
#include <sot/storage.hxx>
#include <tools/link.hxx>
-#include <tools/contnr.hxx>
#include <tools/weakbase.hxx>
#include <vcl/mapmod.hxx>
#include <svl/brdcst.hxx>
@@ -165,7 +164,7 @@ class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< Sd
protected:
DateTime aReadDate; // Datum des Einstreamens
std::vector<SdrPage*> maMaPag; // StammSeiten (Masterpages)
- Container maPages;
+ std::vector<SdrPage*> maPages;
Link aUndoLink; // Link fuer einen NotifyUndo-Handler
Link aIOProgressLink;
String aTablePath;
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 7bae5830fe22..6a3de9e5d8a3 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -227,7 +227,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts):
aReadDate( DateTime::EMPTY ),
maMaPag(),
- maPages(1024,32,32)
+ maPages()
{
#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
@@ -240,7 +240,7 @@ SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal
SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts):
aReadDate( DateTime::EMPTY ),
maMaPag(),
- maPages(1024,32,32),
+ maPages(),
aTablePath(rPath)
{
#ifdef TIMELOG
@@ -254,7 +254,7 @@ SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbed
SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts):
aReadDate( DateTime::EMPTY ),
maMaPag(),
- maPages(1024,32,32)
+ maPages()
{
#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
@@ -267,7 +267,7 @@ SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, boo
SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts):
aReadDate( DateTime::EMPTY ),
maMaPag(),
- maPages(1024,32,32),
+ maPages(),
aTablePath(rPath)
{
#ifdef TIMELOG
@@ -283,7 +283,7 @@ SdrModel::SdrModel(const SdrModel& /*rSrcModel*/):
tools::WeakBase< SdrModel >(),
aReadDate( DateTime::EMPTY ),
maMaPag(),
- maPages(1024,32,32)
+ maPages()
{
#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
@@ -732,7 +732,7 @@ void SdrModel::ClearModel(sal_Bool bCalledFromDestructor)
{
DeletePage( (sal_uInt16)i );
}
- maPages.Clear();
+ maPages.clear();
PageListChanged();
// delete all Masterpages
@@ -1427,11 +1427,10 @@ void SdrModel::RecalcPageNums(bool bMaster)
}
else
{
- Container& rPL=maPages;
- sal_uInt16 nAnz=sal_uInt16(rPL.Count());
+ sal_uInt16 nAnz=sal_uInt16(maPages.size());
sal_uInt16 i;
for (i=0; i<nAnz; i++) {
- SdrPage* pPg=(SdrPage*)(rPL.GetObject(i));
+ SdrPage* pPg=maPages[i];
pPg->SetPageNum(i);
}
bPagNumsDirty=sal_False;
@@ -1442,7 +1441,7 @@ void SdrModel::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
{
sal_uInt16 nAnz=GetPageCount();
if (nPos>nAnz) nPos=nAnz;
- maPages.Insert(pPage,nPos);
+ maPages.insert(maPages.begin()+nPos,pPage);
PageListChanged();
pPage->SetInserted(sal_True);
pPage->SetPageNum(nPos);
@@ -1462,7 +1461,8 @@ void SdrModel::DeletePage(sal_uInt16 nPgNum)
SdrPage* SdrModel::RemovePage(sal_uInt16 nPgNum)
{
- SdrPage* pPg=(SdrPage*)maPages.Remove(nPgNum);
+ SdrPage* pPg=maPages[nPgNum];
+ maPages.erase(maPages.begin()+nPgNum);
PageListChanged();
if (pPg!=NULL) {
pPg->SetInserted(sal_False);
@@ -1477,7 +1477,8 @@ SdrPage* SdrModel::RemovePage(sal_uInt16 nPgNum)
void SdrModel::MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
{
- SdrPage* pPg=(SdrPage*)maPages.Remove(nPgNum);
+ SdrPage* pPg=maPages[nPgNum];
+ maPages.erase(maPages.begin()+nPgNum);
PageListChanged();
if (pPg!=NULL) {
pPg->SetInserted(sal_False);
@@ -1986,19 +1987,19 @@ SvxNumType SdrModel::GetPageNumType() const
const SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum) const
{
- DBG_ASSERT(nPgNum < maPages.Count(), "SdrModel::GetPage: Access out of range (!)");
- return (SdrPage*)(maPages.GetObject(nPgNum));
+ DBG_ASSERT(nPgNum < maPages.size(), "SdrModel::GetPage: Access out of range (!)");
+ return maPages[nPgNum];
}
SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum)
{
- DBG_ASSERT(nPgNum < maPages.Count(), "SdrModel::GetPage: Access out of range (!)");
- return (SdrPage*)(maPages.GetObject(nPgNum));
+ DBG_ASSERT(nPgNum < maPages.size(), "SdrModel::GetPage: Access out of range (!)");
+ return maPages[nPgNum];
}
sal_uInt16 SdrModel::GetPageCount() const
{
- return sal_uInt16(maPages.Count());
+ return sal_uInt16(maPages.size());
}
void SdrModel::PageListChanged()