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 | |
parent | f7b5f477bfd942e0a1d8880c372635000d724dd7 (diff) |
use comphelper::containerToSequence
in chart2, we remove a local equivalent of the method
Change-Id: I25129a3d1ea1dd724eb9cd38a57be37a78b3d100
112 files changed, 202 insertions, 503 deletions
diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx index fa6a6422d6fa..b43f8e78f874 100644 --- a/basic/source/classes/propacc.cxx +++ b/basic/source/classes/propacc.cxx @@ -25,6 +25,7 @@ #include <sbunoobj.hxx> #include <comphelper/propertysetinfo.hxx> +#include <comphelper/sequence.hxx> #include <algorithm> #include <limits.h> @@ -164,10 +165,7 @@ void SbPropertyValues::removeVetoableChangeListener( Sequence< PropertyValue > SbPropertyValues::getPropertyValues() throw (css::uno::RuntimeException, std::exception) { - Sequence<PropertyValue> aRet( m_aPropVals.size() ); - for (size_t n = 0; n < m_aPropVals.size(); ++n) - aRet.getArray()[n] = m_aPropVals[n]; - return aRet; + return comphelper::containerToSequence(m_aPropVals); } diff --git a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx index 80b551bbcaf9..42f5d7f11b2f 100644 --- a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx @@ -62,7 +62,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx index a064752aae72..541c722bbfb4 100644 --- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx @@ -389,7 +389,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index 495e8dcd1d58..00611617d01b 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -257,7 +257,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx index f48e6ef6b16e..c65defc69b7f 100644 --- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx @@ -228,7 +228,7 @@ uno::Sequence< Property > lcl_GetPropertySequence( DataSeriesPointWrapper::eType ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } struct StaticSeriesWrapperPropertyArray_Initializer diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index e38aaba322d7..2ae296f4c5ce 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -478,7 +478,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx index 5e994e29798c..6ce104f45d76 100644 --- a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx @@ -64,7 +64,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx index 4b5b21f61a49..8b77142744a2 100644 --- a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx @@ -260,7 +260,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx index 7483e1429553..23d048f207ef 100644 --- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/chart2/XChartType.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> #include <com/sun/star/drawing/LineJoint.hpp> +#include <comphelper/sequence.hxx> #include "LinePropertiesHelper.hxx" #include "UserDefinedProperties.hxx" @@ -82,7 +83,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx index 5fd664df52c8..f2c46f53095d 100644 --- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx @@ -184,7 +184,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx index 4928e5dd31fa..9921af669504 100644 --- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx @@ -26,6 +26,7 @@ #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/chart2/XChartType.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> +#include <comphelper/sequence.hxx> #include "LinePropertiesHelper.hxx" #include "FillProperties.hxx" @@ -64,7 +65,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx index 7be9d4eeffc5..5ae15ce5fdd0 100644 --- a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx @@ -66,7 +66,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index 4f356b9841c1..9e3d0ae25a10 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> #include <com/sun/star/chart2/data/XDataSink.hpp> +#include <comphelper/sequence.hxx> #include <rtl/ustring.hxx> @@ -343,7 +344,7 @@ Reference< XDataSeries > lcl_CreateNewSeries( aNewSequences.push_back( ::chart::DataSourceHelper::createLabeledDataSequence( xSeq )); } - xSink->setData( ContainerToSequence( aNewSequences )); + xSink->setData( comphelper::containerToSequence( aNewSequences )); } } @@ -506,7 +507,7 @@ void addNewSeriesToContainer( ++aIt; aSeries.insert(aIt, xNewSeries); - xSeriesCnt->setDataSeries(ContainerToSequence(aSeries)); + xSeriesCnt->setDataSeries(comphelper::containerToSequence(aSeries)); } } @@ -735,7 +736,7 @@ bool DialogModel::setData( applyInterpretedData( xInterpreter->interpretDataSource( xDataSource, rArguments, - ContainerToSequence( aSeriesToReUse )), + comphelper::containerToSequence( aSeriesToReUse )), aSeriesToReUse, true /* bSetStyles */); diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx index de804c436bab..807fe68fa874 100644 --- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx +++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/frame/Desktop.hpp> +#include <comphelper/sequence.hxx> namespace chart { @@ -146,7 +147,7 @@ uno::Sequence< uno::Type > CreationWizardUnoDlg::getTypes() throw(uno::RuntimeEx aTypes.push_back( cppu::UnoType<frame::XTerminateListener>::get() ); aTypes.push_back( cppu::UnoType<ui::dialogs::XExecutableDialog>::get() ); aTypes.push_back( cppu::UnoType<beans::XPropertySet>::get() ); - aTypeList = ::chart::ContainerHelper::ContainerToSequence( aTypes ); + aTypeList = comphelper::containerToSequence( aTypes ); } return aTypeList; diff --git a/chart2/source/inc/ContainerHelper.hxx b/chart2/source/inc/ContainerHelper.hxx index 7c7284acf888..9f01b47ab01b 100644 --- a/chart2/source/inc/ContainerHelper.hxx +++ b/chart2/source/inc/ContainerHelper.hxx @@ -32,25 +32,6 @@ namespace chart namespace ContainerHelper { -/** converts a standard container into a sequence of the same type - - input: standard container - output: css::uno::Sequence< container::value_type > - - example: - - ::std::vector< sal_Int32 > aVector; - Sequence< sal_Int32 > aSequence( ContainerHelper::ContainerToSequence( aVector )); - */ -template< class Container > - ::com::sun::star::uno::Sequence< typename Container::value_type > - ContainerToSequence( const Container & rCont ) -{ - ::com::sun::star::uno::Sequence< typename Container::value_type > aResult( rCont.size()); - ::std::copy( rCont.begin(), rCont.end(), aResult.getArray()); - return aResult; -} - /** converts a UNO sequence into a standard "Sequence" container. For convenience see the methods SequenceToVector, etc. below. diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index 1e06b3d7500f..ba2746d2f1b1 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -28,6 +28,7 @@ #include <comphelper/propertysetinfo.hxx> #include <comphelper/documentconstants.hxx> #include <cppuhelper/supportsservice.hxx> +#include <comphelper/sequence.hxx> #include <sot/storage.hxx> #include <osl/diagnose.h> @@ -117,7 +118,7 @@ uno::Reference< embed::XStorage > lcl_getWriteStorage( else aStorageArgs[0] <<= aMDHelper.URL; aStorageArgs[1] <<= (embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE); - aStorageArgs[2] <<= ::chart::ContainerHelper::ContainerToSequence( aPropertiesForStorage ); + aStorageArgs[2] <<= comphelper::containerToSequence( aPropertiesForStorage ); xStorage.set( xStorageFact->createInstanceWithArguments( aStorageArgs ), @@ -181,7 +182,7 @@ uno::Reference< embed::XStorage > lcl_getReadStorage( Sequence< uno::Any > aStorageArgs( 3 ); aStorageArgs[0] <<= xStream; aStorageArgs[1] <<= (embed::ElementModes::READ | embed::ElementModes::NOCREATE); - aStorageArgs[2] <<= ::chart::ContainerHelper::ContainerToSequence( aPropertiesForStorage ); + aStorageArgs[2] <<= comphelper::containerToSequence( aPropertiesForStorage ); xStorage.set( xStorageFact->createInstanceWithArguments( aStorageArgs ), uno::UNO_QUERY_THROW ); } diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx index b8040e7b5648..10334a6e92cc 100644 --- a/chart2/source/model/main/Axis.cxx +++ b/chart2/source/model/main/Axis.cxx @@ -286,7 +286,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx index ee431a8fca6d..63dfa286a6e8 100644 --- a/chart2/source/model/main/BaseCoordinateSystem.cxx +++ b/chart2/source/model/main/BaseCoordinateSystem.cxx @@ -95,7 +95,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; @@ -298,7 +298,7 @@ void SAL_CALL BaseCoordinateSystem::removeChartType( const Reference< chart2::XC Sequence< Reference< chart2::XChartType > > SAL_CALL BaseCoordinateSystem::getChartTypes() throw (uno::RuntimeException, std::exception) { - return ContainerHelper::ContainerToSequence( m_aChartTypes ); + return comphelper::containerToSequence( m_aChartTypes ); } void SAL_CALL BaseCoordinateSystem::setChartTypes( const Sequence< Reference< chart2::XChartType > >& aChartTypes ) diff --git a/chart2/source/model/main/DataPoint.cxx b/chart2/source/model/main/DataPoint.cxx index c775c5ce8392..d3156a2cd3a6 100644 --- a/chart2/source/model/main/DataPoint.cxx +++ b/chart2/source/model/main/DataPoint.cxx @@ -61,7 +61,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx index 3cf89fa952d7..1a42a726646e 100644 --- a/chart2/source/model/main/DataSeries.cxx +++ b/chart2/source/model/main/DataSeries.cxx @@ -71,7 +71,7 @@ struct StaticDataSeriesInfoHelper : public rtl::StaticWithInit< ::cppu::OPropert ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; @@ -274,7 +274,7 @@ void SAL_CALL DataSeries::getFastPropertyValue // special handling for get. set is not possible for this property if( nHandle == DataSeriesProperties::PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) { - // ToDo: only add those property sets that are really modified + // TODO: only add those property sets that are really modified uno::Sequence< sal_Int32 > aSeq( m_aAttributedDataPoints.size()); sal_Int32 * pIndexArray = aSeq.getArray(); sal_Int32 i = 0; @@ -331,7 +331,7 @@ Reference< beans::XPropertySet > Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences; { MutexGuard aGuard( GetMutex() ); - aSequences = ContainerHelper::ContainerToSequence( m_aDataSequences ); + aSequences = comphelper::containerToSequence( m_aDataSequences ); } ::std::vector< Reference< chart2::data::XLabeledDataSequence > > aValuesSeries( @@ -440,7 +440,7 @@ Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL DataSeries: throw (uno::RuntimeException, std::exception) { MutexGuard aGuard( GetMutex() ); - return ContainerHelper::ContainerToSequence( m_aDataSequences ); + return comphelper::containerToSequence( m_aDataSequences ); } // ____ XRegressionCurveContainer ____ @@ -491,7 +491,7 @@ uno::Sequence< uno::Reference< chart2::XRegressionCurve > > SAL_CALL DataSeries: throw (uno::RuntimeException, std::exception) { MutexGuard aGuard( GetMutex() ); - return ContainerHelper::ContainerToSequence( m_aRegressionCurves ); + return comphelper::containerToSequence( m_aRegressionCurves ); } void SAL_CALL DataSeries::setRegressionCurves( diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 9f95cee79723..b0e5c0b04d2f 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -250,7 +250,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; @@ -561,7 +561,7 @@ uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > SAL_CALL Diagram::g throw (uno::RuntimeException, std::exception) { MutexGuard aGuard( GetMutex() ); - return ContainerHelper::ContainerToSequence( m_aCoordSystems ); + return comphelper::containerToSequence( m_aCoordSystems ); } void SAL_CALL Diagram::setCoordinateSystems( diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx index f30eb31a4098..13b54ada3de7 100644 --- a/chart2/source/model/main/FormattedString.cxx +++ b/chart2/source/model/main/FormattedString.cxx @@ -73,7 +73,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/main/GridProperties.cxx b/chart2/source/model/main/GridProperties.cxx index 5aa3f35301fe..7eb1350fd9e6 100644 --- a/chart2/source/model/main/GridProperties.cxx +++ b/chart2/source/model/main/GridProperties.cxx @@ -101,7 +101,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx index 9d22b6eb7ffb..1528dfc45968 100644 --- a/chart2/source/model/main/Legend.cxx +++ b/chart2/source/model/main/Legend.cxx @@ -157,7 +157,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx index ab3ceb0b3935..295dd0a72d9f 100644 --- a/chart2/source/model/main/PageBackground.cxx +++ b/chart2/source/model/main/PageBackground.cxx @@ -86,7 +86,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/main/StockBar.cxx b/chart2/source/model/main/StockBar.cxx index 0b05ee094fcc..347b83f11b37 100644 --- a/chart2/source/model/main/StockBar.cxx +++ b/chart2/source/model/main/StockBar.cxx @@ -60,7 +60,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx index 653abe45d1aa..20300b252d83 100644 --- a/chart2/source/model/main/Title.cxx +++ b/chart2/source/model/main/Title.cxx @@ -204,7 +204,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx index ef1b9e38988b..80093ed21c72 100644 --- a/chart2/source/model/main/Wall.cxx +++ b/chart2/source/model/main/Wall.cxx @@ -88,7 +88,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/AreaChartTypeTemplate.cxx b/chart2/source/model/template/AreaChartTypeTemplate.cxx index 1537c3fd5fea..da3770de9d87 100644 --- a/chart2/source/model/template/AreaChartTypeTemplate.cxx +++ b/chart2/source/model/template/AreaChartTypeTemplate.cxx @@ -92,7 +92,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/BarChartTypeTemplate.cxx b/chart2/source/model/template/BarChartTypeTemplate.cxx index 190ed2344876..d18f8996a41e 100644 --- a/chart2/source/model/template/BarChartTypeTemplate.cxx +++ b/chart2/source/model/template/BarChartTypeTemplate.cxx @@ -100,7 +100,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx index 4b494b7943bc..b732c64d6ffa 100644 --- a/chart2/source/model/template/BubbleChartType.cxx +++ b/chart2/source/model/template/BubbleChartType.cxx @@ -70,7 +70,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx index 0f4276d80bf3..9e4fcac4373d 100644 --- a/chart2/source/model/template/BubbleChartTypeTemplate.cxx +++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx @@ -72,7 +72,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx index f9e4d258320f..2465041abc65 100644 --- a/chart2/source/model/template/BubbleDataInterpreter.cxx +++ b/chart2/source/model/template/BubbleDataInterpreter.cxx @@ -149,13 +149,13 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource( OSL_ASSERT( xSeries.is() ); Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY ); OSL_ASSERT( xSink.is() ); - xSink->setData( ContainerHelper::ContainerToSequence( aNewData ) ); + xSink->setData( comphelper::containerToSequence( aNewData ) ); aSeriesVec.push_back( xSeries ); } Sequence< Sequence< Reference< XDataSeries > > > aSeries(1); - aSeries[0] = ContainerHelper::ContainerToSequence( aSeriesVec ); + aSeries[0] = comphelper::containerToSequence( aSeriesVec ); return InterpretedData( aSeries, xCategories ); } diff --git a/chart2/source/model/template/CandleStickChartType.cxx b/chart2/source/model/template/CandleStickChartType.cxx index 1d46372591d6..e4125fbe36b0 100644 --- a/chart2/source/model/template/CandleStickChartType.cxx +++ b/chart2/source/model/template/CandleStickChartType.cxx @@ -123,7 +123,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; @@ -243,7 +243,7 @@ uno::Sequence< OUString > SAL_CALL CandleStickChartType::getSupportedMandatoryRo aMandRoles.push_back( "values-last"); - return ContainerHelper::ContainerToSequence( aMandRoles ); + return comphelper::containerToSequence( aMandRoles ); } Sequence< OUString > SAL_CALL CandleStickChartType::getSupportedOptionalRoles() @@ -265,7 +265,7 @@ Sequence< OUString > SAL_CALL CandleStickChartType::getSupportedOptionalRoles() aOptRoles.push_back( "values-max"); } - return ContainerHelper::ContainerToSequence( aOptRoles ); + return comphelper::containerToSequence( aOptRoles ); } OUString SAL_CALL CandleStickChartType::getRoleOfSequenceForSeriesLabel() diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx index 9ab9722615ad..bd6162828393 100644 --- a/chart2/source/model/template/ChartType.cxx +++ b/chart2/source/model/template/ChartType.cxx @@ -183,7 +183,7 @@ Sequence< Reference< chart2::XDataSeries > > SAL_CALL ChartType::getDataSeries() { SolarMutexGuard g; - return ContainerHelper::ContainerToSequence( m_aDataSeries ); + return comphelper::containerToSequence( m_aDataSeries ); } void SAL_CALL ChartType::setDataSeries( const Sequence< Reference< chart2::XDataSeries > >& aDataSeries ) diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx index ad12cac7cffd..adee48ecad68 100644 --- a/chart2/source/model/template/ChartTypeManager.cxx +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -600,7 +600,7 @@ uno::Sequence< OUString > SAL_CALL ChartTypeManager::getAvailableServiceNames() } } - return ContainerHelper::ContainerToSequence( aServices ); + return comphelper::containerToSequence( aServices ); } // ____ XServiceInfo ____ diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index 2fb754bcba81..9076b8f073d5 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -274,7 +274,7 @@ void SAL_CALL ChartTypeTemplate::changeDiagramData( { // interpret new data and re-use existing series Sequence< Reference< XDataSeries > > aFlatSeriesSeq( - ::chart::ContainerHelper::ContainerToSequence( DiagramHelper::getDataSeriesFromDiagram( xDiagram ))); + comphelper::containerToSequence( DiagramHelper::getDataSeriesFromDiagram( xDiagram ))); const sal_Int32 nFormerSeriesCount = aFlatSeriesSeq.getLength(); Reference< chart2::XDataInterpreter > xInterpreter( getDataInterpreter()); chart2::InterpretedData aData = diff --git a/chart2/source/model/template/ColumnChartType.cxx b/chart2/source/model/template/ColumnChartType.cxx index f11b2a1b77a7..c60b08bcba83 100644 --- a/chart2/source/model/template/ColumnChartType.cxx +++ b/chart2/source/model/template/ColumnChartType.cxx @@ -98,7 +98,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx index 7f36308fd1ab..25f0cc1d51a9 100644 --- a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx +++ b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx @@ -97,7 +97,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx index 9cc8c8e66a4f..18487e884eb3 100644 --- a/chart2/source/model/template/DataInterpreter.cxx +++ b/chart2/source/model/template/DataInterpreter.cxx @@ -132,7 +132,7 @@ InterpretedData SAL_CALL DataInterpreter::interpretDataSource( } Sequence< Sequence< Reference< XDataSeries > > > aSeries(1); - aSeries[0] = ContainerToSequence( aSeriesVec ); + aSeries[0] = comphelper::containerToSequence( aSeriesVec ); return InterpretedData( aSeries, xCategories ); } @@ -308,7 +308,7 @@ Reference< data::XDataSource > SAL_CALL DataInterpreter::mergeInterpretedData( } } - return Reference< data::XDataSource >( DataSourceHelper::createDataSource( ContainerToSequence( aResultVec ) ) ); + return Reference< data::XDataSource >( DataSourceHelper::createDataSource( comphelper::containerToSequence( aResultVec ) ) ); } // convenience methods diff --git a/chart2/source/model/template/LineChartType.cxx b/chart2/source/model/template/LineChartType.cxx index 553dce43169b..3c9e8ac85a1c 100644 --- a/chart2/source/model/template/LineChartType.cxx +++ b/chart2/source/model/template/LineChartType.cxx @@ -111,7 +111,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/LineChartTypeTemplate.cxx b/chart2/source/model/template/LineChartTypeTemplate.cxx index 42441a7f83ee..8c6175119699 100644 --- a/chart2/source/model/template/LineChartTypeTemplate.cxx +++ b/chart2/source/model/template/LineChartTypeTemplate.cxx @@ -116,7 +116,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/PieChartType.cxx b/chart2/source/model/template/PieChartType.cxx index 2a6ebf659e0a..f036ebc312ad 100644 --- a/chart2/source/model/template/PieChartType.cxx +++ b/chart2/source/model/template/PieChartType.cxx @@ -99,7 +99,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx index 3385df70a3c5..6fc096aef638 100644 --- a/chart2/source/model/template/PieChartTypeTemplate.cxx +++ b/chart2/source/model/template/PieChartTypeTemplate.cxx @@ -125,7 +125,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/ScatterChartType.cxx b/chart2/source/model/template/ScatterChartType.cxx index 106f88f67a07..83e23e3e482e 100644 --- a/chart2/source/model/template/ScatterChartType.cxx +++ b/chart2/source/model/template/ScatterChartType.cxx @@ -115,7 +115,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.cxx b/chart2/source/model/template/ScatterChartTypeTemplate.cxx index 35f974de2f02..1c675c903bde 100644 --- a/chart2/source/model/template/ScatterChartTypeTemplate.cxx +++ b/chart2/source/model/template/ScatterChartTypeTemplate.cxx @@ -118,7 +118,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx index 0e28bf73b4d0..88a51fc115c4 100644 --- a/chart2/source/model/template/StockChartTypeTemplate.cxx +++ b/chart2/source/model/template/StockChartTypeTemplate.cxx @@ -127,7 +127,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; @@ -394,7 +394,7 @@ void StockChartTypeTemplate::createChartTypes( } Reference< XChartTypeContainer > xCTCnt( rCoordSys[ 0 ], uno::UNO_QUERY_THROW ); - xCTCnt->setChartTypes( ::chart::ContainerHelper::ContainerToSequence(aChartTypeVec) ); + xCTCnt->setChartTypes( comphelper::containerToSequence(aChartTypeVec) ); } catch( const uno::Exception & ex ) { diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx index 33175a41e9ef..a30a4459e4fa 100644 --- a/chart2/source/model/template/XYDataInterpreter.cxx +++ b/chart2/source/model/template/XYDataInterpreter.cxx @@ -133,13 +133,13 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource( OSL_ASSERT( xSeries.is() ); Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY ); OSL_ASSERT( xSink.is() ); - xSink->setData( ContainerHelper::ContainerToSequence( aNewData ) ); + xSink->setData( comphelper::containerToSequence( aNewData ) ); aSeriesVec.push_back( xSeries ); } Sequence< Sequence< Reference< XDataSeries > > > aSeries(1); - aSeries[0] = ContainerHelper::ContainerToSequence( aSeriesVec ); + aSeries[0] = comphelper::containerToSequence( aSeriesVec ); return InterpretedData( aSeries, xCategories ); } diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index 140b523f9ade..891719454084 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -45,6 +45,7 @@ #include <com/sun/star/util/XCloneable.hpp> #include <com/sun/star/lang/XServiceName.hpp> +#include <comphelper/sequence.hxx> #include <map> @@ -870,7 +871,7 @@ Sequence< Reference< XAxis > > AxisHelper::getAllAxesOfDiagram( } } - return ContainerHelper::ContainerToSequence( aAxisVector ); + return comphelper::containerToSequence( aAxisVector ); } Sequence< Reference< beans::XPropertySet > > AxisHelper::getAllGrids( const Reference< XDiagram >& xDiagram ) @@ -898,7 +899,7 @@ Sequence< Reference< beans::XPropertySet > > AxisHelper::getAllGrids( const Refe } } - return ContainerHelper::ContainerToSequence( aGridVector ); + return comphelper::containerToSequence( aGridVector ); } void AxisHelper::getAxisOrGridPossibilities( Sequence< sal_Bool >& rPossibilityList diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index b10b5c7e81e1..cdc4de6b1442 100644 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/i18n/ScriptType.hpp> #include <comphelper/InlineContainer.hxx> +#include <comphelper/sequence.hxx> #include <unotools/lingucfg.hxx> #include <i18nlangtag/mslangid.hxx> @@ -490,7 +491,7 @@ awt::FontDescriptor CharacterProperties::createFontDescriptorFromPropertySet( ( "CharWordMode") // WordLineMode ; - uno::Sequence< OUString > aPropNameSeq( ContainerHelper::ContainerToSequence( aPropNames )); + uno::Sequence< OUString > aPropNameSeq( comphelper::containerToSequence( aPropNames )); uno::Sequence< uno::Any > aValues( xMultiPropSet->getPropertyValues( aPropNameSeq )); sal_Int32 i=0; diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx index 51fb7cd8ab61..69ddf393ef43 100644 --- a/chart2/source/tools/ConfigColorScheme.cxx +++ b/chart2/source/tools/ConfigColorScheme.cxx @@ -24,6 +24,7 @@ #include <unotools/configitem.hxx> #include <sal/macros.h> #include <cppuhelper/supportsservice.hxx> +#include <comphelper/sequence.hxx> #include <set> @@ -88,7 +89,7 @@ void ChartConfigItem::ImplCommit() void ChartConfigItem::addPropertyNotification( const OUString & rPropertyName ) { m_aPropertiesToNotify.insert( rPropertyName ); - EnableNotification( ContainerHelper::ContainerToSequence( m_aPropertiesToNotify )); + EnableNotification( comphelper::containerToSequence<OUString>( m_aPropertiesToNotify )); } uno::Any ChartConfigItem::getProperty( const OUString & aPropertyName ) diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx index eea642e0ace9..e668ccbf4565 100644 --- a/chart2/source/tools/DataSeriesHelper.cxx +++ b/chart2/source/tools/DataSeriesHelper.cxx @@ -260,7 +260,7 @@ Reference< chart2::data::XDataSource > getDataSource( const Sequence< Reference< chart2::XDataSeries > > & aSeries ) { return Reference< chart2::data::XDataSource >( - new DataSource(ContainerHelper::ContainerToSequence(getAllDataSequences(aSeries)))); + new DataSource(comphelper::containerToSequence(getAllDataSequences(aSeries)))); } namespace @@ -529,7 +529,7 @@ void deleteSeries( if( aIt != aSeries.end()) { aSeries.erase( aIt ); - xSeriesCnt->setDataSeries( ContainerHelper::ContainerToSequence( aSeries )); + xSeriesCnt->setDataSeries( comphelper::containerToSequence( aSeries )); } } catch( const uno::Exception & ex ) diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx index 0afe27e51ab7..3413e1a34b5b 100644 --- a/chart2/source/tools/DataSourceHelper.cxx +++ b/chart2/source/tools/DataSourceHelper.cxx @@ -243,7 +243,7 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::pressUsedDataIntoR ::std::vector< Reference< chart2::XDataSeries > > xSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) ); uno::Reference< chart2::data::XDataSource > xSeriesSource( - DataSeriesHelper::getDataSource( ContainerHelper::ContainerToSequence(xSeriesVector) ) ); + DataSeriesHelper::getDataSource( comphelper::containerToSequence(xSeriesVector) ) ); Sequence< Reference< chart2::data::XLabeledDataSequence > > aDataSeqences( xSeriesSource->getDataSequences() ); //the first x-values is always the next sequence //todo ... other x-values get lost for old format @@ -260,10 +260,7 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::pressUsedDataIntoR aResultVector.push_back( aDataSeqences[nN] ); } - Sequence< Reference< chart2::data::XLabeledDataSequence > > aResultSequence( aResultVector.size() ); - ::std::copy( aResultVector.begin(), aResultVector.end(), aResultSequence.getArray() ); - - return new DataSource( aResultSequence ); + return new DataSource( comphelper::containerToSequence(aResultVector) ); } uno::Sequence< OUString > DataSourceHelper::getUsedDataRanges( @@ -287,7 +284,7 @@ uno::Sequence< OUString > DataSourceHelper::getUsedDataRanges( } } - return ContainerHelper::ContainerToSequence( aResult ); + return comphelper::containerToSequence( aResult ); } uno::Sequence< OUString > DataSourceHelper::getUsedDataRanges( const uno::Reference< frame::XModel > & xChartModel ) @@ -325,7 +322,7 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData( } return uno::Reference< chart2::data::XDataSource >( - new DataSource( ContainerHelper::ContainerToSequence( aResult ))); + new DataSource( comphelper::containerToSequence( aResult ))); } uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData( @@ -351,7 +348,7 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData( } return uno::Reference< chart2::data::XDataSource >( - new DataSource( ContainerHelper::ContainerToSequence( aResult ))); + new DataSource( comphelper::containerToSequence( aResult ))); } bool DataSourceHelper::detectRangeSegmentation( @@ -537,7 +534,7 @@ Sequence< OUString > DataSourceHelper::getRangesFromDataSource( const Reference< aResult.push_back( xValues->getSourceRangeRepresentation()); } } - return ContainerHelper::ContainerToSequence( aResult ); + return comphelper::containerToSequence( aResult ); } } //namespace chart diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index c38e6d21c5f3..9a66d5308712 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -58,6 +58,7 @@ #include <svl/zformat.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> +#include <comphelper/sequence.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; @@ -753,7 +754,7 @@ Sequence< Sequence< Reference< XDataSeries > > > } } } - return ContainerHelper::ContainerToSequence( aResult ); + return comphelper::containerToSequence( aResult ); } Reference< XChartType > @@ -1266,7 +1267,7 @@ Sequence< Reference< XChartType > > } } - return ContainerHelper::ContainerToSequence( aResult ); + return comphelper::containerToSequence( aResult ); } bool DiagramHelper::areChartTypesCompatible( const Reference< ::chart2::XChartType >& xFirstType, diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index c22e592028b0..29b866f8eeef 100644 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -440,7 +440,7 @@ void SAL_CALL ErrorBar::setData( const uno::Sequence< uno::Reference< chart2::da uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > SAL_CALL ErrorBar::getDataSequences() throw (uno::RuntimeException, std::exception) { - return ContainerHelper::ContainerToSequence( m_aDataSequences ); + return comphelper::containerToSequence( m_aDataSequences ); } uno::Sequence< OUString > ErrorBar::getSupportedServiceNames_Static() diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index 7ff00f157f9f..4f68d0b65632 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -720,7 +720,7 @@ Reference< chart2::data::XDataSource > SAL_CALL InternalDataProvider::createData , lcl_aCategoriesRoleName ) ) ); } //don't add the created sequences to the map as they are used temporarily only ... - return new DataSource( ContainerHelper::ContainerToSequence(aComplexCategories) ); + return new DataSource( comphelper::containerToSequence(aComplexCategories) ); } OSL_ASSERT( aRangeRepresentation == lcl_aCompleteRange ); @@ -772,7 +772,7 @@ Reference< chart2::data::XDataSource > SAL_CALL InternalDataProvider::createData aResultLSeqVec.push_back( *aIt ); } - return new DataSource( ContainerHelper::ContainerToSequence(aResultLSeqVec) ); + return new DataSource( comphelper::containerToSequence(aResultLSeqVec) ); } Sequence< beans::PropertyValue > SAL_CALL InternalDataProvider::detectArguments( @@ -893,7 +893,7 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation ? m_aInternalData.getComplexColumnLabel( nIndex ) : m_aInternalData.getComplexRowLabel( nIndex ); if( !aComplexLabel.empty() ) - aResult = ContainerHelper::ContainerToSequence(aComplexLabel); + aResult = comphelper::containerToSequence(aComplexLabel); } else if( aRange.match( lcl_aCategoriesPointRangeNamePrefix ) ) { @@ -902,7 +902,7 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation ? m_aInternalData.getComplexRowLabel( nPointIndex ) : m_aInternalData.getComplexColumnLabel( nPointIndex ); if( !aComplexCategory.empty() ) - aResult = ContainerHelper::ContainerToSequence(aComplexCategory); + aResult = comphelper::containerToSequence(aComplexCategory); } else if( aRange.match( lcl_aCategoriesLevelRangeNamePrefix ) ) { @@ -1305,7 +1305,7 @@ Sequence< Sequence< Type > > lcl_convertVectorVectorToSequenceSequence( const ve { aRet.realloc(nOuterCount); for( sal_Int32 nN=0; nN<nOuterCount; nN++) - aRet[nN]= ContainerHelper::ContainerToSequence( rIn[nN] ); + aRet[nN]= comphelper::containerToSequence( rIn[nN] ); } return aRet; } @@ -1332,7 +1332,7 @@ Sequence< Sequence< OUString > > lcl_convertComplexAnyVectorToStringSequence( co { aRet.realloc(nOuterCount); for( sal_Int32 nN=0; nN<nOuterCount; nN++) - aRet[nN]= lcl_AnyToStringSequence( ContainerHelper::ContainerToSequence( rIn[nN] ) ); + aRet[nN]= lcl_AnyToStringSequence( comphelper::containerToSequence( rIn[nN] ) ); } return aRet; } diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx index a64d893e715b..4c00807cb175 100644 --- a/chart2/source/tools/OPropertySet.cxx +++ b/chart2/source/tools/OPropertySet.cxx @@ -22,6 +22,7 @@ #include "ContainerHelper.hxx" #include <cppuhelper/queryinterface.hxx> #include <comphelper/servicehelper.hxx> +#include <comphelper/sequence.hxx> #include <vector> #include <algorithm> @@ -111,7 +112,7 @@ Sequence< uno::Type > SAL_CALL aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XMultiPropertyStates )); aTypes.push_back( LCL_PROP_CPPUTYPE( XStyleSupplier )); - aTypeList = ::chart::ContainerHelper::ContainerToSequence( aTypes ); + aTypeList = comphelper::containerToSequence( aTypes ); } return aTypeList; diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx index 40a7e4312b99..654f30a84c24 100644 --- a/chart2/source/tools/RangeHighlighter.cxx +++ b/chart2/source/tools/RangeHighlighter.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/chart2/XDataSeries.hpp> #include <com/sun/star/chart/ErrorBarStyle.hpp> #include <com/sun/star/drawing/XShape.hpp> +#include <comphelper/sequence.hxx> #define PREFERED_DEFAULT_COLOR 0x0000ff @@ -292,7 +293,7 @@ void RangeHighlighter::fillRangesForDataPoint( const Reference< uno::XInterface nPreferredColor, sal_False )); } - m_aSelectedRanges = ContainerHelper::ContainerToSequence( aHilightedRanges ); + m_aSelectedRanges = comphelper::containerToSequence( aHilightedRanges ); } } } diff --git a/chart2/source/tools/RegressionCurveModel.cxx b/chart2/source/tools/RegressionCurveModel.cxx index 6857be4bd386..dfafae4df28e 100644 --- a/chart2/source/tools/RegressionCurveModel.cxx +++ b/chart2/source/tools/RegressionCurveModel.cxx @@ -156,7 +156,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/tools/RegressionEquation.cxx b/chart2/source/tools/RegressionEquation.cxx index 35ca0c880ea6..5d3633c7de1d 100644 --- a/chart2/source/tools/RegressionEquation.cxx +++ b/chart2/source/tools/RegressionEquation.cxx @@ -152,7 +152,7 @@ private: ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - return ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return comphelper::containerToSequence( aProperties ); } }; diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx index 5a16b8034419..fc03e33e17f3 100644 --- a/chart2/source/view/axes/VCoordinateSystem.cxx +++ b/chart2/source/view/axes/VCoordinateSystem.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/chart2/AxisType.hpp> #include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> +#include <comphelper/sequence.hxx> #include <rtl/math.hxx> @@ -218,7 +219,7 @@ Sequence< Reference< beans::XPropertySet > > VCoordinateSystem::getGridListFromA aRet.insert( aRet.end(), aSubGrids.begin(), aSubGrids.end() ); } - return ContainerHelper::ContainerToSequence( aRet ); + return comphelper::containerToSequence( aRet ); } void VCoordinateSystem::impl_adjustDimension( sal_Int32& rDimensionIndex ) diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 164d2fd51629..4ed9bdcd5a28 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -78,6 +78,7 @@ #include <com/sun/star/drawing/TextFitToSizeType.hpp> #include <svx/unoshape.hxx> +#include <comphelper/sequence.hxx> #include <functional> #include <map> @@ -2063,7 +2064,7 @@ uno::Sequence< OUString > VSeriesPlotter::getSeriesNames() const } } } - return ContainerHelper::ContainerToSequence( aRetVector ); + return comphelper::containerToSequence( aRetVector ); } namespace diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx index 8384e7325e12..aee1cd0fcedf 100644 --- a/comphelper/source/misc/string.cxx +++ b/comphelper/source/misc/string.cxx @@ -33,6 +33,7 @@ #include <comphelper/string.hxx> #include <comphelper/stl_types.hxx> +#include <comphelper/sequence.hxx> #include <com/sun/star/i18n/BreakIterator.hpp> #include <com/sun/star/i18n/CharType.hpp> @@ -265,9 +266,7 @@ uno::Sequence< OUString > vec.push_back(kw); } } while (idx >= 0); - uno::Sequence< OUString > kws(vec.size()); - std::copy(vec.begin(), vec.end(), kws.begin()); - return kws; + return comphelper::containerToSequence(vec); } OString join(const OString& rSeparator, const std::vector<OString>& rSequence) diff --git a/cui/source/options/tsaurls.cxx b/cui/source/options/tsaurls.cxx index b5b0988ff434..d812f370c296 100644 --- a/cui/source/options/tsaurls.cxx +++ b/cui/source/options/tsaurls.cxx @@ -10,6 +10,7 @@ #include <officecfg/Office/Common.hxx> #include <svx/svxdlg.hxx> #include <cuires.hrc> +#include <comphelper/sequence.hxx> #include "tsaurls.hxx" @@ -52,12 +53,7 @@ IMPL_LINK_NOARG_TYPED(TSAURLsDialog, OKHdl_Impl, Button*, void) { std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); - css::uno::Sequence<OUString> aNewValue(m_aURLs.size()); - size_t n(0); - - for (auto i = m_aURLs.cbegin(); i != m_aURLs.cend(); ++i) - aNewValue[n++] = *i; - officecfg::Office::Common::Security::Scripting::TSAURLs::set(aNewValue, batch); + officecfg::Office::Common::Security::Scripting::TSAURLs::set(comphelper::containerToSequence<OUString>(m_aURLs), batch); batch->commit(); EndDialog(RET_OK); diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx index 3589548024cf..16895634d59e 100644 --- a/dbaccess/source/core/dataaccess/connection.cxx +++ b/dbaccess/source/core/dataaccess/connection.cxx @@ -412,9 +412,7 @@ Sequence< Type > OConnection::getTypes() throw (RuntimeException, std::exception if ( !m_bSupportsGroups ) aNormalizedTypes.erase( cppu::UnoType<XGroupsSupplier>::get() ); - Sequence< Type > aSupportedTypes( aNormalizedTypes.size() ); - ::std::copy( aNormalizedTypes.begin(), aNormalizedTypes.end(), aSupportedTypes.getArray() ); - return aSupportedTypes; + return comphelper::containerToSequence<Type>(aNormalizedTypes); } Sequence< sal_Int8 > OConnection::getImplementationId() throw (RuntimeException, std::exception) diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 4fca0c824b0a..01a8f9435612 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -1706,9 +1706,7 @@ bool OApplicationController::onContainerSelect(ElementType _eType) SelectionByElementType::iterator pendingSelection = m_aPendingSelection.find( _eType ); if ( pendingSelection != m_aPendingSelection.end() ) { - Sequence< OUString > aSelected( pendingSelection->second.size() ); - ::std::copy( pendingSelection->second.begin(), pendingSelection->second.end(), aSelected.getArray() ); - getContainer()->selectElements( aSelected ); + getContainer()->selectElements( comphelper::containerToSequence(pendingSelection->second) ); m_aPendingSelection.erase( pendingSelection ); } @@ -2861,9 +2859,7 @@ sal_Bool SAL_CALL OApplicationController::select( const Any& _aSelection ) throw { if ( sel->first == m_eCurrentType ) { - Sequence< OUString > aSelected( sel->second.size() ); - ::std::copy( sel->second.begin(), sel->second.end(), aSelected.getArray() ); - getContainer()->selectElements( aSelected ); + getContainer()->selectElements( comphelper::containerToSequence(sel->second) ); } else { diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 3d235aa31c8c..eba3487dc60b 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -552,8 +552,7 @@ bool SbaTableQueryBrowser::InitializeForm( const Reference< XPropertySet > & i_f ::std::vector< OUString > aNames( aPropertyValues.getNames() ); ::std::sort(aNames.begin(), aNames.end()); - Sequence< OUString > aPropNames( aNames.size() ); - ::std::copy( aNames.begin(), aNames.end(), aPropNames.getArray() ); + Sequence< OUString > aPropNames( comphelper::containerToSequence(aNames) ); Sequence< Any > aPropValues( aNames.size() ); ::std::transform( aNames.begin(), aNames.end(), aPropValues.getArray(), SelectValueByName( aPropertyValues ) ); 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: diff --git a/framework/source/classes/framecontainer.cxx b/framework/source/classes/framecontainer.cxx index 1eea3b39cefe..dd18ea5ce7d6 100644 --- a/framework/source/classes/framecontainer.cxx +++ b/framework/source/classes/framecontainer.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <vcl/svapp.hxx> +#include <comphelper/sequence.hxx> namespace framework{ @@ -186,11 +187,7 @@ css::uno::Reference< css::frame::XFrame > FrameContainer::operator[]( sal_uInt32 css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > FrameContainer::getAllElements() const { SolarMutexGuard g; - sal_Int32 nPosition = 0; - css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > lElements ( (sal_uInt32)m_aContainer.size() ); - for (TFrameContainer::const_iterator pItem=m_aContainer.begin(); pItem!=m_aContainer.end(); ++pItem) - lElements[nPosition++] = *pItem; - return lElements; + return comphelper::containerToSequence(m_aContainer); } /**-*************************************************************************************************************** diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index b7f271a6d5f4..e62a7a7e5603 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -751,10 +751,7 @@ throw (css::uno::RuntimeException, lang::IllegalAccessException) ImageList* pImageList = implts_getUserImageList( ImageType(i)); pImageList->GetImageNames( aUserImageNames ); - Sequence< OUString > aRemoveList( aUserImageNames.size() ); - const sal_uInt32 nCount = aUserImageNames.size(); - for ( sal_uInt32 j = 0; j < nCount; j++ ) - aRemoveList[j] = aUserImageNames[j]; + Sequence< OUString > aRemoveList( comphelper::containerToSequence(aUserImageNames) ); // Remove images removeImages( sal_Int16( i ), aRemoveList ); diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 15ed050b55d5..525da700f7b4 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -28,6 +28,7 @@ #include <cppuhelper/supportsservice.hxx> #include <unotools/localfilehelper.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/sequence.hxx> #include <unotools/ucbstreamhelper.hxx> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/lang/Locale.hpp> @@ -404,14 +405,7 @@ uno::Sequence< uno::Reference< XDictionary > > SAL_CALL DictionaryVec_t& rDicList = GetOrCreateDicList(); - uno::Sequence< uno::Reference< XDictionary > > aDics( rDicList.size() ); - uno::Reference< XDictionary > *pDic = aDics.getArray(); - - sal_Int32 n = (sal_uInt16) aDics.getLength(); - for (sal_Int32 i = 0; i < n; i++) - pDic[i] = rDicList[i]; - - return aDics; + return comphelper::containerToSequence(rDicList); } uno::Reference< XDictionary > SAL_CALL diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index cb40b1fb20cd..19fbc613044e 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp> #include <osl/diagnose.h> +#include <comphelper/sequence.hxx> using namespace ::oox::core; using namespace ::com::sun::star; @@ -258,10 +259,7 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi PropertyMap aPath; - Sequence< EnhancedCustomShapeSegment > aSegments( maSegments.size() ); - for ( i = 0; i < maSegments.size(); i++ ) - aSegments[ i ] = maSegments[ i ]; - aPath.setProperty( PROP_Segments, aSegments); + aPath.setProperty( PROP_Segments, comphelper::containerToSequence(maSegments) ); if ( maTextRect.has() ) { Sequence< EnhancedCustomShapeTextFrame > aTextFrames(1); diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 19ff7806428b..14e49a86161d 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -87,6 +87,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/random.hxx> +#include <comphelper/sequence.hxx> #include <xmloff/SchXMLSeriesHelper.hxx> #include "ColorPropertySet.hxx" #include <set> @@ -207,16 +208,15 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen } Reference< chart2::data::XDataSource > lcl_createDataSource( - const Sequence< Reference< chart2::data::XLabeledDataSequence > > & aData ) + const std::vector< Reference< chart2::data::XLabeledDataSequence > > & aData ) { - Reference< uno::XComponentContext > xContext( - comphelper::getProcessComponentContext() ); + Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); Reference< chart2::data::XDataSink > xSink( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.chart2.data.DataSource", xContext ), uno::UNO_QUERY_THROW ); if( xSink.is()) - xSink->setData( aData ); + xSink->setData( comphelper::containerToSequence(aData) ); return Reference< chart2::data::XDataSource >( xSink, uno::UNO_QUERY ); } @@ -239,10 +239,7 @@ Sequence< Reference< chart2::data::XLabeledDataSequence > > lcl_getAllSeriesSequ } } - Sequence< Reference< chart2::data::XLabeledDataSequence > > aRet( aContainer.size()); - ::std::copy( aContainer.begin(), aContainer.end(), aRet.getArray()); - - return aRet; + return comphelper::containerToSequence(aContainer); } Reference< chart2::data::XLabeledDataSequence > @@ -291,10 +288,7 @@ Reference< chart2::data::XDataSource > lcl_pressUsedDataIntoRectangularFormat( c aLabeledSeqVector.push_back( aSeriesSeqVector[nN] ); } - Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeq( aLabeledSeqVector.size() ); - ::std::copy( aLabeledSeqVector.begin(), aLabeledSeqVector.end(), aSeq.getArray() ); - - return lcl_createDataSource( aSeq ); + return lcl_createDataSource( aLabeledSeqVector ); } bool lcl_isSeriesAttachedToFirstAxis( diff --git a/oox/source/helper/grabbagstack.cxx b/oox/source/helper/grabbagstack.cxx index 1505bb286864..ea0df7f3cd2e 100644 --- a/oox/source/helper/grabbagstack.cxx +++ b/oox/source/helper/grabbagstack.cxx @@ -10,6 +10,7 @@ #include "oox/helper/grabbagstack.hxx" #include <com/sun/star/uno/Sequence.hxx> +#include <comphelper/sequence.hxx> namespace oox { @@ -37,14 +38,7 @@ PropertyValue GrabBagStack::getRootProperty() PropertyValue aProperty; aProperty.Name = mCurrentElement.maName; - - Sequence<PropertyValue> aSequence(mCurrentElement.maPropertyList.size()); - PropertyValue* pSequence = aSequence.getArray(); - std::vector<PropertyValue>::iterator i; - for (i = mCurrentElement.maPropertyList.begin(); i != mCurrentElement.maPropertyList.end(); ++i) - *pSequence++ = *i; - - aProperty.Value = makeAny(aSequence); + aProperty.Value = makeAny(comphelper::containerToSequence(mCurrentElement.maPropertyList)); return aProperty; } @@ -67,12 +61,7 @@ void GrabBagStack::push(const OUString& aKey) void GrabBagStack::pop() { OUString aName = mCurrentElement.maName; - Sequence<PropertyValue> aSequence(mCurrentElement.maPropertyList.size()); - PropertyValue* pSequence = aSequence.getArray(); - std::vector<PropertyValue>::iterator i; - for (i = mCurrentElement.maPropertyList.begin(); i != mCurrentElement.maPropertyList.end(); ++i) - *pSequence++ = *i; - + Sequence<PropertyValue> aSequence(comphelper::containerToSequence(mCurrentElement.maPropertyList)); mCurrentElement = mStack.top(); mStack.pop(); appendElement(aName, makeAny(aSequence)); diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx index 4b9f363136ba..09b87b397edf 100644 --- a/oox/source/vml/vmltextbox.cxx +++ b/oox/source/vml/vmltextbox.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/text/XTextAppend.hpp> #include <com/sun/star/text/WritingMode.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> +#include <comphelper/sequence.hxx> namespace oox { namespace vml { @@ -120,11 +121,7 @@ void TextBox::convert(uno::Reference<drawing::XShape> xShape) const aPropertyValue.Value = uno::makeAny(rFont.moColor.get().toUInt32(16)); aPropVec.push_back(aPropertyValue); } - uno::Sequence<beans::PropertyValue> aPropSeq(aPropVec.size()); - beans::PropertyValue* pValues = aPropSeq.getArray(); - for (std::vector<beans::PropertyValue>::iterator i = aPropVec.begin(); i != aPropVec.end(); ++i) - *pValues++ = *i; - xTextAppend->appendTextPortion(aIt->maText, aPropSeq); + xTextAppend->appendTextPortion(aIt->maText, comphelper::containerToSequence(aPropVec)); } // Remove the last character of the shape text, if it would be a newline. diff --git a/package/source/manifest/ManifestReader.cxx b/package/source/manifest/ManifestReader.cxx index 485c45c58ffd..7ca27786d194 100644 --- a/package/source/manifest/ManifestReader.cxx +++ b/package/source/manifest/ManifestReader.cxx @@ -20,6 +20,7 @@ #include <ManifestReader.hxx> #include <ManifestImport.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/sequence.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> @@ -59,12 +60,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSeque aParserInput.sSystemId = "META-INF/manifest.xml"; xParser->setDocumentHandler ( xFilter ); xParser->parseStream( aParserInput ); - aManifestSequence.realloc ( aManVector.size() ); - Sequence < PropertyValue > * pSequence = aManifestSequence.getArray(); - ::std::vector < Sequence < PropertyValue > >::const_iterator aIter = aManVector.begin(); - ::std::vector < Sequence < PropertyValue > >::const_iterator aEnd = aManVector.end(); - while( aIter != aEnd ) - *pSequence++ = (*aIter++); + aManifestSequence = comphelper::containerToSequence(aManVector); } catch (SAXParseException& e) { diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 1fe2cffbae9e..d19452d96a49 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -79,6 +79,7 @@ #include <comphelper/documentconstants.hxx> #include <comphelper/sequenceashashmap.hxx> #include <cppuhelper/supportsservice.hxx> +#include <comphelper/sequence.hxx> using namespace std; using namespace osl; @@ -1017,16 +1018,7 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< uno::Seq pEntry->nSize = pEntry->nCompressedSize = -1; pEntry->nTime = ZipOutputStream::getCurrentDosTime(); - // Convert vector into a uno::Sequence - uno::Sequence < uno::Sequence < PropertyValue > > aManifestSequence ( aManList.size() ); - sal_Int32 nInd = 0; - for ( vector < uno::Sequence < PropertyValue > >::const_iterator aIter = aManList.begin(), aEnd = aManList.end(); - aIter != aEnd; - ++aIter, ++nInd ) - { - aManifestSequence[nInd] = ( *aIter ); - } - xWriter->writeManifestSequence ( xManOutStream, aManifestSequence ); + xWriter->writeManifestSequence ( xManOutStream, comphelper::containerToSequence(aManList) ); sal_Int32 nBufferLength = static_cast < sal_Int32 > ( pBuffer->getPosition() ); pBuffer->realloc( nBufferLength ); diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index 283ffc53edd8..8eb64c7fe54d 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/script/Converter.hpp> #include <com/sun/star/script/InvocationAdapterFactory.hpp> #include <com/sun/star/reflection/theCoreReflection.hpp> +#include <comphelper/sequence.hxx> using com::sun::star::uno::Reference; @@ -636,11 +637,7 @@ bool Runtime::pyIterUnpack( PyObject *const pObj, Any &a ) const items.push_back( pyObject2Any( rItem.get() ) ); } while( (pItem = PyIter_Next( pObj )) ); - Sequence<Any> aSeq( items.size() ); - ::std::list<Any>::iterator it = items.begin(); - for( int i = 0; it != items.end(); ++it ) - aSeq[i++] = *it; - a <<= aSeq; + a <<= comphelper::containerToSequence<Any>(items); return true; } diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 2c6dce15edca..fab5cc5a4437 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -932,8 +932,7 @@ uno::Any GeometryHandler::getConstantValue(bool _bToControlValue,sal_uInt16 _nRe { ::std::vector< OUString > aList; tools::StringListResource aRes(ModuleRes(_nResId),aList); - uno::Sequence< OUString > aSeq(aList.size()); - ::std::copy( aList.begin(), aList.end(), aSeq.getArray() ); + uno::Sequence< OUString > aSeq(comphelper::containerToSequence(aList)); uno::Reference< inspection::XStringRepresentation > xConversionHelper = inspection::StringRepresentation::createConstant( m_xContext,m_xTypeConverter,_sConstantName,aSeq); if ( _bToControlValue ) diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx index 5e26d7c4428b..a65b3e586e98 100644 --- a/sc/source/filter/excel/xltoolbar.cxx +++ b/sc/source/filter/excel/xltoolbar.cxx @@ -19,8 +19,10 @@ #include <com/sun/star/ui/ItemType.hpp> #include <fstream> #include <comphelper/processfactory.hxx> +#include <comphelper/sequence.hxx> #include <vcl/graph.hxx> #include <map> + using namespace com::sun::star; typedef std::map< sal_Int16, OUString > IdToString; @@ -301,13 +303,7 @@ bool ScTBC::ImportToolBarControl( ScCTBWrapper& rWrapper, const css::uno::Refere sProps[ 0 ].Value = uno::makeAny( ui::ItemType::SEPARATOR_LINE ); toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) ); } - uno::Sequence< beans::PropertyValue > sProps( props.size() ); - beans::PropertyValue* pProp = sProps.getArray(); - - for ( std::vector< css::beans::PropertyValue >::iterator it = props.begin(); it != props.end(); ++it, ++pProp ) - *pProp = *it; - - toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) ); + toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( comphelper::containerToSequence(props) ) ); } return true; } 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) diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx index dc9a9adbee1c..2f6506d4c5f3 100644 --- a/sc/source/ui/vba/vbaformatconditions.cxx +++ b/sc/source/ui/vba/vbaformatconditions.cxx @@ -20,6 +20,7 @@ #include <ooo/vba/excel/XRange.hpp> #include <com/sun/star/sheet/XCellRangeAddressable.hpp> #include <com/sun/star/sheet/XSheetConditionalEntry.hpp> +#include <comphelper/sequence.hxx> #include <cppuhelper/exc_hlp.hxx> #include <vector> #include "unonames.hxx" @@ -28,6 +29,7 @@ #include "vbaworkbook.hxx" #include "vbastyles.hxx" #include "vbaglobals.hxx" + using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -191,14 +193,7 @@ ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, cons aProperty.Name = STYLENAME; aProperty.Value = uno::makeAny( sStyleName ); - // convert vector to sequence - uno::Sequence< beans::PropertyValue > aPropertyValueList(aPropertyValueVector.size()); - VecPropValues::iterator it = aPropertyValueVector.begin(); - VecPropValues::iterator it_end = aPropertyValueVector.end(); - for ( sal_Int32 index=0; it != it_end; ++it ) - aPropertyValueList[ index++ ] = *it; - - mxSheetConditionalEntries->addNew(aPropertyValueList); + mxSheetConditionalEntries->addNew(comphelper::containerToSequence(aPropertyValueVector)); for (sal_Int32 i = mxSheetConditionalEntries->getCount()-1; i >= 0; i--) { uno::Reference< sheet::XSheetConditionalEntry > xSheetConditionalEntry( mxSheetConditionalEntries->getByIndex(i), uno::UNO_QUERY_THROW ); diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx index 3c1fc4618625..d201f836306d 100644 --- a/scripting/source/vbaevents/eventhelper.cxx +++ b/scripting/source/vbaevents/eventhelper.cxx @@ -416,14 +416,7 @@ ScriptEventHelper::getEventListeners() } } - Sequence< OUString > sEventMethodNames( eventMethods.size() ); - std::list< OUString >::const_iterator it = eventMethods.begin(); - OUString* pDest = sEventMethodNames.getArray(); - - for ( ; it != eventMethods.end(); ++it, ++pDest ) - *pDest = *it; - - return sEventMethodNames; + return comphelper::containerToSequence<OUString>(eventMethods); } Sequence< ScriptEventDescriptor > diff --git a/sd/source/ui/framework/configuration/Configuration.cxx b/sd/source/ui/framework/configuration/Configuration.cxx index e930f9dcc072..70b59105ca37 100644 --- a/sd/source/ui/framework/configuration/Configuration.cxx +++ b/sd/source/ui/framework/configuration/Configuration.cxx @@ -168,12 +168,7 @@ Sequence<Reference<XResourceId> > SAL_CALL Configuration::getResources ( aResources.push_back(*iResource); } - // Copy the resources from the vector into a new sequence. - Sequence<Reference<XResourceId> > aResult (aResources.size()); - for (size_t nIndex=0; nIndex<aResources.size(); ++nIndex) - aResult[nIndex] = aResources[nIndex]; - - return aResult; + return comphelper::containerToSequence(aResources); } sal_Bool SAL_CALL Configuration::hasResource (const Reference<XResourceId>& rxResourceId) diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index cd9d91f9c589..44044b639fed 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -479,13 +479,8 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow PropertyState_DIRECT_VALUE)); } - // Convert vector into uno Sequence. - Sequence< PropertyValue > aPropertySequence (aProperties.size()); - for (int nIndex=0,nCount=aProperties.size();nIndex<nCount; ++nIndex) - aPropertySequence[nIndex] = aProperties[nIndex]; - if( getSlideAPI( nCurrentSlideNumber, xSlide, xAnimNode ) ) - xShow->displaySlide( xSlide, xDrawPages, xAnimNode, aPropertySequence ); + xShow->displaySlide( xSlide, xDrawPages, xAnimNode, comphelper::containerToSequence(aProperties) ); } } diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index 7612ca1d6a0a..e660f5ca288b 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -676,11 +676,8 @@ IPropertyArrayHelper & DrawController::getInfoHelper() if (mpPropertyArrayHelper.get() == nullptr) { ::std::vector<beans::Property> aProperties; - FillPropertyTable (aProperties); - Sequence<beans::Property> aPropertySequence (aProperties.size()); - for (size_t i=0; i<aProperties.size(); i++) - aPropertySequence[i] = aProperties[i]; - mpPropertyArrayHelper.reset(new OPropertyArrayHelper(aPropertySequence, sal_False)); + FillPropertyTable(aProperties); + mpPropertyArrayHelper.reset(new OPropertyArrayHelper(comphelper::containerToSequence(aProperties), sal_False)); } return *mpPropertyArrayHelper.get(); diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 008991d91046..d15e4ee0d9b4 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -27,6 +27,7 @@ #include <cppuhelper/implbase.hxx> #include <cppuhelper/implementationentry.hxx> #include <cppuhelper/supportsservice.hxx> +#include <comphelper/sequence.hxx> #include <uno/mapping.hxx> #include <osl/thread.h> @@ -1633,19 +1634,7 @@ Sequence< OUString > ImplementationRegistration::getImplementations( if (!implNames.empty()) { - std::list<OUString>::const_iterator iter = implNames.begin(); - - Sequence<OUString> seqImpl(implNames.size()); - OUString *pImplNames = seqImpl.getArray(); - - sal_Int32 index = 0; - while (iter != implNames.end()) - { - pImplNames[index] = *iter; - index++; - ++iter; - } - + Sequence<OUString> seqImpl(comphelper::containerToSequence<OUString>(implNames)); xImpl->closeKey(); return seqImpl; } diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index 73c9ec1ab526..1fdf14f19a31 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -33,6 +33,7 @@ #include <cppuhelper/bootstrap.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/supportsservice.hxx> +#include <comphelper/sequence.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> @@ -860,14 +861,7 @@ Sequence< OUString > OServiceManager::getUniqueAvailableServiceNames( aNameSet.insert( (*aIt++).first ); */ - Sequence< OUString > aNames( aNameSet.size() ); - OUString * pArray = aNames.getArray(); - sal_Int32 i = 0; - HashSet_OWString::iterator next = aNameSet.begin(); - while( next != aNameSet.end() ) - pArray[i++] = (*next++); - - return aNames; + return comphelper::containerToSequence<OUString>(aNameSet); } // XMultiComponentFactory diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index fde28a2195c7..d6c1d82887fd 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -24,6 +24,7 @@ #include <cppuhelper/factory.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/sequence.hxx> #include <com/sun/star/registry/XSimpleRegistry.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/task/InteractionHandler.hpp> @@ -177,25 +178,6 @@ static ::rtl::ByteSequence getBufFromAsciiLine( const OUString& line ) } -static Sequence< OUString > copyVectorToSequence( const vector< OUString >& original ) -{ - Sequence< OUString > newOne ( original.size() ); - for( size_t i = 0; i < original.size() ; i++ ) - newOne[i] = original[i]; - - return newOne; -} - -static vector< OUString > copySequenceToVector( const Sequence< OUString >& original ) -{ - vector< OUString > newOne ( original.getLength() ); - for( int i = 0; i < original.getLength() ; i++ ) - newOne[i] = original[i]; - - return newOne; -} - - PassMap StorageItem::getInfo() { PassMap aResult; @@ -618,7 +600,7 @@ UserRecord PasswordContainer::CopyToUserRecord( const NamePassRecord& aRecord, b } } - return UserRecord( aRecord.GetUserName(), copyVectorToSequence( aPasswords ) ); + return UserRecord( aRecord.GetUserName(), comphelper::containerToSequence( aPasswords ) ); } @@ -658,7 +640,7 @@ void SAL_CALL PasswordContainer::addPersistent( const OUString& Url, const OUStr void PasswordContainer::PrivateAdd( const OUString& Url, const OUString& UserName, const Sequence< OUString >& Passwords, char Mode, const Reference< XInteractionHandler >& aHandler ) throw(RuntimeException, std::exception) { NamePassRecord aRecord( UserName ); - ::std::vector< OUString > aStorePass = copySequenceToVector( Passwords ); + ::std::vector< OUString > aStorePass = comphelper::sequenceToContainer< std::vector<OUString>, OUString>( Passwords ); if( Mode == PERSISTENT_RECORD ) aRecord.SetPersPasswords( EncodePasswords( aStorePass, GetMasterPassword( aHandler ) ) ); @@ -1035,7 +1017,7 @@ Sequence< UrlRecord > SAL_CALL PasswordContainer::getAllPersistent( const Refere { sal_Int32 oldLen = aUsers.getLength(); aUsers.realloc( oldLen + 1 ); - aUsers[ oldLen ] = UserRecord( aNPIter->GetUserName(), copyVectorToSequence( DecodePasswords( aNPIter->GetPersPasswords(), GetMasterPassword( xHandler ) ) ) ); + aUsers[ oldLen ] = UserRecord( aNPIter->GetUserName(), comphelper::containerToSequence( DecodePasswords( aNPIter->GetPersPasswords(), GetMasterPassword( xHandler ) ) ) ); } if( aUsers.getLength() ) diff --git a/svl/source/passwordcontainer/syscreds.cxx b/svl/source/passwordcontainer/syscreds.cxx index bd1722a32e82..ca54b517ab78 100644 --- a/svl/source/passwordcontainer/syscreds.cxx +++ b/svl/source/passwordcontainer/syscreds.cxx @@ -20,6 +20,7 @@ #include "syscreds.hxx" #include <com/sun/star/beans/PropertyValue.hpp> #include <osl/diagnose.h> +#include <comphelper/sequence.hxx> using namespace com::sun::star; @@ -185,19 +186,7 @@ void SysCredentialsConfig::writeCfg() OSL_ENSURE( m_bCfgInited, "SysCredentialsConfig::writeCfg : not initialized!" ); - uno::Sequence< OUString > aURLs( m_aCfgContainer.size() ); - StringSet::const_iterator it = m_aCfgContainer.begin(); - const StringSet::const_iterator end = m_aCfgContainer.end(); - sal_Int32 n = 0; - - while ( it != end ) - { - aURLs[ n ] = *it; - ++it; - ++n; - } - - m_aConfigItem.setSystemCredentialsURLs( aURLs ); + m_aConfigItem.setSystemCredentialsURLs( comphelper::containerToSequence<OUString>(m_aCfgContainer) ); } OUString SysCredentialsConfig::find( OUString const & aURL ) diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 6a22fef255f0..f9f84be461ac 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -37,6 +37,7 @@ #include <vcl/window.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/servicehelper.hxx> +#include <comphelper/sequence.hxx> #include <sot/filelist.hxx> #include <cppuhelper/implbase.hxx> @@ -421,16 +422,7 @@ Sequence< DataFlavor > SAL_CALL TransferableHelper::getTransferDataFlavors() thr { } - Sequence< DataFlavor > aRet( mpFormats->size() ); - DataFlavorExVector::iterator aIter( mpFormats->begin() ), aEnd( mpFormats->end() ); - sal_uInt32 nCurPos = 0; - - while( aIter != aEnd ) - { - aRet[ nCurPos++ ] = *aIter++; - } - - return aRet; + return comphelper::containerToSequence<DataFlavor>(*mpFormats); } diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx index 8fb2af8dd263..aff1df1df3bf 100644 --- a/svx/source/form/fmPropBrw.cxx +++ b/svx/source/form/fmPropBrw.cxx @@ -51,6 +51,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/property.hxx> +#include <comphelper/sequence.hxx> #include <cppuhelper/component_context.hxx> #include <sfx2/bindings.hxx> #include <sfx2/childwin.hxx> @@ -396,10 +397,7 @@ void FmPropBrw::implSetNewSelection( const InterfaceBag& _rSelection ) Reference< XObjectInspector > xInspector( m_xBrowserController, UNO_QUERY_THROW ); // tell it the objects to inspect - Sequence< Reference< XInterface > > aSelection( _rSelection.size() ); - ::std::copy( _rSelection.begin(), _rSelection.end(), aSelection.getArray() ); - - xInspector->inspect( aSelection ); + xInspector->inspect( comphelper::containerToSequence< Reference< XInterface > >(_rSelection) ); } catch( const VetoException& ) { diff --git a/svx/source/unodraw/UnoNameItemTable.cxx b/svx/source/unodraw/UnoNameItemTable.cxx index e21736f7d7b1..cef93f16b146 100644 --- a/svx/source/unodraw/UnoNameItemTable.cxx +++ b/svx/source/unodraw/UnoNameItemTable.cxx @@ -22,6 +22,7 @@ #include <svl/itempool.hxx> #include <svl/itemset.hxx> #include <svl/style.hxx> +#include <comphelper/sequence.hxx> #include <cppuhelper/supportsservice.hxx> #include <svx/svdmodel.hxx> @@ -247,18 +248,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoNameItemTable::getElementNames( ) aNameSet.insert(aApiName); } - uno::Sequence< OUString > aSeq( aNameSet.size() ); - OUString* pNames = aSeq.getArray(); - - std::set< OUString >::iterator aIter( aNameSet.begin() ); - const std::set< OUString >::iterator aEnd( aNameSet.end() ); - - while( aIter != aEnd ) - { - *pNames++ = *aIter++; - } - - return aSeq; + return comphelper::containerToSequence<OUString>(aNameSet); } sal_Bool SAL_CALL SvxUnoNameItemTable::hasByName( const OUString& aApiName ) diff --git a/svx/source/unodraw/UnoNamespaceMap.cxx b/svx/source/unodraw/UnoNamespaceMap.cxx index 066c1df4e02c..183164370308 100644 --- a/svx/source/unodraw/UnoNamespaceMap.cxx +++ b/svx/source/unodraw/UnoNamespaceMap.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <comphelper/sequence.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> @@ -226,18 +227,7 @@ Sequence< OUString > SAL_CALL NamespaceMap::getElementNames() throw (RuntimeExce while( aIter.next( aPrefix, aURL ) ) aPrefixSet.insert( aPrefix ); - Sequence< OUString > aSeq( aPrefixSet.size() ); - OUString* pPrefixes = aSeq.getArray(); - - std::set< OUString >::iterator aPrefixIter( aPrefixSet.begin() ); - const std::set< OUString >::iterator aEnd( aPrefixSet.end() ); - - while( aPrefixIter != aEnd ) - { - *pPrefixes++ = *aPrefixIter++; - } - - return aSeq; + return comphelper::containerToSequence<OUString>(aPrefixSet); } sal_Bool SAL_CALL NamespaceMap::hasByName( const OUString& aName ) throw (RuntimeException, std::exception) diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx index 23723cb68247..29355e1d1b81 100644 --- a/svx/source/unodraw/unomtabl.cxx +++ b/svx/source/unodraw/unomtabl.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/drawing/PointSequence.hpp> #include <svl/style.hxx> +#include <comphelper/sequence.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <svl/itempool.hxx> @@ -356,18 +357,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoMarkerTable::getElementNames() // search model pool for line ends createNamesForPool( mpModelPool, XATTR_LINEEND, aNameSet ); - uno::Sequence< OUString > aSeq( aNameSet.size() ); - OUString* pNames = aSeq.getArray(); - - std::set< OUString >::iterator aIter( aNameSet.begin() ); - const std::set< OUString >::iterator aEnd( aNameSet.end() ); - - while( aIter != aEnd ) - { - *pNames++ = *aIter++; - } - - return aSeq; + return comphelper::containerToSequence<OUString>(aNameSet); } sal_Bool SAL_CALL SvxUnoMarkerTable::hasByName( const OUString& aName ) diff --git a/sw/source/core/fields/flddropdown.cxx b/sw/source/core/fields/flddropdown.cxx index 95d8c4046f62..ee31b1bb0f05 100644 --- a/sw/source/core/fields/flddropdown.cxx +++ b/sw/source/core/fields/flddropdown.cxx @@ -23,6 +23,7 @@ #include <osl/diagnose.h> #include <svl/poolitem.hxx> +#include <comphelper/sequence.hxx> #include <unofldmid.h> #include <unoprnms.hxx> @@ -120,18 +121,7 @@ void SwDropDownField::SetItems(const uno::Sequence<OUString> & rItems) uno::Sequence<OUString> SwDropDownField::GetItemSequence() const { - uno::Sequence<OUString> aSeq( aValues.size() ); - OUString* pSeq = aSeq.getArray(); - int i = 0; - vector<OUString>::const_iterator aIt; - - for (aIt = aValues.begin(); aIt != aValues.end(); ++aIt) - { - pSeq[i] = *aIt; - i++; - } - - return aSeq; + return comphelper::containerToSequence(aValues); } diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index cbf3d98d84b3..a4d63b892ab8 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2825,14 +2825,7 @@ uno::Sequence< OUString > SwXTextFieldMasters::getElementNames() } } - uno::Sequence< OUString > aSeq( static_cast<sal_Int32>(aFieldNames.size()) ); - OUString* pArray = aSeq.getArray(); - for (size_t i = 0; i<aFieldNames.size(); ++i) - { - pArray[i] = aFieldNames[i]; - } - - return aSeq; + return comphelper::containerToSequence(aFieldNames); } sal_Bool SwXTextFieldMasters::hasByName(const OUString& rName) throw( uno::RuntimeException, std::exception ) diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 8f9db59d9fdb..0688b392753a 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -47,6 +47,7 @@ #include <viewopt.hxx> #include <comphelper/servicehelper.hxx> #include <comphelper/propertysetinfo.hxx> +#include <comphelper/sequence.hxx> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/text/XTextRange.hpp> @@ -107,17 +108,11 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, if (rPropertyName == "FieldPositions") { - uno::Sequence<sal_Int32> ret(GetConversionMap().getFieldPositions().size()); - std::copy(GetConversionMap().getFieldPositions().begin(), - GetConversionMap().getFieldPositions().end(), ret.begin()); - return uno::makeAny(ret); + return uno::makeAny( comphelper::containerToSequence( GetConversionMap().getFieldPositions() ) ); } else if (rPropertyName == "FootnotePositions") { - uno::Sequence<sal_Int32> ret(GetConversionMap().getFootnotePositions().size()); - std::copy(GetConversionMap().getFootnotePositions().begin(), - GetConversionMap().getFootnotePositions().end(), ret.begin()); - return uno::makeAny(ret); + return uno::makeAny( comphelper::containerToSequence( GetConversionMap().getFootnotePositions() ) ); } return uno::Any(); } diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 8af520380d4a..ca603e804262 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -47,6 +47,7 @@ #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> +#include <comphelper/sequence.hxx> using namespace ::com::sun::star; @@ -702,16 +703,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion: css::uno::Reference<css::uno::XInterface>(), a); } - uno::Sequence< beans::GetDirectPropertyTolerantResult > aResult( aResultVector.size() ); - std::vector< beans::GetDirectPropertyTolerantResult >::const_iterator aIt = aResultVector.begin(); - beans::GetDirectPropertyTolerantResult *pResult = aResult.getArray(); - for( sal_Int32 nResult = 0; nResult < aResult.getLength(); ++nResult ) - { - pResult[nResult] = *aIt; - ++aIt; - } - - return aResult; + return comphelper::containerToSequence(aResultVector); } void SwXTextPortion::addPropertiesChangeListener( diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index c447e35e48d4..2a2eaab5fd2e 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/ui/ItemType.hpp> #include <fstream> #include <comphelper/processfactory.hxx> +#include <comphelper/sequence.hxx> #include <unotools/configmgr.hxx> #include <vcl/graph.hxx> #include <map> @@ -748,13 +749,7 @@ SwTBC::ImportToolBarControl( SwCTBWrapper& rWrapper, const css::uno::Reference< toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) ); } - uno::Sequence< beans::PropertyValue > sProps( props.size() ); - beans::PropertyValue* pProp = sProps.getArray(); - - for ( std::vector< css::beans::PropertyValue >::iterator it = props.begin(); it != props.end(); ++it, ++pProp ) - *pProp = *it; - - toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) ); + toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( comphelper::containerToSequence(props) ) ); } return true; } diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index f97b99a86356..46b4ceab96af 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -2549,12 +2549,7 @@ void UnoControlListBoxModel::impl_getStringItemList( ::std::vector< OUString >& void UnoControlListBoxModel::impl_setStringItemList_nolck( const ::std::vector< OUString >& i_rStringItems ) { - Sequence< OUString > aStringItems( i_rStringItems.size() ); - ::std::copy( - i_rStringItems.begin(), - i_rStringItems.end(), - aStringItems.getArray() - ); + Sequence< OUString > aStringItems( comphelper::containerToSequence(i_rStringItems) ); m_xData->m_bSettingLegacyProperty = true; try { diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx index 303b31bedc46..e93e620a5049 100644 --- a/unotools/source/misc/syslocale.cxx +++ b/unotools/source/misc/syslocale.cxx @@ -24,6 +24,7 @@ #include <unotools/syslocale.hxx> #include <unotools/syslocaleoptions.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/sequence.hxx> #include <rtl/tencinfo.h> #include <rtl/locale.h> #include <osl/thread.h> @@ -106,10 +107,7 @@ void SvtSysLocale_Impl::setDateAcceptancePatternsConfig() if (!aTok.isEmpty()) aVec.push_back( aTok); } - uno::Sequence< OUString > aSeq( aVec.size()); - for (sal_Int32 i=0; i < aSeq.getLength(); ++i) - aSeq[i] = aVec[i]; - pLocaleData->setDateAcceptancePatterns( aSeq); + pLocaleData->setDateAcceptancePatterns( comphelper::containerToSequence(aVec) ); } } diff --git a/vcl/unx/kde/UnxCommandThread.cxx b/vcl/unx/kde/UnxCommandThread.cxx index df3a01499b42..c5d313c91d57 100644 --- a/vcl/unx/kde/UnxCommandThread.cxx +++ b/vcl/unx/kde/UnxCommandThread.cxx @@ -26,6 +26,7 @@ #include <unistd.h> #include <string.h> #include <iostream> +#include <comphelper/sequence.hxx> using namespace ::com::sun::star; @@ -268,12 +269,7 @@ void SAL_CALL UnxFilePickerCommandThread::handleCommand( const OUString &rComman } else if ( aType == "stringList" ) { - uno::Sequence< OUString > aSequence( aList.size() ); - sal_Int32 nIdx = 0; - for ( ::std::list< OUString >::const_iterator it = aList.begin(); it != aList.end(); ++it, ++nIdx ) - aSequence[nIdx] = (*it); - - m_aGetValue <<= aSequence; + m_aGetValue <<= comphelper::containerToSequence<OUString>(aList); m_aGetValueCondition.set(); } else diff --git a/writerfilter/source/dmapper/MeasureHandler.cxx b/writerfilter/source/dmapper/MeasureHandler.cxx index 9b41676aca94..2d0a5fdbdebe 100644 --- a/writerfilter/source/dmapper/MeasureHandler.cxx +++ b/writerfilter/source/dmapper/MeasureHandler.cxx @@ -22,6 +22,7 @@ #include <ooxml/resourceids.hxx> #include <osl/diagnose.h> #include <com/sun/star/text/SizeType.hpp> +#include <comphelper/sequence.hxx> namespace writerfilter { namespace dmapper { @@ -133,13 +134,7 @@ beans::PropertyValue MeasureHandler::getInteropGrabBag() { beans::PropertyValue aRet; aRet.Name = m_aInteropGrabBagName; - - uno::Sequence<beans::PropertyValue> aSeq(m_aInteropGrabBag.size()); - beans::PropertyValue* pSeq = aSeq.getArray(); - for (std::vector<beans::PropertyValue>::iterator i = m_aInteropGrabBag.begin(); i != m_aInteropGrabBag.end(); ++i) - *pSeq++ = *i; - - aRet.Value = uno::makeAny(aSeq); + aRet.Value = uno::makeAny( comphelper::containerToSequence(m_aInteropGrabBag) ); return aRet; } diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index befce733f1a4..36f979bec396 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -224,15 +224,7 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetCharStyleProperties( ) rProperties.push_back(beans::PropertyValue(aValIter->Name, 0, aValIter->Value, beans::PropertyState_DIRECT_VALUE)); } - uno::Sequence< beans::PropertyValue > aRet( rProperties.size() ); - beans::PropertyValue* pValues = aRet.getArray(); - PropertyValueVector_t::const_iterator aIt = rProperties.begin(); - PropertyValueVector_t::const_iterator aEndIt = rProperties.end(); - for(sal_uInt32 nIndex = 0; aIt != aEndIt; ++aIt,++nIndex) - { - pValues[nIndex] = *aIt; - } - return aRet; + return comphelper::containerToSequence(rProperties); } uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( ) diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 2d0a240cdb45..b5eabb9dc0ae 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -80,10 +80,7 @@ void SdtHelper::createDropDownControl() uno::Reference<beans::XPropertySet> xPropertySet(xControlModel, uno::UNO_QUERY); xPropertySet->setPropertyValue("DefaultText", uno::makeAny(aDefaultText)); xPropertySet->setPropertyValue("Dropdown", uno::makeAny(sal_True)); - uno::Sequence<OUString> aItems(m_aDropDownItems.size()); - for (size_t i = 0; i < m_aDropDownItems.size(); ++i) - aItems[i] = m_aDropDownItems[i]; - xPropertySet->setPropertyValue("StringItemList", uno::makeAny(aItems)); + xPropertySet->setPropertyValue("StringItemList", uno::makeAny( comphelper::containerToSequence(m_aDropDownItems) )); createControlShape(lcl_getOptimalWidth(m_rDM_Impl.GetStyleSheetTable(), aDefaultText, m_aDropDownItems), xControlModel); m_aDropDownItems.clear(); diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 293064c51814..a0e5922b7f15 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -172,12 +172,7 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask, StyleSheetE beans::PropertyValues StyleSheetEntry::GetInteropGrabBagSeq() { - uno::Sequence<beans::PropertyValue> aSeq(m_aInteropGrabBag.size()); - beans::PropertyValue* pSeq = aSeq.getArray(); - for (std::vector<beans::PropertyValue>::iterator i = m_aInteropGrabBag.begin(); i != m_aInteropGrabBag.end(); ++i) - *pSeq++ = *i; - - return aSeq; + return comphelper::containerToSequence(m_aInteropGrabBag); } beans::PropertyValue StyleSheetEntry::GetInteropGrabBag() @@ -831,21 +826,13 @@ void StyleSheetTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties> if (!m_pImpl->m_pCurrentEntry->aLsdExceptions.empty()) { std::vector<beans::PropertyValue>& rLsdExceptions = m_pImpl->m_pCurrentEntry->aLsdExceptions; - uno::Sequence<beans::PropertyValue> aLsdExceptions(rLsdExceptions.size()); - beans::PropertyValue* pLsdExceptions = aLsdExceptions.getArray(); - for (std::vector<beans::PropertyValue>::iterator i = rLsdExceptions.begin(); i != rLsdExceptions.end(); ++i) - *pLsdExceptions++ = *i; - beans::PropertyValue aValue; aValue.Name = "lsdExceptions"; - aValue.Value = uno::makeAny(aLsdExceptions); + aValue.Value = uno::makeAny( comphelper::containerToSequence(rLsdExceptions) ); rLatentStyles.push_back(aValue); } - uno::Sequence<beans::PropertyValue> aLatentStyles(rLatentStyles.size()); - beans::PropertyValue* pLatentStyles = aLatentStyles.getArray(); - for (std::vector<beans::PropertyValue>::iterator i = rLatentStyles.begin(); i != rLatentStyles.end(); ++i) - *pLatentStyles++ = *i; + uno::Sequence<beans::PropertyValue> aLatentStyles( comphelper::containerToSequence(rLatentStyles) ); // We can put all latent style info directly to the document interop // grab bag, as we can be sure that only a single style entry has |