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

Convert SV_DECL_PTRARR(SfxViewShellArr_Impl) to std::vector

Change-Id: I91c33be902e20f72623c3d9642057db5eb6e30ba
üst 59713265
......@@ -40,7 +40,7 @@ class SfxViewFrame;
SV_DECL_PTRARR( SfxViewFrameArr_Impl, SfxViewFrame*, 4 )
class SfxViewShell;
SV_DECL_PTRARR( SfxViewShellArr_Impl, SfxViewShell*, 4 )
class SfxViewShellArr_Impl : public std::vector<SfxViewShell*> {};
struct SfxTbxCtrlFactory;
class SfxTbxCtrlFactArr_Impl : public std::vector<SfxTbxCtrlFactory*>
......
......@@ -2205,7 +2205,7 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl
return sal_False;
}
DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().Count() == SFX_APP()->GetViewShells_Impl().Count(), "Inconsistent view arrays!" );
DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().Count() == SFX_APP()->GetViewShells_Impl().size(), "Inconsistent view arrays!" );
return sal_True;
}
......
......@@ -1297,9 +1297,8 @@ SfxViewShell::SfxViewShell
StartListening(*pViewFrame->GetObjectShell());
// Insert into list
const SfxViewShell *pThis = this; // due to the sick Array syntax
SfxViewShellArr_Impl &rViewArr = SFX_APP()->GetViewShells_Impl();
rViewArr.Insert(pThis, rViewArr.Count() );
rViewArr.push_back(this);
}
//--------------------------------------------------------------------
......@@ -1311,7 +1310,8 @@ SfxViewShell::~SfxViewShell()
// Remove from list
const SfxViewShell *pThis = this;
SfxViewShellArr_Impl &rViewArr = SFX_APP()->GetViewShells_Impl();
rViewArr.Remove( rViewArr.GetPos(pThis) );
SfxViewShellArr_Impl::iterator it = std::find( rViewArr.begin(), rViewArr.end(), pThis );
rViewArr.erase( it );
if ( pImp->xClipboardListener.is() )
{
......@@ -1544,9 +1544,9 @@ SfxViewShell* SfxViewShell::GetFirst
// search for a SfxViewShell of the specified type
SfxViewShellArr_Impl &rShells = SFX_APP()->GetViewShells_Impl();
SfxViewFrameArr_Impl &rFrames = SFX_APP()->GetViewFrames_Impl();
for ( sal_uInt16 nPos = 0; nPos < rShells.Count(); ++nPos )
for ( sal_uInt16 nPos = 0; nPos < rShells.size(); ++nPos )
{
SfxViewShell *pShell = rShells.GetObject(nPos);
SfxViewShell *pShell = rShells[nPos];
if ( pShell )
{
// sometimes dangling SfxViewShells exist that point to a dead SfxViewFrame
......@@ -1582,13 +1582,13 @@ SfxViewShell* SfxViewShell::GetNext
SfxViewShellArr_Impl &rShells = SFX_APP()->GetViewShells_Impl();
SfxViewFrameArr_Impl &rFrames = SFX_APP()->GetViewFrames_Impl();
sal_uInt16 nPos;
for ( nPos = 0; nPos < rShells.Count(); ++nPos )
if ( rShells.GetObject(nPos) == &rPrev )
for ( nPos = 0; nPos < rShells.size(); ++nPos )
if ( rShells[nPos] == &rPrev )
break;
for ( ++nPos; nPos < rShells.Count(); ++nPos )
for ( ++nPos; nPos < rShells.size(); ++nPos )
{
SfxViewShell *pShell = rShells.GetObject(nPos);
SfxViewShell *pShell = rShells[nPos];
if ( pShell )
{
// sometimes dangling SfxViewShells exist that point to a dead SfxViewFrame
......
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