summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdpage.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-30 13:21:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-07-01 11:27:50 +0200
commit2fe50b2f11e2236ae7145fd633ad93342f5a0f6c (patch)
tree4365c2f1bb5f061192ff9b8d593933df921dda42 /svx/source/svdraw/svdpage.cxx
parent78fece3619e986ae0e4a41594965af83214f7da8 (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.cxx30
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);
+ }
}
}