[gnumeric] xlsx: fix schema problem with ring plots.



commit 6cc95aa962468d7cc4e7c3f2093f681acd511ff2
Author: Morten Welinder <terra gnome org>
Date:   Mon Apr 13 10:49:50 2015 -0400

    xlsx: fix schema problem with ring plots.

 plugins/excel/ChangeLog            |    5 +++++
 plugins/excel/xlsx-write-drawing.c |   14 +++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index b205ade..9049e52 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-13  Morten Welinder  <terra gnome org>
+
+       * xlsx-write-drawing.c (xlsx_write_one_plot): Move c:holeSize to
+       where the schema says it should be.
+
 2015-04-11  Morten Welinder  <terra gnome org>
 
        * ms-excel-read.c (excel_read_FORMULA): Only print recalc tag in
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 553dae9..8c94476 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -892,16 +892,12 @@ xlsx_write_one_plot (XLSXWriteState *state, GsfXMLOut *xml,
        case XLSX_PT_GOGPIEPLOT:
        case XLSX_PT_GOGRINGPLOT:
                if (plot_type == XLSX_PT_GOGRINGPLOT) {
-                       gint16 center;
-                       double center_size;
                        gsf_xml_out_start_element (xml, "c:doughnutChart");
-                       g_object_get (G_OBJECT (plot), "center-size", &center_size, NULL);
-                       center = (int)floor (center_size * 100. + .5);
-                       xlsx_write_chart_int (xml, "c:holeSize", CLAMP (center, 10, 90));
                } else
                        gsf_xml_out_start_element (xml, "c:pieChart");
 
                xlsx_write_chart_bool (xml, "c:varyColors", vary_by_element);
+
 #if 0
                double default_separation = 0.;
                /* handled in series ? */
@@ -1103,6 +1099,14 @@ xlsx_write_one_plot (XLSXWriteState *state, GsfXMLOut *xml,
                              "initial-angle", &initial_angle,
                              NULL);
                xlsx_write_chart_int (xml, "c:firstSliceAng", (int) initial_angle);
+
+               if (plot_type == XLSX_PT_GOGRINGPLOT) {
+                       int center;
+                       double center_size;
+                       g_object_get (G_OBJECT (plot), "center-size", &center_size, NULL);
+                       center = (int)floor (center_size * 100. + .5);
+                       xlsx_write_chart_int (xml, "c:holeSize", CLAMP (center, 10, 90));
+               }
                break;
        }
 


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