summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2018-07-07 09:29:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-07 12:42:37 +0200
commit363146254bd44ab82d657f2ca0293d03bd111280 (patch)
tree41e76c63ca1887e8171f9a4e15d7f138bf48bccc /svx
parentd4b1f51f99fcb2a6d550f667df14e99983ab9d8c (diff)
use std::unique_ptr fo CreateObjectSpecificProperties
Change-Id: Ica82eca48719f12535757c81e95d788fe0aaa48e Reviewed-on: https://gerrit.libreoffice.org/57110 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/engine3d/extrud3d.cxx4
-rw-r--r--svx/source/engine3d/lathe3d.cxx4
-rw-r--r--svx/source/engine3d/obj3d.cxx9
-rw-r--r--svx/source/engine3d/scene3d.cxx4
-rw-r--r--svx/source/engine3d/sphere3d.cxx4
-rw-r--r--svx/source/svdraw/svdoashp.cxx4
-rw-r--r--svx/source/svdraw/svdoattr.cxx5
-rw-r--r--svx/source/svdraw/svdobj.cxx8
-rw-r--r--svx/source/svdraw/svdocapt.cxx4
-rw-r--r--svx/source/svdraw/svdocirc.cxx4
-rw-r--r--svx/source/svdraw/svdoedge.cxx4
-rw-r--r--svx/source/svdraw/svdograf.cxx4
-rw-r--r--svx/source/svdraw/svdogrp.cxx4
-rw-r--r--svx/source/svdraw/svdomeas.cxx4
-rw-r--r--svx/source/svdraw/svdoole2.cxx4
-rw-r--r--svx/source/svdraw/svdopage.cxx4
-rw-r--r--svx/source/svdraw/svdorect.cxx4
-rw-r--r--svx/source/svdraw/svdotext.cxx4
-rw-r--r--svx/source/table/svdotable.cxx4
19 files changed, 44 insertions, 42 deletions
diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx
index 6ab1ae7440a3..38b94e629e47 100644
--- a/svx/source/engine3d/extrud3d.cxx
+++ b/svx/source/engine3d/extrud3d.cxx
@@ -45,9 +45,9 @@ std::unique_ptr<sdr::contact::ViewContact> E3dExtrudeObj::CreateObjectSpecificVi
return o3tl::make_unique<sdr::contact::ViewContactOfE3dExtrude>(*this);
}
-sdr::properties::BaseProperties* E3dExtrudeObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> E3dExtrudeObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::E3dExtrudeProperties(*this);
+ return o3tl::make_unique<sdr::properties::E3dExtrudeProperties>(*this);
}
// Constructor creates a two cover surface tools::PolyPolygon and (point-count 1) side
diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx
index 629ecfb85127..5068defb7d1b 100644
--- a/svx/source/engine3d/lathe3d.cxx
+++ b/svx/source/engine3d/lathe3d.cxx
@@ -43,9 +43,9 @@ std::unique_ptr<sdr::contact::ViewContact> E3dLatheObj::CreateObjectSpecificView
return o3tl::make_unique<sdr::contact::ViewContactOfE3dLathe>(*this);
}
-sdr::properties::BaseProperties* E3dLatheObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> E3dLatheObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::E3dLatheProperties(*this);
+ return o3tl::make_unique<sdr::properties::E3dLatheProperties>(*this);
}
// Constructor from 3D polygon, scale is the conversion factor for the coordinates
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index 01d57b94d3d6..d3cf4bf8fbe5 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -75,12 +75,13 @@
#include <com/sun/star/uno/Sequence.h>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
#include <svx/e3dsceneupdater.hxx>
+#include <o3tl/make_unique.hxx>
using namespace com::sun::star;
-sdr::properties::BaseProperties* E3dObject::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> E3dObject::CreateObjectSpecificProperties()
{
- return new sdr::properties::E3dProperties(*this);
+ return o3tl::make_unique<sdr::properties::E3dProperties>(*this);
}
E3dObject::E3dObject(SdrModel& rSdrModel)
@@ -486,9 +487,9 @@ void E3dObject::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
SetGlueReallyAbsolute(false); // from now they are again relative to BoundRect (that is defined as aOutRect)
}
-sdr::properties::BaseProperties* E3dCompoundObject::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> E3dCompoundObject::CreateObjectSpecificProperties()
{
- return new sdr::properties::E3dCompoundProperties(*this);
+ return o3tl::make_unique<sdr::properties::E3dCompoundProperties>(*this);
}
E3dCompoundObject::E3dCompoundObject(SdrModel& rSdrModel)
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index a6cf651fa9b9..4e3d06bea40a 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -157,9 +157,9 @@ sal_uInt32 Imp3DDepthRemapper::RemapOrdNum(sal_uInt32 nOrdNum) const
// BaseProperties section
-sdr::properties::BaseProperties* E3dScene::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> E3dScene::CreateObjectSpecificProperties()
{
- return new sdr::properties::E3dSceneProperties(*this);
+ return o3tl::make_unique<sdr::properties::E3dSceneProperties>(*this);
}
diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx
index c528d47e5713..4b2ee554aa10 100644
--- a/svx/source/engine3d/sphere3d.cxx
+++ b/svx/source/engine3d/sphere3d.cxx
@@ -40,9 +40,9 @@ std::unique_ptr<sdr::contact::ViewContact> E3dSphereObj::CreateObjectSpecificVie
return o3tl::make_unique<sdr::contact::ViewContactOfE3dSphere>(*this);
}
-sdr::properties::BaseProperties* E3dSphereObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> E3dSphereObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::E3dSphereProperties(*this);
+ return o3tl::make_unique<sdr::properties::E3dSphereProperties>(*this);
}
// Build Sphere from polygon facets in latitude and longitude
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index c0a139c26ef7..2c261b5e4162 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -804,9 +804,9 @@ static void lcl_ShapePropertiesFromDFF( const SvxMSDffHandle* pData, css::beans:
}
}
-sdr::properties::BaseProperties* SdrObjCustomShape::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrObjCustomShape::CreateObjectSpecificProperties()
{
- return new sdr::properties::CustomShapeProperties(*this);
+ return o3tl::make_unique<sdr::properties::CustomShapeProperties>(*this);
}
SdrObjCustomShape::SdrObjCustomShape(SdrModel& rSdrModel)
diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx
index f33a47e63ee5..578e84147e34 100644
--- a/svx/source/svdraw/svdoattr.cxx
+++ b/svx/source/svdraw/svdoattr.cxx
@@ -71,12 +71,13 @@
#include <sdr/properties/attributeproperties.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <svx/xlinjoit.hxx>
+#include <o3tl/make_unique.hxx>
using namespace com::sun::star;
-sdr::properties::BaseProperties* SdrAttrObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrAttrObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::AttributeProperties(*this);
+ return o3tl::make_unique<sdr::properties::AttributeProperties>(*this);
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 5d30142ca120..fdfd176b0011 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -216,9 +216,9 @@ struct SdrObject::Impl
// BaseProperties section
-sdr::properties::BaseProperties* SdrObject::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrObject::CreateObjectSpecificProperties()
{
- return new sdr::properties::EmptyProperties(*this);
+ return o3tl::make_unique<sdr::properties::EmptyProperties>(*this);
}
sdr::properties::BaseProperties& SdrObject::GetProperties() const
@@ -229,8 +229,8 @@ sdr::properties::BaseProperties& SdrObject::GetProperties() const
// that will lead to wrong type-casts (dependent on constructor-level)
// and thus eventually create the wrong sdr::properties (!). Is there
// a way to check if on the stack is a SdrObject-constructor (?)
- const_cast< SdrObject* >(this)->mpProperties.reset(
- const_cast< SdrObject* >(this)->CreateObjectSpecificProperties() );
+ const_cast< SdrObject* >(this)->mpProperties =
+ const_cast< SdrObject* >(this)->CreateObjectSpecificProperties();
}
return *mpProperties;
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 1a4ea0c18bcc..4af2f1a3dfe4 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -175,9 +175,9 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const tools::Rectangle& rRe
// BaseProperties section
-sdr::properties::BaseProperties* SdrCaptionObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrCaptionObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::CaptionProperties(*this);
+ return o3tl::make_unique<sdr::properties::CaptionProperties>(*this);
}
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 71dad28a7b6e..d0a9d3a3010f 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -92,9 +92,9 @@ Point GetAnglePnt(const tools::Rectangle& rR, long nAngle)
// BaseProperties section
-sdr::properties::BaseProperties* SdrCircObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrCircObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::CircleProperties(*this);
+ return o3tl::make_unique<sdr::properties::CircleProperties>(*this);
}
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index ca3174a6de5e..7b490aeecd96 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -148,9 +148,9 @@ long SdrEdgeInfoRec::ImpGetLineOffset(SdrEdgeLineCode eLineCode, const XPolygon&
// BaseProperties section
-sdr::properties::BaseProperties* SdrEdgeObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrEdgeObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::ConnectorProperties(*this);
+ return o3tl::make_unique<sdr::properties::ConnectorProperties>(*this);
}
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 90e6d4a0c391..3b6e673662ae 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -265,9 +265,9 @@ void SdrGraphicLink::UpdateAsynchron()
}
}
-sdr::properties::BaseProperties* SdrGrafObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrGrafObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::GraphicProperties(*this);
+ return o3tl::make_unique<sdr::properties::GraphicProperties>(*this);
}
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index c66ee4f1bff3..e0f85deaad14 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -52,9 +52,9 @@
#include <o3tl/make_unique.hxx>
// BaseProperties section
-sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrObjGroup::CreateObjectSpecificProperties()
{
- return new sdr::properties::GroupProperties(*this);
+ return o3tl::make_unique<sdr::properties::GroupProperties>(*this);
}
// DrawContact section
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index cc6ba7d6f5cb..8d58f797b6a5 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -185,9 +185,9 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
// BaseProperties section
-sdr::properties::BaseProperties* SdrMeasureObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrMeasureObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::MeasureProperties(*this);
+ return o3tl::make_unique<sdr::properties::MeasureProperties>(*this);
}
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index d854ffbc3488..b01af63da0ca 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -669,9 +669,9 @@ static bool ImplIsMathObj( const uno::Reference < embed::XEmbeddedObject >& rObj
// BaseProperties section
-sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrOle2Obj::CreateObjectSpecificProperties()
{
- return new sdr::properties::OleProperties(*this);
+ return o3tl::make_unique<sdr::properties::OleProperties>(*this);
}
// DrawContact section
diff --git a/svx/source/svdraw/svdopage.cxx b/svx/source/svdraw/svdopage.cxx
index ceb4a130fc59..817662601e95 100644
--- a/svx/source/svdraw/svdopage.cxx
+++ b/svx/source/svdraw/svdopage.cxx
@@ -36,9 +36,9 @@
// BaseProperties section
-sdr::properties::BaseProperties* SdrPageObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrPageObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::PageProperties(*this);
+ return o3tl::make_unique<sdr::properties::PageProperties>(*this);
}
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index c1a102b15ac3..fdba01575f28 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -49,9 +49,9 @@ using namespace com::sun::star;
// BaseProperties section
-sdr::properties::BaseProperties* SdrRectObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrRectObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::RectangleProperties(*this);
+ return o3tl::make_unique<sdr::properties::RectangleProperties>(*this);
}
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 7a1d1c9421ce..cb02ba7da976 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -65,9 +65,9 @@
using namespace com::sun::star;
// BaseProperties section
-sdr::properties::BaseProperties* SdrTextObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrTextObj::CreateObjectSpecificProperties()
{
- return new sdr::properties::TextProperties(*this);
+ return o3tl::make_unique<sdr::properties::TextProperties>(*this);
}
// DrawContact section
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 4586485156d2..e638c5e7345e 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -837,9 +837,9 @@ void SdrTableObjImpl::UpdateCells( tools::Rectangle const & rArea )
// BaseProperties section
-sdr::properties::BaseProperties* SdrTableObj::CreateObjectSpecificProperties()
+std::unique_ptr<sdr::properties::BaseProperties> SdrTableObj::CreateObjectSpecificProperties()
{
- return new TableProperties(*this);
+ return o3tl::make_unique<TableProperties>(*this);
}