mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-23 14:59:47 +03:00
Fix copying text/plain to clipboard
svn path=/trunk/netsurf/; revision=11636
This commit is contained in:
parent
f04cc9e9ec
commit
86c2948eb4
@ -246,7 +246,9 @@ bool ami_clipboard_copy(const char *text, size_t length, struct box *box,
|
||||
|
||||
if(text)
|
||||
{
|
||||
if (!ami_add_to_clipboard(text, length, box->space)) return false;
|
||||
bool add_space = box != NULL ? box->space : false;
|
||||
|
||||
if (!ami_add_to_clipboard(text, length, add_space)) return false;
|
||||
}
|
||||
|
||||
PopChunk(iffh);
|
||||
|
@ -876,14 +876,15 @@ gui_selection_traverse_handler(const char *text,
|
||||
const char *space_text,
|
||||
size_t space_length)
|
||||
{
|
||||
bool add_space = box != NULL ? box->space : false;
|
||||
|
||||
if (space_text) {
|
||||
if (space_text != NULL && space_length > 0) {
|
||||
if (!gui_add_to_clipboard(space_text, space_length, false)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!gui_add_to_clipboard(text, length, box->space))
|
||||
if (!gui_add_to_clipboard(text, length, add_space))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -72,9 +72,11 @@ static bool cocoa_clipboard_copy_handler(const char *text, size_t length, struct
|
||||
void *handle, const char *whitespace_text,
|
||||
size_t whitespace_length)
|
||||
{
|
||||
bool add_space = box != NULL ? box->space : false;
|
||||
|
||||
if (whitespace_text && !gui_add_to_clipboard( whitespace_text,
|
||||
whitespace_length, false )) return false;
|
||||
return gui_add_to_clipboard( text, length, box->space );
|
||||
return gui_add_to_clipboard( text, length, add_space );
|
||||
}
|
||||
|
||||
bool gui_commit_clipboard(void)
|
||||
|
@ -50,15 +50,18 @@ bool copy_handler(const char *text, size_t length, struct box *box,
|
||||
void *handle, const char *whitespace_text,
|
||||
size_t whitespace_length)
|
||||
{
|
||||
bool add_space = box != NULL ? box->space : false;
|
||||
|
||||
/* add any whitespace which precedes the text from this box */
|
||||
if (whitespace_text) {
|
||||
if (whitespace_text != NULL && whitespace_length > 0) {
|
||||
if (!gui_add_to_clipboard(whitespace_text,
|
||||
whitespace_length, false)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* add the text from this box */
|
||||
if (!gui_add_to_clipboard(text, length, box->space))
|
||||
if (!gui_add_to_clipboard(text, length, add_space))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -207,15 +207,18 @@ bool copy_handler(const char *text, size_t length, struct box *box,
|
||||
void *handle, const char *whitespace_text,
|
||||
size_t whitespace_length)
|
||||
{
|
||||
bool add_space = box != NULL ? box->space : false;
|
||||
|
||||
/* add any whitespace which precedes the text from this box */
|
||||
if (whitespace_text) {
|
||||
if (whitespace_text != NULL && whitespace_length > 0) {
|
||||
if (!gui_add_to_clipboard(whitespace_text,
|
||||
whitespace_length, false)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* add the text from this box */
|
||||
if (!gui_add_to_clipboard(text, length, box->space))
|
||||
if (!gui_add_to_clipboard(text, length, add_space))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -2488,13 +2488,15 @@ gui_selection_traverse_handler(const char *text,
|
||||
const char *space_text,
|
||||
size_t space_length)
|
||||
{
|
||||
if (space_text) {
|
||||
bool add_space = box != NULL ? box->space : false;
|
||||
|
||||
if (space_text != NULL && space_length > 0) {
|
||||
if (!gui_add_to_clipboard(space_text, space_length, false)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!gui_add_to_clipboard(text, length, box->space))
|
||||
if (!gui_add_to_clipboard(text, length, add_space))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user