mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
Spreadsheet: Avoid making StringView of temporary ByteBuffer
This commit is contained in:
parent
470c99a2a6
commit
4ef9a1ba48
Notes:
sideshowbarker
2024-07-18 04:17:44 +09:00
Author: https://github.com/BenWiederhake
Commit: 4ef9a1ba48
Pull-request: https://github.com/SerenityOS/serenity/pull/9946
Reviewed-by: https://github.com/IdanHo ✅
1 changed files with 2 additions and 1 deletions
|
@ -115,9 +115,10 @@ RefPtr<Core::MimeData> SheetModel::mime_data(const GUI::ModelSelection& selectio
|
|||
VERIFY(cursor);
|
||||
|
||||
Position cursor_position { (size_t)cursor->column(), (size_t)cursor->row() };
|
||||
auto mime_data_buffer = mime_data->data("text/x-spreadsheet-data");
|
||||
auto new_data = String::formatted("{}\n{}",
|
||||
cursor_position.to_url(m_sheet).to_string(),
|
||||
StringView(mime_data->data("text/x-spreadsheet-data")));
|
||||
StringView(mime_data_buffer));
|
||||
mime_data->set_data("text/x-spreadsheet-data", new_data.to_byte_buffer());
|
||||
|
||||
return mime_data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue