1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:38:13 +00:00

LibGUI: Make the Clipboard API deal in raw byte buffers a bit more

To open up for putting not just text/plain content on the clipboard,
let's make the GUI::Clipboard API a bit more raw-data-friendly. :^)
This commit is contained in:
Andreas Kling 2020-09-05 16:16:01 +02:00
parent 802f541184
commit 51146e3075
12 changed files with 43 additions and 38 deletions

View file

@ -139,7 +139,7 @@ bool HexEditor::copy_selected_hex_to_clipboard()
output_string_builder.appendf("%02X ", m_buffer.data()[i]);
}
GUI::Clipboard::the().set_data(output_string_builder.to_string());
GUI::Clipboard::the().set_plain_text(output_string_builder.to_string());
return true;
}
@ -153,7 +153,7 @@ bool HexEditor::copy_selected_text_to_clipboard()
output_string_builder.appendf("%c", isprint(m_buffer.data()[i]) ? m_buffer[i] : '.');
}
GUI::Clipboard::the().set_data(output_string_builder.to_string());
GUI::Clipboard::the().set_plain_text(output_string_builder.to_string());
return true;
}
@ -176,7 +176,7 @@ bool HexEditor::copy_selected_hex_to_clipboard_as_c_code()
}
output_string_builder.append("\n};\n");
GUI::Clipboard::the().set_data(output_string_builder.to_string());
GUI::Clipboard::the().set_plain_text(output_string_builder.to_string());
return true;
}