From 0193b284e880a659ab73160e42238e1d5fe5cf8f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 23 Jun 2023 12:34:31 +0200 Subject: new loplugin:constexprliteral OUStringLiteral should be declared constexpr, to enforce that it is initialised at compile-time and not runtime. This seems to make a different at least on Visual Studio Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499 Tested-by: Jenkins Reviewed-by: Noel Grandin --- comphelper/source/misc/backupfilehelper.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'comphelper') diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx index e9b173a47369..6493776a158b 100644 --- a/comphelper/source/misc/backupfilehelper.cxx +++ b/comphelper/source/misc/backupfilehelper.cxx @@ -661,8 +661,8 @@ namespace const ExtensionInfoEntryVector& rToBeEnabled, const ExtensionInfoEntryVector& rToBeDisabled) { - static const OUStringLiteral aRegPathFront(u"/uno_packages/cache/registry/com.sun.star.comp.deployment."); - static const OUStringLiteral aRegPathBack(u".PackageRegistryBackend/backenddb.xml"); + static constexpr OUStringLiteral aRegPathFront(u"/uno_packages/cache/registry/com.sun.star.comp.deployment."); + static constexpr OUStringLiteral aRegPathBack(u".PackageRegistryBackend/backenddb.xml"); // first appearance to check { const OUString aUnoPackagReg(OUString::Concat(rUserConfigWorkURL) + aRegPathFront + "bundle" + aRegPathBack); @@ -1467,7 +1467,7 @@ namespace comphelper // points to registrymodifications.xcu OUString conf("${CONFIGURATION_LAYERS}"); rtl::Bootstrap::expandMacros(conf); - static const OUStringLiteral aTokenUser(u"user:"); + static constexpr OUStringLiteral aTokenUser(u"user:"); sal_Int32 nStart(conf.indexOf(aTokenUser)); if (-1 != nStart) -- cgit