[gnumeric] ODF import/export the z-index for line objects.



commit 9cf80219aa64450e7bb604169a3322897ee8f51c
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Sat Feb 7 13:45:23 2015 -0700

    ODF import/export the z-index for line objects.
    
    2015-02-07  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (odf_line): read the z-index
        * openoffice-write.c (odf_write_line): write a z-index

 NEWS                                  |    1 +
 plugins/openoffice/ChangeLog          |    5 +++++
 plugins/openoffice/openoffice-read.c  |    6 +++++-
 plugins/openoffice/openoffice-write.c |    4 ++++
 4 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index ce7ea44..ad3dc62 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Gnumeric 1.12.21
 
 Andreas:
        * ODF import/export general plot data specifications. [#743818]
+       * ODF import/export the z-index for line objects.
 
 Morten:
        * Initial xlsx import of sheet widgets.
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index ccc92b3..667ac19 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,10 @@
 2015-02-07  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+       * openoffice-read.c (odf_line): read the z-index
+       * openoffice-write.c (odf_write_line): write a z-index
+
+2015-02-07  Andreas J. Guelzow <aguelzow pyrshep ca>
+
        * openoffice-read.c (oo_table_end): put all objects without z-index at the top.
 
 2015-02-07  Andreas J. Guelzow <aguelzow pyrshep ca>
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 0147c25..edaa53c 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -10342,6 +10342,7 @@ odf_line (GsfXMLIn *xin, xmlChar const **attrs)
        double frame_offset[4];
        char const *style_name = NULL;
        gdouble height, width;
+       int z = -1;
 
        cell_base.start.col = cell_base.end.col = state->pos.eval.col;
        cell_base.start.row = cell_base.end.row = state->pos.eval.row;
@@ -10375,7 +10376,9 @@ odf_line (GsfXMLIn *xin, xmlChar const **attrs)
                                cell_base.end.col = ref.a.col;
                                cell_base.end.row = ref.a.row;
                        }
-               }
+               } else if (oo_attr_int_range (xin,attrs, OO_NS_DRAW, "z-index",
+                                             &z, 0, G_MAXINT))
+                       ;
 
        if (x1 < x2) {
                if (y1 < y2)
@@ -10467,6 +10470,7 @@ odf_line (GsfXMLIn *xin, xmlChar const **attrs)
                }
        }
        odf_push_text_p (state, FALSE);
+       state->chart.z_index = z;
 }
 
 /****************************************************************************/
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index e245a30..ea9fe34 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -3174,10 +3174,14 @@ odf_write_line (GnmOOExport *state, SheetObject *so)
        char *formula;
        double x1, y1, x2, y2;
        gchar const *style_name = g_hash_table_lookup (state->so_styles, so);
+       int z;
 
        gsf_xml_out_start_element (state->xml, DRAW "line");
        if (style_name != NULL)
                gsf_xml_out_add_cstr (state->xml, DRAW "style-name", style_name);
+       z = g_slist_length (state->sheet->sheet_objects) - 
+               sheet_object_get_stacking (so);
+       gsf_xml_out_add_int (state->xml, DRAW "z-index", z);
 
        sheet_object_anchor_to_offset_pts (anchor, state->sheet, res_pts);
        odf_add_pt (state->xml, TABLE "end-x", res_pts[2]);


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