std::set->o3tl::sorted_vector in oox

Change-Id: Id7cdf8c4787d89adc9c343a5417093bee2aa603a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104905
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2020-10-27 21:17:58 +02:00
committed by Noel Grandin
parent 6436302f40
commit 4b6ebf3b4f
2 changed files with 14 additions and 9 deletions

View File

@@ -66,6 +66,7 @@
#include <sax/tools/converter.hxx>
#include <oox/token/namespacemap.hxx>
#include <editeng/unoprnms.hxx>
#include <o3tl/sorted_vector.hxx>
using ::com::sun::star::xml::dom::DocumentBuilder;
using ::com::sun::star::xml::dom::XDocument;
@@ -157,7 +158,8 @@ void registerNamespaces( FastParser& rParser )
// Filter out duplicates: a namespace can have multiple URLs, think of
// strict vs transitional.
std::set<sal_Int32> aSet;
o3tl::sorted_vector<sal_Int32> aSet;
aSet.reserve(ids.getLength());
for (const auto& rId : ids)
aSet.insert(rId.Second);

View File

@@ -103,6 +103,7 @@
#include <rtl/math.hxx>
#include <o3tl/temporary.hxx>
#include <o3tl/sorted_vector.hxx>
using namespace css;
using namespace css::uno;
@@ -3664,10 +3665,11 @@ void ChartExport::exportDataPoints(
if( bVaryColorsByPoint && xColorScheme.is() )
{
::std::set< sal_Int32 > aAttrPointSet;
::std::copy( pPoints, pPoints + aDataPointSeq.getLength(),
::std::inserter( aAttrPointSet, aAttrPointSet.begin()));
const ::std::set< sal_Int32 >::const_iterator aEndIt( aAttrPointSet.end());
o3tl::sorted_vector< sal_Int32 > aAttrPointSet;
aAttrPointSet.reserve(aDataPointSeq.getLength());
for (auto p = pPoints; p < pPoints + aDataPointSeq.getLength(); ++p)
aAttrPointSet.insert(*p);
const auto aEndIt = aAttrPointSet.end();
for( nElement = 0; nElement < nSeriesLength; ++nElement )
{
uno::Reference< beans::XPropertySet > xPropSet;
@@ -3724,10 +3726,11 @@ void ChartExport::exportDataPoints(
if( bVaryColorsByPoint )
return;
::std::set< sal_Int32 > aAttrPointSet;
::std::copy( pPoints, pPoints + aDataPointSeq.getLength(),
::std::inserter( aAttrPointSet, aAttrPointSet.begin()));
const ::std::set< sal_Int32 >::const_iterator aEndIt( aAttrPointSet.end());
o3tl::sorted_vector< sal_Int32 > aAttrPointSet;
aAttrPointSet.reserve(aDataPointSeq.getLength());
for (auto p = pPoints; p < pPoints + aDataPointSeq.getLength(); ++p)
aAttrPointSet.insert(*p);
const auto aEndIt = aAttrPointSet.end();
for( nElement = 0; nElement < nSeriesLength; ++nElement )
{
uno::Reference< beans::XPropertySet > xPropSet;