From fb8973f31f111229be5184f4e4223e963ced2c7b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 10 Oct 2020 19:21:38 +0100 Subject: ofz#23492 the only user of this ctor throws away the original of the clone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit so we can take ownership of the original instead Change-Id: I26fd4303a3b205df309f91bfa5bcddbbc41dfd7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104173 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- editeng/source/outliner/outliner.cxx | 4 ++-- editeng/source/outliner/outlobj.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'editeng/source') diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 5684c64a44a7..2fba66dc2d4e 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -373,7 +373,7 @@ std::unique_ptr Outliner::CreateParaObject( sal_Int32 nStart if (nCount <= 0) return nullptr; - std::unique_ptr pText = pEditEngine->CreateTextObject( nStartPara, nCount ); + std::unique_ptr xText = pEditEngine->CreateTextObject( nStartPara, nCount ); const bool bIsEditDoc(OutlinerMode::TextObject == ImplGetOutlinerMode()); ParagraphDataVector aParagraphDataVector(nCount); const sal_Int32 nLastPara(nStartPara + nCount - 1); @@ -383,7 +383,7 @@ std::unique_ptr Outliner::CreateParaObject( sal_Int32 nStart aParagraphDataVector[nPara-nStartPara] = *GetParagraph(nPara); } - std::unique_ptr pPObj(new OutlinerParaObject(*pText, aParagraphDataVector, bIsEditDoc)); + std::unique_ptr pPObj(new OutlinerParaObject(std::move(xText), aParagraphDataVector, bIsEditDoc)); pPObj->SetOutlinerMode(GetMode()); return pPObj; diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx index 48c7aa02ab08..61b0a40d6b98 100644 --- a/editeng/source/outliner/outlobj.cxx +++ b/editeng/source/outliner/outlobj.cxx @@ -62,8 +62,8 @@ bool OutlinerParaObjData::isWrongListEqual(const OutlinerParaObjData& rCompare) } OutlinerParaObject::OutlinerParaObject( - const EditTextObject& rTextObj, const ParagraphDataVector& rParagraphDataVector, bool bIsEditDoc ) : - mpImpl(OutlinerParaObjData(rTextObj.Clone(), rParagraphDataVector, bIsEditDoc)) + std::unique_ptr xTextObj, const ParagraphDataVector& rParagraphDataVector, bool bIsEditDoc ) : + mpImpl(OutlinerParaObjData(std::move(xTextObj), rParagraphDataVector, bIsEditDoc)) { } -- cgit