diff --git a/include/xlnt/worksheet/row_properties.hpp b/include/xlnt/worksheet/row_properties.hpp index d78c4313..a2e92e25 100644 --- a/include/xlnt/worksheet/row_properties.hpp +++ b/include/xlnt/worksheet/row_properties.hpp @@ -63,6 +63,13 @@ public: /// The index to the style used by all cells in this row /// optional style; + + /// + /// The row column span, used as part of the row block optimisation. + /// This used for loading this attribute from existing excel files mainly for inspecting + /// and not used when saving, it is calculated in the xlsx_producer. + /// + optional spans; }; inline bool operator==(const row_properties &lhs, const row_properties &rhs) @@ -72,7 +79,8 @@ inline bool operator==(const row_properties &lhs, const row_properties &rhs) && lhs.custom_height == rhs.custom_height && lhs.hidden == rhs.hidden && lhs.custom_format == rhs.custom_format - && lhs.style == rhs.style; + && lhs.style == rhs.style + && lhs.spans == rhs.spans; } } // namespace xlnt diff --git a/source/detail/serialization/xlsx_consumer.cpp b/source/detail/serialization/xlsx_consumer.cpp index 3ac9eb0b..33841f84 100644 --- a/source/detail/serialization/xlsx_consumer.cpp +++ b/source/detail/serialization/xlsx_consumer.cpp @@ -221,9 +221,13 @@ cell xlsx_consumer::read_cell() row_properties.dy_descent = parser().attribute(qn("x14ac", "dyDescent")); } + if (parser().attribute_present("spans")) { + row_properties.spans = parser().attribute("spans"); + } + skip_attributes({"customFormat", "s", "customFont", "outlineLevel", "collapsed", "thickTop", "thickBot", - "ph", "spans"}); + "ph"}); } if (!in_element(qn("spreadsheetml", "row"))) @@ -713,9 +717,13 @@ void xlsx_consumer::read_worksheet_sheetdata() row_properties.custom_format.set(parser().attribute("customFormat")); } + if (parser().attribute_present("spans")) { + row_properties.spans = parser().attribute("spans"); + } + skip_attributes({"customFont", "outlineLevel", "collapsed", "thickTop", "thickBot", - "ph", "spans"}); + "ph"}); while (in_element(qn("spreadsheetml", "row"))) {