sc/inc/cellvalue.hxx | 2 +- sc/source/core/data/cellvalue.cxx | 4 ++-- sc/source/filter/oox/revisionfragment.cxx | 2 +- sc/source/filter/xml/XMLTrackedChangesContext.cxx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
New commits: commit 7eae7e54e0c55d5896cf807c339fd0789f54d380 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Thu Jun 16 14:24:56 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Jun 16 20:39:05 2022 +0200 pass EditTextObject by unique_ptr to make the ownership passing obvious Change-Id: Icf4b94a422b91da3082fe1ce56eff149d390a649 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136000 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/inc/cellvalue.hxx b/sc/inc/cellvalue.hxx index 5876f9584a4f..942cf006cab5 100644 --- a/sc/inc/cellvalue.hxx +++ b/sc/inc/cellvalue.hxx @@ -58,7 +58,7 @@ public: void set( double fValue ); void set( const svl::SharedString& rStr ); void set( const EditTextObject& rEditText ); - void set( EditTextObject* pEditText ); + void set( std::unique_ptr<EditTextObject> ); void set( ScFormulaCell* pFormula ); CellType getType() const { return meType; } diff --git a/sc/source/core/data/cellvalue.cxx b/sc/source/core/data/cellvalue.cxx index ca8c8e78c954..c565e0a488d6 100644 --- a/sc/source/core/data/cellvalue.cxx +++ b/sc/source/core/data/cellvalue.cxx @@ -315,11 +315,11 @@ void ScCellValue::set( const EditTextObject& rEditText ) mpEditText = rEditText.Clone().release(); } -void ScCellValue::set( EditTextObject* pEditText ) +void ScCellValue::set( std::unique_ptr<EditTextObject> xEditText ) { clear(); meType = CELLTYPE_EDIT; - mpEditText = pEditText; + mpEditText = xEditText.release(); } void ScCellValue::set( ScFormulaCell* pFormula ) diff --git a/sc/source/filter/oox/revisionfragment.cxx b/sc/source/filter/oox/revisionfragment.cxx index f6fee91c4051..4a0fa785e6df 100644 --- a/sc/source/filter/oox/revisionfragment.cxx +++ b/sc/source/filter/oox/revisionfragment.cxx @@ -147,7 +147,7 @@ protected: { svl::SharedStringPool& rPool = rDoc.GetSharedStringPool(); pTextObj->NormalizeString(rPool); - mrCellValue.set(pTextObj.release()); + mrCellValue.set(std::move(pTextObj)); } } } diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx index d478a8af0ba9..8294eb979a92 100644 --- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx +++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx @@ -860,7 +860,7 @@ void SAL_CALL ScXMLChangeCellContext::endFastElement( sal_Int32 /*nElement*/ ) } // The cell will own the text object instance. - mrOldCell.set(mpEditTextObj->CreateTextObject().release()); + mrOldCell.set(mpEditTextObj->CreateTextObject()); GetScImport().GetTextImport()->ResetCursor(); mpEditTextObj.clear(); }