summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx16
-rw-r--r--sd/source/ui/view/drawview.cxx16
-rw-r--r--sd/source/ui/view/drviews2.cxx10
-rw-r--r--sd/source/ui/view/outlview.cxx12
4 files changed, 20 insertions, 34 deletions
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index fb7cec583aff..8a797c066479 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1634,15 +1634,15 @@ private:
continue;
SdrTextObj* pTextObj = nullptr;
- size_t nObj (0);
- while (pTextObj==nullptr && nObj < pPage->GetObjCount())
+ for (const rtl::Reference<SdrObject>& pObj : *pPage)
{
- SdrObject* pObj = pPage->GetObj(nObj++);
if (pObj->GetObjInventor() == SdrInventor::Default
&& pObj->GetObjIdentifier() == SdrObjKind::TitleText)
{
- pTextObj = DynCastSdrTextObj(pObj);
+ pTextObj = DynCastSdrTextObj(pObj.get());
+ if (pTextObj)
+ break;
}
}
@@ -1658,15 +1658,15 @@ private:
pOutliner->Insert(OUString());
pTextObj = nullptr;
- nObj = 0;
- while (pTextObj==nullptr && nObj<pPage->GetObjCount())
+ for (const rtl::Reference<SdrObject>& pObj : *pPage)
{
- SdrObject* pObj = pPage->GetObj(nObj++);
if (pObj->GetObjInventor() == SdrInventor::Default
&& pObj->GetObjIdentifier() == SdrObjKind::OutlineText)
{
- pTextObj = DynCastSdrTextObj(pObj);
+ pTextObj = DynCastSdrTextObj(pObj.get());
+ if (pTextObj)
+ break;
}
}
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index bd454bec194b..69555bb7419d 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -117,24 +117,16 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet,
SfxStyleSheetBasePool* pStShPool = mrDoc.GetStyleSheetPool();
SdPage& rPage = *mpDrawViewShell->getCurrentPage();
SdrPage& rMasterPage = rPage.TRG_GetMasterPage();
- size_t nObjCount = rMasterPage.GetObjCount();
- for (size_t nObj = 0; nObj < nObjCount; ++nObj)
- {
- SdrObject* pObject = rMasterPage.GetObj(nObj);
- SetMasterAttributes(pObject, rPage, rSet, pStShPool, bOk, bMaster, bSlide);
- }
+ for (const rtl::Reference<SdrObject>& pObject : rMasterPage)
+ SetMasterAttributes(pObject.get(), rPage, rSet, pStShPool, bOk, bMaster, bSlide);
return bOk;
}
if (mpDrawViewShell && bSlide)
{
SfxStyleSheetBasePool* pStShPool = mrDoc.GetStyleSheetPool();
SdPage& rPage = *mpDrawViewShell->getCurrentPage();
- size_t nObjCount = rPage.GetObjCount();
- for (size_t nObj = 0; nObj < nObjCount; ++nObj)
- {
- SdrObject* pObject = rPage.GetObj(nObj);
- SetMasterAttributes(pObject, rPage, rSet, pStShPool, bOk, bMaster, bSlide);
- }
+ for (const rtl::Reference<SdrObject>& pObject : rPage)
+ SetMasterAttributes(pObject.get(), rPage, rSet, pStShPool, bOk, bMaster, bSlide);
return bOk;
}
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 4dc14204b53d..d7fefcecae72 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -338,10 +338,9 @@ public:
for (sal_uInt16 nPageIndex = 0; nPageIndex < nCount; ++nPageIndex)
{
SdPage* pMasterPage = m_rDrawViewShell.GetDoc()->GetMasterSdPage(nPageIndex, PageKind::Standard);
- for (size_t nObject = 0; nObject < pMasterPage->GetObjCount(); ++nObject)
+ for (const rtl::Reference<SdrObject>& pObject : *pMasterPage)
{
- SdrObject* pObject = pMasterPage->GetObj(nObject);
- SdrRectObj* pRectObject = dynamic_cast<SdrRectObj*>(pObject);
+ SdrRectObj* pRectObject = dynamic_cast<SdrRectObj*>(pObject.get());
if (pRectObject && pRectObject->GetTextKind() == SdrObjKind::Text)
{
OutlinerParaObject* pOutlinerParagraphObject = pRectObject->GetOutlinerParaObject();
@@ -377,10 +376,9 @@ private:
for (sal_uInt16 nPageIndex = 0; nPageIndex < nCount; ++nPageIndex)
{
SdPage* pMasterPage = m_rDrawViewShell.GetDoc()->GetMasterSdPage(nPageIndex, PageKind::Standard);
- for (size_t nObject = 0; nObject < pMasterPage->GetObjCount(); ++nObject)
+ for (const rtl::Reference<SdrObject>& pObject : *pMasterPage)
{
- SdrObject* pObject = pMasterPage->GetObj(nObject);
- SdrRectObj* pRectObject = dynamic_cast<SdrRectObj*>(pObject);
+ SdrRectObj* pRectObject = dynamic_cast<SdrRectObj*>(pObject.get());
if (pRectObject && pRectObject->GetTextKind() == SdrObjKind::Text)
{
OutlinerParaObject* pOutlinerParagraphObject = pRectObject->GetOutlinerParaObject();
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 8ce0a5dcb874..ab994e235813 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -857,16 +857,14 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner, void )
*/
SdrTextObj* OutlineView::GetTitleTextObject(SdrPage const * pPage)
{
- const size_t nObjectCount = pPage->GetObjCount();
SdrTextObj* pResult = nullptr;
- for (size_t nObject = 0; nObject < nObjectCount; ++nObject)
+ for (const rtl::Reference<SdrObject>& pObject : *pPage)
{
- SdrObject* pObject = pPage->GetObj(nObject);
if (pObject->GetObjInventor() == SdrInventor::Default &&
pObject->GetObjIdentifier() == SdrObjKind::TitleText)
{
- pResult = static_cast<SdrTextObj*>(pObject);
+ pResult = static_cast<SdrTextObj*>(pObject.get());
break;
}
}
@@ -878,16 +876,14 @@ SdrTextObj* OutlineView::GetTitleTextObject(SdrPage const * pPage)
*/
SdrTextObj* OutlineView::GetOutlineTextObject(SdrPage const * pPage)
{
- const size_t nObjectCount = pPage->GetObjCount();
SdrTextObj* pResult = nullptr;
- for (size_t nObject = 0; nObject < nObjectCount; ++nObject)
+ for (const rtl::Reference<SdrObject>& pObject : *pPage)
{
- SdrObject* pObject = pPage->GetObj(nObject);
if (pObject->GetObjInventor() == SdrInventor::Default &&
pObject->GetObjIdentifier() == SdrObjKind::OutlineText)
{
- pResult = static_cast<SdrTextObj*>(pObject);
+ pResult = static_cast<SdrTextObj*>(pObject.get());
break;
}
}