mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
final tweaks
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9495 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
5647961e59
commit
304fd730f4
@ -62,11 +62,11 @@ struct _gncBillTerm
|
|||||||
gint cutoff;
|
gint cutoff;
|
||||||
|
|
||||||
/* See src/doc/business.txt for an explanation of the following */
|
/* See src/doc/business.txt for an explanation of the following */
|
||||||
|
/* Code that handles this is *identical* to that in gncTaxTable */
|
||||||
gint64 refcount;
|
gint64 refcount;
|
||||||
GncBillTerm * parent; /* if non-null, we are an immutable child */
|
GncBillTerm * parent; /* if non-null, we are an immutable child */
|
||||||
GncBillTerm * child; /* if non-null, we have not changed */
|
GncBillTerm * child; /* if non-null, we have not changed */
|
||||||
gboolean invisible;
|
gboolean invisible;
|
||||||
|
|
||||||
GList * children; /* list of children for disconnection */
|
GList * children; /* list of children for disconnection */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -224,6 +224,7 @@ static void gncBillTermFree (GncBillTerm *term)
|
|||||||
GncBillTerm *
|
GncBillTerm *
|
||||||
gncCloneBillTerm (GncBillTerm *from, QofBook *book)
|
gncCloneBillTerm (GncBillTerm *from, QofBook *book)
|
||||||
{
|
{
|
||||||
|
GList *node;
|
||||||
GncBillTerm *term;
|
GncBillTerm *term;
|
||||||
|
|
||||||
if (!book) return NULL;
|
if (!book) return NULL;
|
||||||
@ -241,25 +242,27 @@ gncCloneBillTerm (GncBillTerm *from, QofBook *book)
|
|||||||
term->cutoff = from->cutoff;
|
term->cutoff = from->cutoff;
|
||||||
term->invisible = from->invisible;
|
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
|
/* 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)
|
if (from->child)
|
||||||
{
|
{
|
||||||
term->child = gncBillTermObtainTwin (from->child, book);
|
term->child = gncBillTermObtainTwin (from->child, book);
|
||||||
term->child->parent = term;
|
term->child->parent = term;
|
||||||
term->child->refcount = 0; /* XXX is this right ?? */
|
|
||||||
term->children = g_list_prepend(term->children, term->child);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (from->parent)
|
if (from->parent)
|
||||||
{
|
{
|
||||||
term->parent = gncBillTermObtainTwin (from->parent, book);
|
term->parent = gncBillTermObtainTwin (from->parent, book);
|
||||||
term->parent->child = term;
|
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);
|
addObj (term);
|
||||||
gnc_engine_generate_event (&term->inst.guid, _GNC_MOD_NAME, GNC_EVENT_CREATE);
|
gnc_engine_generate_event (&term->inst.guid, _GNC_MOD_NAME, GNC_EVENT_CREATE);
|
||||||
|
@ -53,15 +53,15 @@ struct _gncTaxTable
|
|||||||
QofInstance inst;
|
QofInstance inst;
|
||||||
char * name;
|
char * name;
|
||||||
GList * entries;
|
GList * entries;
|
||||||
|
Timespec modtime; /* internal date of last modtime */
|
||||||
|
|
||||||
/* See src/doc/business.txt for an explanation of the following */
|
/* 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;
|
gint64 refcount;
|
||||||
GncTaxTable * parent; /* if non-null, we are an immutable child */
|
GncTaxTable * parent; /* if non-null, we are an immutable child */
|
||||||
GncTaxTable * child; /* if non-null, we have not changed */
|
GncTaxTable * child; /* if non-null, we have not changed */
|
||||||
gboolean invisible;
|
gboolean invisible;
|
||||||
|
GList * children; /* list of children for disconnection */
|
||||||
GList * children; /* A list of children */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _gncTaxTableEntry
|
struct _gncTaxTableEntry
|
||||||
@ -255,28 +255,27 @@ gncCloneTaxTable (GncTaxTable *from, QofBook *book)
|
|||||||
table->modtime = from->modtime;
|
table->modtime = from->modtime;
|
||||||
table->invisible = from->invisible;
|
table->invisible = from->invisible;
|
||||||
|
|
||||||
/* XXX not sure how to handle the refcount ... FIXME!! */
|
table->refcount = 0;
|
||||||
#if LATER_FIXME
|
|
||||||
table->refcount = ????
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 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
|
/* 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)
|
if (from->child)
|
||||||
{
|
{
|
||||||
table->child = gncTaxTableObtainTwin (from->child, book);
|
table->child = gncTaxTableObtainTwin (from->child, book);
|
||||||
table->child->parent = table;
|
table->child->parent = table;
|
||||||
table->child->refcount = 0; /* XXX is this right ?? */
|
|
||||||
table->children = g_list_prepend(table->children, table->child);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (from->parent)
|
if (from->parent)
|
||||||
{
|
{
|
||||||
table->parent = gncTaxTableObtainTwin (from->parent, book);
|
table->parent = gncTaxTableObtainTwin (from->parent, book);
|
||||||
table->parent->child = table;
|
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 */
|
/* Copy tax entries, preserving the order in the list */
|
||||||
table->entries = NULL;
|
table->entries = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user