summaryrefslogtreecommitdiff
path: root/indra/llui/llemojidictionary.cpp
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-04-19 01:39:42 +0200
committerAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-04-20 03:55:02 +0200
commit97b0ba2a6d2596da867043077e32065653d44f6e (patch)
tree896599c3ab441be09998b0e58b40bde6700cfdbd /indra/llui/llemojidictionary.cpp
parent8dad411e9055c32a753e575ccd6142073eb27aae (diff)
SL-19575 LLFloaterEmojiPicker - Add filter by category
Diffstat (limited to 'indra/llui/llemojidictionary.cpp')
-rw-r--r--indra/llui/llemojidictionary.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llui/llemojidictionary.cpp b/indra/llui/llemojidictionary.cpp
index b70a9b2e7a..d306407484 100644
--- a/indra/llui/llemojidictionary.cpp
+++ b/indra/llui/llemojidictionary.cpp
@@ -175,6 +175,12 @@ LLWString LLEmojiDictionary::findMatchingEmojis(const std::string& needle) const
return result;
}
+const LLEmojiDescriptor* LLEmojiDictionary::getDescriptorFromEmoji(llwchar emoji) const
+{
+ const auto it = mEmoji2Descr.find(emoji);
+ return (mEmoji2Descr.end() != it) ? it->second : nullptr;
+}
+
const LLEmojiDescriptor* LLEmojiDictionary::getDescriptorFromShortCode(const std::string& short_code) const
{
const auto it = mShortCode2Descr.find(short_code);
@@ -195,6 +201,10 @@ void LLEmojiDictionary::addEmoji(LLEmojiDescriptor&& descr)
{
mShortCode2Descr.insert(std::make_pair(shortCode, &mEmojis.back()));
}
+ for (const std::string& category : descr.Categories)
+ {
+ mCategory2Descrs[category].push_back(&mEmojis.back());
+ }
}
// ============================================================================