summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-10-18 14:07:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-10-19 09:05:56 +0200
commitb1311dff66b83c6bb119cbb75231aa97f82fe994 (patch)
treeb654804289c5ad0cd0cde7acc31e49e008a1ff29 /sc/source/ui/unoobj
parent37298c29e775c0715c779e7d2be3902290556d17 (diff)
use more SdrObjList::begin/end in sc
Change-Id: I6b8614e4e8917f71308cda4caaeb714ae18885f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158130 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index e139b4a59ec6..70f57dda89ca 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -1119,15 +1119,12 @@ uno::Reference< uno::XInterface > ScTabViewObj::GetClickedObject(const Point& rP
double fHitLog = pActiveWin->PixelToLogic(Size(pDrawView->GetHitTolerancePixel(),0)).Width();
- const size_t nCount(pDrawPage->GetObjCount());
- bool bFound(false);
- for (size_t i = 0; i < nCount && !bFound; ++i)
+ for (const rtl::Reference<SdrObject>& pObj : *pDrawPage)
{
- SdrObject* pObj = pDrawPage->GetObj(i);
- if (pObj && SdrObjectPrimitiveHit(*pObj, aPos, {fHitLog, fHitLog}, *pDrawView->GetSdrPageView(), nullptr, false))
+ if (SdrObjectPrimitiveHit(*pObj, aPos, {fHitLog, fHitLog}, *pDrawView->GetSdrPageView(), nullptr, false))
{
xTarget.set(pObj->getUnoShape(), uno::UNO_QUERY);
- bFound = true;
+ break;
}
}
}