summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-06-26 16:16:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-06-27 13:10:44 +0200
commite266d448f45348f27f8291ea5d0542747d7c8168 (patch)
tree0d6d14e94d9bf25aeeb4ef21630ee72c10681645 /l10ntools
parent05c6cdb144d1732ca51d463845fa6ddef7c08265 (diff)
loplugin:stringstatic look for more strings
that can be initialised at compile-time instead of runtime Change-Id: I08d516fdc13a3a79f93c079f89ac44cbc7a1ed71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153620 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/merge.cxx2
-rw-r--r--l10ntools/source/propmerge.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 263e3d588121..8327442b0af2 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -150,7 +150,7 @@ MergeDataFile::MergeDataFile(
OString sLang;
//Get language id from path
{
- const OString sTransSource("translations/source/");
+ static constexpr OStringLiteral sTransSource("translations/source/");
const sal_Int32 nStart =
sPoFileName.indexOf(sTransSource)+sTransSource.getLength();
const sal_Int32 nCount =
diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx
index c17519364443..99c2885ce5a3 100644
--- a/l10ntools/source/propmerge.cxx
+++ b/l10ntools/source/propmerge.cxx
@@ -28,7 +28,7 @@ namespace
sal_Int32 lcl_IndexOfUnicode(
std::string_view rSource, const sal_Int32 nFrom = 0 )
{
- const OString sHexDigits = "0123456789abcdefABCDEF";
+ static constexpr std::string_view sHexDigits = "0123456789abcdefABCDEF";
size_t nIndex = rSource.find( "\\u", nFrom );
if( nIndex == std::string_view::npos )
{
@@ -37,7 +37,7 @@ namespace
bool bIsUnicode = true;
for( short nDist = 2; nDist <= 5; ++nDist )
{
- if( sHexDigits.indexOf( rSource[nIndex + nDist] ) == -1 )
+ if( sHexDigits.find( rSource[nIndex + nDist] ) == std::string_view::npos )
{
bIsUnicode = false;
}