From 7310bb5590a65dfc3067c55d1b1d1b14df81e2be Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Wed, 7 Sep 2016 18:48:08 -0400 Subject: [PATCH] fix writing frozen panes --- source/detail/xlsx_producer.cpp | 2 +- source/workbook/tests/test_produce_xlsx.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/detail/xlsx_producer.cpp b/source/detail/xlsx_producer.cpp index c2e36ca1..f6e51823 100644 --- a/source/detail/xlsx_producer.cpp +++ b/source/detail/xlsx_producer.cpp @@ -1631,7 +1631,7 @@ void xlsx_producer::write_worksheet(const relationship &rel, pugi::xml_node root sheet_view_node.append_attribute("tabSelected").set_value("1"); sheet_view_node.append_attribute("workbookViewId").set_value("0"); - if (!view.get_selections().empty()) + if (!view.get_selections().empty() && !ws.has_frozen_panes()) { auto selection_node = sheet_view_node.child("selection") ? sheet_view_node.child("selection") diff --git a/source/workbook/tests/test_produce_xlsx.hpp b/source/workbook/tests/test_produce_xlsx.hpp index ffd5148d..14eea992 100644 --- a/source/workbook/tests/test_produce_xlsx.hpp +++ b/source/workbook/tests/test_produce_xlsx.hpp @@ -119,7 +119,7 @@ public: ws.get_cell("A22").set_value("timedelta"); ws.get_cell("B22").set_value(xlnt::timedelta(1, 2, 3, 4, 5)); - //ws.freeze_panes("B2"); + ws.freeze_panes("B2"); wb.save("simple.xlsx"); }