diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-16 12:46:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-23 08:14:56 +0200 |
commit | 8e0e2b7dd8d478c443351d0ea7ce271f7e839825 (patch) | |
tree | 7f736f040602c656fea5d2d1f49e19a3aec81a0d | |
parent | e7197e9dc18dd00f1e553edfd163a0570ecde977 (diff) |
loplugin:useuniqueptr in FloatingWindow
Change-Id: I960417daea8a4f3d612278de7a78a8f80630a288
Reviewed-on: https://gerrit.libreoffice.org/53231
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/vcl/floatwin.hxx | 3 | ||||
-rw-r--r-- | vcl/source/window/floatwin.cxx | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx index 6ebb5c84cf37..5e5cfac0d3ac 100644 --- a/include/vcl/floatwin.hxx +++ b/include/vcl/floatwin.hxx @@ -24,6 +24,7 @@ #include <vcl/dllapi.h> #include <vcl/syswin.hxx> #include <o3tl/typed_flags_set.hxx> +#include <memory> class ToolBox; @@ -86,7 +87,7 @@ private: VclPtr<FloatingWindow> mpNextFloat; VclPtr<vcl::Window> mpFirstPopupModeWin; VclPtr<vcl::Window> mxPrevFocusWin; - ImplData* mpImplData; + std::unique_ptr<ImplData> mpImplData; tools::Rectangle maFloatRect; ImplSVEvent * mnPostId; FloatWinPopupFlags mnPopupModeFlags; diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index f7b68203b67c..19c8ed1b5748 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -54,7 +54,7 @@ tools::Rectangle& FloatingWindow::ImplGetItemEdgeClipRect() void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) { - mpImplData = new ImplData; + mpImplData.reset(new ImplData); mpWindowImpl->mbFloatWin = true; mbInCleanUp = false; @@ -216,8 +216,7 @@ void FloatingWindow::dispose() mnPostId = nullptr; } - delete mpImplData; - mpImplData = nullptr; + mpImplData.reset(); mpNextFloat.clear(); mpFirstPopupModeWin.clear(); |