summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-11 22:24:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-12 12:42:15 +0200
commitcbaf1fbaa6e707d939f815eda360fad68a492aca (patch)
tree20b3dfeac257130afb01572b2c117b7840d07007 /sw/source/filter
parentf751417b77e6573a0c639778e76ec943449f4573 (diff)
loplugin:stringview more o3tl conversion
look for call sequences that can use string_view and the new o3tl functions in o3tl/string_view.hxx Also add a few more wrappers to said #include file Change-Id: I05d8752cc67a7b55b0b57e8eed803bd06bfcd9ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/html/htmlfldw.cxx3
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx2
3 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index 91fa6120eae2..222ac3e96589 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -22,6 +22,7 @@
#include <svtools/htmlkywd.hxx>
#include <svtools/htmlout.hxx>
#include <osl/diagnose.h>
+#include <o3tl/string_view.hxx>
#include <fmtfld.hxx>
#include <doc.hxx>
#include <breakit.hxx>
@@ -466,7 +467,7 @@ Writer& OutHTML_SwFormatField( Writer& rWrt, const SfxPoolItem& rHt )
bool bWritten = false;
if( (rComment.getLength() >= 6 && rComment.startsWith("<") && rComment.endsWith(">") &&
- rComment.copy( 1, 4 ).equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_meta) ) ||
+ o3tl::equalsIgnoreAsciiCase(rComment.subView( 1, 4 ), u"" OOO_STRING_SVTOOLS_HTML_meta) ) ||
(rComment.getLength() >= 7 &&
rComment.startsWith( "<!--" ) &&
rComment.endsWith( "-->" )) )
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 44063c816d9e..032c302460c6 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1816,7 +1816,7 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType,
break;
case ww::eCITATION:
eFieldType = ww::eQUOTE;
- assert(rFieldCmd.trim().startsWith("CITATION"));
+ assert(o3tl::starts_with(o3tl::trim(rFieldCmd), u"CITATION"));
sFieldCmd = rFieldCmd.replaceFirst(FieldString(ww::eCITATION),
FieldString(ww::eQUOTE));
break;
@@ -3060,7 +3060,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField )
// FIXME: DomainMapper_Impl::CloseFieldCommand() stuffs fully formed
// field instructions in here, but if the field doesn't originate
// from those filters it won't have that
- if (!sRet.trim().startsWith("CITATION"))
+ if (!o3tl::starts_with(o3tl::trim(sRet), u"CITATION"))
{
sRet = FieldString(ww::eCITATION) + " \"" + sRet + "\"";
}
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index cecad8f6d370..fd19f6c11630 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -631,7 +631,7 @@ sal_uInt16 SwWW8ImplReader::End_Field()
}
default:
OUString aCode = m_aFieldStack.back().GetBookmarkCode();
- if (!aCode.isEmpty() && !aCode.trim().startsWith("SHAPE"))
+ if (!aCode.isEmpty() && !o3tl::starts_with(o3tl::trim(aCode), u"SHAPE"))
{
// Unhandled field with stored code
SwPosition aEndPos = *m_pPaM->GetPoint();