[Libreoffice-commits] core.git: include/svx svx/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Jun 4 12:39:55 UTC 2018
include/svx/dlgctl3d.hxx | 5 +++--
svx/source/dialog/dlgctl3d.cxx | 8 ++++----
2 files changed, 7 insertions(+), 6 deletions(-)
New commits:
commit 68fb5a215aed2905b517cb81a2db162b3735f7fd
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu May 31 10:51:37 2018 +0200
loplugin:useuniqueptr in Svx3DPreviewControl
Change-Id: I088a8521231283e4c9d4c8ee08677496bd244141
Reviewed-on: https://gerrit.libreoffice.org/55229
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svx/dlgctl3d.hxx b/include/svx/dlgctl3d.hxx
index 6bcece170214..84e9d855ef33 100644
--- a/include/svx/dlgctl3d.hxx
+++ b/include/svx/dlgctl3d.hxx
@@ -26,6 +26,7 @@
#include <svl/itemset.hxx>
#include <svx/svxdllapi.h>
#include <basegfx/vector/b3dvector.hxx>
+#include <memory>
class FmFormModel;
class FmFormPage;
@@ -38,9 +39,9 @@ enum class SvxPreviewObjectType { SPHERE, CUBE };
class SAL_WARN_UNUSED SVX_DLLPUBLIC Svx3DPreviewControl : public Control
{
protected:
- FmFormModel* mpModel;
+ std::unique_ptr<FmFormModel> mpModel;
FmFormPage* mpFmPage;
- E3dView* mp3DView;
+ std::unique_ptr<E3dView> mp3DView;
E3dScene* mpScene;
E3dObject* mp3DObj;
SvxPreviewObjectType mnObjectType;
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index 7388d98f3eaf..6d9831fa15ae 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -71,8 +71,8 @@ Svx3DPreviewControl::~Svx3DPreviewControl()
void Svx3DPreviewControl::dispose()
{
- delete mp3DView;
- delete mpModel;
+ mp3DView.reset();
+ mpModel.reset();
Control::dispose();
}
@@ -84,7 +84,7 @@ void Svx3DPreviewControl::Construct()
SetMapMode(MapMode(MapUnit::Map100thMM));
// Model
- mpModel = new FmFormModel();
+ mpModel.reset(new FmFormModel());
mpModel->GetItemPool().FreezeIdRanges();
// Page
@@ -92,7 +92,7 @@ void Svx3DPreviewControl::Construct()
mpModel->InsertPage( mpFmPage, 0 );
// 3D View
- mp3DView = new E3dView(*mpModel, this );
+ mp3DView.reset(new E3dView(*mpModel, this ));
mp3DView->SetBufferedOutputAllowed(true);
mp3DView->SetBufferedOverlayAllowed(true);
More information about the Libreoffice-commits
mailing list