summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-25 16:23:17 +0200
committerAndras Timar <andras.timar@collabora.com>2017-02-18 00:45:43 +0100
commit390e951b78288e082361c386ff5c6618d917c333 (patch)
treede4f00b80ba6183f2678d6582d98d65a94b93aa7 /framework
parent599719217423e8468cc54cc74e7850b8a867120b (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')
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx2
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx18
-rw-r--r--framework/source/uielement/addonstoolbarwrapper.cxx2
-rw-r--r--framework/source/uielement/toolbarwrapper.cxx2
4 files changed, 12 insertions, 12 deletions
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 83fc164c4805..756205886d34 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -711,7 +711,7 @@ void LayoutManager::implts_writeWindowStateData( const OUString& aName, const UI
// Retrieve output size from container Window
SolarMutexGuard aGuard;
- pContainerWindow = VCLUnoHelper::GetWindow( m_xContainerWindow );
+ pContainerWindow = VCLUnoHelper::GetWindow( m_xContainerWindow ).get();
if ( pContainerWindow )
aContainerWinSize = pContainerWindow->GetOutputSizePixel();
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);
diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx
index 4de793340e67..0214754d0dca 100644
--- a/framework/source/uielement/addonstoolbarwrapper.cxx
+++ b/framework/source/uielement/addonstoolbarwrapper.cxx
@@ -105,7 +105,7 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument
if ( xFrame.is() && m_aConfigData.getLength() > 0 )
{
// Create VCL based toolbar which will be filled with settings data
- ToolBox* pToolBar = nullptr;
+ VclPtr<ToolBox> pToolBar;
AddonsToolBarManager* pToolBarManager = nullptr;
{
SolarMutexGuard aSolarMutexGuard;
diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx
index 8733666c047b..288294ada9ac 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -141,7 +141,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th
if ( xFrame.is() && m_xConfigSource.is() )
{
// Create VCL based toolbar which will be filled with settings data
- ToolBox* pToolBar = nullptr;
+ VclPtr<ToolBox> pToolBar;
ToolBarManager* pToolBarManager = nullptr;
{
SolarMutexGuard aSolarMutexGuard;