Commit ed5b7621 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg
Browse files

Include menu item for R1C1


2005-11-06  Jody Goldberg <jody@gnome.org>

	* src/GNOME_Gnumeric-gtk.xml.in : Include menu item for R1C1
parent 5b453a57
......@@ -21,11 +21,11 @@ Release Critical
- Conditional formats
: draw & print long spans
- Save as ps/pdf
- back port python fixes ?
Pending Patches
---------------
http://bugzilla.gnome.org/show_bug.cgi?id=310354
- Patch for non-gconf gnm-config {bugzilla}
- autopackage patches {rob}
- Patches for Maemo {partially in}
- Meta Data
......
2005-11-06 Jody Goldberg <jody@gnome.org>
* src/GNOME_Gnumeric-gtk.xml.in : Include menu item for R1C1
2005-11-05 Jody Goldberg <jody@gnome.org>
* src/xml-io.c : Delete the original DOM based export. The pseudo-sax
......
......@@ -9,6 +9,7 @@ Jody:
* Some R1C1 fixes
* More SpreadsheetML from MS Office XP.
* Some OpenDoc import extensions.
* Minor fixes for auto-fill
* Enable a chart importer in the experimental xml sax importer.
Lukasz Stelmach:
......
2005-11-06 Jody Goldberg <jody@gnome.org>
* src/GNOME_Gnumeric-gtk.xml.in : Include menu item for R1C1
2005-11-05 Jody Goldberg <jody@gnome.org>
* src/xml-io.c : Delete the original DOM based export. The pseudo-sax
......
......@@ -147,7 +147,7 @@ sog_datas_set_sheet (SheetObjectGraph *sog, Sheet *sheet)
}
static void
sheet_object_graph_finalize (GObject *obj)
gnm_sog_finalize (GObject *obj)
{
SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (obj);
......@@ -164,7 +164,7 @@ sheet_object_graph_finalize (GObject *obj)
}
static SheetObjectView *
sheet_object_graph_new_view (SheetObject *so, SheetObjectViewContainer *container)
gnm_sog_new_view (SheetObject *so, SheetObjectViewContainer *container)
{
GnmCanvas *gcanvas = ((GnmPane *)container)->gcanvas;
SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
......@@ -176,7 +176,7 @@ sheet_object_graph_new_view (SheetObject *so, SheetObjectViewContainer *containe
}
static GtkTargetList *
sheet_object_graph_get_target_list (SheetObject const *so)
gnm_sog_get_target_list (SheetObject const *so)
{
GtkTargetList *tl = gtk_target_list_new (NULL, 0);
char *mime_str = go_image_format_to_mime ("svg");
......@@ -200,7 +200,7 @@ sheet_object_graph_get_target_list (SheetObject const *so)
}
static GtkTargetList *
sheet_object_graph_get_object_target_list (SheetObject const *so)
gnm_sog_get_object_target_list (SheetObject const *so)
{
GtkTargetList *tl, *tl2;
GtkTargetPair *pair;
......@@ -237,7 +237,7 @@ sog_gsf_gdk_pixbuf_save (const gchar *buf,
}
static void
sheet_object_graph_write_image (SheetObject const *so, const char *format,
gnm_sog_write_image (SheetObject const *so, const char *format,
GsfOutput *output, GError **err)
{
SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
......@@ -279,7 +279,7 @@ sheet_object_graph_write_image (SheetObject const *so, const char *format,
}
static void
sheet_object_graph_write_object (SheetObject const *so, const char *format,
gnm_sog_write_object (SheetObject const *so, const char *format,
GsfOutput *output, GError **err)
{
SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
......@@ -363,7 +363,7 @@ out:
}
static void
sheet_object_graph_populate_menu (SheetObject *so, GPtrArray *actions)
gnm_sog_populate_menu (SheetObject *so, GPtrArray *actions)
{
static SheetObjectAction const sog_action =
{ GTK_STOCK_SAVE_AS, N_("_Save as image"), NULL, 0, sog_cb_save_as };
......@@ -372,7 +372,7 @@ sheet_object_graph_populate_menu (SheetObject *so, GPtrArray *actions)
}
static gboolean
sheet_object_graph_read_xml_dom (SheetObject *so, char const *typename,
gnm_sog_read_xml_dom (SheetObject *so, char const *typename,
XmlParseContext const *ctxt, xmlNodePtr tree)
{
xmlNodePtr child = e_xml_get_child_by_name (tree, "GogObject");
......@@ -386,7 +386,7 @@ sheet_object_graph_read_xml_dom (SheetObject *so, char const *typename,
}
static void
sheet_object_graph_write_xml_sax (SheetObject const *so, GsfXMLOut *output)
gnm_sog_write_xml_sax (SheetObject const *so, GsfXMLOut *output)
{
SheetObjectGraph const *sog = SHEET_OBJECT_GRAPH (so);
gog_object_write_xml_sax (GOG_OBJECT (sog->graph), output);
......@@ -399,17 +399,15 @@ sog_xml_finish (GogObject *graph, SheetObject *so)
g_object_unref (graph);
}
static gboolean
sheet_object_graph_prep_xml_sax (SheetObject const *so,
GsfXMLIn *xin, xmlChar const **attrs)
static void
gnm_sog_prep_sax_parser (SheetObject *so, GsfXMLIn *xin, xmlChar const **attrs)
{
gog_object_sax_push_parser (xin, attrs,
(GogObjectSaxHandler) sog_xml_finish, so);
return FALSE;
}
static void
sheet_object_graph_copy (SheetObject *dst, SheetObject const *src)
gnm_sog_copy (SheetObject *dst, SheetObject const *src)
{
SheetObjectGraph const *sog = SHEET_OBJECT_GRAPH (src);
GogGraph *graph = gog_graph_dup (sog->graph);
......@@ -418,7 +416,7 @@ sheet_object_graph_copy (SheetObject *dst, SheetObject const *src)
}
static void
sheet_object_graph_print (SheetObject const *so, GnomePrintContext *ctx,
gnm_sog_print (SheetObject const *so, GnomePrintContext *ctx,
double width, double height)
{
gog_graph_print_to_gnome_print (
......@@ -428,10 +426,10 @@ sheet_object_graph_print (SheetObject const *so, GnomePrintContext *ctx,
typedef struct {
SheetObject *so;
WorkbookControl *wbc;
} sheet_object_graph_user_config_t;
} gnm_sog_user_config_t;
static void
sheet_object_graph_user_config_free_data (gpointer data,
gnm_sog_user_config_free_data (gpointer data,
GClosure *closure)
{
g_free (data);
......@@ -439,18 +437,18 @@ sheet_object_graph_user_config_free_data (gpointer data,
}
static void
cb_update_graph (GogGraph *graph, sheet_object_graph_user_config_t *data)
cb_update_graph (GogGraph *graph, gnm_sog_user_config_t *data)
{
cmd_so_graph_config (data->wbc, data->so, G_OBJECT (graph),
G_OBJECT (SHEET_OBJECT_GRAPH (data->so)->graph));
}
static void
sheet_object_graph_user_config (SheetObject *so, SheetControl *sc)
gnm_sog_user_config (SheetObject *so, SheetControl *sc)
{
SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
WorkbookControlGUI *wbcg;
sheet_object_graph_user_config_t *data;
gnm_sog_user_config_t *data;
GClosure *closure;
g_return_if_fail (sog != NULL);
......@@ -458,19 +456,19 @@ sheet_object_graph_user_config (SheetObject *so, SheetControl *sc)
wbcg = scg_get_wbcg (SHEET_CONTROL_GUI (sc));
data = g_new0 (sheet_object_graph_user_config_t, 1);
data = g_new0 (gnm_sog_user_config_t, 1);
data->so = so;
data->wbc = WORKBOOK_CONTROL (wbcg);
closure = g_cclosure_new (G_CALLBACK (cb_update_graph), data,
(GClosureNotify) sheet_object_graph_user_config_free_data);
(GClosureNotify) gnm_sog_user_config_free_data);
sheet_object_graph_guru (wbcg, sog->graph, closure);
g_closure_sink (closure);
}
static gboolean
sheet_object_graph_set_sheet (SheetObject *so, Sheet *sheet)
gnm_sog_set_sheet (SheetObject *so, Sheet *sheet)
{
SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
if (sog->graph != NULL)
......@@ -479,7 +477,7 @@ sheet_object_graph_set_sheet (SheetObject *so, Sheet *sheet)
}
static gboolean
sheet_object_graph_remove_from_sheet (SheetObject *so)
gnm_sog_remove_from_sheet (SheetObject *so)
{
SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
if (sog->graph != NULL)
......@@ -488,14 +486,14 @@ sheet_object_graph_remove_from_sheet (SheetObject *so)
}
static void
sheet_object_graph_default_size (SheetObject const *so, double *w, double *h)
gnm_sog_default_size (SheetObject const *so, double *w, double *h)
{
*w = GO_CM_TO_PT ((double)12);
*h = GO_CM_TO_PT ((double)8);
}
static void
sheet_object_graph_bounds_changed (SheetObject *so)
gnm_sog_bounds_changed (SheetObject *so)
{
SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
......@@ -509,34 +507,34 @@ sheet_object_graph_bounds_changed (SheetObject *so)
}
static void
sheet_object_graph_class_init (GObjectClass *klass)
gnm_sog_class_init (GObjectClass *klass)
{
SheetObjectClass *so_class = SHEET_OBJECT_CLASS (klass);
parent_klass = g_type_class_peek_parent (klass);
/* Object class method overrides */
klass->finalize = sheet_object_graph_finalize;
klass->finalize = gnm_sog_finalize;
/* SheetObject class method overrides */
so_class->new_view = sheet_object_graph_new_view;
so_class->bounds_changed = sheet_object_graph_bounds_changed;
so_class->populate_menu = sheet_object_graph_populate_menu;
so_class->read_xml_dom = sheet_object_graph_read_xml_dom;
so_class->write_xml_sax = sheet_object_graph_write_xml_sax;
so_class->prep_xml_sax = sheet_object_graph_prep_xml_sax;
so_class->copy = sheet_object_graph_copy;
so_class->user_config = sheet_object_graph_user_config;
so_class->assign_to_sheet = sheet_object_graph_set_sheet;
so_class->remove_from_sheet = sheet_object_graph_remove_from_sheet;
so_class->print = sheet_object_graph_print;
so_class->default_size = sheet_object_graph_default_size;
so_class->new_view = gnm_sog_new_view;
so_class->bounds_changed = gnm_sog_bounds_changed;
so_class->populate_menu = gnm_sog_populate_menu;
so_class->read_xml_dom = gnm_sog_read_xml_dom;
so_class->write_xml_sax = gnm_sog_write_xml_sax;
so_class->prep_sax_parser = gnm_sog_prep_sax_parser;
so_class->copy = gnm_sog_copy;
so_class->user_config = gnm_sog_user_config;
so_class->assign_to_sheet = gnm_sog_set_sheet;
so_class->remove_from_sheet = gnm_sog_remove_from_sheet;
so_class->print = gnm_sog_print;
so_class->default_size = gnm_sog_default_size;
so_class->rubber_band_directly = FALSE;
}
static void
sheet_object_graph_init (GObject *obj)
gnm_sog_init (GObject *obj)
{
SheetObject *so = SHEET_OBJECT (obj);
so->anchor.direction = SO_DIR_DOWN_RIGHT;
......@@ -545,20 +543,20 @@ sheet_object_graph_init (GObject *obj)
static void
sog_imageable_init (SheetObjectImageableIface *soi_iface)
{
soi_iface->get_target_list = sheet_object_graph_get_target_list;
soi_iface->write_image = sheet_object_graph_write_image;
soi_iface->get_target_list = gnm_sog_get_target_list;
soi_iface->write_image = gnm_sog_write_image;
}
static void
sog_exportable_init (SheetObjectExportableIface *soe_iface)
{
soe_iface->get_target_list = sheet_object_graph_get_object_target_list;
soe_iface->write_object = sheet_object_graph_write_object;
soe_iface->get_target_list = gnm_sog_get_object_target_list;
soe_iface->write_object = gnm_sog_write_object;
}
GSF_CLASS_FULL (SheetObjectGraph, sheet_object_graph,
NULL, NULL, sheet_object_graph_class_init,NULL,
sheet_object_graph_init, SHEET_OBJECT_TYPE, 0,
NULL, NULL, gnm_sog_class_init,NULL,
gnm_sog_init, SHEET_OBJECT_TYPE, 0,
GSF_INTERFACE (sog_imageable_init, SHEET_OBJECT_IMAGEABLE_TYPE) \
GSF_INTERFACE (sog_exportable_init, SHEET_OBJECT_EXPORTABLE_TYPE));
......
......@@ -16,6 +16,7 @@
#include "gnumeric-pane.h"
#include "gui-file.h"
#include "application.h"
#include "xml-io.h"
#include <goffice/utils/go-glib-extras.h>
#include <goffice/utils/go-libxml-extras.h>
......@@ -114,7 +115,7 @@ typedef struct {
SheetObjectClass parent_class;
} SheetObjectImageClass;
static SheetObjectClass *sheet_object_image_parent_class;
static SheetObjectClass *gnm_soi_parent_class;
enum {
PROP_0,
......@@ -163,7 +164,7 @@ sheet_object_image_set_crop (SheetObjectImage *soi,
}
static void
sheet_object_image_finalize (GObject *object)
gnm_soi_finalize (GObject *object)
{
SheetObjectImage *soi;
......@@ -172,7 +173,7 @@ sheet_object_image_finalize (GObject *object)
g_free (soi->type);
soi->bytes.data = NULL;
G_OBJECT_CLASS (sheet_object_image_parent_class)->finalize (object);
G_OBJECT_CLASS (gnm_soi_parent_class)->finalize (object);
}
static GdkPixbuf *
......@@ -300,7 +301,7 @@ soi_get_pixbuf (SheetObjectImage *soi, double scale)
}
static SheetObjectView *
sheet_object_image_new_view (SheetObject *so, SheetObjectViewContainer *container)
gnm_soi_new_view (SheetObject *so, SheetObjectViewContainer *container)
{
GnmCanvas *gcanvas = ((GnmPane *)container)->gcanvas;
SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
......@@ -416,7 +417,7 @@ soi_free_image_fmt (gpointer data)
}
static GtkTargetList *
sheet_object_image_get_target_list (SheetObject const *so)
gnm_soi_get_target_list (SheetObject const *so)
{
SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
GtkTargetList *tl = gtk_target_list_new (NULL, 0);
......@@ -445,7 +446,7 @@ sheet_object_image_get_target_list (SheetObject const *so)
}
static void
sheet_object_image_write_image (SheetObject const *so, const char *format,
gnm_soi_write_image (SheetObject const *so, const char *format,
GsfOutput *output, GError **err)
{
SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
......@@ -529,25 +530,22 @@ out:
}
static void
sheet_object_image_populate_menu (SheetObject *so, GPtrArray *actions)
gnm_soi_populate_menu (SheetObject *so, GPtrArray *actions)
{
static SheetObjectAction const soi_action =
{ GTK_STOCK_SAVE_AS, N_("_Save as image"), NULL, 0, soi_cb_save_as };
sheet_object_image_parent_class->populate_menu (so, actions);
gnm_soi_parent_class->populate_menu (so, actions);
go_ptr_array_insert (actions, (gpointer) &soi_action, 1);
}
static gboolean
sheet_object_image_read_xml_dom (SheetObject *so, char const *typename,
gnm_soi_read_xml_dom (SheetObject *so, char const *typename,
XmlParseContext const *ctxt, xmlNodePtr tree)
{
SheetObjectImage *soi;
SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
xmlNodePtr child;
xmlChar *type, *content;
g_return_val_if_fail (IS_SHEET_OBJECT_IMAGE (so), TRUE);
soi = SHEET_OBJECT_IMAGE (so);
child = e_xml_get_child_by_name (tree, "Content");
type = xmlGetProp (child, CC2XML ("image-type"));
if (type == NULL)
......@@ -567,7 +565,53 @@ sheet_object_image_read_xml_dom (SheetObject *so, char const *typename,
}
static void
sheet_object_image_write_xml_sax (SheetObject const *so, GsfXMLOut *output)
content_start (GsfXMLIn *xin, xmlChar const **attrs)
{
SheetObject *so = gnm_xml_in_cur_obj (xin);
SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
xmlChar const *image_type = NULL;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (0 == strcmp (attrs[0], "image-type"))
image_type = attrs[1];
soi->type = g_strdup (image_type);
}
static void
content_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *unknown)
{
SheetObject *so = gnm_xml_in_cur_obj (xin);
SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
soi->bytes.len = gsf_base64_decode_simple (
xin->content->str, xin->content->len);
soi->bytes.data = g_memdup (xin->content->str, soi->bytes.len);
}
static void
gnm_soi_prep_sax_parser (SheetObject *so, GsfXMLIn *xin, xmlChar const **attrs)
{
static GsfXMLInNode const dtd[] = {
GSF_XML_IN_NODE (CONTENT, CONTENT, -1, "Content", GSF_XML_CONTENT, &content_start, &content_end),
GSF_XML_IN_NODE_END
};
static GsfXMLInDoc *doc = NULL;
SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
if (NULL == doc)
doc = gsf_xml_in_doc_new (dtd, NULL);
gsf_xml_in_push_state (xin, doc, NULL, NULL, attrs);
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
if (gnm_xml_attr_double (attrs, "crop-top", &soi->crop_top)) ;
else if (gnm_xml_attr_double (attrs, "crop-bottom", &soi->crop_bottom)) ;
else if (gnm_xml_attr_double (attrs, "crop-left", &soi->crop_left)) ;
else if (gnm_xml_attr_double (attrs, "crop-right", &soi->crop_right)) ;
}
}
static void
gnm_soi_write_xml_sax (SheetObject const *so, GsfXMLOut *output)
{
SheetObjectImage *soi;
......@@ -587,7 +631,7 @@ sheet_object_image_write_xml_sax (SheetObject const *so, GsfXMLOut *output)
}
static void
sheet_object_image_copy (SheetObject *dst, SheetObject const *src)
gnm_soi_copy (SheetObject *dst, SheetObject const *src)
{
SheetObjectImage const *soi = SHEET_OBJECT_IMAGE (src);
SheetObjectImage *new_soi = SHEET_OBJECT_IMAGE (dst);
......@@ -602,7 +646,7 @@ sheet_object_image_copy (SheetObject *dst, SheetObject const *src)
}
static void
sheet_object_image_print (SheetObject const *so, GnomePrintContext *ctx,
gnm_soi_print (SheetObject const *so, GnomePrintContext *ctx,
double width, double height)
{
SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
......@@ -629,7 +673,7 @@ sheet_object_image_print (SheetObject const *so, GnomePrintContext *ctx,
}
static void
sheet_object_image_default_size (SheetObject const *so, double *w, double *h)
gnm_soi_default_size (SheetObject const *so, double *w, double *h)
{
GdkPixbuf *buf = soi_get_pixbuf (SHEET_OBJECT_IMAGE (so), 1.);
*w = gdk_pixbuf_get_width (buf);
......@@ -638,10 +682,10 @@ sheet_object_image_default_size (SheetObject const *so, double *w, double *h)
}
static void
sheet_object_image_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
gnm_soi_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
SheetObjectImage *soi = SHEET_OBJECT_IMAGE (object);
GdkPixbuf *pixbuf;
......@@ -664,45 +708,40 @@ sheet_object_image_get_property (GObject *object,
}
static void
sheet_object_image_class_init (GObjectClass *object_class)
gnm_soi_class_init (GObjectClass *object_class)
{
SheetObjectClass *sheet_object_class;
SheetObjectClass *so_class;
sheet_object_image_parent_class = g_type_class_peek_parent (object_class);
gnm_soi_parent_class = g_type_class_peek_parent (object_class);
/* Object class method overrides */
object_class->finalize = sheet_object_image_finalize;
object_class->get_property = sheet_object_image_get_property;
object_class->finalize = gnm_soi_finalize;
object_class->get_property = gnm_soi_get_property;
/* SheetObject class method overrides */
sheet_object_class = SHEET_OBJECT_CLASS (object_class);
sheet_object_class->new_view = sheet_object_image_new_view;
sheet_object_class->populate_menu = sheet_object_image_populate_menu;
sheet_object_class->read_xml_dom = sheet_object_image_read_xml_dom;
sheet_object_class->write_xml_sax = sheet_object_image_write_xml_sax;
sheet_object_class->copy = sheet_object_image_copy;
sheet_object_class->user_config = NULL;
sheet_object_class->print = sheet_object_image_print;
sheet_object_class->default_size = sheet_object_image_default_size;
sheet_object_class->rubber_band_directly = TRUE;
so_class = SHEET_OBJECT_CLASS (object_class);
so_class->new_view = gnm_soi_new_view;
so_class->populate_menu = gnm_soi_populate_menu;
so_class->read_xml_dom = gnm_soi_read_xml_dom;
so_class->write_xml_sax = gnm_soi_write_xml_sax;
so_class->prep_sax_parser = gnm_soi_prep_sax_parser;
so_class->copy = gnm_soi_copy;
so_class->user_config = NULL;
so_class->print = gnm_soi_print;
so_class->default_size = gnm_soi_default_size;
so_class->rubber_band_directly = TRUE;
/* The property strings don't need translation */
g_object_class_install_property
(object_class,
PROP_IMAGE_TYPE,
g_object_class_install_property (object_class, PROP_IMAGE_TYPE,
g_param_spec_string ("image-type", "Image type",
"Type of image",
NULL,
GSF_PARAM_STATIC | G_PARAM_READABLE));
g_object_class_install_property
(object_class,
PROP_IMAGE_DATA,
g_object_class_install_property (object_class, PROP_IMAGE_DATA,
g_param_spec_pointer ("image-data", "Image data",
"Image data",
GSF_PARAM_STATIC | G_PARAM_READABLE));
g_object_class_install_property
(object_class,
PROP_PIXBUF,
g_object_class_install_property (object_class, PROP_PIXBUF,
g_param_spec_object ("pixbuf", "Pixbuf",
"Pixbuf",
GDK_TYPE_PIXBUF,
......@@ -710,7 +749,7 @@ sheet_object_image_class_init (GObjectClass *object_class)
}
static void
sheet_object_image_init (GObject *obj)
gnm_soi_init (GObject *obj)
{
SheetObjectImage *soi;
SheetObject *so;
......@@ -727,11 +766,11 @@ sheet_object_image_init (GObject *obj)
static void
soi_imageable_init (SheetObjectImageableIface *soi_iface)
{
soi_iface->get_target_list = sheet_object_image_get_target_list;
soi_iface->write_image = sheet_object_image_write_image;
soi_iface->get_target_list = gnm_soi_get_target_list;
soi_iface->write_image = gnm_soi_write_image;
}
GSF_CLASS_FULL (SheetObjectImage, sheet_object_image,
NULL, NULL, sheet_object_image_class_init, NULL,
sheet_object_image_init, SHEET_OBJECT_TYPE, 0,
NULL, NULL, gnm_soi_class_init, NULL,
gnm_soi_init, SHEET_OBJECT_TYPE, 0,
GSF_INTERFACE (soi_imageable_init, SHEET_OBJECT_IMAGEABLE_TYPE));
......@@ -54,4 +54,9 @@ void gnm_xml_out_add_color (GsfXMLOut *o, char const *id, GnmColor const *c);
void gnm_xml_out_add_gocolor (GsfXMLOut *o, char const *id, GOColor c);
void gnm_xml_out_add_cellpos (GsfXMLOut *o, char const *id, GnmCellPos const *p);
/* Gnumeric specific SAX import */
gboolean gnm_xml_attr_double (xmlChar const * const *attrs,
char const *name, double * res);
SheetObject *gnm_xml_in_cur_obj (GsfXMLIn const *xin);
#endif /* GNUMERIC_XML_IO_H */
......@@ -54,6 +54,7 @@
#include "gnm-so-filled.h"
#include "sheet-object-graph.h"
#include "application.h"
#include "xml-io.h"
#include <goffice/app/io-context.h>
#include <goffice/app/go-plugin.h>
......@@ -76,8 +77,8 @@ GNM_PLUGIN_MODULE_HEADER;
/*****************************************************************************/
static gboolean
xml_sax_attr_double (xmlChar const * const *attrs, char const *name, double * res)
gboolean
gnm_xml_attr_double (xmlChar const * const *attrs, char const *name, double * res)
{
char *end;
double tmp;
......@@ -298,6 +299,13 @@ typedef struct {
SheetObject *so;
} XMLSaxParseState;
SheetObject *
gnm_xml_in_cur_obj (GsfXMLIn const *xin)
{
XMLSaxParseState *state = (XMLSaxParseState *)xin->user_state;
return state->so;
}
/****************************************************************************/
static void
......@@ -403,7 +411,7 @@ xml_sax_calculation (GsfXMLIn *gsf_state, xmlChar const **attrs)
workbook_iteration_enabled (state->wb, b);
else if (xml_sax_attr_int (attrs, "MaxIterations", &i))
workbook_iteration_max_number (state->wb, i);
else if (xml_sax_attr_double (attrs, "IterationTolerance", &d))
else if (gnm_xml_attr_double (attrs, "IterationTolerance", &d))
workbook_iteration_tolerance (state->wb, d);