summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/postgresql
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-28 17:56:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-29 16:42:33 +0100
commit042033f1e6da22616cb76c8d950c20c9efecbad5 (patch)
tree26b3f1f42d067506f44550b410f3fb9640616a5b /connectivity/source/drivers/postgresql
parentccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff)
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity/source/drivers/postgresql')
-rw-r--r--connectivity/source/drivers/postgresql/pq_databasemetadata.cxx8
-rw-r--r--connectivity/source/drivers/postgresql/pq_statement.cxx2
-rw-r--r--connectivity/source/drivers/postgresql/pq_statement.hxx7
-rw-r--r--connectivity/source/drivers/postgresql/pq_tools.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_tools.hxx2
5 files changed, 15 insertions, 8 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
index 22130ed7c6d8..07e0e85815c1 100644
--- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
+++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
@@ -65,6 +65,8 @@
************************************************************************/
#include <algorithm>
+#include <string_view>
+
#include <sal/log.hxx>
#include "pq_databasemetadata.hxx"
#include "pq_driver.hxx"
@@ -2162,12 +2164,12 @@ namespace
return ret;
}
- OUString construct_full_typename(const OUString &ns, const OUString &tn)
+ OUString construct_full_typename(std::u16string_view ns, const OUString &tn)
{
- if(ns.isEmpty() || ns == "pg_catalog")
+ if(ns.empty() || ns == u"pg_catalog")
return tn;
else
- return ns + "." + tn;
+ return OUString::Concat(ns) + "." + tn;
}
void pgTypeInfo2ResultSet(
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx
index ff3b05dc8190..946d25b0c91e 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -210,7 +210,7 @@ void Statement::close( )
}
void Statement::raiseSQLException(
- const OUString & sql, const char * errorMsg )
+ std::u16string_view sql, const char * errorMsg )
{
OUString error = "pq_driver: "
+ OUString( errorMsg, strlen(errorMsg), ConnectionSettings::encoding )
diff --git a/connectivity/source/drivers/postgresql/pq_statement.hxx b/connectivity/source/drivers/postgresql/pq_statement.hxx
index 8e93c07b7125..6f9fb3bb1ecc 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.hxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.hxx
@@ -36,6 +36,11 @@
#ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_STATEMENT_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_STATEMENT_HXX
+
+#include <sal/config.h>
+
+#include <string_view>
+
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/component.hxx>
@@ -161,7 +166,7 @@ private:
/// @throws css::uno::RuntimeException
void checkClosed();
/// @throws css::sdbc::SQLException
- void raiseSQLException( const OUString & sql, const char * errorMsg );
+ void raiseSQLException( std::u16string_view sql, const char * errorMsg );
};
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx
index 543f042f921e..1bb089a5407a 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -87,9 +87,9 @@ using com::sun::star::container::XEnumerationAccess;
namespace pq_sdbc_driver
{
-OUString concatQualified( const OUString & a, const OUString &b)
+OUString concatQualified( std::u16string_view a, std::u16string_view b)
{
- return a + "." + b;
+ return OUString::Concat(a) + "." + b;
}
static OString iOUStringToOString( std::u16string_view str, ConnectionSettings const *settings) {
diff --git a/connectivity/source/drivers/postgresql/pq_tools.hxx b/connectivity/source/drivers/postgresql/pq_tools.hxx
index 18b105870705..6d11e9b40425 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.hxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.hxx
@@ -63,7 +63,7 @@ namespace pq_sdbc_driver
{
bool isWhitespace( sal_Unicode c );
-OUString concatQualified( const OUString & a, const OUString &b);
+OUString concatQualified( std::u16string_view a, std::u16string_view b);
OString OUStringToOString( std::u16string_view str, ConnectionSettings const *settings);