2007-07-20 Mike Kestner <mkestner@novell.com>

* gtk/Calendar.custom : workaround invalid states in widget when
	raising month_changed signals.  [Fixes #78524]

svn path=/trunk/gtk-sharp/; revision=82387
This commit is contained in:
Mike Kestner 2007-07-20 20:25:49 +00:00
parent cdf0658754
commit 6501e5e0ba
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2007-07-20 Mike Kestner <mkestner@novell.com>
* gtk/Calendar.custom : workaround invalid states in widget when
raising month_changed signals. [Fixes #78524]
2007-07-20 Mike Kestner <mkestner@novell.com>
* gtk/gtk-api-2.10.raw : refresh.

View file

@ -26,7 +26,15 @@ public DateTime GetDate ()
{
uint year, month, day;
GetDate (out year, out month, out day);
return new DateTime ((int) year, (int) month + 1, (int) day);
DateTime result;
try {
result = new DateTime ((int) year, (int) month + 1, (int) day);
} catch (ArgumentOutOfRangeException) {
// Kluge to workaround GtkCalendar being in an invalid state
// when raising month_changed signals, like in bug #78524.
result = new DateTime ((int) year, (int) month + 1, DateTime.DaysInMonth ((int) year, (int) month + 1));
}
return result;
}