From 3d236177be255b2027a997bfc12fe0833ca9a2f7 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 11 Oct 2022 10:23:28 +0300 Subject: Deduplicate O(U)StringConcatenation And use an overloaded helper function with a better (?) unified name to show that the result is not an O(U)String. Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- connectivity/source/drivers/firebird/PreparedStatement.cxx | 2 +- connectivity/source/drivers/firebird/Util.cxx | 2 +- connectivity/source/drivers/mysql_jdbc/YTables.cxx | 2 +- connectivity/source/parse/sqlnode.cxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index fe30054ebda3..608d05c274e0 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -570,7 +570,7 @@ void OPreparedStatement::openBlobForWriting(isc_blob_handle& rBlobHandle, ISC_QU if (aErr) { evaluateStatusVector(m_statusVector, - OUStringConcatenation("setBlob failed on " + m_sSqlStatement), + Concat2View("setBlob failed on " + m_sSqlStatement), *this); assert(false); } diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx index c015f2d47d14..a792e032939c 100644 --- a/connectivity/source/drivers/firebird/Util.cxx +++ b/connectivity/source/drivers/firebird/Util.cxx @@ -420,7 +420,7 @@ OUString firebird::escapeWith( const OUString& sText, const char aKey, const cha aIndex = sRet.indexOf(aKey, aIndex); if ( aIndex <= 0 || aIndex >= sRet.getLength()) break; - sRet = sRet.replaceAt(aIndex, 1, rtl::OUStringConcatenation(OUStringChar(aEscapeChar) + OUStringChar(aKey)) ); + sRet = sRet.replaceAt(aIndex, 1, rtl::Concat2View(OUStringChar(aEscapeChar) + OUStringChar(aKey)) ); aIndex += 2; } diff --git a/connectivity/source/drivers/mysql_jdbc/YTables.cxx b/connectivity/source/drivers/mysql_jdbc/YTables.cxx index c28f8e44ef76..0460053192c0 100644 --- a/connectivity/source/drivers/mysql_jdbc/YTables.cxx +++ b/connectivity/source/drivers/mysql_jdbc/YTables.cxx @@ -153,7 +153,7 @@ OUString OTables::adjustSQL(const OUString& _sSql) sal_Int32 nPos = nIndex + strlen(s_sUNSIGNED); OUString sNewUnsigned(sSQL.copy(nPos, nParen - nPos + 1)); sSQL = sSQL.replaceAt(nIndex, strlen(s_sUNSIGNED) + sNewUnsigned.getLength(), - rtl::OUStringConcatenation(sNewUnsigned + s_sUNSIGNED)); + rtl::Concat2View(sNewUnsigned + s_sUNSIGNED)); nIndex = sSQL.indexOf(s_sUNSIGNED, nIndex + strlen(s_sUNSIGNED) + sNewUnsigned.getLength()); } return sSQL; diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 44e0c2bba2a9..d98e8cc80064 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -362,7 +362,7 @@ bool OSQLParseNode::parseNodeToExecutableStatement( OUString& _out_rString, cons { constexpr char SELECT_KEYWORD[] = "SELECT"; sBuffer.insert(sBuffer.indexOf(SELECT_KEYWORD) + strlen(SELECT_KEYWORD), - OUStringConcatenation(" FIRST " + sLimitValue)); + Concat2View(" FIRST " + sLimitValue)); } _out_rString = sBuffer.makeStringAndClear(); -- cgit