summaryrefslogtreecommitdiff
path: root/amiga/clipboard.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-02-12 17:56:25 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-02-12 17:56:25 +0000
commit0410b0d640df5495cc6548e578e92b1b5f4a0e33 (patch)
treefc23a2a38112f1a78d5e1d1cdd2e627e7a1fe7e4 /amiga/clipboard.c
parent9c7ced69d22a27491cbb1579b3db06b14898d080 (diff)
downloadnetsurf-0410b0d640df5495cc6548e578e92b1b5f4a0e33.tar.gz
netsurf-0410b0d640df5495cc6548e578e92b1b5f4a0e33.tar.bz2
Don't break the clipboard when copying 'nothing'.
Don't touch clipboard contents when copying 'nothing'. svn path=/trunk/netsurf/; revision=13442
Diffstat (limited to 'amiga/clipboard.c')
-rwxr-xr-xamiga/clipboard.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 1d75051ca..2af7d81ac 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2011 Chris Young <chris@unsatisfactorysoftware.co.uk>
+ * Copyright 2008-2012 Chris Young <chris@unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -286,15 +286,17 @@ bool ami_clipboard_copy(const char *text, size_t length, struct box *box,
bool gui_copy_to_clipboard(struct selection *s)
{
+ bool success;
+
+ if(s->defined == false) return false;
if(!gui_empty_clipboard()) return false;
- if (s->defined && selection_traverse(s, ami_clipboard_copy, NULL))
- {
- gui_commit_clipboard();
- return true;
- }
+ success = selection_traverse(s, ami_clipboard_copy, NULL);
- return false;
+ /* commit regardless, otherwise we leave the clipboard in an unusable state */
+ gui_commit_clipboard();
+
+ return success;
}
struct ami_text_selection *ami_selection_to_text(struct gui_window_2 *gwin)