Re: Saving objects in goffice

On Mon, Feb 23, 2004 at 08:41:40PM +0100, Jean Brefort wrote:
Jody Goldberg wrote:

On Sat, Feb 21, 2004 at 11:44:19AM +0100, Jean Brefort wrote:
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);

Also, success should be FALSE if val_obj is NULL.

Hmm, that does not fit well with my plans to ditch the DOM interface
and move to SAX alone.  For that we won't have the luxery of knowing
not to export the wrapper if the object's export fails. 

Why is the val_obj != NULL test insufficient ?

The node will be saved even if empty since by default success is TRUE.

Agreed success should be set to FALSE in the val_obj == NULL case.
Please do a couple round trips to make sure it works smootly.
However, the question still stands why is the val_obj == NULL test
insufficent.  Why do you need the persist_dom interface to return a
flag ?

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