diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2018-02-08 20:01:16 -0500 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2018-02-09 12:45:04 +0100 |
commit | 1af6354b46f32603365b53be16178ee792ba428a (patch) | |
tree | 40ca0f692290c591bbe7f6e770a667da2504ad93 /external | |
parent | 2ebb38dd36022d5d61bfb9fc3edfbf460153e1ff (diff) |
Pick up cell border colors when importing via orcus.
Change-Id: Iee2d79930d0c917518b180fdd63fe30c6860b9b1
Reviewed-on: https://gerrit.libreoffice.org/49466
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-Pick-up-border-colors.patch | 69 | ||||
-rw-r--r-- | external/liborcus/UnpackedTarball_liborcus.mk | 1 |
2 files changed, 70 insertions, 0 deletions
diff --git a/external/liborcus/0001-xls-xml-Pick-up-border-colors.patch b/external/liborcus/0001-xls-xml-Pick-up-border-colors.patch new file mode 100644 index 000000000000..1dff6bf93415 --- /dev/null +++ b/external/liborcus/0001-xls-xml-Pick-up-border-colors.patch @@ -0,0 +1,69 @@ +From 0a4e8c44fc8229818191c6b9b46e4de079d0ca3b Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida <kohei.yoshida@gmail.com> +Date: Thu, 8 Feb 2018 17:59:11 -0500 +Subject: [PATCH] xls-xml: Pick up border colors. + +(cherry picked from commit e065d26dabafea465ec49e7d79775e62014ac0db) +--- + src/liborcus/xls_xml_context.cpp | 10 ++++++++++ + src/liborcus/xls_xml_context.hpp | 1 + + 2 files changed, 11 insertions(+) + +diff --git a/src/liborcus/xls_xml_context.cpp b/src/liborcus/xls_xml_context.cpp +index 790dfed..917ff86 100644 +--- a/src/liborcus/xls_xml_context.cpp ++++ b/src/liborcus/xls_xml_context.cpp +@@ -1069,6 +1069,7 @@ void xls_xml_context::start_element_border(const xml_token_pair_t& parent, const + + spreadsheet::border_direction_t dir = spreadsheet::border_direction_t::unknown; + spreadsheet::border_style_t style = spreadsheet::border_style_t::unknown; ++ spreadsheet::color_rgb_t color; + long weight = 0; + + for (const xml_token_attr_t& attr : attrs) +@@ -1093,6 +1094,11 @@ void xls_xml_context::start_element_border(const xml_token_pair_t& parent, const + weight = to_long(attr.value); + break; + } ++ case XML_Color: ++ { ++ color = spreadsheet::to_color_rgb(attr.value.data(), attr.value.size()); ++ break; ++ } + default: + ; + } +@@ -1105,6 +1111,7 @@ void xls_xml_context::start_element_border(const xml_token_pair_t& parent, const + border_style_type& bs = m_current_style->borders.back(); + bs.dir = dir; + bs.style = style; ++ bs.color = color; + + switch (bs.style) + { +@@ -1525,7 +1532,10 @@ void xls_xml_context::commit_styles() + styles->set_border_count(style->borders.size()); + + for (const border_style_type& b : style->borders) ++ { + styles->set_border_style(b.dir, b.style); ++ styles->set_border_color(b.dir, 255, b.color.red, b.color.green, b.color.blue); ++ } + + size_t border_id = styles->commit_border(); + styles->set_xf_border(border_id); +diff --git a/src/liborcus/xls_xml_context.hpp b/src/liborcus/xls_xml_context.hpp +index 47cd01c..93dceca 100644 +--- a/src/liborcus/xls_xml_context.hpp ++++ b/src/liborcus/xls_xml_context.hpp +@@ -107,6 +107,7 @@ class xls_xml_context : public xml_context_base + { + spreadsheet::border_direction_t dir = spreadsheet::border_direction_t::unknown; + spreadsheet::border_style_t style = spreadsheet::border_style_t::unknown; ++ spreadsheet::color_rgb_t color; + }; + + struct font_style_type +-- +2.7.4 + diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk index 3b49e0a58f63..a35ad9eec002 100644 --- a/external/liborcus/UnpackedTarball_liborcus.mk +++ b/external/liborcus/UnpackedTarball_liborcus.mk @@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\ external/liborcus/rpath.patch.0 \ 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 \ )) ifeq ($(OS),WNT) |