Fixed a bug when using the xlnt::streaming_workbook_reader where a streaming cell could still contain information from the previously streamed cell. This could happen if the new cell did not contain information that could override the information of the previous cell, e.g. when the cell in XML only contained something like <c r="H4"/>, so the streamed cell still contained the type and the string/value of the previously streamed cell.

This commit is contained in:
Laurențiu Leahu-Vlăducu 2021-12-01 14:02:46 +01:00
parent 3a279fcaab
commit f6f4adca7d
No known key found for this signature in database
GPG Key ID: B4B638CBEFDFC921

View File

@ -1322,6 +1322,7 @@ bool xlsx_consumer::has_cell()
expect_start_element(qn("spreadsheetml", "c"), xml::content::complex);
assert(streaming_);
streaming_cell_.reset(new detail::cell_impl()); // Clean cell state - otherwise it might contain information from the previously streamed cell.
auto cell = xlnt::cell(streaming_cell_.get());
auto reference = cell_reference(parser().attribute("r"));
cell.d_->parent_ = current_worksheet_;