diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-11 17:44:34 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-11 21:25:10 +0100 |
commit | 35e471bb4d1388cf5afcdcee214cf5111edf44e3 (patch) | |
tree | bb78f4f13f131f0cb206a9707cc3cfc495a3876a /connectivity/source/inc/odbc | |
parent | 0c06e77c122f10a1842bc908bd6e25b1110ddbd2 (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/inc/odbc')
-rw-r--r-- | connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx | 23 | ||||
-rw-r--r-- | connectivity/source/inc/odbc/OStatement.hxx | 3 |
2 files changed, 14 insertions, 12 deletions
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx index 41f3f756cf74..8f10f3c10ad4 100644 --- a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx +++ b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx @@ -39,6 +39,7 @@ #include <odbc/ODatabaseMetaData.hxx> #include <odbc/odbcbasedllapi.hxx> #include <memory> +#include <string_view> namespace connectivity::odbc { @@ -199,31 +200,31 @@ namespace connectivity::odbc /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openTables(const css::uno::Any& catalog, const OUString& schemaPattern, - const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ); + std::u16string_view tableNamePattern, const css::uno::Sequence< OUString >& types ); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openColumnPrivileges( const css::uno::Any& catalog, const OUString& schema, - const OUString& table, const OUString& columnNamePattern ); + std::u16string_view table, std::u16string_view columnNamePattern ); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openColumns( const css::uno::Any& catalog, const OUString& schemaPattern, - const OUString& tableNamePattern, const OUString& columnNamePattern ); + std::u16string_view tableNamePattern, std::u16string_view columnNamePattern ); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern, - const OUString& procedureNamePattern,const OUString& columnNamePattern ); + std::u16string_view procedureNamePattern,std::u16string_view columnNamePattern ); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openProcedures( const css::uno::Any& catalog, const OUString& schemaPattern, - const OUString& procedureNamePattern); + std::u16string_view procedureNamePattern); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openVersionColumns(const css::uno::Any& catalog, const OUString& schema, - const OUString& table); + std::u16string_view table); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openBestRowIdentifier( const css::uno::Any& catalog, const OUString& schema, - const OUString& table,sal_Int32 scope, bool nullable ); + std::u16string_view table,sal_Int32 scope, bool nullable ); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openForeignKeys( const css::uno::Any& catalog, const OUString* schema,const OUString* table, @@ -236,19 +237,19 @@ namespace connectivity::odbc void openImportedKeys(const css::uno::Any& catalog, const OUString& schema,const OUString& table); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException - void openPrimaryKeys(const css::uno::Any& catalog, const OUString& schema,const OUString& table); + void openPrimaryKeys(const css::uno::Any& catalog, const OUString& schema,std::u16string_view table); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openTablePrivileges(const css::uno::Any& catalog, const OUString& schemaPattern, - const OUString& tableNamePattern); + std::u16string_view tableNamePattern); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openSpecialColumns(bool _bRowVer,const css::uno::Any& catalog, const OUString& schema, - const OUString& table,sal_Int32 scope, bool nullable ); + std::u16string_view table,sal_Int32 scope, bool nullable ); /// @throws css::sdbc::SQLException /// @throws css::uno::RuntimeException void openIndexInfo( const css::uno::Any& catalog, const OUString& schema, - const OUString& table,bool unique,bool approximate ); + std::u16string_view table,bool unique,bool approximate ); protected: using OPropertySetHelper::getFastPropertyValue; diff --git a/connectivity/source/inc/odbc/OStatement.hxx b/connectivity/source/inc/odbc/OStatement.hxx index 54b28cac825e..1b7b3a569434 100644 --- a/connectivity/source/inc/odbc/OStatement.hxx +++ b/connectivity/source/inc/odbc/OStatement.hxx @@ -35,6 +35,7 @@ #include <odbc/OFunctions.hxx> #include <odbc/OConnection.hxx> #include <odbc/odbcbasedllapi.hxx> +#include <string_view> #include <vector> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -91,7 +92,7 @@ namespace connectivity::odbc void setMaxRows(sal_Int64 _par0) ; void setFetchDirection(sal_Int32 _par0) ; void setFetchSize(sal_Int32 _par0) ; - void setCursorName(const OUString &_par0); + void setCursorName(std::u16string_view _par0); void setEscapeProcessing( const bool _bEscapeProc ); template < typename T, SQLINTEGER BufferLength > SQLRETURN setStmtOption (SQLINTEGER fOption, T value) const; |