New loplugin:getstr

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 14 October 2019 13:48 EDT

...to find matches of

... << s.getStr()

(for the rtl string classes) that can be written as just

... << s

Some notes:

- The OUStringToOString(..., RTL_TEXTENCODING_UTF8) is left explicit in desktop/source/app/crashreport.cxx (even though that would also be done internally by the "<< OUString" operator) to clarify that these values are written out as UTF-8 (and not as what that operator << happens to use, which just also happens to be UTF-8).

- OUSTRING_TO_CSTR (include/oox/helper/helper.hxx) is no longer used now.

- Just don't bother to use osl_getThreadTextEncoding() in the SAL_WARN in lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx.

- The toUtf8() in the SAL_DEBUG in pyuno/source/module/pyuno_module.cxx can just go, too.

Change-Id: I4602f0379ef816bff310f1e51b57c56b7e3f0136 Reviewed-on: https://gerrit.libreoffice.org/80762

77d083f2cbe4 New loplugin:getstr
compilerplugins/clang/check.cxx | 16 ++
compilerplugins/clang/check.hxx | 10 +-
compilerplugins/clang/compat.hxx | 13 ++
compilerplugins/clang/getstr.cxx | 172 +++++++++++++++++++++
compilerplugins/clang/test/getstr.cxx | 41 +++++
desktop/source/app/crashreport.cxx | 4 +-
include/oox/helper/helper.hxx | 4 -
include/rtl/ustring.hxx | 2 +-
.../source/hyphenator/hyphen/hyphenimp.cxx | 2 +-
oox/source/ppt/commonbehaviorcontext.cxx | 2 +-
pyuno/source/module/pyuno_module.cxx | 2 +-
sal/osl/unx/uunxapi.cxx | 8 +-
solenv/CompilerTest_compilerplugins_clang.mk | 1 +
vcl/source/gdi/pdfwriter_impl.cxx | 4 +-
14 files changed, 264 insertions(+), 17 deletions(-)

Upstream: cgit.freedesktop.org


  • Share