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

Miklos Vajna vmiklos at collabora.co.uk
Wed Sep 14 09:25:47 UTC 2016


 sfx2/source/view/lokhelper.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit ecc29bf323a83b0379ffed31057c8ab409e0d2d2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Sep 14 09:12:44 2016 +0200

    sfx2: use range-based for loop in lokhelper
    
    Change-Id: I7c3421231dd74c8d1e2678a6aee92288fdd3221a

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 8225474..36203ce 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -40,9 +40,8 @@ void SfxLokHelper::destroyView(int nId)
     unsigned nViewShellId = nId;
     SfxViewShellArr_Impl& rViewArr = SfxGetpApp()->GetViewShells_Impl();
 
-    for (std::size_t i = 0; i < rViewArr.size(); ++i)
+    for (SfxViewShell* pViewShell : rViewArr)
     {
-        SfxViewShell* pViewShell = rViewArr[i];
         if (pViewShell->GetViewShellId() == nViewShellId)
         {
             SfxViewFrame* pViewFrame = pViewShell->GetViewFrame();
@@ -58,9 +57,8 @@ void SfxLokHelper::setView(int nId)
     unsigned nViewShellId = nId;
     SfxViewShellArr_Impl& rViewArr = SfxGetpApp()->GetViewShells_Impl();
 
-    for (std::size_t i = 0; i < rViewArr.size(); ++i)
+    for (SfxViewShell* pViewShell : rViewArr)
     {
-        SfxViewShell* pViewShell = rViewArr[i];
         if (pViewShell->GetViewShellId() == nViewShellId)
         {
             if (pViewShell == SfxViewShell::Current())


More information about the Libreoffice-commits mailing list