diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-30 13:21:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-01 11:27:50 +0200 |
commit | 2fe50b2f11e2236ae7145fd633ad93342f5a0f6c (patch) | |
tree | 4365c2f1bb5f061192ff9b8d593933df921dda42 /svx/source/svdraw/svdpage.cxx | |
parent | 78fece3619e986ae0e4a41594965af83214f7da8 (diff) |
tdf#137544 ReformatAllEdgeObjects use recursion
rather than SdrObjListIter, which wants to build a vector of all the
child objects, of which there are a great many
Change-Id: If6a4213b94e2ef2133100e406fb435b82944ac18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136719
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw/svdpage.cxx')
-rw-r--r-- | svx/source/svdraw/svdpage.cxx | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index a98b88947b76..61a58b3dbc35 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -774,17 +774,29 @@ void SdrObjList::ReformatAllTextObjects() */ void SdrObjList::ReformatAllEdgeObjects() { - // #i120437# go over whole hierarchy, not only over object level null (seen from grouping) - SdrObjListIter aIter(this, SdrIterMode::DeepNoGroups); + ImplReformatAllEdgeObjects(*this); +} - while(aIter.IsMore()) +void SdrObjList::ImplReformatAllEdgeObjects(const SdrObjList& rObjList) +{ + // #i120437# go over whole hierarchy, not only over object level null (seen from grouping) + for(size_t nIdx(0), nCount(rObjList.GetObjCount()); nIdx < nCount; ++nIdx) { - SdrObject* pObj = aIter.Next(); - if (pObj->GetObjIdentifier() != SdrObjKind::Edge) - continue; - - SdrEdgeObj* pSdrEdgeObj = static_cast< SdrEdgeObj* >(pObj); - pSdrEdgeObj->Reformat(); + SdrObject* pSdrObject(rObjList.GetObjectForNavigationPosition(nIdx)); + const SdrObjList* pChildren(pSdrObject->getChildrenOfSdrObject()); + const bool bIsGroup(nullptr != pChildren); + if(!bIsGroup) + { + if (pSdrObject->GetObjIdentifier() == SdrObjKind::Edge) + { + SdrEdgeObj* pSdrEdgeObj = static_cast< SdrEdgeObj* >(pSdrObject); + pSdrEdgeObj->Reformat(); + } + } + else + { + ImplReformatAllEdgeObjects(*pChildren); + } } } |