Convert \n to \r\n also when storing CF_UNICODETEXT (UTF-16) in the

2006-06-11  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkproperty-win32.c (gdk_property_change): Convert \n
	to \r\n also when storing CF_UNICODETEXT (UTF-16) in the
	Clipboard. (#344496)
This commit is contained in:
Tor Lillqvist 2006-06-11 19:45:56 +00:00 committed by Tor Lillqvist
parent 7870cc59aa
commit dd9aefca76
3 changed files with 26 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2006-06-11 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Convert \n
to \r\n also when storing CF_UNICODETEXT (UTF-16) in the
Clipboard. (#344496)
2006-06-10 Matthias Clasen <mclasen@redhat.com> 2006-06-10 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkrecentchooserwidget.c * gtk/gtkrecentchooserwidget.c

View File

@ -1,3 +1,9 @@
2006-06-11 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkproperty-win32.c (gdk_property_change): Convert \n
to \r\n also when storing CF_UNICODETEXT (UTF-16) in the
Clipboard. (#344496)
2006-06-10 Matthias Clasen <mclasen@redhat.com> 2006-06-10 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkrecentchooserwidget.c * gtk/gtkrecentchooserwidget.c

View File

@ -336,6 +336,9 @@ gdk_property_change (GdkWindow *window,
wclen++; /* Terminating 0 */ wclen++; /* Terminating 0 */
size = wclen * 2; size = wclen * 2;
for (i = 0; i < wclen; i++)
if (wcptr[i] == '\n')
size += 2;
GDK_NOTE (DND, g_print ("... as Unicode\n")); GDK_NOTE (DND, g_print ("... as Unicode\n"));
} }
else if (find_common_locale (data, nelements, nchars, &lcid, &buf, &size)) else if (find_common_locale (data, nelements, nchars, &lcid, &buf, &size))
@ -427,9 +430,17 @@ gdk_property_change (GdkWindow *window,
break; break;
case UNICODE_TEXT: case UNICODE_TEXT:
cf = CF_UNICODETEXT; {
memmove (ucptr, wcptr, size); wchar_t *p = (wchar_t *) ucptr;
g_free (wcptr); cf = CF_UNICODETEXT;
for (i = 0; i < wclen; i++)
{
if (wcptr[i] == '\n')
*p++ = '\r';
*p++ = wcptr[i];
}
g_free (wcptr);
}
break; break;
case SINGLE_LOCALE: case SINGLE_LOCALE: