diff --git a/source/detail/serialization/xlsx_consumer.cpp b/source/detail/serialization/xlsx_consumer.cpp index aea033e6..18504ff1 100644 --- a/source/detail/serialization/xlsx_consumer.cpp +++ b/source/detail/serialization/xlsx_consumer.cpp @@ -552,7 +552,10 @@ std::string xlsx_consumer::read_worksheet_begin(const std::string &rel_id) current_selection.sqref(sqref); } - current_selection.pane(pane_corner::top_left); + if (parser().attribute_present("pane")) + { + current_selection.pane(parser().attribute("pane")); + } new_view.add_selection(current_selection); diff --git a/source/detail/serialization/xlsx_producer.cpp b/source/detail/serialization/xlsx_producer.cpp index 0bd2d569..66c4860c 100644 --- a/source/detail/serialization/xlsx_producer.cpp +++ b/source/detail/serialization/xlsx_producer.cpp @@ -2326,8 +2326,15 @@ void xlsx_producer::write_worksheet(const relationship &rel) write_attribute("topLeftCell", current_pane.top_left_cell.get().to_string()); } - write_attribute("xSplit", current_pane.x_split.index); - write_attribute("ySplit", current_pane.y_split); + if (current_pane.x_split + 1 == current_pane.top_left_cell.get().column()) + { + write_attribute("xSplit", current_pane.x_split.index); + } + + if (current_pane.y_split + 1 == current_pane.top_left_cell.get().row()) + { + write_attribute("ySplit", current_pane.y_split); + } if (current_pane.active_pane != pane_corner::top_left) {