From a37c55760048564773e65bc3b94e9c52406ca403 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 30 Jul 2007 10:01:20 +0000 Subject: 2007-07-30 mcrha Fix for bug #343716 svn path=/trunk/; revision=33898 --- calendar/ChangeLog | 8 ++++++++ calendar/gui/dialogs/memo-page.c | 40 +++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index a3586a69d6..ee2bda838a 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2007-07-30 Milan Crha + + ** Fix for bug #343716 + + * gui/dialogs/memo-page.c: (memo_page_fill_component): + Working properly with UTF-8 characters when cutting and + added ellipsize for longer texts. + 2007-07-30 Chenthill Palanisamy Fixes #453860 diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 6f2d1af20f..816144042c 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -634,32 +634,30 @@ memo_page_fill_component (CompEditorPage *page, ECalComponent *comp) e_cal_component_set_description_list (comp, NULL); } else { - int idxToUse = -1, nstr = strlen(str); - gboolean foundNL = FALSE; + int idxToUse = 1; GSList l; ECalComponentText text, sumText; - char *txt; - - for(i = 0; i 50){ - sumText.value = txt = g_strndup(str, 50); - } - else{ - sumText.value = txt = g_strdup(str); - } - } - else{ - sumText.value = txt = g_strndup(str, idxToUse); /* cuts off '\n' */ - } - + + if (p) + idxToUse = p - str; + + if (i == 50 && uc && uc < (gunichar)-2) + sumText.value = txt = g_strdup_printf ("%.*s...", idxToUse, str); + else + sumText.value = txt = g_strndup(str, idxToUse); + sumText.altrep = NULL; text.value = str; -- cgit v1.2.3