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

Convert SV_DECL_PTRARR_DEL(SfxDockArr_Impl) to std::vector

Change-Id: I1856a276ee93f35c8f6e7f51c83d7d80c3efd86c
üst 928dbe93
...@@ -65,9 +65,16 @@ struct SfxDock_Impl ...@@ -65,9 +65,16 @@ struct SfxDock_Impl
long nSize; long nSize;
}; };
typedef SfxDock_Impl* SfxDockPtr; class SfxDockArr_Impl : public std::vector<SfxDock_Impl*>
SV_DECL_PTRARR_DEL( SfxDockArr_Impl, SfxDockPtr, 4 ) {
SV_IMPL_PTRARR( SfxDockArr_Impl, SfxDockPtr); public:
~SfxDockArr_Impl()
{
for(const_iterator it = begin(); it != end(); ++it)
delete *it;
}
};
class SfxEmptySplitWin_Impl : public SplitWindow class SfxEmptySplitWin_Impl : public SplitWindow
{ {
...@@ -273,7 +280,7 @@ SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl, ...@@ -273,7 +280,7 @@ SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl,
pDock->bNewLine = sal_True; pDock->bNewLine = sal_True;
} }
pDockArr->Insert(pDock,n); pDockArr->insert(pDockArr->begin() + n, pDock);
} }
} }
} }
...@@ -317,7 +324,7 @@ void SfxSplitWindow::SaveConfig_Impl() ...@@ -317,7 +324,7 @@ void SfxSplitWindow::SaveConfig_Impl()
sal_uInt16 nCount = 0; sal_uInt16 nCount = 0;
sal_uInt16 n; sal_uInt16 n;
for ( n=0; n<pDockArr->Count(); n++ ) for ( n=0; n<pDockArr->size(); n++ )
{ {
SfxDock_Impl *pDock = (*pDockArr)[n]; SfxDock_Impl *pDock = (*pDockArr)[n];
if ( pDock->bHide || pDock->pWin ) if ( pDock->bHide || pDock->pWin )
...@@ -326,7 +333,7 @@ void SfxSplitWindow::SaveConfig_Impl() ...@@ -326,7 +333,7 @@ void SfxSplitWindow::SaveConfig_Impl()
aWinData += String::CreateFromInt32( nCount ); aWinData += String::CreateFromInt32( nCount );
for ( n=0; n<pDockArr->Count(); n++ ) for ( n=0; n<pDockArr->size(); n++ )
{ {
SfxDock_Impl *pDock = (*pDockArr)[n]; SfxDock_Impl *pDock = (*pDockArr)[n];
if ( !pDock->bHide && !pDock->pWin ) if ( !pDock->bHide && !pDock->pWin )
...@@ -394,7 +401,7 @@ void SfxSplitWindow::Split() ...@@ -394,7 +401,7 @@ void SfxSplitWindow::Split()
SplitWindow::Split(); SplitWindow::Split();
sal_uInt16 nCount = pDockArr->Count(); sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
SfxDock_Impl *pD = (*pDockArr)[n]; SfxDock_Impl *pD = (*pDockArr)[n];
...@@ -440,7 +447,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize ...@@ -440,7 +447,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
sal_Bool bNewLine = sal_True; sal_Bool bNewLine = sal_True;
sal_Bool bSaveConfig = sal_False; sal_Bool bSaveConfig = sal_False;
SfxDock_Impl *pFoundDock=0; SfxDock_Impl *pFoundDock=0;
sal_uInt16 nCount = pDockArr->Count(); sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
SfxDock_Impl *pDock = (*pDockArr)[n]; SfxDock_Impl *pDock = (*pDockArr)[n];
...@@ -500,7 +507,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize ...@@ -500,7 +507,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
// Not found, insert at end // Not found, insert at end
pFoundDock = new SfxDock_Impl; pFoundDock = new SfxDock_Impl;
pFoundDock->bHide = sal_True; pFoundDock->bHide = sal_True;
pDockArr->Insert( pFoundDock, nCount ); pDockArr->push_back( pFoundDock );
pFoundDock->nType = pDockWin->GetType(); pFoundDock->nType = pDockWin->GetType();
nLine++; nLine++;
nPos = 0; nPos = 0;
...@@ -527,7 +534,7 @@ void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, sal_Bool bSa ...@@ -527,7 +534,7 @@ void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, sal_Bool bSa
{ {
SfxDock_Impl *pDock=0; SfxDock_Impl *pDock=0;
sal_uInt16 nCount = pDockArr->Count(); sal_uInt16 nCount = pDockArr->size();
sal_Bool bFound = sal_False; sal_Bool bFound = sal_False;
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
...@@ -539,7 +546,7 @@ void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, sal_Bool bSa ...@@ -539,7 +546,7 @@ void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, sal_Bool bSa
// Window has a position, this we forget // Window has a position, this we forget
bFound = sal_True; bFound = sal_True;
pDockArr->Remove(n); pDockArr->erase(pDockArr->begin() + n);
break; break;
} }
} }
...@@ -599,7 +606,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize ...@@ -599,7 +606,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
// The window must be inserted before the first window so that it has the // The window must be inserted before the first window so that it has the
// same or a greater position than pDockWin. // same or a greater position than pDockWin.
sal_uInt16 nCount = pDockArr->Count(); sal_uInt16 nCount = pDockArr->size();
sal_uInt16 nLastWindowIdx(0); sal_uInt16 nLastWindowIdx(0);
// If no window is found, a first window is inserted // If no window is found, a first window is inserted
...@@ -640,7 +647,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize ...@@ -640,7 +647,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
nInsertPos = nLastWindowIdx + 1; // ignore all non-windows after the last window nInsertPos = nLastWindowIdx + 1; // ignore all non-windows after the last window
} }
pDockArr->Insert(pDock, nInsertPos); pDockArr->insert(pDockArr->begin() + nInsertPos, pDock);
InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine ); InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine );
SaveConfig_Impl(); SaveConfig_Impl();
} }
...@@ -794,7 +801,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, sal_Bool bHide ) ...@@ -794,7 +801,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, sal_Bool bHide )
} }
SfxDock_Impl *pDock=0; SfxDock_Impl *pDock=0;
sal_uInt16 nCount = pDockArr->Count(); sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
pDock = (*pDockArr)[n]; pDock = (*pDockArr)[n];
...@@ -1214,7 +1221,7 @@ void SfxSplitWindow::FadeIn() ...@@ -1214,7 +1221,7 @@ void SfxSplitWindow::FadeIn()
void SfxSplitWindow::Show_Impl() void SfxSplitWindow::Show_Impl()
{ {
sal_uInt16 nCount = pDockArr->Count(); sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
SfxDock_Impl *pDock = (*pDockArr)[n]; SfxDock_Impl *pDock = (*pDockArr)[n];
...@@ -1227,7 +1234,7 @@ sal_Bool SfxSplitWindow::ActivateNextChild_Impl( sal_Bool bForward ) ...@@ -1227,7 +1234,7 @@ sal_Bool SfxSplitWindow::ActivateNextChild_Impl( sal_Bool bForward )
{ {
// If no pActive, go to first and last window (!bForward is first // If no pActive, go to first and last window (!bForward is first
// decremented in the loop) // decremented in the loop)
sal_uInt16 nCount = pDockArr->Count(); sal_uInt16 nCount = pDockArr->size();
sal_uInt16 n = bForward ? 0 : nCount; sal_uInt16 n = bForward ? 0 : nCount;
// if Focus is within, then move to a window forward or backwards // if Focus is within, then move to a window forward or backwards
......
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