Spreadsheet: Don't release the file buffer when importing CSV files

CSVImportDialogPage takes and holds a StringView meaning that the data
was dropped instantly and displayed garbage instead.
This commit is contained in:
Karol Kosek 2023-05-14 20:24:54 +02:00 committed by Andreas Kling
parent 4de99d553e
commit bde96640ac
Notes: sideshowbarker 2024-07-17 20:19:08 +09:00

View file

@ -186,7 +186,7 @@ ErrorOr<Vector<NonnullRefPtr<Sheet>>, DeprecatedString> ImportDialog::make_and_r
auto contents_or_error = file.read_until_eof();
if (contents_or_error.is_error())
return DeprecatedString::formatted("{}", contents_or_error.release_error());
CSVImportDialogPage page { contents_or_error.release_value() };
CSVImportDialogPage page { contents_or_error.value() };
wizard->replace_page(page.page());
auto result = wizard->exec();