When faced with a self-closing <row/> tag (which is valid), this code will fail its assertion:
while (wbr.has_cell()) {
const xlnt::cell& cell(wbr.read_cell());
assert(cell != nullptr);
// do something...
}
That's because of this line in xlsx_consumer::read_cell():
if (!in_element(qn("spreadsheetml", "row")))
{
return cell(nullptr);
}
That's an invalid cell. And there's no way to compare against it in my own code, because I can't initialize such a cell or read its d_ member. So I can't see a way to parse the workbook with the streaming parser without segfaulting.
The only way to know whether there's another cell is to parse until it's found. That implies a while loop somewhere in xlsx_consumer::read_cell().
When faced with a self-closing
<row/>
tag (which is valid), this code will fail its assertion:That's because of this line in
xlsx_consumer::read_cell()
:That's an invalid cell. And there's no way to compare against it in my own code, because I can't initialize such a cell or read its
d_
member. So I can't see a way to parse the workbook with the streaming parser without segfaulting.The only way to know whether there's another cell is to parse until it's found. That implies a
while
loop somewhere inxlsx_consumer::read_cell()
.Pull request pending.