mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-30 12:44:01 -06:00
Remove unused ifdefs for IMPLEMENT_BOOK_DOM_TREES_LATER.
Apparently stub code for a different way of generating the DOM tree, never implemented.
This commit is contained in:
parent
a0a0ffbb77
commit
456ab2241f
@ -60,45 +60,6 @@ static QofLogModule log_module = GNC_MOD_IO;
|
||||
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef IMPLEMENT_BOOK_DOM_TREES_LATER
|
||||
|
||||
static void
|
||||
append_account_tree (xmlNodePtr parent,
|
||||
Account* account,
|
||||
gboolean allow_incompat)
|
||||
{
|
||||
GList* children, *node;
|
||||
|
||||
children = gnc_account_get_children (account);
|
||||
children = g_list_sort (children, qof_instance_guid_compare);
|
||||
for (node = children; node; node = node->next)
|
||||
{
|
||||
xmlNodePtr accnode;
|
||||
Account* account;
|
||||
|
||||
account = node->data;
|
||||
accnode = gnc_account_dom_tree_create (account, FALSE, allow_incompat);
|
||||
xmlAddChild (parent, accnode);
|
||||
append_account_tree (accnode, account);
|
||||
}
|
||||
g_list_free (children);
|
||||
}
|
||||
|
||||
static int
|
||||
traverse_txns (Transaction* txn, gpointer data)
|
||||
{
|
||||
xmlNodePtr node;
|
||||
xmlNodePtr parent = data;
|
||||
|
||||
node = gnc_transaction_dom_tree_create (txn);
|
||||
xmlAddChild (parent, node);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
|
||||
xmlNodePtr
|
||||
gnc_book_dom_tree_create (QofBook* book)
|
||||
{
|
||||
@ -115,32 +76,6 @@ gnc_book_dom_tree_create (QofBook* book)
|
||||
xmlAddChild (ret, qof_instance_slots_to_dom_tree (book_slots_string,
|
||||
QOF_INSTANCE (book)));
|
||||
|
||||
#ifdef IMPLEMENT_BOOK_DOM_TREES_LATER
|
||||
/* theoretically, we should be adding all the below to the book
|
||||
* but in fact, there's enough brain damage in the code already
|
||||
* that we are only going to hand-edit the file at a higher layer.
|
||||
* And that's OK, since its probably a performance boost anyway.
|
||||
*/
|
||||
xmlAddChild (ret, gnc_commodity_dom_tree_create (
|
||||
gnc_commodity_table_get_table (book)));
|
||||
xmlAddChild (ret, gnc_pricedb_dom_tree_create (gnc_pricedb_get_db (book)));
|
||||
if (allow_incompat)
|
||||
{
|
||||
accnode = gnc_account_dom_tree_create (account, FALSE);
|
||||
xmlAddChild (ret, rootAccNode);
|
||||
}
|
||||
append_account_tree (ret, gnc_book_get_root (book));
|
||||
|
||||
xaccAccountTreeForEachTransaction (gnc_book_get_root_account (book),
|
||||
traverse_txns, ret);
|
||||
|
||||
/* xxx FIXME hack alert how are we going to handle
|
||||
* gnc_book_get_template_group handled ??? */
|
||||
xmlAddChild (ret, gnc_schedXaction_dom_tree_create (
|
||||
gnc_book_get_schedxactions (book)));
|
||||
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -981,31 +981,6 @@ write_book (FILE* out, QofBook* book, sixtp_gdv2* gd)
|
||||
{
|
||||
struct file_backend be_data;
|
||||
|
||||
#ifdef IMPLEMENT_BOOK_DOM_TREES_LATER
|
||||
/* We can't just blast out the dom tree, because the dom tree
|
||||
* doesn't have the books, transactions, etc underneath it.
|
||||
* But that is just as well, since I think the performance
|
||||
* will be much better if we write out as we go along
|
||||
*/
|
||||
xmlNodePtr node;
|
||||
|
||||
node = gnc_book_dom_tree_create (book);
|
||||
|
||||
if (!node)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xmlElemDump (out, NULL, node);
|
||||
xmlFreeNode (node);
|
||||
|
||||
if (ferror (out) || fprintf (out, "\n") < 0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
be_data.out = out;
|
||||
be_data.book = book;
|
||||
be_data.gd = gd;
|
||||
|
Loading…
Reference in New Issue
Block a user