diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-11-18 08:46:33 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-11-18 10:22:44 +0100 |
commit | 6fa1161d3113d43f38acdf9207627659fbc137c8 (patch) | |
tree | 0b4e0091101fde23515ec7ab9bb7a05993c40482 /sc | |
parent | 7938cae5178a4ce4093fd6494a058ab879ba303b (diff) |
loplugin:stringviewparam: No good reason to exclude operator functions
(at least not in general)
Change-Id: I71337b53dc9735e90a37ee532d0a8a08797b518c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106043
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xistyle.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/inc/workbookhelper.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/oox/workbookhelper.cxx | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 98c91ab6f8c2..a2d76b6e8d54 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -68,6 +68,7 @@ #include <root.hxx> #include <colrowst.hxx> +#include <string_view> #include <vector> #include <cppuhelper/implbase.hxx> @@ -1598,7 +1599,7 @@ namespace { /** Functor for case-insensitive string comparison, usable in maps etc. */ struct IgnoreCaseCompare { - bool operator()( const OUString& rName1, const OUString& rName2 ) const + bool operator()( const OUString& rName1, std::u16string_view rName2 ) const { return rName1.compareToIgnoreAsciiCase( rName2 ) < 0; } }; diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx index ad1018302265..0fd9ca5ebc64 100644 --- a/sc/source/filter/inc/workbookhelper.hxx +++ b/sc/source/filter/inc/workbookhelper.hxx @@ -21,6 +21,8 @@ #define INCLUDED_SC_SOURCE_FILTER_INC_WORKBOOKHELPER_HXX #include <memory> +#include <string_view> + #include <oox/helper/storagebase.hxx> #include <address.hxx> @@ -61,7 +63,7 @@ class ExcelFilter; /** Functor for case-insensitive string comparison, usable in maps etc. */ struct IgnoreCaseCompare { - bool operator()( const OUString& rName1, const OUString& rName2 ) const; + bool operator()( const OUString& rName1, std::u16string_view rName2 ) const; }; class AddressConverter; diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 32b393e52215..8214ccb0cf4e 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -94,7 +94,7 @@ using ::oox::core::FilterBase; using ::oox::core::FragmentHandler; using ::oox::core::XmlFilterBase; -bool IgnoreCaseCompare::operator()( const OUString& rName1, const OUString& rName2 ) const +bool IgnoreCaseCompare::operator()( const OUString& rName1, std::u16string_view rName2 ) const { // TODO: compare with collator return rName1.compareToIgnoreAsciiCase(rName2 ) < 0; |