From 50c63e5c2f7962e8893e2d04b0e958209432f4c9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 29 Jun 2018 15:38:29 +0200 Subject: pass OutlinerParaObject around by std::unique_ptr SdrText::SetOutlinerParaObject was modified to not check for self-assign, and instead assert because the existing check was no longer possible. Fix bug in SdrUndoObjSetText::Undo(), where it was calling SdrText::SetOutlinerParaObject unnecessarily, because NbcSetOutlinerParaObjectForText already does that. Optimise Outliner::GetEmptyParaObject by creating a new constructor for OutlinerParaObject, so we don't need to copy the new object we get back from GetEmptyTextObject, unnecessarily. Change-Id: I57c475583d6c31658c154e24992b3d587bad9841 Reviewed-on: https://gerrit.libreoffice.org/56730 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/svdraw/svdotxat.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'svx/source/svdraw/svdotxat.cxx') diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx index a28a5a698a3c..7a3490e3722d 100644 --- a/svx/source/svdraw/svdotxat.cxx +++ b/svx/source/svdraw/svdotxat.cxx @@ -420,9 +420,9 @@ void SdrTextObj::RemoveOutlinerCharacterAttribs( const std::vector& if(!pEdtOutl || (pText != getActiveText()) ) { const sal_Int32 nParaCount = pOutliner->GetParagraphCount(); - OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount); + std::unique_ptr pTemp = pOutliner->CreateParaObject(0, nParaCount); pOutliner->Clear(); - NbcSetOutlinerParaObjectForText(pTemp, pText); + NbcSetOutlinerParaObjectForText(std::move(pTemp), pText); } } } -- cgit