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>
This commit is contained in:
@@ -394,18 +394,12 @@ namespace
|
||||
|
||||
OUString ReplaceStringHookProc( const OUString& rStr )
|
||||
{
|
||||
const static OUString sBuildId(utl::Bootstrap::getBuildIdData("development"));
|
||||
static OUString sBrandName, sVersion, sAboutBoxVersion, sAboutBoxVersionSuffix, sExtension;
|
||||
|
||||
static std::once_flag aInitOnce;
|
||||
std::call_once(aInitOnce, []
|
||||
{
|
||||
sBrandName = utl::ConfigManager::getProductName();
|
||||
sVersion = utl::ConfigManager::getProductVersion();
|
||||
sAboutBoxVersion = utl::ConfigManager::getAboutBoxProductVersion();
|
||||
sAboutBoxVersionSuffix = utl::ConfigManager::getAboutBoxProductVersionSuffix();
|
||||
sExtension = utl::ConfigManager::getProductExtension();
|
||||
} );
|
||||
const static OUString sBuildId(utl::Bootstrap::getBuildIdData("development")),
|
||||
sBrandName(utl::ConfigManager::getProductName()),
|
||||
sVersion(utl::ConfigManager::getProductVersion()),
|
||||
sAboutBoxVersion(utl::ConfigManager::getAboutBoxProductVersion()),
|
||||
sAboutBoxVersionSuffix(utl::ConfigManager::getAboutBoxProductVersionSuffix()),
|
||||
sExtension(utl::ConfigManager::getProductExtension());
|
||||
|
||||
OUString sRet(rStr);
|
||||
if (sRet.indexOf("%PRODUCT") != -1 || sRet.indexOf("%ABOUTBOX") != -1)
|
||||
|
||||
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user