diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-10-18 14:42:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-10-19 09:06:06 +0200 |
commit | 358b480be5e3146ee8edead9aed5998f011925e2 (patch) | |
tree | ff6db88b852ae835ce51b201755382e35017eeae /basctl | |
parent | b1311dff66b83c6bb119cbb75231aa97f82fe994 (diff) |
use more SdrObjList::begin/end in various
Change-Id: If054626a10d3cbd3b168dd4e66ec7f08344d2c2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158131
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/accessibility/accessibledialogwindow.cxx | 9 | ||||
-rw-r--r-- | basctl/source/dlged/dlged.cxx | 11 | ||||
-rw-r--r-- | basctl/source/dlged/dlgedobj.cxx | 5 |
3 files changed, 10 insertions, 15 deletions
diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx index 9b17f3cf4caa..d5c702616d9f 100644 --- a/basctl/source/accessibility/accessibledialogwindow.cxx +++ b/basctl/source/accessibility/accessibledialogwindow.cxx @@ -85,11 +85,10 @@ AccessibleDialogWindow::AccessibleDialogWindow (basctl::DialogWindow* pDialogWin return; SdrPage& rPage = m_pDialogWindow->GetPage(); - const size_t nCount = rPage.GetObjCount(); - for ( size_t i = 0; i < nCount; ++i ) + for (const rtl::Reference<SdrObject>& pObj : rPage) { - if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(rPage.GetObj(i))) + if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pObj.get())) { ChildDescriptor aDesc( pDlgEdObj ); if ( IsChildVisible( aDesc ) ) @@ -267,8 +266,8 @@ void AccessibleDialogWindow::UpdateChildren() if ( m_pDialogWindow ) { SdrPage& rPage = m_pDialogWindow->GetPage(); - for ( size_t i = 0, nCount = rPage.GetObjCount(); i < nCount; ++i ) - if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(rPage.GetObj(i))) + for (const rtl::Reference<SdrObject>& pObj : rPage) + if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pObj.get())) UpdateChild( ChildDescriptor( pDlgEdObj ) ); } } diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index 1917e3ff4a56..873fb3792dd7 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -516,16 +516,13 @@ void DlgEditor::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle pDlgEdForm->StartListening(); // set position and size of controls - if (const size_t nObjCount = pDlgEdPage->GetObjCount()) + for (const rtl::Reference<SdrObject>& pObj : *pDlgEdPage) { - for (size_t i = 0 ; i < nObjCount ; ++i) + if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pObj.get())) { - if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pDlgEdPage->GetObj(i))) + if (!dynamic_cast<DlgEdForm*>(pDlgEdObj)) { - if (!dynamic_cast<DlgEdForm*>(pDlgEdObj)) - { - pDlgEdObj->SetRectFromProps(); - } + pDlgEdObj->SetRectFromProps(); } } } diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx index 1f4421d5ca43..a3c2b396f791 100644 --- a/basctl/source/dlged/dlgedobj.cxx +++ b/basctl/source/dlged/dlgedobj.cxx @@ -1406,10 +1406,9 @@ void DlgEdForm::UpdateStep() if ( pSdrPage ) { - const size_t nObjCount = pSdrPage->GetObjCount(); - for ( size_t i = 0 ; i < nObjCount ; i++ ) + for (const rtl::Reference<SdrObject>& pObj : *pSdrPage) { - DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pSdrPage->GetObj(i)); + DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pObj.get()); if (pDlgEdObj && !dynamic_cast<DlgEdForm*>(pDlgEdObj)) pDlgEdObj->UpdateStep(); } |