From 544feee19f3b17f13fc735bc838fbaa35c2d8bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Wed, 8 Jan 2020 20:48:48 -0500 Subject: [PATCH] Fix Copy Names in Object Menu not working, oops!! --- indra/newview/llviewermenu.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5fb6ae779..ccd0d0e4a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -9223,10 +9223,19 @@ class ListCopyNames : public view_listener_t return ret; } + static std::string getObjectName(const LLUUID& id) + { + const auto& obj_data = get_obj_data(id); + return obj_data ? obj_data->name : LLStringUtil::null; + } + bool handleEvent(LLPointer event, const LLSD& userdata) { LLWString str; - copy_from_ids(LFIDBearer::getActiveSelectedIDs(), LFIDBearer::getActiveType() == LFIDBearer::GROUP ? getGroupName : getAvatarName); + const auto& type = LFIDBearer::getActiveType(); + copy_from_ids(LFIDBearer::getActiveSelectedIDs(), type == LFIDBearer::GROUP ? getGroupName : + type == LFIDBearer::OBJECT ? getObjectName : + getAvatarName); if (!str.empty()) LLView::getWindow()->copyTextToClipboard(str); return true; }