loplugin:stringadd convert chained append to +

which can use the more efficient *StringConcat

Also fix a crash in stringview plugin which
started happening while I working on this.

Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2021-04-23 16:07:32 +02:00
parent 99482297c7
commit c7c6f0af6c
115 changed files with 520 additions and 576 deletions

View File

@@ -217,6 +217,10 @@ void f1(OUString s, OUString t, int i, const char* pChar)
// no warning expected
OUString c;
c = c + OUString(pChar, strlen(pChar), RTL_TEXTENCODING_UTF8);
OUStringBuffer buf;
// expected-error@+1 {{chained append, rather use single append call and + operator [loplugin:stringadd]}}
buf.append(" ").append(b);
}
void f2(char ch)
{