summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-28 12:00:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-04 08:37:32 +0200
commit51d93012d5d947c458c58a92b10b6411e1ebb43d (patch)
tree32fdb694941816f7b5adb784ef00688d1e669326
parent5848eb908fadd8ff8ab73bbbbee1df9743ffb60f (diff)
loplugin:useuniqueptr in SvxXConnectionPreview
Change-Id: Ie634cbf418e49a2272966feafb4bbfa987cad52c Reviewed-on: https://gerrit.libreoffice.org/55223 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/svx/connctrl.hxx3
-rw-r--r--svx/source/dialog/connctrl.cxx6
2 files changed, 5 insertions, 4 deletions
diff --git a/include/svx/connctrl.hxx b/include/svx/connctrl.hxx
index 106140dfa374..0f35c31cf1aa 100644
--- a/include/svx/connctrl.hxx
+++ b/include/svx/connctrl.hxx
@@ -26,6 +26,7 @@
#include <vcl/ctrl.hxx>
#include <vcl/event.hxx>
#include <vcl/outdev.hxx>
+#include <memory>
namespace vcl { class Window; }
@@ -45,7 +46,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxXConnectionPreview : public Control
private:
SdrEdgeObj* pEdgeObj;
- SdrPage* pSdrPage;
+ std::unique_ptr<SdrPage> pSdrPage;
const SdrView* pView;
SVX_DLLPRIVATE void SetStyles();
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index a27dcf0278fd..d46f31beacf7 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -54,7 +54,7 @@ SvxXConnectionPreview::~SvxXConnectionPreview()
void SvxXConnectionPreview::dispose()
{
- delete pSdrPage;
+ pSdrPage.reset();
Control::dispose();
}
@@ -161,9 +161,9 @@ void SvxXConnectionPreview::Construct()
// not yet one.
if(!pSdrPage)
{
- pSdrPage = new SdrPage(
+ pSdrPage.reset( new SdrPage(
pView->getSdrModelFromSdrView(),
- false);
+ false) );
}
const SdrEdgeObj* pTmpEdgeObj = static_cast<const SdrEdgeObj*>(pObj);