summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-06-23 12:34:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-06-26 13:12:31 +0200
commit0193b284e880a659ab73160e42238e1d5fe5cf8f (patch)
treeda09299838a6afb43d7c601803a6bab787489854 /connectivity/source/drivers
parent2ef138de767c312188d41a7f206234eafac3108b (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r--connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index 4589a636d951..4585629a877c 100644
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
@@ -1074,7 +1074,7 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables(
// check if any type is given
// when no types are given then we have to return all tables e.g. TABLE
- static const OUStringLiteral aTable(u"TABLE");
+ static constexpr OUStringLiteral aTable(u"TABLE");
bool bTableFound = true;
sal_Int32 nLength = types.getLength();
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 200d9f4bd3fe..5b69086b3934 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -243,7 +243,7 @@ namespace connectivity
OUString sMessage;
try
{
- static const OUStringLiteral sProperties( u"properties" );
+ static constexpr OUStringLiteral sProperties( u"properties" );
if ( !bIsNewDatabase && xStorage->isStreamElement(sProperties) )
{
Reference<XStream > xStream = xStorage->openStreamElement(sProperties,ElementModes::READ);
@@ -297,7 +297,7 @@ namespace connectivity
//
// hsqldb 2.6.0 release notes have: added system role SCRIPT_OPS for export / import of database structure and data
// which seems to provide a builtin way to do this with contemporary hsqldb
- static const OUStringLiteral sScript(u"script");
+ static constexpr OUStringLiteral sScript(u"script");
if (!bIsNewDatabase && xStorage->isStreamElement(sScript))
{
Reference<XStream > xStream = xStorage->openStreamElement(sScript, ElementModes::READ);