Kaydet (Commit) 51d93012 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SvxXConnectionPreview

Change-Id: Ie634cbf418e49a2272966feafb4bbfa987cad52c
Reviewed-on: https://gerrit.libreoffice.org/55223Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 5848eb90
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <vcl/ctrl.hxx> #include <vcl/ctrl.hxx>
#include <vcl/event.hxx> #include <vcl/event.hxx>
#include <vcl/outdev.hxx> #include <vcl/outdev.hxx>
#include <memory>
namespace vcl { class Window; } namespace vcl { class Window; }
...@@ -45,7 +46,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxXConnectionPreview : public Control ...@@ -45,7 +46,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxXConnectionPreview : public Control
private: private:
SdrEdgeObj* pEdgeObj; SdrEdgeObj* pEdgeObj;
SdrPage* pSdrPage; std::unique_ptr<SdrPage> pSdrPage;
const SdrView* pView; const SdrView* pView;
SVX_DLLPRIVATE void SetStyles(); SVX_DLLPRIVATE void SetStyles();
......
...@@ -54,7 +54,7 @@ SvxXConnectionPreview::~SvxXConnectionPreview() ...@@ -54,7 +54,7 @@ SvxXConnectionPreview::~SvxXConnectionPreview()
void SvxXConnectionPreview::dispose() void SvxXConnectionPreview::dispose()
{ {
delete pSdrPage; pSdrPage.reset();
Control::dispose(); Control::dispose();
} }
...@@ -161,9 +161,9 @@ void SvxXConnectionPreview::Construct() ...@@ -161,9 +161,9 @@ void SvxXConnectionPreview::Construct()
// not yet one. // not yet one.
if(!pSdrPage) if(!pSdrPage)
{ {
pSdrPage = new SdrPage( pSdrPage.reset( new SdrPage(
pView->getSdrModelFromSdrView(), pView->getSdrModelFromSdrView(),
false); false) );
} }
const SdrEdgeObj* pTmpEdgeObj = static_cast<const SdrEdgeObj*>(pObj); const SdrEdgeObj* pTmpEdgeObj = static_cast<const SdrEdgeObj*>(pObj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment