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

Julien Nabet serval2412 at yahoo.fr
Sun Oct 15 18:50:07 UTC 2017


 sfx2/source/appl/appdispatchprovider.cxx |    6 +++---
 sfx2/source/view/sfxbasecontroller.cxx   |    6 +++---
 sfx2/source/view/viewfrm.cxx             |   14 +++++++-------
 3 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 1651dee9a9ebbef9e296358198761361836c16ff
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Fri Oct 13 19:50:27 2017 +0200

    Replace lists by vectors (sfx2)
    
    Change-Id: I081d0614978bc6d9f1a137e09d09e6d2dadb925a
    Reviewed-on: https://gerrit.libreoffice.org/43372
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sfx2/source/appl/appdispatchprovider.cxx b/sfx2/source/appl/appdispatchprovider.cxx
index bd7b9c66fd8b..2c284688afaa 100644
--- a/sfx2/source/appl/appdispatchprovider.cxx
+++ b/sfx2/source/appl/appdispatchprovider.cxx
@@ -199,7 +199,7 @@ Sequence< sal_Int16 > SAL_CALL SfxAppDispatchProvider::getSupportedCommandGroups
 
 Sequence< frame::DispatchInformation > SAL_CALL SfxAppDispatchProvider::getConfigurableDispatchInformation( sal_Int16 nCmdGroup )
 {
-    std::list< frame::DispatchInformation > aCmdList;
+    std::vector< frame::DispatchInformation > aCmdVector;
 
     SolarMutexGuard aGuard;
     SfxSlotPool& rAppSlotPool = SfxGetpApp()->GetAppSlotPool_Impl();
@@ -223,7 +223,7 @@ Sequence< frame::DispatchInformation > SAL_CALL SfxAppDispatchProvider::getConfi
                         frame::DispatchInformation aCmdInfo;
                         aCmdInfo.Command = ".uno:" + OUString::createFromAscii(pSfxSlot->GetUnoName());
                         aCmdInfo.GroupId = nCommandGroup;
-                        aCmdList.push_back( aCmdInfo );
+                        aCmdVector.push_back( aCmdInfo );
                     }
                     pSfxSlot = rAppSlotPool.NextSlot();
                 }
@@ -231,7 +231,7 @@ Sequence< frame::DispatchInformation > SAL_CALL SfxAppDispatchProvider::getConfi
         }
     }
 
-    return comphelper::containerToSequence( aCmdList );
+    return comphelper::containerToSequence( aCmdVector );
 }
 
 }
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 935ba2aaf8c1..b82af1b29b9a 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1135,7 +1135,7 @@ uno::Sequence< sal_Int16 > SAL_CALL SfxBaseController::getSupportedCommandGroups
 
 uno::Sequence< frame::DispatchInformation > SAL_CALL SfxBaseController::getConfigurableDispatchInformation( sal_Int16 nCmdGroup )
 {
-    std::list< frame::DispatchInformation > aCmdList;
+    std::vector< frame::DispatchInformation > aCmdVector;
 
     SolarMutexGuard aGuard;
     if ( m_pData->m_pViewShell )
@@ -1162,7 +1162,7 @@ uno::Sequence< frame::DispatchInformation > SAL_CALL SfxBaseController::getConfi
                             frame::DispatchInformation aCmdInfo;
                             aCmdInfo.Command = ".uno:" + OUString::createFromAscii( pSfxSlot->GetUnoName() );
                             aCmdInfo.GroupId = nCommandGroup;
-                            aCmdList.push_back( aCmdInfo );
+                            aCmdVector.push_back( aCmdInfo );
                         }
                         pSfxSlot = pSlotPool->NextSlot();
                     }
@@ -1171,7 +1171,7 @@ uno::Sequence< frame::DispatchInformation > SAL_CALL SfxBaseController::getConfi
         }
     }
 
-    return comphelper::containerToSequence( aCmdList );
+    return comphelper::containerToSequence( aCmdVector );
 }
 
 bool SfxBaseController::HandleEvent_Impl( NotifyEvent const & rEvent )
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index ca5283c65137..77490ae2cb64 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -542,7 +542,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
                 // TODO: when UNO ViewFactories are available for SFX-based documents, the below code should
                 // be UNOized, too
                 typedef ::std::pair< Reference< XFrame >, SfxInterfaceId >  ViewDescriptor;
-                ::std::list< ViewDescriptor > aViewFrames;
+                ::std::vector< ViewDescriptor > aViewFrames;
                 SfxViewFrame *pView = GetFirst( xOldObj );
                 while ( pView )
                 {
@@ -736,23 +736,23 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 
                     try
                     {
-                        while ( !aViewFrames.empty() )
+                        for (auto const& viewFrame : aViewFrames)
                         {
-                            LoadViewIntoFrame_Impl( *xNewObj, aViewFrames.front().first, aLoadArgs, aViewFrames.front().second, false );
-                            aViewFrames.pop_front();
+                            LoadViewIntoFrame_Impl( *xNewObj, viewFrame.first, aLoadArgs, viewFrame.second, false );
                         }
+                        aViewFrames.clear();
                     }
                     catch( const Exception& )
                     {
                         // close the remaining frames
                         // Don't catch exceptions herein, if this fails, then we're left in an indetermined state, and
                         // crashing is better than trying to proceed
-                        while ( !aViewFrames.empty() )
+                        for (auto const& viewFrame : aViewFrames)
                         {
-                            Reference< util::XCloseable > xClose( aViewFrames.front().first, UNO_QUERY_THROW );
+                            Reference< util::XCloseable > xClose( viewFrame.first, UNO_QUERY_THROW );
                             xClose->close( true );
-                            aViewFrames.pop_front();
                         }
+                        aViewFrames.clear();
                     }
 
                     // Propagate document closure.


More information about the Libreoffice-commits mailing list