diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-19 09:14:59 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-19 09:33:29 +0200 |
commit | 2554efabb6d7cd2ad9f7cfdddd0712c25cdca1cd (patch) | |
tree | 1b8fd3940910ffcd328e16a53e208c099f67ab21 /sc/source/ui/unoobj/chart2uno.cxx | |
parent | f7b5f477bfd942e0a1d8880c372635000d724dd7 (diff) |
use comphelper::containerToSequence
in chart2, we remove a local equivalent of the method
Change-Id: I25129a3d1ea1dd724eb9cd38a57be37a78b3d100
Diffstat (limited to 'sc/source/ui/unoobj/chart2uno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 0ef1b0e2707f..deb144f19c3c 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -57,6 +57,7 @@ #include <com/sun/star/text/XText.hpp> #include <comphelper/extract.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/sequence.hxx> #include <rtl/math.hxx> #include <boost/checked_delete.hpp> @@ -104,14 +105,6 @@ const SfxItemPropertyMapEntry* lcl_GetDataSequencePropertyMap() return aDataSequencePropertyMap_Impl; } -template< typename T > -css::uno::Sequence< T > lcl_VectorToSequence( const ::std::vector< T > & rCont ) -{ - css::uno::Sequence< T > aResult( rCont.size()); - ::std::copy( rCont.begin(), rCont.end(), aResult.getArray()); - return aResult; -} - struct lcl_appendTableNumber : public ::std::unary_function< SCTAB, void > { explicit lcl_appendTableNumber( OUStringBuffer & rBuffer ) : @@ -1794,7 +1787,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum SolarMutexGuard aGuard; OSL_ENSURE( m_pDocument, "No Document -> no detectArguments" ); if(!m_pDocument ||!xDataSource.is()) - return lcl_VectorToSequence( aResult ); + return comphelper::containerToSequence( aResult ); sal_Int32 nDataInRows = 0; sal_Int32 nDataInCols = 0; @@ -1980,7 +1973,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum uno::Reference< chart2::data::XDataSource > xCompareDataSource; try { - xCompareDataSource.set( this->createDataSource( lcl_VectorToSequence( aResult ) ) ); + xCompareDataSource.set( this->createDataSource( comphelper::containerToSequence( aResult ) ) ); } catch( const lang::IllegalArgumentException & ) { @@ -2039,12 +2032,12 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum { aResult.push_back( beans::PropertyValue( OUString("SequenceMapping"), -1, - uno::makeAny( lcl_VectorToSequence(aSequenceMappingVector) ) + uno::makeAny( comphelper::containerToSequence(aSequenceMappingVector) ) , beans::PropertyState_DIRECT_VALUE )); } } - return lcl_VectorToSequence( aResult ); + return comphelper::containerToSequence( aResult ); } sal_Bool SAL_CALL ScChart2DataProvider::createDataSequenceByRangeRepresentationPossible( const OUString& aRangeRepresentation ) @@ -2414,21 +2407,7 @@ uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence> > SAL_CALL ScChart2DataSource::getDataSequences() throw ( uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - - LabeledList::const_iterator aItr(m_aLabeledSequences.begin()); - LabeledList::const_iterator aEndItr(m_aLabeledSequences.end()); - - uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aRet(m_aLabeledSequences.size()); - - sal_Int32 i = 0; - while (aItr != aEndItr) - { - aRet[i] = *aItr; - ++i; - ++aItr; - } - - return aRet; + return comphelper::containerToSequence< uno::Reference< chart2::data::XLabeledDataSequence> >(m_aLabeledSequences); } void ScChart2DataSource::AddLabeledSequence(const uno::Reference < chart2::data::XLabeledDataSequence >& xNew) |