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 /chart2 | |
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 'chart2')
-rw-r--r-- | chart2/source/view/main/DrawModelWrapper.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx index 9b4a8b28a1ef..5593c9b59943 100644 --- a/chart2/source/view/main/DrawModelWrapper.cxx +++ b/chart2/source/view/main/DrawModelWrapper.cxx @@ -293,17 +293,13 @@ SdrObject* DrawModelWrapper::getNamedSdrObject( const OUString& rObjectCID, SdrO { if(!pSearchList || rObjectCID.isEmpty()) return nullptr; - const size_t nCount = pSearchList->GetObjCount(); - for( size_t nN=0; nN<nCount; ++nN ) + for (const rtl::Reference<SdrObject>& pObj : *pSearchList) { - SdrObject* pObj = pSearchList->GetObj(nN); - if(!pObj) - continue; if( ObjectIdentifier::areIdenticalObjects( rObjectCID, pObj->GetName() ) ) - return pObj; - pObj = DrawModelWrapper::getNamedSdrObject( rObjectCID, pObj->GetSubList() ); - if(pObj) - return pObj; + return pObj.get(); + SdrObject* pNamedObj = DrawModelWrapper::getNamedSdrObject( rObjectCID, pObj->GetSubList() ); + if(pNamedObj) + return pNamedObj; } return nullptr; } |