summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-19 09:14:59 +0200
committerNoel Grandin <noel@peralex.com>2015-11-19 09:33:29 +0200
commit2554efabb6d7cd2ad9f7cfdddd0712c25cdca1cd (patch)
tree1b8fd3940910ffcd328e16a53e208c099f67ab21 /forms
parentf7b5f477bfd942e0a1d8880c372635000d724dd7 (diff)
use comphelper::containerToSequence
in chart2, we remove a local equivalent of the method Change-Id: I25129a3d1ea1dd724eb9cd38a57be37a78b3d100
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/ComboBox.cxx8
-rw-r--r--forms/source/component/Filter.cxx3
-rw-r--r--forms/source/component/FormattedField.cxx4
-rw-r--r--forms/source/component/refvaluecomponent.cxx4
-rw-r--r--forms/source/misc/componenttools.cxx5
-rw-r--r--forms/source/xforms/namedcollection.hxx7
6 files changed, 7 insertions, 24 deletions
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<OUString> for ListBox
- css::uno::Sequence<OUString> aStringSeq(aStringList.size());
- OUString* pStringAry = aStringSeq.getArray();
- for (sal_Int32 i = 0; i<aStringSeq.getLength(); ++i)
- pStringAry[i] = aStringList[i];
-
// Set String-Sequence at ListBox
- setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( aStringSeq ) );
+ setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( comphelper::containerToSequence(aStringList) ) );
}
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx
index e23009b6fd6f..5cb32bd9f9c2 100644
--- a/forms/source/component/Filter.cxx
+++ b/forms/source/component/Filter.cxx
@@ -466,8 +466,7 @@ namespace frm
}
// fill the list items into our peer
- Sequence< OUString> 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<Type>(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<OUString>::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<Type>(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 <com/sun/star/container/XChild.hpp>
+#include <comphelper/sequence.hxx>
#include <algorithm>
#include <iterator>
@@ -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<css::uno::Type>(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<OUString> aResult( aNames.size() );
- OUString* pStrings = aResult.getArray();
- std::copy( aNames.begin(), aNames.end(), pStrings );
-
- return aResult;
+ return comphelper::containerToSequence(aNames);
}
protected: