From: <rl...@us...> - 2006-09-06 00:36:08
|
Revision: 17171 http://svn.sourceforge.net/gaim/?rev=17171&view=rev Author: rlaager Date: 2006-09-05 17:36:04 -0700 (Tue, 05 Sep 2006) Log Message: ----------- SF Patch #1551607 from Alex Badea: "I'm not entirely sure what causes it in general, but on my system it's triggered (only sometimes) by the History plugin on a Yahoo account." The almost identical SF Patch #1549604 from Valdis Kletnieks says: "Unchecked dereference of 'oldfont' in gtkimhtml.c causes a crash when starting up, as 'oldfont' isn't set." Modified Paths: -------------- trunk/gtk/gtkimhtml.c Modified: trunk/gtk/gtkimhtml.c =================================================================== --- trunk/gtk/gtkimhtml.c 2006-09-06 00:04:45 UTC (rev 17170) +++ trunk/gtk/gtkimhtml.c 2006-09-06 00:36:04 UTC (rev 17171) @@ -2902,7 +2902,7 @@ else font->bold = 0; } - if((font->bold && !oldfont->bold) || (oldfont->bold && !font->bold)) + if ((font->bold && oldfont && !oldfont->bold) || (oldfont && oldfont->bold && !font->bold) || (font->bold && !oldfont)) { gtk_imhtml_toggle_bold(imhtml); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-10-04 18:13:24
|
Revision: 17428 http://svn.sourceforge.net/gaim/?rev=17428&view=rev Author: seanegan Date: 2006-10-04 11:13:22 -0700 (Wed, 04 Oct 2006) Log Message: ----------- Make smaller fonts less small Modified Paths: -------------- trunk/gtk/gtkimhtml.c Modified: trunk/gtk/gtkimhtml.c =================================================================== --- trunk/gtk/gtkimhtml.c 2006-10-04 12:31:26 UTC (rev 17427) +++ trunk/gtk/gtkimhtml.c 2006-10-04 18:13:22 UTC (rev 17428) @@ -120,7 +120,7 @@ /* POINT_SIZE converts from AIM font sizes to a point size scale factor. */ #define MAX_FONT_SIZE 7 #define POINT_SIZE(x) (_point_sizes [MIN ((x > 0 ? x : 1), MAX_FONT_SIZE) - 1]) -static gdouble _point_sizes [] = { .69444444, .8333333, 1, 1.2, 1.44, 1.728, 2.0736}; +static gdouble _point_sizes [] = { .85, .95, 1, 1.2, 1.44, 1.728, 2.0736}; enum { TARGET_HTML, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-10-18 04:21:17
|
Revision: 17516 http://svn.sourceforge.net/gaim/?rev=17516&view=rev Author: sadrul Date: 2006-10-17 21:21:10 -0700 (Tue, 17 Oct 2006) Log Message: ----------- Memleak fixes in gtkimhtml. Thanks to henningn for reporting exactly where the leaks were happening. Modified Paths: -------------- trunk/gtk/gtkimhtml.c Modified: trunk/gtk/gtkimhtml.c =================================================================== --- trunk/gtk/gtkimhtml.c 2006-10-18 04:15:43 UTC (rev 17515) +++ trunk/gtk/gtkimhtml.c 2006-10-18 04:21:10 UTC (rev 17516) @@ -2599,23 +2599,21 @@ if (font->face && (imhtml->format_functions & GTK_IMHTML_FACE)) { gtk_imhtml_toggle_fontface(imhtml, NULL); - g_free (font->face); } + g_free (font->face); if (font->fore && (imhtml->format_functions & GTK_IMHTML_FORECOLOR)) { gtk_imhtml_toggle_forecolor(imhtml, NULL); - g_free (font->fore); } + g_free (font->fore); if (font->back && (imhtml->format_functions & GTK_IMHTML_BACKCOLOR)) { gtk_imhtml_toggle_backcolor(imhtml, NULL); - g_free (font->back); } - if (font->sml) - g_free (font->sml); + g_free (font->back); + g_free (font->sml); if ((font->size != 3) && (imhtml->format_functions & (GTK_IMHTML_GROW|GTK_IMHTML_SHRINK))) gtk_imhtml_font_set_size(imhtml, 3); - fonts = g_slist_remove (fonts, font); g_free(font); @@ -2680,17 +2678,20 @@ if (color && !(options & GTK_IMHTML_NO_COLOURS) && (imhtml->format_functions & GTK_IMHTML_FORECOLOR)) { font->fore = color; gtk_imhtml_toggle_forecolor(imhtml, font->fore); - } + } else + g_free(color); if (back && !(options & GTK_IMHTML_NO_COLOURS) && (imhtml->format_functions & GTK_IMHTML_BACKCOLOR)) { font->back = back; gtk_imhtml_toggle_backcolor(imhtml, font->back); - } + } else + g_free(back); if (face && !(options & GTK_IMHTML_NO_FONTS) && (imhtml->format_functions & GTK_IMHTML_FACE)) { font->face = face; gtk_imhtml_toggle_fontface(imhtml, font->face); - } + } else + g_free(face); if (sml) font->sml = sml; @@ -2706,7 +2707,7 @@ font->size = MAX (0, 3 - font->size); } else if (isdigit (*size)) { sscanf (size, "%hd", &font->size); - } + } if (font->size > 100) font->size = 100; } else if (oldfont) @@ -2729,7 +2730,8 @@ g_free(bg); bg = bgcolor; gtk_imhtml_toggle_background(imhtml, bg); - } + } else + g_free(bgcolor); } break; case 45: /* A (opt) */ @@ -2809,29 +2811,32 @@ if (fonts) oldfont = fonts->data; - if (color && !(options & GTK_IMHTML_NO_COLOURS) && (imhtml->format_functions & GTK_IMHTML_FORECOLOR)) - { + if (color && !(options & GTK_IMHTML_NO_COLOURS) && (imhtml->format_functions & GTK_IMHTML_FORECOLOR)) { font->fore = color; gtk_imhtml_toggle_forecolor(imhtml, font->fore); + } else { + if (oldfont && oldfont->fore) + font->fore = g_strdup(oldfont->fore); + g_free(color); } - else if (oldfont && oldfont->fore) - font->fore = g_strdup(oldfont->fore); - if (background && !(options & GTK_IMHTML_NO_COLOURS) && (imhtml->format_functions & GTK_IMHTML_BACKCOLOR)) - { + if (background && !(options & GTK_IMHTML_NO_COLOURS) && (imhtml->format_functions & GTK_IMHTML_BACKCOLOR)) { font->back = background; gtk_imhtml_toggle_backcolor(imhtml, font->back); + } else { + if (oldfont && oldfont->back) + font->back = g_strdup(oldfont->back); + g_free(background); } - else if (oldfont && oldfont->back) - font->back = g_strdup(oldfont->back); - if (family && !(options & GTK_IMHTML_NO_FONTS) && (imhtml->format_functions & GTK_IMHTML_FACE)) - { + if (family && !(options & GTK_IMHTML_NO_FONTS) && (imhtml->format_functions & GTK_IMHTML_FACE)) { font->face = family; gtk_imhtml_toggle_fontface(imhtml, font->face); + } else { + if (oldfont && oldfont->face) + font->face = g_strdup(oldfont->face); + g_free(family); } - else if (oldfont && oldfont->face) - font->face = g_strdup(oldfont->face); if (font->face && (atoi(font->face) > 100)) { /* WTF is this? */ /* Maybe it sets a max size on the font face? I seem to @@ -2878,7 +2883,8 @@ { gtk_imhtml_toggle_underline(imhtml); font->underline = 1; - } + } else + g_free(textdec); if (oldfont) { @@ -2906,6 +2912,7 @@ { gtk_imhtml_toggle_bold(imhtml); } + g_free(weight); } g_free(style); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-10-23 18:11:02
|
Revision: 17566 http://svn.sourceforge.net/gaim/?rev=17566&view=rev Author: datallah Date: 2006-10-23 11:10:51 -0700 (Mon, 23 Oct 2006) Log Message: ----------- fix searching in an empty conversation (SF bug #1582852) Modified Paths: -------------- trunk/gtk/gtkimhtml.c Modified: trunk/gtk/gtkimhtml.c =================================================================== --- trunk/gtk/gtkimhtml.c 2006-10-23 17:53:55 UTC (rev 17565) +++ trunk/gtk/gtkimhtml.c 2006-10-23 18:10:51 UTC (rev 17566) @@ -3531,22 +3531,25 @@ { GtkTextIter iter, start, end; gboolean new_search = TRUE; + GtkTextMark *start_mark; g_return_val_if_fail(imhtml != NULL, FALSE); g_return_val_if_fail(text != NULL, FALSE); - if (imhtml->search_string && !strcmp(text, imhtml->search_string)) + start_mark = gtk_text_buffer_get_mark(imhtml->text_buffer, "search"); + + if (start_mark && imhtml->search_string && !strcmp(text, imhtml->search_string)) new_search = FALSE; if (new_search) { gtk_imhtml_search_clear(imhtml); + g_free(imhtml->search_string); + imhtml->search_string = g_strdup(text); gtk_text_buffer_get_start_iter(imhtml->text_buffer, &iter); } else { gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, - gtk_text_buffer_get_mark(imhtml->text_buffer, "search")); + start_mark); } - g_free(imhtml->search_string); - imhtml->search_string = g_strdup(text); if (gtk_source_iter_forward_search(&iter, imhtml->search_string, GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_CASE_INSENSITIVE, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-11-06 06:54:29
|
Revision: 17680 http://svn.sourceforge.net/gaim/?rev=17680&view=rev Author: thekingant Date: 2006-11-05 22:54:14 -0800 (Sun, 05 Nov 2006) Log Message: ----------- Something I noticed a little while ago Modified Paths: -------------- trunk/gtk/gtkimhtml.c Modified: trunk/gtk/gtkimhtml.c =================================================================== --- trunk/gtk/gtkimhtml.c 2006-11-06 06:53:34 UTC (rev 17679) +++ trunk/gtk/gtkimhtml.c 2006-11-06 06:54:14 UTC (rev 17680) @@ -813,6 +813,11 @@ menuitem = gtk_menu_item_new_with_mnemonic(_("Paste as Plain _Text")); gtk_widget_show(menuitem); + /* + * TODO: gtk_clipboard_wait_is_text_available() iterates the glib + * mainloop, which tends to be a source of bugs. It would + * be good to audit this or change it to not wait. + */ gtk_widget_set_sensitive(menuitem, (imhtml->editable && gtk_clipboard_wait_is_text_available( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-11-22 21:33:54
|
Revision: 17814 http://svn.sourceforge.net/gaim/?rev=17814&view=rev Author: seanegan Date: 2006-11-22 13:33:51 -0800 (Wed, 22 Nov 2006) Log Message: ----------- Make searching in conversations search backwards. Presumingly you want to see the most recent mentions of your search term first. I use it mostly for searching my nick when I See a blue tab in #gaim, and this is useful for that. Modified Paths: -------------- trunk/gtk/gtkimhtml.c Modified: trunk/gtk/gtkimhtml.c =================================================================== --- trunk/gtk/gtkimhtml.c 2006-11-22 20:10:01 UTC (rev 17813) +++ trunk/gtk/gtkimhtml.c 2006-11-22 21:33:51 UTC (rev 17814) @@ -3550,24 +3550,24 @@ gtk_imhtml_search_clear(imhtml); g_free(imhtml->search_string); imhtml->search_string = g_strdup(text); - gtk_text_buffer_get_start_iter(imhtml->text_buffer, &iter); + gtk_text_buffer_get_end_iter(imhtml->text_buffer, &iter); } else { gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, start_mark); } - if (gtk_source_iter_forward_search(&iter, imhtml->search_string, + if (gtk_source_iter_backward_search(&iter, imhtml->search_string, GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_CASE_INSENSITIVE, &start, &end, NULL)) { gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(imhtml), &start, 0, TRUE, 0, 0); - gtk_text_buffer_create_mark(imhtml->text_buffer, "search", &end, FALSE); + gtk_text_buffer_create_mark(imhtml->text_buffer, "search", &start, FALSE); if (new_search) { gtk_text_buffer_remove_tag_by_name(imhtml->text_buffer, "search", &iter, &end); do gtk_text_buffer_apply_tag_by_name(imhtml->text_buffer, "search", &start, &end); - while (gtk_source_iter_forward_search(&end, imhtml->search_string, + while (gtk_source_iter_backward_search(&start, imhtml->search_string, GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_CASE_INSENSITIVE, &start, &end, NULL)); @@ -3577,14 +3577,14 @@ else if (!new_search) { /* We hit the end, so start at the beginning again. */ - gtk_text_buffer_get_start_iter(imhtml->text_buffer, &iter); + gtk_text_buffer_get_end_iter(imhtml->text_buffer, &iter); - if (gtk_source_iter_forward_search(&iter, imhtml->search_string, + if (gtk_source_iter_backward_search(&iter, imhtml->search_string, GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_CASE_INSENSITIVE, &start, &end, NULL)) { gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(imhtml), &start, 0, TRUE, 0, 0); - gtk_text_buffer_create_mark(imhtml->text_buffer, "search", &end, FALSE); + gtk_text_buffer_create_mark(imhtml->text_buffer, "search", &start, FALSE); return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-11-28 06:37:12
|
Revision: 17833 http://svn.sourceforge.net/gaim/?rev=17833&view=rev Author: datallah Date: 2006-11-27 22:37:12 -0800 (Mon, 27 Nov 2006) Log Message: ----------- Fix "Paste" and "Paste as Plain Text" from the imhtml on win32. This was apparently broken by gtk changing how the clipboard is handled internally. This is a much cleaner way to do this anyway. I should probably check if it works on GTK+ 2.6.10. Modified Paths: -------------- trunk/gtk/gtkimhtml.c Modified: trunk/gtk/gtkimhtml.c =================================================================== --- trunk/gtk/gtkimhtml.c 2006-11-28 00:15:31 UTC (rev 17832) +++ trunk/gtk/gtkimhtml.c 2006-11-28 06:37:12 UTC (rev 17833) @@ -142,7 +142,11 @@ static guint signals [LAST_SIGNAL] = { 0 }; static GtkTargetEntry selection_targets[] = { +#ifndef _WIN32 { "text/html", 0, TARGET_HTML }, +#else + { "HTML Format", 0, TARGET_HTML }, +#endif { "UTF8_STRING", 0, TARGET_UTF8_STRING }, { "COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT }, { "STRING", 0, TARGET_STRING }, @@ -153,11 +157,6 @@ }; #ifdef _WIN32 -/* Win32 clipboard format value, and functions to convert back and - * forth between HTML and the clipboard format. - */ -static UINT win_html_fmt; - static gchar * clipboard_win32_to_html(char *clipboard) { const char *header; @@ -241,38 +240,18 @@ return g_string_free(clipboard, FALSE); } -static void clipboard_copy_html_win32(GtkIMHtml *imhtml) { - gchar *clipboard = clipboard_html_to_win32(imhtml->clipboard_html_string); - if (clipboard != NULL) { - HWND hwnd = GDK_WINDOW_HWND(GTK_WIDGET(imhtml)->window); - if (OpenClipboard(hwnd)) { - if (EmptyClipboard()) { - gint length = strlen(clipboard); - HGLOBAL hdata = GlobalAlloc(GMEM_MOVEABLE, length); - if (hdata != NULL) { - gchar *buffer = GlobalLock(hdata); - memcpy(buffer, clipboard, length); - GlobalUnlock(hdata); - - if (SetClipboardData(win_html_fmt, hdata) == NULL) { - gchar *err_msg = - g_win32_error_message(GetLastError()); - gaim_debug_info("html clipboard", - "Unable to set clipboard data: %s\n", - err_msg ? err_msg : "Unknown Error"); - g_free(err_msg); - } - } - } - CloseClipboard(); - } - g_free(clipboard); - } -} - static gboolean clipboard_paste_html_win32(GtkIMHtml *imhtml) { gboolean pasted = FALSE; + /* Win32 clipboard format value, and functions to convert back and + * forth between HTML and the clipboard format. + */ + static UINT win_html_fmt = 0; + + /* Register HTML Format as desired clipboard format */ + if (!win_html_fmt) + win_html_fmt = RegisterClipboardFormat("HTML Format"); + if (gtk_text_view_get_editable(GTK_TEXT_VIEW(imhtml)) && IsClipboardFormatAvailable(win_html_fmt)) { gboolean error_reading_clipboard = FALSE; @@ -281,7 +260,8 @@ if (OpenClipboard(hwnd)) { HGLOBAL hdata = GetClipboardData(win_html_fmt); if (hdata == NULL) { - error_reading_clipboard = TRUE; + if (GetLastError() != ERROR_SUCCESS) + error_reading_clipboard = TRUE; } else { char *buffer = GlobalLock(hdata); if (buffer == NULL) { @@ -298,7 +278,6 @@ } CloseClipboard(); - } else { error_reading_clipboard = TRUE; } @@ -892,7 +871,7 @@ static void gtk_imhtml_clipboard_get(GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, GtkIMHtml *imhtml) { - char *text; + char *text = NULL; gboolean primary; GtkTextIter start, end; GtkTextMark *sel = gtk_text_buffer_get_selection_bound(imhtml->text_buffer); @@ -903,8 +882,9 @@ primary = gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_PRIMARY) == clipboard; if (info == TARGET_HTML) { - gsize len; char *selection; +#ifndef _WIN32 + gsize len; GString *str = g_string_new(NULL); if (primary) { text = gtk_imhtml_get_markup_range(imhtml, &start, &end); @@ -918,6 +898,10 @@ selection = g_convert(str->str, str->len, "UCS-2", "UTF-8", NULL, &len, NULL); gtk_selection_data_set(selection_data, gdk_atom_intern("text/html", FALSE), 16, (const guchar *)selection, len); g_string_free(str, TRUE); +#else + selection = clipboard_html_to_win32(imhtml->clipboard_html_string); + gtk_selection_data_set(selection_data, gdk_atom_intern("HTML Format", FALSE), 8, (const guchar *)selection, strlen(selection)); +#endif g_free(selection); } else { if (primary) { @@ -968,12 +952,6 @@ imhtml->clipboard_html_string = gtk_imhtml_get_markup_range(imhtml, &start, &end); imhtml->clipboard_text_string = gtk_imhtml_get_text(imhtml, &start, &end); -#ifdef _WIN32 - /* We're going to still copy plain text, but let's toss the "HTML Format" - we need into the windows clipboard now as well. */ - clipboard_copy_html_win32(imhtml); -#endif - g_signal_stop_emission_by_name(imhtml, "copy-clipboard"); } @@ -999,12 +977,6 @@ imhtml->clipboard_html_string = gtk_imhtml_get_markup_range(imhtml, &start, &end); imhtml->clipboard_text_string = gtk_imhtml_get_text(imhtml, &start, &end); -#ifdef _WIN32 - /* We're going to still copy plain text, but let's toss the "HTML Format" - we need into the windows clipboard now as well. */ - clipboard_copy_html_win32(imhtml); -#endif - if (imhtml->editable) gtk_text_buffer_delete_selection(imhtml->text_buffer, FALSE, FALSE); g_signal_stop_emission_by_name(imhtml, "cut-clipboard"); @@ -1431,11 +1403,6 @@ gtk_imhtml_set_editable(imhtml, FALSE); g_signal_connect(G_OBJECT(imhtml), "populate-popup", G_CALLBACK(hijack_menu_cb), NULL); - -#ifdef _WIN32 - /* Register HTML Format as desired clipboard format */ - win_html_fmt = RegisterClipboardFormat("HTML Format"); -#endif } GtkWidget *gtk_imhtml_new(void *a, void *b) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-26 20:40:11
|
Revision: 18059 http://svn.sourceforge.net/gaim/?rev=18059&view=rev Author: sadrul Date: 2006-12-26 12:40:05 -0800 (Tue, 26 Dec 2006) Log Message: ----------- Fix bug #1622466 ("Don't substitute smileys in URIs") by disabling smileys for links. This is going to cause smileys to be disabled for stuff like "<a href='abc'>check this out ;)</a>" too. Do people use links/smileys like this a lot? If they do, this probably needs to be reverted. Modified Paths: -------------- trunk/gtk/gtkimhtml.c Modified: trunk/gtk/gtkimhtml.c =================================================================== --- trunk/gtk/gtkimhtml.c 2006-12-26 19:22:03 UTC (rev 18058) +++ trunk/gtk/gtkimhtml.c 2006-12-26 20:40:05 UTC (rev 18059) @@ -2966,7 +2966,8 @@ c += tlen; pos += tlen; g_free(tag); /* This was allocated back in VALID_TAG() */ - } else if (gtk_imhtml_is_smiley(imhtml, fonts, c, &smilelen)) { + } else if (imhtml->edit.link == NULL && + gtk_imhtml_is_smiley(imhtml, fonts, c, &smilelen)) { GtkIMHtmlFontDetail *fd; gchar *sml = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |