aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-12-06 04:50:15 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-12-06 04:50:15 +0800
commit7fef4ba1e95a25b78600434b2a71ce0762db47f1 (patch)
tree37ff545517f4afe21db534a1bff3c2fbe59643f0 /calendar/gui/e-day-view.c
parentdbc59d48bea9da7292c7a30e37f2f086adb76c2d (diff)
downloadgsoc2013-evolution-7fef4ba1e95a25b78600434b2a71ce0762db47f1.tar.gz
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-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c66
1 files changed, 18 insertions, 48 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 45de0472f5..cb5743e3b3 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -1687,8 +1687,8 @@ e_day_view_style_set (GtkWidget *widget,
gint month, day, width;
gint longest_month_width, longest_abbreviated_month_width;
gint longest_weekday_width, longest_abbreviated_weekday_width;
- struct tm date_tm;
gchar buffer[128];
+ const gchar *name;
gint times_width;
PangoFontDescription *font_desc;
PangoContext *pango_context;
@@ -1775,18 +1775,11 @@ e_day_view_style_set (GtkWidget *widget,
e_day_view_update_top_scroll (day_view, TRUE);
/* Find the longest full & abbreviated month names. */
- memset (&date_tm, 0, sizeof (date_tm));
- date_tm.tm_year = 100;
- date_tm.tm_mday = 1;
- date_tm.tm_isdst = -1;
-
longest_month_width = 0;
longest_abbreviated_month_width = 0;
for (month = 0; month < 12; month++) {
- date_tm.tm_mon = month;
-
- e_utf8_strftime (buffer, sizeof (buffer), "%B", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
+ name = e_get_month_name (month + 1, FALSE);
+ pango_layout_set_text (layout, name, -1);
pango_layout_get_pixel_size (layout, &width, NULL);
if (width > longest_month_width) {
@@ -1794,8 +1787,8 @@ e_day_view_style_set (GtkWidget *widget,
day_view->longest_month_name = month;
}
- e_utf8_strftime (buffer, sizeof (buffer), "%b", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
+ name = e_get_month_name (month + 1, TRUE);
+ pango_layout_set_text (layout, name, -1);
pango_layout_get_pixel_size (layout, &width, NULL);
if (width > longest_abbreviated_month_width) {
@@ -1805,19 +1798,11 @@ e_day_view_style_set (GtkWidget *widget,
}
/* Find the longest full & abbreviated weekday names. */
- memset (&date_tm, 0, sizeof (date_tm));
- date_tm.tm_year = 100;
- date_tm.tm_mon = 0;
- date_tm.tm_isdst = -1;
-
longest_weekday_width = 0;
longest_abbreviated_weekday_width = 0;
for (day = 0; day < 7; day++) {
- date_tm.tm_mday = 2 + day;
- date_tm.tm_wday = day;
-
- e_utf8_strftime (buffer, sizeof (buffer), "%A", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
+ name = e_get_weekday_name (day + 1, FALSE);
+ pango_layout_set_text (layout, name, -1);
pango_layout_get_pixel_size (layout, &width, NULL);
if (width > longest_weekday_width) {
@@ -1825,8 +1810,8 @@ e_day_view_style_set (GtkWidget *widget,
day_view->longest_weekday_name = day;
}
- e_utf8_strftime (buffer, sizeof (buffer), "%a", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
+ name = e_get_weekday_name (day + 1, TRUE);
+ pango_layout_set_text (layout, name, -1);
pango_layout_get_pixel_size (layout, &width, NULL);
if (width > longest_abbreviated_weekday_width) {
@@ -1888,8 +1873,8 @@ e_day_view_style_set (GtkWidget *widget,
gint month, day, width;
gint longest_month_width, longest_abbreviated_month_width;
gint longest_weekday_width, longest_abbreviated_weekday_width;
- struct tm date_tm;
gchar buffer[128];
+ const gchar *name;
gint times_width;
PangoFontDescription *font_desc;
PangoContext *pango_context;
@@ -1969,18 +1954,11 @@ e_day_view_style_set (GtkWidget *widget,
e_day_view_update_top_scroll (day_view, TRUE);
/* Find the longest full & abbreviated month names. */
- memset (&date_tm, 0, sizeof (date_tm));
- date_tm.tm_year = 100;
- date_tm.tm_mday = 1;
- date_tm.tm_isdst = -1;
-
longest_month_width = 0;
longest_abbreviated_month_width = 0;
for (month = 0; month < 12; month++) {
- date_tm.tm_mon = month;
-
- e_utf8_strftime (buffer, sizeof (buffer), "%B", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
+ name = e_get_month_name (month + 1, FALSE);
+ pango_layout_set_text (layout, name, -1);
pango_layout_get_pixel_size (layout, &width, NULL);
if (width > longest_month_width) {
@@ -1988,8 +1966,8 @@ e_day_view_style_set (GtkWidget *widget,
day_view->longest_month_name = month;
}
- e_utf8_strftime (buffer, sizeof (buffer), "%b", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
+ name = e_get_month_name (month + 1, TRUE);
+ pango_layout_set_text (layout, name, -1);
pango_layout_get_pixel_size (layout, &width, NULL);
if (width > longest_abbreviated_month_width) {
@@ -1999,19 +1977,11 @@ e_day_view_style_set (GtkWidget *widget,
}
/* Find the longest full & abbreviated weekday names. */
- memset (&date_tm, 0, sizeof (date_tm));
- date_tm.tm_year = 100;
- date_tm.tm_mon = 0;
- date_tm.tm_isdst = -1;
-
longest_weekday_width = 0;
longest_abbreviated_weekday_width = 0;
for (day = 0; day < 7; day++) {
- date_tm.tm_mday = 2 + day;
- date_tm.tm_wday = day;
-
- e_utf8_strftime (buffer, sizeof (buffer), "%A", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
+ name = e_get_weekday_name (day + 1, FALSE);
+ pango_layout_set_text (layout, name, -1);
pango_layout_get_pixel_size (layout, &width, NULL);
if (width > longest_weekday_width) {
@@ -2019,8 +1989,8 @@ e_day_view_style_set (GtkWidget *widget,
day_view->longest_weekday_name = day;
}
- e_utf8_strftime (buffer, sizeof (buffer), "%a", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
+ name = e_get_weekday_name (day + 1, TRUE);
+ pango_layout_set_text (layout, name, -1);
pango_layout_get_pixel_size (layout, &width, NULL);
if (width > longest_abbreviated_weekday_width) {