From 22077670edcec437a3505ae412c06c974f273b7b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 24 Apr 2018 14:51:04 +0200 Subject: loplugin:useuniqueptr in BrowserMouseEventPtr Change-Id: Idbde5b63fc1241bef0a9237727fa1b010ce1eef9 Reviewed-on: https://gerrit.libreoffice.org/53599 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svtools/editbrowsebox.hxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index 5d76e28e46f6..2c66a3cb612e 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -452,7 +452,7 @@ namespace svt class BrowserMouseEventPtr { - BrowserMouseEvent* pEvent; + std::unique_ptr pEvent; bool bDown; public: @@ -461,11 +461,10 @@ namespace svt , bDown(false) { } - ~BrowserMouseEventPtr(){Clear();} bool Is() const {return pEvent != nullptr;} bool IsDown() const {return bDown;} - const BrowserMouseEvent* operator->() const {return pEvent;} + const BrowserMouseEvent* operator->() const {return pEvent.get();} SVT_DLLPUBLIC void Clear(); void Set(const BrowserMouseEvent* pEvt, bool bIsDown); -- cgit