Merge pull request #510 from softmarch/issue-509-count-missing

Fix the missing count of fonts and throw an exception.
This commit is contained in:
Thomas Fussell 2021-01-02 15:04:44 -05:00 committed by GitHub
commit 7e40e73601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2289,7 +2289,7 @@ void xlsx_consumer::read_stylesheet()
else if (current_style_element == qn("spreadsheetml", "fonts"))
{
auto &fonts = stylesheet.fonts;
auto count = parser().attribute<std::size_t>("count");
auto count = parser().attribute<std::size_t>("count", 0);
if (parser().attribute_present(qn("x14ac", "knownFonts")))
{
@ -2426,7 +2426,7 @@ void xlsx_consumer::read_stylesheet()
if (count != stylesheet.fonts.size())
{
throw xlnt::exception("counts don't match");
// throw xlnt::exception("counts don't match");
}
}
else if (current_style_element == qn("spreadsheetml", "numFmts"))