diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-11-30 17:36:17 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-11-30 19:38:40 +0100 |
commit | ae4efac7010c0596a3b03792ce8db6c4c49afffb (patch) | |
tree | ade68a98b884010f4e3aa04440c67036dd817521 /connectivity/source/drivers/postgresql/pq_xkeys.cxx | |
parent | d7e70e8dffa1945e10d977c5d9d99c754fdb0568 (diff) |
loplugin:stringviewparam (Library_postgresql-sdbc-impl)
Change-Id: I9f37f6abfe7d923f8ca0a2d4fd5b699d7034f9f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106901
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity/source/drivers/postgresql/pq_xkeys.cxx')
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_xkeys.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_xkeys.cxx b/connectivity/source/drivers/postgresql/pq_xkeys.cxx index 2297b557e6af..969ce4dd398c 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeys.cxx +++ b/connectivity/source/drivers/postgresql/pq_xkeys.cxx @@ -34,6 +34,10 @@ * ************************************************************************/ +#include <sal/config.h> + +#include <string_view> + #include <sal/log.hxx> #include <rtl/ustrbuf.hxx> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> @@ -83,26 +87,26 @@ Keys::Keys( Keys::~Keys() {} -static sal_Int32 string2keytype( const OUString &type ) +static sal_Int32 string2keytype( std::u16string_view type ) { sal_Int32 ret = css::sdbcx::KeyType::UNIQUE; - if ( type == "p" ) + if ( type == u"p" ) ret = css::sdbcx::KeyType::PRIMARY; - else if ( type == "f" ) + else if ( type == u"f" ) ret = css::sdbcx::KeyType::FOREIGN; return ret; } -static sal_Int32 string2keyrule( const OUString & rule ) +static sal_Int32 string2keyrule( std::u16string_view rule ) { sal_Int32 ret = css::sdbc::KeyRule::NO_ACTION; - if( rule == "r" ) + if( rule == u"r" ) ret = css::sdbc::KeyRule::RESTRICT; - else if( rule == "c" ) + else if( rule == u"c" ) ret = css::sdbc::KeyRule::CASCADE; - else if( rule == "n" ) + else if( rule == u"n" ) ret = css::sdbc::KeyRule::SET_NULL; - else if( rule == "d" ) + else if( rule == u"d" ) ret = css::sdbc::KeyRule::SET_DEFAULT; return ret; } |