changeset 18458:742fcc75b563

merge of '38c2cb0e7952750e5835eb5b97b9bdd3dcb84f60' and '66e95aed7d4704c7b3cce52574a41f24ce40fccb'
author Daniel Atallah <daniel.atallah@gmail.com>
date Sun, 08 Jul 2007 19:58:31 +0000
parents f50a82a14122 (diff) 37f4fb160937 (current diff)
children 042b64016a57
files
diffstat 1 files changed, 7 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkimhtml.c	Sun Jul 08 17:23:52 2007 +0000
+++ b/pidgin/gtkimhtml.c	Sun Jul 08 19:58:31 2007 +0000
@@ -216,7 +216,6 @@
 clipboard_html_to_win32(char *html) {
 	int length;
 	GString *clipboard;
-	gchar *tmp;
 
 	if (html == NULL)
 		return NULL;
@@ -224,13 +223,9 @@
 	length = strlen(html);
 	clipboard = g_string_new ("Version:1.0\r\n");
 	g_string_append(clipboard, "StartHTML:0000000105\r\n");
-	tmp = g_strdup_printf("EndHTML:%010d\r\n", 147 + length);
-	g_string_append(clipboard, tmp);
-	g_free(tmp);
+	g_string_append_printf(clipboard, "EndHTML:%010d\r\n", 147 + length);
 	g_string_append(clipboard, "StartFragment:0000000127\r\n");
-	tmp = g_strdup_printf("EndFragment:%010d\r\n", 127 + length);
-	g_string_append(clipboard, tmp);
-	g_free(tmp);
+	g_string_append_printf(clipboard, "EndFragment:%010d\r\n", 127 + length);
 	g_string_append(clipboard, "<!--StartFragment-->\r\n");
 	g_string_append(clipboard, html);
 	g_string_append(clipboard, "\r\n<!--EndFragment-->");
@@ -909,7 +904,7 @@
 		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);
+		selection = clipboard_html_to_win32(html_clipboard);
 		gtk_selection_data_set(selection_data, gdk_atom_intern("HTML Format", FALSE), 8, (const guchar *)selection, strlen(selection));
 #endif
 		g_free(selection);
@@ -957,8 +952,8 @@
 						 (GtkClipboardGetFunc)gtk_imhtml_clipboard_get,
 						 (GtkClipboardClearFunc)gtk_imhtml_clipboard_clear, G_OBJECT(imhtml));
 
-		g_free(imhtml->clipboard_html_string);
-		g_free(imhtml->clipboard_text_string);
+		g_free(html_clipboard);
+		g_free(text_clipboard);
 
 		imhtml->clipboard_html_string = gtk_imhtml_get_markup_range(imhtml, &start, &end);
 		imhtml->clipboard_text_string = gtk_imhtml_get_text(imhtml, &start, &end);
@@ -982,8 +977,8 @@
 						 (GtkClipboardGetFunc)gtk_imhtml_clipboard_get,
 						 (GtkClipboardClearFunc)gtk_imhtml_clipboard_clear, G_OBJECT(imhtml));
 
-		g_free(imhtml->clipboard_html_string);
-		g_free(imhtml->clipboard_text_string);
+		g_free(html_clipboard);
+		g_free(text_clipboard);
 
 		imhtml->clipboard_html_string = gtk_imhtml_get_markup_range(imhtml, &start, &end);
 		imhtml->clipboard_text_string = gtk_imhtml_get_text(imhtml, &start, &end);