[gnumeric] match the ODF defaults for imported charts better



commit e0da23df66ea1699e2ddb4f2c22cffc6abd515fd
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon Apr 22 13:04:26 2013 -0600

    match the ODF defaults for imported charts better
    
    2013-04-22  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (odf_chart_set_default_style): new
        (oo_chart): use odf_chart_set_default_style

 plugins/openoffice/ChangeLog         |  5 +++++
 plugins/openoffice/openoffice-read.c | 14 ++++++++++++++
 2 files changed, 19 insertions(+)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 358b7dc..9f7dced 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,10 @@
 2013-04-22  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+       * openoffice-read.c (odf_chart_set_default_style): new
+       (oo_chart): use odf_chart_set_default_style
+
+2013-04-22  Andreas J. Guelzow <aguelzow pyrshep ca>
+
        * openoffice-read.c (odf_draw_frame_store_location):
        initialize plot-area dimensions
        (oo_legend_set_position): new
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 1d67111..b4ed1a8 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -8914,6 +8914,19 @@ oo_chart_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 }
 
 static void
+odf_chart_set_default_style (GogObject *chart)
+{
+       GOStyle *style;
+
+       style = go_styled_object_get_style (GO_STYLED_OBJECT (chart));
+
+       style->line.width = -1.0;
+       style->line.dash_type = GO_LINE_NONE;
+
+       go_styled_object_style_changed (GO_STYLED_OBJECT (chart));
+}
+
+static void
 oo_chart (GsfXMLIn *xin, xmlChar const **attrs)
 {
        static OOEnum const types[] = {
@@ -8951,6 +8964,7 @@ oo_chart (GsfXMLIn *xin, xmlChar const **attrs)
        state->chart.plot_type = type;
        state->chart.chart = GOG_CHART (gog_object_add_by_name (
                GOG_OBJECT (state->chart.graph), "Chart", NULL));
+       odf_chart_set_default_style (GOG_OBJECT (state->chart.chart));
        state->chart.plot = NULL;
        state->chart.series = NULL;
        state->chart.axis = NULL;


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