[gnumeric] Improve ODF roundtrip of conditional formats. [#726201]



commit 90b315a0b08e78e9ab384a056d205ce9ba430f4a
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Mon Mar 17 08:00:11 2014 -0600

    Improve ODF roundtrip of conditional formats. [#726201]
    
    2014-03-17  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-write.c (odf_write_style_cell_properties): even write
        pattern and background colour for pattern 0
        * openoffice-read.c (oo_style_prop_cell): set pattern and background
        colour even for pattern 0

 plugins/openoffice/ChangeLog          |    7 +++++++
 plugins/openoffice/openoffice-read.c  |    5 +++--
 plugins/openoffice/openoffice-write.c |    3 ++-
 3 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index d4d8864..12ee353 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,12 @@
 2014-03-17  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+       * openoffice-write.c (odf_write_style_cell_properties): even write
+       pattern and background colour for pattern 0
+       * openoffice-read.c (oo_style_prop_cell): set pattern and background
+       colour even for pattern 0
+
+2014-03-17  Andreas J. Guelzow <aguelzow pyrshep ca>
+
        * openoffice-write.c (odf_write_style_paragraph_properties): our indent
        is fo:margin-left, not fo:indent
        * openoffice-read.c (oo_style_prop_cell): read fo:margin-left
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 9229138..ccca69c 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -6365,11 +6365,12 @@ oo_style_prop_cell (GsfXMLIn *xin, xmlChar const **attrs)
                gnm_style_set_font_uline (style, underline);
        }
        
-       if (gnm_pattern > 0) {
+       if (gnm_pattern > 0)
                gnm_style_set_pattern (style, gnm_pattern);
+       if (gnm_b_color)
                gnm_style_set_back_color (style, gnm_b_color);
+       if (gnm_p_color)
                gnm_style_set_pattern_color (style, gnm_p_color);
-       }
 }
 
 static OOPageBreakType
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index a0b587e..b7dfc25 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -1193,7 +1193,8 @@ odf_write_style_cell_properties (GnmOOExport *state, GnmStyle const *style)
 
                gnm_xml_out_add_hex_color (state->xml, FOSTYLE "background-color",
                                           gnm_style_get_back_color (style), pattern);
-               if (state->with_extension && pattern_set && pattern != 0) {
+               if (state->with_extension) {
+                       /* We save this to retain as much state as possible. */
                        gnm_xml_out_add_hex_color (state->xml, GNMSTYLE "background-colour",
                                                   gnm_style_get_back_color (style), 1);
                        gnm_xml_out_add_hex_color (state->xml, GNMSTYLE "pattern-colour",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]