summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2018-07-01 22:04:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-03 08:18:19 +0200
commitdbdf5ef32e2fc041183b762d9a1561430c96470b (patch)
treeb2ce4ec15fdbb3712a7d81ab9b779acbfd44fe9f /sw/source
parent24218c21712bc900a6641bd1844878f07b173df7 (diff)
use std::unique_ptr for CreateObjectSpecificViewContact
Change-Id: I0fed54d345a43fe0bc21ebbe424e6fdc7eac9523 Reviewed-on: https://gerrit.libreoffice.org/56823 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/draw/dcontact.cxx5
-rw-r--r--sw/source/core/draw/dflyobj.cxx9
-rw-r--r--sw/source/core/inc/dflyobj.hxx4
3 files changed, 10 insertions, 8 deletions
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;