summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-10 12:53:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-11 06:55:41 +0000
commit78b4a1fb01af9ad3b3395a22f6e396be914b553e (patch)
tree846fdaea907a70fdc274a1e76642ed5e06622c0d /vbahelper
parent071e23fee07b92b8f07800cda3ca7e66afe818ae (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 'vbahelper')
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 16dead5c76ad..69e16518838c 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -495,7 +495,7 @@ static Pointer lcl_msoPointerToLOPointer( long msoPointerStyle )
ScVbaControl::getMousePointer() throw (css::uno::RuntimeException, std::exception)
{
PointerStyle eType = PointerStyle::Arrow; // default ?
- vcl::Window* pWindow = VCLUnoHelper::GetWindow( getWindowPeer() );
+ VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( getWindowPeer() );
if ( pWindow )
{
eType = pWindow->GetPointer().GetStyle();
@@ -506,7 +506,7 @@ ScVbaControl::getMousePointer() throw (css::uno::RuntimeException, std::exceptio
void SAL_CALL
ScVbaControl::setMousePointer( ::sal_Int32 _mousepointer ) throw (css::uno::RuntimeException, std::exception)
{
- vcl::Window* pWindow = VCLUnoHelper::GetWindow( getWindowPeer() );
+ VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( getWindowPeer() );
if ( pWindow )
{
Pointer aPointer( PointerStyle::Arrow );
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index e19c1288ef0b..598907a5d575 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -722,7 +722,7 @@ void setCursorHelper( const uno::Reference< frame::XModel >& xModel, const Point
const uno::Reference< frame::XFrame > xFrame ( (*controller)->getFrame(), uno::UNO_SET_THROW );
const uno::Reference< awt::XWindow > xWindow ( xFrame->getContainerWindow(), uno::UNO_SET_THROW );
- vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
+ VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow );
SAL_WARN_IF( !pWindow, "vbahelper", "ScVbaApplication::setCursor: no window!" );
if ( !pWindow )
continue;