Mercurial > pidgin.yaz
comparison finch/libgnt/gnttextview.c @ 18873:7066896f6628
disapproval of revision 'a4ce7b8adf2db74d531c35278fe83247d90ce4b1'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 11 Aug 2007 04:19:32 +0000 |
parents | 85b155a574a3 |
children | 40c3e3857458 |
comparison
equal
deleted
inserted
replaced
18872:85b155a574a3 | 18873:7066896f6628 |
---|---|
374 | 374 |
375 view->string = g_string_set_size(view->string, string->len); | 375 view->string = g_string_set_size(view->string, string->len); |
376 view->string->len = 0; | 376 view->string->len = 0; |
377 GNT_WIDGET_SET_FLAGS(GNT_WIDGET(view), GNT_WIDGET_DRAWING); | 377 GNT_WIDGET_SET_FLAGS(GNT_WIDGET(view), GNT_WIDGET_DRAWING); |
378 | 378 |
379 g_object_set_data(G_OBJECT(view), "resizing", GINT_TO_POINTER(TRUE)); | |
380 for (; back; back = back->prev) { | 379 for (; back; back = back->prev) { |
381 line = back->data; | 380 line = back->data; |
382 if (back->next && !line->soft) { | 381 if (back->next && !line->soft) { |
383 gnt_text_view_append_text_with_flags(view, "\n", GNT_TEXT_FLAG_NORMAL); | 382 gnt_text_view_append_text_with_flags(view, "\n", GNT_TEXT_FLAG_NORMAL); |
384 } | 383 } |
393 *end = back; | 392 *end = back; |
394 } | 393 } |
395 free_text_line(line, NULL); | 394 free_text_line(line, NULL); |
396 } | 395 } |
397 g_list_free(list); | 396 g_list_free(list); |
398 g_object_set_data(G_OBJECT(view), "resizing", GINT_TO_POINTER(FALSE)); | |
399 | 397 |
400 list = view->list = g_list_first(view->list); | 398 list = view->list = g_list_first(view->list); |
401 /* Go back to the line that was in view before resizing started */ | 399 /* Go back to the line that was in view before resizing started */ |
402 while (pos--) { | 400 while (pos--) { |
403 while (((GntTextLine*)list->data)->soft) | 401 while (((GntTextLine*)list->data)->soft) |
507 gboolean wrap_word = !(view->flags & GNT_TEXT_VIEW_WRAP_CHAR); | 505 gboolean wrap_word = !(view->flags & GNT_TEXT_VIEW_WRAP_CHAR); |
508 | 506 |
509 if (text == NULL || *text == '\0') | 507 if (text == NULL || *text == '\0') |
510 return; | 508 return; |
511 | 509 |
512 if (!g_object_get_data(G_OBJECT(view), "resizing")) | |
513 text = gnt_util_localize_string(text); | |
514 fl = gnt_text_format_flag_to_chtype(flags); | 510 fl = gnt_text_format_flag_to_chtype(flags); |
515 | 511 |
516 len = view->string->len; | 512 len = view->string->len; |
517 view->string = g_string_append(view->string, text); | 513 view->string = g_string_append(view->string, text); |
518 | 514 |
703 { | 699 { |
704 GList *alllines = g_list_first(view->list); | 700 GList *alllines = g_list_first(view->list); |
705 GList *list, *next, *iter, *inext; | 701 GList *list, *next, *iter, *inext; |
706 const int text_length = text ? strlen(text) : 0; | 702 const int text_length = text ? strlen(text) : 0; |
707 int count = 0; | 703 int count = 0; |
708 text = gnt_util_localize_string(text); | |
709 for (list = view->tags; list; list = next) { | 704 for (list = view->tags; list; list = next) { |
710 GntTextTag *tag = list->data; | 705 GntTextTag *tag = list->data; |
711 next = list->next; | 706 next = list->next; |
712 if (strcmp(tag->name, name) == 0) { | 707 if (strcmp(tag->name, name) == 0) { |
713 int change; | 708 int change; |