summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-10-26 14:44:17 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-10-26 21:35:13 +0200
commit637d29fa8e0f5b04129244f993c6bb487e8510d8 (patch)
tree5c150d28cdade5a01bce670146339560d2e4dd5b
parent277d05a7188be77162e4a388c7c825daf8d6e326 (diff)
Drop ContainerHelper::vectorToSequence and use comphelper::containerToSequence
Change-Id: I987c56feab147cdbeb4ad58bd5ebb23dce6dbbca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124215 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx4
-rw-r--r--include/oox/helper/containerhelper.hxx22
-rw-r--r--oox/source/docprop/ooxmldocpropimport.cxx3
-rw-r--r--oox/source/drawingml/chart/seriesconverter.cxx6
-rw-r--r--oox/source/drawingml/chart/titleconverter.cxx6
-rw-r--r--oox/source/drawingml/chart/typegroupconverter.cxx4
-rw-r--r--oox/source/drawingml/lineproperties.cxx7
-rw-r--r--oox/source/vml/vmlshape.cxx6
-rw-r--r--sc/source/filter/oox/autofilterbuffer.cxx4
-rw-r--r--sc/source/filter/oox/externallinkbuffer.cxx6
-rw-r--r--sc/source/filter/oox/formulabase.cxx8
-rw-r--r--sc/source/filter/oox/pivotcachebuffer.cxx4
-rw-r--r--sc/source/filter/oox/pivottablebuffer.cxx4
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx3
14 files changed, 44 insertions, 43 deletions
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 92a5e591cf4f..5b6e9523fbef 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -38,6 +38,8 @@
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XModel.hpp>
+
+#include <comphelper/sequence.hxx>
#include <svx/xflclit.hxx>
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
@@ -580,7 +582,7 @@ bool DataPointItemConverter::ApplySpecialItem(
}
if (bHideLegendEntry)
deletedLegendEntries.push_back(m_nPointIndex);
- xSeriesProp->setPropertyValue("DeletedLegendEntries", uno::makeAny(oox::ContainerHelper::vectorToSequence(deletedLegendEntries)));
+ xSeriesProp->setPropertyValue("DeletedLegendEntries", uno::makeAny(comphelper::containerToSequence(deletedLegendEntries)));
}
}
break;
diff --git a/include/oox/helper/containerhelper.hxx b/include/oox/helper/containerhelper.hxx
index 1bc5ee17f0d8..256719c5334e 100644
--- a/include/oox/helper/containerhelper.hxx
+++ b/include/oox/helper/containerhelper.hxx
@@ -228,19 +228,6 @@ public:
static const typename MapType::mapped_type&
getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault );
- // vector/map/matrix to UNO sequence --------------------------------------
-
- /** Creates a UNO sequence from a std::vector with copies of all elements.
-
- @param rVector The vector to be converted to a sequence.
-
- @return A com.sun.star.uno.Sequence object with copies of all objects
- contained in the passed vector.
- */
- template< typename VectorType >
- static css::uno::Sequence< typename VectorType::value_type >
- vectorToSequence( const VectorType& rVector );
-
/** Creates a UNO sequence of sequences from a matrix with copies of all elements.
@param rMatrix The matrix to be converted to a sequence of sequences.
@@ -287,15 +274,6 @@ template< typename MapType >
return (aIt == rMap.end()) ? rDefault : aIt->second;
}
-template< typename VectorType >
-/*static*/ css::uno::Sequence< typename VectorType::value_type > ContainerHelper::vectorToSequence( const VectorType& rVector )
-{
- typedef typename VectorType::value_type ValueType;
- if( rVector.empty() )
- return css::uno::Sequence< ValueType >();
- return css::uno::Sequence<ValueType>(rVector.data(), static_cast<sal_Int32>(rVector.size()));
-}
-
template< typename MatrixType >
/*static*/ css::uno::Sequence< css::uno::Sequence< typename MatrixType::value_type > > ContainerHelper::matrixToSequenceSequence( const MatrixType& rMatrix )
{
diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx
index 621173b6bdea..4de14e0fca9f 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -32,6 +32,7 @@
#include <oox/helper/containerhelper.hxx>
#include "docprophandler.hxx"
+#include <comphelper/sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star;
@@ -82,7 +83,7 @@ Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxSto
}
}
- return ContainerHelper::vectorToSequence( aResult );
+ return comphelper::containerToSequence( aResult );
}
} // namespace
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index 3f03e1e5c2a6..324f3817d6f1 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -35,6 +35,8 @@
#include <com/sun/star/chart2/data/LabeledDataSequence.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+
+#include <comphelper/sequence.hxx>
#include <osl/diagnose.h>
#include <drawingml/chart/datasourceconverter.hxx>
#include <drawingml/chart/seriesmodel.hxx>
@@ -530,7 +532,7 @@ void ErrorBarConverter::convertFromModel( const Reference< XDataSeries >& rxData
if( aLabeledSeqVec.empty() )
xErrorBar.clear();
else
- xDataSink->setData( ContainerHelper::vectorToSequence( aLabeledSeqVec ) );
+ xDataSink->setData( comphelper::containerToSequence( aLabeledSeqVec ) );
}
}
break;
@@ -810,7 +812,7 @@ Reference< XDataSeries > SeriesConverter::createDataSeries( const TypeGroupConve
}
// attach labeled data sequences to series
if( !aLabeledSeqVec.empty() )
- xDataSink->setData( ContainerHelper::vectorToSequence( aLabeledSeqVec ) );
+ xDataSink->setData( comphelper::containerToSequence( aLabeledSeqVec ) );
}
// error bars
diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx
index f39929134b63..0faf8aa5f79e 100644
--- a/oox/source/drawingml/chart/titleconverter.cxx
+++ b/oox/source/drawingml/chart/titleconverter.cxx
@@ -29,6 +29,8 @@
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
+
+#include <comphelper/sequence.hxx>
#include <osl/diagnose.h>
#include <drawingml/textbody.hxx>
#include <drawingml/textparagraph.hxx>
@@ -114,7 +116,7 @@ Sequence< Reference< XFormattedString > > TextConverter::createStringSequence(
}
}
- return ContainerHelper::vectorToSequence( aStringVec );
+ return comphelper::containerToSequence( aStringVec );
}
Reference< XFormattedString > TextConverter::appendFormattedString(
@@ -336,7 +338,7 @@ void LegendConverter::legendEntriesFormatting(const Reference<XDiagram>& rxDiagr
j += nDataSeqSize;
}
if (deletedLegendEntries.size() > 0)
- aSeriesProp.setProperty(PROP_DeletedLegendEntries, ContainerHelper::vectorToSequence(deletedLegendEntries));
+ aSeriesProp.setProperty(PROP_DeletedLegendEntries, comphelper::containerToSequence(deletedLegendEntries));
}
else
{
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index d6982192a4f5..9a0b9342ac56 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -34,6 +34,8 @@
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
+
+#include <comphelper/sequence.hxx>
#include <osl/diagnose.h>
#include <drawingml/lineproperties.hxx>
#include <drawingml/chart/seriesconverter.hxx>
@@ -395,7 +397,7 @@ void TypeGroupConverter::convertFromModel( const Reference< XDiagram >& rxDiagra
}
// attach labeled data sequences to series and insert series into chart type
- xDataSink->setData( ContainerHelper::vectorToSequence( aLabeledSeqVec ) );
+ xDataSink->setData( comphelper::containerToSequence( aLabeledSeqVec ) );
// formatting of high/low lines
aTypeProp.setProperty( PROP_ShowHighLow, true );
diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx
index 451da4c6aa26..63e768a08c3f 100644
--- a/oox/source/drawingml/lineproperties.cxx
+++ b/oox/source/drawingml/lineproperties.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <comphelper/sequence.hxx>
#include <drawingml/lineproperties.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -369,11 +372,11 @@ void lclPushMarkerProperties( ShapePropertyMap& rPropMap,
{
PolyPolygonBezierCoords aMarkerCoords;
aMarkerCoords.Coordinates.realloc( 1 );
- aMarkerCoords.Coordinates[ 0 ] = ContainerHelper::vectorToSequence( aPoints );
+ aMarkerCoords.Coordinates[ 0 ] = comphelper::containerToSequence( aPoints );
::std::vector< PolygonFlags > aFlags( aPoints.size(), PolygonFlags_NORMAL );
aMarkerCoords.Flags.realloc( 1 );
- aMarkerCoords.Flags[ 0 ] = ContainerHelper::vectorToSequence( aFlags );
+ aMarkerCoords.Flags[ 0 ] = comphelper::containerToSequence( aFlags );
aNamedMarker.Name = aMarkerName;
aNamedMarker.Value <<= aMarkerCoords;
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 4d99a0014e88..f197bd009af6 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -1058,7 +1058,7 @@ Reference< XShape > PolyLineShape::implConvertAndInsert( const Reference< XShape
if (!aAbsPoints.empty())
{
PointSequenceSequence aPointSeq( 1 );
- aPointSeq[ 0 ] = ContainerHelper::vectorToSequence( aAbsPoints );
+ aPointSeq[ 0 ] = comphelper::containerToSequence( aAbsPoints );
PropertySet aPropSet( xShape );
aPropSet.setProperty( PROP_PolyPolygon, aPointSeq );
}
@@ -1226,11 +1226,11 @@ Reference< XShape > BezierShape::implConvertAndInsert( const Reference< XShapes
aBezierCoords.Coordinates.realloc( aCoordLists.size() );
for ( size_t i = 0; i < aCoordLists.size(); i++ )
- aBezierCoords.Coordinates[i] = ContainerHelper::vectorToSequence( aCoordLists[i] );
+ aBezierCoords.Coordinates[i] = comphelper::containerToSequence( aCoordLists[i] );
aBezierCoords.Flags.realloc( aFlagLists.size() );
for ( size_t i = 0; i < aFlagLists.size(); i++ )
- aBezierCoords.Flags[i] = ContainerHelper::vectorToSequence( aFlagLists[i] );
+ aBezierCoords.Flags[i] = comphelper::containerToSequence( aFlagLists[i] );
if( !aCoordLists.front().empty() && !aCoordLists.back().empty()
&& aCoordLists.front().front().X == aCoordLists.back().back().X
diff --git a/sc/source/filter/oox/autofilterbuffer.cxx b/sc/source/filter/oox/autofilterbuffer.cxx
index 211511e52367..5779bd1e5e9c 100644
--- a/sc/source/filter/oox/autofilterbuffer.cxx
+++ b/sc/source/filter/oox/autofilterbuffer.cxx
@@ -28,6 +28,8 @@
#include <com/sun/star/sheet/XSheetFilterDescriptor3.hpp>
#include <com/sun/star/table/TableOrientation.hpp>
#include <com/sun/star/table/CellAddress.hpp>
+
+#include <comphelper/sequence.hxx>
#include <editeng/colritem.hxx>
#include <editeng/brushitem.hxx>
#include <rtl/ustrbuf.hxx>
@@ -779,7 +781,7 @@ void AutoFilter::finalizeImport( const Reference< XDatabaseRange >& rxDatabaseRa
// insert all filter fields to the filter descriptor
if( !aFilterFields.empty() )
- xFilterDesc->setFilterFields3( ContainerHelper::vectorToSequence( aFilterFields ) );
+ xFilterDesc->setFilterFields3( comphelper::containerToSequence( aFilterFields ) );
// regular expressions
bool bUseRegExp = obNeedsRegExp.get( false );
diff --git a/sc/source/filter/oox/externallinkbuffer.cxx b/sc/source/filter/oox/externallinkbuffer.cxx
index b0c5ccd77c6f..9c09580f096e 100644
--- a/sc/source/filter/oox/externallinkbuffer.cxx
+++ b/sc/source/filter/oox/externallinkbuffer.cxx
@@ -29,6 +29,8 @@
#include <com/sun/star/sheet/XDDELinkResults.hpp>
#include <com/sun/star/sheet/XExternalDocLinks.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+
+#include <comphelper/sequence.hxx>
#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <sal/log.hxx>
@@ -425,7 +427,7 @@ ExternalLinkInfo ExternalLink::getLinkInfo() const
for( const auto& rxExtName : maExtNames )
if( rxExtName->getDdeItemInfo( aItemInfo ) )
aItemInfos.push_back( aItemInfo );
- aDdeLinkInfo.Items = ContainerHelper::vectorToSequence( aItemInfos );
+ aDdeLinkInfo.Items = comphelper::containerToSequence( aItemInfos );
aLinkInfo.Data <<= aDdeLinkInfo;
}
break;
@@ -647,7 +649,7 @@ Sequence< ExternalLinkInfo > ExternalLinkBuffer::getLinkInfos() const
aLinkInfos.push_back( mxSelfRef->getLinkInfo() );
for( const auto& rxExtLink : maExtLinks )
aLinkInfos.push_back( rxExtLink->getLinkInfo() );
- return ContainerHelper::vectorToSequence( aLinkInfos );
+ return comphelper::containerToSequence( aLinkInfos );
}
ExternalLinkRef ExternalLinkBuffer::getExternalLink( sal_Int32 nRefId, bool bUseRefSheets ) const
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index 928023f7b7bc..3cb012bda7c8 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -33,6 +33,8 @@
#include <com/sun/star/sheet/FormulaMapGroupSpecialOffset.hpp>
#include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp>
#include <com/sun/star/sheet/XFormulaParser.hpp>
+
+#include <comphelper/sequence.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -138,7 +140,7 @@ Any& ApiTokenVector::append( sal_Int32 nOpCode )
ApiTokenSequence ApiTokenVector::toSequence() const
{
- return ContainerHelper::vectorToSequence( mvTokens );
+ return comphelper::containerToSequence( mvTokens );
}
// token sequence iterator ====================================================
@@ -1427,7 +1429,7 @@ const FunctionInfo* OpCodeProvider::getFuncInfoFromApiToken( const ApiToken& rTo
Sequence< FormulaOpCodeMapEntry > OpCodeProvider::getOoxParserMap() const
{
- return ContainerHelper::vectorToSequence( mxOpCodeImpl->maParserMap );
+ return comphelper::containerToSequence( mxOpCodeImpl->maParserMap );
}
// API formula parser wrapper =================================================
@@ -1703,7 +1705,7 @@ void FormulaProcessorBase::convertStringToStringList(
aNewTokens.emplace_back( OPCODE_SEP, Any() );
aNewTokens.emplace_back( OPCODE_PUSH, Any( aEntry ) );
}
- orTokens = ContainerHelper::vectorToSequence( aNewTokens );
+ orTokens = comphelper::containerToSequence( aNewTokens );
}
} // namespace oox
diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx
index a6d9302cfbdd..52c57d002a0b 100644
--- a/sc/source/filter/oox/pivotcachebuffer.cxx
+++ b/sc/source/filter/oox/pivotcachebuffer.cxx
@@ -26,6 +26,8 @@
#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
#include <com/sun/star/sheet/DataPilotFieldGroupInfo.hpp>
#include <com/sun/star/sheet/XDataPilotFieldGrouping.hpp>
+
+#include <comphelper/sequence.hxx>
#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <sal/log.hxx>
@@ -700,7 +702,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie
if( !aMembers.empty() ) try
{
// only the first call of createNameGroup() returns the new field
- Reference< XDataPilotField > xDPNewField = xDPGrouping->createNameGroup( ContainerHelper::vectorToSequence( aMembers ) );
+ Reference< XDataPilotField > xDPNewField = xDPGrouping->createNameGroup( comphelper::containerToSequence( aMembers ) );
SAL_WARN_IF( xDPGroupField.is() == xDPNewField.is(), "sc", "PivotCacheField::createParentGroupField - missing group field" );
if( !xDPGroupField.is() )
xDPGroupField = xDPNewField;
diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx
index 712a2dcb37ac..142ec1b2406e 100644
--- a/sc/source/filter/oox/pivottablebuffer.cxx
+++ b/sc/source/filter/oox/pivottablebuffer.cxx
@@ -38,6 +38,8 @@
#include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
#include <com/sun/star/sheet/XSheetOperation.hpp>
#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
+
+#include <comphelper/sequence.hxx>
#include <osl/diagnose.h>
#include <tools/diagnose_ex.h>
#include <sal/log.hxx>
@@ -701,7 +703,7 @@ Reference< XDataPilotField > PivotTableField::convertRowColPageField( sal_Int32
// if no function is set manually, check the 'defaultSubtotal' flag
if( aSubtotals.empty() && maModel.mbDefaultSubtotal )
aSubtotals.push_back( GeneralFunction_AUTO );
- aPropSet.setProperty( PROP_Subtotals, ContainerHelper::vectorToSequence( aSubtotals ) );
+ aPropSet.setProperty( PROP_Subtotals, comphelper::containerToSequence( aSubtotals ) );
// layout settings
DataPilotFieldLayoutInfo aLayoutInfo;
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index f3491ce37fab..94255c263c32 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -24,6 +24,7 @@
#include "SchXMLTools.hxx"
#include <comphelper/processfactory.hxx>
+#include <comphelper/sequence.hxx>
#include <sal/log.hxx>
#include <tools/diagnose_ex.h>
#include <xmloff/xmlnamespace.hxx>
@@ -762,7 +763,7 @@ void SchXMLDataPointContext::startFastElement (sal_Int32 /*Element*/,
deletedLegendEntries.push_back(deletedLegendEntry);
}
deletedLegendEntries.push_back(mDataPoint.m_nPointIndex);
- xSeriesProp->setPropertyValue("DeletedLegendEntries", uno::makeAny(::oox::ContainerHelper::vectorToSequence(deletedLegendEntries)));
+ xSeriesProp->setPropertyValue("DeletedLegendEntries", uno::makeAny(comphelper::containerToSequence(deletedLegendEntries)));
}
break;
}