summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-04 16:12:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-07 08:33:46 +0200
commitbabaa7afcf38763511a152dcc467c2812349207b (patch)
tree0824af3d0ed3d804c4634271c06d0881ca2fdb05
parent5c632220d3aa8faa66b44ba29fbcc560813a369a (diff)
loplugin:useuniqueptr in SvxTableController
Change-Id: I505f0fe1626e6b935c4194cceaa0f4d0f8756656 Reviewed-on: https://gerrit.libreoffice.org/53879 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/svx/sdr/table/tablecontroller.hxx3
-rw-r--r--svx/source/table/tablecontroller.cxx5
2 files changed, 4 insertions, 4 deletions
diff --git a/include/svx/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx
index fe03d7353a2b..b16b5f30f0b2 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -28,6 +28,7 @@
#include <svx/selectioncontroller.hxx>
#include <svx/svdotable.hxx>
#include <svx/svdview.hxx>
+#include <memory>
class SdrView;
class SdrObject;
@@ -178,7 +179,7 @@ private:
bool mbCellSelectionMode;
CellPos maMouseDownPos;
bool mbLeftButtonDown;
- sdr::overlay::OverlayObjectList* mpSelectionOverlay;
+ std::unique_ptr<sdr::overlay::OverlayObjectList> mpSelectionOverlay;
SdrView& mrView;
tools::WeakReference<SdrTableObj> mxTableObj;
css::uno::Reference< css::util::XModifyListener > mxModifyListener;
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index ecdd0a233be5..9e70356369e3 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -2183,7 +2183,7 @@ void SvxTableController::updateSelectionOverlay()
sdr::overlay::OverlayObjectCell* pOverlay = new sdr::overlay::OverlayObjectCell( aHighlight, aRanges );
xOverlayManager->add(*pOverlay);
- mpSelectionOverlay = new sdr::overlay::OverlayObjectList;
+ mpSelectionOverlay.reset(new sdr::overlay::OverlayObjectList);
mpSelectionOverlay->append(pOverlay);
}
}
@@ -2221,8 +2221,7 @@ void SvxTableController::destroySelectionOverlay()
{
if( mpSelectionOverlay )
{
- delete mpSelectionOverlay;
- mpSelectionOverlay = nullptr;
+ mpSelectionOverlay.reset();
if (comphelper::LibreOfficeKit::isActive())
{