Commit b3b93a11 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

only delete the series after processing. condtionalize some of the debug

2001-08-23  Jody Goldberg <jgoldberg@home.com>

	* ms-chart.c (ms_excel_chart) : only delete the series after
	  processing.  condtionalize some of the debug spew.
	  condtionalize parsing based on the existence of a graph
	  condtionalize making the graph on the debug flag (for now)
	(BC_R(sertocrt)) : store the chart group.
	(BC_R(series_impl)) : merge back into BC_R(series).
	(BC_R(vector_details)) : use the gnumeric type directly.
	(excel_chart_series_new) : new.
	(excel_chart_series_destroy) : new.

	* ms-container.c (ms_container_workbook) : new function.
	(ms_container_sheet) : ditto.

	* ms-excel-read.c (ms_wb_workbook) : new function.
	(ms_excel_workbook_new) : used here.
	(ms_sheet_workbook) : new function.
	(ms_sheet_sheet) : new function.
	(ms_excel_sheet_new) : used here.

2001-08-21  Jody Goldberg <jgoldberg@home.com>

	* ms-chart.c (gnm_graph_vector_type_name) : use the version in gnumeric-graph.c
	(BC_R(vector_details)) : Use the correct index for the debug info.

	* ms-excel-read.c (ms_excel_biff_dimensions) : Use range_name.

2001-08-23  Jody Goldberg <jgoldberg@home.com>

	* dialog-graph-guru.c (graph_guru_create_vectors_from_range) : Use the
	  new gnm_graph_vector_new interface.
	(cb_data_simple_col_row_toggle) : use gnm_graph_arrange_vectors.
2001-08-23  Jody Goldberg <jgoldberg@home.com>

	* idl/gnumeric-graphs.idl : reorganize to improve naming.
	  remove notion of header that was not working well.
	  remove freeze.
	  add arrangeVector.
	  add notion of selection for future uese.

	* src/gnumeric-graph.c (gnm_graph_vector_type_name) : add these.
	(MANAGER) : bump the idl version.
	(GnmGraphVector) : remove header, add id, adjust to new idl and use
	  vectors directly, rather than notifies.
	(gnm_graph_add_vector) : adjust to idl renaming.
	(gnm_graph_new) : improve error message.
	(gnm_graph_freeze) : delete.
	(gnm_graph_arrange_vectors) : new function.
	(gnm_graph_vector_seq_{scalar,date,string}) : headers are handled at a
	  higher level.
	(gnm_graph_vector_eval) : idl renaming.
	(impl_vector_selection_selected) : new.
	(gnm_graph_vector_corba_init) : split from gnm_graph_vector_new to
	  simpify cut-n-paste sharing with guppi.
	(gnm_graph_vector_corba_destroy) : Fix and split out to simplify
	  sharing.
	(gnm_graph_vector_destroy) : simplify and handle the case of a vector
	  being destroyed indepenently of the graph.
	(gnm_graph_vector_new) : handle headers at a higher level.
	(gnm_graph_vector_corba_class_init) : renamed from
	  corba_implementation_classes_init.

	* src/sheet-object-container.c (sheet_object_container_new_view) : Use
	  bonobo_client_site_new_view_full to disable the irrtiating frame
	  that causes the content to change size when the frme is activated
	  and deactivated.
parent 7c1bcd9c
2001-08-23 Jody Goldberg <jgoldberg@home.com>
* idl/gnumeric-graphs.idl : reorganize to improve naming.
remove notion of header that was not working well.
remove freeze.
add arrangeVector.
add notion of selection for future uese.
* src/gnumeric-graph.c (gnm_graph_vector_type_name) : add these.
(MANAGER) : bump the idl version.
(GnmGraphVector) : remove header, add id, adjust to new idl and use
vectors directly, rather than notifies.
(gnm_graph_add_vector) : adjust to idl renaming.
(gnm_graph_new) : improve error message.
(gnm_graph_freeze) : delete.
(gnm_graph_arrange_vectors) : new function.
(gnm_graph_vector_seq_{scalar,date,string}) : headers are handled at a
higher level.
(gnm_graph_vector_eval) : idl renaming.
(impl_vector_selection_selected) : new.
(gnm_graph_vector_corba_init) : split from gnm_graph_vector_new to
simpify cut-n-paste sharing with guppi.
(gnm_graph_vector_corba_destroy) : Fix and split out to simplify
sharing.
(gnm_graph_vector_destroy) : simplify and handle the case of a vector
being destroyed indepenently of the graph.
(gnm_graph_vector_new) : handle headers at a higher level.
(gnm_graph_vector_corba_class_init) : renamed from
corba_implementation_classes_init.
* src/sheet-object-container.c (sheet_object_container_new_view) : Use
bonobo_client_site_new_view_full to disable the irrtiating frame
that causes the content to change size when the frme is activated
and deactivated.
2001-08-22 Zbigniew Chyla <cyba@gnome.pl>
Fixes #59334
......
--------------------------------------------------------------------------
Gnumeric 0.71
Jody:
* bump bonobo req to 1.0.8 to fix the memory problem.
* bump the gnome-print req to 0.29 in an effort to decrease
the number of problems with gnome-print installs.
Morten:
* Speed up font handling a bit.
......
2001-08-23 Jody Goldberg <jgoldberg@home.com>
* idl/gnumeric-graphs.idl : reorganize to improve naming.
remove notion of header that was not working well.
remove freeze.
add arrangeVector.
add notion of selection for future uese.
* src/gnumeric-graph.c (gnm_graph_vector_type_name) : add these.
(MANAGER) : bump the idl version.
(GnmGraphVector) : remove header, add id, adjust to new idl and use
vectors directly, rather than notifies.
(gnm_graph_add_vector) : adjust to idl renaming.
(gnm_graph_new) : improve error message.
(gnm_graph_freeze) : delete.
(gnm_graph_arrange_vectors) : new function.
(gnm_graph_vector_seq_{scalar,date,string}) : headers are handled at a
higher level.
(gnm_graph_vector_eval) : idl renaming.
(impl_vector_selection_selected) : new.
(gnm_graph_vector_corba_init) : split from gnm_graph_vector_new to
simpify cut-n-paste sharing with guppi.
(gnm_graph_vector_corba_destroy) : Fix and split out to simplify
sharing.
(gnm_graph_vector_destroy) : simplify and handle the case of a vector
being destroyed indepenently of the graph.
(gnm_graph_vector_new) : handle headers at a higher level.
(gnm_graph_vector_corba_class_init) : renamed from
corba_implementation_classes_init.
* src/sheet-object-container.c (sheet_object_container_new_view) : Use
bonobo_client_site_new_view_full to disable the irrtiating frame
that causes the content to change size when the frme is activated
and deactivated.
2001-08-22 Zbigniew Chyla <cyba@gnome.pl>
Fixes #59334
......
2001-08-23 Jody Goldberg <jgoldberg@home.com>
* idl/gnumeric-graphs.idl : reorganize to improve naming.
remove notion of header that was not working well.
remove freeze.
add arrangeVector.
add notion of selection for future uese.
* src/gnumeric-graph.c (gnm_graph_vector_type_name) : add these.
(MANAGER) : bump the idl version.
(GnmGraphVector) : remove header, add id, adjust to new idl and use
vectors directly, rather than notifies.
(gnm_graph_add_vector) : adjust to idl renaming.
(gnm_graph_new) : improve error message.
(gnm_graph_freeze) : delete.
(gnm_graph_arrange_vectors) : new function.
(gnm_graph_vector_seq_{scalar,date,string}) : headers are handled at a
higher level.
(gnm_graph_vector_eval) : idl renaming.
(impl_vector_selection_selected) : new.
(gnm_graph_vector_corba_init) : split from gnm_graph_vector_new to
simpify cut-n-paste sharing with guppi.
(gnm_graph_vector_corba_destroy) : Fix and split out to simplify
sharing.
(gnm_graph_vector_destroy) : simplify and handle the case of a vector
being destroyed indepenently of the graph.
(gnm_graph_vector_new) : handle headers at a higher level.
(gnm_graph_vector_corba_class_init) : renamed from
corba_implementation_classes_init.
* src/sheet-object-container.c (sheet_object_container_new_view) : Use
bonobo_client_site_new_view_full to disable the irrtiating frame
that causes the content to change size when the frme is activated
and deactivated.
2001-08-22 Zbigniew Chyla <cyba@gnome.pl>
Fixes #59334
......
2001-08-23 Jody Goldberg <jgoldberg@home.com>
* idl/gnumeric-graphs.idl : reorganize to improve naming.
remove notion of header that was not working well.
remove freeze.
add arrangeVector.
add notion of selection for future uese.
* src/gnumeric-graph.c (gnm_graph_vector_type_name) : add these.
(MANAGER) : bump the idl version.
(GnmGraphVector) : remove header, add id, adjust to new idl and use
vectors directly, rather than notifies.
(gnm_graph_add_vector) : adjust to idl renaming.
(gnm_graph_new) : improve error message.
(gnm_graph_freeze) : delete.
(gnm_graph_arrange_vectors) : new function.
(gnm_graph_vector_seq_{scalar,date,string}) : headers are handled at a
higher level.
(gnm_graph_vector_eval) : idl renaming.
(impl_vector_selection_selected) : new.
(gnm_graph_vector_corba_init) : split from gnm_graph_vector_new to
simpify cut-n-paste sharing with guppi.
(gnm_graph_vector_corba_destroy) : Fix and split out to simplify
sharing.
(gnm_graph_vector_destroy) : simplify and handle the case of a vector
being destroyed indepenently of the graph.
(gnm_graph_vector_new) : handle headers at a higher level.
(gnm_graph_vector_corba_class_init) : renamed from
corba_implementation_classes_init.
* src/sheet-object-container.c (sheet_object_container_new_view) : Use
bonobo_client_site_new_view_full to disable the irrtiating frame
that causes the content to change size when the frme is activated
and deactivated.
2001-08-22 Zbigniew Chyla <cyba@gnome.pl>
Fixes #59334
......
Gnumeric -- The GNOME spreadsheet program
Gnumeric -- The GNOME spreadsheet
Jody Goldberg <jgoldberg@home.com>
Miguel de Icaza <miguel@helixcode.com>
Miguel de Icaza <miguel@ximian.com>
This is Gnumeric, the GNOME spreadsheet.
......@@ -8,9 +8,9 @@ This is Gnumeric, the GNOME spreadsheet.
file COPYING.
The project aims to become a drop in replacement for commercial
spreadsheets. Gnumeric is still a young program and it is advancing steadily.
If you are interested in contributing to it's development please send us some
email, there are lots of projects available.
spreadsheets. Gnumeric is still a young program and it is advancing
steadily. If you are interested in contributing to it's development please
send us some email, there are lots of projects available.
To report Gnumeric bugs, please visit bugzilla.gnome.org.
......@@ -26,20 +26,19 @@ You need:
libglade >= 0.16
gal >= 0.8
gnome-print >= 0.25
gnome-xml >= 1.8.14 (gnome-xml 2.x not supported yet)
gnome-xml >= 1.8.14 (gnome-xml 2.x not supported yet)
NOTE : gnome-xml is also known as libxml
libole2 >= 0.2.3
NOTE : libole2 is also known as libgnomeole2
bonobo >= 1.0.3
With the newer bonobo you will also want a newer gnome-libs
gnome-libs >= 1.2.7 (gnome-libs 2.0 is not supported)
Optionally:
evolution CVS
gb == 0.0.19 (Gnome Basic for macros)
gda >= 0.2.11 (GDA plugin, for accessing databases)
guile >= 1.5 ("Soon" to be releated Guile version)
guppi == CVS module guppi3
bonobo >= 1.0.8
NOTE : With bonobo you will need gnome-libs >= 1.2.7
gb == 0.0.19 (Gnome Basic for macros)
gda >= 0.2.11 (GDA plugin, for accessing databases)
guile >= 1.5 ("Soon" to be releated Guile version)
guppi == CVS module guppi3
evolution == CVS
Notes regarding plugins
-----------------------
......
......@@ -8,45 +8,65 @@
module GNOME {
module Gnumeric {
interface VectorNotify {
oneway void headerChanged (in string header);
struct Pair {
short start;
short end;
};
typedef sequence<double> SeqScalar;
interface VectorScalarNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqScalar new_values);
};
interface VectorScalar : VectorScalarNotify {
void value (out SeqScalar values);
};
typedef sequence<long> SeqDate;
interface VectorDateNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqDate new_values);
/* This is a place holder */
typedef sequence<Pair> SeqPair;
interface VectorSelection {
oneway void selected (in SeqPair ranges);
};
interface VectorDate : VectorDateNotify {
void value (out SeqDate values);
module Scalar {
typedef sequence<double> Seq;
interface Vector : VectorSelection {
oneway void changed (in short start, in Seq new_values);
void value (out Seq values);
};
};
typedef sequence<string> SeqString;
interface VectorStringNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqString new_values);
module Date {
typedef sequence<long> Seq;
interface Vector : VectorSelection {
oneway void changed (in short start, in Seq new_values);
void value (out Seq values);
};
};
interface VectorString : VectorStringNotify {
void value (out SeqString values);
module String {
typedef sequence<string> Seq;
interface Vector : VectorSelection {
oneway void changed (in short start, in Seq new_values);
void value (out Seq values);
};
};
module Graph {
interface Manager_v1 : Bonobo::Unknown {
Bonobo::Control getTypeSelectControl ();
Bonobo::Control getLayoutControl ();
interface Manager_v2 : Bonobo::Unknown {
typedef long VectorID;
typedef sequence<VectorID> VectorIDs;
Scalar::Vector addScalarVector (in Scalar::Vector v, in VectorID id);
Date::Vector addDateVector (in Date::Vector v, in VectorID id);
String::Vector addStringVector (in String::Vector v, in VectorID id);
VectorScalarNotify addVectorScalar (in VectorScalar v, in long id);
VectorDateNotify addVectorDate (in VectorDate v, in long id);
VectorStringNotify addVectorString (in VectorString v, in long id);
/**
* clearVectors :
*
* Remove all references to the existing set of vectors.
*/
oneway void clearVectors ();
oneway void freeze (in boolean flag);
oneway void clearVectors ();
/**
* arrangeVectors :
*
* Take the set of vectors and their optional
* headers in the order specified by the
* supplied @data ids, and arrange them into a
* graph using the 'current' graph type.
*/
oneway void arrangeVectors (in VectorIDs data, in VectorIDs optional_headers);
Bonobo::Control getTypeSelectControl ();
Bonobo::Control getLayoutControl ();
};
};
};
......
......@@ -8,45 +8,65 @@
module GNOME {
module Gnumeric {
interface VectorNotify {
oneway void headerChanged (in string header);
struct Pair {
short start;
short end;
};
typedef sequence<double> SeqScalar;
interface VectorScalarNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqScalar new_values);
};
interface VectorScalar : VectorScalarNotify {
void value (out SeqScalar values);
};
typedef sequence<long> SeqDate;
interface VectorDateNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqDate new_values);
/* This is a place holder */
typedef sequence<Pair> SeqPair;
interface VectorSelection {
oneway void selected (in SeqPair ranges);
};
interface VectorDate : VectorDateNotify {
void value (out SeqDate values);
module Scalar {
typedef sequence<double> Seq;
interface Vector : VectorSelection {
oneway void changed (in short start, in Seq new_values);
void value (out Seq values);
};
};
typedef sequence<string> SeqString;
interface VectorStringNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqString new_values);
module Date {
typedef sequence<long> Seq;
interface Vector : VectorSelection {
oneway void changed (in short start, in Seq new_values);
void value (out Seq values);
};
};
interface VectorString : VectorStringNotify {
void value (out SeqString values);
module String {
typedef sequence<string> Seq;
interface Vector : VectorSelection {
oneway void changed (in short start, in Seq new_values);
void value (out Seq values);
};
};
module Graph {
interface Manager_v1 : Bonobo::Unknown {
Bonobo::Control getTypeSelectControl ();
Bonobo::Control getLayoutControl ();
interface Manager_v2 : Bonobo::Unknown {
typedef long VectorID;
typedef sequence<VectorID> VectorIDs;
Scalar::Vector addScalarVector (in Scalar::Vector v, in VectorID id);
Date::Vector addDateVector (in Date::Vector v, in VectorID id);
String::Vector addStringVector (in String::Vector v, in VectorID id);
VectorScalarNotify addVectorScalar (in VectorScalar v, in long id);
VectorDateNotify addVectorDate (in VectorDate v, in long id);
VectorStringNotify addVectorString (in VectorString v, in long id);
/**
* clearVectors :
*
* Remove all references to the existing set of vectors.
*/
oneway void clearVectors ();
oneway void freeze (in boolean flag);
oneway void clearVectors ();
/**
* arrangeVectors :
*
* Take the set of vectors and their optional
* headers in the order specified by the
* supplied @data ids, and arrange them into a
* graph using the 'current' graph type.
*/
oneway void arrangeVectors (in VectorIDs data, in VectorIDs optional_headers);
Bonobo::Control getTypeSelectControl ();
Bonobo::Control getLayoutControl ();
};
};
};
......
2001-08-23 Jody Goldberg <jgoldberg@home.com>
* ms-chart.c (ms_excel_chart) : only delete the series after
processing. condtionalize some of the debug spew.
condtionalize parsing based on the existence of a graph
condtionalize making the graph on the debug flag (for now)
(BC_R(sertocrt)) : store the chart group.
(BC_R(series_impl)) : merge back into BC_R(series).
(BC_R(vector_details)) : use the gnumeric type directly.
(excel_chart_series_new) : new.
(excel_chart_series_destroy) : new.
* ms-container.c (ms_container_workbook) : new function.
(ms_container_sheet) : ditto.
* ms-excel-read.c (ms_wb_workbook) : new function.
(ms_excel_workbook_new) : used here.
(ms_sheet_workbook) : new function.
(ms_sheet_sheet) : new function.
(ms_excel_sheet_new) : used here.
2001-08-21 Jody Goldberg <jgoldberg@home.com>
* ms-chart.c (gnm_graph_vector_type_name) : use the version in gnumeric-graph.c
(BC_R(vector_details)) : Use the correct index for the debug info.
* ms-excel-read.c (ms_excel_biff_dimensions) : Use range_name.
2001-08-21 Zbigniew Chyla <cyba@gnome.pl>
* plugin.xml: Removed
......
......@@ -21,26 +21,13 @@
#include <format.h>
#include <expr.h>
#include <gutils.h>
#include <gnumeric-graph.h>
#include <gnumeric-graph.h>
#include <gnome-xml/tree.h>
#include <stdio.h>
/* #define NO_DEBUG_EXCEL */
typedef enum {
MS_VECTOR_TYPE_DATES = 0,
MS_VECTOR_TYPE_NUMBERS = 1,
MS_VECTOR_TYPE_SEQUENCES = 2,
MS_VECTOR_TYPE_STRINGS = 3,
MS_VECTOR_TYPE_MAX = 4
} MS_VECTOR_TYPE;
static char const *const gnm_graph_vector_type_name [] =
{
"Dates (This is invalid)", "Numbers",
"Sequences (This is invalid)", "Strings",
};
typedef enum {
MS_VECTOR_PURPOSE_LABELS = 0,
MS_VECTOR_PURPOSE_VALUES = 1,
......@@ -53,12 +40,12 @@ typedef enum {
typedef struct _ExcelChartSeries
{
struct {
MS_VECTOR_TYPE type;
int count;
GnmGraphVector *gnum;
GnmGraphVectorType type;
int count;
GnmGraphVector *g_vector;
} vector [MS_VECTOR_PURPOSE_MAX];
gboolean has_bubbles;
int chart_group;
xmlNodePtr xml;
} ExcelChartSeries;
......@@ -102,6 +89,32 @@ struct biff_chart_handler
#define BC_R(n) BC(read_ ## n)
#define BC_W(n) BC(write_ ## n)
static ExcelChartSeries *
excel_chart_series_new (void)
{
ExcelChartSeries *series;
int i;
series = g_new (ExcelChartSeries, 1);
series->chart_group = -1;
for (i = MS_VECTOR_PURPOSE_MAX; i-- > 0 ; ) {
series->vector [i].g_vector = NULL;
series->vector [i].type = GNM_VECTOR_AUTO; /* may be reset later */
}
/* labels are always strings */
series->vector [MS_VECTOR_PURPOSE_LABELS].type = GNM_VECTOR_STRING;
return series;
}
static void
excel_chart_series_delete (ExcelChartSeries *series)
{
g_free (series);
}
static int
BC_R(top_state) (ExcelChartReadState *s)
{
......@@ -117,7 +130,10 @@ BC_R(color)(guint8 const *data, char *type)
guint16 const g = (rgb >> 8) & 0xff;
guint16 const b = (rgb >> 16) & 0xff;
printf("%s Color %02x%02x%02x\n", type, r, g, b);
#ifndef NO_DEBUG_EXCEL
if (ms_excel_chart_debug > 0)
printf("%s Color %02x%02x%02x\n", type, r, g, b);
#endif
return style_color_new ((r<<8)|r, (g<<8)|g, (b<<8)|b);
}
......@@ -196,29 +212,11 @@ BC_W(3d)(ExcelChartHandler const *handle,
/****************************************************************************/
static GnmGraphVectorType
map_excel_vec_type_to_gnm (MS_VECTOR_TYPE t)
{
switch (t) {
case MS_VECTOR_TYPE_DATES : return GNM_VECTOR_DATE;
case MS_VECTOR_TYPE_NUMBERS : return GNM_VECTOR_SCALAR;
case MS_VECTOR_TYPE_SEQUENCES :
g_warning ("Unsupported vector type 'sequences', converting to scalar");
return GNM_VECTOR_SCALAR;
case MS_VECTOR_TYPE_STRINGS : return GNM_VECTOR_STRING;
default :
;
};
g_warning ("Unsupported vector type '%d', converting to scalar", t);
return GNM_VECTOR_SCALAR;
}
static gboolean
BC_R(ai)(ExcelChartHandler const *handle,
ExcelChartReadState *s, BiffQuery *q)
{
guint8 const link_type = MS_OLE_GET_GUINT8 (q->data);
guint8 const purpose = MS_OLE_GET_GUINT8 (q->data);
guint8 const ref_type = MS_OLE_GET_GUINT8 (q->data + 1);
guint16 const flags = MS_OLE_GET_GUINT16 (q->data + 2);
guint16 const length = MS_OLE_GET_GUINT16 (q->data + 6);
......@@ -242,8 +240,8 @@ BC_R(ai)(ExcelChartHandler const *handle,
} else
puts ("Uses number format from data source");
g_return_val_if_fail (link_type < MS_VECTOR_PURPOSE_MAX, TRUE);
switch (link_type) {
g_return_val_if_fail (purpose < MS_VECTOR_PURPOSE_MAX, TRUE);
switch (purpose) {
case MS_VECTOR_PURPOSE_LABELS : puts ("Linking title or text"); break;
case MS_VECTOR_PURPOSE_VALUES : puts ("Linking values"); break;
case MS_VECTOR_PURPOSE_CATEGORIES : puts ("Linking categories"); break;
......@@ -265,13 +263,16 @@ BC_R(ai)(ExcelChartHandler const *handle,
ExprTree *expr = ms_container_parse_expr (s->parent,
q->data+8, length);
if (expr) {
Sheet *sheet = ms_container_sheet (s->parent);
g_return_val_if_fail (sheet != NULL, FALSE);
g_return_val_if_fail (s->currentSeries != NULL, TRUE);
#if 0
s->currentSeries->vector [link_type].gnm =
#ifdef ENABLE_BONOBO
s->currentSeries->vector [purpose].g_vector =
gnm_graph_vector_new (s->graph, expr,
s->currentSeries->vector [link_type].gnm =
);
s->currentSeries->vector [purpose].type,
sheet);
#endif
}
......@@ -279,8 +280,6 @@ BC_R(ai)(ExcelChartHandler const *handle,
g_return_val_if_fail (length == 0, TRUE);
}
g_return_val_if_fail (s->currentSeries != NULL, TRUE);
return FALSE;
}
......@@ -1268,11 +1267,11 @@ static gboolean
BC_R(objectlink)(ExcelChartHandler const *handle,
ExcelChartReadState *s, BiffQuery *q)
{
guint16 const link_type = MS_OLE_GET_GUINT16 (q->data);
guint16 const purpose = MS_OLE_GET_GUINT16 (q->data);
guint16 const series_num = MS_OLE_GET_GUINT16 (q->data+2);
guint16 const pt_num = MS_OLE_GET_GUINT16 (q->data+2);
switch (link_type)
switch (purpose)
{
case 1 : printf ("TEXT is chart title\n"); break;
case 2 : printf ("TEXT is Y axis title\n"); break;
......@@ -1507,39 +1506,47 @@ BC_W(serfmt)(ExcelChartHandler const *handle,
/****************************************************************************/
static void
BC_R(vector_details)(ExcelChartReadState *s, BiffQuery *q, ExcelChartSeries *ser,
BC_R(vector_details)(ExcelChartReadState *s, BiffQuery *q, ExcelChartSeries *series,
MS_VECTOR_PURPOSE purpose,
int type_offset, int count_offset, char const *name)
{
guint16 type = MS_OLE_GET_GUINT16 (q->data + type_offset);
typedef enum {
MS_VECTOR_TYPE_DATES = 0,
MS_VECTOR_TYPE_NUMBERS = 1,
MS_VECTOR_TYPE_SEQUENCES = 2,
MS_VECTOR_TYPE_STRINGS = 3,
MS_VECTOR_TYPE_MAX = 4
} MS_VECTOR_TYPE;
g_return_if_fail (type < MS_VECTOR_TYPE_MAX);
GnmGraphVectorType type;
guint16 e_type = MS_OLE_GET_GUINT16 (q->data + type_offset);
ser->vector [purpose].type = map_excel_vec_type_to_gnm (type);
ser->vector [purpose].count = MS_OLE_GET_GUINT16 (q->data+count_offset);
printf ("%d %s are %s\n",
ser->vector [purpose].count, name,
gnm_graph_vector_type_name [ser->vector [purpose].count]);
}
g_return_if_fail (e_type < MS_VECTOR_TYPE_MAX);
static gboolean
BC_R(series_impl)(ExcelChartReadState *s, BiffQuery *q, ExcelChartSeries *ser)
{
/*
* WARNING : The offsets in the documentation are WRONG.
* Use the sizes instead.
*/
BC_R(vector_details) (s, q, ser, MS_VECTOR_PURPOSE_CATEGORIES,
0, 4, "Categories");
BC_R(vector_details) (s, q, ser, MS_VECTOR_PURPOSE_VALUES,
2, 6, "Values");
if ((ser->has_bubbles = (s->container.ver >= MS_BIFF_V8)))
BC_R(vector_details) (s, q, ser, MS_VECTOR_PURPOSE_VALUES,
8, 10, "Bubbles");
switch (e_type) {
case MS_VECTOR_TYPE_DATES : type = GNM_VECTOR_DATE; break;
case MS_VECTOR_TYPE_NUMBERS : type = GNM_VECTOR_SCALAR; break;
case MS_VECTOR_TYPE_SEQUENCES :
g_warning ("Unsupported vector type 'sequences', converting to scalar");
type = GNM_VECTOR_SCALAR; break;
return FALSE;
case MS_VECTOR_TYPE_STRINGS : type = GNM_VECTOR_STRING; break;
default :
g_warning ("Unsupported vector type '%d', converting to scalar", e_type);
type = GNM_VECTOR_SCALAR;
};
series->vector [purpose].type = type;
series->vector [purpose].count = MS_OLE_GET_GUINT16 (q->data+count_offset);
#ifdef ENABLE_BONOBO
printf ("%d %s are %s\n",
series->vector [purpose].count, name,
gnm_graph_vector_type_name [series->vector [purpose].type]);
#endif
}
/*
* Wrapper function to avoid leaking memory on failure
*/
......@@ -1547,20 +1554,27 @@ static gboolean
BC_R(series)(ExcelChartHandler const *handle,
ExcelChartReadState *s, BiffQuery *q)
{
ExcelChartSeries *ser;
ExcelChartSeries *series;
g_return_val_if_fail (s->chart != NULL, TRUE);
g_return_val_if_fail (s->currentSeries == NULL, TRUE);
ser = g_new (ExcelChartSeries, 1);
if (BC_R(series_impl)(s, q, ser)) {
g_free (ser);
return TRUE;
}
series = excel_chart_series_new ();
/*
* WARNING : The offsets in the documentation are WRONG.
* Use the sizes instead.
*/
BC_R(vector_details) (s, q, series, MS_VECTOR_PURPOSE_CATEGORIES,
0, 4, "Categories");
BC_R(vector_details) (s, q, series, MS_VECTOR_PURPOSE_VALUES,
2, 6, "Values");
if (s->container.ver >= MS_BIFF_V8)
BC_R(vector_details) (s, q, series, MS_VECTOR_PURPOSE_VALUES,
8, 10, "Bubbles");
g_ptr_array_add (s->series, ser);
g_ptr_array_add (s->series, series);
printf ("SERIES = %d\n", s->series->len-1);
s->currentSeries = ser;
s->currentSeries = series;
return FALSE;
}
......@@ -1632,7 +1646,14 @@ BC_R(sertocrt)(ExcelChartHandler const *handle,
ExcelChartReadState *s, BiffQuery *q)
{
guint16 const index = MS_OLE_GET_GUINT16 (q->data);
g_return_val_if_fail (s->currentSeries != NULL, FALSE);