diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-10 12:53:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-11 06:55:41 +0000 |
commit | 78b4a1fb01af9ad3b3395a22f6e396be914b553e (patch) | |
tree | 846fdaea907a70fdc274a1e76642ed5e06622c0d /chart2 | |
parent | 071e23fee07b92b8f07800cda3ca7e66afe818ae (diff) |
update vclwidget loplugin to find ref-dropping assigment
Look for places where we are accidentally assigning a returned-by-value
VclPtr<T> to a T*, which generally ends up in a use-after-free.
Change-Id: I4f361eaca88820cdb7aa3b8340212db61580fdd9
Reviewed-on: https://gerrit.libreoffice.org/30749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
6 files changed, 7 insertions, 7 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx index a903d4b3a6d7..b06f6d456263 100644 --- a/chart2/source/controller/accessibility/AccessibleBase.cxx +++ b/chart2/source/controller/accessibility/AccessibleBase.cxx @@ -681,7 +681,7 @@ awt::Rectangle SAL_CALL AccessibleBase::getBounds() ExplicitValueProvider::getExplicitValueProvider( m_aAccInfo.m_xView )); if( pExplicitValueProvider ) { - vcl::Window* pWindow( VCLUnoHelper::GetWindow( m_aAccInfo.m_xWindow )); + VclPtr<vcl::Window> pWindow( VCLUnoHelper::GetWindow( m_aAccInfo.m_xWindow )); awt::Rectangle aLogicRect( pExplicitValueProvider->getRectangleOfObject( m_aAccInfo.m_aOID.getObjectCID() )); if( pWindow ) { diff --git a/chart2/source/controller/accessibility/AccessibleChartView.cxx b/chart2/source/controller/accessibility/AccessibleChartView.cxx index f24951371df6..823c3b5872fc 100644 --- a/chart2/source/controller/accessibility/AccessibleChartView.cxx +++ b/chart2/source/controller/accessibility/AccessibleChartView.cxx @@ -74,7 +74,7 @@ awt::Rectangle AccessibleChartView::GetWindowPosSize() const awt::Rectangle aBBox( xWindow->getPosSize() ); - vcl::Window* pWindow( VCLUnoHelper::GetWindow( GetInfo().m_xWindow )); + VclPtr<vcl::Window> pWindow( VCLUnoHelper::GetWindow( GetInfo().m_xWindow )); if( pWindow ) { SolarMutexGuard aSolarGuard; @@ -322,7 +322,7 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments aAccInfo.m_pParent = nullptr; aAccInfo.m_spObjectHierarchy = m_spObjectHierarchy; aAccInfo.m_pSdrView = m_pSdrView; - vcl::Window* pWindow = VCLUnoHelper::GetWindow( m_xWindow ); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( m_xWindow ); if ( m_pViewForwarder ) { delete m_pViewForwarder; diff --git a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx index e715e0775d3f..d7d4fdd5ae9b 100644 --- a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx +++ b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx @@ -81,7 +81,7 @@ void SAL_CALL AccessibleTextHelper::initialize( const Sequence< uno::Any >& aArg delete m_pTextHelper; - vcl::Window* pWindow( VCLUnoHelper::GetWindow( xWindow )); + VclPtr<vcl::Window> pWindow( VCLUnoHelper::GetWindow( xWindow )); if( pWindow ) { SdrView * pView = m_pDrawViewWrapper; diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx index 9d0e54ca4c42..bcffbbdfe7c2 100644 --- a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx +++ b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx @@ -38,7 +38,7 @@ NumberFormatDialog::NumberFormatDialog(vcl::Window* pParent, SfxItemSet& rSet) ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ); if ( fnCreatePage ) { - SfxTabPage* pTabPage = (*fnCreatePage)( get_content_area(), &rSet ); + VclPtr<SfxTabPage> pTabPage = (*fnCreatePage)( get_content_area(), &rSet ); pTabPage->PageCreated(rSet); SetTabPage(pTabPage); } diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx index e03a43c7e094..e45b280d6f94 100644 --- a/chart2/source/controller/main/ElementSelector.cxx +++ b/chart2/source/controller/main/ElementSelector.cxx @@ -313,7 +313,7 @@ uno::Reference< awt::XWindow > SAL_CALL ElementSelectorToolbarController::create uno::Reference< awt::XWindow > xItemWindow; if( !m_apSelectorListBox.get() ) { - vcl::Window* pParent = VCLUnoHelper::GetWindow( xParent ); + VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent ); if( pParent ) { m_apSelectorListBox.reset( VclPtr<SelectorListBox>::Create( pParent, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER ) ); diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx index 7265a07b1728..1da8c639343e 100644 --- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx +++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx @@ -68,7 +68,7 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement ( Reference<css::awt::XWindow> xParentWindow (aArguments.getOrDefault("ParentWindow", Reference<css::awt::XWindow>())); Reference<css::frame::XController> xController (aArguments.getOrDefault("Controller", Reference<css::frame::XController>())); - vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); + VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); if ( ! xParentWindow.is() || pParentWindow==nullptr) throw RuntimeException( "PanelFactory::createUIElement called without ParentWindow", |