Saving objects in goffice


I am writing the code to add error bars in graphs. I am ipmlementing
error bars as properties in GogSeries. My concern is that I don't think
necessary to have anything about error bars saved when the default (no
bars) applies. With the current implementation (use of the GogPersistDOM
interface), we'll have always something saved. This is also true for
GogStyle even when the default is used.

A simple solution to this is to change the GogPersistDOM interface so t
that the save method returns a boolean value:

<       void     (*save) (GogPersistDOM *gpd, xmlNode *parent);
      gboolean     (*save) (GogPersistDOM *gpd, xmlNode *parent);

and in gog_object_write_property:

        case G_TYPE_OBJECT:
                val_obj = g_value_get_object (&value);
                if (val_obj != NULL) {
                        if (IS_GOG_PERSIST_DOM (val_obj)) {
<                               gog_persist_dom_save (GOG_PERSIST_DOM (val_obj), node);
                              success = gog_persist_dom_save (GOG_PERSIST_DOM (val_obj), node);
                        } else

Also, success should be FALSE if val_obj is NULL.



Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]