mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:47:34 +00:00
Spreadsheet: Use ByteString for file paths
This commit is contained in:
parent
44ca55aaf8
commit
90240c0e02
7 changed files with 26 additions and 26 deletions
|
@ -50,31 +50,31 @@ bool Workbook::set_filename(ByteString const& filename)
|
|||
return true;
|
||||
}
|
||||
|
||||
ErrorOr<void, ByteString> Workbook::open_file(String const& filename, Core::File& file)
|
||||
ErrorOr<void, ByteString> Workbook::open_file(ByteString const& filename, Core::File& file)
|
||||
{
|
||||
auto mime = Core::guess_mime_type_based_on_filename(filename);
|
||||
|
||||
// Make an import dialog, we might need to import it.
|
||||
m_sheets = TRY(ImportDialog::make_and_run_for(m_parent_window, mime, filename, file, *this));
|
||||
|
||||
set_filename(filename.to_byte_string());
|
||||
set_filename(filename);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<void> Workbook::write_to_file(String const& filename, Core::File& stream)
|
||||
ErrorOr<void> Workbook::write_to_file(ByteString const& filename, Core::File& stream)
|
||||
{
|
||||
auto mime = Core::guess_mime_type_based_on_filename(filename);
|
||||
|
||||
// Make an export dialog, we might need to import it.
|
||||
TRY(ExportDialog::make_and_run_for(mime, stream, filename.to_byte_string(), *this));
|
||||
TRY(ExportDialog::make_and_run_for(mime, stream, filename, *this));
|
||||
|
||||
set_filename(filename.to_byte_string());
|
||||
set_filename(filename);
|
||||
set_dirty(false);
|
||||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<bool, ByteString> Workbook::import_file(String const& filename, Core::File& file)
|
||||
ErrorOr<bool, ByteString> Workbook::import_file(ByteString const& filename, Core::File& file)
|
||||
{
|
||||
auto mime = Core::guess_mime_type_based_on_filename(filename);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue