diff options
author | marcus <marcus@FreeBSD.org> | 2004-05-05 06:11:53 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2004-05-05 06:11:53 +0800 |
commit | 2202cd27678e01c874dfc07e5a66c9e3f89538ba (patch) | |
tree | c55450391fac723e1c6bf48f69adcadb7f65537a | |
parent | 389778d034d341e29879c03f68859b32a2728368 (diff) | |
download | freebsd-ports-gnome-2202cd27678e01c874dfc07e5a66c9e3f89538ba.tar.gz freebsd-ports-gnome-2202cd27678e01c874dfc07e5a66c9e3f89538ba.tar.zst freebsd-ports-gnome-2202cd27678e01c874dfc07e5a66c9e3f89538ba.zip |
Fix the rich text copy/paste problem. Basically, text from any rich text
application (e.g. gaim itself, Mozilla, Galeon, etc.) would fail to paste
or paste incorrectly into Gaim. This has been fixed, and has been committed
to Gaim CVS.
-rw-r--r-- | net-im/gaim/Makefile | 1 | ||||
-rw-r--r-- | net-im/gaim/files/patch-src-gtkimhtml | 32 | ||||
-rw-r--r-- | net/gaim/Makefile | 1 | ||||
-rw-r--r-- | net/gaim/files/patch-src-gtkimhtml | 32 |
4 files changed, 62 insertions, 4 deletions
diff --git a/net-im/gaim/Makefile b/net-im/gaim/Makefile index 105a48e99ac9..a0dcea02f99b 100644 --- a/net-im/gaim/Makefile +++ b/net-im/gaim/Makefile @@ -6,6 +6,7 @@ PORTNAME= gaim PORTVERSION= 0.77 +PORTREVISION= 1 CATEGORIES?= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/net-im/gaim/files/patch-src-gtkimhtml b/net-im/gaim/files/patch-src-gtkimhtml index f5b06e9f1f43..4bf981d8a39c 100644 --- a/net-im/gaim/files/patch-src-gtkimhtml +++ b/net-im/gaim/files/patch-src-gtkimhtml @@ -1,5 +1,5 @@ ---- src/gtkimhtml.c.orig Fri Apr 23 04:24:05 2004 -+++ src/gtkimhtml.c Sat Apr 24 05:37:14 2004 +--- src/gtkimhtml.c.orig Tue May 4 18:09:10 2004 ++++ src/gtkimhtml.c Tue May 4 18:09:12 2004 @@ -542,10 +542,11 @@ GtkTextIter start, end; GtkTextMark *sel = gtk_text_buffer_get_selection_bound(imhtml->text_buffer); @@ -14,3 +14,31 @@ if (info == TARGET_HTML) { int len; +@@ -684,7 +685,6 @@ + static void paste_received_cb (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data) + { + char *text; +- guint16 c; + GtkIMHtml *imhtml = data; + GtkTextIter iter; + GtkIMHtmlOptions flags = GTK_IMHTML_NO_NEWLINE; +@@ -756,14 +756,14 @@ + memcpy(text, selection_data->data, selection_data->length); + } + +- memcpy (&c, text, 2); +- if (c == 0xfeff) { +- /* This is UCS2 */ +- char *utf8 = g_convert(text+2, selection_data->length - 2, "UTF-8", "UCS-2", NULL, NULL, NULL); ++ if (selection_data->length >= 2 && ++ (*(guint16 *)text == 0xfeff || *(guint16 *)text == 0xfffe)) { ++ /* This is UCS-2 */ ++ char *utf8 = g_convert(text, selection_data->length, "UTF-8", "UCS-2", NULL, NULL, NULL); + g_free(text); + text = utf8; + if (!text) { +- gaim_debug_warning("gtkimhtml", "g_convert failed in paste_received_cb\n"); ++ gaim_debug_warning("gtkimhtml", "g_convert from UCS-2 failed in paste_received_cb\n"); + return; + } + } diff --git a/net/gaim/Makefile b/net/gaim/Makefile index 105a48e99ac9..a0dcea02f99b 100644 --- a/net/gaim/Makefile +++ b/net/gaim/Makefile @@ -6,6 +6,7 @@ PORTNAME= gaim PORTVERSION= 0.77 +PORTREVISION= 1 CATEGORIES?= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/net/gaim/files/patch-src-gtkimhtml b/net/gaim/files/patch-src-gtkimhtml index f5b06e9f1f43..4bf981d8a39c 100644 --- a/net/gaim/files/patch-src-gtkimhtml +++ b/net/gaim/files/patch-src-gtkimhtml @@ -1,5 +1,5 @@ ---- src/gtkimhtml.c.orig Fri Apr 23 04:24:05 2004 -+++ src/gtkimhtml.c Sat Apr 24 05:37:14 2004 +--- src/gtkimhtml.c.orig Tue May 4 18:09:10 2004 ++++ src/gtkimhtml.c Tue May 4 18:09:12 2004 @@ -542,10 +542,11 @@ GtkTextIter start, end; GtkTextMark *sel = gtk_text_buffer_get_selection_bound(imhtml->text_buffer); @@ -14,3 +14,31 @@ if (info == TARGET_HTML) { int len; +@@ -684,7 +685,6 @@ + static void paste_received_cb (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data) + { + char *text; +- guint16 c; + GtkIMHtml *imhtml = data; + GtkTextIter iter; + GtkIMHtmlOptions flags = GTK_IMHTML_NO_NEWLINE; +@@ -756,14 +756,14 @@ + memcpy(text, selection_data->data, selection_data->length); + } + +- memcpy (&c, text, 2); +- if (c == 0xfeff) { +- /* This is UCS2 */ +- char *utf8 = g_convert(text+2, selection_data->length - 2, "UTF-8", "UCS-2", NULL, NULL, NULL); ++ if (selection_data->length >= 2 && ++ (*(guint16 *)text == 0xfeff || *(guint16 *)text == 0xfffe)) { ++ /* This is UCS-2 */ ++ char *utf8 = g_convert(text, selection_data->length, "UTF-8", "UCS-2", NULL, NULL, NULL); + g_free(text); + text = utf8; + if (!text) { +- gaim_debug_warning("gtkimhtml", "g_convert failed in paste_received_cb\n"); ++ gaim_debug_warning("gtkimhtml", "g_convert from UCS-2 failed in paste_received_cb\n"); + return; + } + } |