diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-08-26 15:49:08 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-08-26 18:53:16 +0200 |
commit | ff8a9eebfa1b3d8975b735d26bcd5c721b7995ea (patch) | |
tree | b6597acb27cf6975dabc39d7ee3624e49f6e2efd /sfx2 | |
parent | bc91b92b5ee0b2c25b239734fb1fd7409da932ff (diff) |
Better use std::string_view than OUStringLiteral here
Change-Id: Id62324beaa108d9421711989ee4fa09e4c7798ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101407
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index bd559af59fde..4b71403785a4 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -51,7 +51,6 @@ #include <unotools/pathoptions.hxx> #include <rtl/byteseq.hxx> #include <rtl/ustring.hxx> -#include <o3tl/safeint.hxx> #include <officecfg/Office/Common.hxx> #include <osl/process.h> #include <osl/file.hxx> @@ -781,12 +780,12 @@ bool rewriteFlatpakHelpRootUrl(OUString * helpRootUrl) { std::string_view const line( reinterpret_cast<char const *>(bytes.getConstArray()), bytes.getLength()); if (instance) { - static constexpr auto keyPath = OUStringLiteral("app-path="); - static constexpr auto keyExtensions = OUStringLiteral("app-extensions="); - if (!havePath && line.length() >= o3tl::make_unsigned(keyPath.size) - && line.substr(0, keyPath.size) == keyPath.data) + static constexpr auto keyPath = std::string_view("app-path="); + static constexpr auto keyExtensions = std::string_view("app-extensions="); + if (!havePath && line.length() >= keyPath.size() + && line.substr(0, keyPath.size()) == keyPath.data()) { - auto const value = line.substr(keyPath.size); + auto const value = line.substr(keyPath.size()); if (!rtl_convertStringToUString( &path.pData, value.data(), value.length(), osl_getThreadTextEncoding(), @@ -801,10 +800,10 @@ bool rewriteFlatpakHelpRootUrl(OUString * helpRootUrl) { throw Failure(); } havePath = true; - } else if (!haveExtensions && line.length() >= o3tl::make_unsigned(keyExtensions.size) - && line.substr(0, keyExtensions.size) == keyExtensions.data) + } else if (!haveExtensions && line.length() >= keyExtensions.size() + && line.substr(0, keyExtensions.size()) == keyExtensions.data()) { - auto const value = line.substr(keyExtensions.size); + auto const value = line.substr(keyExtensions.size()); if (!rtl_convertStringToUString( &extensions.pData, value.data(), value.length(), osl_getThreadTextEncoding(), |