1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:27:34 +00:00

Spreadsheet: Do not assume that a worksheet always exists

Fixes #5910.
Fixes #4822 (as far as I can tell).
This commit is contained in:
AnotherTest 2021-03-22 17:32:21 +04:30 committed by Andreas Kling
parent 534626f917
commit ba2df70eab
4 changed files with 63 additions and 30 deletions

View file

@ -46,8 +46,7 @@ public:
void add_sheet(NonnullRefPtr<Sheet>&&);
const String& current_filename() const { return m_workbook->current_filename(); }
const Sheet& current_worksheet() const { return m_selected_view->sheet(); }
Sheet& current_worksheet() { return m_selected_view->sheet(); }
Sheet* current_worksheet_if_available() { return m_selected_view ? m_selected_view->sheet_if_available() : nullptr; }
void set_filename(const String& filename);
Workbook& workbook() { return *m_workbook; }