Author: aolk
Date: 2006-06-08 13:38:02 -0400 (Thu, 08 Jun 2006)
New Revision: 61579

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
Log:
2006-06-08  Alexander Olk  <[EMAIL PROTECTED]>

        * ComboBox.cs: Don't create a new ObjectCollection when an item
          gets inserted. Just insert the item in the existing object_items
          ArrayList.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-06-08 17:33:58 UTC (rev 61578)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-06-08 17:38:02 UTC (rev 61579)
@@ -1,3 +1,9 @@
+2006-06-08  Alexander Olk  <[EMAIL PROTECTED]>
+
+       * ComboBox.cs: Don't create a new ObjectCollection when an item
+         gets inserted. Just insert the item in the existing object_items
+         ArrayList.
+
 2006-06-08  Jackson Harper  <[EMAIL PROTECTED]>
 
        * OpenTreeNodeEnumerator.cs: Fix to use the Parent property, so

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2006-06-08 17:33:58 UTC (rev 61578)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2006-06-08 17:38:02 UTC (rev 61579)
@@ -1299,27 +1299,9 @@
                                if (index < 0 || index > Count)
                                        throw new ArgumentOutOfRangeException 
("Index of out range");                                   
                                
-                               ObjectCollection new_items = new 
ObjectCollection (owner);                              
-                               object sel_item = owner.SelectedItem;
-                                                                               
                
                                owner.BeginUpdate ();
                                
-                               for (int i = 0; i < index; i++) {
-                                       new_items.AddItem (ObjectItems[i]);
-                               }
-
-                               new_items.AddItem (item);
-
-                               for (int i = index; i < Count; i++){
-                                       new_items.AddItem (ObjectItems[i]);
-                               }                               
-
-                               ObjectItems = new_items.ObjectItems;
-                               
-                               if (sel_item != null) {
-                                       owner.selected_item = sel_item;
-                                       owner.listbox_ctrl.HighlightedItem = 
sel_item;
-                               }
+                               object_items.Insert (index, item);
                                                                                
                
                                owner.EndUpdate ();     // Calls UpdatedItems
                        }

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

Reply via email to