summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2011-04-30 11:21:14 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2011-04-30 11:21:14 +0000
commit003f3537c6f6d45f9f04f04df98d502bfe45f550 (patch)
tree9c2840545e5b50f6c4d3e0e6f9942e3342c5d146
parent9f9436bf40609d1b0a334683729d9513b27b0862 (diff)
downloadnetsurf-003f3537c6f6d45f9f04f04df98d502bfe45f550.tar.gz
netsurf-003f3537c6f6d45f9f04f04df98d502bfe45f550.tar.bz2
Ensure selection drags to NetSurf text boxes are always UTF-8
svn path=/trunk/netsurf/; revision=12263
-rwxr-xr-xamiga/clipboard.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index a8122f1bd..ee9e692f5 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2010 Chris Young <chris@unsatisfactorysoftware.co.uk>
+ * Copyright 2008-2011 Chris Young <chris@unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -42,6 +42,7 @@
#include <datatypes/pictureclass.h>
struct IFFHandle *iffh = NULL;
+bool ami_utf8_clipboard = false; // force UTF-8 in clipboard
bool ami_add_to_clipboard(const char *text, size_t length, bool space);
static bool ami_copy_selection(const char *text, size_t length,
@@ -166,7 +167,7 @@ bool gui_empty_clipboard(void)
{
if(!(PushChunk(iffh,ID_FTXT,ID_FORM,IFFSIZE_UNKNOWN)))
{
- if(option_utf8_clipboard)
+ if(option_utf8_clipboard || ami_utf8_clipboard)
{
if(!(PushChunk(iffh,0,ID_CSET,24)))
{
@@ -215,7 +216,7 @@ bool ami_add_to_clipboard(const char *text, size_t length, bool space)
{
char *buffer;
- if(option_utf8_clipboard)
+ if(option_utf8_clipboard || ami_utf8_clipboard)
{
WriteChunkBytes(iffh,text,length);
}
@@ -346,6 +347,8 @@ void ami_drag_selection(struct selection *s)
if(text_box = ami_text_box_at_point(gwin, &x, &y))
{
+ ami_utf8_clipboard = true;
+
iffh = ami_clipboard_init_internal(1);
if(gui_copy_to_clipboard(s))
@@ -356,6 +359,7 @@ void ami_drag_selection(struct selection *s)
ami_clipboard_free_internal(iffh);
iffh = old_iffh;
+ ami_utf8_clipboard = false;
}
else
{