summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/inc/cell.hxx2
-rw-r--r--svx/source/table/cell.cxx11
-rw-r--r--svx/source/table/tableundo.cxx5
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) );