summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llviewermenu.cpp14
-rw-r--r--indra/newview/tests/lldateutil_test.cpp10
2 files changed, 19 insertions, 5 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 40c74ccf82..fb64a1929d 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5856,8 +5856,12 @@ void confirm_replace_attachment(S32 option, void* user_data)
}
}
-bool callback_attachment_drop(const LLSD& notification, const LLSD& response)
+void callback_attachment_drop(const LLSD& notification, const LLSD& response)
{
+ // Ensure user confirmed the drop
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option != 0) return;
+
// Called when the user clicked on an object attached to them
// and selected "Drop".
LLUUID object_id = notification["payload"]["object_id"].asUUID();
@@ -5866,7 +5870,7 @@ bool callback_attachment_drop(const LLSD& notification, const LLSD& response)
if (!object)
{
llwarns << "handle_drop_attachment() - no object to drop" << llendl;
- return true;
+ return;
}
LLViewerObject *parent = (LLViewerObject*)object->getParent();
@@ -5883,13 +5887,13 @@ bool callback_attachment_drop(const LLSD& notification, const LLSD& response)
if (!object)
{
llwarns << "handle_detach() - no object to detach" << llendl;
- return true;
+ return;
}
if (object->isAvatar())
{
llwarns << "Trying to detach avatar from avatar." << llendl;
- return true;
+ return;
}
// reselect the object
@@ -5897,7 +5901,7 @@ bool callback_attachment_drop(const LLSD& notification, const LLSD& response)
LLSelectMgr::getInstance()->sendDropAttachment();
- return true;
+ return;
}
class LLAttachmentDrop : public view_listener_t
diff --git a/indra/newview/tests/lldateutil_test.cpp b/indra/newview/tests/lldateutil_test.cpp
index 142a5eb5e6..7ba82fbd2c 100644
--- a/indra/newview/tests/lldateutil_test.cpp
+++ b/indra/newview/tests/lldateutil_test.cpp
@@ -179,4 +179,14 @@ namespace tut
LLDateUtil::ageFromDate("12/31/2009", mNow),
"Joined today" );
}
+
+ template<> template<>
+ void dateutil_object_t::test<5>()
+ {
+ set_test_name("2010 rollover");
+ LLDate now(std::string("2010-01-04T12:00:00Z"));
+ ensure_equals("days",
+ LLDateUtil::ageFromDate("12/13/2009", now),
+ "3 weeks old" );
+ }
}