diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-25 16:23:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-29 06:45:42 +0000 |
commit | e6ffb539ee232ea0c679928ff456c1cf97429f63 (patch) | |
tree | e4b71a9bd49edba1a0f1c95f60f6da81433d1983 /basctl/source/basicide/basidesh.cxx | |
parent | bbc7ed9c379019f31dc7ac234cf83ea151601465 (diff) |
loplugin:vclwidgets check for assigning from VclPt<T> to T*
Inspired by a recent bug report where we were assigning the result
of VclPtr<T>::Create to a raw pointer.
As a consequence, we also need to change various methods that were
returning newly created Window subclasses via raw pointer, to
instead return those via VclPtr
Change-Id: I8118e0195a5b2b4780e646cfb0e151692e54ae2b
Reviewed-on: https://gerrit.libreoffice.org/31318
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl/source/basicide/basidesh.cxx')
-rw-r--r-- | basctl/source/basicide/basidesh.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 417a987223d8..762b90b43b0a 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -309,9 +309,8 @@ void Shell::onDocumentClosed( const ScriptDocument& _rDocument ) } } // delete windows outside main loop so we don't invalidate the original iterator - for (auto it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it) + for (VclPtr<BaseWindow> const & pWin : aDeleteVec) { - BaseWindow* pWin = *it; pWin->StoreData(); if ( pWin == pCurWin ) bSetCurWindow = true; @@ -436,7 +435,7 @@ void Shell::OuterResizePixel( const Point &rPos, const Size &rSize ) IMPL_LINK( Shell, TabBarHdl, ::TabBar *, pCurTabBar, void ) { sal_uInt16 nCurId = pCurTabBar->GetCurPageId(); - BaseWindow* pWin = aWindowTable[ nCurId ]; + BaseWindow* pWin = aWindowTable[ nCurId ].get(); DBG_ASSERT( pWin, "Eintrag in TabBar passt zu keinem Fenster!" ); SetCurWindow( pWin ); } @@ -555,9 +554,8 @@ void Shell::CheckWindows() if ( pWin->GetStatus() & BASWIN_TOBEKILLED ) aDeleteVec.push_back( pWin ); } - for ( auto it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it ) + for ( VclPtr<BaseWindow> const & pWin : aDeleteVec ) { - BaseWindow* pWin = *it; pWin->StoreData(); if ( pWin == pCurWin ) bSetCurWindow = true; @@ -578,9 +576,8 @@ void Shell::RemoveWindows( const ScriptDocument& rDocument, const OUString& rLib if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName ) aDeleteVec.push_back( pWin ); } - for ( auto it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it ) + for ( VclPtr<BaseWindow> const & pWin : aDeleteVec ) { - BaseWindow* pWin = *it; if ( pWin == pCurWin ) bChangeCurWindow = true; pWin->StoreData(); @@ -733,7 +730,7 @@ void Shell::UpdateWindows() { if ( !pNextActiveWindow ) { - pNextActiveWindow = FindApplicationWindow(); + pNextActiveWindow = FindApplicationWindow().get(); } SetCurWindow( pNextActiveWindow, true ); } |