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

Julien Nabet serval2412 at yahoo.fr
Sun Nov 5 05:31:26 UTC 2017


 svtools/source/config/miscopt.cxx |   17 +++++------------
 svtools/source/misc/transfer2.cxx |    2 +-
 svtools/source/uno/unoimap.cxx    |    2 +-
 3 files changed, 7 insertions(+), 14 deletions(-)

New commits:
commit ca2aaa2b9f4ce69d05d415e13451ae6a6030f032
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Nov 4 15:29:53 2017 +0100

    Replace remaining lists by vectors in svtools
    
    Change-Id: I3b85f4853d305fec2efe1fa351466c56d11473c9
    Reviewed-on: https://gerrit.libreoffice.org/44303
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index fa53cf0d2208..4a06f66b2526 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -33,7 +33,7 @@
 #include <vcl/settings.hxx>
 #include <vcl/toolbox.hxx>
 
-#include <list>
+#include <vector>
 
 using namespace ::utl                   ;
 using namespace ::osl                   ;
@@ -73,7 +73,7 @@ using namespace ::com::sun::star;
 class SvtMiscOptions_Impl : public ConfigItem
 {
 private:
-    ::std::list<Link<LinkParamNone*,void>> aList;
+    ::std::vector<Link<LinkParamNone*,void>> aList;
     bool        m_bUseSystemFileDialog;
     bool        m_bIsUseSystemFileDialogRO;
     bool        m_bPluginsEnabled;
@@ -521,20 +521,13 @@ void SvtMiscOptions_Impl::AddListenerLink( const Link<LinkParamNone*,void>& rLin
 
 void SvtMiscOptions_Impl::RemoveListenerLink( const Link<LinkParamNone*,void>& rLink )
 {
-    for ( ::std::list<Link<LinkParamNone*,void>>::iterator iter = aList.begin(); iter != aList.end(); ++iter )
-    {
-        if ( *iter == rLink )
-        {
-            aList.erase(iter);
-            break;
-        }
-    }
+    aList.erase(std::remove(aList.begin(), aList.end(), rLink), aList.end());
 }
 
 void SvtMiscOptions_Impl::CallListeners()
 {
-    for ( ::std::list<Link<LinkParamNone*,void>>::const_iterator iter = aList.begin(); iter != aList.end(); ++iter )
-        iter->Call( nullptr );
+    for (auto const& elem : aList)
+        elem.Call( nullptr );
 }
 
 void SvtMiscOptions_Impl::SetToolboxStyle( sal_Int16 nStyle )
diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx
index 9073fe0fba07..7a4e1e3b6e44 100644
--- a/svtools/source/misc/transfer2.cxx
+++ b/svtools/source/misc/transfer2.cxx
@@ -323,7 +323,7 @@ struct TDataCntnrEntry_Impl
 };
 
 
-typedef ::std::list< TDataCntnrEntry_Impl > TDataCntnrEntryList;
+typedef ::std::vector< TDataCntnrEntry_Impl > TDataCntnrEntryList;
 
 
 struct TransferDataContainer_Impl
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 58f95496182f..e7e7398dea72 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -536,7 +536,7 @@ public:
 private:
     OUString maName;
 
-    std::list< rtl::Reference<SvUnoImageMapObject> > maObjectList;
+    std::vector< rtl::Reference<SvUnoImageMapObject> > maObjectList;
 };
 
 UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMap );


More information about the Libreoffice-commits mailing list