Kaydet (Commit) 10629489 authored tarafından Noel Grandin's avatar Noel Grandin

sfx2: boost::ptr_vector->std::vector<std::unique_ptr>

Change-Id: Ida6aa572b182f966180debc9bf8665975fe51ea2
üst 31a42483
...@@ -285,7 +285,7 @@ SfxSplitWindow::SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl, ...@@ -285,7 +285,7 @@ SfxSplitWindow::SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl,
pDock->bNewLine = true; pDock->bNewLine = true;
} }
pDockArr->insert(pDockArr->begin() + n, pDock); pDockArr->insert(pDockArr->begin() + n, std::unique_ptr<SfxDock_Impl>(pDock));
} }
} }
} }
...@@ -339,7 +339,7 @@ void SfxSplitWindow::SaveConfig_Impl() ...@@ -339,7 +339,7 @@ void SfxSplitWindow::SaveConfig_Impl()
sal_uInt16 n; sal_uInt16 n;
for ( n=0; n<pDockArr->size(); n++ ) for ( n=0; n<pDockArr->size(); n++ )
{ {
const SfxDock_Impl& rDock = (*pDockArr)[n]; const SfxDock_Impl& rDock = *(*pDockArr)[n].get();
if ( rDock.bHide || rDock.pWin ) if ( rDock.bHide || rDock.pWin )
nCount++; nCount++;
} }
...@@ -348,7 +348,7 @@ void SfxSplitWindow::SaveConfig_Impl() ...@@ -348,7 +348,7 @@ void SfxSplitWindow::SaveConfig_Impl()
for ( n=0; n<pDockArr->size(); n++ ) for ( n=0; n<pDockArr->size(); n++ )
{ {
const SfxDock_Impl& rDock = (*pDockArr)[n]; const SfxDock_Impl& rDock = *(*pDockArr)[n].get();
if ( !rDock.bHide && !rDock.pWin ) if ( !rDock.bHide && !rDock.pWin )
continue; continue;
if ( rDock.bNewLine ) if ( rDock.bNewLine )
...@@ -419,7 +419,7 @@ void SfxSplitWindow::Split() ...@@ -419,7 +419,7 @@ void SfxSplitWindow::Split()
sal_uInt16 nCount = pDockArr->size(); sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
const SfxDock_Impl& rD = (*pDockArr)[n]; const SfxDock_Impl& rD = *(*pDockArr)[n].get();
if ( rD.pWin ) if ( rD.pWin )
{ {
const sal_uInt16 nId = rD.nType; const sal_uInt16 nId = rD.nType;
...@@ -476,7 +476,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize ...@@ -476,7 +476,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
sal_uInt16 nCount = pDockArr->size(); sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
SfxDock_Impl& rDock = (*pDockArr)[n]; SfxDock_Impl& rDock = *(*pDockArr)[n].get();
if ( rDock.bNewLine ) if ( rDock.bNewLine )
{ {
// The window opens a new line // The window opens a new line
...@@ -533,7 +533,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize ...@@ -533,7 +533,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 = true; pFoundDock->bHide = true;
pDockArr->push_back( pFoundDock ); pDockArr->push_back( std::unique_ptr<SfxDock_Impl>(pFoundDock) );
pFoundDock->nType = pDockWin->GetType(); pFoundDock->nType = pDockWin->GetType();
nLine++; nLine++;
nPos = 0; nPos = 0;
...@@ -557,11 +557,11 @@ void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, bool bSave) ...@@ -557,11 +557,11 @@ void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, bool bSave)
sal_uInt16 nCount = pDockArr->size(); sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
const SfxDock_Impl& rDock = (*pDockArr)[n]; const SfxDock_Impl& rDock = *(*pDockArr)[n].get();
if ( rDock.nType == pDockWin->GetType() ) if ( rDock.nType == pDockWin->GetType() )
{ {
if ( rDock.bNewLine && n<nCount-1 ) if ( rDock.bNewLine && n<nCount-1 )
(*pDockArr)[n+1].bNewLine = true; (*pDockArr)[n+1]->bNewLine = true;
// Window has a position, this we forget // Window has a position, this we forget
pDockArr->erase(pDockArr->begin() + n); pDockArr->erase(pDockArr->begin() + n);
...@@ -628,7 +628,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize ...@@ -628,7 +628,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
sal_uInt16 nInsertPos = 0; sal_uInt16 nInsertPos = 0;
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
SfxDock_Impl& rD = (*pDockArr)[n]; SfxDock_Impl& rD = *(*pDockArr)[n].get();
if (rD.pWin) if (rD.pWin)
{ {
...@@ -662,7 +662,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize ...@@ -662,7 +662,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(pDockArr->begin() + nInsertPos, pDock); pDockArr->insert(pDockArr->begin() + nInsertPos, std::unique_ptr<SfxDock_Impl>(pDock));
InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine ); InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine );
SaveConfig_Impl(); SaveConfig_Impl();
} }
...@@ -782,7 +782,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock, ...@@ -782,7 +782,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
sal_uInt16 nCount = pDockArr->size(); sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; ++n ) for ( sal_uInt16 n=0; n<nCount; ++n )
{ {
const SfxDock_Impl& rD = (*pDockArr)[n]; const SfxDock_Impl& rD = *(*pDockArr)[n].get();
if ( rD.pWin ) if ( rD.pWin )
{ {
const sal_uInt16 nId = rD.nType; const sal_uInt16 nId = rD.nType;
...@@ -839,7 +839,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, bool bHide ) ...@@ -839,7 +839,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, bool bHide )
sal_uInt16 nCount = pDockArr->size(); sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
SfxDock_Impl& rDock = (*pDockArr)[n]; SfxDock_Impl& rDock = *(*pDockArr)[n].get();
if ( rDock.nType == pDockWin->GetType() ) if ( rDock.nType == pDockWin->GetType() )
{ {
rDock.pWin = nullptr; rDock.pWin = nullptr;
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#include <vcl/splitwin.hxx> #include <vcl/splitwin.hxx>
#include <sfx2/childwin.hxx> #include <sfx2/childwin.hxx>
#include <boost/ptr_container/ptr_vector.hpp> #include <vector>
#include <memory>
class SfxWorkWindow; class SfxWorkWindow;
class SfxDockingWindow; class SfxDockingWindow;
...@@ -37,7 +38,7 @@ struct SfxDock_Impl ...@@ -37,7 +38,7 @@ struct SfxDock_Impl
long nSize; long nSize;
}; };
typedef boost::ptr_vector<SfxDock_Impl> SfxDockArr_Impl; typedef std::vector<std::unique_ptr<SfxDock_Impl> > SfxDockArr_Impl;
class SfxSplitWindow : public SplitWindow class SfxSplitWindow : public SplitWindow
{ {
......
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