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

Dump in a pile of pending stuff.

Temporarily lose ability to show/hide toolbars until that is part of GODocControl

2004-05-07  Jody Goldberg <jody@gnome.org>

	* graph/gog-theme.c (gog_themes_init) : sync the default theme with
	  XL's notion of things so that we do not theme away auto settings on
	  import.  Specificly Give chart's the background and make graph
	  empty.

	*  */Makefile.am : use goffice.mk for include paths

2004-05-03  Jody Goldberg <jody@gnome.org>

	http://bugzilla.gnome.org/show_bug.cgi?id=136363
	* graph/gog-style.c (gog_style_apply_theme) : Do not theme the fonts
	  it over rides the user selection because there is no 'auto' flag.

2004-05-07  Jody Goldberg <jody@gnome.org>

	* ms-biff.c (ms_biff_put_var_write) : Quick and simple support for
	  continue.  It will not split a block of content, but it will split
	  between blocks (attempted writes).

2004-05-06  Jody Goldberg <jody@gnome.org>

	* ms-obj.c (ms_obj_attr_get_*) : Take an attrbag rather than an obj to
	 be more useful.

	* ms-escher.c (ms_escher_read_container) : add a
	  'return_attrs_in_container' kludge parameter.
	(ms_escher_parse) : make the return of the attributes optional and
	  actually make it work.
	(ms_escher_read_OPT) : load properties for gradients.

	* ms-chart.c (BC_R(gelframe)) : support gradients
	(BC_R(legend)) : store the legend object.
	(BC_R(legendxn)) : notice deleted legend elements.
	(BC_R(text)) : import the text colour.
	(BC_R(end)) : support legend styles and clarify the grid vs plotarea
	  distinction.

2004-05-03  Jody Goldberg <jody@gnome.org>

	* excel-xml-read.c : some tweaks to get a layout that will support
	  richtext.


2004-05-07  Jody Goldberg <jody@gnome.org>

	* src/command-context-priv.h : Make this an interface
	* src/command-context.c : support the change here.
	* src/command-context-stderr.c : here.
	* src/io-context-gtk.c : here
	* src/io-context-priv.h : here
	* src/io-context.c : here.
	* src/workbook-control-gui.c : here
	* src/workbook-control.c : and here

	* src/GNOME_Gnumeric-gtk.xml : Move the toolbars out, they will be
	  generated.  Add FullScreen.

	* configure.in : bump libgsf dep and add the new goffice/app directory

2004-05-03  Jody Goldberg <jody@gnome.org>

	http://bugzilla.gnome.org/show_bug.cgi?id=140671
	* src/commands.c (cmd_paste_cut_undo) : we don't know the SheetView
	  associated with the origin sheet.

	* src/selection.c (sv_selection_set) : add some safety
parent 25acadf4
......@@ -10,13 +10,12 @@ Release Critical
http://bugzilla.gnome.org/show_bug.cgi?id=136546
: about box i18n
http://bugzilla.gnome.org/show_bug.cgi?id=136363
: label font size
http://bugzilla.gnome.org/show_bug.cgi?id=140820
: undo of tab colour change
http://bugzilla.gnome.org/show_bug.cgi?id=127203 [x axis child pos]
: X axis label seperation
: Delete grid then edit and see a new grid
: xls loading of things with deleted axis
Worries
http://bugzilla.gnome.org/show_bug.cgi?id=123403
......@@ -233,15 +232,29 @@ Short Term Goals
1.7.5.3) Marker (DONE)
1.7.5.4) Grid (DONE)
1.7.5.5) Chart (DONE)
1.7.5.6) Legend (DONE)
1.7.6) Avoid leaking GODatas when faced with an unknown (DONE)
plot type.
1.7.7) double axis import on simple_bar2
1.7.8) Axis bounds and ticks size (DONE)
1.7.9) log scale (DONE)
1.7.10) Titles (DONE)
1.7.11) check marker none
1.7.12) Axis value format (DONE)
1.7.13) check plot default styles
1.7.8) Titles (DONE)
1.7.9) check marker none
1.7.10) Axis
1.7.10.1) value format (DONE)
1.7.10.2) Axis bounds and ticks size (DONE)
1.7.10.3) log scale (DONE)
1.7.10.4) deleted axis should not appear
1.7.11) Gradients
1.7.11.1) Horizontal x4 (DONE)
1.7.11.2) Vertical x4 (DONE)
1.7.11.3) Diag Up x4 (DONE)
1.7.11.4) Diag Down x4 (DONE)
1.7.11.5) From center
1.7.11.6) From corner
1.7.11.7) Two colour (DONE)
1.7.11.8) Two colour alpha (is this possible)
1.7.11.9) One colour (DONE)
1.7.11.10) One colour alpha (is this possible)
1.7.11.11) presets
1.8) data sources (DONE)
1.8.1) vector and scalar data sources from gnumeric (DONE)
1.8.2) Add min/max elements to vector (DONE)
......
2004-05-07 Jody Goldberg <jody@gnome.org>
* src/command-context-priv.h : Make this an interface
* src/command-context.c : support the change here.
* src/command-context-stderr.c : here.
* src/io-context-gtk.c : here
* src/io-context-priv.h : here
* src/io-context.c : here.
* src/workbook-control-gui.c : here
* src/workbook-control.c : and here
* src/GNOME_Gnumeric-gtk.xml : Move the toolbars out, they will be
generated. Add FullScreen.
* configure.in : bump libgsf dep and add the new goffice/app directory
2004-05-03 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=140671
* src/commands.c (cmd_paste_cut_undo) : we don't know the SheetView
associated with the origin sheet.
* src/selection.c (sv_selection_set) : add some safety
2004-05-04 Morten Welinder <terra@gnome.org>
* src/validation.c (validation_new): Make sure
......
......@@ -15,6 +15,13 @@ Jody:
* Pango uses _byte_ offsets for attributes. Fix everything
* Fix xls import of chart background and outline
* Support richtext during autofill
* A huge performance improvement when scrolling images
http://bugzilla.gnome.org/show_bug.cgi?id=136363
* Fix font handling in chart labels and titles
http://bugzilla.gnome.org/show_bug.cgi?id=140671
* Fix crash when undoing a cut from a different workbook
* Fix MS XL crash when there are too many strings
* MS XL import for chart gradient backgrounds
Morten:
* Fix crash related to database functions (#138600). [backported]
......
2004-05-07 Jody Goldberg <jody@gnome.org>
* src/command-context-priv.h : Make this an interface
* src/command-context.c : support the change here.
* src/command-context-stderr.c : here.
* src/io-context-gtk.c : here
* src/io-context-priv.h : here
* src/io-context.c : here.
* src/workbook-control-gui.c : here
* src/workbook-control.c : and here
* src/GNOME_Gnumeric-gtk.xml : Move the toolbars out, they will be
generated. Add FullScreen.
* configure.in : bump libgsf dep and add the new goffice/app directory
2004-05-03 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=140671
* src/commands.c (cmd_paste_cut_undo) : we don't know the SheetView
associated with the origin sheet.
* src/selection.c (sv_selection_set) : add some safety
2004-05-04 Morten Welinder <terra@gnome.org>
* src/validation.c (validation_new): Make sure
......
......@@ -47,7 +47,7 @@ gnumeric_reqs="
glib-2.0 >= 2.4.0
gobject-2.0 >= 2.4.0
gmodule-2.0 >= 2.4.0
libgsf-1 >= 1.8.2
libgsf-1 >= 1.9.0
gtk+-2.0 >= 2.4.0
libxml-2.0 >= 2.4.12
libglade-2.0 >= 2.0.0
......@@ -67,7 +67,7 @@ libbonobo-2.0 >= 2.2.0
libbonoboui-2.0 >= 2.2.0
libgnome-2.0 >= 2.0.0
libgnomeui-2.0 >= 2.0.0
libgsf-gnome-1 >= 1.8.2"
libgsf-gnome-1 >= 1.9.0"
AC_ARG_WITH(gnome,
[--{with,without}-gnome Use GNOME extensions],
......@@ -765,6 +765,7 @@ src/cut-n-paste-code/foocanvas/Makefile
src/cut-n-paste-code/foocanvas/libfoocanvas/Makefile
src/cut-n-paste-code/pcre/Makefile
src/cut-n-paste-code/goffice/Makefile
src/cut-n-paste-code/goffice/app/Makefile
src/cut-n-paste-code/goffice/pixmaps/Makefile
src/cut-n-paste-code/goffice/utils/Makefile
src/cut-n-paste-code/goffice/gui-utils/Makefile
......
......@@ -31,6 +31,7 @@
#include <sheet-control-priv.h>
#include <ranges.h>
#include <sheet.h>
#include <command-context-priv.h>
#include <gsf/gsf-impl-utils.h>
#include <bonobo.h>
......
2004-05-07 Jody Goldberg <jody@gnome.org>
* ms-biff.c (ms_biff_put_var_write) : Quick and simple support for
continue. It will not split a block of content, but it will split
between blocks (attempted writes).
2004-05-06 Jody Goldberg <jody@gnome.org>
* ms-obj.c (ms_obj_attr_get_*) : Take an attrbag rather than an obj to
be more useful.
* ms-escher.c (ms_escher_read_container) : add a
'return_attrs_in_container' kludge parameter.
(ms_escher_parse) : make the return of the attributes optional and
actually make it work.
(ms_escher_read_OPT) : load properties for gradients.
* ms-chart.c (BC_R(gelframe)) : support gradients
(BC_R(legend)) : store the legend object.
(BC_R(legendxn)) : notice deleted legend elements.
(BC_R(text)) : import the text colour.
(BC_R(end)) : support legend styles and clarify the grid vs plotarea
distinction.
2004-05-03 Jody Goldberg <jody@gnome.org>
* excel-xml-read.c : some tweaks to get a layout that will support
richtext.
2004-05-04 Morten Welinder <terra@gnome.org>
* ms-excel-write.c (excel_write_DV): Map VALIDATION_OP_NONE to
......
......@@ -128,6 +128,7 @@ GSF_XML_IN_NODE_FULL (START, WORKBOOK, XL_NS_SS, "Workbook", FALSE, FALSE, TRUE,
GSF_XML_IN_NODE (DOC_PROP, PROP_COMPANY, XL_NS_O, "Company", TRUE, NULL, NULL),
GSF_XML_IN_NODE (DOC_PROP, PROP_VERSION, XL_NS_O, "Version", TRUE, NULL, NULL),
GSF_XML_IN_NODE (WORKBOOK, DOC_SETTINGS, XL_NS_O, "OfficeDocumentSettings", FALSE, NULL, NULL),
GSF_XML_IN_NODE (DOC_SETTINGS, DOC_COLORS, XL_NS_O, "Colors", FALSE, NULL, NULL),
GSF_XML_IN_NODE (DOC_SETTINGS, DOC_COMPONENTS, XL_NS_O, "DownloadComponents", FALSE, NULL, NULL),
GSF_XML_IN_NODE (DOC_SETTINGS, DOC_COMPONENTS_LOCATION, XL_NS_O, "LocationOfComponents", FALSE, NULL, NULL),
GSF_XML_IN_NODE (WORKBOOK, WB_VIEW, XL_NS_XL, "ExcelWorkbook", FALSE, NULL, NULL),
......@@ -137,6 +138,7 @@ GSF_XML_IN_NODE_FULL (START, WORKBOOK, XL_NS_SS, "Workbook", FALSE, FALSE, TRUE,
GSF_XML_IN_NODE (WB_VIEW, VIEW_TOP_Y, XL_NS_XL, "WindowTopY", TRUE, NULL, NULL),
GSF_XML_IN_NODE (WB_VIEW, PROTECT_STRUCTURE, XL_NS_XL, "ProtectStructure", TRUE, NULL, NULL),
GSF_XML_IN_NODE (WB_VIEW, PROTECT_WINDOWS, XL_NS_XL, "ProtectWindows", TRUE, NULL, NULL),
GSF_XML_IN_NODE (WB_VIEW, NATURAL_LANGUAGE, XL_NS_XL, "AcceptLabelsInFormulas", TRUE, NULL, NULL),
GSF_XML_IN_NODE (WORKBOOK, STYLES, XL_NS_SS, "Styles", FALSE, NULL, NULL),
GSF_XML_IN_NODE (STYLES, STYLE, XL_NS_SS, "Style", FALSE, NULL, NULL),
GSF_XML_IN_NODE (STYLE, ALIGNMENT, XL_NS_SS, "Alignment", FALSE, NULL, NULL),
......@@ -153,9 +155,18 @@ GSF_XML_IN_NODE_FULL (START, WORKBOOK, XL_NS_SS, "Workbook", FALSE, FALSE, TRUE,
GSF_XML_IN_NODE (WORKSHEET, TABLE, XL_NS_SS, "Table", FALSE, NULL, NULL),
GSF_XML_IN_NODE (TABLE, COLUMN, XL_NS_SS, "Column", FALSE, NULL, NULL),
GSF_XML_IN_NODE (TABLE, ROW, XL_NS_SS, "Row", FALSE, NULL, NULL),
GSF_XML_IN_NODE (ROW, CELL, XL_NS_SS, "Cell", FALSE, NULL, NULL),
GSF_XML_IN_NODE (CELL, DATA, XL_NS_SS, "Data", TRUE, NULL, NULL),
GSF_XML_IN_NODE_FULL (ROW, CELL, XL_NS_SS, "Cell", FALSE, FALSE, TRUE, NULL, NULL, 0),
GSF_XML_IN_NODE (CELL, NAMED_CELL, XL_NS_SS, "NamedCell", FALSE, NULL, NULL),
GSF_XML_IN_NODE_FULL (CELL, CELL_DATA, XL_NS_SS, "Data", TRUE, FALSE, TRUE, NULL, NULL, 0),
GSF_XML_IN_NODE (CELL_DATA, HTML_B, XL_NS_HTML, "B", GSF_XML_SHARED_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (CELL_DATA, HTML_I, XL_NS_HTML, "I", GSF_XML_SHARED_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (CELL_DATA, HTML_FONT,XL_NS_HTML, "Font", GSF_XML_SHARED_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (HTML_B, HTML_I, XL_NS_HTML, "I", FALSE, NULL, NULL), /* 2nd def */
GSF_XML_IN_NODE (HTML_B, HTML_FONT, XL_NS_HTML, "Font", FALSE, NULL, NULL), /* 2nd def */
GSF_XML_IN_NODE (HTML_I, HTML_B, XL_NS_HTML, "B", FALSE, NULL, NULL), /* 2nd def */
GSF_XML_IN_NODE (HTML_I, HTML_FONT, XL_NS_HTML, "Font", FALSE, NULL, NULL), /* 2nd def */
GSF_XML_IN_NODE (HTML_FONT, HTML_I, XL_NS_HTML, "I", FALSE, NULL, NULL), /* 2nd def */
GSF_XML_IN_NODE (HTML_FONT, HTML_B, XL_NS_HTML, "B", FALSE, NULL, NULL), /* 2nd def */
GSF_XML_IN_NODE (WORKSHEET, OPTIONS, XL_NS_XL, "WorksheetOptions", FALSE, NULL, NULL),
GSF_XML_IN_NODE (OPTIONS, SELECTED, XL_NS_XL, "Selected", FALSE, NULL, NULL),
GSF_XML_IN_NODE (OPTIONS, PANES, XL_NS_XL, "Panes", FALSE, NULL, NULL),
......@@ -165,6 +176,7 @@ GSF_XML_IN_NODE_FULL (START, WORKBOOK, XL_NS_SS, "Workbook", FALSE, FALSE, TRUE,
GSF_XML_IN_NODE (PANE, PANE_ACTIVECOL, XL_NS_XL, "ActiveCol", TRUE, NULL, NULL),
GSF_XML_IN_NODE (OPTIONS, PROT_OBJS, XL_NS_XL, "ProtectObjects", TRUE, NULL, NULL),
GSF_XML_IN_NODE (OPTIONS, PROT_SCENARIOS, XL_NS_XL, "ProtectScenarios", TRUE, NULL, NULL),
GSF_XML_IN_NODE (OPTIONS, PAGEBREAK_ZOOM, XL_NS_XL, "PageBreakZoom", FALSE, NULL, NULL),
{ NULL }
};
static GsfXMLInDoc *doc;
......
......@@ -614,6 +614,12 @@ ms_biff_put_var_next (BiffPut *bp, guint16 opcode)
gsf_output_write (bp->output, 4, data);
}
inline unsigned
ms_biff_max_record_len (BiffPut const *bp)
{
return (bp->version >= MS_BIFF_V8) ? MAX_BIFF8_RECORD_SIZE : MAX_BIFF7_RECORD_SIZE;
}
void
ms_biff_put_var_write (BiffPut *bp, guint8 const *data, guint32 len)
{
......@@ -627,6 +633,14 @@ ms_biff_put_var_write (BiffPut *bp, guint8 const *data, guint32 len)
/* Temporary */
g_return_if_fail (bp->length + len < 0xf000);
if ((bp->curpos + len) > ms_biff_max_record_len (bp)) {
g_return_if_fail (bp->curpos == bp->length);
ms_biff_put_commit (bp);
ms_biff_put_var_next (bp, BIFF_CONTINUE);
}
gsf_output_write (bp->output, len, data);
bp->curpos += len;
if (bp->curpos > bp->length)
......@@ -707,8 +721,3 @@ ms_biff_put_commit (BiffPut *bp)
ms_biff_put_var_commit (bp);
}
unsigned
ms_biff_max_record_len (BiffPut const *bp)
{
return (bp->version >= MS_BIFF_V8) ? MAX_BIFF8_RECORD_SIZE : MAX_BIFF7_RECORD_SIZE;
}
......@@ -23,6 +23,7 @@
#include <value.h>
#include <gutils.h>
#include <graph.h>
#include <style-color.h>
#include <sheet-object-graph.h>
#include <goffice/graph/goffice-graph.h>
......@@ -71,6 +72,7 @@ typedef struct {
SheetObject *sog;
GogGraph *graph;
GogChart *chart;
GogObject *legend;
GogPlot *plot;
GogStyle *default_plot_style;
GogObject *axis;
......@@ -841,17 +843,126 @@ BC_R(frame)(XLChartHandler const *handle,
/****************************************************************************/
static GOColor
ms_chart_map_color (XLChartReadState const *s, guint32 raw, guint32 alpha)
{
GOColor res;
if ((~0x7ffffff) & raw) {
GnmColor *c= excel_palette_get (s->container.ewb->palette,
(0x7ffffff & raw));
res = GDK_TO_UINT (c->color);
style_color_unref (c);
} else {
guint8 r, g, b;
r = (raw) & 0xff;
g = (raw >> 8) & 0xff;
b = (raw >> 16) & 0xff;
res = RGBA_TO_UINT (r, g, b, 0xff);
}
return res;
}
static gboolean
BC_R(gelframe) (XLChartHandler const *handle,
XLChartReadState *s, BiffQuery *q)
{
MSObjAttrBag *attrs = ms_escher_parse (q, &s->container);
MSObjAttrBag *attrs = ms_escher_parse (q, &s->container, TRUE);
guint32 type = ms_obj_attr_get_uint (attrs,
MS_OBJ_ATTR_FILL_TYPE, 0);
guint32 shade_type = ms_obj_attr_get_uint (attrs,
MS_OBJ_ATTR_FILL_SHADE_TYPE, 0);
guint32 fill_color = ms_obj_attr_get_uint (attrs,
MS_OBJ_ATTR_FILL_COLOR, 0);
guint32 fill_alpha = ms_obj_attr_get_uint (attrs,
MS_OBJ_ATTR_FILL_ALPHA, 0x10000);
guint32 fill_back_color = ms_obj_attr_get_uint (attrs,
MS_OBJ_ATTR_FILL_BACKGROUND, 0);
guint32 fill_back_alpha = ms_obj_attr_get_uint (attrs,
MS_OBJ_ATTR_FILL_BACKGROUND_ALPHA, 0x10000);
guint32 preset = ms_obj_attr_get_uint (attrs,
MS_OBJ_ATTR_FILL_PRESET, 0);
s->style->fill.type = GOG_FILL_STYLE_GRADIENT;
s->style->fill.u.gradient.start =
ms_chart_map_color (s, fill_color, fill_alpha);
/* FIXME : make presets the same as 2 color for now */
if (!(shade_type & 8) || preset > 0) {
s->style->fill.u.gradient.end = ms_chart_map_color (s,
fill_back_color, fill_back_alpha);
} else {
float brightness;
unsigned frac = (fill_back_color >> 16) & 0xff;
/**
* 0x10 const
* 0x00..0xff fraction
* 0x02 == bright 0x01 == dark
* 0xf0 == const
**/
switch ((fill_back_color & 0xff00)) {
default :
g_warning ("looks like our theory of 1-color gradient brightness is incorrect");
case 0x0100 : brightness = 0. + frac/512.; break;
case 0x0200 : brightness = 1. - frac/512.; break;
}
gog_style_set_fill_brightness (s->style, (1. - brightness) * 100.);
d (1, fprintf (stderr, "%x : frac = %u, flag = 0x%hx ::: %f",
fill_back_color, frac, fill_back_color & 0xff00, brightness););
}
if (type == 5) { /* Fill from corner */
/* TODO */
} else if (type == 6) { /* fill from center */
/* TODO */
} else if (type == 7) {
GOGradientDirection dir;
guint32 angle = ms_obj_attr_get_uint (attrs, MS_OBJ_ATTR_FILL_ANGLE, 0);
gint32 focus = ms_obj_attr_get_int (attrs, MS_OBJ_ATTR_FILL_FOCUS, 0);
if (focus < 0)
focus = ((focus - 25) / 50) % 4 + 4;
else
focus = ((focus + 25) / 50) % 4;
switch (angle) {
default :
g_warning ("non standard gradient angle %u, using horizontal", angle);
case 0 : /* horizontal */
switch (focus) {
case 0 : dir = GO_GRADIENT_S_TO_N; break;
case 1 : dir = GO_GRADIENT_N_TO_S_MIRRORED; break;
case 2 : dir = GO_GRADIENT_N_TO_S; break;
case 3 : dir = GO_GRADIENT_S_TO_N_MIRRORED; break;
}
break;
case 0xffd30000 : /* diag down (-45 in 16.16 fixed) */
switch (focus) {
case 0 : dir = GO_GRADIENT_SE_TO_NW; break;
case 1 : dir = GO_GRADIENT_SE_TO_NW_MIRRORED; break;
case 2 : dir = GO_GRADIENT_NW_TO_SE; break;
case 3 : dir = GO_GRADIENT_NW_TO_SE_MIRRORED; break;
}
break;
case 0xffa60000 : /* vertical (-90 in 16.16 fixed) */
switch (focus) {
case 0 : dir = GO_GRADIENT_E_TO_W; break;
case 1 : dir = GO_GRADIENT_E_TO_W_MIRRORED; break;
case 2 : dir = GO_GRADIENT_W_TO_E; break;
case 3 : dir = GO_GRADIENT_W_TO_E_MIRRORED; break;
}
break;
case 0xff790000 : /* diag up (-135 in 16.16 fixed) */
switch (focus) {
case 0 : dir = GO_GRADIENT_SE_TO_NW; break;
case 1 : dir = GO_GRADIENT_SE_TO_NW_MIRRORED; break;
case 2 : dir = GO_GRADIENT_NW_TO_SE; break;
case 3 : dir = GO_GRADIENT_NW_TO_SE_MIRRORED; break;
}
}
s->style->fill.u.gradient.dir = dir;
}
#if 0
MSObjAttr *crop_bottom_attr = ms_obj_attr_bag_lookup
(obj->attrs, MS_OBJ_ATTR_BLIP_CROP_BOTTOM);
MS_OBJ_ATTR_FILL_TYPE;
#endif
ms_obj_attr_bag_destroy (attrs);
return FALSE;
......@@ -898,7 +1009,6 @@ BC_R(legend)(XLChartHandler const *handle,
#endif
guint16 const XL_pos = GSF_LE_GET_GUINT8 (q->data+16);
GogObjectPosition pos;
GogObject *legend;
switch (XL_pos) {
case 0: pos = GOG_POSITION_S | GOG_POSITION_ALIGN_CENTER; break;
......@@ -913,8 +1023,8 @@ BC_R(legend)(XLChartHandler const *handle,
pos = GOG_POSITION_E | GOG_POSITION_ALIGN_CENTER; break;
};
legend = gog_object_add_by_name (GOG_OBJECT (s->chart), "Legend", NULL);
gog_object_set_pos (legend, pos);
s->legend = gog_object_add_by_name (GOG_OBJECT (s->chart), "Legend", NULL);
gog_object_set_pos (s->legend, pos);
#if 0
fprintf (stderr, "Legend @ %f,%f, X=%f, Y=%f\n",
......@@ -932,6 +1042,9 @@ static gboolean
BC_R(legendxn)(XLChartHandler const *handle,
XLChartReadState *s, BiffQuery *q)
{
guint16 const flags = GSF_LE_GET_GUINT16 (q->data+2);
if (flags & 1)
g_warning ("deleted legend entry");
return FALSE;
}
......@@ -1525,6 +1638,8 @@ BC_R(text)(XLChartHandler const *handle,
d (4, fputs ("Text follows defaulttext", stderr););
} else {
}
BC_R(get_style) (s);
s->style->font.color = BC_R(color) (q->data+0, "Font");
#if 0
case BIFF_CHART_chart :
......@@ -1721,23 +1836,22 @@ BC_R(end)(XLChartHandler const *handle,
case BIFF_CHART_frame :
if (s->style != NULL) {
GogObject *obj;
if (s->chart != NULL) {
if (s->frame_for_grid) {
GogGrid *tmp = gog_chart_get_grid (s->chart);
obj = (tmp == NULL)
? gog_object_add_by_name (GOG_OBJECT (s->chart), "Grid", NULL)
: GOG_OBJECT (tmp);
} else {
obj = GOG_OBJECT (s->chart);
s->style->outline = s->style->line;
s->style->line.width = -1.;
}
if (obj != NULL)
g_object_set (G_OBJECT (obj),
"style", s->style,
NULL);
int top_state = BC_R(top_state) (s);
GogObject *obj = NULL;
if (top_state == BIFF_CHART_legend)
obj = s->legend;
else if (top_state == BIFF_CHART_chart)
obj = GOG_OBJECT (s->chart);
else if (s->frame_for_grid) {
GogGrid *tmp = gog_chart_get_grid (s->chart);
obj = (tmp == NULL)
? gog_object_add_by_name (GOG_OBJECT (s->chart), "Grid", NULL)
: GOG_OBJECT (tmp);
}
if (obj != NULL)
g_object_set (G_OBJECT (obj),
"style", s->style,
NULL);
g_object_unref (s->style);
s->style = NULL;
}
......@@ -2097,7 +2211,7 @@ ms_excel_read_chart (BiffQuery *q, MSContainer *container, MsBiffVersion ver,
}
case BIFF_MS_O_DRAWING:
ms_obj_attr_bag_destroy (ms_escher_parse (q, &state.container));
ms_escher_parse (q, &state.container, FALSE);
break;
case BIFF_EXTERNCOUNT: /* ignore */ break;
......
......@@ -237,7 +237,7 @@ ms_escher_get_data (MSEscherState *state,
static gboolean
ms_escher_read_container (MSEscherState *state, MSEscherHeader *container,
gint offset);
gint prefix, gboolean return_attrs_in_container);
/****************************************************************************/
......@@ -293,7 +293,7 @@ ms_escher_read_SplitMenuColors (MSEscherState *state, MSEscherHeader *h)
static gboolean
ms_escher_read_BStoreContainer (MSEscherState *state, MSEscherHeader *h)
{
return ms_escher_read_container (state, h, 0);
return ms_escher_read_container (state, h, 0, FALSE);
}
static gchar const *
......@@ -357,7 +357,7 @@ ms_escher_read_BSE (MSEscherState *state, MSEscherHeader *h)
/* Ignore empties */
if (h->len > 36 + COMMON_HEADER_LEN)
return ms_escher_read_container (state, h, 36);
return ms_escher_read_container (state, h, 36, FALSE);
/* Store a blank */
ms_container_add_blip (state->container, NULL);
......@@ -483,7 +483,7 @@ ms_escher_read_ColorScheme (MSEscherState *state, MSEscherHeader *h)
static gboolean
ms_escher_read_SpContainer (MSEscherState *state, MSEscherHeader *h)
{
return ms_escher_read_container (state, h, 0);
return ms_escher_read_container (state, h, 0, FALSE);
}
static gboolean
......@@ -1392,9 +1392,13 @@ ms_escher_read_OPT (MSEscherState *state, MSEscherHeader *h)
/* 0 : */
case 394 : name = "long fillHeight"; break;
/* 0 : Fade angle - degrees in 16.16 */
case 395 : name = "long fillAngle"; break;
case 395 : id = MS_OBJ_ATTR_FILL_ANGLE;
name = "long fillAngle";
break;
/* 0 : Linear shaded fill focus percent */
case 396 : name = "long fillFocus"; break;
case 396 : id = MS_OBJ_ATTR_FILL_FOCUS;
name = "long fillFocus";
break;
/* 0 : Fraction 16.16 */
case 397 : name = "long fillToLeft"; break;
/* 0 : Fraction 16.16 */
......@@ -1416,7 +1420,9 @@ ms_escher_read_OPT (MSEscherState *state, MSEscherHeader *h)
/* measure_Default : */
case 405 : name = "LengthMeasure fillDztype"; break;
/* 0 : Special shades */
case 406 : name = "long fillShadePreset"; break;
case 406 : id = MS_OBJ_ATTR_FILL_PRESET;
name = "long fillShadePreset";
break;
/* NULL : a preset array of colors */
case 407 : name = "IMsoArray fillShadeColors"; break;
/* 0 : */
......@@ -1428,9 +1434,9 @@ ms_escher_read_OPT (MSEscherState *state, MSEscherHeader *h)
/* 0 : */
case 411 : name = "long fillShapeOriginY"; break;
/* shade_Default : Type of shading, if a shaded (gradient) fill. */
case 412 : name = "ShadeType fillShadeType"; break;
case 412 : id = MS_OBJ_ATTR_FILL_SHADE_TYPE;
name = "ShadeType fillShadeType";
break;
/* TRUE : Is shape filled? */
case 443 : name = "bool fFilled"; break;
/* TRUE : Should we hit test fill? */
......@@ -1820,17 +1826,17 @@ ms_escher_read_OPT (MSEscherState *state, MSEscherHeader *h)
static gboolean
ms_escher_read_SpgrContainer (MSEscherState *state, MSEscherHeader *h)
{
return ms_escher_read_container (state, h, 0);
return ms_escher_read_container (state, h, 0, FALSE);
}
static gboolean
ms_escher_read_DgContainer (MSEscherState *state, MSEscherHeader *h)
{
return ms_escher_read_container (state, h, 0);
return ms_escher_read_container (state, h, 0, FALSE);
}
static gboolean
ms_escher_read_DggContainer (MSEscherState *state, MSEscherHeader *h)
{
return ms_escher_read_container (state, h, 0);
return ms_escher_read_container (state, h, 0, FALSE);
}
static gboolean
ms_escher_read_ClientTextbox (MSEscherState *state, MSEscherHeader *h)
......@@ -1889,10 +1895,12 @@ ms_escher_read_ClientData (MSEscherState *state, MSEscherHeader *h)
static gboolean
ms_escher_read_container (MSEscherState *state, MSEscherHeader *container,
gint const prefix)
gint prefix, gboolean return_attrs_in_container)
{
MSEscherHeader h;
g_return_val_if_fail (container != NULL, TRUE);
ms_escher_header_init (&h);
h.container = container;
......@@ -1996,25 +2004,30 @@ ms_escher_read_container (MSEscherState *state, MSEscherHeader *container,
h.offset += h.len;
} while (h.offset < (container->offset + container->len));
if (container->attrs == NULL && return_attrs_in_container) {
container->attrs = h.attrs;
h.release_attrs = FALSE;
}
ms_escher_header_release (&h);
return FALSE;
}
/*
* ms_escher_parse:
* @q: Biff context.
* @wb: required workbook argument
* @sheet: optional sheet argument
* @q:
* @container: required workbook argument
* @return_attrs: Should we steal our childrens attributes and return them
*
* Parse an escher stream stores in a sequence of biff records
*
* This function parses an escher stream, and stores relevant data in the
* workbook.
* Returns NULL or an MSObjAttrBag (callers frees) depending on @return_attrs
*/
MSObjAttrBag *
ms_escher_parse (BiffQuery *q, MSContainer *container)
ms_escher_parse (BiffQuery *q, MSContainer *container, gboolean return_attrs)
{
MSEscherState state;
MSEscherHeader fake_header;
MSObjAttrBag *attrs;
MSObjAttrBag *res = NULL;
char const *drawing_record_name = "Unknown";
g_return_val_if_fail (q != NULL, NULL);
......@@ -2043,14 +2056,16 @@ ms_escher_parse (BiffQuery *q, MSContainer *container)
fake_header.offset = 0;
d (0, printf ("{ /* Escher '%s'*/\n", drawing_record_name););
ms_escher_read_container (&state, &fake_header, -COMMON_HEADER_LEN);
ms_escher_read_container (&state,
&fake_header, -COMMON_HEADER_LEN, return_attrs);
d (0, printf ("}; /* Escher '%s'*/\n", drawing_record_name););
attrs = fake_header.attrs;
fake_header.release_attrs = FALSE;
if (return_attrs) {
res = fake_header.attrs;
fake_header.release_attrs = FALSE;
}
ms_escher_header_release (&fake_header);
return attrs;
return res;
}
/****************************************************************************/
......
......@@ -25,14 +25,16 @@ struct _MSEscherShape {
MSObjAttrBag *attrs;
};
MSObjAttrBag *ms_escher_parse (BiffQuery *q, MSContainer *container);
void ms_escher_blip_free (MSEscherBlip *blip);
MSObjAttrBag *ms_escher_parse (BiffQuery *q, MSContainer *container,
gboolean return_attrs);
void ms_escher_blip_free (MSEscherBlip *blip);
#if 0
typedef struct _MSEscherWriter MSEscherWriter;
MSEscherWriter *ms_escher_writer_new (BiffPut *bp);
void ms_escher_writer_commit (MSEscherWriter *ew);
#endif
void excel_write_MS_O_DRAWING_GROUP (BiffPut *bp);
void excel_write_MS_O_DRAWING_GROUP (BiffPut *bp);
#endif /* GNUMERIC_MS_OFFICE_ESCHER_H */
......@@ -382,7 +382,7 @@ ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
/* handle common attributes */
/* THIS IS DAMN UGLY we should be using gobject properties with common names or something */
label = ms_obj_attr_get_ptr (obj, MS_OBJ_ATTR_TEXT, NULL);
label = ms_obj_attr_get_ptr (obj->attrs, MS_OBJ_ATTR_TEXT, NULL);
if (label != NULL) {
switch (obj->excel_type) {
#if 0
......@@ -406,7 +406,7 @@ unhandled text for type 0x2
break;
}
}
markup = ms_obj_attr_get_markup (obj, MS_OBJ_ATTR_MARKUP, NULL);
markup = ms_obj_attr_get_markup (obj->attrs, MS_OBJ_ATTR_MARKUP, NULL);
if (markup != NULL) {
switch (obj->excel_type) {