dbaccess/source/core/misc/dsntypes.cxx | 5 +++-- dbaccess/source/inc/dsntypes.hxx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
New commits: commit 2e088bf71767849e99070d576fb300c244bd6475 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Sep 22 23:28:10 2021 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Thu Sep 23 08:50:50 2021 +0200 Extend loplugin:stringviewparam to starts/endsWith: dbaccess Change-Id: I30e48b7ebf3795659638d7a2aedfb58e325cea37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122501 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx index aca8aacb560b..2758b0a6ed6a 100644 --- a/dbaccess/source/core/misc/dsntypes.cxx +++ b/dbaccess/source/core/misc/dsntypes.cxx @@ -19,6 +19,7 @@ #include <dsntypes.hxx> #include <unotools/confignode.hxx> +#include <o3tl/string_view.hxx> #include <osl/diagnose.h> #include <tools/wldcrd.hxx> #include <osl/file.hxx> @@ -278,9 +279,9 @@ Sequence<PropertyValue> ODsnTypeCollection::getDefaultDBSettings( std::u16string return aProperties.getPropertyValues(); } -bool ODsnTypeCollection::isEmbeddedDatabase( const OUString& _sURL ) +bool ODsnTypeCollection::isEmbeddedDatabase( std::u16string_view _sURL ) { - return _sURL.startsWith( "sdbc:embedded:" ); + return o3tl::starts_with( _sURL, u"sdbc:embedded:" ); } OUString ODsnTypeCollection::getEmbeddedDatabase() diff --git a/dbaccess/source/inc/dsntypes.hxx b/dbaccess/source/inc/dsntypes.hxx index b7642c66f20c..871db0a1fe27 100644 --- a/dbaccess/source/inc/dsntypes.hxx +++ b/dbaccess/source/inc/dsntypes.hxx @@ -158,7 +158,7 @@ public: bool isConnectionUrlRequired(std::u16string_view _sURL) const; /// checks if the given data source type embeds its data into the database document - static bool isEmbeddedDatabase( const OUString& _sURL ); + static bool isEmbeddedDatabase( std::u16string_view _sURL ); static OUString getEmbeddedDatabase();