diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-12-03 21:19:39 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-12-03 21:19:39 +0800 |
commit | 796e7ca63b134fca7767d1b009aa973c03fd46a6 (patch) | |
tree | 1c43762c65bc236403e02c5d5f0ffd531ada3d80 /a11y/widgets | |
parent | 0432e0fb2709cf09a898a8c9cf914ed7e81e88b1 (diff) | |
download | gsoc2013-evolution-796e7ca63b134fca7767d1b009aa973c03fd46a6.tar gsoc2013-evolution-796e7ca63b134fca7767d1b009aa973c03fd46a6.tar.gz gsoc2013-evolution-796e7ca63b134fca7767d1b009aa973c03fd46a6.tar.bz2 gsoc2013-evolution-796e7ca63b134fca7767d1b009aa973c03fd46a6.tar.lz gsoc2013-evolution-796e7ca63b134fca7767d1b009aa973c03fd46a6.tar.xz gsoc2013-evolution-796e7ca63b134fca7767d1b009aa973c03fd46a6.tar.zst gsoc2013-evolution-796e7ca63b134fca7767d1b009aa973c03fd46a6.zip |
** Fixes bug #392747
2007-12-03 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #392747
* e-util/e-utils.c (e_get_month_name), (e_get_weekday_name):
New functions cache localized month and weekday names (respectively)
for easier retrieval than resorting to strftime().
* a11y/widgets/ea-calendar-item.c (ea_calendar_item_get_column_label):
Get the column label via e_get_weekday_name().
* calendar/gui/weekday-picker.c (get_day_text):
Convert the day_index to GDateWeekday and call e_get_weekday_name().
* widgets/misc/e-calendar-item.h (struct _ECalendarItem):
* widgets/misc/e-calendar-item.c (e_calendar_item_init),
(e_calendar_item_draw):
Lose the local weekday name cache and just call e_get_weekday_name().
svn path=/trunk/; revision=34627
Diffstat (limited to 'a11y/widgets')
-rw-r--r-- | a11y/widgets/ea-calendar-item.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/a11y/widgets/ea-calendar-item.c b/a11y/widgets/ea-calendar-item.c index 585eba796d..00cba1b477 100644 --- a/a11y/widgets/ea-calendar-item.c +++ b/a11y/widgets/ea-calendar-item.c @@ -1119,8 +1119,7 @@ ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, gint column, AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - gchar *week_char; - gint char_size; + const gchar *abbr_name; g_return_val_if_fail (ea_calitem, FALSE); @@ -1129,17 +1128,12 @@ ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, gint column, if (!g_obj) return FALSE; + /* Columns are 0 = Monday ... 6 = Sunday */ calitem = E_CALENDAR_ITEM (g_obj); - week_char = g_utf8_offset_to_pointer (calitem->days, column); - char_size = strlen (calitem->days) - - strlen (g_utf8_find_next_char (calitem->days, NULL)); - - if (week_char && char_size < buffer_size) { - memcpy (buffer, week_char, char_size); - buffer[char_size] = '\0'; - return TRUE; - } - return FALSE; + abbr_name = e_get_weekday_name (column + 1, TRUE); + g_strlcpy (buffer, abbr_name, buffer_size); + + return TRUE; } /* the coordinate the e-calendar canvas coord */ |