Author: calberto
Date: 2007-11-20 19:18:45 -0500 (Tue, 20 Nov 2007)
New Revision: 90054

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

        * ListView.cs: When setting focused item, try to give focus to the
        previous one _only_ if the previous one remains valid. 
        Fixes #342504.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-11-21 00:09:34 UTC (rev 90053)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-11-21 00:18:45 UTC (rev 90054)
@@ -1,3 +1,9 @@
+2007-11-20  Carlos Alberto Cortez <[EMAIL PROTECTED]>
+
+       * ListView.cs: When setting focused item, try to give focus to the
+       previous one _only_ if the previous one remains valid. 
+       Fixes #342504.
+
 2007-11-20  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * Application.cs: Revert r89650, as it broke a common case to fix

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2007-11-21 00:09:34 UTC (rev 90053)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2007-11-21 00:18:45 UTC (rev 90054)
@@ -3087,7 +3087,7 @@
                {
                        if (index != -1)
                                items [index].Focused = true;
-                       else if (focused_item_index != -1) // Previous focused 
item
+                       else if (focused_item_index != -1 && focused_item_index 
< items.Count) // Previous focused item
                                items [focused_item_index].Focused = false;
 
                        focused_item_index = index;

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

Reply via email to