diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-11 14:05:05 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-12 08:01:35 +0200 |
commit | 10629489d39044c79967c0e7a38e1fdd5025f069 (patch) | |
tree | 9405e396ba8ace6dd81254034122147e59c50cd6 /sfx2 | |
parent | 31a4248332cc95a23337ac9c6d7218fe109bce57 (diff) |
sfx2: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ida6aa572b182f966180debc9bf8665975fe51ea2
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/splitwin.cxx | 24 | ||||
-rw-r--r-- | sfx2/source/inc/splitwin.hxx | 5 |
2 files changed, 15 insertions, 14 deletions
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 567fdee700c8..16e5a5b48300 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -285,7 +285,7 @@ SfxSplitWindow::SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl, 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() sal_uInt16 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 ) nCount++; } @@ -348,7 +348,7 @@ void SfxSplitWindow::SaveConfig_Impl() 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 ) continue; if ( rDock.bNewLine ) @@ -419,7 +419,7 @@ void SfxSplitWindow::Split() sal_uInt16 nCount = pDockArr->size(); for ( sal_uInt16 n=0; n<nCount; n++ ) { - const SfxDock_Impl& rD = (*pDockArr)[n]; + const SfxDock_Impl& rD = *(*pDockArr)[n].get(); if ( rD.pWin ) { const sal_uInt16 nId = rD.nType; @@ -476,7 +476,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize sal_uInt16 nCount = pDockArr->size(); for ( sal_uInt16 n=0; n<nCount; n++ ) { - SfxDock_Impl& rDock = (*pDockArr)[n]; + SfxDock_Impl& rDock = *(*pDockArr)[n].get(); if ( rDock.bNewLine ) { // The window opens a new line @@ -533,7 +533,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize // Not found, insert at end pFoundDock = new SfxDock_Impl; pFoundDock->bHide = true; - pDockArr->push_back( pFoundDock ); + pDockArr->push_back( std::unique_ptr<SfxDock_Impl>(pFoundDock) ); pFoundDock->nType = pDockWin->GetType(); nLine++; nPos = 0; @@ -557,11 +557,11 @@ void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, bool bSave) sal_uInt16 nCount = pDockArr->size(); 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.bNewLine && n<nCount-1 ) - (*pDockArr)[n+1].bNewLine = true; + (*pDockArr)[n+1]->bNewLine = true; // Window has a position, this we forget pDockArr->erase(pDockArr->begin() + n); @@ -628,7 +628,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize sal_uInt16 nInsertPos = 0; for ( sal_uInt16 n=0; n<nCount; n++ ) { - SfxDock_Impl& rD = (*pDockArr)[n]; + SfxDock_Impl& rD = *(*pDockArr)[n].get(); if (rD.pWin) { @@ -662,7 +662,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize 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 ); SaveConfig_Impl(); } @@ -782,7 +782,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock, sal_uInt16 nCount = pDockArr->size(); for ( sal_uInt16 n=0; n<nCount; ++n ) { - const SfxDock_Impl& rD = (*pDockArr)[n]; + const SfxDock_Impl& rD = *(*pDockArr)[n].get(); if ( rD.pWin ) { const sal_uInt16 nId = rD.nType; @@ -839,7 +839,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, bool bHide ) sal_uInt16 nCount = pDockArr->size(); for ( sal_uInt16 n=0; n<nCount; n++ ) { - SfxDock_Impl& rDock = (*pDockArr)[n]; + SfxDock_Impl& rDock = *(*pDockArr)[n].get(); if ( rDock.nType == pDockWin->GetType() ) { rDock.pWin = nullptr; diff --git a/sfx2/source/inc/splitwin.hxx b/sfx2/source/inc/splitwin.hxx index 86d9d7f92ed3..2f3b8d65c984 100644 --- a/sfx2/source/inc/splitwin.hxx +++ b/sfx2/source/inc/splitwin.hxx @@ -22,7 +22,8 @@ #include <vcl/splitwin.hxx> #include <sfx2/childwin.hxx> -#include <boost/ptr_container/ptr_vector.hpp> +#include <vector> +#include <memory> class SfxWorkWindow; class SfxDockingWindow; @@ -37,7 +38,7 @@ struct SfxDock_Impl long nSize; }; -typedef boost::ptr_vector<SfxDock_Impl> SfxDockArr_Impl; +typedef std::vector<std::unique_ptr<SfxDock_Impl> > SfxDockArr_Impl; class SfxSplitWindow : public SplitWindow { |