gnucash maint: Remove unused ifdefs for IMPLEMENT_BOOK_DOM_TREES_LATER.
John Ralls
jralls at code.gnucash.org
Fri Jul 26 19:17:21 EDT 2019
Updated via https://github.com/Gnucash/gnucash/commit/456ab224 (commit)
from https://github.com/Gnucash/gnucash/commit/a0a0ffbb (commit)
commit 456ab2241f8e5532c1b6724fc43c77e06d32fab5
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jul 26 16:17:09 2019 -0700
Remove unused ifdefs for IMPLEMENT_BOOK_DOM_TREES_LATER.
Apparently stub code for a different way of generating the DOM tree, never implemented.
diff --git a/libgnucash/backend/xml/gnc-book-xml-v2.cpp b/libgnucash/backend/xml/gnc-book-xml-v2.cpp
index ed8416b9c..529eb2d93 100644
--- a/libgnucash/backend/xml/gnc-book-xml-v2.cpp
+++ b/libgnucash/backend/xml/gnc-book-xml-v2.cpp
@@ -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;
}
diff --git a/libgnucash/backend/xml/io-gncxml-v2.cpp b/libgnucash/backend/xml/io-gncxml-v2.cpp
index 3b2c0b35f..8f42abe84 100644
--- a/libgnucash/backend/xml/io-gncxml-v2.cpp
+++ b/libgnucash/backend/xml/io-gncxml-v2.cpp
@@ -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;
Summary of changes:
libgnucash/backend/xml/gnc-book-xml-v2.cpp | 65 ------------------------------
libgnucash/backend/xml/io-gncxml-v2.cpp | 25 ------------
2 files changed, 90 deletions(-)
More information about the gnucash-changes
mailing list