[gnumeric] Fix print flag roundtrip for sheet objects through ODF. [#486]



commit c3d3a5ad21ae34c0e58c7a111a86ac936351424b
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Wed May 6 01:32:58 2020 -0600

    Fix print flag roundtrip for sheet objects through ODF. [#486]
    
    2020-05-06  Andreas J. Guelzow <aguelzow pyrshep ca>
    
            * openoffice-read.c (oo_prop_list_has): read style:print-content
            (odf_so_filled): set print flag

 plugins/openoffice/ChangeLog         |  5 +++++
 plugins/openoffice/openoffice-read.c | 13 ++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 4a30a440e..892d42bf7 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-06  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * openoffice-read.c (oo_prop_list_has): read style:print-content
+       (odf_so_filled): set print flag
+
 2020-05-06  Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * openoffice-write.c (odf_write_sheet_object_style): write print-content
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 3b7d82c77..b0c6e3a2c 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -7628,6 +7628,11 @@ od_style_prop_chart (GsfXMLIn *xin, xmlChar const **attrs)
                                (style->other_props,
                                 oo_prop_new_string
                                 ("border", CXML2C(attrs[1])));
+               else if (oo_attr_bool (xin, attrs, OO_NS_STYLE, "print-content", &btmp))
+                       style->other_props = g_slist_prepend
+                               (style->other_props,
+                                oo_prop_new_bool ("do-not-print-content", !btmp));
+
                else if (oo_attr_bool (xin, attrs, OO_GNUM_NS_EXT, "auto-marker-outline-colour", &btmp))
                        style->style_props = g_slist_prepend (style->style_props,
                                oo_prop_new_bool ("gnm-auto-marker-outline-colour", btmp));
@@ -10372,9 +10377,15 @@ odf_so_filled (GsfXMLIn *xin, xmlChar const **attrs, gboolean is_oval)
                if (style_name != NULL) {
                        OOChartStyle *oostyle = g_hash_table_lookup
                                (state->chart.graph_styles, style_name);
-                       if (oostyle != NULL)
+                       /* since we are using oo_prop_list_has we need to default to FALSE */
+                       gboolean has_prop = FALSE;
+                       if (oostyle != NULL) {
                                odf_apply_style_props (xin, oostyle->style_props,
                                                       style, FALSE);
+                               oo_prop_list_has (oostyle->other_props, &has_prop, "do-not-print-content");
+                               has_prop =!has_prop;
+                               sheet_object_set_print_flag (state->chart.so, &has_prop);
+                       }
                }
                g_object_set (state->chart.so, "style", style, NULL);
                g_object_unref (style);


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