diff options
Diffstat (limited to 'external/liborcus/0001-xls-xml-Import-hidden-row-and-column-flags.patch')
-rw-r--r-- | external/liborcus/0001-xls-xml-Import-hidden-row-and-column-flags.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/external/liborcus/0001-xls-xml-Import-hidden-row-and-column-flags.patch b/external/liborcus/0001-xls-xml-Import-hidden-row-and-column-flags.patch new file mode 100644 index 000000000..15a554a79 --- /dev/null +++ b/external/liborcus/0001-xls-xml-Import-hidden-row-and-column-flags.patch @@ -0,0 +1,81 @@ +From 66bbbd42f5d135b7e7dd57eaa7fdf6fd69c664df Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida <kohei.yoshida@gmail.com> +Date: Tue, 13 Feb 2018 22:15:49 -0500 +Subject: [PATCH] xls-xml: Import hidden row and column flags. + +(cherry picked from commit 95420c1a1e8c082bb5953b2a49f0d56eef0e5f7e) +--- + src/liborcus/xls_xml_context.cpp | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +diff --git a/src/liborcus/xls_xml_context.cpp b/src/liborcus/xls_xml_context.cpp +index 917ff86..04b863a 100644 +--- a/src/liborcus/xls_xml_context.cpp ++++ b/src/liborcus/xls_xml_context.cpp +@@ -1222,6 +1222,7 @@ void xls_xml_context::start_element_column(const xml_token_pair_t& parent, const + spreadsheet::col_t col_index = m_cur_prop_col; + spreadsheet::col_t span = 0; + double width = 0.0; ++ bool hidden = false; + + std::for_each(attrs.begin(), attrs.end(), + [&](const xml_token_attr_t& attr) +@@ -1244,6 +1245,8 @@ void xls_xml_context::start_element_column(const xml_token_pair_t& parent, const + case XML_Span: + span = to_long(attr.value); + break; ++ case XML_Hidden: ++ hidden = to_long(attr.value) != 0; + default: + ; + } +@@ -1251,8 +1254,11 @@ void xls_xml_context::start_element_column(const xml_token_pair_t& parent, const + ); + + for (; span >= 0; --span, ++col_index) ++ { + // Column widths are stored as points. + mp_sheet_props->set_column_width(col_index, width, orcus::length_unit_t::point); ++ mp_sheet_props->set_column_hidden(col_index, hidden); ++ } + + m_cur_prop_col = col_index; + } +@@ -1263,6 +1269,7 @@ void xls_xml_context::start_element_row(const xml_token_pair_t& parent, const xm + m_cur_col = 0; + spreadsheet::row_t row_index = -1; + bool has_height = false; ++ bool hidden = false; + double height = 0.0; + + for (const xml_token_attr_t& attr : attrs) +@@ -1281,6 +1288,9 @@ void xls_xml_context::start_element_row(const xml_token_pair_t& parent, const xm + has_height = true; + height = to_double(attr.value); + break; ++ case XML_Hidden: ++ hidden = to_long(attr.value) != 0; ++ break; + default: + ; + } +@@ -1293,8 +1303,14 @@ void xls_xml_context::start_element_row(const xml_token_pair_t& parent, const xm + m_cur_row = row_index - 1; + } + +- if (mp_sheet_props && has_height) +- mp_sheet_props->set_row_height(m_cur_row, height, length_unit_t::point); ++ if (mp_sheet_props) ++ { ++ if (has_height) ++ mp_sheet_props->set_row_height(m_cur_row, height, length_unit_t::point); ++ ++ if (hidden) ++ mp_sheet_props->set_row_hidden(m_cur_row, true); ++ } + } + + void xls_xml_context::end_element_borders() +-- +2.7.4 + |