diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-02 19:02:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-03 10:01:48 +0200 |
commit | 3e1e0af376d45f44dab975cea943de7fb676f967 (patch) | |
tree | 3a1e0f7cf57ee323b8cdde8ac02a010d1e02f0b3 /sfx2/source/control/emojiview.cxx | |
parent | 744722123a8ce3d3c30583ba1285a21e129b471f (diff) |
loplugin:stringviewparam convert methods using match
which converts to a combination of substr and o3tl::starts_with
Change-Id: I5b01a181b9e6bee3483e4f49f1a9426abcc682d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132458
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/control/emojiview.cxx')
-rw-r--r-- | sfx2/source/control/emojiview.cxx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sfx2/source/control/emojiview.cxx b/sfx2/source/control/emojiview.cxx index 02ee330e2c2a..6e5bd97b8dfc 100644 --- a/sfx2/source/control/emojiview.cxx +++ b/sfx2/source/control/emojiview.cxx @@ -17,6 +17,7 @@ #include <comphelper/processfactory.hxx> #include <vcl/event.hxx> #include <vcl/weldutils.hxx> +#include <o3tl/string_view.hxx> #include <orcus/json_document_tree.hpp> #include <orcus/config.hpp> @@ -26,28 +27,28 @@ using namespace ::com::sun::star; -bool ViewFilter_Category::isFilteredCategory(FILTER_CATEGORY filter, const OUString &rCategory) +bool ViewFilter_Category::isFilteredCategory(FILTER_CATEGORY filter, std::u16string_view rCategory) { bool bRet = true; if (filter == FILTER_CATEGORY::PEOPLE) - bRet = rCategory.match("people"); + bRet = o3tl::starts_with(rCategory, u"people"); else if (filter == FILTER_CATEGORY::NATURE) - bRet = rCategory.match("nature"); + bRet = o3tl::starts_with(rCategory, u"nature"); else if (filter == FILTER_CATEGORY::FOOD) - bRet = rCategory.match("food"); + bRet = o3tl::starts_with(rCategory, u"food"); else if (filter == FILTER_CATEGORY::ACTIVITY) - bRet = rCategory.match("activity"); + bRet = o3tl::starts_with(rCategory, u"activity"); else if (filter == FILTER_CATEGORY::TRAVEL) - bRet = rCategory.match("travel"); + bRet = o3tl::starts_with(rCategory, u"travel"); else if (filter == FILTER_CATEGORY::OBJECTS) - bRet = rCategory.match("objects"); + bRet = o3tl::starts_with(rCategory, u"objects"); else if (filter == FILTER_CATEGORY::SYMBOLS) - bRet = rCategory.match("symbols"); + bRet = o3tl::starts_with(rCategory, u"symbols"); else if (filter == FILTER_CATEGORY::FLAGS) - bRet = rCategory.match("flags"); + bRet = o3tl::starts_with(rCategory, u"flags"); else if (filter == FILTER_CATEGORY::UNICODE9) - bRet = rCategory.match("unicode9"); + bRet = o3tl::starts_with(rCategory, u"unicode9"); return bRet; } |