diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-12 12:43:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-13 08:38:53 +0200 |
commit | fdfd517a6f75e394ddcb1e195decbfed33ba56b9 (patch) | |
tree | e3bff14e5531affcd908415b4e85d7ceac4aa1fd /svl | |
parent | e568c9dca8b93b96a8a130a8fb6f1bba1a33d6ea (diff) |
loplugin:stringviewparam whitelist some more functions
for which we have o3tl:: equivalents
Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/misc/msodocumentlockfile.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/svl/source/misc/msodocumentlockfile.cxx b/svl/source/misc/msodocumentlockfile.cxx index c4709840102f..b240e9c9cbd9 100644 --- a/svl/source/misc/msodocumentlockfile.cxx +++ b/svl/source/misc/msodocumentlockfile.cxx @@ -11,6 +11,7 @@ #include <algorithm> #include <ucbhelper/content.hxx> #include <comphelper/processfactory.hxx> +#include <o3tl/string_view.hxx> #include <com/sun/star/io/IOException.hpp> #include <com/sun/star/io/XOutputStream.hpp> @@ -21,22 +22,23 @@ namespace svt { namespace { -bool isWordFormat(const OUString& sExt) +bool isWordFormat(std::u16string_view sExt) { - return sExt.equalsIgnoreAsciiCase("DOC") || sExt.equalsIgnoreAsciiCase("DOCX") - || sExt.equalsIgnoreAsciiCase("RTF") || sExt.equalsIgnoreAsciiCase("ODT"); + return o3tl::equalsIgnoreAsciiCase(sExt, u"DOC") || o3tl::equalsIgnoreAsciiCase(sExt, u"DOCX") + || o3tl::equalsIgnoreAsciiCase(sExt, u"RTF") + || o3tl::equalsIgnoreAsciiCase(sExt, u"ODT"); } -bool isExcelFormat(const OUString& sExt) +bool isExcelFormat(std::u16string_view sExt) { return //sExt.equalsIgnoreAsciiCase("XLS") || // MSO does not create lockfile for XLS - sExt.equalsIgnoreAsciiCase("XLSX") || sExt.equalsIgnoreAsciiCase("ODS"); + o3tl::equalsIgnoreAsciiCase(sExt, u"XLSX") || o3tl::equalsIgnoreAsciiCase(sExt, u"ODS"); } -bool isPowerPointFormat(const OUString& sExt) +bool isPowerPointFormat(std::u16string_view sExt) { - return sExt.equalsIgnoreAsciiCase("PPTX") || sExt.equalsIgnoreAsciiCase("PPT") - || sExt.equalsIgnoreAsciiCase("ODP"); + return o3tl::equalsIgnoreAsciiCase(sExt, u"PPTX") || o3tl::equalsIgnoreAsciiCase(sExt, u"PPT") + || o3tl::equalsIgnoreAsciiCase(sExt, u"ODP"); } // Need to generate different lock file name for MSO. |