diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-10-27 21:17:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-28 07:22:17 +0100 |
commit | 4b6ebf3b4f2992a8b796443fe666ee32e2e47c1d (patch) | |
tree | db307d3077b1d9a5c8b8604dd437358c20ada41b | |
parent | 6436302f40252bc6619e304e2051115fee902e20 (diff) |
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>
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 4 | ||||
-rw-r--r-- | oox/source/export/chartexport.cxx | 19 |
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; |