static void gnc_template_register_save_shares_cell (BasicCell * cell, gpointer save_data, gpointer user_data) { SRSaveData *sd = save_data; kvp_frame *kvpf; char *sharesStr = "(x + y)/42"; g_return_if_fail (gnc_basic_cell_has_name (cell, SHRS_CELL)); kvpf = xaccSplitGetSlots (sd->split); /* FIXME: shares cells are numeric by definition. */ DEBUG ("kvp_frame before: %s\n", kvp_frame_to_string (kvpf)); /* sharesStr = gnc_numeric_to_string( sharesStr ); */ kvp_frame_set_slot_path (kvpf, kvp_value_new_string (sharesStr), GNC_SX_ID, GNC_SX_SHARES, NULL); DEBUG ("kvp_frame after: %s\n", kvp_frame_to_string (kvpf)); /* set the shares to an innocuous value */ /* Note that this marks the split dirty */ xaccSplitSetSharePriceAndAmount (sd->split, gnc_numeric_create (0, 1), gnc_numeric_create (0, 1)); }
static void gnc_template_register_save_shares_cell (BasicCell * cell, gpointer save_data, gpointer user_data) { SRSaveData *sd = save_data; char *sharesStr = "(x + y)/42"; g_return_if_fail (gnc_basic_cell_has_name (cell, SHRS_CELL)); /* FIXME: shares cells are numeric by definition. */ qof_instance_set (QOF_INSTANCE (sd->split), "sx-shares", sharesStr, NULL); /* set the shares to an innocuous value */ /* Note that this marks the split dirty */ xaccSplitSetSharePriceAndAmount (sd->split, gnc_numeric_create (0, 1), gnc_numeric_create (0, 1)); }