diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-11-16 10:36:24 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-11-16 11:45:21 +0100 |
commit | 130c1ae09451c268fcd4f2d55f65ac7dc9581342 (patch) | |
tree | 642a15b3ca13a6f5e06e09f372a0f647eeec502b /sw | |
parent | 16fbe76fd05e96f0aa1a39498a0d7fd56a5b9c5f (diff) |
Replace some std::once with static initializers
Change-Id: I6234bc252dac5b1c29e3f1ef844cf51f56aaa7ac
Reviewed-on: https://gerrit.libreoffice.org/82970
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/wrtw8num.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index d9f284c3380b..35b8c60a89b7 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -40,6 +40,7 @@ #include "ww8par.hxx" #include <mutex> +#include <numeric> using namespace ::com::sun::star; using namespace sw::types; @@ -444,15 +445,11 @@ void MSWordExportBase::NumberingLevel( SwNumRule const& rRule, sal_uInt8 const nLvl) { // prepare the NodeNum to generate the NumString - static SwNumberTree::tNumberVector aNumVector; - static std::once_flag aInitOnce; - std::call_once(aInitOnce, [] - { - for (int n = 0; n < WW8ListManager::nMaxLevel; ++n) - { - aNumVector.push_back( n ); - } - }); + static const SwNumberTree::tNumberVector aNumVector = [] { + SwNumberTree::tNumberVector vec(WW8ListManager::nMaxLevel); + std::iota(vec.begin(), vec.end(), 0); + return vec; + }(); // write the static data of the SwNumFormat of this level sal_uInt8 aNumLvlPos[WW8ListManager::nMaxLevel] = { 0,0,0,0,0,0,0,0,0 }; |