mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 19:46:03 +00:00
Spreadsheet: Allow importing sheets into an existing workbook
This commit is contained in:
parent
135683795b
commit
64ef808aeb
Notes:
sideshowbarker
2024-07-17 09:57:04 +09:00
Author: https://github.com/alimpfard
Commit: 64ef808aeb
Pull-request: https://github.com/SerenityOS/serenity/pull/14391
Reviewed-by: https://github.com/linusg ✅
4 changed files with 50 additions and 0 deletions
|
@ -76,4 +76,15 @@ Result<bool, String> Workbook::write_to_file(Core::File& file)
|
|||
return true;
|
||||
}
|
||||
|
||||
Result<bool, String> Workbook::import_file(Core::File& file)
|
||||
{
|
||||
auto mime = Core::guess_mime_type_based_on_filename(file.filename());
|
||||
|
||||
auto sheets = TRY(ImportDialog::make_and_run_for(m_parent_window, mime, file, *this));
|
||||
auto has_any_changes = !sheets.is_empty();
|
||||
m_sheets.extend(move(sheets));
|
||||
|
||||
return has_any_changes;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue