mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
Everywhere: Stop using NonnullOwnPtrVector
Same as NonnullRefPtrVector: weird semantics, questionable benefits.
This commit is contained in:
parent
689ca370d4
commit
359d6e7b0b
111 changed files with 517 additions and 503 deletions
|
@ -28,7 +28,7 @@ void UndoStack::undo()
|
|||
return;
|
||||
|
||||
auto& command = m_stack[--m_stack_index];
|
||||
command.undo();
|
||||
command->undo();
|
||||
|
||||
if (on_state_change)
|
||||
on_state_change();
|
||||
|
@ -40,7 +40,7 @@ void UndoStack::redo()
|
|||
return;
|
||||
|
||||
auto& command = m_stack[m_stack_index++];
|
||||
command.redo();
|
||||
command->redo();
|
||||
|
||||
if (on_state_change)
|
||||
on_state_change();
|
||||
|
@ -56,7 +56,7 @@ ErrorOr<void> UndoStack::try_push(NonnullOwnPtr<Command> command)
|
|||
m_clean_index = {};
|
||||
|
||||
if (!m_stack.is_empty() && is_current_modified()) {
|
||||
if (m_stack.last().merge_with(*command))
|
||||
if (m_stack.last()->merge_with(*command))
|
||||
return {};
|
||||
}
|
||||
|
||||
|
@ -114,14 +114,14 @@ Optional<DeprecatedString> UndoStack::undo_action_text() const
|
|||
{
|
||||
if (!can_undo())
|
||||
return {};
|
||||
return m_stack[m_stack_index - 1].action_text();
|
||||
return m_stack[m_stack_index - 1]->action_text();
|
||||
}
|
||||
|
||||
Optional<DeprecatedString> UndoStack::redo_action_text() const
|
||||
{
|
||||
if (!can_redo())
|
||||
return {};
|
||||
return m_stack[m_stack_index].action_text();
|
||||
return m_stack[m_stack_index]->action_text();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue