final tweaks

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9495 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2003-10-13 03:56:23 +00:00
parent 5647961e59
commit 304fd730f4
2 changed files with 25 additions and 23 deletions

View File

@ -62,11 +62,11 @@ struct _gncBillTerm
gint cutoff;
/* See src/doc/business.txt for an explanation of the following */
/* Code that handles this is *identical* to that in gncTaxTable */
gint64 refcount;
GncBillTerm * parent; /* if non-null, we are an immutable child */
GncBillTerm * child; /* if non-null, we have not changed */
gboolean invisible;
GList * children; /* list of children for disconnection */
};
@ -224,6 +224,7 @@ static void gncBillTermFree (GncBillTerm *term)
GncBillTerm *
gncCloneBillTerm (GncBillTerm *from, QofBook *book)
{
GList *node;
GncBillTerm *term;
if (!book) return NULL;
@ -241,25 +242,27 @@ gncCloneBillTerm (GncBillTerm *from, QofBook *book)
term->cutoff = from->cutoff;
term->invisible = from->invisible;
/** xxx I don't know what to do about refcount ... FIXME XXX */
term->refcount = 0;
/* XXX this treats parent-child as double-linked list, not sure
* if that's true .. */
/* Make copies of parents and children. Note that this can be
* a recursive copy ... */
* a recursive copy ... treat as doubly-linked list. */
if (from->child)
{
term->child = gncBillTermObtainTwin (from->child, book);
term->child->parent = term;
term->child->refcount = 0; /* XXX is this right ?? */
term->children = g_list_prepend(term->children, term->child);
}
if (from->parent)
{
term->parent = gncBillTermObtainTwin (from->parent, book);
term->parent->child = term;
}
for (node=g_list_last(from->children); node; node=node->next)
{
GncBillTerm *btrm = node->data;
btrm = gncBillTermObtainTwin (btrm, book);
btrm->parent = term;
term->children = g_list_prepend(term->children, btrm);
}
addObj (term);
gnc_engine_generate_event (&term->inst.guid, _GNC_MOD_NAME, GNC_EVENT_CREATE);

View File

@ -53,15 +53,15 @@ struct _gncTaxTable
QofInstance inst;
char * name;
GList * entries;
Timespec modtime; /* internal date of last modtime */
/* See src/doc/business.txt for an explanation of the following */
Timespec modtime; /* internal date of last modtime */
/* Code that handles this is *identical* to that in gncBillTerm */
gint64 refcount;
GncTaxTable * parent; /* if non-null, we are an immutable child */
GncTaxTable * child; /* if non-null, we have not changed */
GncTaxTable * parent; /* if non-null, we are an immutable child */
GncTaxTable * child; /* if non-null, we have not changed */
gboolean invisible;
GList * children; /* A list of children */
GList * children; /* list of children for disconnection */
};
struct _gncTaxTableEntry
@ -255,28 +255,27 @@ gncCloneTaxTable (GncTaxTable *from, QofBook *book)
table->modtime = from->modtime;
table->invisible = from->invisible;
/* XXX not sure how to handle the refcount ... FIXME!! */
#if LATER_FIXME
table->refcount = ????
#endif
table->refcount = 0;
/* XXX this treats parent-child as double-linked list, not sure
* if that's true .. */
/* Make copies of parents and children. Note that this can be
* a recursive copy ... */
* a recursive copy ... treat as doubly-linked list. */
if (from->child)
{
table->child = gncTaxTableObtainTwin (from->child, book);
table->child->parent = table;
table->child->refcount = 0; /* XXX is this right ?? */
table->children = g_list_prepend(table->children, table->child);
}
if (from->parent)
{
table->parent = gncTaxTableObtainTwin (from->parent, book);
table->parent->child = table;
}
for (node=g_list_last(from->children); node; node=node->next)
{
GncTaxTable *tbl = node->data;
tbl = gncTaxTableObtainTwin (tbl, book);
tbl->parent = table;
table->children = g_list_prepend(table->children, tbl);
}
/* Copy tax entries, preserving the order in the list */
table->entries = NULL;