From 6f4a21531ae7e5d095034f7315501421dd94d124 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 21 Oct 2010 17:12:24 -0700 Subject: STORM-173 : never enable return object if no object selected --- indra/newview/llviewermenu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ccf3df827d..dc7c6f17a9 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4160,6 +4160,12 @@ class LLObjectEnableReturn : public view_listener_t { bool handleEvent(const LLSD& userdata) { + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); + if (!node) + { + // Do not enable if nothing selected + return false; + } #ifdef HACKED_GODLIKE_VIEWER bool new_value = true; #else -- cgit v1.2.3 From c0e9594e9d509ba665c3b5a2fe01049b0dbb92fd Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 25 Oct 2010 10:27:37 -0700 Subject: STORM-173 : use isEmpty() instead of getFirstRootNode() to check selection --- indra/newview/llviewermenu.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index dc7c6f17a9..68935d536b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4160,8 +4160,7 @@ class LLObjectEnableReturn : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); - if (!node) + if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) { // Do not enable if nothing selected return false; -- cgit v1.2.3