29
29
#include <sheet-object-graph.h>
30
30
#include <workbook-view.h>
32
#include <goffice/graph/goffice-graph.h>
33
#include <goffice/graph/gog-graph.h>
34
#include <goffice/graph/gog-chart.h>
35
#include <goffice/graph/gog-axis.h>
36
#include <goffice/graph/gog-grid-line.h>
37
#include <goffice/graph/gog-plot-impl.h>
38
#include <goffice/graph/gog-series-impl.h>
39
#include <goffice/graph/gog-object.h>
40
#include <goffice/graph/gog-styled-object.h>
41
#include <goffice/graph/gog-plot-engine.h>
42
#include <goffice/graph/gog-renderer.h>
43
#include <goffice/graph/gog-error-bar.h>
44
#include <goffice/graph/gog-reg-curve.h>
45
#include <goffice/graph/gog-label.h>
46
#include <goffice/data/go-data-simple.h>
47
#include <goffice/utils/go-color.h>
48
#include <goffice/utils/go-font.h>
49
#include <goffice/utils/go-line.h>
50
#include <goffice/utils/go-pattern.h>
51
#include <goffice/utils/go-marker.h>
52
#include <goffice/utils/go-glib-extras.h>
53
#include <goffice/utils/go-style.h>
54
#include <goffice/utils/go-styled-object.h>
32
#include <goffice/goffice.h>
56
34
#include <gsf/gsf-utils.h>
3411
3389
sernum = GSF_LE_GET_GUINT16 (q->data + 2);
3412
3390
val = gsf_le_get_double (q->data + ofs);
3414
if (state->series == NULL)
3392
if (state->series == NULL || state->cur_role < 0)
3417
XL_CHECK_CONDITION (state->cur_role >= 0);
3418
3394
XL_CHECK_CONDITION (state->cur_role < GOG_MS_DIM_TYPES);
3419
3395
XL_CHECK_CONDITION (sernum < state->series->len);
3443
3419
sernum = GSF_LE_GET_GUINT16 (q->data + 2);
3444
3420
/* xf = GSF_LE_GET_GUINT16 (q->data + 4); */
3446
if (state->series == NULL)
3422
if (state->series == NULL || state->cur_role < 0)
3449
XL_CHECK_CONDITION (state->cur_role >= 0);
3450
3424
XL_CHECK_CONDITION (state->cur_role < GOG_MS_DIM_TYPES);
3451
3425
XL_CHECK_CONDITION (sernum < state->series->len);
5747
5721
break; /* hopefully there is only one matrix */
5749
5723
if (!has_matrix) {
5750
for (series = gog_plot_get_series (plots->data) ; series != NULL ; series = series->next)
5751
num_series += chart_write_series (&state, series->data, num_series);
5724
for (series = gog_plot_get_series (plots->data) ; series != NULL ; series = series->next)
5725
num_series += chart_write_series (&state, series->data, num_series);
5752
5726
} else if (n == 2) { /* surfaces and countours have the matrix as third data, other
5753
5727
plot types that might use matrices will probably not be exportable
5754
5728
to any of excel formats */
5755
/* we should have only one series there */
5756
GogSeries *ser = GOG_SERIES (gog_plot_get_series (plots->data)->data);
5757
/* create an equivalent XLContourPlot and save its series */
5729
/* we should have only one series there */
5730
GogSeries *ser = GOG_SERIES (gog_plot_get_series (plots->data)->data);
5731
/* create an equivalent XLContourPlot and save its series */
5759
5733
gboolean as_col, s_as_col = FALSE;
5760
5734
gboolean s_is_rc = FALSE, mat_is_rc;
5761
5735
GnmExprTop const *stexpr = NULL;
5762
GnmExprTop const *mattexpr;
5736
GnmExprTop const *mattexpr;
5763
5737
GnmValue const *sval = NULL, *matval;
5766
GnmRange vector, svec;
5740
GnmRange vector, svec;
5767
5741
int i, j, sn = 0, cur = 0, scur = 0;
5768
5742
GOData *s, *c, *mat = ser->values[2].data;
5769
5743
GODataMatrixSize size = go_data_matrix_get_size (GO_DATA_MATRIX (mat));