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 /reportdesign/source | |
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 'reportdesign/source')
-rw-r--r-- | reportdesign/source/ui/inspection/GeometryHandler.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/UITools.cxx | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index e1fff151ebf7..44b783275a9a 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -2070,7 +2070,7 @@ void GeometryHandler::impl_initFieldList_nothrow( uno::Sequence< OUString >& _rF try { uno::Reference< awt::XWindow> xInspectorWindow(m_xContext->getValueByName("DialogParentWindow") ,uno::UNO_QUERY); - vcl::Window* pInspectorWindow = VCLUnoHelper::GetWindow( xInspectorWindow ); + VclPtr<vcl::Window> pInspectorWindow = VCLUnoHelper::GetWindow( xInspectorWindow ); WaitObject aWaitCursor( pInspectorWindow ); uno::Reference< sdbc::XPreparedStatement > xStatement; diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index efb4161d14dd..5fcc67c828c0 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -645,7 +645,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep { SID_ATTR_CHAR_CTL_POSTURE, true }, { SID_ATTR_CHAR_CTL_WEIGHT, true } }; - vcl::Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow ); + VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( _rxParentWindow ); ::std::unique_ptr<FontList> pFontList(new FontList( pParent )); XColorListRef pColorList( XColorList::CreateStdColorList() ); SfxPoolItem* pDefaults[] = @@ -745,7 +745,7 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R std::shared_ptr<rptui::OReportModel> pModel = ::reportdesign::OReportDefinition::getSdrModel(_xShape->getSection()->getReportDefinition()); - vcl::Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow ); + VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( _rxParentWindow ); bool bSuccess = false; try @@ -1015,7 +1015,7 @@ bool openDialogFormula_nothrow( OUString& _in_out_rFormula { xFactory = _xContext->getServiceManager(); xServiceFactory.set(xFactory,uno::UNO_QUERY); - vcl::Window* pParent = VCLUnoHelper::GetWindow( _xInspectorWindow ); + VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( _xInspectorWindow ); uno::Reference< report::meta::XFunctionManager> xMgr(xFactory->createInstanceWithContext("org.libreoffice.report.pentaho.SOFunctionManager",_xContext),uno::UNO_QUERY); if ( xMgr.is() ) |