From 5b61145a0b49e5cd15ddf7de4e58f523d3702316 Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Thu, 9 Mar 2017 21:35:36 -0500 Subject: [PATCH] only expect alternatecontent if it's present --- source/detail/xlsx_consumer.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/detail/xlsx_consumer.cpp b/source/detail/xlsx_consumer.cpp index d339d1d2..4f50905a 100755 --- a/source/detail/xlsx_consumer.cpp +++ b/source/detail/xlsx_consumer.cpp @@ -2480,11 +2480,14 @@ void xlsx_consumer::read_comments(worksheet ws) ws.cell(cell_ref).comment(comment(read_rich_text(qn("spreadsheetml", "text")), authors.at(author_id))); expect_end_element(qn("spreadsheetml", "text")); - // specifc name space mc alternateContent element - expect_start_element(qn("mc", "AlternateContent"),xml::content::complex); - skip_remaining_content(qn("mc", "AlternateContent")); - expect_end_element(qn("mc", "AlternateContent")); - + + if (in_element(xml::qname(qn("spreadsheetml", "comment")))) + { + expect_start_element(qn("mc", "AlternateContent"), xml::content::complex); + skip_remaining_content(qn("mc", "AlternateContent")); + expect_end_element(qn("mc", "AlternateContent")); + } + expect_end_element(qn("spreadsheetml", "comment")); }