From dc9f55042967b328db790a4e2ae5471fe1c45f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=89=91=E6=B3=A2?= <940930034@qq.com> Date: Tue, 25 Aug 2020 16:40:33 +0800 Subject: [PATCH] Fix the missing count of fonts and throw an exception. --- source/detail/serialization/xlsx_consumer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/detail/serialization/xlsx_consumer.cpp b/source/detail/serialization/xlsx_consumer.cpp index 62d9c418..2db934e3 100644 --- a/source/detail/serialization/xlsx_consumer.cpp +++ b/source/detail/serialization/xlsx_consumer.cpp @@ -2277,7 +2277,7 @@ void xlsx_consumer::read_stylesheet() else if (current_style_element == qn("spreadsheetml", "fonts")) { auto &fonts = stylesheet.fonts; - auto count = parser().attribute("count"); + auto count = parser().attribute("count", 0); if (parser().attribute_present(qn("x14ac", "knownFonts"))) { @@ -2414,7 +2414,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"))