[gnumeric] In XLSX files, do not ignore gradient cell background fills completely. Part of [#644496]
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] In XLSX files, do not ignore gradient cell background fills completely. Part of [#644496]
- Date: Tue, 14 Jun 2011 19:40:57 +0000 (UTC)
commit 2739b2c681cb4d8da48b2106da5c968ffadd5eba
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Tue Jun 14 13:39:39 2011 -0600
In XLSX files, do not ignore gradient cell background fills completely. Part of [#644496]
2011-06-14 Andreas J. Guelzow <aguelzow pyrshep ca>
* xlsx-read.c (xlsx_cell_begin): don't overwrite an existing row style
(xlsx_CT_Row): the row style should only be used if customFormat == 1
(xlsx_CT_GradientFill): consider this a solid colour fill until we
really import the gradients
NEWS | 2 ++
plugins/excel/ChangeLog | 7 +++++++
plugins/excel/xlsx-read.c | 11 ++++++++---
3 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index 38f0869..a5f00f3 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ Andreas
* Fix regression line export to ODF.
* Fix font and background colour import of LibreOffice generated xlsx
files. Part of [#644496]
+ * In XLSX files, do not ignore gradient cell background fills
+ completely. Part of [#644496]
Morten:
* Fix leaks in SHEET. [#650761]
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 71225d2..97f279c 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,12 @@
2011-06-14 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * xlsx-read.c (xlsx_cell_begin): don't overwrite an existing row style
+ (xlsx_CT_Row): the row style should only be used if customFormat == 1
+ (xlsx_CT_GradientFill): consider this a solid colour fill until we
+ really import the gradients
+
+2011-06-14 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* xlsx-read.c (elem_color): add allow_alpha argument, change all
callers and set alpha to 0xFF if it is not allowed
(xlsx_pattern_fg_bg): if we are reading a colour for a solid fill, ignore
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 8a91b2b..6239310 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -1266,7 +1266,8 @@ xlsx_cell_begin (GsfXMLIn *xin, xmlChar const **attrs)
if (NULL != style) {
gnm_style_ref (style);
- sheet_style_set_pos (state->sheet,
+ /* There may already be a row style set!*/
+ sheet_style_apply_pos (state->sheet,
state->pos.col, state->pos.row, style);
}
}
@@ -1337,7 +1338,7 @@ xlsx_CT_Row (GsfXMLIn *xin, xmlChar const **attrs)
colrow_set_outline (sheet_row_fetch (state->sheet, row),
outline, collapsed);
- if (NULL != style) {
+ if (NULL != style && cust_fmt) {
GnmRange r;
r.start.row = r.end.row = row;
r.start.col = 0;
@@ -3623,6 +3624,10 @@ xlsx_pattern_fg_bg (GsfXMLIn *xin, xmlChar const **attrs)
static void
xlsx_CT_GradientFill (GsfXMLIn *xin, xmlChar const **attrs)
{
+ XLSXReadState *state = (XLSXReadState *)xin->user_state;
+
+ gnm_style_set_pattern (state->style_accum, 1);
+
#if 0
XLSXReadState *state = (XLSXReadState *)xin->user_state;
<xsd:attribute name="type" type="ST_GradientType" use="optional" default="linear">
@@ -3895,7 +3900,7 @@ GSF_XML_IN_NODE_FULL (START, STYLE_INFO, XL_NS_SS, "styleSheet", GSF_XML_NO_CONT
GSF_XML_IN_NODE (FILL, IMAGE_FILL, XL_NS_SS, "image", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (FILL, GRADIENT_FILL, XL_NS_SS, "gradientFill", GSF_XML_NO_CONTENT, &xlsx_CT_GradientFill, NULL),
GSF_XML_IN_NODE (GRADIENT_FILL, GRADIENT_STOPS, XL_NS_SS, "stop", GSF_XML_NO_CONTENT, NULL, NULL),
- GSF_XML_IN_NODE (GRADIENT_STOPS, GRADIENT_COLOR, XL_NS_SS, "color", GSF_XML_NO_CONTENT, NULL, NULL),
+ GSF_XML_IN_NODE_FULL (GRADIENT_STOPS, GRADIENT_COLOR, XL_NS_SS, "color", GSF_XML_NO_CONTENT, FALSE, FALSE, &xlsx_pattern_fg_bg, NULL, TRUE),
GSF_XML_IN_NODE_FULL (STYLE_INFO, BORDERS, XL_NS_SS, "borders", GSF_XML_NO_CONTENT,
FALSE, FALSE, &xlsx_collection_begin, &xlsx_collection_end, XLSX_COLLECT_BORDERS),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]