diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-02 10:39:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-03 08:24:45 +0200 |
commit | 12c0aaf4aea8cdd6fbabd4f04228fb40e0220067 (patch) | |
tree | 484b8304ac3e032c9a3b70b5eb8c64819ff6ce7a /svx | |
parent | c3a8dc07be1beeccbefb9242a1fd1f270cb531ba (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')
-rw-r--r-- | svx/source/inc/cell.hxx | 2 | ||||
-rw-r--r-- | svx/source/table/cell.cxx | 11 | ||||
-rw-r--r-- | svx/source/table/tableundo.cxx | 5 |
3 files changed, 6 insertions, 12 deletions
diff --git a/svx/source/inc/cell.hxx b/svx/source/inc/cell.hxx index 86c7579e1726..2f9a9dfec8c7 100644 --- a/svx/source/inc/cell.hxx +++ b/svx/source/inc/cell.hxx @@ -199,7 +199,7 @@ private: const SvxItemPropertySet* mpPropSet; - sdr::properties::TextProperties* mpProperties; + std::unique_ptr<sdr::properties::TextProperties> mpProperties; css::table::CellContentType mnCellContentType; 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) ); |