From be2e3b846ed6480f300eea240bc4f45b837a7712 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 9 Feb 2012 23:54:22 +0200
Subject: [PATCH] EXP-1335 FIXED Disabled dragging the items from notecards and
 objects into Recent tab. Disabled DnD from Recent to Received Items. Fixed
 updating FILTERTYPE_DATE flag of LLInventoryFilter when time limits are
 applied.

---
 indra/newview/llinventoryfilter.cpp           | 37 ++++++++++---------
 indra/newview/llinventoryfilter.h             |  2 +
 .../default/xui/en/panel_inbox_inventory.xml  |  1 +
 3 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 796251cae5f..177ab28b369 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -282,19 +282,9 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons
 	// Pass if this item is within the date range.
 	if (filterTypes & FILTERTYPE_DATE)
 	{
-		const U16 HOURS_TO_SECONDS = 3600;
-		time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS;
-		if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest)
-		{
-			earliest = mFilterOps.mMinDate;
-		}
-		else if (!mFilterOps.mHoursAgo)
-		{
-			earliest = 0;
-		}
-		if (item->getCreationDate() < earliest ||
-			item->getCreationDate() > mFilterOps.mMaxDate)
-			return false;
+		// We don't get the updated item creation date for the task inventory or
+		// a notecard embedded item. See LLTaskInvFVBridge::getCreationDate().
+		return false;
 	}
 
 	return true;
@@ -548,7 +538,9 @@ void LLInventoryFilter::setDateRange(time_t min_date, time_t max_date)
 		mFilterOps.mMaxDate = llmax(mFilterOps.mMinDate, max_date);
 		setModified();
 	}
-	mFilterOps.mFilterTypes |= FILTERTYPE_DATE;
+
+	areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE
+			: mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
 }
 
 void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl)
@@ -560,10 +552,12 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl)
 	}
 	if (!sl && isSinceLogoff())
 	{
-		setDateRange(0, time_max());
+		setDateRange(time_min(), time_max());
 		setModified();
 	}
-	mFilterOps.mFilterTypes |= FILTERTYPE_DATE;
+
+	areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE
+			: mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
 }
 
 BOOL LLInventoryFilter::isSinceLogoff() const
@@ -608,7 +602,9 @@ void LLInventoryFilter::setHoursAgo(U32 hours)
 			setModified(FILTER_RESTART);
 		}
 	}
-	mFilterOps.mFilterTypes |= FILTERTYPE_DATE;
+
+	areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE
+			: mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE;
 }
 
 void LLInventoryFilter::setFilterLinks(U64 filter_links)
@@ -1058,3 +1054,10 @@ const std::string& LLInventoryFilter::getEmptyLookupMessage() const
 	return mEmptyLookupMessage;
 
 }
+
+bool LLInventoryFilter::areDateLimitsSet()
+{
+	return     mFilterOps.mMinDate != time_min()
+			|| mFilterOps.mMaxDate != time_max()
+			|| mFilterOps.mHoursAgo != 0;
+}
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 343306ae8ed..8635d5d5b38 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -179,6 +179,8 @@ class LLInventoryFilter
 	void 				fromLLSD(LLSD& data);
 
 private:
+	bool				areDateLimitsSet();
+
 	struct FilterOps
 	{
 		FilterOps();
diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
index 383e637ace1..413e22e4449 100644
--- a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <inbox_inventory_panel
+    accepts_drag_and_drop="false"
     name="inventory_inbox"
     start_folder="Received Items"
     follows="all" layout="topleft"
-- 
GitLab