summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-10-19 10:30:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2023-10-19 14:25:14 +0200
commit4f66ce572be5bbec9fe8feef8f0937d0ca06e964 (patch)
treee96571f34719ebf0ed94ef9bb5ff4e247675cfcd /connectivity/source/drivers
parentfec4d0fb9992811d1217624d8eda95eac6da4220 (diff)
Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: connectivity
Change-Id: I8220cf4e83a59aa55394d01f29a6af108dcc0619 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158149 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r--connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/file/FDatabaseMetaData.cxx4
-rw-r--r--connectivity/source/drivers/firebird/Connection.cxx4
-rw-r--r--connectivity/source/drivers/firebird/Driver.cxx18
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx6
-rw-r--r--connectivity/source/drivers/mysql_jdbc/YDriver.cxx2
6 files changed, 18 insertions, 18 deletions
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index 4585629a877c..96a0904efc0b 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 constexpr OUStringLiteral aTable(u"TABLE");
+ static constexpr OUString aTable(u"TABLE"_ustr);
bool bTableFound = true;
sal_Int32 nLength = types.getLength();
diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
index 7b720f91000a..8935022e5088 100644
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
@@ -167,7 +167,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
// check if any type is given
// when no types are given then we have to return all tables e.g. TABLE
- static constexpr OUStringLiteral aTable = u"TABLE";
+ static constexpr OUString aTable = u"TABLE"_ustr;
bool bTableFound = true;
sal_Int32 nLength = types.getLength();
@@ -299,7 +299,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
}
if(bNewRow)
{
- aRow.push_back(new ORowSetValueDecorator(OUString(aTable)));
+ aRow.push_back(new ORowSetValueDecorator(aTable));
aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
aRows.push_back(aRow);
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index 5b8cdb7b16d6..8dc567b23233 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -72,11 +72,11 @@ using namespace ::com::sun::star::uno;
* Location within the .odb that an embedded .fdb will be stored.
* Only relevant for embedded dbs.
*/
-constexpr OUStringLiteral our_sFDBLocation( u"firebird.fdb" );
+constexpr OUString our_sFDBLocation( u"firebird.fdb"_ustr );
/**
* Older version of LO may store the database in a .fdb file
*/
-constexpr OUStringLiteral our_sFBKLocation( u"firebird.fbk" );
+constexpr OUString our_sFBKLocation( u"firebird.fbk"_ustr );
Connection::Connection()
: Connection_BASE(m_aMutex)
diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx
index 3a1b80292adc..39a72f3b5649 100644
--- a/connectivity/source/drivers/firebird/Driver.cxx
+++ b/connectivity/source/drivers/firebird/Driver.cxx
@@ -45,9 +45,9 @@ using namespace connectivity::firebird;
// Static const variables
namespace {
-constexpr OUStringLiteral our_sFirebirdTmpVar = u"FIREBIRD_TMP";
-constexpr OUStringLiteral our_sFirebirdLockVar = u"FIREBIRD_LOCK";
-constexpr OUStringLiteral our_sFirebirdMsgVar = u"FIREBIRD_MSG";
+constexpr OUString our_sFirebirdTmpVar = u"FIREBIRD_TMP"_ustr;
+constexpr OUString our_sFirebirdLockVar = u"FIREBIRD_LOCK"_ustr;
+constexpr OUString our_sFirebirdMsgVar = u"FIREBIRD_MSG"_ustr;
#ifdef MACOSX
constexpr OUStringLiteral our_sFirebirdLibVar = u"LIBREOFFICE_FIREBIRD_LIB";
#endif
@@ -66,10 +66,10 @@ FirebirdDriver::FirebirdDriver(const css::uno::Reference< css::uno::XComponentCo
m_firebirdLockDirectory.EnableKillingFile(true);
// Overrides firebird's default of /tmp or c:\temp
- osl_setEnvironment(OUString(our_sFirebirdTmpVar).pData, m_firebirdTMPDirectory.GetFileName().pData);
+ osl_setEnvironment(our_sFirebirdTmpVar.pData, m_firebirdTMPDirectory.GetFileName().pData);
// Overrides firebird's default of /tmp/firebird or c:\temp\firebird
- osl_setEnvironment(OUString(our_sFirebirdLockVar).pData, m_firebirdLockDirectory.GetFileName().pData);
+ osl_setEnvironment(our_sFirebirdLockVar.pData, m_firebirdLockDirectory.GetFileName().pData);
#ifndef SYSTEM_FIREBIRD
// Overrides firebird's hardcoded default of /usr/local/firebird on *nix,
@@ -78,7 +78,7 @@ FirebirdDriver::FirebirdDriver(const css::uno::Reference< css::uno::XComponentCo
::rtl::Bootstrap::expandMacros(sMsgURL);
OUString sMsgPath;
::osl::FileBase::getSystemPathFromFileURL(sMsgURL, sMsgPath);
- osl_setEnvironment(OUString(our_sFirebirdMsgVar).pData, sMsgPath.pData);
+ osl_setEnvironment(our_sFirebirdMsgVar.pData, sMsgPath.pData);
#ifdef MACOSX
// Set an env. variable to specify library location
// for dlopen used in fbclient.
@@ -105,11 +105,11 @@ void FirebirdDriver::disposing()
}
m_xConnections.clear();
- osl_clearEnvironment(OUString(our_sFirebirdTmpVar).pData);
- osl_clearEnvironment(OUString(our_sFirebirdLockVar).pData);
+ osl_clearEnvironment(our_sFirebirdTmpVar.pData);
+ osl_clearEnvironment(our_sFirebirdLockVar.pData);
#ifndef SYSTEM_FIREBIRD
- osl_clearEnvironment(OUString(our_sFirebirdMsgVar).pData);
+ osl_clearEnvironment(our_sFirebirdMsgVar.pData);
#ifdef MACOSX
osl_clearEnvironment(OUString(our_sFirebirdLibVar).pData);
#endif /*MACOSX*/
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 5b69086b3934..0439ffde75c4 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -71,7 +71,7 @@ namespace connectivity
using namespace css::util;
using namespace css::reflection;
- constexpr OUStringLiteral IMPL_NAME = u"com.sun.star.sdbcx.comp.hsqldb.Driver";
+ constexpr OUString IMPL_NAME = u"com.sun.star.sdbcx.comp.hsqldb.Driver"_ustr;
@@ -243,7 +243,7 @@ namespace connectivity
OUString sMessage;
try
{
- static constexpr OUStringLiteral sProperties( u"properties" );
+ static constexpr OUString sProperties( u"properties"_ustr );
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 constexpr OUStringLiteral sScript(u"script");
+ static constexpr OUString sScript(u"script"_ustr);
if (!bIsNewDatabase && xStorage->isStreamElement(sScript))
{
Reference<XStream > xStream = xStorage->openStreamElement(sScript, ElementModes::READ);
diff --git a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx
index 0f8357abd112..d62ee1b469b9 100644
--- a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx
+++ b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx
@@ -244,7 +244,7 @@ Reference<XConnection> SAL_CALL ODriverDelegator::connect(const OUString& url,
OUString sAdd;
if (RTL_TEXTENCODING_UTF8 == (*aLookup).getEncoding())
{
- static constexpr OUStringLiteral s_sCharSetOp = u"useUnicode=true&";
+ static constexpr OUString s_sCharSetOp = u"useUnicode=true&"_ustr;
if (!sCuttedUrl.matchIgnoreAsciiCase(s_sCharSetOp))
{
sAdd = s_sCharSetOp;