summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-12-02 13:47:32 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-12-02 22:13:31 +0100
commit279674b3024d83601e928e74e128892ca8762dc7 (patch)
tree40446164deb368ddaf9f474f99f6e304d3e03dbd
parent2f2c7c3dadda7a20c8d49e6ea044887a94d2d46e (diff)
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@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--include/xmloff/xmlexp.hxx3
-rw-r--r--sw/source/filter/xml/xmlexp.cxx2
-rw-r--r--sw/source/filter/xml/xmlexp.hxx2
-rw-r--r--xmloff/source/core/xmlexp.cxx15
4 files changed, 10 insertions, 12 deletions
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;
}