mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
prevent exception from being thrown when a view doesn't contain window attributes
This commit is contained in:
parent
d14f8c2e5f
commit
cae6276b23
|
@ -529,10 +529,26 @@ void xlsx_consumer::read_office_document(const std::string &content_type) // CT_
|
|||
"showHorizontalScroll", "showSheetTabs", "showVerticalScroll"});
|
||||
|
||||
workbook_view view;
|
||||
view.x_window = parser().attribute<std::size_t>("xWindow");
|
||||
view.y_window = parser().attribute<std::size_t>("yWindow");
|
||||
view.window_width = parser().attribute<std::size_t>("windowWidth");
|
||||
view.window_height = parser().attribute<std::size_t>("windowHeight");
|
||||
|
||||
if (parser().attribute_present("xWindow"))
|
||||
{
|
||||
view.x_window = parser().attribute<std::size_t>("xWindow");
|
||||
}
|
||||
|
||||
if (parser().attribute_present("yWindow"))
|
||||
{
|
||||
view.y_window = parser().attribute<std::size_t>("yWindow");
|
||||
}
|
||||
|
||||
if (parser().attribute_present("windowWidth"))
|
||||
{
|
||||
view.window_width = parser().attribute<std::size_t>("windowWidth");
|
||||
}
|
||||
|
||||
if (parser().attribute_present("windowHeight"))
|
||||
{
|
||||
view.window_height = parser().attribute<std::size_t>("windowHeight");
|
||||
}
|
||||
|
||||
if (parser().attribute_present("tabRatio"))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user