SetSpreadsheetGridCommand.h header

#include <ew/core/SetSpreadsheetGridCommand.h>

Namespace ew::core

SetSpreadsheetGridCommand class

class ew::core::SetSpreadsheetGridCommand

Command that replaces a spreadsheet's whole grid at once – its dimensions, every cell, and every cell format. Used for bulk edits (paste, CSV import, structural row/column edits, refreshing a bound data table from the codex). Undo restores the previous dimensions, cells, and formats.

Members

ew::core::SetSpreadsheetGridCommand::SetSpreadsheetGridCommand(Spreadsheet &sheet, int rowCount, int columnCount, std::vector< SpreadsheetCell > cells, std::vector< SpreadsheetCellFormat > formats)

Creates a command that sets sheet to rowCount x columnCount with cells and formats. Callers that only change cells should pass the sheet's existing formats to preserve them; a structural edit passes the moved formats.

ew::core::SetSpreadsheetGridCommand::~SetSpreadsheetGridCommand() override

Destroys the command.

void ew::core::SetSpreadsheetGridCommand::apply() override

Records the sheet's current grid and applies the new one.

void ew::core::SetSpreadsheetGridCommand::undo() override

Restores the previous grid.

QString ew::core::SetSpreadsheetGridCommand::description() const override

Returns a short description for the undo/redo UI.