[gnumeric] Graphs: Force update of graphs after load.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Graphs: Force update of graphs after load.
- Date: Mon, 19 Jan 2015 18:11:55 +0000 (UTC)
commit e4178e4fdbc65f552a2283d56a35a41f29cc7ece
Author: Morten Welinder <terra gnome org>
Date: Mon Jan 19 13:11:16 2015 -0500
Graphs: Force update of graphs after load.
This forces the idle handlers to run.
ChangeLog | 7 +++++++
plugins/excel/xlsx-write-drawing.c | 8 +++++++-
src/workbook-view.c | 1 +
src/workbook.c | 15 +++++++++++++++
src/workbook.h | 2 ++
5 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7555b85..a9235b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-01-19 Morten Welinder <terra gnome org>
+
+ * src/workbook.c (workbook_update_graphs): New function.
+
+ * src/workbook-view.c (workbook_view_new_from_input): Update
+ graphs.
+
2015-01-14 Morten Welinder <terra gnome org>
* src/xml-sax-read.c (xml_sax_cell_content): When we fail to parse
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index a7fd1ac..aa2e47c 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -324,6 +324,12 @@ xlsx_write_axis (XLSXWriteState *state, GsfXMLOut *xml, GogAxis *axis, GogAxisTy
GogObject *label;
GOFormat *format;
+#ifdef DEBUG_AXIS
+ g_printerr ("Writing axis %s. (discrete = %d)\n",
+ gog_object_get_name (GOG_OBJECT (axis)),
+ gog_axis_is_discrete (axis));
+#endif
+
if (gog_axis_is_discrete (axis))
gsf_xml_out_start_element (xml, "c:catAx");
else
@@ -701,7 +707,7 @@ xlsx_write_one_chart (XLSXWriteState *state, GsfXMLOut *xml, GogObject const *ch
static void
xlsx_write_chart (XLSXWriteState *state, GsfOutput *chart_part, SheetObject *so)
{
- GogGraph const *graph;
+ GogGraph const *graph;
GogObject const *chart;
GsfXMLOut *xml;
diff --git a/src/workbook-view.c b/src/workbook-view.c
index fe71f8f..93a5ac8 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -1292,6 +1292,7 @@ workbook_view_new_from_input (GsfInput *input,
workbook_optimize_style (new_wb);
workbook_queue_volatile_recalc (new_wb);
workbook_recalc (new_wb);
+ workbook_update_graphs (new_wb);
go_doc_set_dirty (GO_DOC (new_wb), FALSE);
if (optional_uri && workbook_get_file_exporter (new_wb))
workbook_set_last_export_uri
diff --git a/src/workbook.c b/src/workbook.c
index 272761a..07a068b 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -38,6 +38,7 @@
#include "gnm-marshalers.h"
#include "style-color.h"
#include "sheet-style.h"
+#include "sheet-object-graph.h"
#include <goffice/goffice.h>
@@ -110,6 +111,20 @@ workbook_update_history (Workbook *wb, GnmFileSaveAsStyle type)
}
}
+void
+workbook_update_graphs (Workbook *wb)
+{
+ WORKBOOK_FOREACH_SHEET (wb, sheet, ({
+ GSList *l, *graphs = sheet_objects_get (sheet, NULL, SHEET_OBJECT_GRAPH_TYPE);
+ for (l = graphs; l; l = l->next) {
+ SheetObject *sog = l->data;
+ gog_graph_force_update (sheet_object_graph_get_gog (sog));
+ }
+ g_slist_free (graphs);
+ }));
+}
+
+
static void
workbook_dispose (GObject *wb_object)
{
diff --git a/src/workbook.h b/src/workbook.h
index 6cb4f23..139c19d 100644
--- a/src/workbook.h
+++ b/src/workbook.h
@@ -45,6 +45,8 @@ unsigned workbook_find_command (Workbook *wb,
GnmExprSharer *workbook_share_expressions (Workbook *wb, gboolean freeit);
void workbook_optimize_style (Workbook *wb);
+void workbook_update_graphs (Workbook *wb);
+
/* IO Routines */
gboolean workbook_set_saveinfo (Workbook *wb, GOFileFormatLevel lev,
GOFileSaver *saver);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]