summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-11-01 10:31:04 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-11-03 07:26:12 +0100
commitc5857a0371dcc7977e68d48f08f2a3ecefb67b89 (patch)
treedcdacd2d49024e64bc94cbab7f43a01f5d347b8c /sd
parentaa5f6764bd29939f6543c0afa02b21319f2c7c6e (diff)
A first step to refactor ShapeList (sd)
Change-Id: I5b036a9e2ba2b4c5eb784d7264adaa525fd4c08d Reviewed-on: https://gerrit.libreoffice.org/44156 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/drawdoc.cxx5
-rw-r--r--sd/source/core/sdpage.cxx9
-rw-r--r--sd/source/ui/view/drviews1.cxx9
3 files changed, 7 insertions, 16 deletions
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 948bba6dc85d..393bc68c2e3e 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -732,12 +732,9 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool
SfxStyleSheet* pTitleSheet = static_cast<SfxStyleSheet*>(pSPool->GetTitleSheet(aName));
- SdrObject* pObj = nullptr;
- rPresentationShapes.seekShape(0);
-
// Now look for title and outline text objects, then make those objects
// listeners.
- while( (pObj = rPresentationShapes.getNextShape()) )
+ for (auto const& pObj : rPresentationShapes.getList())
{
if (pObj->GetObjInventor() == SdrInventor::Default)
{
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 6d7358947ca6..3ac3b29568de 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -199,12 +199,9 @@ SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex, bool bFuzzySearc
// first sort all matching shapes with z-order
std::vector< SdrObject* > aMatches;
- SdrObject* pObj = nullptr;
- maPresentationShapeList.seekShape(0);
-
- while( (pObj = maPresentationShapeList.getNextShape()) )
+ for (auto const& shape : maPresentationShapeList.getList())
{
- SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj);
+ SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*shape);
if( pInfo )
{
bool bFound = false;
@@ -231,7 +228,7 @@ SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex, bool bFuzzySearc
}
if( bFound )
{
- aMatches.push_back( pObj );
+ aMatches.push_back( shape );
}
}
}
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 976d8dd1cb7b..8c322a76ff99 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -1063,16 +1063,13 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
{
// set pages for all available handout presentation objects
sd::ShapeList& rShapeList = pMaster->GetPresentationShapeList();
- SdrObject* pObj = nullptr;
- rShapeList.seekShape(0);
-
- while( (pObj = rShapeList.getNextShape()) )
+ for (auto const& shape : rShapeList.getList())
{
- if( pMaster->GetPresObjKind(pObj) == PRESOBJ_HANDOUT )
+ if( pMaster->GetPresObjKind(shape) == PRESOBJ_HANDOUT )
{
// #i105146# We want no content to be displayed for PageKind::Handout,
// so just never set a page as content
- static_cast<SdrPageObj*>(pObj)->SetReferencedPage(nullptr);
+ static_cast<SdrPageObj*>(shape)->SetReferencedPage(nullptr);
}
}
}