1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +00:00

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
parent 235eb0b1ad
commit 5f1a34bba3
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));