Author: atsushi
Date: 2006-05-15 15:18:40 -0400 (Mon, 15 May 2006)
New Revision: 60718
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TabControlTest.cs
Log:
2006-05-15 Atsushi Enomoto <[EMAIL PROTECTED]>
* When argument index is equal or more than tab count, just ignore.
Fixed bug #78395.
* TabControlTest.cs : added test for bug #78395.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-05-15 18:57:48 UTC (rev 60717)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-05-15 19:18:40 UTC (rev 60718)
@@ -1,3 +1,8 @@
+2006-05-15 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * When argument index is equal or more than tab count, just ignore.
+ Fixed bug #78395.
+
2006-05-15 Peter Dennis Bartok <[EMAIL PROTECTED]>
* Control.cs: Dispose all child controls when control is diposed
(#78394)
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
2006-05-15 18:57:48 UTC (rev 60717)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
2006-05-15 19:18:40 UTC (rev 60718)
@@ -211,6 +211,8 @@
throw new ArgumentException ("'" +
value + "' is not a valid value for 'value'. " +
"'value' must be
greater than or equal to -1.");
}
+ if (value >= TabCount)
+ return;
SuspendLayout ();
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2006-05-15 18:57:48 UTC (rev 60717)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2006-05-15 19:18:40 UTC (rev 60718)
@@ -1,3 +1,7 @@
+2006-05-15 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * TabControlTest.cs : added test for bug #78395.
+
2006-04-16 Gert Driesen <[EMAIL PROTECTED]>
* TabControlTest.cs: Added test for bug #78121. Marked failing tests
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TabControlTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TabControlTest.cs
2006-05-15 18:57:48 UTC (rev 60717)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TabControlTest.cs
2006-05-15 19:18:40 UTC (rev 60718)
@@ -114,4 +114,18 @@
Assert.AreEqual (-1, tab.SelectedIndex, "#C3");
Assert.AreEqual (0, tab.TabPages.Count, "#C4");
}
+
+ [Test]
+ public void SetSelectedIndex ()
+ {
+ // bug #78395
+ TabControl c = new TabControl ();
+ c.SelectedIndex = 0;
+
+ c.TabPages.Add (new TabPage ());
+ c.TabPages.Add (new TabPage ());
+ Assert.AreEqual (0, c.SelectedIndex, "#1");
+ c.SelectedIndex = 2; // beyond the pages - ignored
+ Assert.AreEqual (0, c.SelectedIndex, "#2");
+ }
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches