mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:47:35 +00:00
Spreadsheet: Let the cells know their own position in the sheet
This commit is contained in:
parent
13ce24de13
commit
f159d161fa
7 changed files with 227 additions and 22 deletions
|
@ -245,12 +245,12 @@ RefPtr<Sheet> Sheet::from_json(const JsonObject& object, Workbook& workbook)
|
|||
OwnPtr<Cell> cell;
|
||||
switch (kind) {
|
||||
case Cell::LiteralString:
|
||||
cell = make<Cell>(obj.get("value").to_string(), sheet->make_weak_ptr());
|
||||
cell = make<Cell>(obj.get("value").to_string(), position, sheet->make_weak_ptr());
|
||||
break;
|
||||
case Cell::Formula: {
|
||||
auto& interpreter = sheet->interpreter();
|
||||
auto value = interpreter.call(parse_function, json, JS::js_string(interpreter.heap(), obj.get("value").as_string()));
|
||||
cell = make<Cell>(obj.get("source").to_string(), move(value), sheet->make_weak_ptr());
|
||||
cell = make<Cell>(obj.get("source").to_string(), move(value), position, sheet->make_weak_ptr());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue