Kaydet (Commit) 17afe4ce authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert maPages field in SdrModel class from Container to std::vector

Change-Id: Id36c3c414429d8f0e16f8e479f9946511b1e377f
üst ed04025e
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <cppuhelper/weakref.hxx> #include <cppuhelper/weakref.hxx>
#include <sot/storage.hxx> #include <sot/storage.hxx>
#include <tools/link.hxx> #include <tools/link.hxx>
#include <tools/contnr.hxx>
#include <tools/weakbase.hxx> #include <tools/weakbase.hxx>
#include <vcl/mapmod.hxx> #include <vcl/mapmod.hxx>
#include <svl/brdcst.hxx> #include <svl/brdcst.hxx>
...@@ -165,7 +164,7 @@ class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< Sd ...@@ -165,7 +164,7 @@ class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< Sd
protected: protected:
DateTime aReadDate; // Datum des Einstreamens DateTime aReadDate; // Datum des Einstreamens
std::vector<SdrPage*> maMaPag; // StammSeiten (Masterpages) std::vector<SdrPage*> maMaPag; // StammSeiten (Masterpages)
Container maPages; std::vector<SdrPage*> maPages;
Link aUndoLink; // Link fuer einen NotifyUndo-Handler Link aUndoLink; // Link fuer einen NotifyUndo-Handler
Link aIOProgressLink; Link aIOProgressLink;
String aTablePath; String aTablePath;
......
...@@ -227,7 +227,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe ...@@ -227,7 +227,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts): SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts):
aReadDate( DateTime::EMPTY ), aReadDate( DateTime::EMPTY ),
maMaPag(), maMaPag(),
maPages(1024,32,32) maPages()
{ {
#ifdef TIMELOG #ifdef TIMELOG
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" ); RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
...@@ -240,7 +240,7 @@ SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal ...@@ -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): SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts):
aReadDate( DateTime::EMPTY ), aReadDate( DateTime::EMPTY ),
maMaPag(), maMaPag(),
maPages(1024,32,32), maPages(),
aTablePath(rPath) aTablePath(rPath)
{ {
#ifdef TIMELOG #ifdef TIMELOG
...@@ -254,7 +254,7 @@ SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbed ...@@ -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): SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts):
aReadDate( DateTime::EMPTY ), aReadDate( DateTime::EMPTY ),
maMaPag(), maMaPag(),
maPages(1024,32,32) maPages()
{ {
#ifdef TIMELOG #ifdef TIMELOG
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" ); RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
...@@ -267,7 +267,7 @@ SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, boo ...@@ -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): SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts):
aReadDate( DateTime::EMPTY ), aReadDate( DateTime::EMPTY ),
maMaPag(), maMaPag(),
maPages(1024,32,32), maPages(),
aTablePath(rPath) aTablePath(rPath)
{ {
#ifdef TIMELOG #ifdef TIMELOG
...@@ -283,7 +283,7 @@ SdrModel::SdrModel(const SdrModel& /*rSrcModel*/): ...@@ -283,7 +283,7 @@ SdrModel::SdrModel(const SdrModel& /*rSrcModel*/):
tools::WeakBase< SdrModel >(), tools::WeakBase< SdrModel >(),
aReadDate( DateTime::EMPTY ), aReadDate( DateTime::EMPTY ),
maMaPag(), maMaPag(),
maPages(1024,32,32) maPages()
{ {
#ifdef TIMELOG #ifdef TIMELOG
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" ); RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
...@@ -732,7 +732,7 @@ void SdrModel::ClearModel(sal_Bool bCalledFromDestructor) ...@@ -732,7 +732,7 @@ void SdrModel::ClearModel(sal_Bool bCalledFromDestructor)
{ {
DeletePage( (sal_uInt16)i ); DeletePage( (sal_uInt16)i );
} }
maPages.Clear(); maPages.clear();
PageListChanged(); PageListChanged();
// delete all Masterpages // delete all Masterpages
...@@ -1427,11 +1427,10 @@ void SdrModel::RecalcPageNums(bool bMaster) ...@@ -1427,11 +1427,10 @@ void SdrModel::RecalcPageNums(bool bMaster)
} }
else else
{ {
Container& rPL=maPages; sal_uInt16 nAnz=sal_uInt16(maPages.size());
sal_uInt16 nAnz=sal_uInt16(rPL.Count());
sal_uInt16 i; sal_uInt16 i;
for (i=0; i<nAnz; i++) { for (i=0; i<nAnz; i++) {
SdrPage* pPg=(SdrPage*)(rPL.GetObject(i)); SdrPage* pPg=maPages[i];
pPg->SetPageNum(i); pPg->SetPageNum(i);
} }
bPagNumsDirty=sal_False; bPagNumsDirty=sal_False;
...@@ -1442,7 +1441,7 @@ void SdrModel::InsertPage(SdrPage* pPage, sal_uInt16 nPos) ...@@ -1442,7 +1441,7 @@ void SdrModel::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
{ {
sal_uInt16 nAnz=GetPageCount(); sal_uInt16 nAnz=GetPageCount();
if (nPos>nAnz) nPos=nAnz; if (nPos>nAnz) nPos=nAnz;
maPages.Insert(pPage,nPos); maPages.insert(maPages.begin()+nPos,pPage);
PageListChanged(); PageListChanged();
pPage->SetInserted(sal_True); pPage->SetInserted(sal_True);
pPage->SetPageNum(nPos); pPage->SetPageNum(nPos);
...@@ -1462,7 +1461,8 @@ void SdrModel::DeletePage(sal_uInt16 nPgNum) ...@@ -1462,7 +1461,8 @@ void SdrModel::DeletePage(sal_uInt16 nPgNum)
SdrPage* SdrModel::RemovePage(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(); PageListChanged();
if (pPg!=NULL) { if (pPg!=NULL) {
pPg->SetInserted(sal_False); pPg->SetInserted(sal_False);
...@@ -1477,7 +1477,8 @@ SdrPage* SdrModel::RemovePage(sal_uInt16 nPgNum) ...@@ -1477,7 +1477,8 @@ SdrPage* SdrModel::RemovePage(sal_uInt16 nPgNum)
void SdrModel::MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos) 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(); PageListChanged();
if (pPg!=NULL) { if (pPg!=NULL) {
pPg->SetInserted(sal_False); pPg->SetInserted(sal_False);
...@@ -1986,19 +1987,19 @@ SvxNumType SdrModel::GetPageNumType() const ...@@ -1986,19 +1987,19 @@ SvxNumType SdrModel::GetPageNumType() const
const SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum) const const SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum) const
{ {
DBG_ASSERT(nPgNum < maPages.Count(), "SdrModel::GetPage: Access out of range (!)"); DBG_ASSERT(nPgNum < maPages.size(), "SdrModel::GetPage: Access out of range (!)");
return (SdrPage*)(maPages.GetObject(nPgNum)); return maPages[nPgNum];
} }
SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum) SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum)
{ {
DBG_ASSERT(nPgNum < maPages.Count(), "SdrModel::GetPage: Access out of range (!)"); DBG_ASSERT(nPgNum < maPages.size(), "SdrModel::GetPage: Access out of range (!)");
return (SdrPage*)(maPages.GetObject(nPgNum)); return maPages[nPgNum];
} }
sal_uInt16 SdrModel::GetPageCount() const sal_uInt16 SdrModel::GetPageCount() const
{ {
return sal_uInt16(maPages.Count()); return sal_uInt16(maPages.size());
} }
void SdrModel::PageListChanged() void SdrModel::PageListChanged()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment