summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-11 17:44:34 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-11 21:25:10 +0100
commit35e471bb4d1388cf5afcdcee214cf5111edf44e3 (patch)
treebb78f4f13f131f0cb206a9707cc3cfc495a3876a /connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
parent0c06e77c122f10a1842bc908bd6e25b1110ddbd2 (diff)
Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx')
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index 7afd4bed54f9..a47758f31a5d 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -822,7 +822,7 @@ void ODatabaseMetaDataResultSet::openTypeInfo()
}
void ODatabaseMetaDataResultSet::openTables(const Any& catalog, const OUString& schemaPattern,
- const OUString& tableNamePattern,
+ std::u16string_view tableNamePattern,
const Sequence< OUString >& types )
{
OString aPKQ,aPKO,aPKN,aCOL;
@@ -919,7 +919,8 @@ void ODatabaseMetaDataResultSet::openSchemas()
}
void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, const OUString& schema,
- const OUString& table, const OUString& columnNamePattern )
+ std::u16string_view table,
+ std::u16string_view columnNamePattern )
{
const OUString *pSchemaPat = nullptr;
@@ -953,7 +954,7 @@ void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, cons
}
void ODatabaseMetaDataResultSet::openColumns( const Any& catalog, const OUString& schemaPattern,
- const OUString& tableNamePattern, const OUString& columnNamePattern )
+ std::u16string_view tableNamePattern, std::u16string_view columnNamePattern )
{
const OUString *pSchemaPat = nullptr;
@@ -1020,7 +1021,7 @@ void ODatabaseMetaDataResultSet::openColumns( const Any& catalog,
}
void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog, const OUString& schemaPattern,
- const OUString& procedureNamePattern,const OUString& columnNamePattern )
+ std::u16string_view procedureNamePattern,std::u16string_view columnNamePattern )
{
const OUString *pSchemaPat = nullptr;
@@ -1053,7 +1054,7 @@ void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog,
}
void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const OUString& schemaPattern,
- const OUString& procedureNamePattern)
+ std::u16string_view procedureNamePattern)
{
const OUString *pSchemaPat = nullptr;
@@ -1083,11 +1084,11 @@ void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const OUStri
}
void ODatabaseMetaDataResultSet::openSpecialColumns(bool _bRowVer,const Any& catalog, const OUString& schema,
- const OUString& table,sal_Int32 scope, bool nullable )
+ std::u16string_view table,sal_Int32 scope, bool nullable )
{
// Some ODBC drivers really don't like getting an empty string as tableName
// E.g. psqlodbc up to at least version 09.01.0100 segfaults
- if (table.isEmpty())
+ if (table.empty())
{
const char errMsg[] = "ODBC: Trying to get special columns of empty table name";
const char SQLState[] = "HY009";
@@ -1123,13 +1124,13 @@ void ODatabaseMetaDataResultSet::openSpecialColumns(bool _bRowVer,const Any& cat
}
void ODatabaseMetaDataResultSet::openVersionColumns(const Any& catalog, const OUString& schema,
- const OUString& table)
+ std::u16string_view table)
{
openSpecialColumns(true,catalog,schema,table,SQL_SCOPE_TRANSACTION,false);
}
void ODatabaseMetaDataResultSet::openBestRowIdentifier( const Any& catalog, const OUString& schema,
- const OUString& table,sal_Int32 scope,bool nullable )
+ std::u16string_view table,sal_Int32 scope,bool nullable )
{
openSpecialColumns(false,catalog,schema,table,scope,nullable);
}
@@ -1198,7 +1199,7 @@ void ODatabaseMetaDataResultSet::openExportedKeys(const Any& catalog, const OUSt
}
void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUString& schema,
- const OUString& table)
+ std::u16string_view table)
{
const OUString *pSchemaPat = nullptr;
@@ -1228,7 +1229,7 @@ void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUStr
}
void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const OUString& schemaPattern,
- const OUString& tableNamePattern)
+ std::u16string_view tableNamePattern)
{
const OUString *pSchemaPat = nullptr;
@@ -1257,7 +1258,7 @@ void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const O
}
void ODatabaseMetaDataResultSet::openIndexInfo( const Any& catalog, const OUString& schema,
- const OUString& table, bool unique, bool approximate )
+ std::u16string_view table, bool unique, bool approximate )
{
const OUString *pSchemaPat = nullptr;