summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/xmlfilterbase.cxx4
-rw-r--r--oox/source/export/chartexport.cxx19
2 files changed, 14 insertions, 9 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 259e0bf2e406..d1d1e82f0bb9 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -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);
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 5b52d312c091..19c5b7abf5f4 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -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;