[gnumeric] Fix print flag roundtrip through ODF for images



commit c354f8e506cec0c8d7e9ce41d442cdd67f62beba
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Fri May 8 23:39:39 2020 -0600

    Fix print flag roundtrip through ODF for images
    
    2020-05-08  Andreas J. Guelzow <aguelzow pyrshep ca>
    
            * openoffice-write.c (odf_write_graph): receive style_name
            (odf_write_frame): handle style_name

 plugins/openoffice/ChangeLog          |  5 +++++
 plugins/openoffice/openoffice-write.c | 12 +++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 5a1ff9d36..2dfa4db3f 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-08  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * openoffice-write.c (odf_write_graph): receive style_name
+       (odf_write_frame): handle style_name
+
 2020-05-08  Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * openoffice-read.c (od_draw_frame_start): read style_name
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index ec85cb6c6..f11386069 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -2980,10 +2980,10 @@ odf_n_charts (GnmOOExport *state, SheetObject *so)
 }
 
 static void
-odf_write_graph (GnmOOExport *state, SheetObject *so, char const *name)
+odf_write_graph (GnmOOExport *state, SheetObject *so, char const *name,
+                char const *style_name)
 {
        GnmParsePos pp;
-       gchar const *style_name = g_hash_table_lookup (state->so_styles, so);
 
        parse_pos_init_sheet (&pp, state->sheet);
 
@@ -3087,15 +3087,21 @@ odf_write_image (GnmOOExport *state, SheetObject *so, char const *name)
 static void
 odf_write_frame (GnmOOExport *state, SheetObject *so)
 {
+       char const *style_name = g_hash_table_lookup (state->so_styles, so);
+
        if (GNM_IS_SO_GRAPH (so))
-               odf_write_graph (state, so, g_hash_table_lookup (state->graphs, so));
+               odf_write_graph (state, so, g_hash_table_lookup (state->graphs, so), style_name);
        else if (GNM_IS_SO_IMAGE (so)) {
                gsf_xml_out_start_element (state->xml, DRAW "frame");
+               if (style_name != NULL)
+                       gsf_xml_out_add_cstr (state->xml, DRAW "style-name", style_name);
                odf_write_frame_size (state, so);
                odf_write_image (state, so, g_hash_table_lookup (state->images, so));
                gsf_xml_out_end_element (state->xml); /*  DRAW "frame" */
        } else {
                gsf_xml_out_start_element (state->xml, DRAW "frame");
+               if (style_name != NULL)
+                       gsf_xml_out_add_cstr (state->xml, DRAW "style-name", style_name);
                odf_write_frame_size (state, so);
                gsf_xml_out_start_element (state->xml, DRAW "text-box");
                gsf_xml_out_simple_element (state->xml, TEXT "p",


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