diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 17:18:06 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 19:59:56 +0200 |
commit | d1e14030e81ff2bbe4bcb3706a9f21672a368074 (patch) | |
tree | 713e59ead818f81e599c9757dd87468326795173 /sw/source/filter/ww8/ww8par5.cxx | |
parent | 743e6aa211ccd631c811fb57e2050a5b4e8ffbba (diff) |
Extend loplugin:stringviewparam to starts/endsWith: sw
Change-Id: I7271bba6c61a56be15335c81d8950a29a07eb6d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122473
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source/filter/ww8/ww8par5.cxx')
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index b9cc9d24c700..19991a2ebc18 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -77,11 +77,13 @@ #include "ww8par.hxx" #include "writerhelper.hxx" #include <o3tl/safeint.hxx> +#include <o3tl/string_view.hxx> #include <unotools/fltrcfg.hxx> #include <xmloff/odffields.hxx> #include <osl/diagnose.h> #include <algorithm> +#include <string_view> #define MAX_FIELDLEN 64000 @@ -98,9 +100,9 @@ using namespace nsSwDocInfoSubType; namespace { // #120879# - helper method to identify a bookmark name to match the internal TOC bookmark naming convention - bool IsTOCBookmarkName(const OUString& rName) + bool IsTOCBookmarkName(std::u16string_view rName) { - return rName.startsWith("_Toc") || rName.startsWith(OUString(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()+"_Toc")); + return o3tl::starts_with(rName, u"_Toc") || o3tl::starts_with(rName, OUString(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()+"_Toc")); } OUString EnsureTOCBookmarkName(const OUString& rName) |