From 2554efabb6d7cd2ad9f7cfdddd0712c25cdca1cd Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 19 Nov 2015 09:14:59 +0200 Subject: use comphelper::containerToSequence in chart2, we remove a local equivalent of the method Change-Id: I25129a3d1ea1dd724eb9cd38a57be37a78b3d100 --- forms/source/component/ComboBox.cxx | 8 +------- forms/source/component/Filter.cxx | 3 +-- forms/source/component/FormattedField.cxx | 4 +--- forms/source/component/refvaluecomponent.cxx | 4 +--- forms/source/misc/componenttools.cxx | 5 ++--- forms/source/xforms/namedcollection.hxx | 7 +------ 6 files changed, 7 insertions(+), 24 deletions(-) (limited to 'forms') diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index bbb7da042884..eb636fbf8367 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -659,14 +659,8 @@ void OComboBoxModel::loadData( bool _bForce ) return; } - // Create css::uno::Sequence for ListBox - css::uno::Sequence aStringSeq(aStringList.size()); - OUString* pStringAry = aStringSeq.getArray(); - for (sal_Int32 i = 0; i aStringSeq( aProposals.size() ); - ::std::copy( aProposals.begin(), aProposals.end(), aStringSeq.getArray() ); + Sequence< OUString> aStringSeq( comphelper::containerToSequence(aProposals) ); const Reference< XComboBox > xComboBox( getPeer(), UNO_QUERY_THROW ); xComboBox->addItems( aStringSeq, 0 ); diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index f27f31e46f44..614875ddc15f 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -1019,9 +1019,7 @@ Sequence< Type > OFormattedModel::getSupportedBindingTypes() aTypes.push_front(cppu::UnoType< sal_Bool >::get() ); break; } - Sequence< Type > aTypesRet( aTypes.size() ); - ::std::copy( aTypes.begin(), aTypes.end(), aTypesRet.getArray() ); - return aTypesRet; + return comphelper::containerToSequence(aTypes); } Any OFormattedModel::getDefaultForReset() const diff --git a/forms/source/component/refvaluecomponent.cxx b/forms/source/component/refvaluecomponent.cxx index 0be4706f9d73..c1d6ae81beec 100644 --- a/forms/source/component/refvaluecomponent.cxx +++ b/forms/source/component/refvaluecomponent.cxx @@ -177,9 +177,7 @@ namespace frm aTypes.push_front( cppu::UnoType::get() ); // push_front, because this is the preferred type - Sequence< Type > aTypesRet( aTypes.size() ); - ::std::copy( aTypes.begin(), aTypes.end(), aTypesRet.getArray() ); - return aTypesRet; + return comphelper::containerToSequence(aTypes); } diff --git a/forms/source/misc/componenttools.cxx b/forms/source/misc/componenttools.cxx index add35d583630..13a1ed71f03d 100644 --- a/forms/source/misc/componenttools.cxx +++ b/forms/source/misc/componenttools.cxx @@ -20,6 +20,7 @@ #include "componenttools.hxx" #include +#include #include #include @@ -80,9 +81,7 @@ namespace frm TypeBag::TypeSequence TypeBag::getTypes() const { - TypeSequence aTypes( m_aTypes.size() ); - ::std::copy( m_aTypes.begin(), m_aTypes.end(), aTypes.getArray() ); - return aTypes; + return comphelper::containerToSequence(m_aTypes); } diff --git a/forms/source/xforms/namedcollection.hxx b/forms/source/xforms/namedcollection.hxx index ec10c91950f3..1c53ad9b0230 100644 --- a/forms/source/xforms/namedcollection.hxx +++ b/forms/source/xforms/namedcollection.hxx @@ -64,12 +64,7 @@ public: aNames.push_back( xNamed->getName() ); } - // copy names to Sequence and return - css::uno::Sequence aResult( aNames.size() ); - OUString* pStrings = aResult.getArray(); - std::copy( aNames.begin(), aNames.end(), pStrings ); - - return aResult; + return comphelper::containerToSequence(aNames); } protected: -- cgit v1.2.3