diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 19:05:10 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 20:44:36 +0200 |
commit | 49cee95eb4efddefde9caab33d0a639e83f05202 (patch) | |
tree | ff85637144cacf22b18e29a62fd854097aa68806 /svtools | |
parent | 27f3618a600006e59d6b45e22f0eb46457172a52 (diff) |
xtend loplugin:stringviewparam to starts/endsWith: svtools
Change-Id: I5364107766dd77963a9a34468754c4cbcc34c8d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122480
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/imageresourceaccess.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/svtools/source/misc/imageresourceaccess.cxx b/svtools/source/misc/imageresourceaccess.cxx index 24db4ae50ac3..fc12981a3460 100644 --- a/svtools/source/misc/imageresourceaccess.cxx +++ b/svtools/source/misc/imageresourceaccess.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/graphic/GraphicProvider.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/io/XStream.hpp> +#include <o3tl/string_view.hxx> #include <osl/diagnose.h> #include <tools/stream.hxx> #include <tools/diagnose_ex.h> @@ -106,12 +107,12 @@ sal_Int64 SAL_CALL StreamSupplier::getLength() return m_xSeekable->getLength(); } -bool isSupportedURL(OUString const & rURL) +bool isSupportedURL(std::u16string_view rURL) { - return rURL.startsWith("private:resource/") - || rURL.startsWith("private:graphicrepository/") - || rURL.startsWith("private:standardimage/") - || rURL.startsWith("vnd.sun.star.extension://"); + return o3tl::starts_with(rURL, u"private:resource/") + || o3tl::starts_with(rURL, u"private:graphicrepository/") + || o3tl::starts_with(rURL, u"private:standardimage/") + || o3tl::starts_with(rURL, u"vnd.sun.star.extension://"); } std::unique_ptr<SvStream> getImageStream(uno::Reference<uno::XComponentContext> const & rxContext, OUString const & rImageResourceURL) |