From 49d60e0ded52c095c834e9ca134b67282728b389 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 1 Jul 2024 22:24:32 -0400 Subject: Reduce string temporaries from LLFloaterReg find/get --- indra/llui/llbutton.cpp | 2 +- indra/llui/llfloaterreg.cpp | 165 ++++++++++++++------------ indra/llui/llfloaterreg.h | 36 +++--- indra/llui/llfloaterreglistener.cpp | 10 +- indra/llui/llui.cpp | 14 +-- indra/newview/llfloatersidepanelcontainer.cpp | 10 +- indra/newview/llfloatersidepanelcontainer.h | 12 +- indra/newview/llfloaterwebcontent.cpp | 2 +- indra/newview/llsidetraypanelcontainer.cpp | 4 +- indra/newview/llsidetraypanelcontainer.h | 2 +- 10 files changed, 137 insertions(+), 120 deletions(-) (limited to 'indra') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 91044e5441..7912baf132 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -1273,7 +1273,7 @@ void LLButton::setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname) // Set the button control value (toggle state) to the floater visibility control (Sets the value as well) button->setControlVariable(LLFloater::getControlGroup()->getControl(vis_control_name)); // Set the clicked callback to toggle the floater - button->setClickedCallback(boost::bind(&LLFloaterReg::toggleInstance, sdname, LLSD())); + button->setClickedCallback([=](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::toggleInstance(sdname.asString(), LLSD()); }); } // static diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index fd5a370bc3..a818e72f59 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -40,9 +40,9 @@ LLFloaterReg::instance_list_t LLFloaterReg::sNullInstanceList; LLFloaterReg::instance_map_t LLFloaterReg::sInstanceMap; LLFloaterReg::build_map_t LLFloaterReg::sBuildMap; -std::map LLFloaterReg::sGroupMap; +std::map> LLFloaterReg::sGroupMap; bool LLFloaterReg::sBlockShowFloaters = false; -std::set LLFloaterReg::sAlwaysShowableList; +std::set> LLFloaterReg::sAlwaysShowableList; static LLFloaterRegListener sFloaterRegListener; @@ -58,27 +58,31 @@ void LLFloaterReg::add(const std::string& name, const std::string& filename, con } //static -bool LLFloaterReg::isRegistered(const std::string& name) +bool LLFloaterReg::isRegistered(std::string_view name) { return sBuildMap.find(name) != sBuildMap.end(); } //static -LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name) +LLFloater* LLFloaterReg::getLastFloaterInGroup(std::string_view name) { - const std::string& groupname = sGroupMap[name]; - if (!groupname.empty()) + auto it = sGroupMap.find(name); + if (it != sGroupMap.end()) { - instance_list_t& list = sInstanceMap[groupname]; - if (!list.empty()) + const std::string& groupname = it->second; + if (!groupname.empty()) { - for (instance_list_t::reverse_iterator iter = list.rbegin(); iter != list.rend(); ++iter) + instance_list_t& list = sInstanceMap[groupname]; + if (!list.empty()) { - LLFloater* inst = *iter; - - if (inst->getVisible() && !inst->isMinimized()) + for (instance_list_t::reverse_iterator iter = list.rbegin(), end = list.rend(); iter != end; ++iter) { - return inst; + LLFloater* inst = *iter; + + if (inst->getVisible() && !inst->isMinimized()) + { + return inst; + } } } } @@ -99,10 +103,8 @@ LLFloater* LLFloaterReg::getLastFloaterCascading() instance_list_t& instances = sInstanceMap[group_name]; - for (instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); ++iter) + for (LLFloater* inst : instances) { - LLFloater* inst = *iter; - if (inst->getVisible() && (inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADING) || inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADE_GROUP))) @@ -120,20 +122,23 @@ LLFloater* LLFloaterReg::getLastFloaterCascading() } //static -LLFloater* LLFloaterReg::findInstance(const std::string& name, const LLSD& key) +LLFloater* LLFloaterReg::findInstance(std::string_view name, const LLSD& key) { LLFloater* res = NULL; - const std::string& groupname = sGroupMap[name]; - if (!groupname.empty()) + auto it = sGroupMap.find(name); + if (it != sGroupMap.end()) { - instance_list_t& list = sInstanceMap[groupname]; - for (instance_list_t::iterator iter = list.begin(); iter != list.end(); ++iter) + const std::string& groupname = it->second; + if (!groupname.empty()) { - LLFloater* inst = *iter; - if (inst->matchesKey(key)) + instance_list_t& list = sInstanceMap[groupname]; + for (LLFloater* inst : list) { - res = inst; - break; + if (inst->matchesKey(key)) + { + res = inst; + break; + } } } } @@ -141,47 +146,55 @@ LLFloater* LLFloaterReg::findInstance(const std::string& name, const LLSD& key) } //static -LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) +LLFloater* LLFloaterReg::getInstance(std::string_view name, const LLSD& key) { LLFloater* res = findInstance(name, key); if (!res) { - const LLFloaterBuildFunc& build_func = sBuildMap[name].mFunc; - const std::string& xui_file = sBuildMap[name].mFile; - if (build_func) + auto it = sBuildMap.find(name); + if (it != sBuildMap.end()) { - const std::string& groupname = sGroupMap[name]; - if (!groupname.empty()) + const LLFloaterBuildFunc& build_func = it->second.mFunc; + const std::string& xui_file = it->second.mFile; + if (build_func) { - instance_list_t& list = sInstanceMap[groupname]; - - res = build_func(key); - if (!res) - { - LL_WARNS() << "Failed to build floater type: '" << name << "'." << LL_ENDL; - return NULL; - } - bool success = res->buildFromFile(xui_file); - if (!success) + auto it = sGroupMap.find(name); + if (it != sGroupMap.end()) { - LL_WARNS() << "Failed to build floater type: '" << name << "'." << LL_ENDL; - return NULL; + const std::string& groupname = it->second; + if (!groupname.empty()) + { + instance_list_t& list = sInstanceMap[groupname]; + + res = build_func(key); + if (!res) + { + LL_WARNS() << "Failed to build floater type: '" << name << "'." << LL_ENDL; + return NULL; + } + bool success = res->buildFromFile(xui_file); + if (!success) + { + LL_WARNS() << "Failed to build floater type: '" << name << "'." << LL_ENDL; + return NULL; + } + + // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe + if (res->mKey.isUndefined()) + { + res->mKey = key; + } + res->setInstanceName(std::string(name)); + + LLFloater* last_floater = (list.empty() ? NULL : list.back()); + + res->applyControlsAndPosition(last_floater); + + gFloaterView->adjustToFitScreen(res, false); + + list.push_back(res); + } } - - // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe - if (res->mKey.isUndefined()) - { - res->mKey = key; - } - res->setInstanceName(name); - - LLFloater *last_floater = (list.empty() ? NULL : list.back()); - - res->applyControlsAndPosition(last_floater); - - gFloaterView->adjustToFitScreen(res, false); - - list.push_back(res); } } if (!res) @@ -193,21 +206,25 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) } //static -LLFloater* LLFloaterReg::removeInstance(const std::string& name, const LLSD& key) +LLFloater* LLFloaterReg::removeInstance(std::string_view name, const LLSD& key) { LLFloater* res = NULL; - const std::string& groupname = sGroupMap[name]; - if (!groupname.empty()) + auto it = sGroupMap.find(name); + if (it != sGroupMap.end()) { - instance_list_t& list = sInstanceMap[groupname]; - for (instance_list_t::iterator iter = list.begin(); iter != list.end(); ++iter) + const std::string& groupname = it->second; + if (!groupname.empty()) { - LLFloater* inst = *iter; - if (inst->matchesKey(key)) + instance_list_t& list = sInstanceMap[groupname]; + for (instance_list_t::iterator iter = list.begin(); iter != list.end(); ++iter) { - res = inst; - list.erase(iter); - break; + LLFloater* inst = *iter; + if (inst->matchesKey(key)) + { + res = inst; + list.erase(iter); + break; + } } } } @@ -216,7 +233,7 @@ LLFloater* LLFloaterReg::removeInstance(const std::string& name, const LLSD& key //static // returns true if the instance existed -bool LLFloaterReg::destroyInstance(const std::string& name, const LLSD& key) +bool LLFloaterReg::destroyInstance(std::string_view name, const LLSD& key) { LLFloater* inst = removeInstance(name, key); if (inst) @@ -232,7 +249,7 @@ bool LLFloaterReg::destroyInstance(const std::string& name, const LLSD& key) // Iterators //static -LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::string& name) +LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(std::string_view name) { instance_map_t::iterator iter = sInstanceMap.find(name); if (iter != sInstanceMap.end()) @@ -248,7 +265,7 @@ LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::str // Visibility Management //static -LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, bool focus) +LLFloater* LLFloaterReg::showInstance(std::string_view name, const LLSD& key, bool focus) { if( sBlockShowFloaters // see EXT-7090 @@ -266,7 +283,7 @@ LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, //static // returns true if the instance exists -bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) +bool LLFloaterReg::hideInstance(std::string_view name, const LLSD& key) { LLFloater* instance = findInstance(name, key); if (instance) @@ -278,7 +295,7 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) //static // returns true if the instance is visible when completed -bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key) +bool LLFloaterReg::toggleInstance(std::string_view name, const LLSD& key) { LLFloater* instance = findInstance(name, key); if (instance && instance->isShown()) @@ -294,7 +311,7 @@ bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key) //static // returns true if the instance exists and is visible (doesnt matter minimized or not) -bool LLFloaterReg::instanceVisible(const std::string& name, const LLSD& key) +bool LLFloaterReg::instanceVisible(std::string_view name, const LLSD& key) { LLFloater* instance = findInstance(name, key); return LLFloater::isVisible(instance); diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 6a642cbb27..94a67c8d8b 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -51,26 +51,26 @@ public: // 2) We can change the key of a floater without altering the list. typedef std::list instance_list_t; typedef const instance_list_t const_instance_list_t; - typedef std::map instance_map_t; + typedef std::map> instance_map_t; struct BuildData { LLFloaterBuildFunc mFunc; std::string mFile; }; - typedef std::map build_map_t; + typedef std::map> build_map_t; private: friend class LLFloaterRegListener; static instance_list_t sNullInstanceList; static instance_map_t sInstanceMap; static build_map_t sBuildMap; - static std::map sGroupMap; + static std::map> sGroupMap; static bool sBlockShowFloaters; /** * Defines list of floater names that can be shown despite state of sBlockShowFloaters. */ - static std::set sAlwaysShowableList; + static std::set> sAlwaysShowableList; public: // Registration @@ -85,30 +85,30 @@ public: static void add(const std::string& name, const std::string& file, const LLFloaterBuildFunc& func, const std::string& groupname = LLStringUtil::null); - static bool isRegistered(const std::string& name); + static bool isRegistered(std::string_view name); // Helpers - static LLFloater* getLastFloaterInGroup(const std::string& name); + static LLFloater* getLastFloaterInGroup(std::string_view name); static LLFloater* getLastFloaterCascading(); // Find / get (create) / remove / destroy - static LLFloater* findInstance(const std::string& name, const LLSD& key = LLSD()); - static LLFloater* getInstance(const std::string& name, const LLSD& key = LLSD()); - static LLFloater* removeInstance(const std::string& name, const LLSD& key = LLSD()); - static bool destroyInstance(const std::string& name, const LLSD& key = LLSD()); + static LLFloater* findInstance(std::string_view name, const LLSD& key = LLSD()); + static LLFloater* getInstance(std::string_view name, const LLSD& key = LLSD()); + static LLFloater* removeInstance(std::string_view name, const LLSD& key = LLSD()); + static bool destroyInstance(std::string_view name, const LLSD& key = LLSD()); // Iterators - static const_instance_list_t& getFloaterList(const std::string& name); + static const_instance_list_t& getFloaterList(std::string_view name); // Visibility Management // return NULL if instance not found or can't create instance (no builder) - static LLFloater* showInstance(const std::string& name, const LLSD& key = LLSD(), bool focus = false); + static LLFloater* showInstance(std::string_view name, const LLSD& key = LLSD(), bool focus = false); // Close a floater (may destroy or set invisible) // return false if can't find instance - static bool hideInstance(const std::string& name, const LLSD& key = LLSD()); + static bool hideInstance(std::string_view name, const LLSD& key = LLSD()); // return true if instance is visible: - static bool toggleInstance(const std::string& name, const LLSD& key = LLSD()); - static bool instanceVisible(const std::string& name, const LLSD& key = LLSD()); + static bool toggleInstance(std::string_view name, const LLSD& key = LLSD()); + static bool instanceVisible(std::string_view name, const LLSD& key = LLSD()); static void showInitialVisibleInstances(); static void hideVisibleInstances(const std::set& exceptions = std::set()); @@ -133,19 +133,19 @@ public: // Typed find / get / show template - static T* findTypedInstance(const std::string& name, const LLSD& key = LLSD()) + static T* findTypedInstance(std::string_view name, const LLSD& key = LLSD()) { return dynamic_cast(findInstance(name, key)); } template - static T* getTypedInstance(const std::string& name, const LLSD& key = LLSD()) + static T* getTypedInstance(std::string_view name, const LLSD& key = LLSD()) { return dynamic_cast(getInstance(name, key)); } template - static T* showTypedInstance(const std::string& name, const LLSD& key = LLSD(), bool focus = false) + static T* showTypedInstance(std::string_view name, const LLSD& key = LLSD(), bool focus = false) { return dynamic_cast(showInstance(name, key, focus)); } diff --git a/indra/llui/llfloaterreglistener.cpp b/indra/llui/llfloaterreglistener.cpp index 88fa65e8f5..17641b8375 100644 --- a/indra/llui/llfloaterreglistener.cpp +++ b/indra/llui/llfloaterreglistener.cpp @@ -94,22 +94,22 @@ void LLFloaterRegListener::getBuildMap(const LLSD& event) const void LLFloaterRegListener::showInstance(const LLSD& event) const { - LLFloaterReg::showInstance(event["name"], event["key"], event["focus"]); + LLFloaterReg::showInstance(event["name"].asString(), event["key"], event["focus"]); } void LLFloaterRegListener::hideInstance(const LLSD& event) const { - LLFloaterReg::hideInstance(event["name"], event["key"]); + LLFloaterReg::hideInstance(event["name"].asString(), event["key"]); } void LLFloaterRegListener::toggleInstance(const LLSD& event) const { - LLFloaterReg::toggleInstance(event["name"], event["key"]); + LLFloaterReg::toggleInstance(event["name"].asString(), event["key"]); } void LLFloaterRegListener::instanceVisible(const LLSD& event) const { - sendReply(LLSDMap("visible", LLFloaterReg::instanceVisible(event["name"], event["key"])), + sendReply(LLSDMap("visible", LLFloaterReg::instanceVisible(event["name"].asString(), event["key"])), event); } @@ -119,7 +119,7 @@ void LLFloaterRegListener::clickButton(const LLSD& event) const LLReqID reqID(event); LLSD reply(reqID.makeResponse()); - LLFloater* floater = LLFloaterReg::findInstance(event["name"], event["key"]); + LLFloater* floater = LLFloaterReg::findInstance(event["name"].asString(), event["key"]); if (! LLFloater::isShown(floater)) { reply["type"] = "LLFloater"; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 66ec3ad9bd..f5c55a3d37 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -170,11 +170,11 @@ mHelpImpl(NULL) LLUICtrl::CommitCallbackRegistry::Registrar& reg = LLUICtrl::CommitCallbackRegistry::defaultRegistrar(); // Callbacks for associating controls with floater visibility: - reg.add("Floater.Toggle", boost::bind(&LLFloaterReg::toggleInstance, _2, LLSD())); - reg.add("Floater.ToggleOrBringToFront", boost::bind(&LLFloaterReg::toggleInstanceOrBringToFront, _2, LLSD())); - reg.add("Floater.Show", boost::bind(&LLFloaterReg::showInstance, _2, LLSD(), false)); - reg.add("Floater.ShowOrBringToFront", boost::bind(&LLFloaterReg::showInstanceOrBringToFront, _2, LLSD())); - reg.add("Floater.Hide", boost::bind(&LLFloaterReg::hideInstance, _2, LLSD())); + reg.add("Floater.Toggle", [](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::toggleInstance(param.asStringRef()); }); + reg.add("Floater.ToggleOrBringToFront", [](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::toggleInstanceOrBringToFront(param.asStringRef()); }); + reg.add("Floater.Show", [](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::showInstance(param.asStringRef(), LLSD(), false); }); + reg.add("Floater.ShowOrBringToFront", [](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::showInstanceOrBringToFront(param.asStringRef(), LLSD()); }); + reg.add("Floater.Hide", [](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::hideInstance(param.asStringRef()); }); // Button initialization callback for toggle buttons reg.add("Button.SetFloaterToggle", boost::bind(&LLButton::setFloaterToggle, _1, _2)); @@ -189,8 +189,8 @@ mHelpImpl(NULL) reg.add("Button.ToggleFloater", boost::bind(&LLButton::toggleFloaterAndSetToggleState, _1, _2)); // Used by menus along with Floater.Toggle to display visibility as a check-mark - LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD())); - LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD())); + LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", [](LLUICtrl* ctrl, const LLSD& param) -> bool { return LLFloaterReg::instanceVisible(param.asStringRef(), LLSD()); }); + LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", [](LLUICtrl* ctrl, const LLSD& param) -> bool { return LLFloaterReg::instanceVisible(param.asStringRef(), LLSD()); }); // Parse the master list of commands LLCommandManager::load(); diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 2f6d14d6b5..48547852c4 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -113,7 +113,7 @@ LLFloater* LLFloaterSidePanelContainer::getTopmostInventoryFloater() return topmost_floater; } -LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) +LLPanel* LLFloaterSidePanelContainer::openChildPanel(std::string_view panel_name, const LLSD& params) { LLView* view = findChildView(panel_name, true); if (!view) @@ -144,7 +144,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na return panel; } -void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& key) +void LLFloaterSidePanelContainer::showPanel(std::string_view floater_name, const LLSD& key) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance(floater_name); if (floaterp) @@ -153,7 +153,7 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con } } -void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key) +void LLFloaterSidePanelContainer::showPanel(std::string_view floater_name, std::string_view panel_name, const LLSD& key) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance(floater_name); if (floaterp) @@ -162,7 +162,7 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con } } -LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, const std::string& panel_name) +LLPanel* LLFloaterSidePanelContainer::getPanel(std::string_view floater_name, std::string_view panel_name) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance(floater_name); @@ -174,7 +174,7 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, return NULL; } -LLPanel* LLFloaterSidePanelContainer::findPanel(const std::string& floater_name, const std::string& panel_name) +LLPanel* LLFloaterSidePanelContainer::findPanel(std::string_view floater_name, std::string_view panel_name) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::findTypedInstance(floater_name); diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index d5d0c43cae..19d6c747cb 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -55,17 +55,17 @@ public: void cleanup() { destroy(); } - LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); + LLPanel* openChildPanel(std::string_view panel_name, const LLSD& params); static LLFloater* getTopmostInventoryFloater(); - static void showPanel(const std::string& floater_name, const LLSD& key); + static void showPanel(std::string_view floater_name, const LLSD& key); - static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); + static void showPanel(std::string_view floater_name, std::string_view panel_name, const LLSD& key); - static LLPanel* getPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName); + static LLPanel* getPanel(std::string_view floater_name, std::string_view panel_name = sMainPanelName); - static LLPanel* findPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName); + static LLPanel* findPanel(std::string_view floater_name, std::string_view panel_name = sMainPanelName); /** * Gets the panel of given type T (doesn't show it or do anything else with it). @@ -75,7 +75,7 @@ public: * @returns a pointer to the panel of given type T. */ template - static T* getPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName) + static T* getPanel(std::string_view floater_name, std::string_view panel_name = sMainPanelName) { T* panel = dynamic_cast(getPanel(floater_name, panel_name)); if (!panel) diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index f5b5b8293f..e1b6df6072 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -220,7 +220,7 @@ void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p) // showInstance will open a new window. Figure out how many web browsers are already open, // and close the least recently opened one if this will put us over the limit. - LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class); + LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class()); if(instances.size() >= (size_t)browser_window_limit) { diff --git a/indra/newview/llsidetraypanelcontainer.cpp b/indra/newview/llsidetraypanelcontainer.cpp index eb8e05ec27..44e0c3b05c 100644 --- a/indra/newview/llsidetraypanelcontainer.cpp +++ b/indra/newview/llsidetraypanelcontainer.cpp @@ -62,10 +62,10 @@ void LLSideTrayPanelContainer::onOpen(const LLSD& key) getCurrentPanel()->onOpen(key); } -void LLSideTrayPanelContainer::openPanel(const std::string& panel_name, const LLSD& key) +void LLSideTrayPanelContainer::openPanel(std::string_view panel_name, const LLSD& key) { LLSD combined_key = key; - combined_key[PARAM_SUB_PANEL_NAME] = panel_name; + combined_key[PARAM_SUB_PANEL_NAME] = std::string(panel_name); onOpen(combined_key); } diff --git a/indra/newview/llsidetraypanelcontainer.h b/indra/newview/llsidetraypanelcontainer.h index 5dfd7f2d83..0017d7743f 100644 --- a/indra/newview/llsidetraypanelcontainer.h +++ b/indra/newview/llsidetraypanelcontainer.h @@ -59,7 +59,7 @@ public: /** * Opens given subpanel. */ - void openPanel(const std::string& panel_name, const LLSD& key = LLSD::emptyMap()); + void openPanel(std::string_view panel_name, const LLSD& key = LLSD::emptyMap()); /** * Opens previous panel from panel navigation history. -- cgit v1.2.3