summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-14 12:01:17 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-20 19:46:39 +0200
commit5baef2f4d8cc6e3b27660a044980b9a4ce14d17b (patch)
tree2faf05a212ab16acf52b3cbce658b1d43d283c54 /sfx2
parentaf50c7d9ce96de45d40e6c1462bf1682ce7572a5 (diff)
Convert SV_DECL_PTRARR(SfxObjectShellArr_Impl) to std::vector
Change-Id: I9f26d380526c63a8b86b42a5b0b74a7cfff71249
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/arrdecl.hxx4
-rw-r--r--sfx2/source/appl/app.cxx2
-rw-r--r--sfx2/source/doc/objxtor.cxx21
3 files changed, 12 insertions, 15 deletions
diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx
index 9d1644640ae9..bfade8e7e303 100644
--- a/sfx2/inc/arrdecl.hxx
+++ b/sfx2/inc/arrdecl.hxx
@@ -28,13 +28,11 @@
#ifndef _SFX_ARRDECL_HXX
#define _SFX_ARRDECL_HXX
-#include <svl/svarray.hxx>
#include <sfx2/minarray.hxx>
#include <vector>
-#include <boost/ptr_container/ptr_vector.hpp>
class SfxObjectShell;
-SV_DECL_PTRARR( SfxObjectShellArr_Impl, SfxObjectShell*, 4 )
+class SfxObjectShellArr_Impl : public std::vector<SfxObjectShell*> {};
class SfxViewFrame;
class SfxViewFrameArr_Impl : public std::vector<SfxViewFrame*> {};
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 6d5f30bca0ad..8c85cf10adce 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -231,7 +231,7 @@ SfxApplication::SfxApplication()
SfxApplication::~SfxApplication()
{
- OSL_ENSURE( GetObjectShells_Impl().Count() == 0, "Memory leak: some object shells were not removed!" );
+ OSL_ENSURE( GetObjectShells_Impl().size() == 0, "Memory leak: some object shells were not removed!" );
Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 3d090104d9de..15a7399e14dc 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -288,7 +288,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
{
SfxObjectShell* pDoc = &_rDocShell;
SfxObjectShellArr_Impl &rArr = SFX_APP()->GetObjectShells_Impl();
- rArr.C40_INSERT( SfxObjectShell, pDoc, rArr.Count() );
+ rArr.push_back( pDoc );
bInList = sal_True;
}
@@ -481,10 +481,9 @@ sal_Bool SfxObjectShell::Close()
// remove from Document list
SfxApplication *pSfxApp = SFX_APP();
SfxObjectShellArr_Impl &rDocs = pSfxApp->GetObjectShells_Impl();
- const SfxObjectShell *pThis = this;
- sal_uInt16 nPos = rDocs.GetPos(pThis);
- if ( nPos < rDocs.Count() )
- rDocs.Remove( nPos );
+ SfxObjectShellArr_Impl::iterator it = std::find( rDocs.begin(), rDocs.end(), this );
+ if ( it != rDocs.end() )
+ rDocs.erase( it );
pImp->bInList = sal_False;
}
}
@@ -505,9 +504,9 @@ SfxObjectShell* SfxObjectShell::GetFirst
SfxObjectShellArr_Impl &rDocs = SFX_APP()->GetObjectShells_Impl();
// seach for a SfxDocument of the specified type
- for ( sal_uInt16 nPos = 0; nPos < rDocs.Count(); ++nPos )
+ for ( sal_uInt16 nPos = 0; nPos < rDocs.size(); ++nPos )
{
- SfxObjectShell* pSh = rDocs.GetObject( nPos );
+ SfxObjectShell* pSh = rDocs[ nPos ];
if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() )
continue;
@@ -533,14 +532,14 @@ SfxObjectShell* SfxObjectShell::GetNext
// refind the specified predecessor
sal_uInt16 nPos;
- for ( nPos = 0; nPos < rDocs.Count(); ++nPos )
- if ( rDocs.GetObject(nPos) == &rPrev )
+ for ( nPos = 0; nPos < rDocs.size(); ++nPos )
+ if ( rDocs[nPos] == &rPrev )
break;
// search for the next SfxDocument of the specified type
- for ( ++nPos; nPos < rDocs.Count(); ++nPos )
+ for ( ++nPos; nPos < rDocs.size(); ++nPos )
{
- SfxObjectShell* pSh = rDocs.GetObject( nPos );
+ SfxObjectShell* pSh = rDocs[ nPos ];
if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() )
continue;