Author: mkestner
Date: 2007-07-20 16:25:49 -0400 (Fri, 20 Jul 2007)
New Revision: 82387

Modified:
   trunk/gtk-sharp/ChangeLog
   trunk/gtk-sharp/gtk/Calendar.custom
Log:

2007-07-20  Mike Kestner  <[EMAIL PROTECTED]>

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


Modified: trunk/gtk-sharp/ChangeLog
===================================================================
--- trunk/gtk-sharp/ChangeLog   2007-07-20 19:56:23 UTC (rev 82386)
+++ trunk/gtk-sharp/ChangeLog   2007-07-20 20:25:49 UTC (rev 82387)
@@ -1,5 +1,10 @@
 2007-07-20  Mike Kestner  <[EMAIL PROTECTED]>
 
+       * gtk/Calendar.custom : workaround invalid states in widget when
+       raising month_changed signals.  [Fixes #78524]
+
+2007-07-20  Mike Kestner  <[EMAIL PROTECTED]>
+
        * gtk/gtk-api-2.10.raw : refresh.
        * parser/gapi_pp.pl : combine lines that end in '\' before sending
        them through the pattern matching.  [Fixes #79214]

Modified: trunk/gtk-sharp/gtk/Calendar.custom
===================================================================
--- trunk/gtk-sharp/gtk/Calendar.custom 2007-07-20 19:56:23 UTC (rev 82386)
+++ trunk/gtk-sharp/gtk/Calendar.custom 2007-07-20 20:25:49 UTC (rev 82387)
@@ -26,7 +26,15 @@
 {
        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;
 }
 
 

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

Reply via email to