Update xlsx_producer.cpp

show_grid_lines() is default enabled in Excel so attribute should only be written when it is set to false. 

Added 'if-statement' to check for 'false' before writing attribute.
This commit is contained in:
Blakjak88 2022-08-07 11:11:15 +08:00 committed by GitHub
parent dbfed051c8
commit 6b5755af30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2310,7 +2310,10 @@ void xlsx_producer::write_worksheet(const relationship &rel)
const auto wb_view = source_.view(); const auto wb_view = source_.view();
const auto view = ws.view(); const auto view = ws.view();
write_attribute("showGridLines", write_bool(view.show_grid_lines())); if (!view.show_grid_lines())
{
write_attribute("showGridLines", write_bool(view.show_grid_lines()));
}
if ((wb_view.active_tab.is_set() && (ws.id() - 1) == wb_view.active_tab.get()) if ((wb_view.active_tab.is_set() && (ws.id() - 1) == wb_view.active_tab.get())
|| (!wb_view.active_tab.is_set() && ws.id() == 1)) || (!wb_view.active_tab.is_set() && ws.id() == 1))