diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-25 16:23:17 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-02-18 00:45:43 +0100 |
commit | 390e951b78288e082361c386ff5c6618d917c333 (patch) | |
tree | de4f00b80ba6183f2678d6582d98d65a94b93aa7 /framework/source/layoutmanager/toolbarlayoutmanager.cxx | |
parent | 599719217423e8468cc54cc74e7850b8a867120b (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>
(cherry picked from commit e6ffb539ee232ea0c679928ff456c1cf97429f63)
Diffstat (limited to 'framework/source/layoutmanager/toolbarlayoutmanager.cxx')
-rw-r--r-- | framework/source/layoutmanager/toolbarlayoutmanager.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 2e28756a7bd0..a22381e560df 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -828,7 +828,7 @@ bool ToolbarLayoutManager::dockToolbar( const OUString& rResourceURL, ui::Dockin { SolarMutexGuard aGuard; - pWindow = VCLUnoHelper::GetWindow( xWindow ); + pWindow = VCLUnoHelper::GetWindow( xWindow ).get(); if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX ) { pToolBox = static_cast<ToolBox *>(pWindow); @@ -1421,7 +1421,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno { { SolarMutexGuard aGuard; - pWindow = VCLUnoHelper::GetWindow( xWindow ); + pWindow = VCLUnoHelper::GetWindow( xWindow ).get(); if ( pWindow ) { OUString aText = pWindow->GetText(); @@ -2262,7 +2262,7 @@ void ToolbarLayoutManager::implts_findNextDockingPos( ui::DockingArea DockingAre { // Retrieve output size from container Window SolarMutexGuard aGuard; - pDockingWindow = VCLUnoHelper::GetWindow( xDockingWindow ); + pDockingWindow = VCLUnoHelper::GetWindow( xDockingWindow ).get(); if ( pDockingWindow ) aDockingWinSize = pDockingWindow->GetOutputSizePixel(); } @@ -2600,7 +2600,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( SolarMutexResettableGuard aReadLock; uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow ); ::Size aContainerWinSize; - vcl::Window* pContainerWindow( nullptr ); + vcl::Window* pContainerWindow( nullptr ); ::Rectangle aDockingAreaOffsets( m_aDockingAreaOffsets ); aReadLock.clear(); @@ -2613,7 +2613,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( { // Retrieve output size from container Window SolarMutexGuard aGuard; - pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); + pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ).get(); aContainerWinSize = pContainerWindow->GetOutputSizePixel(); } @@ -2640,7 +2640,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( { SolarMutexGuard aGuard; - pDockingAreaWindow = VCLUnoHelper::GetWindow( xDockingAreaWindow ); + pDockingAreaWindow = VCLUnoHelper::GetWindow( xDockingAreaWindow ).get(); VclPtr<vcl::Window> pDockWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pDockWindow && pDockWindow->GetType() == WINDOW_TOOLBOX ) pToolBox = static_cast<ToolBox *>(pDockWindow.get()); @@ -3078,7 +3078,7 @@ framework::ToolbarLayoutManager::DockingOperation ToolbarLayoutManager::implts_d vcl::Window* pDockingAreaWindow( nullptr ); { SolarMutexGuard aGuard; - pDockingAreaWindow = VCLUnoHelper::GetWindow( xDockingAreaWindow ); + pDockingAreaWindow = VCLUnoHelper::GetWindow( xDockingAreaWindow ).get(); VclPtr<vcl::Window> pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); nDockPosY = pDockingAreaWindow->ScreenToOutputPixel( pContainerWindow->OutputToScreenPixel( ::Point( 0, nPosY ))).Y(); } @@ -3273,7 +3273,7 @@ throw (uno::RuntimeException, std::exception) ::Point aMousePos; { SolarMutexGuard aGuard; - pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); + pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ).get(); aMousePos = pContainerWindow->ScreenToOutputPixel( ::Point( e.MousePos.X, e.MousePos.Y )); } @@ -3642,7 +3642,7 @@ throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; xWindow.set( e.Source, uno::UNO_QUERY ); - pWindow = VCLUnoHelper::GetWindow( xWindow ); + pWindow = VCLUnoHelper::GetWindow( xWindow ).get(); if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX ) pToolBox = static_cast<ToolBox *>(pWindow); |