diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-12-06 04:50:15 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-12-06 04:50:15 +0800 |
commit | 7fef4ba1e95a25b78600434b2a71ce0762db47f1 (patch) | |
tree | 37ff545517f4afe21db534a1bff3c2fbe59643f0 /calendar/gui/e-week-view.c | |
parent | dbc59d48bea9da7292c7a30e37f2f086adb76c2d (diff) | |
download | gsoc2013-evolution-7fef4ba1e95a25b78600434b2a71ce0762db47f1.tar gsoc2013-evolution-7fef4ba1e95a25b78600434b2a71ce0762db47f1.tar.gz gsoc2013-evolution-7fef4ba1e95a25b78600434b2a71ce0762db47f1.tar.bz2 gsoc2013-evolution-7fef4ba1e95a25b78600434b2a71ce0762db47f1.tar.lz gsoc2013-evolution-7fef4ba1e95a25b78600434b2a71ce0762db47f1.tar.xz gsoc2013-evolution-7fef4ba1e95a25b78600434b2a71ce0762db47f1.tar.zst gsoc2013-evolution-7fef4ba1e95a25b78600434b2a71ce0762db47f1.zip |
** Fixes bug #392747 (extra cleanup work)
2007-12-05 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #392747 (extra cleanup work)
* calendar/gui/e-day-view.c (e_day_view_style_set):
* calendar/gui/e-week-view-titles-item.c
(e_week_view_titles_item_draw):
* calendar/gui/e-week-view.c (e_week_view_style_set):
* calendar/gui/print.c (print_month_summary):
* calendar/gui/e-meeting-time-sel.c
(e_meeting_time_selector_recalc_date_form):
Call e_get_month_name() or e_get_weekday_name() instead of
e_utf8_strftime() or g_date_strftime().
e_utf8_strftime() or g_date_strftime().
* widgets/misc/e-calendar-item.c (e_calendar_item_show_popup_menu):
Call e_get_month_name() instead of e_utf8_strftime().
svn path=/trunk/; revision=34659
Diffstat (limited to 'calendar/gui/e-week-view.c')
-rw-r--r-- | calendar/gui/e-week-view.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 47a939a4de..0c3ca360ad 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -52,6 +52,7 @@ #include <misc/e-unicode.h> #include <e-util/e-categories-config.h> #include <e-util/e-dialog-utils.h> +#include <e-util/e-util.h> #include "dialogs/delete-comp.h" #include "dialogs/delete-error.h" #include "dialogs/send-comp.h" @@ -815,8 +816,7 @@ e_week_view_style_set (GtkWidget *widget, gint day, day_width, max_day_width, max_abbr_day_width; gint month, month_width, max_month_width, max_abbr_month_width; gint span_num; - GDate date; - gchar buffer[128]; + const gchar *name; PangoFontDescription *font_desc; PangoContext *pango_context; PangoFontMetrics *font_metrics; @@ -873,37 +873,31 @@ e_week_view_style_set (GtkWidget *widget, /* Save the sizes of various strings in the font, so we can quickly decide which date formats to use. */ - g_date_clear (&date, 1); - g_date_set_dmy (&date, 27, 3, 2000); /* Must be a Monday. */ max_day_width = 0; max_abbr_day_width = 0; for (day = 0; day < 7; day++) { - g_date_strftime (buffer, 128, "%A", &date); - day_width = get_string_width (layout, buffer); + name = e_get_weekday_name (day + 1, FALSE); + day_width = get_string_width (layout, name); week_view->day_widths[day] = day_width; max_day_width = MAX (max_day_width, day_width); - g_date_strftime (buffer, 128, "%a", &date); - day_width = get_string_width (layout, buffer); + name = e_get_weekday_name (day + 1, TRUE); + day_width = get_string_width (layout, name); week_view->abbr_day_widths[day] = day_width; max_abbr_day_width = MAX (max_abbr_day_width, day_width); - - g_date_add_days (&date, 1); } max_month_width = 0; max_abbr_month_width = 0; for (month = 0; month < 12; month++) { - g_date_set_month (&date, month + 1); - - g_date_strftime (buffer, 128, "%B", &date); - month_width = get_string_width (layout, buffer); + name = e_get_month_name (month + 1, FALSE); + month_width = get_string_width (layout, name); week_view->month_widths[month] = month_width; max_month_width = MAX (max_month_width, month_width); - g_date_strftime (buffer, 128, "%b", &date); - month_width = get_string_width (layout, buffer); + name = e_get_month_name (month + 1, TRUE); + month_width = get_string_width (layout, name); week_view->abbr_month_widths[month] = month_width; max_abbr_month_width = MAX (max_abbr_month_width, month_width); } |