connectivity/source/commontools/conncleanup.cxx          |    2 
 connectivity/source/commontools/dbtools.cxx              |   32 +++++++--------
 connectivity/source/commontools/dbtools2.cxx             |    2 
 connectivity/source/commontools/formattedcolumnvalue.cxx |    2 
 connectivity/source/commontools/statementcomposer.cxx    |    4 -
 connectivity/source/cpool/ZConnectionPool.cxx            |    2 
 connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx |    2 
 connectivity/source/drivers/file/FDatabaseMetaData.cxx   |    4 -
 connectivity/source/drivers/firebird/Connection.cxx      |    4 -
 connectivity/source/drivers/firebird/Driver.cxx          |   18 ++++----
 connectivity/source/drivers/hsqldb/HDriver.cxx           |    6 +-
 connectivity/source/drivers/mysql_jdbc/YDriver.cxx       |    2 
 connectivity/source/parse/sqliterator.cxx                |    2 
 connectivity/source/parse/sqlnode.cxx                    |    2 
 14 files changed, 42 insertions(+), 42 deletions(-)

New commits:
commit 4f66ce572be5bbec9fe8feef8f0937d0ca06e964
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Oct 19 10:30:07 2023 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Oct 19 14:25:14 2023 +0200

    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 <sberg...@redhat.com>

diff --git a/connectivity/source/commontools/conncleanup.cxx 
b/connectivity/source/commontools/conncleanup.cxx
index 5504c4e14253..7b703f093c80 100644
--- a/connectivity/source/commontools/conncleanup.cxx
+++ b/connectivity/source/commontools/conncleanup.cxx
@@ -35,7 +35,7 @@ namespace dbtools
     using namespace css::sdbc;
     using namespace css::lang;
 
-    constexpr OUStringLiteral ACTIVE_CONNECTION_PROPERTY_NAME = 
u"ActiveConnection";
+    constexpr OUString ACTIVE_CONNECTION_PROPERTY_NAME = 
u"ActiveConnection"_ustr;
 
     OAutoConnectionDisposer::OAutoConnectionDisposer(const Reference< XRowSet 
>& _rxRowSet, const Reference< XConnection >& _rxConnection)
         :m_xRowSet( _rxRowSet )
diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 1e66826e80b6..885e28c751f5 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -389,7 +389,7 @@ static SharedConnection lcl_connectRowSet(const Reference< 
XRowSet>& _rxRowSet,
 
         // build a connection with its current settings (4. data source name, 
or 5. URL)
 
-        static constexpr OUStringLiteral sUserProp( u"User" );
+        static constexpr OUString sUserProp( u"User"_ustr );
         OUString sDataSourceName;
         xRowSetProps->getPropertyValue("DataSourceName") >>= sDataSourceName;
         OUString sURL;
@@ -913,7 +913,7 @@ Reference< XNumberFormatsSupplier> getNumberFormats(
     // ask the parent of the connection (should be a DatabaseAccess)
     Reference< XNumberFormatsSupplier> xReturn;
     Reference< XChild> xConnAsChild(_rxConn, UNO_QUERY);
-    static constexpr OUStringLiteral sPropFormatsSupplier( 
u"NumberFormatsSupplier" );
+    static constexpr OUString sPropFormatsSupplier( 
u"NumberFormatsSupplier"_ustr );
     if (xConnAsChild.is())
     {
         Reference< XPropertySet> xConnParentProps(xConnAsChild->getParent(), 
UNO_QUERY);
@@ -945,20 +945,20 @@ try
     const Sequence< Property> aOldProperties = xOldInfo->getProperties();
     const Sequence< Property> aNewProperties = xNewInfo->getProperties();
 
-    static constexpr OUStringLiteral sPropFormatsSupplier(u"FormatsSupplier");
-    static constexpr OUStringLiteral sPropCurrencySymbol(u"CurrencySymbol");
-    static constexpr OUStringLiteral sPropDecimals(u"Decimals");
-    static constexpr OUStringLiteral sPropEffectiveMin(u"EffectiveMin");
-    static constexpr OUStringLiteral sPropEffectiveMax(u"EffectiveMax");
-    static constexpr OUStringLiteral 
sPropEffectiveDefault(u"EffectiveDefault");
-    static constexpr OUStringLiteral sPropDefaultText(u"DefaultText");
-    static constexpr OUStringLiteral sPropDefaultDate(u"DefaultDate");
-    static constexpr OUStringLiteral sPropDefaultTime(u"DefaultTime");
-    static constexpr OUStringLiteral sPropValueMin(u"ValueMin");
-    static constexpr OUStringLiteral sPropValueMax(u"ValueMax");
-    static constexpr OUStringLiteral sPropDecimalAccuracy(u"DecimalAccuracy");
-    static constexpr OUStringLiteral sPropClassId(u"ClassId");
-    static constexpr OUStringLiteral sFormattedServiceName( 
u"com.sun.star.form.component.FormattedField" );
+    static constexpr OUString sPropFormatsSupplier(u"FormatsSupplier"_ustr);
+    static constexpr OUString sPropCurrencySymbol(u"CurrencySymbol"_ustr);
+    static constexpr OUString sPropDecimals(u"Decimals"_ustr);
+    static constexpr OUString sPropEffectiveMin(u"EffectiveMin"_ustr);
+    static constexpr OUString sPropEffectiveMax(u"EffectiveMax"_ustr);
+    static constexpr OUString sPropEffectiveDefault(u"EffectiveDefault"_ustr);
+    static constexpr OUString sPropDefaultText(u"DefaultText"_ustr);
+    static constexpr OUString sPropDefaultDate(u"DefaultDate"_ustr);
+    static constexpr OUString sPropDefaultTime(u"DefaultTime"_ustr);
+    static constexpr OUString sPropValueMin(u"ValueMin"_ustr);
+    static constexpr OUString sPropValueMax(u"ValueMax"_ustr);
+    static constexpr OUString sPropDecimalAccuracy(u"DecimalAccuracy"_ustr);
+    static constexpr OUString sPropClassId(u"ClassId"_ustr);
+    static constexpr OUString sFormattedServiceName( 
u"com.sun.star.form.component.FormattedField"_ustr );
 
     for (const Property& rOldProp : aOldProperties)
     {
diff --git a/connectivity/source/commontools/dbtools2.cxx 
b/connectivity/source/commontools/dbtools2.cxx
index fc533d0ff024..8148b25ddca3 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -1004,7 +1004,7 @@ bool isAggregateColumn( const Reference< XPropertySet > 
&_xColumn )
 {
     bool bAgg(false);
 
-    static constexpr OUStringLiteral sAgg = u"AggregateFunction";
+    static constexpr OUString sAgg = u"AggregateFunction"_ustr;
     if ( _xColumn->getPropertySetInfo()->hasPropertyByName(sAgg) )
         _xColumn->getPropertyValue(sAgg) >>= bAgg;
 
diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx 
b/connectivity/source/commontools/formattedcolumnvalue.cxx
index a389236e6aa0..32db3d7177c2 100644
--- a/connectivity/source/commontools/formattedcolumnvalue.cxx
+++ b/connectivity/source/commontools/formattedcolumnvalue.cxx
@@ -149,7 +149,7 @@ namespace dbtools
                 // get the format key of our bound field
                 Reference< XPropertySetInfo > xPSI( 
_rxColumn->getPropertySetInfo(), UNO_SET_THROW );
                 bool bHaveFieldFormat = false;
-                static constexpr OUStringLiteral sFormatKeyProperty( 
u"FormatKey" );
+                static constexpr OUString sFormatKeyProperty( 
u"FormatKey"_ustr );
                 if ( xPSI->hasPropertyByName( sFormatKeyProperty ) )
                 {
                     bHaveFieldFormat = ( _rxColumn->getPropertyValue( 
sFormatKeyProperty ) >>= _rData.m_nFormatKey );
diff --git a/connectivity/source/commontools/statementcomposer.cxx 
b/connectivity/source/commontools/statementcomposer.cxx
index c7113b2f179f..8ebbd9ca8608 100644
--- a/connectivity/source/commontools/statementcomposer.cxx
+++ b/connectivity/source/commontools/statementcomposer.cxx
@@ -166,7 +166,7 @@ namespace dbtools
                         xComposer->setElementaryQuery( sStatement );
 
                         // the sort order
-                        static constexpr OUStringLiteral sPropOrder( u"Order" 
);
+                        static constexpr OUString sPropOrder( u"Order"_ustr );
                         if ( ::comphelper::hasProperty( sPropOrder, xQuery ) )
                         {
                             OUString sOrder;
@@ -176,7 +176,7 @@ namespace dbtools
 
                         // the filter
                         bool bApplyFilter = true;
-                        static constexpr OUStringLiteral sPropApply( 
u"ApplyFilter" );
+                        static constexpr OUString sPropApply( 
u"ApplyFilter"_ustr );
                         if ( ::comphelper::hasProperty( sPropApply, xQuery ) )
                         {
                             OSL_VERIFY( xQuery->getPropertyValue( sPropApply ) 
>>= bApplyFilter );
diff --git a/connectivity/source/cpool/ZConnectionPool.cxx 
b/connectivity/source/cpool/ZConnectionPool.cxx
index 009de85b3f4b..7db4a8f16f3c 100644
--- a/connectivity/source/cpool/ZConnectionPool.cxx
+++ b/connectivity/source/cpool/ZConnectionPool.cxx
@@ -41,7 +41,7 @@ void SAL_CALL OPoolTimer::onShot()
     m_pPool->invalidatePooledConnections();
 }
 
-constexpr OUStringLiteral TIMEOUT_NODENAME = u"Timeout";
+constexpr OUString TIMEOUT_NODENAME = u"Timeout"_ustr;
 
 OConnectionPool::OConnectionPool(const Reference< XDriver >& _xDriver,
                                  const Reference< XInterface >& _xDriverNode,
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;
diff --git a/connectivity/source/parse/sqliterator.cxx 
b/connectivity/source/parse/sqliterator.cxx
index 683391f66f6a..a89d631e256b 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -266,7 +266,7 @@ namespace
     {
         OUString sComposedName;
 
-        static constexpr OUStringLiteral s_sWildcard = u"%" ;
+        static constexpr OUString s_sWildcard = u"%"_ustr ;
 
         // we want all catalogues, all schemas, all tables
         Sequence< OUString > sTableTypes { "VIEW", "TABLE", s_sWildcard }; // 
this last one just to be sure to include anything else...
diff --git a/connectivity/source/parse/sqlnode.cxx 
b/connectivity/source/parse/sqlnode.cxx
index 7e01770d386d..71a9105aac6e 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -2458,7 +2458,7 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, 
const SQLParseNodeParamet
         case SQLNodeType::ApproxNum:
             {
                 OUString aTmp = m_aNodeValue;
-                static constexpr OUStringLiteral strPoint(u".");
+                static constexpr OUString strPoint(u"."_ustr);
                 if (rParam.bInternational && rParam.bPredicate && 
rParam.sDecSep != strPoint)
                     aTmp = aTmp.replaceAll(strPoint, rParam.sDecSep);
 

Reply via email to