summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2018-02-13 22:25:20 -0500
committerKohei Yoshida <libreoffice@kohei.us>2018-02-14 05:48:47 +0100
commit9dbc3ffec050c880bb46e0edbdb9cd4a6241c9eb (patch)
treea6473f5e285678f4c0b0b5e77329f483e604aac7 /external
parenteb975197b62204062393979e33438a3a4e2d27c1 (diff)
Pick up hidden row and column flags when importing via orcus.
Change-Id: Idf2530935eb93339602ac5f6a5d0547aa56b453a Reviewed-on: https://gerrit.libreoffice.org/49695 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'external')
-rw-r--r--external/liborcus/0001-xls-xml-Import-hidden-row-and-column-flags.patch81
-rw-r--r--external/liborcus/UnpackedTarball_liborcus.mk1
2 files changed, 82 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 000000000000..15a554a79cff
--- /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
+
diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk
index a35ad9eec002..92e461f95e57 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
external/liborcus/0001-Alpha-value-of-0-means-fully-transparent.-I-m-sure-2.patch \
external/liborcus/0002-We-are-supposed-to-use-the-foreground-color-for-soli.patch \
external/liborcus/0001-xls-xml-Pick-up-border-colors.patch \
+ external/liborcus/0001-xls-xml-Import-hidden-row-and-column-flags.patch \
))
ifeq ($(OS),WNT)