summaryrefslogtreecommitdiff
path: root/svx/source/sdr/properties
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-29 15:38:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-02 08:47:58 +0200
commit50c63e5c2f7962e8893e2d04b0e958209432f4c9 (patch)
tree308893225e96328c5ff5fd071a97c2110e61577b /svx/source/sdr/properties
parentd98f1e4e0373782ad71b945dcc92c1c3d6dcf6c8 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr/properties')
-rw-r--r--svx/source/sdr/properties/textproperties.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index 503872cb4ba6..1ca04d65a628 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -128,10 +128,10 @@ namespace sdr
mpItemSet->Put(aNewSet);
}
- OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount);
+ std::unique_ptr<OutlinerParaObject> pTemp = pOutliner->CreateParaObject(0, nParaCount);
pOutliner->Clear();
- rObj.NbcSetOutlinerParaObjectForText(pTemp,pText);
+ rObj.NbcSetOutlinerParaObjectForText(std::move(pTemp),pText);
}
}
}
@@ -187,10 +187,10 @@ namespace sdr
ESelection aSelection( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL);
rOutliner.RemoveAttribs(aSelection, true, 0);
- OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, nParaCount);
+ std::unique_ptr<OutlinerParaObject> pTemp = rOutliner.CreateParaObject(0, nParaCount);
rOutliner.Clear();
- rObj.NbcSetOutlinerParaObjectForText( pTemp, pText );
+ rObj.NbcSetOutlinerParaObjectForText( std::move(pTemp), pText );
}
}
}
@@ -338,9 +338,9 @@ namespace sdr
delete pTempSet;
}
- OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, nParaCount);
+ std::unique_ptr<OutlinerParaObject> pTemp = rOutliner.CreateParaObject(0, nParaCount);
rOutliner.Clear();
- rObj.NbcSetOutlinerParaObjectForText(pTemp, pText);
+ rObj.NbcSetOutlinerParaObjectForText(std::move(pTemp), pText);
}
}
}
@@ -518,8 +518,8 @@ namespace sdr
if(bBurnIn)
{
- OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount);
- rObj.NbcSetOutlinerParaObjectForText(pTemp,pText);
+ std::unique_ptr<OutlinerParaObject> pTemp = pOutliner->CreateParaObject(0, nParaCount);
+ rObj.NbcSetOutlinerParaObjectForText(std::move(pTemp),pText);
}
}