summaryrefslogtreecommitdiff
path: root/svx/source/table
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-02 10:39:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-03 08:24:45 +0200
commit12c0aaf4aea8cdd6fbabd4f04228fb40e0220067 (patch)
tree484b8304ac3e032c9a3b70b5eb8c64819ff6ce7a /svx/source/table
parentc3a8dc07be1beeccbefb9242a1fd1f270cb531ba (diff)
loplugin:useuniqueptr in sdr::table::Cell
Change-Id: Iede820e3e6f3c6d079bab5d7addc1f587ec78104 Reviewed-on: https://gerrit.libreoffice.org/53758 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/table')
-rw-r--r--svx/source/table/cell.cxx11
-rw-r--r--svx/source/table/tableundo.cxx5
2 files changed, 5 insertions, 11 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 5d8484944758..b1364f6d60ff 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -442,11 +442,7 @@ void Cell::dispose()
mxTable.clear();
}
- if( mpProperties )
- {
- delete mpProperties;
- mpProperties = nullptr;
- }
+ mpProperties.reset();
SetOutlinerParaObject( nullptr );
}
@@ -818,7 +814,7 @@ sdr::properties::TextProperties* Cell::CloneProperties( sdr::properties::TextPro
sdr::properties::TextProperties* Cell::CloneProperties( SdrObject& rNewObj, Cell& rNewCell )
{
- return CloneProperties(mpProperties,rNewObj,rNewCell);
+ return CloneProperties(mpProperties.get(),rNewObj,rNewCell);
}
@@ -1563,8 +1559,7 @@ Any SAL_CALL Cell::getPropertyDefault( const OUString& aPropertyName )
void SAL_CALL Cell::setAllPropertiesToDefault()
{
- delete mpProperties;
- mpProperties = new sdr::properties::CellProperties( static_cast< SdrTableObj& >( GetObject() ), this );
+ mpProperties.reset(new sdr::properties::CellProperties( static_cast< SdrTableObj& >( GetObject() ), this ));
SdrOutliner& rOutliner = GetObject().ImpGetDrawOutliner();
diff --git a/svx/source/table/tableundo.cxx b/svx/source/table/tableundo.cxx
index 493c895057dc..913d8d1f716d 100644
--- a/svx/source/table/tableundo.cxx
+++ b/svx/source/table/tableundo.cxx
@@ -101,11 +101,10 @@ bool CellUndo::Merge( SfxUndoAction *pNextAction )
void CellUndo::setDataToCell( const Data& rData )
{
- delete mxCell->mpProperties;
if( rData.mpProperties )
- mxCell->mpProperties = Cell::CloneProperties( rData.mpProperties, *mxObjRef.get(), *mxCell.get() );
+ mxCell->mpProperties.reset(Cell::CloneProperties( rData.mpProperties, *mxObjRef.get(), *mxCell.get() ));
else
- mxCell->mpProperties = nullptr;
+ mxCell->mpProperties.reset();
if( rData.mpOutlinerParaObject )
mxCell->SetOutlinerParaObject( new OutlinerParaObject(*rData.mpOutlinerParaObject) );