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

Everywhere: Replace Vector<T*> with nonnull entries with Vector<T&>

This commit is contained in:
Ali Mohammad Pur 2021-06-08 19:36:27 +04:30 committed by Andreas Kling
parent 3d94b5051d
commit 7ac196974d
22 changed files with 92 additions and 94 deletions

View file

@ -171,11 +171,11 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector<Sheet> new_sheets)
m_current_cell_label->set_enabled(true);
m_current_cell_label->set_text(builder.string_view());
Vector<Cell*> cells;
Vector<Cell&> cells;
for (auto& position : selection)
cells.append(&sheet.ensure(position));
cells.append(sheet.ensure(position));
auto first_cell = cells.first();
auto& first_cell = cells.first();
m_cell_value_editor->on_change = nullptr;
m_cell_value_editor->set_text("");
m_should_change_selected_cells = false;
@ -191,14 +191,14 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector<Sheet> new_sheets)
// FIXME: Lines?
auto offset = m_cell_value_editor->cursor().column();
try_generate_tip_for_input_expression(text, offset);
for (auto* cell : cells)
cell->set_data(text);
for (auto& cell : cells)
cell.set_data(text);
sheet.update();
update();
}
};
m_cell_value_editor->set_enabled(true);
static_cast<CellSyntaxHighlighter*>(const_cast<Syntax::Highlighter*>(m_cell_value_editor->syntax_highlighter()))->set_cell(first_cell);
static_cast<CellSyntaxHighlighter*>(const_cast<Syntax::Highlighter*>(m_cell_value_editor->syntax_highlighter()))->set_cell(&first_cell);
};
m_selected_view->on_selection_dropped = [&]() {
m_cell_value_editor->set_enabled(false);