summaryrefslogtreecommitdiff
path: root/vcl
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 /vcl
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 'vcl')
-rw-r--r--vcl/qa/cppunit/text.cxx2
-rw-r--r--vcl/source/filter/FilterConfigCache.cxx14
-rw-r--r--vcl/source/filter/ipdf/pdfdocument.cxx4
3 files changed, 10 insertions, 10 deletions
diff --git a/vcl/qa/cppunit/text.cxx b/vcl/qa/cppunit/text.cxx
index 4301c89bfadd..4d55b1bd91d5 100644
--- a/vcl/qa/cppunit/text.cxx
+++ b/vcl/qa/cppunit/text.cxx
@@ -518,7 +518,7 @@ CPPUNIT_TEST_FIXTURE(VclTextTest, testImplLayoutArgs_PrepareFallback_precalculat
ScopedVclPtrInstance<VirtualDevice> pVirDev;
pVirDev->SetFont(aFont);
- const OString sUTF8String(u8"Тхе яуицк\n ыумпед овер");
+ static constexpr OStringLiteral sUTF8String(u8"Тхе яуицк\n ыумпед овер");
const OUString sTestString(OUString::fromUtf8(sUTF8String));
std::unique_ptr<SalLayout> pLayout
= pVirDev->ImplLayout(sTestString, 0, sTestString.getLength(), Point(0, 0), 0, {}, {},
diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx
index 9f3668ccc5a6..fd3ce0cea8a7 100644
--- a/vcl/source/filter/FilterConfigCache.cxx
+++ b/vcl/source/filter/FilterConfigCache.cxx
@@ -119,13 +119,13 @@ static Reference< XInterface > openConfig(const char* sPackage)
void FilterConfigCache::ImplInit()
{
- OUString const STYPE ( "Type" );
- OUString const SUINAME ( "UIName" );
- OUString const SFLAGS ( "Flags" );
- OUString const SMEDIATYPE ( "MediaType" );
- OUString const SEXTENSIONS ( "Extensions" );
- OUString const SFORMATNAME ( "FormatName" );
- OUString const SREALFILTERNAME ( "RealFilterName" );
+ static constexpr OUStringLiteral STYPE ( u"Type" );
+ static constexpr OUStringLiteral SUINAME ( u"UIName" );
+ static constexpr OUStringLiteral SFLAGS ( u"Flags" );
+ static constexpr OUStringLiteral SMEDIATYPE ( u"MediaType" );
+ static constexpr OUStringLiteral SEXTENSIONS ( u"Extensions" );
+ static constexpr OUStringLiteral SFORMATNAME ( u"FormatName" );
+ static constexpr OUStringLiteral SREALFILTERNAME ( u"RealFilterName" );
// get access to config
Reference< XNameAccess > xTypeAccess ( openConfig("types" ), UNO_QUERY );
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx
index be6375d10675..53d3d37b4e86 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -112,11 +112,11 @@ sal_uInt32 PDFDocument::GetNextSignature()
continue;
const OString& rValue = pT->GetValue();
- const OString aPrefix = "Signature";
+ static constexpr std::string_view aPrefix = "Signature";
if (!rValue.startsWith(aPrefix))
continue;
- nRet = std::max(nRet, o3tl::toUInt32(rValue.subView(aPrefix.getLength())));
+ nRet = std::max(nRet, o3tl::toUInt32(rValue.subView(aPrefix.size())));
}
return nRet + 1;