diff options
Diffstat (limited to 'indra/newview/llfloateremojipicker.cpp')
-rw-r--r-- | indra/newview/llfloateremojipicker.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index ab81b2936f..9d28f7d4dc 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -73,15 +73,14 @@ LLFloaterEmojiPicker* LLFloaterEmojiPicker::getInstance() { LLFloaterEmojiPicker* floater = LLFloaterReg::getTypedInstance<LLFloaterEmojiPicker>("emoji_picker"); if (!floater) - LL_WARNS() << "Cannot instantiate emoji picker" << LL_ENDL; + LL_ERRS() << "Cannot instantiate emoji picker" << LL_ENDL; return floater; } LLFloaterEmojiPicker* LLFloaterEmojiPicker::showInstance(pick_callback_t pick_callback, close_callback_t close_callback) { LLFloaterEmojiPicker* floater = getInstance(); - if (floater) - floater->show(pick_callback, close_callback); + floater->show(pick_callback, close_callback); return floater; } @@ -106,9 +105,9 @@ BOOL LLFloaterEmojiPicker::postBuild() mCategory = getChild<LLComboBox>("Category"); mCategory->setCommitCallback(boost::bind(&LLFloaterEmojiPicker::onCategoryCommit, this)); - const auto& cat2Descrs = LLEmojiDictionary::instance().getCategory2Descrs(); + const LLEmojiDictionary::cat2descrs_map_t& cat2Descrs = LLEmojiDictionary::instance().getCategory2Descrs(); mCategory->clearRows(); - for (const auto& item : cat2Descrs) + for (const LLEmojiDictionary::cat2descrs_item_t& item : cat2Descrs) { std::string value = item.first; std::string name = value; @@ -139,8 +138,8 @@ void LLFloaterEmojiPicker::fillEmojis() { mEmojis->clearRows(); - const auto& emoji2Descr = LLEmojiDictionary::instance().getEmoji2Descr(); - for (const std::pair<const llwchar, const LLEmojiDescriptor*>& it : emoji2Descr) + const LLEmojiDictionary::emoji2descr_map_t& emoji2Descr = LLEmojiDictionary::instance().getEmoji2Descr(); + for (const LLEmojiDictionary::emoji2descr_item_t& it : emoji2Descr) { const LLEmojiDescriptor* descr = it.second; @@ -179,10 +178,10 @@ bool LLFloaterEmojiPicker::matchesPattern(const LLEmojiDescriptor* descr) { if (descr->Name.find(mSearchPattern) != std::string::npos) return true; - for (auto shortCode : descr->ShortCodes) + for (const std::string& shortCode : descr->ShortCodes) if (shortCode.find(mSearchPattern) != std::string::npos) return true; - for (auto category : descr->Categories) + for (const std::string& category : descr->Categories) if (category.find(mSearchPattern) != std::string::npos) return true; return false; @@ -204,7 +203,7 @@ void LLFloaterEmojiPicker::onSearchKeystroke(LLLineEditor* caller, void* user_da void LLFloaterEmojiPicker::onPreviewEmojiClick() { - if (mEmojis && mEmojiPickCallback) + if (mEmojiPickCallback) { if (LLEmojiScrollListItem* item = dynamic_cast<LLEmojiScrollListItem*>(mEmojis->getFirstSelected())) { @@ -221,8 +220,7 @@ void LLFloaterEmojiPicker::onEmojiSelect() mSelectedEmojiIndex = mEmojis->getFirstSelectedIndex(); LLUIString text; text.insert(0, LLWString(1, item->getEmoji())); - if (mPreviewEmoji) - mPreviewEmoji->setLabel(text); + mPreviewEmoji->setLabel(text); return; } @@ -232,13 +230,12 @@ void LLFloaterEmojiPicker::onEmojiSelect() void LLFloaterEmojiPicker::onEmojiEmpty() { mSelectedEmojiIndex = 0; - if (mPreviewEmoji) - mPreviewEmoji->setLabel(LLUIString()); + mPreviewEmoji->setLabel(LLUIString()); } void LLFloaterEmojiPicker::onEmojiPick() { - if (mEmojis && mEmojiPickCallback) + if (mEmojiPickCallback) { if (LLEmojiScrollListItem* item = dynamic_cast<LLEmojiScrollListItem*>(mEmojis->getFirstSelected())) { |