diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 10:02:46 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-31 06:56:57 +0100 |
commit | 8b9e502480812f61a1c8d37c465aaf93763fe156 (patch) | |
tree | c74b7baf71fe1ffd88a9819bb53b33fb75668392 /sdext/source/minimizer/optimizationstats.cxx | |
parent | ce22935a8586eda71fd29d4ff969d9cd7a2ec15b (diff) |
Prepare for removal of non-const operator[] from Sequence in sdext
Change-Id: I1992d1ffbbc80efe9749ebd254971a0a92a10019
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124386
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sdext/source/minimizer/optimizationstats.cxx')
-rw-r--r-- | sdext/source/minimizer/optimizationstats.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sdext/source/minimizer/optimizationstats.cxx b/sdext/source/minimizer/optimizationstats.cxx index deed337c712a..1deef26ac059 100644 --- a/sdext/source/minimizer/optimizationstats.cxx +++ b/sdext/source/minimizer/optimizationstats.cxx @@ -23,6 +23,10 @@ #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> +#include <comphelper/propertyvalue.hxx> + +#include <algorithm> + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -51,13 +55,10 @@ const uno::Any* OptimizationStats::GetStatusValue( const PPPOptimizerTokenEnum e css::beans::PropertyValues OptimizationStats::GetStatusSequence() { - int i = 0; uno::Sequence< PropertyValue > aStatsSequence( maStats.size() ); - for( const auto& rEntry : maStats ) - { - aStatsSequence[ i ].Name = TKGet( rEntry.first ); - aStatsSequence[ i++ ].Value = rEntry.second; - } + std::transform(maStats.begin(), maStats.end(), aStatsSequence.getArray(), + [](const auto& rEntry) + { return comphelper::makePropertyValue(TKGet( rEntry.first ), rEntry.second); }); return aStatsSequence; } |