diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-10 19:21:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-10 22:19:25 +0200 |
commit | fb8973f31f111229be5184f4e4223e963ced2c7b (patch) | |
tree | ff61aba8eb2b0acd3e2b8a50b3cd564854c032a1 /editeng | |
parent | 7ca1632a402bea7568d8441524d3f6092695f3c5 (diff) |
ofz#23492 the only user of this ctor throws away the original of the clone
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 <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 4 | ||||
-rw-r--r-- | editeng/source/outliner/outlobj.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
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<OutlinerParaObject> Outliner::CreateParaObject( sal_Int32 nStart if (nCount <= 0) return nullptr; - std::unique_ptr<EditTextObject> pText = pEditEngine->CreateTextObject( nStartPara, nCount ); + std::unique_ptr<EditTextObject> 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<OutlinerParaObject> Outliner::CreateParaObject( sal_Int32 nStart aParagraphDataVector[nPara-nStartPara] = *GetParagraph(nPara); } - std::unique_ptr<OutlinerParaObject> pPObj(new OutlinerParaObject(*pText, aParagraphDataVector, bIsEditDoc)); + std::unique_ptr<OutlinerParaObject> 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<EditTextObject> xTextObj, const ParagraphDataVector& rParagraphDataVector, bool bIsEditDoc ) : + mpImpl(OutlinerParaObjData(std::move(xTextObj), rParagraphDataVector, bIsEditDoc)) { } |