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 /oox | |
parent | f7b5f477bfd942e0a1d8880c372635000d724dd7 (diff) |
use comphelper::containerToSequence
in chart2, we remove a local equivalent of the method
Change-Id: I25129a3d1ea1dd724eb9cd38a57be37a78b3d100
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/customshapeproperties.cxx | 6 | ||||
-rw-r--r-- | oox/source/export/chartexport.cxx | 18 | ||||
-rw-r--r-- | oox/source/helper/grabbagstack.cxx | 17 | ||||
-rw-r--r-- | oox/source/vml/vmltextbox.cxx | 7 |
4 files changed, 13 insertions, 35 deletions
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. |