diff options
author | root <root@rshg054.dnsready.net> | 2013-08-11 01:21:34 -0700 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2013-08-11 01:21:34 -0700 |
commit | 18a41d682d6e91e0d28fce23eb75292f477bd620 (patch) | |
tree | bce8f660d7d0b6541cadbc49bf1bac2434e4c0c6 /community/parcellite/history_menu_crash_patch | |
parent | 0ade1da67addf154d93c6a6399b0a3d5a18a3336 (diff) |
Sun Aug 11 01:21:31 PDT 2013
Diffstat (limited to 'community/parcellite/history_menu_crash_patch')
-rw-r--r-- | community/parcellite/history_menu_crash_patch | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/community/parcellite/history_menu_crash_patch b/community/parcellite/history_menu_crash_patch deleted file mode 100644 index 961106839..000000000 --- a/community/parcellite/history_menu_crash_patch +++ /dev/null @@ -1,39 +0,0 @@ -Index: main.c -=================================================================== ---- main.c (revision 232) -+++ main.c (working copy) -@@ -1199,24 +1199,28 @@ - { - GString* string = g_string_new((gchar*)element->data); - /* Ellipsize text */ -- if (string->len > prefs.item_length) -+ glong len = g_utf8_strlen(string->str, string->len); -+ if (len > prefs.item_length) - { - switch (prefs.ellipsize) - { - case PANGO_ELLIPSIZE_START: -- string = g_string_erase(string, 0, string->len-(prefs.item_length)); -+ string = g_string_erase(string, 0, g_utf8_offset_to_pointer(string->str, len - prefs.item_length) - string->str); - string = g_string_prepend(string, "..."); - break; - case PANGO_ELLIPSIZE_MIDDLE: -- string = g_string_erase(string, (prefs.item_length/2), string->len-(prefs.item_length)); -- string = g_string_insert(string, (string->len/2), "..."); -+ ; /* to avoid wierd gcc error */ -+ gchar* p1 = g_utf8_offset_to_pointer(string->str, prefs.item_length / 2); -+ gchar* p2 = g_utf8_offset_to_pointer(string->str, len - prefs.item_length / 2); -+ string = g_string_erase(string, p1 - string->str, p2 - p1); -+ string = g_string_insert(string, p1 - string->str, "..."); - break; - case PANGO_ELLIPSIZE_END: -- string = g_string_truncate(string, prefs.item_length); -+ string = g_string_truncate(string, g_utf8_offset_to_pointer(string->str, prefs.item_length) - string->str); - string = g_string_append(string, "..."); - break; - } -- } -+ } - /* Remove control characters */ - gsize i = 0; - while (i < string->len) |