Add support for cells in error when writing XLSX and ODS
When appending data to an existing sheet, it was possible to get cells in error when reading (DIV/0 for instance). When trying to write them back, `addRow` would throw because `Cell`s in error were not supported by the writers.
This commit is contained in:
1 parent
eb88bb4c3a
commit
7964dadc21
5 files changed
+53
No files matched your search
@@ -204,6 +204,11 @@ class WorksheetManager implements WorksheetManagerInterface
|
||||
$data .= ' office:value-type="float" calcext:value-type="float" office:value="' . $cell->getValue() . '">';
|
||||
$data .= '<text:p>' . $cell->getValue() . '</text:p>';
|
||||
$data .= '</table:table-cell>';
|
||||
} elseif ($cell->isError() && is_string($cell->getValueEvenIfError())) {
|
||||
// only writes the error value if it's a string
|
||||
$data .= ' office:value-type="string" calcext:value-type="error" office:value="">';
|
||||
$data .= '<text:p>' . $cell->getValueEvenIfError() . '</text:p>';
|
||||
$data .= '</table:table-cell>';
|
||||
} elseif ($cell->isEmpty()) {
|
||||
$data .= '/>';
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user