--- trunk/lib/libqof/qof/gnc-numeric.c 2007-02-03 11:41:53.000000000 -0500 +++ gda-dev/lib/libqof/qof/gnc-numeric.c 2007-04-05 15:47:42.000000000 -0400 @@ -1264,6 +1264,40 @@ } /* ******************************************************************* + * GValue handling + ********************************************************************/ +static gpointer +gnc_numeric_boxed_copy_func( gpointer in_gnc_numeric ) +{ + gnc_numeric* newvalue; + + newvalue = g_malloc( sizeof( gnc_numeric ) ); + memcpy( newvalue, in_gnc_numeric, sizeof( gnc_numeric ) ); + + return newvalue; +} + +static void +gnc_numeric_boxed_free_func( gpointer in_gnc_numeric ) +{ + g_free( in_gnc_numeric ); +} + +GType +gnc_numeric_get_type( void ) +{ + static GType type = 0; + + if( type == 0 ) { + type = g_boxed_type_register_static( "gnc_numeric", + gnc_numeric_boxed_copy_func, + gnc_numeric_boxed_free_func ); + } + + return type; +} + +/* ******************************************************************* * gnc_numeric misc testing ********************************************************************/ #ifdef _GNC_NUMERIC_TEST --- trunk/lib/libqof/qof/gnc-numeric.h 2007-02-03 11:41:53.000000000 -0500 +++ gda-dev/lib/libqof/qof/gnc-numeric.h 2007-04-05 15:21:43.000000000 -0400 @@ -50,6 +50,8 @@ #ifndef GNC_NUMERIC_H #define GNC_NUMERIC_H +#include + struct _gnc_numeric { gint64 num; @@ -445,6 +447,13 @@ gnc_numeric gnc_numeric_reduce(gnc_numeric in); /** @} */ +/** @name GValue + @{ +*/ +GType gnc_numeric_get_type( void ); + +/** @} */ + /** @name Deprecated, backwards-compatible definitions @{ */ --- trunk/lib/libqof/qof/kvp_frame.c 2007-02-03 11:41:53.000000000 -0500 +++ gda-dev/lib/libqof/qof/kvp_frame.c 2007-04-05 15:21:43.000000000 -0400 @@ -512,6 +512,7 @@ { char *key = NULL; KvpValue *oldvalue; + KvpFrame* orig_frame = frame; frame = (KvpFrame *) get_trailer_or_null (frame, path, &key); oldvalue = kvp_frame_get_slot (frame, key); @@ -544,6 +545,7 @@ /* Hmm, if we are here, the path doesn't exist. We need to * create the path, add the value to it. */ + frame = orig_frame; frame = kvp_frame_set_value_nc (frame, path, value); LEAVE ("new frame=%s", kvp_frame_to_string(frame)); return frame;