Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 147031 Details for
Bug 214415
x11-misc/periodic-calendar-2.1 doesn't correctly check for invalid dates
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
periodic-calendar-january0.patch (text/plain), 2.63 KB, created by
Paul Goldbaum (AMD64 Arch Tester)
on 2008-03-23 17:48:28 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Paul Goldbaum (AMD64 Arch Tester)
Created:
2008-03-23 17:48:28 UTC
Size:
2.63 KB
patch
obsolete
>diff -Naur PeriodicCalendar-2.1/src/dateselect.cpp /root/PeriodicCalendar-2.1/src/dateselect.cpp >--- PeriodicCalendar-2.1/src/dateselect.cpp 2005-08-20 16:52:27.000000000 +0200 >+++ /root/PeriodicCalendar-2.1/src/dateselect.cpp 2008-03-23 18:28:30.000000000 +0100 >@@ -167,6 +167,11 @@ > guint max_days; > pDateSelectionDialogCalendar->get_date(new_year, new_month, new_day); > new_month = monthSpinButton->get_value_as_int()-1; >+ if((new_year == 1) && (new_month == 0)) { // 0 because he did -1 in the line before >+ // This is an invalid combination so we set it to february >+ new_month++; >+ monthSpinButton->set_value(new_month+1); >+ } > max_days = int(Glib::Date::get_days_in_month(Glib::Date::Month(new_month+1),new_year)); > daySpinButton->set_range(1, max_days); > if(max_days<new_day) pDateSelectionDialogCalendar->select_day(max_days); >@@ -184,6 +189,11 @@ > guint max_days; > pDateSelectionDialogCalendar->get_date(new_year, new_month, new_day); > new_year = yearSpinButton->get_value_as_int(); >+ if((new_year == 1) && (new_month == 0)) { >+ // This is an invalid combination so we set it to february >+ new_month++; >+ monthSpinButton->set_value(new_month+1); >+ } > max_days = int(Glib::Date::get_days_in_month(Glib::Date::Month(new_month+1),new_year)); > daySpinButton->set_range(1, max_days); > if(max_days<new_day) pDateSelectionDialogCalendar->select_day(max_days); >diff -Naur PeriodicCalendar-2.1/src/mainwindow.cpp /root/PeriodicCalendar-2.1/src/mainwindow.cpp >--- PeriodicCalendar-2.1/src/mainwindow.cpp 2005-11-07 21:37:17.000000000 +0100 >+++ /root/PeriodicCalendar-2.1/src/mainwindow.cpp 2008-03-23 18:24:42.000000000 +0100 >@@ -1145,12 +1145,17 @@ > if(!( > (cal_current_date.get_month() != model_current_date->get_month()) && > (cal_current_date > *model_current_date))) { >- *model_current_date = (*model_current_date).subtract_months(1); >+ >+ // Glib doesn't like January of year 1 >+ if(!((model_current_date->get_month() == 2) && (model_current_date->get_year() == 1))) >+ *model_current_date = (*model_current_date).subtract_months(1); > } > refreshCalendarView(); > } > void PCalMainWindow::prevYear() { >- *model_current_date = (*model_current_date).subtract_years(1); >+ if((model_current_date->get_year() != 1) && >+ (!((model_current_date->get_year() == 2) && (model_current_date->get_month() == 1)))) >+ *model_current_date = (*model_current_date).subtract_years(1); > refreshCalendarView(); > } > void PCalMainWindow::today() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 214415
: 147031 |
156707