From ed6dcb6a5bbdefd1c8cf382f43126b21d25de52e Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 25 Jul 2019 10:56:20 -0400 Subject: [PATCH] More code cleanup to fix compile --- indra/newview/ascentprefschat.cpp | 47 +++++++++++++------------------ 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index b2c9f3c72..7084e0081 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -338,67 +338,58 @@ void LLPrefsAscentChat::refresh() } //Chat UI ----------------------------------------------------------------------------- - if (combo = getChild("chat_tabs_namesystem_combobox")) + if (auto combo = getChild("chat_tabs_namesystem_combobox")) combo->setCurrentByIndex(mChatTabNames); - if (combo = getChild("friends_namesystem_combobox")) + if (auto combo = getChild("friends_namesystem_combobox")) combo->setCurrentByIndex(mFriendNames); - if (combo = getChild("group_members_namesystem_combobox")) + if (auto combo = getChild("group_members_namesystem_combobox")) combo->setCurrentByIndex(mGroupMembersNames); - if (combo = getChild("land_management_namesystem_combobox")) + if (auto combo = getChild("land_management_namesystem_combobox")) combo->setCurrentByIndex(mLandManagementNames); - if (combo = getChild("radar_namesystem_combobox")) + if (auto combo = getChild("radar_namesystem_combobox")) combo->setCurrentByIndex(mRadarNames); - if (combo = getChild("speaker_namesystem_combobox")) + if (auto combo = getChild("speaker_namesystem_combobox")) combo->setCurrentByIndex(mSpeakerNames); //Text Options ------------------------------------------------------------------------ - combo = getChild("SpellBase"); - - if (combo != NULL) + if (combo = getChild("SpellBase")) { combo->removeall(); - std::vector names = glggHunSpell->getDicts(); - for (int i = 0; i < (int)names.size(); i++) + for (const auto& name : glggHunSpell->getDicts()) { - combo->add(names[i]); + combo->add(name); } combo->setSimple(gSavedSettings.getString("SpellBase")); } - combo = getChild("EmSpell_Avail"); - - if (combo != NULL) + if (auto combo = getChild("EmSpell_Avail")) { combo->removeall(); - combo->add(""); - std::vector names = glggHunSpell->getAvailDicts(); + combo->add(LLStringUtil::null); - for (int i = 0; i < (int)names.size(); i++) + for (const auto& name : glggHunSpell->getAvailDicts()) { - combo->add(names[i]); + combo->add(name); } - combo->setSimple(std::string("")); + combo->setSimple(LLStringUtil::null); } - combo = getChild("EmSpell_Installed"); - - if (combo != NULL) + if (auto combo = getChild("EmSpell_Installed")) { combo->removeall(); - combo->add(""); - std::vector names = glggHunSpell->getInstalledDicts(); + combo->add(LLStringUtil::null); - for (int i = 0; i < (int)names.size(); i++) + for (const auto& name : glggHunSpell->getInstalledDicts()) { - combo->add(names[i]); + combo->add(name); } - combo->setSimple(std::string("")); + combo->setSimple(LLStringUtil::null); } childSetEnabled("KeywordsList", mKeywordsOn);