mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-24 07:19:37 +03:00
Obtain font style in copy handler.
This commit is contained in:
parent
986bc5ff83
commit
68947c377e
@ -747,7 +747,8 @@ static bool selection_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 != 0 : false;
|
||||
bool add_space = false;
|
||||
plot_font_style_t style = *plot_style_font;
|
||||
|
||||
/* add any whitespace which precedes the text from this box */
|
||||
if (whitespace_text != NULL && whitespace_length > 0) {
|
||||
@ -757,6 +758,19 @@ static bool selection_copy_handler(const char *text, size_t length,
|
||||
}
|
||||
}
|
||||
|
||||
if (box != NULL) {
|
||||
/* HTML */
|
||||
add_space = (box->space != 0);
|
||||
|
||||
if (box->style != NULL) {
|
||||
/* Override default font style */
|
||||
font_plot_style_from_css(box->style, &style);
|
||||
} else {
|
||||
/* If there's no style, there must be no text */
|
||||
assert(box->text == NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* add the text from this box */
|
||||
if (!gui_add_to_clipboard(text, length, add_space))
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user