diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-11 10:22:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-15 08:38:03 +0200 |
commit | 7ec60cdc3a6ca76d96411288ad55435de39c4b0c (patch) | |
tree | 6ba9a4e5c4a3fe817342b361bd8b471c42d9d726 /editeng/source/editeng/impedit4.cxx | |
parent | d5f9675c2dba0c2e8993078946ee669e1d61b086 (diff) |
loplugin:useuniqueptr pass XEditAttribute around by std::unique_ptr
Change-Id: Idaf02002cecb1300a5fc3bcb0e298b11a1958bb1
Reviewed-on: https://gerrit.libreoffice.org/59008
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/editeng/impedit4.cxx')
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index b9b55534b37e..5c2378917381 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1060,7 +1060,7 @@ std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject( EditSelection a if ( bEmptyPara || ( ( pAttr->GetEnd() > nStartPos ) && ( pAttr->GetStart() < nEndPos ) ) ) { - XEditAttribute* pX = pTxtObj->mpImpl->CreateAttrib(*pAttr->GetItem(), pAttr->GetStart(), pAttr->GetEnd()); + std::unique_ptr<XEditAttribute> pX = pTxtObj->mpImpl->CreateAttrib(*pAttr->GetItem(), pAttr->GetStart(), pAttr->GetEnd()); // Possibly Correct ... if ( ( nNode == nStartNode ) && ( nStartPos != 0 ) ) { @@ -1075,9 +1075,9 @@ std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject( EditSelection a } DBG_ASSERT( pX->GetEnd() <= (nEndPos-nStartPos), "CreateBinTextObject: Attribute too long!" ); if ( !pX->GetLen() && !bEmptyPara ) - pTxtObj->mpImpl->DestroyAttrib(pX); + pTxtObj->mpImpl->DestroyAttrib(std::move(pX)); else - pC->GetCharAttribs().push_back(std::unique_ptr<XEditAttribute>(pX)); + pC->GetCharAttribs().push_back(std::move(pX)); } nAttr++; pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); |