[Libreoffice-commits] core.git: sd/source

Julien Nabet serval2412 at yahoo.fr
Fri Nov 3 06:26:44 UTC 2017


 sd/source/core/drawdoc.cxx     |    5 +----
 sd/source/core/sdpage.cxx      |    9 +++------
 sd/source/ui/view/drviews1.cxx |    9 +++------
 3 files changed, 7 insertions(+), 16 deletions(-)

New commits:
commit c5857a0371dcc7977e68d48f08f2a3ecefb67b89
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Wed Nov 1 10:31:04 2017 +0100

    A first step to refactor ShapeList (sd)
    
    Change-Id: I5b036a9e2ba2b4c5eb784d7264adaa525fd4c08d
    Reviewed-on: https://gerrit.libreoffice.org/44156
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

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);
                     }
                 }
             }


More information about the Libreoffice-commits mailing list