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 --- svtools/source/brwbox/editbrowsebox.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'svtools/source') diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 41d824fddbbe..1a9cb86b80aa 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -82,25 +82,25 @@ namespace svt void EditBrowseBox::BrowserMouseEventPtr::Clear() { - DELETEZ(pEvent); + pEvent.reset(); } void EditBrowseBox::BrowserMouseEventPtr::Set(const BrowserMouseEvent* pEvt, bool bIsDown) { - if (pEvt == pEvent) + if (pEvt == pEvent.get()) { bDown = bIsDown; return; } - Clear(); + pEvent.reset(); if (pEvt) { - pEvent = new BrowserMouseEvent(pEvt->GetWindow(), + pEvent.reset(new BrowserMouseEvent(pEvt->GetWindow(), *pEvt, pEvt->GetRow(), pEvt->GetColumn(), pEvt->GetColumnId(), - pEvt->GetRect()); + pEvt->GetRect())); bDown = bIsDown; } } -- cgit