Spreadsheet: Avoid using Value.to_string_without_side_effects()

We should use .to_string() and handle the possible exceptions.
This makes the displayed cell contents so much more informative than
'[object Object]' :^)
This commit is contained in:
Ali Mohammad Pur 2021-11-21 05:08:00 +03:30 committed by Ali Mohammad Pur
commit 5f1a34bba3
Notes: sideshowbarker 2024-07-17 22:53:49 +09:00
13 changed files with 72 additions and 53 deletions

View file

@ -598,8 +598,11 @@ Vector<Vector<String>> Sheet::to_xsv() const
row.resize(column_count);
for (size_t j = 0; j < column_count; ++j) {
auto cell = at({ j, i });
if (cell)
row[j] = cell->typed_display();
if (cell) {
auto result = cell->typed_display();
if (result.has_value())
row[j] = result.value();
}
}
data.append(move(row));