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 /drawinglayer/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 'drawinglayer/source')
-rw-r--r-- | drawinglayer/source/primitive2d/controlprimitive2d.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx index 8a06c039a235..846305510397 100644 --- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx @@ -152,18 +152,15 @@ namespace drawinglayer if(pVCLXWindow) { - vcl::Window* pWindow = pVCLXWindow->GetWindow(); + VclPtr<vcl::Window> pWindow = pVCLXWindow->GetWindow(); if(pWindow) { pWindow = pWindow->GetParent(); - if(pWindow) + if(pWindow && MapUnit::Map100thMM == pWindow->GetMapMode().GetMapUnit()) { - if(MapUnit::Map100thMM == pWindow->GetMapMode().GetMapUnit()) - { - bUserIs100thmm = true; - } + bUserIs100thmm = true; } } } |