summaryrefslogtreecommitdiff
path: root/indra/llui/llui.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-07-02 12:02:26 +0300
committerGitHub <noreply@github.com>2024-07-02 12:02:26 +0300
commit5e1f83f7e657a455cdd57716ac6addf3f91b4e0c (patch)
tree77c11941a1cdafd7b5758da028fec4fbd707feec /indra/llui/llui.cpp
parente32f6426d5b0765272f7c08bbbb6780a2f2e1e0b (diff)
parentfad6a3753757778d4b50d46f44aabd0d3fa3e13b (diff)
Merge pull request #1903 from RyeMutt/reduce-llui-stringtemp
Reduce string temporaries from frequently called llui find and get functions
Diffstat (limited to 'indra/llui/llui.cpp')
-rw-r--r--indra/llui/llui.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 66ec3ad9bd..e3ddd66b58 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();
@@ -367,7 +367,7 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen)
}
-LLControlGroup& LLUI::getControlControlGroup (const std::string& controlname)
+LLControlGroup& LLUI::getControlControlGroup (std::string_view controlname)
{
for (settings_map_t::iterator itor = mSettingGroups.begin();
itor != mSettingGroups.end(); ++itor)
@@ -529,7 +529,7 @@ namespace LLInitParam
{
if (control.isProvided() && !control().empty())
{
- updateValue(LLUIColorTable::instance().getColor(control));
+ updateValue(LLUIColorTable::instance().getColor(control()));
}
else
{