summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-12 15:07:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-13 09:17:34 +0200
commit0fdcfedd898afcc03332a432ef21052eee6b3a3a (patch)
tree46ed1c968570414ffa0917d2324863234cc504fe /sc/source
parentd0d4a3647692883b17a1acd96a01a1857c5872b1 (diff)
make SdrObjUserData::Clone return std::unique_ptr
Change-Id: Iffe047b081fde0bb582d8730a8e96d2597c7567a Reviewed-on: https://gerrit.libreoffice.org/52780 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/drwlayer.cxx6
-rw-r--r--sc/source/core/data/userdat.cxx12
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh9.cxx2
4 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 0665e0942188..8f8983a4c553 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -2211,7 +2211,7 @@ ScDrawObjData* ScDrawLayer::GetNonRotatedObjData( SdrObject* pObj, bool bCreate
if( pObj && bCreate )
{
ScDrawObjData* pData = new ScDrawObjData;
- pObj->AppendUserData(pData);
+ pObj->AppendUserData(std::unique_ptr<SdrObjUserData>(pData));
return pData;
}
return nullptr;
@@ -2225,7 +2225,7 @@ ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, bool bCreate )
if( pObj && bCreate )
{
ScDrawObjData* pData = new ScDrawObjData;
- pObj->AppendUserData(pData);
+ pObj->AppendUserData(std::unique_ptr<SdrObjUserData>(pData));
return pData;
}
return nullptr;
@@ -2332,7 +2332,7 @@ ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, bool bCreate )
if ( bCreate )
{
ScMacroInfo* pData = new ScMacroInfo;
- pObj->AppendUserData(pData);
+ pObj->AppendUserData(std::unique_ptr<SdrObjUserData>(pData));
return pData;
}
return nullptr;
diff --git a/sc/source/core/data/userdat.cxx b/sc/source/core/data/userdat.cxx
index 53dd575dd4ca..ebf7f6dc70b6 100644
--- a/sc/source/core/data/userdat.cxx
+++ b/sc/source/core/data/userdat.cxx
@@ -31,9 +31,9 @@ ScDrawObjData::ScDrawObjData() :
{
}
-ScDrawObjData* ScDrawObjData::Clone( SdrObject* ) const
+std::unique_ptr<SdrObjUserData> ScDrawObjData::Clone( SdrObject* ) const
{
- return new ScDrawObjData( *this );
+ return std::unique_ptr<SdrObjUserData>(new ScDrawObjData( *this ));
}
ScIMapInfo::ScIMapInfo( const ImageMap& rImageMap ) :
@@ -52,9 +52,9 @@ ScIMapInfo::~ScIMapInfo()
{
}
-SdrObjUserData* ScIMapInfo::Clone( SdrObject* ) const
+std::unique_ptr<SdrObjUserData> ScIMapInfo::Clone( SdrObject* ) const
{
- return new ScIMapInfo( *this );
+ return std::unique_ptr<SdrObjUserData>(new ScIMapInfo( *this ));
}
ScMacroInfo::ScMacroInfo() :
@@ -66,9 +66,9 @@ ScMacroInfo::~ScMacroInfo()
{
}
-SdrObjUserData* ScMacroInfo::Clone( SdrObject* /*pObj*/ ) const
+std::unique_ptr<SdrObjUserData> ScMacroInfo::Clone( SdrObject* /*pObj*/ ) const
{
- return new ScMacroInfo( *this );
+ return std::unique_ptr<SdrObjUserData>(new ScMacroInfo( *this ));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 8c590d64a90e..2279a2f2b4c0 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -453,7 +453,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
else
{
// insert new user data with image map
- pObj->AppendUserData(new ScIMapInfo(aImageMap) );
+ pObj->AppendUserData(std::unique_ptr<SdrObjUserData>(new ScIMapInfo(aImageMap) ));
}
}
}
diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx
index 43508fb93981..9c1f1b0f2f5b 100644
--- a/sc/source/ui/view/tabvwsh9.cxx
+++ b/sc/source/ui/view/tabvwsh9.cxx
@@ -135,7 +135,7 @@ void ScTabViewShell::ExecImageMap( SfxRequest& rReq )
ScIMapInfo* pIMapInfo = ScDrawLayer::GetIMapInfo( pSdrObj );
if ( !pIMapInfo )
- pSdrObj->AppendUserData( new ScIMapInfo( rImageMap ) );
+ pSdrObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new ScIMapInfo( rImageMap )) );
else
pIMapInfo->SetImageMap( rImageMap );