mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix #81
This commit is contained in:
parent
b781aeb989
commit
2618237678
|
@ -1890,9 +1890,14 @@ void xlsx_consumer::read_worksheet(const std::string &rel_id)
|
||||||
if (parser().qname() == xml::qname(xmlns, "v"))
|
if (parser().qname() == xml::qname(xmlns, "v"))
|
||||||
{
|
{
|
||||||
has_value = true;
|
has_value = true;
|
||||||
|
|
||||||
|
// <v> might be empty, check first
|
||||||
|
if (parser().peek() == xml::parser::event_type::characters)
|
||||||
|
{
|
||||||
parser().next_expect(xml::parser::event_type::characters);
|
parser().next_expect(xml::parser::event_type::characters);
|
||||||
value_string = parser().value();
|
value_string = parser().value();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (parser().qname() == xml::qname(xmlns, "f"))
|
else if (parser().qname() == xml::qname(xmlns, "f"))
|
||||||
{
|
{
|
||||||
has_formula = true;
|
has_formula = true;
|
||||||
|
|
|
@ -2165,7 +2165,7 @@ void xlsx_producer::write_worksheet(const relationship &rel)
|
||||||
else if (cell.has_formula())
|
else if (cell.has_formula())
|
||||||
{
|
{
|
||||||
serializer().element(xmlns, "f", cell.get_formula());
|
serializer().element(xmlns, "f", cell.get_formula());
|
||||||
serializer().element(xmlns, "v", "");
|
// todo (but probably not) could calculate the formula and set the value here
|
||||||
serializer().end_element(xmlns, "c");
|
serializer().end_element(xmlns, "c");
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user