diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 4 | ||||
-rw-r--r-- | svx/source/table/tableundo.cxx | 10 | ||||
-rw-r--r-- | svx/source/table/tableundo.hxx | 3 |
3 files changed, 7 insertions, 10 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 2eea31d23237..51f35d8e80c7 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -279,7 +279,7 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSave { auto p = pObj->GetOutlinerParaObject(); if(p) - pTextUndo.reset( new OutlinerParaObject(*p) ); + pTextUndo = *p; } } @@ -316,7 +316,7 @@ void SdrUndoAttrObj::Undo() // #i8508# auto p = pObj->GetOutlinerParaObject(); if(p) - pTextRedo.reset( new OutlinerParaObject(*p) ); + pTextRedo = *p; } } diff --git a/svx/source/table/tableundo.cxx b/svx/source/table/tableundo.cxx index 2840562a4acf..66641469dd09 100644 --- a/svx/source/table/tableundo.cxx +++ b/svx/source/table/tableundo.cxx @@ -61,10 +61,8 @@ void CellUndo::dispose() maUndoData.mpProperties = nullptr; delete maRedoData.mpProperties; maRedoData.mpProperties = nullptr; - delete maUndoData.mpOutlinerParaObject; - maUndoData.mpOutlinerParaObject = nullptr; - delete maRedoData.mpOutlinerParaObject; - maRedoData.mpOutlinerParaObject = nullptr; + maUndoData.mpOutlinerParaObject.reset(); + maRedoData.mpOutlinerParaObject.reset(); } void CellUndo::ObjectInDestruction(const SdrObject& ) @@ -136,9 +134,9 @@ void CellUndo::getDataFromCell( Data& rData ) rData.mpProperties = mxCell->CloneProperties( *mxObjRef, *mxCell); if( mxCell->GetOutlinerParaObject() ) - rData.mpOutlinerParaObject = new OutlinerParaObject(*mxCell->GetOutlinerParaObject()); + rData.mpOutlinerParaObject = *mxCell->GetOutlinerParaObject(); else - rData.mpOutlinerParaObject = nullptr; + rData.mpOutlinerParaObject.reset(); rData.msFormula = mxCell->msFormula; rData.mfValue = mxCell->mfValue; diff --git a/svx/source/table/tableundo.hxx b/svx/source/table/tableundo.hxx index 861251963658..822f5ec642fa 100644 --- a/svx/source/table/tableundo.hxx +++ b/svx/source/table/tableundo.hxx @@ -55,7 +55,7 @@ private: struct Data { sdr::properties::TextProperties* mpProperties; - OutlinerParaObject* mpOutlinerParaObject; + std::optional<OutlinerParaObject> mpOutlinerParaObject; OUString msFormula; double mfValue; @@ -66,7 +66,6 @@ private: Data() : mpProperties(nullptr) - , mpOutlinerParaObject(nullptr) , mfValue(0) , mnError(0) , mbMerged(false) |