[Libreoffice-commits] core.git: include/svx svx/source sw/inc sw/source

Noel Grandin noelgrandin at gmail.com
Tue Jul 3 06:18:45 UTC 2018


 include/svx/cube3d.hxx           |    2 +-
 include/svx/extrud3d.hxx         |    2 +-
 include/svx/lathe3d.hxx          |    2 +-
 include/svx/polygn3d.hxx         |    2 +-
 include/svx/scene3d.hxx          |    2 +-
 include/svx/sphere3d.hxx         |    2 +-
 include/svx/svdoashp.hxx         |    2 +-
 include/svx/svdobj.hxx           |    2 +-
 include/svx/svdocapt.hxx         |    2 +-
 include/svx/svdocirc.hxx         |    2 +-
 include/svx/svdoedge.hxx         |    2 +-
 include/svx/svdograf.hxx         |    2 +-
 include/svx/svdogrp.hxx          |    2 +-
 include/svx/svdomeas.hxx         |    2 +-
 include/svx/svdomedia.hxx        |    2 +-
 include/svx/svdoole2.hxx         |    2 +-
 include/svx/svdopage.hxx         |    2 +-
 include/svx/svdopath.hxx         |    2 +-
 include/svx/svdorect.hxx         |    2 +-
 include/svx/svdotable.hxx        |    2 +-
 include/svx/svdotext.hxx         |    2 +-
 include/svx/svdouno.hxx          |    2 +-
 include/svx/svdovirt.hxx         |    2 +-
 svx/source/engine3d/cube3d.cxx   |    5 +++--
 svx/source/engine3d/extrud3d.cxx |    5 +++--
 svx/source/engine3d/lathe3d.cxx  |    5 +++--
 svx/source/engine3d/polygn3d.cxx |    5 +++--
 svx/source/engine3d/scene3d.cxx  |    5 +++--
 svx/source/engine3d/sphere3d.cxx |    5 +++--
 svx/source/svdraw/svdoashp.cxx   |    5 +++--
 svx/source/svdraw/svdobj.cxx     |    9 +++++----
 svx/source/svdraw/svdocapt.cxx   |    5 +++--
 svx/source/svdraw/svdocirc.cxx   |    5 +++--
 svx/source/svdraw/svdoedge.cxx   |    5 +++--
 svx/source/svdraw/svdograf.cxx   |    5 +++--
 svx/source/svdraw/svdogrp.cxx    |    5 +++--
 svx/source/svdraw/svdomeas.cxx   |    5 +++--
 svx/source/svdraw/svdomedia.cxx  |    5 +++--
 svx/source/svdraw/svdoole2.cxx   |    4 ++--
 svx/source/svdraw/svdopage.cxx   |    5 +++--
 svx/source/svdraw/svdopath.cxx   |    5 +++--
 svx/source/svdraw/svdorect.cxx   |    5 +++--
 svx/source/svdraw/svdotext.cxx   |    5 +++--
 svx/source/svdraw/svdouno.cxx    |    5 +++--
 svx/source/svdraw/svdovirt.cxx   |    5 +++--
 svx/source/table/svdotable.cxx   |    4 ++--
 sw/inc/dcontact.hxx              |    2 +-
 sw/source/core/draw/dcontact.cxx |    5 +++--
 sw/source/core/draw/dflyobj.cxx  |    9 +++++----
 sw/source/core/inc/dflyobj.hxx   |    4 ++--
 50 files changed, 103 insertions(+), 80 deletions(-)

New commits:
commit dbdf5ef32e2fc041183b762d9a1561430c96470b
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sun Jul 1 22:04:20 2018 +0200

    use std::unique_ptr for CreateObjectSpecificViewContact
    
    Change-Id: I0fed54d345a43fe0bc21ebbe424e6fdc7eac9523
    Reviewed-on: https://gerrit.libreoffice.org/56823
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/cube3d.hxx b/include/svx/cube3d.hxx
index 570805f8a908..b67d6995a5de 100644
--- a/include/svx/cube3d.hxx
+++ b/include/svx/cube3d.hxx
@@ -55,7 +55,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC E3dCubeObj final : public E3dCompoundObject
     bool                                bPosIsCenter : 1;
 
     void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
 private:
     // protected destructor - due to final, make private
diff --git a/include/svx/extrud3d.hxx b/include/svx/extrud3d.hxx
index 656a1114a3ee..4bdb696decdf 100644
--- a/include/svx/extrud3d.hxx
+++ b/include/svx/extrud3d.hxx
@@ -38,7 +38,7 @@ private:
     // geometry, which determines the object
     basegfx::B2DPolyPolygon         maExtrudePolygon;
 
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
     void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
 
diff --git a/include/svx/lathe3d.hxx b/include/svx/lathe3d.hxx
index 073bf5787e3c..8875621dc4ea 100644
--- a/include/svx/lathe3d.hxx
+++ b/include/svx/lathe3d.hxx
@@ -37,7 +37,7 @@ class SVX_DLLPUBLIC E3dLatheObj final : public E3dCompoundObject
 {
     basegfx::B2DPolyPolygon maPolyPoly2D;
 
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
     void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
 
diff --git a/include/svx/polygn3d.hxx b/include/svx/polygn3d.hxx
index da2225c74360..9d5940adf9e4 100644
--- a/include/svx/polygn3d.hxx
+++ b/include/svx/polygn3d.hxx
@@ -36,7 +36,7 @@ private:
     SVX_DLLPRIVATE void CreateDefaultTexture();
 
 protected:
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
     // protected destructor
     virtual ~E3dPolygonObj() override;
diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx
index bc65f352f741..d3682c7369ff 100644
--- a/include/svx/scene3d.hxx
+++ b/include/svx/scene3d.hxx
@@ -61,7 +61,7 @@ class SVX_DLLPUBLIC E3dScene : public E3dObject, public SdrObjList
 {
 protected:
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
     // transformations
     B3dCamera                   aCameraSet;
diff --git a/include/svx/sphere3d.hxx b/include/svx/sphere3d.hxx
index ca1d9ec644ef..490bf268942a 100644
--- a/include/svx/sphere3d.hxx
+++ b/include/svx/sphere3d.hxx
@@ -33,7 +33,7 @@ private:
     basegfx::B3DPoint               aCenter;
     basegfx::B3DVector              aSize;
 
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
     void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
 
diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx
index 8247b9b5fcce..f88b67755257 100644
--- a/include/svx/svdoashp.hxx
+++ b/include/svx/svdoashp.hxx
@@ -80,7 +80,7 @@ private:
     bool mbAdjustingTextFrameWidthAndHeight;
 
 protected:
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual void impl_setUnoShape(const css::uno::Reference<css::uno::XInterface>& rxUnoShape) override;
 
 public:
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index d97edb022e4c..fa3a9cfff7b8 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -951,7 +951,7 @@ protected:
 
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
 
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact();
 
     tools::Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
 
diff --git a/include/svx/svdocapt.hxx b/include/svx/svdocapt.hxx
index 0539861eb969..6791cf95d218 100644
--- a/include/svx/svdocapt.hxx
+++ b/include/svx/svdocapt.hxx
@@ -48,7 +48,7 @@ private:
 
 protected:
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
 private:
     tools::Polygon aTailPoly;  // the whole tail polygon
diff --git a/include/svx/svdocirc.hxx b/include/svx/svdocirc.hxx
index 0ec5ff01afae..62fa7c8be431 100644
--- a/include/svx/svdocirc.hxx
+++ b/include/svx/svdocirc.hxx
@@ -47,7 +47,7 @@ private:
     // only for SdrCircleAttributes
     SdrObjKind GetCircleKind() const { return meCircleKind; }
 
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
 
     SdrObjKind                  meCircleKind;
diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index 366963395a32..723741ef12a1 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -136,7 +136,7 @@ private:
     friend class                ImpEdgeHdl;
 
 protected:
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
 
     SdrObjConnection            aCon1;  // Connection status of the beginning of the line
diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index 8171f353936d..6a146934ad5d 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -85,7 +85,7 @@ private:
     friend class SdrExchangeView; // Only for a ForceSwapIn() call.
     friend class SdrGraphicLink;
 
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
 
     void ImpSetAttrToGrafInfo(); // Copy values from the pool
diff --git a/include/svx/svdogrp.hxx b/include/svx/svdogrp.hxx
index 53f4107b8248..351000746e0a 100644
--- a/include/svx/svdogrp.hxx
+++ b/include/svx/svdogrp.hxx
@@ -32,7 +32,7 @@ class SfxItemSet;
 class SVX_DLLPUBLIC SdrObjGroup final : public SdrObject, public SdrObjList
 {
 private:
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
 
     Point                       aRefPoint;      // Reference point inside the object group
diff --git a/include/svx/svdomeas.hxx b/include/svx/svdomeas.hxx
index 0e30251dcab5..6e3e6afdf455 100644
--- a/include/svx/svdomeas.hxx
+++ b/include/svx/svdomeas.hxx
@@ -52,7 +52,7 @@ private:
     friend class                SdrMeasureField;
 
 protected:
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
 
     Point                       aPt1;
diff --git a/include/svx/svdomedia.hxx b/include/svx/svdomedia.hxx
index f99fd2570133..c5dfdda2ea2b 100644
--- a/include/svx/svdomedia.hxx
+++ b/include/svx/svdomedia.hxx
@@ -73,7 +73,7 @@ public:
 
 private:
         void                mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState );
-        virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+        virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
         struct Impl;
         std::unique_ptr<Impl> m_xImpl;
diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index 4a202632edea..a0bb2c385df9 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -62,7 +62,7 @@ private:
     SVX_DLLPRIVATE void Init();
 
 protected:
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
 
     // protected destructor
diff --git a/include/svx/svdopage.hxx b/include/svx/svdopage.hxx
index a23727e62b72..c666e552e56e 100644
--- a/include/svx/svdopage.hxx
+++ b/include/svx/svdopage.hxx
@@ -37,7 +37,7 @@ private:
     SdrPage*                                mpShownPage;
 
 protected:
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
 
     // protected destructor
diff --git a/include/svx/svdopath.hxx b/include/svx/svdopath.hxx
index d626747f31b6..0f58f1f7354c 100644
--- a/include/svx/svdopath.hxx
+++ b/include/svx/svdopath.hxx
@@ -47,7 +47,7 @@ class SVX_DLLPUBLIC SdrPathObj final : public SdrTextObj
 private:
     friend class ImpPathForDragAndCreate;
 
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
     basegfx::B2DPolyPolygon maPathPolygon;
     SdrObjKind                  meKind;
diff --git a/include/svx/svdorect.hxx b/include/svx/svdorect.hxx
index 125d1d7fb5b3..ac015cb498c0 100644
--- a/include/svx/svdorect.hxx
+++ b/include/svx/svdorect.hxx
@@ -44,7 +44,7 @@ private:
     friend class SdrTextObj; // Due to SetXPolyDirty for GrowAdjust
 
 protected:
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
 
     std::unique_ptr<XPolygon> mpXPoly;
diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx
index ad42885a124f..8d9c03a3c5da 100644
--- a/include/svx/svdotable.hxx
+++ b/include/svx/svdotable.hxx
@@ -268,7 +268,7 @@ private:
 
 protected:
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
     virtual SdrObjGeoData* NewGeoData() const override;
     virtual void SaveGeoData(SdrObjGeoData& rGeo) const override;
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 3b0e307246ba..b7e606e11cfc 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -148,7 +148,7 @@ private:
 
 protected:
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
 private:
     // This method is only allowed for sdr::properties::TextProperties
diff --git a/include/svx/svdouno.hxx b/include/svx/svdouno.hxx
index 245069635910..cd47eadef182 100644
--- a/include/svx/svdouno.hxx
+++ b/include/svx/svdouno.hxx
@@ -127,7 +127,7 @@ public:
 
 protected:
     // SdrObject overridables
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
 private:
     /** Retrieves the typed ViewContact for the object
diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx
index 7376b0506b76..45c04ccff893 100644
--- a/include/svx/svdovirt.hxx
+++ b/include/svx/svdovirt.hxx
@@ -34,7 +34,7 @@ public:
     virtual sdr::properties::BaseProperties& GetProperties() const override;
 
 protected:
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
     SdrObject&                  rRefObj; // Referenced drawing object
     tools::Rectangle            aSnapRect;
diff --git a/svx/source/engine3d/cube3d.cxx b/svx/source/engine3d/cube3d.cxx
index a8c92b0556b8..ecc3dc74abc8 100644
--- a/svx/source/engine3d/cube3d.cxx
+++ b/svx/source/engine3d/cube3d.cxx
@@ -25,13 +25,14 @@
 #include <basegfx/point/b3dpoint.hxx>
 #include <basegfx/polygon/b3dpolygon.hxx>
 #include <sdr/contact/viewcontactofe3dcube.hxx>
+#include <o3tl/make_unique.hxx>
 
 
 // DrawContact section
 
-sdr::contact::ViewContact* E3dCubeObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> E3dCubeObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfE3dCube(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfE3dCube>(*this);
 }
 
 
diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx
index b28132fd3c65..6ab1ae7440a3 100644
--- a/svx/source/engine3d/extrud3d.cxx
+++ b/svx/source/engine3d/extrud3d.cxx
@@ -36,12 +36,13 @@
 #include <basegfx/polygon/b2dpolygontools.hxx>
 #include <basegfx/polygon/b3dpolygontools.hxx>
 #include <basegfx/polygon/b3dpolypolygontools.hxx>
+#include <o3tl/make_unique.hxx>
 
 
 // DrawContact section
-sdr::contact::ViewContact* E3dExtrudeObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> E3dExtrudeObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfE3dExtrude(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfE3dExtrude>(*this);
 }
 
 sdr::properties::BaseProperties* E3dExtrudeObj::CreateObjectSpecificProperties()
diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx
index 40bfd69f276b..629ecfb85127 100644
--- a/svx/source/engine3d/lathe3d.cxx
+++ b/svx/source/engine3d/lathe3d.cxx
@@ -34,12 +34,13 @@
 #include <basegfx/polygon/b2dpolypolygontools.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
+#include <o3tl/make_unique.hxx>
 
 
 // DrawContact section
-sdr::contact::ViewContact* E3dLatheObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> E3dLatheObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfE3dLathe(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfE3dLathe>(*this);
 }
 
 sdr::properties::BaseProperties* E3dLatheObj::CreateObjectSpecificProperties()
diff --git a/svx/source/engine3d/polygn3d.cxx b/svx/source/engine3d/polygn3d.cxx
index 68f808f5e41c..a94c316fe4bf 100644
--- a/svx/source/engine3d/polygn3d.cxx
+++ b/svx/source/engine3d/polygn3d.cxx
@@ -24,11 +24,12 @@
 #include <sdr/contact/viewcontactofe3dpolygon.hxx>
 #include <basegfx/polygon/b3dpolygon.hxx>
 #include <basegfx/polygon/b3dpolygontools.hxx>
+#include <o3tl/make_unique.hxx>
 
 // DrawContact section
-sdr::contact::ViewContact* E3dPolygonObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> E3dPolygonObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfE3dPolygon(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfE3dPolygon>(*this);
 }
 
 E3dPolygonObj::E3dPolygonObj(
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index c98ea6d97dca..a6cf651fa9b9 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -46,6 +46,7 @@
 #include <basegfx/polygon/b2dpolypolygontools.hxx>
 #include <svx/e3dsceneupdater.hxx>
 #include <svx/svdmodel.hxx>
+#include <o3tl/make_unique.hxx>
 
 
 class ImpRemap3DDepth
@@ -164,9 +165,9 @@ sdr::properties::BaseProperties* E3dScene::CreateObjectSpecificProperties()
 
 // DrawContact section
 
-sdr::contact::ViewContact* E3dScene::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> E3dScene::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfE3dScene(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfE3dScene>(*this);
 }
 
 
diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx
index a3a3f0c168c1..c528d47e5713 100644
--- a/svx/source/engine3d/sphere3d.cxx
+++ b/svx/source/engine3d/sphere3d.cxx
@@ -32,11 +32,12 @@
 #include <basegfx/point/b3dpoint.hxx>
 #include <sdr/contact/viewcontactofe3dsphere.hxx>
 #include <basegfx/polygon/b3dpolygon.hxx>
+#include <o3tl/make_unique.hxx>
 
 // DrawContact section
-sdr::contact::ViewContact* E3dSphereObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> E3dSphereObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfE3dSphere(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfE3dSphere>(*this);
 }
 
 sdr::properties::BaseProperties* E3dSphereObj::CreateObjectSpecificProperties()
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 5f448b6fb53b..c0a139c26ef7 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -82,6 +82,7 @@
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <svdobjplusdata.hxx>
+#include <o3tl/make_unique.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -3048,9 +3049,9 @@ bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf
     return false;
 }
 
-sdr::contact::ViewContact* SdrObjCustomShape::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrObjCustomShape::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfSdrObjCustomShape(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfSdrObjCustomShape>(*this);
 }
 
 // #i33136#
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 663c4b07083a..a463ea523fae 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -130,6 +130,7 @@
 #include <rtl/strbuf.hxx>
 #include <svdobjplusdata.hxx>
 #include <svdobjuserdatalist.hxx>
+#include <o3tl/make_unique.hxx>
 
 #include <boost/optional.hpp>
 #include <libxml/xmlwriter.h>
@@ -256,17 +257,17 @@ void SdrObject::RemoveObjectUser(sdr::ObjectUser& rOldUser)
 
 // DrawContact section
 
-sdr::contact::ViewContact* SdrObject::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrObject::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfSdrObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfSdrObj>(*this);
 }
 
 sdr::contact::ViewContact& SdrObject::GetViewContact() const
 {
     if(!mpViewContact)
     {
-        const_cast< SdrObject* >(this)->mpViewContact.reset(
-            const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact() );
+        const_cast< SdrObject* >(this)->mpViewContact =
+            const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact();
     }
 
     return *mpViewContact;
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index e02b596f2195..1a4ea0c18bcc 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -58,6 +58,7 @@
 #include <svx/xlnwtit.hxx>
 #include <svx/xpoly.hxx>
 #include <svx/xpool.hxx>
+#include <o3tl/make_unique.hxx>
 
 
 enum EscDir {LKS,RTS,OBN,UNT};
@@ -182,9 +183,9 @@ sdr::properties::BaseProperties* SdrCaptionObj::CreateObjectSpecificProperties()
 
 // DrawContact section
 
-sdr::contact::ViewContact* SdrCaptionObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrCaptionObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfSdrCaptionObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfSdrCaptionObj>(*this);
 }
 
 
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index e55f79183d18..71dad28a7b6e 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -49,6 +49,7 @@
 #include <svx/xlnstwit.hxx>
 #include <svx/xlnwtit.hxx>
 #include <svx/xpool.hxx>
+#include <o3tl/make_unique.hxx>
 
 using namespace com::sun::star;
 
@@ -99,9 +100,9 @@ sdr::properties::BaseProperties* SdrCircObj::CreateObjectSpecificProperties()
 
 // DrawContact section
 
-sdr::contact::ViewContact* SdrCircObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrCircObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfSdrCircObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfSdrCircObj>(*this);
 }
 
 SdrCircObj::SdrCircObj(
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 860b4f018a81..ca3174a6de5e 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -47,6 +47,7 @@
 #include <svx/sxenditm.hxx>
 #include <svx/xpoly.hxx>
 #include <svx/xpool.hxx>
+#include <o3tl/make_unique.hxx>
 
 
 SdrObjConnection::~SdrObjConnection()
@@ -155,9 +156,9 @@ sdr::properties::BaseProperties* SdrEdgeObj::CreateObjectSpecificProperties()
 
 // DrawContact section
 
-sdr::contact::ViewContact* SdrEdgeObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrEdgeObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfSdrEdgeObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfSdrEdgeObj>(*this);
 }
 
 
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index aefebe7b3a7c..90e6d4a0c391 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -62,6 +62,7 @@
 #include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
 #include <memory>
 #include <vcl/GraphicLoader.hxx>
+#include <o3tl/make_unique.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -272,9 +273,9 @@ sdr::properties::BaseProperties* SdrGrafObj::CreateObjectSpecificProperties()
 
 // DrawContact section
 
-sdr::contact::ViewContact* SdrGrafObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrGrafObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfGraphic(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfGraphic>(*this);
 }
 
 // check if SVG and if try to get ObjectInfoPrimitive2D and extract info
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index c0e6ae0b468d..c66ee4f1bff3 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -49,6 +49,7 @@
 #include <basegfx/polygon/b2dpolygontools.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <libxml/xmlwriter.h>
+#include <o3tl/make_unique.hxx>
 
 // BaseProperties section
 sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties()
@@ -57,9 +58,9 @@ sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties()
 }
 
 // DrawContact section
-sdr::contact::ViewContact* SdrObjGroup::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrObjGroup::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfGroup(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfGroup>(*this);
 }
 
 SdrObjGroup::SdrObjGroup(SdrModel& rSdrModel)
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index b0738696d733..cc6ba7d6f5cb 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -68,6 +68,7 @@
 #include <svx/xlnwtit.hxx>
 #include <svx/xpoly.hxx>
 #include <unotools/syslocale.hxx>
+#include <o3tl/make_unique.hxx>
 
 
 SdrMeasureObjGeoData::SdrMeasureObjGeoData() {}
@@ -192,9 +193,9 @@ sdr::properties::BaseProperties* SdrMeasureObj::CreateObjectSpecificProperties()
 
 // DrawContact section
 
-sdr::contact::ViewContact* SdrMeasureObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrMeasureObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfSdrMeasureObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfSdrMeasureObj>(*this);
 }
 
 
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index 6767d05eb7d4..54c3d66846da 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -38,6 +38,7 @@
 #include <svx/strings.hrc>
 #include <svx/sdr/contact/viewcontactofsdrmediaobj.hxx>
 #include <avmedia/mediawindow.hxx>
+#include <o3tl/make_unique.hxx>
 
 using namespace ::com::sun::star;
 
@@ -88,9 +89,9 @@ bool SdrMediaObj::HasTextEdit() const
     return false;
 }
 
-sdr::contact::ViewContact* SdrMediaObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrMediaObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfSdrMediaObj( *this );
+    return o3tl::make_unique<sdr::contact::ViewContactOfSdrMediaObj>( *this );
 }
 
 void SdrMediaObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index feb7caf6700c..d854ffbc3488 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -676,9 +676,9 @@ sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties()
 
 // DrawContact section
 
-sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrOle2Obj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfSdrOle2Obj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfSdrOle2Obj>(*this);
 }
 
 void SdrOle2Obj::Init()
diff --git a/svx/source/svdraw/svdopage.cxx b/svx/source/svdraw/svdopage.cxx
index c9dfa21838de..ceb4a130fc59 100644
--- a/svx/source/svdraw/svdopage.cxx
+++ b/svx/source/svdraw/svdopage.cxx
@@ -31,6 +31,7 @@
 #include <svl/itemset.hxx>
 #include <sdr/properties/pageproperties.hxx>
 #include <svx/sdr/contact/viewcontactofpageobj.hxx>
+#include <o3tl/make_unique.hxx>
 
 
 // BaseProperties section
@@ -43,9 +44,9 @@ sdr::properties::BaseProperties* SdrPageObj::CreateObjectSpecificProperties()
 
 // DrawContact section
 
-sdr::contact::ViewContact* SdrPageObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrPageObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfPageObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfPageObj>(*this);
 }
 
 
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 4c5ad7e7bffa..d98c9d6a21fd 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -51,6 +51,7 @@
 #include <svx/sdr/primitive2d/sdrattributecreator.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <svx/sdr/attribute/sdrformtextattribute.hxx>
+#include <o3tl/make_unique.hxx>
 #include <memory>
 
 using namespace sdr;
@@ -1616,9 +1617,9 @@ SdrPathObjGeoData::~SdrPathObjGeoData()
 
 // DrawContact section
 
-sdr::contact::ViewContact* SdrPathObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrPathObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfSdrPathObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfSdrPathObj>(*this);
 }
 
 
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index c9f8ee955e3b..c1a102b15ac3 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -43,6 +43,7 @@
 #include <svx/sdr/contact/viewcontactofsdrrectobj.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
+#include <o3tl/make_unique.hxx>
 
 using namespace com::sun::star;
 
@@ -56,9 +57,9 @@ sdr::properties::BaseProperties* SdrRectObj::CreateObjectSpecificProperties()
 
 // DrawContact section
 
-sdr::contact::ViewContact* SdrRectObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrRectObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfSdrRectObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfSdrRectObj>(*this);
 }
 
 
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 1e6780866101..7a1d1c9421ce 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -60,6 +60,7 @@
 #include <drawinglayer/geometry/viewinformation2d.hxx>
 #include <vcl/virdev.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <o3tl/make_unique.hxx>
 
 using namespace com::sun::star;
 
@@ -70,9 +71,9 @@ sdr::properties::BaseProperties* SdrTextObj::CreateObjectSpecificProperties()
 }
 
 // DrawContact section
-sdr::contact::ViewContact* SdrTextObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrTextObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfTextObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfTextObj>(*this);
 }
 
 SdrTextObj::SdrTextObj(SdrModel& rSdrModel)
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index 40e8c9601edb..68b13f3d2e4f 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -48,6 +48,7 @@
 #include <svx/sdrpaintwindow.hxx>
 #include <tools/diagnose_ex.h>
 #include <svx/svdograf.hxx>
+#include <o3tl/make_unique.hxx>
 
 using namespace ::com::sun::star;
 using namespace sdr::contact;
@@ -525,9 +526,9 @@ bool SdrUnoObj::impl_getViewContact( ViewContactOfUnoControl*& _out_rpContact )
 }
 
 
-sdr::contact::ViewContact* SdrUnoObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrUnoObj::CreateObjectSpecificViewContact()
 {
-  return new sdr::contact::ViewContactOfUnoControl( *this );
+  return o3tl::make_unique<sdr::contact::ViewContactOfUnoControl>( *this );
 }
 
 
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index 55d564dc71f2..698ac2051adc 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -28,6 +28,7 @@
 #include <svx/svdograf.hxx>
 #include <svx/svddrgv.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <o3tl/make_unique.hxx>
 
 
 sdr::properties::BaseProperties& SdrVirtObj::GetProperties() const
@@ -37,9 +38,9 @@ sdr::properties::BaseProperties& SdrVirtObj::GetProperties() const
 
 
 // #i27224#
-sdr::contact::ViewContact* SdrVirtObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrVirtObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfVirtObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfVirtObj>(*this);
 }
 
 SdrVirtObj::SdrVirtObj(
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 6a7dcd3f3427..4586485156d2 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -846,9 +846,9 @@ sdr::properties::BaseProperties* SdrTableObj::CreateObjectSpecificProperties()
 // DrawContact section
 
 
-sdr::contact::ViewContact* SdrTableObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SdrTableObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::ViewContactOfTableObj(*this);
+    return o3tl::make_unique<sdr::contact::ViewContactOfTableObj>(*this);
 }
 
 SdrTableObj::SdrTableObj(SdrModel& rSdrModel)
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index a25c1ac9e54c..ea0261cde391 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -225,7 +225,7 @@ class SwDrawVirtObj : public SdrVirtObj
         /** AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
          not used but something own (top left of new SnapRect minus top left
          of original SnapRect) */
-        virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+        virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
         // protected destructor
         virtual ~SwDrawVirtObj() override;
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 132d8f83662e..96c0787ae835 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -71,6 +71,7 @@
 #include <calbck.hxx>
 #include <algorithm>
 #include <txtfly.hxx>
+#include <o3tl/make_unique.hxx>
 
 using namespace ::com::sun::star;
 
@@ -2149,9 +2150,9 @@ namespace sdr
 } // end of namespace sdr
 
 /// implementation of class <SwDrawVirtObj>
-sdr::contact::ViewContact* SwDrawVirtObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SwDrawVirtObj::CreateObjectSpecificViewContact()
 {
-    return new sdr::contact::VCOfDrawVirtObj(*this);
+    return o3tl::make_unique<sdr::contact::VCOfDrawVirtObj>(*this);
 }
 
 SwDrawVirtObj::SwDrawVirtObj(
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 3646acaf75da..70fab4972352 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -64,6 +64,7 @@
 #include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <notxtfrm.hxx>
+#include <o3tl/make_unique.hxx>
 
 using namespace ::com::sun::star;
 
@@ -114,11 +115,11 @@ sdr::properties::BaseProperties* SwFlyDrawObj::CreateObjectSpecificProperties()
     return new sdr::properties::DefaultProperties(*this);
 }
 
-sdr::contact::ViewContact* SwFlyDrawObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SwFlyDrawObj::CreateObjectSpecificViewContact()
 {
     // needs an own VC since createViewIndependentPrimitive2DSequence()
     // is called when RecalcBoundRect() is used
-    return new sdr::contact::VCOfSwFlyDrawObj(*this);
+    return o3tl::make_unique<sdr::contact::VCOfSwFlyDrawObj>(*this);
 }
 
 SwFlyDrawObj::SwFlyDrawObj(SdrModel& rSdrModel)
@@ -410,11 +411,11 @@ void SwVirtFlyDrawObj::Rotate(const Point& rRef, long nAngle, double sn, double
     }
 }
 
-sdr::contact::ViewContact* SwVirtFlyDrawObj::CreateObjectSpecificViewContact()
+std::unique_ptr<sdr::contact::ViewContact> SwVirtFlyDrawObj::CreateObjectSpecificViewContact()
 {
     // need an own ViewContact (VC) to allow creation of a specialized primitive
     // for being able to visualize the FlyFrames in primitive renderers
-    return new sdr::contact::VCOfSwVirtFlyDrawObj(*this);
+    return o3tl::make_unique<sdr::contact::VCOfSwVirtFlyDrawObj>(*this);
 }
 
 SwVirtFlyDrawObj::SwVirtFlyDrawObj(
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index c22ffae16251..181eeac6c95e 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -38,7 +38,7 @@ private:
 protected:
     // #i95264# SwFlyDrawObj needs an own VC since createViewIndependentPrimitive2DSequence()
     // is called when RecalcBoundRect() is used
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
     // protected destructor
     virtual ~SwFlyDrawObj() override;
@@ -67,7 +67,7 @@ protected:
     // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
     // not used but something own (top left of new SnapRect minus top left
     // of original SnapRect)
-    virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
+    virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
 
     // protected destructor
     virtual ~SwVirtFlyDrawObj() override;


More information about the Libreoffice-commits mailing list