[Libreoffice-commits] core.git: include/xmloff sw/source xmloff/source

Julien Nabet serval2412 at yahoo.fr
Sat Dec 2 21:15:43 UTC 2017


 include/xmloff/xmlexp.hxx       |    3 ++-
 sw/source/filter/xml/xmlexp.cxx |    2 +-
 sw/source/filter/xml/xmlexp.hxx |    2 +-
 xmloff/source/core/xmlexp.cxx   |   15 ++++++---------
 4 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 279674b3024d83601e928e74e128892ca8762dc7
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Dec 2 13:47:32 2017 +0100

    Replace list by vector in xmlexp (xmloff/sw)
    
    Use for-range loop with "auto" to modernize a bit
    
    Change-Id: I9efd7ad2d60eac6a6ce0f79af6ccb02ec235c35d
    Reviewed-on: https://gerrit.libreoffice.org/45711
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index 4127e2a883fa..0812bc66448e 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -63,6 +63,7 @@
 #include <vcl/errcode.hxx>
 
 #include <list>
+#include <vector>
 #include <memory>
 #include <o3tl/typed_flags_set.hxx>
 
@@ -251,7 +252,7 @@ protected:
         @return
             the accumulated count of all settings in all groups
     */
-    virtual sal_Int32 GetDocumentSpecificSettings( ::std::list< SettingsGroup >& _out_rSettings );
+    virtual sal_Int32 GetDocumentSpecificSettings( ::std::vector< SettingsGroup >& _out_rSettings );
 
     const css::uno::Reference< css::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; }
     inline void SetEmbeddedResolver( css::uno::Reference< css::document::XEmbeddedObjectResolver > const & _xEmbeddedResolver );
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 428b90ed6bc9..037fe68c3959 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -407,7 +407,7 @@ void SwXMLExport::GetConfigurationSettings( Sequence < PropertyValue >& rProps)
     }
 }
 
-sal_Int32 SwXMLExport::GetDocumentSpecificSettings( std::list< SettingsGroup >& _out_rSettings )
+sal_Int32 SwXMLExport::GetDocumentSpecificSettings( std::vector< SettingsGroup >& _out_rSettings )
 {
     // the only doc-specific settings group we know so far are the XForms settings
     uno::Sequence<beans::PropertyValue> aXFormsSettings;
diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx
index 778cf20931c4..089521486998 100644
--- a/sw/source/filter/xml/xmlexp.hxx
+++ b/sw/source/filter/xml/xmlexp.hxx
@@ -95,7 +95,7 @@ class SwXMLExport : public SvXMLExport
     virtual void ExportContent_() override;
     virtual void GetViewSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
     virtual void GetConfigurationSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
-    virtual sal_Int32 GetDocumentSpecificSettings( std::list< SettingsGroup >& _out_rSettings ) override;
+    virtual sal_Int32 GetDocumentSpecificSettings( std::vector< SettingsGroup >& _out_rSettings ) override;
 
 private:
     void DeleteTableLines();
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 329fe258b766..85b7152ee566 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1077,7 +1077,7 @@ void SvXMLExport::ImplExportSettings()
 {
     CheckAttrList();
 
-    ::std::list< SettingsGroup > aSettings;
+    ::std::vector< SettingsGroup > aSettings;
     sal_Int32 nSettingsCount = 0;
 
     // view settings
@@ -1104,17 +1104,14 @@ void SvXMLExport::ImplExportSettings()
         SettingsExportFacade aSettingsExportContext( *this );
         XMLSettingsExportHelper aSettingsExportHelper( aSettingsExportContext );
 
-        for (   ::std::list< SettingsGroup >::const_iterator settings = aSettings.begin();
-                settings != aSettings.end();
-                ++settings
-            )
+        for (auto const& settings : aSettings)
         {
-            if ( !settings->aSettings.getLength() )
+            if ( !settings.aSettings.getLength() )
                 continue;
 
-            const OUString& sSettingsName( GetXMLToken( settings->eGroupName ) );
+            const OUString& sSettingsName( GetXMLToken( settings.eGroupName ) );
             OUString sQName = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OOO, sSettingsName );
-            aSettingsExportHelper.exportAllSettings( settings->aSettings, sQName );
+            aSettingsExportHelper.exportAllSettings( settings.aSettings, sQName );
         }
     }
 }
@@ -1824,7 +1821,7 @@ void SvXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>&)
 {
 }
 
-sal_Int32 SvXMLExport::GetDocumentSpecificSettings( ::std::list< SettingsGroup >& )
+sal_Int32 SvXMLExport::GetDocumentSpecificSettings( ::std::vector< SettingsGroup >& )
 {
     return 0;
 }


More information about the Libreoffice-commits mailing list