summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-05-03 10:47:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-05-03 12:47:49 +0200
commitd72f3d480eaffd8bd6d14fe60f01c995886cf317 (patch)
treeab02d6497f60dcbf9c240e88d4671ac860a5de36
parent5431b756d45bebe74beaba2026704552ee6891f0 (diff)
tdf#137544 simplify SdrObjList destructor
by allowing the maList to destruct naturally, it deletes the objects from first to last. This speeds up the search process when these objects remove themselves from broadcasters. Change-Id: I0534b39bc82b24d0e4245773e105a77bce735c9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151315 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--svx/source/svdraw/svdpage.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index e685c40c89a5..351278cf789c 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -112,14 +112,9 @@ void SdrObjList::ClearSdrObjList()
SdrObjList::~SdrObjList()
{
- // clear SdrObjects without broadcasting
- while(!maList.empty())
- {
- // remove last object from list
- SdrObject& rObj = *maList.back();
- rObj.setParentOfSdrObject(nullptr);
- maList.pop_back();
- }
+ // Clear SdrObjects without broadcasting.
+ for (auto& rxObj : maList)
+ rxObj->setParentOfSdrObject(nullptr);
}
SdrPage* SdrObjList::getSdrPageFromSdrObjList() const