SL-19575 Create emoji gallery (use ::value_type in LLEmojiDictionary typedefs)

master
Alexander Gavriliuk 2023-05-18 07:47:54 +02:00 committed by Guru
parent 347c804bfe
commit bb97f3bf03
2 changed files with 7 additions and 7 deletions

View File

@ -57,11 +57,11 @@ class LLEmojiDictionary : public LLParamSingleton<LLEmojiDictionary>, public LLI
public:
typedef std::map<llwchar, const LLEmojiDescriptor*> emoji2descr_map_t;
typedef std::pair<llwchar, const LLEmojiDescriptor*> emoji2descr_item_t;
typedef emoji2descr_map_t::value_type emoji2descr_item_t;
typedef std::map<std::string, const LLEmojiDescriptor*> code2descr_map_t;
typedef std::pair<std::string, const LLEmojiDescriptor*> code2descr_item_t;
typedef code2descr_map_t::value_type code2descr_item_t;
typedef std::map<std::string, std::vector<const LLEmojiDescriptor*>> cat2descrs_map_t;
typedef std::pair<std::string, std::vector<const LLEmojiDescriptor*>> cat2descrs_item_t;
typedef cat2descrs_map_t::value_type cat2descrs_item_t;
static void initClass();
LLWString findMatchingEmojis(const std::string& needle) const;

View File

@ -123,7 +123,7 @@ BOOL LLFloaterEmojiPicker::postBuild()
mCategory->setCommitCallback([this](LLUICtrl*, const LLSD&) { onCategoryCommit(); });
const LLEmojiDictionary::cat2descrs_map_t& cat2Descrs = LLEmojiDictionary::instance().getCategory2Descrs();
mCategory->clearRows();
for (const LLEmojiDictionary::cat2descrs_item_t item : cat2Descrs)
for (const LLEmojiDictionary::cat2descrs_item_t& item : cat2Descrs)
{
std::string value = item.first;
std::string name = value;
@ -155,9 +155,9 @@ void LLFloaterEmojiPicker::fillEmojis()
mEmojis->clearRows();
const LLEmojiDictionary::emoji2descr_map_t& emoji2Descr = LLEmojiDictionary::instance().getEmoji2Descr();
for (const LLEmojiDictionary::emoji2descr_item_t it : emoji2Descr)
for (const LLEmojiDictionary::emoji2descr_item_t& item : emoji2Descr)
{
const LLEmojiDescriptor* descr = it.second;
const LLEmojiDescriptor* descr = item.second;
if (!mSelectedCategory.empty() && !matchesCategory(descr))
continue;
@ -169,7 +169,7 @@ void LLFloaterEmojiPicker::fillEmojis()
// The following line adds default monochrome view of the emoji (is shown as an example)
//params.columns.add().column("look").value(wstring_to_utf8str(LLWString(1, it.first)));
params.columns.add().column("name").value(descr->Name);
mEmojis->addRow(new LLEmojiScrollListItem(it.first, params), params);
mEmojis->addRow(new LLEmojiScrollListItem(item.first, params), params);
}
if (mEmojis->getItemCount())