From 1ff174a0c90ba7cbcccc7d2d42e602cde424487e Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Sun, 27 Nov 2016 09:41:03 +0100 Subject: [PATCH] ignore optional formula attributes --- source/detail/xlsx_consumer.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/detail/xlsx_consumer.cpp b/source/detail/xlsx_consumer.cpp index 99ab7316..59bf230d 100644 --- a/source/detail/xlsx_consumer.cpp +++ b/source/detail/xlsx_consumer.cpp @@ -1774,18 +1774,25 @@ void xlsx_consumer::read_worksheet(const std::string &rel_id) { auto current_element = expect_start_element(xml::content::mixed); - if (current_element == xml::qname(xmlns, "v")) + if (current_element == xml::qname(xmlns, "v")) // s:ST_Xstring { has_value = true; value_string = read_text(); } - else if (current_element == xml::qname(xmlns, "f")) + else if (current_element == xml::qname(xmlns, "f")) // CT_CellFormula { has_formula = true; - has_shared_formula = parser().attribute_present("t") && parser().attribute("t") == "shared"; + + if (parser().attribute_present("t")) + { + has_shared_formula = parser().attribute("t") == "shared"; + } + + skip_attributes({"aca", "ref", "dt2D", "dtr", "del1", "del2", "r1", "r2", "ca", "si", "bx"}); + formula_value_string = read_text(); } - else if (current_element == xml::qname(xmlns, "is")) + else if (current_element == xml::qname(xmlns, "is")) // CT_Rst { parser().next_expect(xml::parser::event_type::start_element, xmlns, "t"); value_string = read_text();