diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/emojiview.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/emojiview.cxx | 21 |
2 files changed, 12 insertions, 11 deletions
diff --git a/sfx2/inc/emojiview.hxx b/sfx2/inc/emojiview.hxx index 52bb47bf0bc0..8328f2f410c4 100644 --- a/sfx2/inc/emojiview.hxx +++ b/sfx2/inc/emojiview.hxx @@ -41,7 +41,7 @@ public: bool operator()(const ThumbnailViewItem* pItem); - static bool isFilteredCategory(FILTER_CATEGORY filter, const OUString& rCategory); + static bool isFilteredCategory(FILTER_CATEGORY filter, std::u16string_view rCategory); private: FILTER_CATEGORY mCategory; 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; } |