mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:17:35 +00:00
Spreadsheet: Make undo operation handle multiple cells at a time
Instead of having the undo operation only be able to undo one cell for a given undo, make it able to handle multiple cells at a time. Please enter the commit message for your changes. Lines starting
This commit is contained in:
parent
7bd0ebb1ab
commit
22575c9370
7 changed files with 59 additions and 31 deletions
|
@ -191,21 +191,4 @@ void Cell::copy_from(Cell const& other)
|
|||
m_thrown_value = other.m_thrown_value;
|
||||
}
|
||||
|
||||
CellUndoCommand::CellUndoCommand(Cell& cell, String const& previous_data)
|
||||
: m_cell(cell)
|
||||
, m_current_data(cell.data())
|
||||
, m_previous_data(previous_data)
|
||||
{
|
||||
}
|
||||
|
||||
void CellUndoCommand::undo()
|
||||
{
|
||||
m_cell.set_data(m_previous_data);
|
||||
}
|
||||
|
||||
void CellUndoCommand::redo()
|
||||
{
|
||||
m_cell.set_data(m_current_data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue