~ubuntu-branches/ubuntu/quantal/gnumeric/quantal

« back to all changes in this revision

Viewing changes to plugins/excel/ms-chart.c

  • Committer: Bazaar Package Importer
  • Author(s): Gauvain Pocentek
  • Date: 2009-06-22 13:37:20 UTC
  • mfrom: (1.1.20 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090622133720-rtdazsiz2lx5q8l7
Tags: 1.9.9-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Promoted gnumeric-doc to Recommends in gnumeric package for help to be
    installed automatically
  - gnumeric-gtk is a transitional package
  - gnumeric conflicts with gnumeric-gtk << 1.8.3-3ubuntu1
  - call initltool-update in po*
  - remove psiconv support (psiconv is in universe):
    o debian/control: remove B-D on libpsiconv-dev
    o debian/rules: don't pass --with-psiconv to ./configure
    o debian/gnumeric-plugins-extra.install: don't install the psiconv
      plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <sheet-object-graph.h>
30
30
#include <workbook-view.h>
31
31
 
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>
55
33
 
56
34
#include <gsf/gsf-utils.h>
57
35
#include <math.h>
3411
3389
        sernum = GSF_LE_GET_GUINT16 (q->data + 2);
3412
3390
        val = gsf_le_get_double (q->data + ofs);
3413
3391
 
3414
 
        if (state->series == NULL)
 
3392
        if (state->series == NULL || state->cur_role < 0)
3415
3393
                return;
3416
 
 
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);
3420
3396
 
3443
3419
        sernum = GSF_LE_GET_GUINT16 (q->data + 2);
3444
3420
        /* xf  = GSF_LE_GET_GUINT16 (q->data + 4); */
3445
3421
 
3446
 
        if (state->series == NULL)
 
3422
        if (state->series == NULL || state->cur_role < 0)
3447
3423
                return;
3448
 
 
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);
3452
3426
 
5747
5721
                                        break; /* hopefully there is only one matrix */
5748
5722
                                }
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 */
5758
 
                                if (ser != NULL) {
 
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 */
 
5732
                                if (ser != NULL) {
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;
5764
 
                                        GnmValue *val;
5765
 
                                        GogSeries *serbuf;
5766
 
                                        GnmRange vector, svec;
 
5738
                                        GnmValue *val;
 
5739
                                        GogSeries *serbuf;
 
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));