summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-05-13 11:57:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-05-14 13:11:50 +0200
commitaf16aa625682b649e8843237652b9246d519cbae (patch)
tree2ea597c328318d6b75761b71af313bef02b5ad77 /sw/source/filter
parentf40cbba63f13e7081fc5901769651fd4d43ea34d (diff)
Improve loplugin:stringview
Issue the "instead of O[U]String, pass [u16]string_view" diagnostic also for operator call arguments. (The "rather than copy, pass subView()" diagnostic is already part of handleSubExprThatCouldBeView, so no need to repeat it explicitly for operator call arguments.) (And many call sites don't even require an explicit [u16]string_view, esp. with the recent ad48b2b02f83eed41fb1eb8d16de7e804156fcf1 "Optimized OString operator += overloads". Just some test code in sal/qa/ that explicitly tests the O[U]String functionality had to be excluded.) Change-Id: I8d55ba5a7fa16a563f5ffe43d245125c88c793bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115589 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/html/htmlatr.cxx2
-rw-r--r--sw/source/filter/html/htmlforw.cxx2
-rw-r--r--sw/source/filter/html/htmlnumwriter.cxx6
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
4 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index a15cd96519cb..bff41ee81471 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -3130,7 +3130,7 @@ static Writer& OutHTML_SwTextCharFormat( Writer& rWrt, const SfxPoolItem& rHt )
if( !pFormatInfo->aToken.isEmpty() )
sOut += pFormatInfo->aToken;
else
- sOut += OString(OOO_STRING_SVTOOLS_HTML_span);
+ sOut += OOO_STRING_SVTOOLS_HTML_span;
if( rHTMLWrt.m_bCfgOutStyles &&
(!pFormatInfo->aClass.isEmpty() || pFormatInfo->bScriptDependent) )
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index fabccbb8a2e0..38c0418060e1 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -167,7 +167,7 @@ static void lcl_html_outEvents( SvStream& rStrm,
OString sOut = " ";
if( pOpt && (EXTENDED_STYPE != eScriptType ||
rDesc.AddListenerParam.isEmpty()) )
- sOut += OString(pOpt);
+ sOut += pOpt;
else
{
sOut += OOO_STRING_SVTOOLS_HTML_O_sdevent +
diff --git a/sw/source/filter/html/htmlnumwriter.cxx b/sw/source/filter/html/htmlnumwriter.cxx
index ddfedd760923..2fa1e6aa3f6b 100644
--- a/sw/source/filter/html/htmlnumwriter.cxx
+++ b/sw/source/filter/html/htmlnumwriter.cxx
@@ -213,7 +213,7 @@ Writer& OutHTML_NumberBulletListStart( SwHTMLWriter& rWrt,
if( SVX_NUM_CHAR_SPECIAL == eType )
{
// ordered list: <OL>
- sOut += OString(OOO_STRING_SVTOOLS_HTML_unorderlist);
+ sOut += OOO_STRING_SVTOOLS_HTML_unorderlist;
// determine the type by the bullet character
const char *pStr = nullptr;
@@ -238,7 +238,7 @@ Writer& OutHTML_NumberBulletListStart( SwHTMLWriter& rWrt,
else if( SVX_NUM_BITMAP == eType )
{
// Unordered list: <UL>
- sOut += OString(OOO_STRING_SVTOOLS_HTML_unorderlist);
+ sOut += OOO_STRING_SVTOOLS_HTML_unorderlist;
rWrt.Strm().WriteOString( sOut );
OutHTML_BulletImage( rWrt,
nullptr,
@@ -248,7 +248,7 @@ Writer& OutHTML_NumberBulletListStart( SwHTMLWriter& rWrt,
else
{
// Ordered list: <OL>
- sOut += OString(OOO_STRING_SVTOOLS_HTML_orderlist);
+ sOut += OOO_STRING_SVTOOLS_HTML_orderlist;
// determine the type by the format
char cType = 0;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3c6b2616e13a..f0775d63f6b8 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2722,7 +2722,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties()
{
const char* pVal = nullptr;
m_pColorAttrList->getAsChar(FSNS(XML_w, XML_val), pVal);
- if (OString("auto") != pVal)
+ if (std::string_view("auto") != pVal)
{
m_pSerializer->startElementNS(XML_w14, XML_textFill);
m_pSerializer->startElementNS(XML_w14, XML_solidFill);