* src/report/report-gnome/dialog-view-column.c:

- fix a bug in the gh_ -> scm_ conversion:  gh_appendN() needs
	    to be converted to gh_append(gh_listify(..., SCM_UNDEFINED)).
	    Just using gh_listify is wrong and causes a crash.
	  - fix a bug that crashes gnucash if you remove the last entry
	    and then add another entry.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8396 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2003-05-25 18:04:25 +00:00
parent dc149e622a
commit bb715d706b
2 changed files with 26 additions and 17 deletions

View File

@ -1,5 +1,12 @@
2003-05-25 Derek Atkins <derek@ihtfp.com>
* src/report/report-gnome/dialog-view-column.c:
- fix a bug in the gh_ -> scm_ conversion: gh_appendN() needs
to be converted to gh_append(gh_listify(..., SCM_UNDEFINED)).
Just using gh_listify is wrong and causes a crash.
- fix a bug that crashes gnucash if you remove the last entry
and then add another entry.
* src/business/business-reports/aging.scm:
- Deal with the case where the first transaction found for a
particular company is a payment (it used to just ignore it!

View File

@ -324,21 +324,23 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data) {
newlist = scm_cons(SCM_CAR(oldlist), newlist);
oldlist = SCM_CDR(oldlist);
}
newlist = scm_listify(scm_reverse(scm_cons(SCM_LIST4(new_report,
newlist = scm_append
(scm_listify(scm_reverse(scm_cons(SCM_LIST4(new_report,
scm_int2num(1),
scm_int2num(1),
SCM_BOOL_F),
newlist)),
oldlist,
SCM_UNDEFINED);
SCM_UNDEFINED));
}
else {
newlist = scm_listify(oldlist,
newlist = scm_append
(scm_listify(oldlist,
SCM_LIST1(SCM_LIST4(new_report,
scm_int2num(1),
scm_int2num(1),
SCM_BOOL_F)),
SCM_UNDEFINED);
SCM_UNDEFINED));
r->contents_selected = oldlength;
}
@ -370,11 +372,11 @@ gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data) {
oldlist = SCM_CDR(oldlist);
}
if(count <= oldlength) {
newlist = scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED);
newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
}
}
if(oldlength == r->contents_selected + 1) {
if(r->contents_selected > 0 && oldlength == r->contents_selected + 1) {
r->contents_selected --;
}
@ -409,7 +411,7 @@ gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data) {
temp = SCM_CAR(oldlist);
oldlist = SCM_CDR(oldlist);
newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
newlist = scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED);
newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
scm_unprotect_object(r->contents_list);
r->contents_list = newlist;
@ -444,7 +446,7 @@ gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data) {
temp = SCM_CAR(oldlist);
oldlist = SCM_CDR(oldlist);
newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
newlist = scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED);
newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
scm_unprotect_object(r->contents_list);
r->contents_list = newlist;