Author: calberto
Date: 2007-08-08 12:56:30 -0400 (Wed, 08 Aug 2007)
New Revision: 83681

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
Log:
2007-08-08  Carlos Alberto Cortez <[EMAIL PROTECTED]>

        * ListView.cs: In ListViewItemCollection.AddItem, don't do a linear
        search do check whether the item is already contained in the
        collection or not; instead check if the owner of the item is the same
        as ours. Also, remove a redundant check in the same method. 



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-08-08 16:40:56 UTC (rev 83680)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-08-08 16:56:30 UTC (rev 83681)
@@ -1,3 +1,10 @@
+2007-08-08  Carlos Alberto Cortez <[EMAIL PROTECTED]>
+
+       * ListView.cs: In ListViewItemCollection.AddItem, don't do a linear
+       search do check whether the item is already contained in the
+       collection or not; instead check if the owner of the item is the same
+       as ours. Also, remove a redundant check in the same method. 
+
 2007-08-08  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * Control.cs: Allow the clip region to be set back to null.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2007-08-08 16:40:56 UTC (rev 83680)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2007-08-08 16:56:30 UTC (rev 83681)
@@ -4660,10 +4660,10 @@
 
                        void AddItem (ListViewItem value)
                        {
-                               if (list.Contains (value))
+                               if (value.ListView != null && value.ListView == 
owner)
                                        throw new ArgumentException ("An item 
cannot be added more than once. To add an item again, you need to clone it.", 
"value");
 
-                               if (value.ListView != null && value.ListView != 
owner)
+                               if (value.ListView != null)
                                        throw new ArgumentException ("Cannot 
add or insert the item '" + value.Text + "' in more than one place. You must 
first remove it from its current location or clone it.", "value");
                                value.Owner = owner;
                                list.Add (value);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to