r18675 - gnucash/trunk/src - Re-indentation of source code, next batch.

Christian Stimming cstim at code.gnucash.org
Thu Feb 18 00:32:03 EST 2010


Author: cstim
Date: 2010-02-18 00:31:54 -0500 (Thu, 18 Feb 2010)
New Revision: 18675
Trac: http://svn.gnucash.org/trac/changeset/18675

Modified:
   gnucash/trunk/src/app-utils/gnc-druid-provider.h
   gnucash/trunk/src/app-utils/gnc-ui-util.c
   gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c
   gnucash/trunk/src/backend/dbi/gncmod-backend-dbi.c
   gnucash/trunk/src/backend/dbi/test/test-dbi-basic.c
   gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.c
   gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.h
   gnucash/trunk/src/backend/dbi/test/test-dbi.c
   gnucash/trunk/src/backend/dbi/test/test-load-backend.c
   gnucash/trunk/src/backend/sql/gnc-backend-sql.h
   gnucash/trunk/src/backend/sql/gnc-recurrence-sql.h
   gnucash/trunk/src/backend/sql/gnc-slots-sql.h
   gnucash/trunk/src/backend/sql/gnc-transaction-sql.h
   gnucash/trunk/src/backend/sql/test/test-column-types.c
   gnucash/trunk/src/backend/xml/gnc-backend-xml.c
   gnucash/trunk/src/backend/xml/gnc-book-xml-v2.c
   gnucash/trunk/src/backend/xml/io-gncxml-v2.c
   gnucash/trunk/src/bin/gnucash-bin.c
   gnucash/trunk/src/business/business-core/gncmod-business-core.c
   gnucash/trunk/src/business/business-core/sql/gncmod-business-backend-sql.c
   gnucash/trunk/src/business/business-core/xml/gncmod-business-backend-xml.c
   gnucash/trunk/src/business/business-gnome/gncmod-business-gnome.c
   gnucash/trunk/src/business/business-utils/gncmod-business-utils.c
   gnucash/trunk/src/business/dialog-tax-table/gncmod-dialog-tax-table.c
   gnucash/trunk/src/calculation/amort_opt.c
   gnucash/trunk/src/calculation/amort_prt.c
   gnucash/trunk/src/calculation/fin-interactive.c
   gnucash/trunk/src/calculation/fin.c
   gnucash/trunk/src/calculation/fin_spl_protos.h
   gnucash/trunk/src/calculation/numeric_ops.c
   gnucash/trunk/src/engine/AccountP.h
   gnucash/trunk/src/engine/FreqSpec.h
   gnucash/trunk/src/engine/GNCId.h
   gnucash/trunk/src/engine/Period.h
   gnucash/trunk/src/engine/Query.h
   gnucash/trunk/src/engine/QueryCore.h
   gnucash/trunk/src/engine/QueryNew.h
   gnucash/trunk/src/engine/QueryObject.h
   gnucash/trunk/src/engine/QueryP.h
   gnucash/trunk/src/engine/Recurrence.h
   gnucash/trunk/src/engine/SX-book.h
   gnucash/trunk/src/engine/SX-ttinfo.h
   gnucash/trunk/src/engine/SchedXaction.h
   gnucash/trunk/src/engine/Scrub.h
   gnucash/trunk/src/engine/Scrub2.h
   gnucash/trunk/src/engine/Scrub3.h
   gnucash/trunk/src/engine/ScrubP.h
   gnucash/trunk/src/engine/Split.h
   gnucash/trunk/src/engine/SplitP.h
   gnucash/trunk/src/engine/TransLog.c
   gnucash/trunk/src/engine/TransLog.h
   gnucash/trunk/src/engine/Transaction.h
   gnucash/trunk/src/engine/TransactionP.h
   gnucash/trunk/src/engine/binreloc.c
   gnucash/trunk/src/engine/binreloc.h
   gnucash/trunk/src/engine/cap-gains.h
   gnucash/trunk/src/engine/cashobjects.c
   gnucash/trunk/src/engine/cashobjects.h
   gnucash/trunk/src/engine/glib-helpers.h
   gnucash/trunk/src/engine/gnc-associate-account.h
   gnucash/trunk/src/engine/gnc-budget.h
   gnucash/trunk/src/engine/gnc-commodity.h
   gnucash/trunk/src/engine/gnc-engine.h
   gnucash/trunk/src/engine/gnc-event.h
   gnucash/trunk/src/engine/gnc-lot-p.h
   gnucash/trunk/src/engine/gnc-lot.h
   gnucash/trunk/src/engine/gnc-pricedb-p.h
   gnucash/trunk/src/engine/gnc-pricedb.h
   gnucash/trunk/src/engine/gnc-session-scm.h
   gnucash/trunk/src/engine/gncObject.h
   gnucash/trunk/src/engine/gncmod-engine.c
   gnucash/trunk/src/engine/policy-p.h
   gnucash/trunk/src/engine/policy.h
   gnucash/trunk/src/engine/test-core/gncmod-test-engine.c
   gnucash/trunk/src/engine/test-core/test-engine-strings.h
   gnucash/trunk/src/engine/test-core/test-engine-stuff.c
   gnucash/trunk/src/engine/test-core/test-engine-stuff.h
   gnucash/trunk/src/engine/test/test-account-object.c
   gnucash/trunk/src/engine/test/test-book-merge.c
   gnucash/trunk/src/engine/test/test-commodities.c
   gnucash/trunk/src/engine/test/test-date.c
   gnucash/trunk/src/engine/test/test-group-vs-book.c
   gnucash/trunk/src/engine/test/test-guid.c
   gnucash/trunk/src/engine/test/test-link.c
   gnucash/trunk/src/engine/test/test-load-engine.c
   gnucash/trunk/src/engine/test/test-lots.c
   gnucash/trunk/src/engine/test/test-numeric.c
   gnucash/trunk/src/engine/test/test-object.c
   gnucash/trunk/src/engine/test/test-period.c
   gnucash/trunk/src/engine/test/test-query.c
   gnucash/trunk/src/engine/test/test-querynew.c
   gnucash/trunk/src/engine/test/test-recurrence.c
   gnucash/trunk/src/engine/test/test-recursive.c
   gnucash/trunk/src/engine/test/test-resolve-file-path.c
   gnucash/trunk/src/engine/test/test-scm-query.c
   gnucash/trunk/src/engine/test/test-split-vs-account.c
   gnucash/trunk/src/engine/test/test-transaction-reversal.c
   gnucash/trunk/src/engine/test/test-transaction-voiding.c
   gnucash/trunk/src/gnome-search/dialog-search.c
   gnucash/trunk/src/gnome-search/dialog-search.h
   gnucash/trunk/src/gnome-search/gnc-general-search.c
   gnucash/trunk/src/gnome-search/gnc-general-search.h
   gnucash/trunk/src/gnome-search/gncmod-gnome-search.c
   gnucash/trunk/src/gnome-search/search-account.c
   gnucash/trunk/src/gnome-search/search-account.h
   gnucash/trunk/src/gnome-search/search-boolean.c
   gnucash/trunk/src/gnome-search/search-boolean.h
   gnucash/trunk/src/gnome-search/search-core-type.c
   gnucash/trunk/src/gnome-search/search-core-type.h
   gnucash/trunk/src/gnome-search/search-core-utils.c
   gnucash/trunk/src/gnome-search/search-core-utils.h
   gnucash/trunk/src/gnome-search/search-date.c
   gnucash/trunk/src/gnome-search/search-date.h
   gnucash/trunk/src/gnome-search/search-double.c
   gnucash/trunk/src/gnome-search/search-double.h
   gnucash/trunk/src/gnome-search/search-int64.c
   gnucash/trunk/src/gnome-search/search-int64.h
   gnucash/trunk/src/gnome-search/search-numeric.c
   gnucash/trunk/src/gnome-search/search-numeric.h
   gnucash/trunk/src/gnome-search/search-reconciled.c
   gnucash/trunk/src/gnome-search/search-reconciled.h
   gnucash/trunk/src/gnome-search/search-string.c
   gnucash/trunk/src/gnome-search/search-string.h
   gnucash/trunk/src/gnome-utils/gncmod-gnome-utils.c
   gnucash/trunk/src/html/gnc-html-extras.h
   gnucash/trunk/src/html/gnc-html-factory.c
   gnucash/trunk/src/html/gnc-html-graph-gog-gtkhtml.c
   gnucash/trunk/src/html/gnc-html-graph-gog-webkit.c
   gnucash/trunk/src/html/gnc-html-graph-gog.c
   gnucash/trunk/src/html/gnc-html-graph-gog.h
   gnucash/trunk/src/html/gnc-html-gtkhtml-p.h
   gnucash/trunk/src/html/gnc-html-gtkhtml.c
   gnucash/trunk/src/html/gnc-html-gtkhtml.h
   gnucash/trunk/src/html/gnc-html-history.c
   gnucash/trunk/src/html/gnc-html-history.h
   gnucash/trunk/src/html/gnc-html-p.h
   gnucash/trunk/src/html/gnc-html-webkit-p.h
   gnucash/trunk/src/html/gnc-html-webkit.c
   gnucash/trunk/src/html/gnc-html-webkit.h
   gnucash/trunk/src/html/gnc-html.c
   gnucash/trunk/src/html/gnc-html.h
   gnucash/trunk/src/html/gncmod-html.c
   gnucash/trunk/src/import-export/aqbanking/dialog-ab-trans.c
   gnucash/trunk/src/import-export/aqbanking/dialog-ab-trans.h
   gnucash/trunk/src/import-export/aqbanking/dialog-daterange.c
   gnucash/trunk/src/import-export/aqbanking/druid-ab-initial.c
   gnucash/trunk/src/import-export/aqbanking/gnc-ab-getbalance.c
   gnucash/trunk/src/import-export/aqbanking/gnc-ab-gettrans.c
   gnucash/trunk/src/import-export/aqbanking/gnc-ab-kvp.c
   gnucash/trunk/src/import-export/aqbanking/gnc-ab-trans-templ.c
   gnucash/trunk/src/import-export/aqbanking/gnc-ab-trans-templ.h
   gnucash/trunk/src/import-export/aqbanking/gnc-ab-transfer.c
   gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.c
   gnucash/trunk/src/import-export/aqbanking/gnc-file-aqb-import.c
   gnucash/trunk/src/import-export/aqbanking/gnc-gwen-gui.c
   gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.c
   gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.h
   gnucash/trunk/src/import-export/aqbanking/gncmod-aqbanking.c
   gnucash/trunk/src/import-export/binary-import/druid-commodity.c
   gnucash/trunk/src/import-export/binary-import/gncmod-binary-import.c
   gnucash/trunk/src/import-export/binary-import/test/test-link-module.c
   gnucash/trunk/src/import-export/csv/gnc-csv-gnumeric-popup.c
   gnucash/trunk/src/import-export/csv/gnc-csv-gnumeric-popup.h
   gnucash/trunk/src/import-export/csv/gnc-csv-import.c
   gnucash/trunk/src/import-export/csv/gnc-csv-import.h
   gnucash/trunk/src/import-export/csv/gnc-csv-model.c
   gnucash/trunk/src/import-export/csv/gnc-csv-model.h
   gnucash/trunk/src/import-export/csv/gnc-plugin-csv.c
   gnucash/trunk/src/import-export/csv/gnc-plugin-csv.h
   gnucash/trunk/src/import-export/csv/gncmod-csv-import.c
   gnucash/trunk/src/import-export/gnc-import-desc-format.c
   gnucash/trunk/src/import-export/gnc-import-desc-format.h
   gnucash/trunk/src/import-export/gnc-import-format-cb.c
   gnucash/trunk/src/import-export/gnc-import-format-cb.h
   gnucash/trunk/src/import-export/gnc-import-format-gnome.c
   gnucash/trunk/src/import-export/gnc-import-format-gnome.h
   gnucash/trunk/src/import-export/gncmod-generic-import.c
   gnucash/trunk/src/import-export/hbci/dialog-daterange.c
   gnucash/trunk/src/import-export/hbci/dialog-daterange.h
   gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c
   gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.h
   gnucash/trunk/src/import-export/hbci/dialog-pass.c
   gnucash/trunk/src/import-export/hbci/dialog-pass.h
   gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c
   gnucash/trunk/src/import-export/hbci/druid-hbci-utils.c
   gnucash/trunk/src/import-export/hbci/druid-hbci-utils.h
   gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.c
   gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.h
   gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c
   gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.h
   gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c
   gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.h
   gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.c
   gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.c
   gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.h
   gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.c
   gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.h
   gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c
   gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.h
   gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.c
   gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.h
   gnucash/trunk/src/import-export/hbci/gncmod-hbci.c
   gnucash/trunk/src/import-export/hbci/hbci-interaction.c
   gnucash/trunk/src/import-export/hbci/hbci-interactionP.h
   gnucash/trunk/src/import-export/hbci/test/test-link-module.c
   gnucash/trunk/src/import-export/import-account-matcher.c
   gnucash/trunk/src/import-export/import-account-matcher.h
   gnucash/trunk/src/import-export/import-backend.c
   gnucash/trunk/src/import-export/import-backend.h
   gnucash/trunk/src/import-export/import-commodity-matcher.c
   gnucash/trunk/src/import-export/import-commodity-matcher.h
   gnucash/trunk/src/import-export/import-format-dialog.c
   gnucash/trunk/src/import-export/import-main-matcher.c
   gnucash/trunk/src/import-export/import-main-matcher.h
   gnucash/trunk/src/import-export/import-match-map.c
   gnucash/trunk/src/import-export/import-match-map.h
   gnucash/trunk/src/import-export/import-match-picker.c
   gnucash/trunk/src/import-export/import-match-picker.h
   gnucash/trunk/src/import-export/import-parse.c
   gnucash/trunk/src/import-export/import-parse.h
   gnucash/trunk/src/import-export/import-settings.c
   gnucash/trunk/src/import-export/import-settings.h
   gnucash/trunk/src/import-export/import-utilities.c
   gnucash/trunk/src/import-export/import-utilities.h
   gnucash/trunk/src/import-export/log-replay/gnc-log-replay.c
   gnucash/trunk/src/import-export/log-replay/gnc-log-replay.h
   gnucash/trunk/src/import-export/log-replay/gnc-plugin-log-replay.c
   gnucash/trunk/src/import-export/log-replay/gnc-plugin-log-replay.h
   gnucash/trunk/src/import-export/log-replay/gncmod-log-replay.c
   gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c
   gnucash/trunk/src/import-export/ofx/gnc-ofx-import.h
   gnucash/trunk/src/import-export/ofx/gnc-plugin-ofx.c
   gnucash/trunk/src/import-export/ofx/gnc-plugin-ofx.h
   gnucash/trunk/src/import-export/ofx/gncmod-ofx-import.c
   gnucash/trunk/src/import-export/ofx/test/test-link.c
   gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c
   gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
   gnucash/trunk/src/import-export/qif-import/gnc-druid-test.c
   gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c
   gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.h
   gnucash/trunk/src/import-export/qif-import/gncmod-qif-import.c
   gnucash/trunk/src/import-export/qif-import/test/test-link.c
   gnucash/trunk/src/import-export/qif-io-core/gncmod-qifiocore.c
   gnucash/trunk/src/import-export/qif/qif-context.c
   gnucash/trunk/src/import-export/qif/qif-defaults.c
   gnucash/trunk/src/import-export/qif/qif-file.c
   gnucash/trunk/src/import-export/qif/qif-file.h
   gnucash/trunk/src/import-export/qif/qif-import-p.h
   gnucash/trunk/src/import-export/qif/qif-import.h
   gnucash/trunk/src/import-export/qif/qif-objects-p.h
   gnucash/trunk/src/import-export/qif/qif-objects.c
   gnucash/trunk/src/import-export/qif/qif-objects.h
   gnucash/trunk/src/import-export/qif/qif-parse.c
   gnucash/trunk/src/import-export/qif/qif-parse.h
   gnucash/trunk/src/import-export/qif/test/test-link.c
   gnucash/trunk/src/import-export/qif/test/test-qif.c
   gnucash/trunk/src/import-export/test/test-import-parse.c
   gnucash/trunk/src/import-export/test/test-link.c
   gnucash/trunk/src/libqof/backend/file/qsf-xml-map.c
   gnucash/trunk/src/libqof/backend/file/qsf-xml.h
   gnucash/trunk/src/libqof/qof/gnc-date.c
   gnucash/trunk/src/libqof/qof/gnc-numeric.c
   gnucash/trunk/src/libqof/qof/guid.c
   gnucash/trunk/src/libqof/qof/kvp_frame.h
   gnucash/trunk/src/libqof/qof/qofbackend.c
   gnucash/trunk/src/libqof/qof/qofbook.c
   gnucash/trunk/src/libqof/qof/qofbookmerge.c
   gnucash/trunk/src/libqof/qof/qofquerycore.c
   gnucash/trunk/src/register/ledger-core/gncmod-ledger-core.c
   gnucash/trunk/src/register/ledger-core/test/test-link-module.c
   gnucash/trunk/src/register/register-core/gncmod-register-core.c
   gnucash/trunk/src/register/register-gnome/gncmod-register-gnome.c
   gnucash/trunk/src/report/locale-specific/us/gncmod-locale-reports-us.c
   gnucash/trunk/src/report/locale-specific/us/test/test-link-module.c
   gnucash/trunk/src/report/report-gnome/dialog-column-view.c
   gnucash/trunk/src/report/report-gnome/dialog-custom-report.c
   gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c
   gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c
   gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.h
   gnucash/trunk/src/report/report-gnome/gncmod-report-gnome.c
   gnucash/trunk/src/report/report-gnome/test/test-link-module.c
   gnucash/trunk/src/report/report-gnome/window-report.c
   gnucash/trunk/src/report/report-gnome/window-report.h
   gnucash/trunk/src/report/report-system/gnc-report.c
   gnucash/trunk/src/report/report-system/gncmod-report-system.c
   gnucash/trunk/src/report/report-system/test/test-link-module.c
   gnucash/trunk/src/report/standard-reports/gncmod-standard-reports.c
   gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.c
   gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.h
   gnucash/trunk/src/report/stylesheets/gncmod-stylesheets.c
   gnucash/trunk/src/report/utility-reports/gncmod-utility-reports.c
Log:
Re-indentation of source code, next batch.

This also strips trailing whitespaces from lines where they existed.
This re-indentation was done using astyle-1.24 using the following options:

astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header

Discussed at http://lists.gnucash.org/pipermail/gnucash-devel/2009-August/026121.html

Modified: gnucash/trunk/src/app-utils/gnc-druid-provider.h
===================================================================
--- gnucash/trunk/src/app-utils/gnc-druid-provider.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/app-utils/gnc-druid-provider.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -73,7 +73,7 @@
 
 typedef GNCDruidProvider* (*GNCDruidProviderNew)(GNCDruid*, GNCDruidProviderDesc*);
 void	gnc_druid_provider_register(const gchar* ui_type, const gchar* name,
-                                 GNCDruidProviderNew new_provider);
+                                    GNCDruidProviderNew new_provider);
 
 /* methods */
 

Modified: gnucash/trunk/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -206,7 +206,7 @@
 void
 gnc_set_current_book_tax_name (const gchar *tax_name)
 {
-	qof_book_set_string_option(gnc_get_current_book(), OPTION_TAXUS_NAME, tax_name);
+    qof_book_set_string_option(gnc_get_current_book(), OPTION_TAXUS_NAME, tax_name);
 }
 
 const gchar *

Modified: gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c
===================================================================
--- gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -19,7 +19,7 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 \********************************************************************/
 /** @file gnc-backend-dbi.c
- *  @brief load and save data to SQL 
+ *  @brief load and save data to SQL
  *  @author Copyright (c) 2006-2008 Phil Longstaff <plongstaff at rogers.com>
  *
  * This file implements the top-level QofBackend API for saving/
@@ -68,50 +68,51 @@
 #define PGSQL_DEFAULT_PORT 5432
 
 typedef gchar* (*CREATE_TABLE_DDL_FN)( GncSqlConnection* conn,
-								const gchar* table_name,
-								const GList* col_info_list );
+                                       const gchar* table_name,
+                                       const GList* col_info_list );
 typedef GSList* (*GET_TABLE_LIST_FN)( dbi_conn conn, const gchar* dbname );
-typedef struct {
-	CREATE_TABLE_DDL_FN		create_table_ddl;
-	GET_TABLE_LIST_FN		get_table_list;
+typedef struct
+{
+    CREATE_TABLE_DDL_FN		create_table_ddl;
+    GET_TABLE_LIST_FN		get_table_list;
 } provider_functions_t;
 
 static /*@ null @*/ gchar* conn_create_table_ddl_sqlite3( GncSqlConnection* conn,
-										const gchar* table_name,
-										const GList* col_info_list );
+        const gchar* table_name,
+        const GList* col_info_list );
 static GSList* conn_get_table_list( dbi_conn conn, const gchar* dbname );
 static provider_functions_t provider_sqlite3 =
 {
-	conn_create_table_ddl_sqlite3,
-	conn_get_table_list
+    conn_create_table_ddl_sqlite3,
+    conn_get_table_list
 };
 #define SQLITE3_TIMESPEC_STR_FORMAT "%04d%02d%02d%02d%02d%02d"
 
 static /*@ null @*/ gchar* conn_create_table_ddl_mysql( GncSqlConnection* conn,
-										const gchar* table_name,
-										const GList* col_info_list );
+        const gchar* table_name,
+        const GList* col_info_list );
 static provider_functions_t provider_mysql =
 {
-	conn_create_table_ddl_mysql,
-	conn_get_table_list
+    conn_create_table_ddl_mysql,
+    conn_get_table_list
 };
 #define MYSQL_TIMESPEC_STR_FORMAT "%04d%02d%02d%02d%02d%02d"
 
 static /*@ null @*/ gchar* conn_create_table_ddl_pgsql( GncSqlConnection* conn,
-										const gchar* table_name,
-										const GList* col_info_list );
+        const gchar* table_name,
+        const GList* col_info_list );
 static GSList* conn_get_table_list_pgsql( dbi_conn conn, const gchar* dbname );
 static provider_functions_t provider_pgsql =
 {
-	conn_create_table_ddl_pgsql,
-	conn_get_table_list_pgsql
+    conn_create_table_ddl_pgsql,
+    conn_get_table_list_pgsql
 };
 #define PGSQL_TIMESPEC_STR_FORMAT "%04d%02d%02d %02d%02d%02d"
 
 static /*@ null @*/ gchar* create_index_ddl( GncSqlConnection* conn,
-											const gchar* index_name,
-											const gchar* table_name,
-											const GncSqlColumnTableEntry* col_table );
+        const gchar* index_name,
+        const gchar* table_name,
+        const GncSqlColumnTableEntry* col_table );
 static GncSqlConnection* create_dbi_connection( /*@ observer @*/ provider_functions_t* provider, /*@ observer @*/ QofBackend* qbe, /*@ observer @*/ dbi_conn conn );
 
 #define GNC_DBI_PROVIDER_SQLITE (&provider_sqlite3)
@@ -120,30 +121,34 @@
 
 struct GncDbiBackend_struct
 {
-  GncSqlBackend sql_be;
+    GncSqlBackend sql_be;
 
-  dbi_conn conn;
+    dbi_conn conn;
 
-  /*@ dependent @*/ QofBook *primary_book;	/* The primary, main open book */
-  gboolean	loading;		/* We are performing an initial load */
-  gboolean  in_query;
-  gboolean  supports_transactions;
-  gboolean  is_pristine_db;	// Are we saving to a new pristine db?
-  gboolean  exists;         // Does the database exist?
+    /*@ dependent @*/
+    QofBook *primary_book;	/* The primary, main open book */
+    gboolean	loading;		/* We are performing an initial load */
+    gboolean  in_query;
+    gboolean  supports_transactions;
+    gboolean  is_pristine_db;	// Are we saving to a new pristine db?
+    gboolean  exists;         // Does the database exist?
 
-  gint obj_total;			// Total # of objects (for percentage calculation)
-  gint operations_done;		// Number of operations (save/load) done
+    gint obj_total;			// Total # of objects (for percentage calculation)
+    gint operations_done;		// Number of operations (save/load) done
 //  GHashTable* versions;		// Version number for each table
 };
 typedef struct GncDbiBackend_struct GncDbiBackend;
 
 typedef struct
 {
-	GncSqlConnection base;
+    GncSqlConnection base;
 
-	/*@ observer @*/ QofBackend* qbe;
-	/*@ observer @*/ dbi_conn conn;
-	/*@ observer @*/ provider_functions_t* provider;
+    /*@ observer @*/
+    QofBackend* qbe;
+    /*@ observer @*/
+    dbi_conn conn;
+    /*@ observer @*/
+    provider_functions_t* provider;
 } GncDbiSqlConnection;
 
 /* ================================================================= */
@@ -157,7 +162,8 @@
     g_return_if_fail( type != NULL && data_p != NULL && be_p != NULL );
     g_return_if_fail( pData->version == GNC_SQL_BACKEND_VERSION );
 
-    if( pData->create_tables != NULL ) {
+    if ( pData->create_tables != NULL )
+    {
         (pData->create_tables)( &be->sql_be );
     }
 }
@@ -166,94 +172,104 @@
 sqlite3_error_fn( dbi_conn conn, /*@ unused @*/ void* user_data )
 {
     //GncDbiBackend *be = (GncDbiBackend*)user_data;
-	const gchar* msg;
+    const gchar* msg;
 
-	(void)dbi_conn_error( conn, &msg );
-	PERR( "DBI error: %s\n", msg );
+    (void)dbi_conn_error( conn, &msg );
+    PERR( "DBI error: %s\n", msg );
 }
 
 static void
-gnc_dbi_sqlite3_session_begin( QofBackend *qbe, QofSession *session, 
-	                   const gchar *book_id,
-                       /*@ unused @*/ gboolean ignore_lock,
-				       gboolean create_if_nonexistent )
+gnc_dbi_sqlite3_session_begin( QofBackend *qbe, QofSession *session,
+                               const gchar *book_id,
+                               /*@ unused @*/ gboolean ignore_lock,
+                               gboolean create_if_nonexistent )
 {
     GncDbiBackend *be = (GncDbiBackend*)qbe;
-	gint result;
-	gchar* dirname;
-	gchar* basename;
+    gint result;
+    gchar* dirname;
+    gchar* basename;
 
-	g_return_if_fail( qbe != NULL );
-	g_return_if_fail( session != NULL );
-	g_return_if_fail( book_id != NULL );
+    g_return_if_fail( qbe != NULL );
+    g_return_if_fail( session != NULL );
+    g_return_if_fail( book_id != NULL );
 
     ENTER (" ");
 
-	/* Remove uri type if present */
-	if( g_str_has_prefix( book_id, FILE_URI_PREFIX ) ) {
-		book_id += strlen( FILE_URI_PREFIX );
-	}
-	if( g_str_has_prefix( book_id, SQLITE3_URI_PREFIX ) ) {
-		book_id += strlen( SQLITE3_URI_PREFIX );
-	}
+    /* Remove uri type if present */
+    if ( g_str_has_prefix( book_id, FILE_URI_PREFIX ) )
+    {
+        book_id += strlen( FILE_URI_PREFIX );
+    }
+    if ( g_str_has_prefix( book_id, SQLITE3_URI_PREFIX ) )
+    {
+        book_id += strlen( SQLITE3_URI_PREFIX );
+    }
 
-	if( !create_if_nonexistent
-		&& !g_file_test( book_id, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_EXISTS ) ) {
-		qof_backend_set_error( qbe, ERR_FILEIO_FILE_NOT_FOUND );
-		LEAVE(" ");
-		return;
-	}
+    if ( !create_if_nonexistent
+            && !g_file_test( book_id, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_EXISTS ) )
+    {
+        qof_backend_set_error( qbe, ERR_FILEIO_FILE_NOT_FOUND );
+        LEAVE(" ");
+        return;
+    }
 
-	if( be->conn != NULL ) {
-		dbi_conn_close( be->conn );
-	}
-	be->conn = dbi_conn_new( "sqlite3" );
-	if( be->conn == NULL ) {
-		PERR( "Unable to create sqlite3 dbi connection\n" );
+    if ( be->conn != NULL )
+    {
+        dbi_conn_close( be->conn );
+    }
+    be->conn = dbi_conn_new( "sqlite3" );
+    if ( be->conn == NULL )
+    {
+        PERR( "Unable to create sqlite3 dbi connection\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_BAD_URL );
-		LEAVE( " " );
-		return;
-	}
+        LEAVE( " " );
+        return;
+    }
 
-	dirname = g_path_get_dirname( book_id );
-	basename = g_path_get_basename( book_id );
-	dbi_conn_error_handler( be->conn, sqlite3_error_fn, be );
-	result = dbi_conn_set_option( be->conn, "host", "localhost" );
-	if( result < 0 ) {
-		PERR( "Error setting 'host' option\n" );
+    dirname = g_path_get_dirname( book_id );
+    basename = g_path_get_basename( book_id );
+    dbi_conn_error_handler( be->conn, sqlite3_error_fn, be );
+    result = dbi_conn_set_option( be->conn, "host", "localhost" );
+    if ( result < 0 )
+    {
+        PERR( "Error setting 'host' option\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
         LEAVE( " " );
         return;
-	}
-	result = dbi_conn_set_option( be->conn, "dbname", basename );
-	if( result < 0 ) {
-		PERR( "Error setting 'dbname' option\n" );
+    }
+    result = dbi_conn_set_option( be->conn, "dbname", basename );
+    if ( result < 0 )
+    {
+        PERR( "Error setting 'dbname' option\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
         LEAVE( " " );
         return;
-	}
-	result = dbi_conn_set_option( be->conn, "sqlite3_dbdir", dirname );
-	if( result < 0 ) {
-		PERR( "Error setting 'sqlite3_dbdir' option\n" );
+    }
+    result = dbi_conn_set_option( be->conn, "sqlite3_dbdir", dirname );
+    if ( result < 0 )
+    {
+        PERR( "Error setting 'sqlite3_dbdir' option\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
         LEAVE( " " );
         return;
-	}
-	result = dbi_conn_connect( be->conn );
-	g_free( basename );
-	g_free( dirname );
-	if( result < 0 ) {
-		PERR( "Unable to connect to %s: %d\n", book_id, result );
+    }
+    result = dbi_conn_connect( be->conn );
+    g_free( basename );
+    g_free( dirname );
+    if ( result < 0 )
+    {
+        PERR( "Unable to connect to %s: %d\n", book_id, result );
         qof_backend_set_error( qbe, ERR_BACKEND_BAD_URL );
         LEAVE( " " );
         return;
-	}
+    }
 
-	if( be->sql_be.conn != NULL ) {
-		gnc_sql_connection_dispose( be->sql_be.conn );
-	}
-	be->sql_be.conn = create_dbi_connection( GNC_DBI_PROVIDER_SQLITE, qbe, be->conn );
-	be->sql_be.timespec_format = SQLITE3_TIMESPEC_STR_FORMAT;
+    if ( be->sql_be.conn != NULL )
+    {
+        gnc_sql_connection_dispose( be->sql_be.conn );
+    }
+    be->sql_be.conn = create_dbi_connection( GNC_DBI_PROVIDER_SQLITE, qbe, be->conn );
+    be->sql_be.timespec_format = SQLITE3_TIMESPEC_STR_FORMAT;
 
     LEAVE (" ");
 }
@@ -262,15 +278,18 @@
 mysql_error_fn( dbi_conn conn, void* user_data )
 {
     GncDbiBackend *be = (GncDbiBackend*)user_data;
-	const gchar* msg;
+    const gchar* msg;
 
-	(void)dbi_conn_error( conn, &msg );
-	if( g_str_has_prefix( msg, "1049: Unknown database" ) ) {
-		PINFO( "DBI error: %s\n", msg );
-		be->exists = FALSE;
-	} else {
-		PERR( "DBI error: %s\n", msg );
-	}
+    (void)dbi_conn_error( conn, &msg );
+    if ( g_str_has_prefix( msg, "1049: Unknown database" ) )
+    {
+        PINFO( "DBI error: %s\n", msg );
+        be->exists = FALSE;
+    }
+    else
+    {
+        PERR( "DBI error: %s\n", msg );
+    }
 }
 
 /**
@@ -287,175 +306,203 @@
  */
 static gboolean
 set_standard_connection_options( QofBackend* qbe, dbi_conn conn, const gchar* host, int port,
-						const gchar* dbname, const gchar* username, const gchar* password )
+                                 const gchar* dbname, const gchar* username, const gchar* password )
 {
-	gint result;
+    gint result;
 
-	result = dbi_conn_set_option( conn, "host", host );
-	if( result < 0 ) {
-		PERR( "Error setting 'host' option\n" );
+    result = dbi_conn_set_option( conn, "host", host );
+    if ( result < 0 )
+    {
+        PERR( "Error setting 'host' option\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-		return FALSE;
-	}
-	result = dbi_conn_set_option_numeric( conn, "port", port );
-	if( result < 0 ) {
-		PERR( "Error setting 'port' option\n" );
+        return FALSE;
+    }
+    result = dbi_conn_set_option_numeric( conn, "port", port );
+    if ( result < 0 )
+    {
+        PERR( "Error setting 'port' option\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-		return FALSE;
-	}
-	result = dbi_conn_set_option( conn, "dbname", dbname );
-	if( result < 0 ) {
-		PERR( "Error setting 'dbname' option\n" );
+        return FALSE;
+    }
+    result = dbi_conn_set_option( conn, "dbname", dbname );
+    if ( result < 0 )
+    {
+        PERR( "Error setting 'dbname' option\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-		return FALSE;
-	}
-	result = dbi_conn_set_option( conn, "username", username );
-	if( result < 0 ) {
-		PERR( "Error setting 'username' option\n" );
+        return FALSE;
+    }
+    result = dbi_conn_set_option( conn, "username", username );
+    if ( result < 0 )
+    {
+        PERR( "Error setting 'username' option\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-		return FALSE;
-	}
-	result = dbi_conn_set_option( conn, "password", password );
-	if( result < 0 ) {
-		PERR( "Error setting 'password' option\n" );
+        return FALSE;
+    }
+    result = dbi_conn_set_option( conn, "password", password );
+    if ( result < 0 )
+    {
+        PERR( "Error setting 'password' option\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-		return FALSE;
-	}
+        return FALSE;
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 static void
-gnc_dbi_mysql_session_begin( QofBackend* qbe, QofSession *session, 
-	                   const gchar *book_id,
-                       /*@ unused @*/gboolean ignore_lock,
-				       gboolean create_if_nonexistent )
+gnc_dbi_mysql_session_begin( QofBackend* qbe, QofSession *session,
+                             const gchar *book_id,
+                             /*@ unused @*/gboolean ignore_lock,
+                             gboolean create_if_nonexistent )
 {
     GncDbiBackend *be = (GncDbiBackend*)qbe;
-	gchar* dsn = NULL;
-	gchar* host;
-	gchar* port = NULL;
-	gchar* dbname;
+    gchar* dsn = NULL;
+    gchar* host;
+    gchar* port = NULL;
+    gchar* dbname;
     gchar* username;
     gchar* password;
-	gint portnum;
-	gint result;
-	gboolean success = FALSE;
+    gint portnum;
+    gint result;
+    gboolean success = FALSE;
 
-	g_return_if_fail( qbe != NULL );
-	g_return_if_fail( session != NULL );
-	g_return_if_fail( book_id != NULL );
+    g_return_if_fail( qbe != NULL );
+    g_return_if_fail( session != NULL );
+    g_return_if_fail( book_id != NULL );
 
     ENTER (" ");
 
-	/* Split the book-id (format host:dbname:username:password or
-	   host:port:dbname:username:password) */
-	dsn = g_strdup( book_id );
-	for( host = dsn; *host != '/'; host++ ) {}
-	host += 2;
-	for( dbname = host; *dbname != ':'; dbname++ ) {}
-	*dbname++ = '\0';
-	if( *dbname >= '0' && *dbname <= '9' ) {
-	    port = dbname;
-	    for( ; *dbname != ':'; dbname++ ) {}
-		*dbname++ = '\0';
-	}
-	for( username = dbname; *username != ':'; username++ ) {}
-	*username++ = '\0';
-	for( password = username; *password != ':'; password++ ) {}
-	*password++ = '\0';
+    /* Split the book-id (format host:dbname:username:password or
+       host:port:dbname:username:password) */
+    dsn = g_strdup( book_id );
+    for ( host = dsn; *host != '/'; host++ ) {}
+    host += 2;
+    for ( dbname = host; *dbname != ':'; dbname++ ) {}
+    *dbname++ = '\0';
+    if ( *dbname >= '0' && *dbname <= '9' )
+    {
+        port = dbname;
+        for ( ; *dbname != ':'; dbname++ ) {}
+        *dbname++ = '\0';
+    }
+    for ( username = dbname; *username != ':'; username++ ) {}
+    *username++ = '\0';
+    for ( password = username; *password != ':'; password++ ) {}
+    *password++ = '\0';
 
-	if( port != NULL && *port != '\0' ) {
-		portnum = atoi( port );
-	} else {
-		portnum = 0;
-	}
+    if ( port != NULL && *port != '\0' )
+    {
+        portnum = atoi( port );
+    }
+    else
+    {
+        portnum = 0;
+    }
 
-	// Try to connect to the db.  If it doesn't exist and the create_if_nonexistent
-	// flag is TRUE, we'll need to connect to the 'mysql' db and execute the
-	// CREATE DATABASE ddl statement there.
-	if( be->conn != NULL ) {
-		dbi_conn_close( be->conn );
-	}
-	be->conn = dbi_conn_new( "mysql" );
-	if( be->conn == NULL ) {
-		PERR( "Unable to create mysql dbi connection\n" );
+    // Try to connect to the db.  If it doesn't exist and the create_if_nonexistent
+    // flag is TRUE, we'll need to connect to the 'mysql' db and execute the
+    // CREATE DATABASE ddl statement there.
+    if ( be->conn != NULL )
+    {
+        dbi_conn_close( be->conn );
+    }
+    be->conn = dbi_conn_new( "mysql" );
+    if ( be->conn == NULL )
+    {
+        PERR( "Unable to create mysql dbi connection\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_BAD_URL );
-		goto exit;
-	}
-	dbi_conn_error_handler( be->conn, mysql_error_fn, be );
-	if( !set_standard_connection_options( qbe, be->conn, host, portnum, dbname, username, password ) ) {
-		goto exit;
-	}
-	be->exists = TRUE;
-	result = dbi_conn_connect( be->conn );
-	if( result == 0 ) {
-		success = TRUE;
-	} else {
+        goto exit;
+    }
+    dbi_conn_error_handler( be->conn, mysql_error_fn, be );
+    if ( !set_standard_connection_options( qbe, be->conn, host, portnum, dbname, username, password ) )
+    {
+        goto exit;
+    }
+    be->exists = TRUE;
+    result = dbi_conn_connect( be->conn );
+    if ( result == 0 )
+    {
+        success = TRUE;
+    }
+    else
+    {
 
-		if( be->exists ) {
-			PERR( "Unable to connect to database '%s'\n", dbname );
-        	qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-			goto exit;
-		}
+        if ( be->exists )
+        {
+            PERR( "Unable to connect to database '%s'\n", dbname );
+            qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+            goto exit;
+        }
 
-		// The db does not already exist.  Connect to the 'mysql' db and try to create it.
-		if( create_if_nonexistent ) {
-			dbi_result dresult;
-			result = dbi_conn_set_option( be->conn, "dbname", "mysql" );
-			if( result < 0 ) {
-				PERR( "Error setting 'dbname' option\n" );
-        		qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-				goto exit;
-			}
-			result = dbi_conn_connect( be->conn );
-			if( result < 0 ) {
-				PERR( "Unable to connect to 'mysql' database\n" );
-        		qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-				goto exit;
-			}
-			dresult = dbi_conn_queryf( be->conn, "CREATE DATABASE %s CHARACTER SET utf8", dbname );
-			if( dresult == NULL ) {
-				PERR( "Unable to create database '%s'\n", dbname );
-        		qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-				goto exit;
-			}
-    		dbi_conn_close( be->conn );
+        // The db does not already exist.  Connect to the 'mysql' db and try to create it.
+        if ( create_if_nonexistent )
+        {
+            dbi_result dresult;
+            result = dbi_conn_set_option( be->conn, "dbname", "mysql" );
+            if ( result < 0 )
+            {
+                PERR( "Error setting 'dbname' option\n" );
+                qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+                goto exit;
+            }
+            result = dbi_conn_connect( be->conn );
+            if ( result < 0 )
+            {
+                PERR( "Unable to connect to 'mysql' database\n" );
+                qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+                goto exit;
+            }
+            dresult = dbi_conn_queryf( be->conn, "CREATE DATABASE %s CHARACTER SET utf8", dbname );
+            if ( dresult == NULL )
+            {
+                PERR( "Unable to create database '%s'\n", dbname );
+                qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+                goto exit;
+            }
+            dbi_conn_close( be->conn );
 
-			// Try again to connect to the db
-			be->conn = dbi_conn_new( "mysql" );
-			if( be->conn == NULL ) {
-				PERR( "Unable to create mysql dbi connection\n" );
-        		qof_backend_set_error( qbe, ERR_BACKEND_BAD_URL );
-				goto exit;
-			}
-			dbi_conn_error_handler( be->conn, mysql_error_fn, be );
-			if( !set_standard_connection_options( qbe, be->conn, host, 0, dbname, username, password ) ) {
-				goto exit;
-			}
-			result = dbi_conn_connect( be->conn );
-			if( result < 0 ) {
-				PERR( "Unable to create database '%s'\n", dbname );
-        		qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-				goto exit;
-			}
-			success = TRUE;
-		} else {
-        	qof_backend_set_error( qbe, ERR_BACKEND_NO_SUCH_DB );
-		}
-	}
+            // Try again to connect to the db
+            be->conn = dbi_conn_new( "mysql" );
+            if ( be->conn == NULL )
+            {
+                PERR( "Unable to create mysql dbi connection\n" );
+                qof_backend_set_error( qbe, ERR_BACKEND_BAD_URL );
+                goto exit;
+            }
+            dbi_conn_error_handler( be->conn, mysql_error_fn, be );
+            if ( !set_standard_connection_options( qbe, be->conn, host, 0, dbname, username, password ) )
+            {
+                goto exit;
+            }
+            result = dbi_conn_connect( be->conn );
+            if ( result < 0 )
+            {
+                PERR( "Unable to create database '%s'\n", dbname );
+                qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+                goto exit;
+            }
+            success = TRUE;
+        }
+        else
+        {
+            qof_backend_set_error( qbe, ERR_BACKEND_NO_SUCH_DB );
+        }
+    }
 
-	if( success ) {
-		if( be->sql_be.conn != NULL ) {
-			gnc_sql_connection_dispose( be->sql_be.conn );
-		}
-		be->sql_be.conn = create_dbi_connection( GNC_DBI_PROVIDER_MYSQL, qbe, be->conn );
-	}
-	be->sql_be.timespec_format = MYSQL_TIMESPEC_STR_FORMAT;
+    if ( success )
+    {
+        if ( be->sql_be.conn != NULL )
+        {
+            gnc_sql_connection_dispose( be->sql_be.conn );
+        }
+        be->sql_be.conn = create_dbi_connection( GNC_DBI_PROVIDER_MYSQL, qbe, be->conn );
+    }
+    be->sql_be.timespec_format = MYSQL_TIMESPEC_STR_FORMAT;
 exit:
-	if( dsn != NULL ) {
-		g_free( dsn );
-	}
+    if ( dsn != NULL )
+    {
+        g_free( dsn );
+    }
 
     LEAVE (" ");
 }
@@ -464,149 +511,175 @@
 pgsql_error_fn( dbi_conn conn, void* user_data )
 {
     GncDbiBackend *be = (GncDbiBackend*)user_data;
-	const gchar* msg;
+    const gchar* msg;
 
-	(void)dbi_conn_error( conn, &msg );
-	if( g_str_has_prefix( msg, "FATAL:  database" ) &&
-			g_str_has_suffix( msg, "does not exist\n" ) ) {
-		PINFO( "DBI error: %s\n", msg );
-		be->exists = FALSE;
-	} else {
-		PERR( "DBI error: %s\n", msg );
-	}
+    (void)dbi_conn_error( conn, &msg );
+    if ( g_str_has_prefix( msg, "FATAL:  database" ) &&
+            g_str_has_suffix( msg, "does not exist\n" ) )
+    {
+        PINFO( "DBI error: %s\n", msg );
+        be->exists = FALSE;
+    }
+    else
+    {
+        PERR( "DBI error: %s\n", msg );
+    }
 }
 
 static void
-gnc_dbi_postgres_session_begin( QofBackend *qbe, QofSession *session, 
-	                   const gchar *book_id,
-                       /*@ unused @*/ gboolean ignore_lock,
-				       gboolean create_if_nonexistent )
+gnc_dbi_postgres_session_begin( QofBackend *qbe, QofSession *session,
+                                const gchar *book_id,
+                                /*@ unused @*/ gboolean ignore_lock,
+                                gboolean create_if_nonexistent )
 {
     GncDbiBackend *be = (GncDbiBackend*)qbe;
-	gint result;
-	gchar* dsn;
-	gchar* host;
-	gchar* port = NULL;
-	gchar* dbname;
+    gint result;
+    gchar* dsn;
+    gchar* host;
+    gchar* port = NULL;
+    gchar* dbname;
     gchar* username;
     gchar* password;
-	gboolean success = FALSE;
-	gint portnum;
+    gboolean success = FALSE;
+    gint portnum;
 
-	g_return_if_fail( qbe != NULL );
-	g_return_if_fail( session != NULL );
-	g_return_if_fail( book_id != NULL );
+    g_return_if_fail( qbe != NULL );
+    g_return_if_fail( session != NULL );
+    g_return_if_fail( book_id != NULL );
 
     ENTER (" ");
 
-	/* Split the book-id (format host:dbname:username:password or
-	   host:port:dbname:username:password) */
-	dsn = g_strdup( book_id );
-	for( host = dsn; *host != '/'; host++ ) {}
-	host += 2;
-	for( dbname = host; *dbname != ':'; dbname++ ) {}
-	*dbname++ = '\0';
-	if( *dbname >= '0' && *dbname <= '9' ) {
-	    port = dbname;
-	    for( ; *dbname != ':'; dbname++ ) {}
-		*dbname++ = '\0';
-	}
-	for( username = dbname; *username != ':'; username++ ) {}
-	*username++ = '\0';
-	for( password = username; *password != ':'; password++ ) {}
-	*password++ = '\0';
+    /* Split the book-id (format host:dbname:username:password or
+       host:port:dbname:username:password) */
+    dsn = g_strdup( book_id );
+    for ( host = dsn; *host != '/'; host++ ) {}
+    host += 2;
+    for ( dbname = host; *dbname != ':'; dbname++ ) {}
+    *dbname++ = '\0';
+    if ( *dbname >= '0' && *dbname <= '9' )
+    {
+        port = dbname;
+        for ( ; *dbname != ':'; dbname++ ) {}
+        *dbname++ = '\0';
+    }
+    for ( username = dbname; *username != ':'; username++ ) {}
+    *username++ = '\0';
+    for ( password = username; *password != ':'; password++ ) {}
+    *password++ = '\0';
 
-	if( port != NULL && *port != '\0' ) {
-		portnum = atoi( port );
-	} else {
-		portnum = PGSQL_DEFAULT_PORT;
-	}
+    if ( port != NULL && *port != '\0' )
+    {
+        portnum = atoi( port );
+    }
+    else
+    {
+        portnum = PGSQL_DEFAULT_PORT;
+    }
 
-	// Try to connect to the db.  If it doesn't exist and the create_if_nonexistent
-	// flag is TRUE, we'll need to connect to the 'postgres' db and execute the
-	// CREATE DATABASE ddl statement there.
-	if( be->conn != NULL ) {
-		dbi_conn_close( be->conn );
-	}
-	be->conn = dbi_conn_new( "pgsql" );
-	if( be->conn == NULL ) {
-		PERR( "Unable to create pgsql dbi connection\n" );
+    // Try to connect to the db.  If it doesn't exist and the create_if_nonexistent
+    // flag is TRUE, we'll need to connect to the 'postgres' db and execute the
+    // CREATE DATABASE ddl statement there.
+    if ( be->conn != NULL )
+    {
+        dbi_conn_close( be->conn );
+    }
+    be->conn = dbi_conn_new( "pgsql" );
+    if ( be->conn == NULL )
+    {
+        PERR( "Unable to create pgsql dbi connection\n" );
         qof_backend_set_error( qbe, ERR_BACKEND_BAD_URL );
-		goto exit;
-	}
-	dbi_conn_error_handler( be->conn, pgsql_error_fn, be );
-	if( !set_standard_connection_options( qbe, be->conn, host, portnum, dbname, username, password ) ) {
-		goto exit;
-	}
-	be->exists = TRUE;
-	result = dbi_conn_connect( be->conn );
-	if( result == 0 ) {
-		success = TRUE;
-	} else {
+        goto exit;
+    }
+    dbi_conn_error_handler( be->conn, pgsql_error_fn, be );
+    if ( !set_standard_connection_options( qbe, be->conn, host, portnum, dbname, username, password ) )
+    {
+        goto exit;
+    }
+    be->exists = TRUE;
+    result = dbi_conn_connect( be->conn );
+    if ( result == 0 )
+    {
+        success = TRUE;
+    }
+    else
+    {
 
-		if( be->exists ) {
-			PERR( "Unable to connect to database '%s'\n", dbname );
-        	qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-			goto exit;
-		}
+        if ( be->exists )
+        {
+            PERR( "Unable to connect to database '%s'\n", dbname );
+            qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+            goto exit;
+        }
 
-		// The db does not already exist.  Connect to the 'postgres' db and try to create it.
-		if( create_if_nonexistent ) {
-			dbi_result dresult;
-			result = dbi_conn_set_option( be->conn, "dbname", "postgres" );
-			if( result < 0 ) {
-				PERR( "Error setting 'dbname' option\n" );
-        		qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-				goto exit;
-			}
-			result = dbi_conn_connect( be->conn );
-			if( result < 0 ) {
-				PERR( "Unable to connect to 'postgres' database\n" );
-        		qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-				goto exit;
-			}
-			dresult = dbi_conn_queryf( be->conn, "CREATE DATABASE %s WITH ENCODING 'UTF8'", dbname );
-			if( dresult == NULL ) {
-				PERR( "Unable to create database '%s'\n", dbname );
-        		qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-				goto exit;
-			}
-    		dbi_conn_close( be->conn );
+        // The db does not already exist.  Connect to the 'postgres' db and try to create it.
+        if ( create_if_nonexistent )
+        {
+            dbi_result dresult;
+            result = dbi_conn_set_option( be->conn, "dbname", "postgres" );
+            if ( result < 0 )
+            {
+                PERR( "Error setting 'dbname' option\n" );
+                qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+                goto exit;
+            }
+            result = dbi_conn_connect( be->conn );
+            if ( result < 0 )
+            {
+                PERR( "Unable to connect to 'postgres' database\n" );
+                qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+                goto exit;
+            }
+            dresult = dbi_conn_queryf( be->conn, "CREATE DATABASE %s WITH ENCODING 'UTF8'", dbname );
+            if ( dresult == NULL )
+            {
+                PERR( "Unable to create database '%s'\n", dbname );
+                qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+                goto exit;
+            }
+            dbi_conn_close( be->conn );
 
-			// Try again to connect to the db
-			be->conn = dbi_conn_new( "pgsql" );
-			if( be->conn == NULL ) {
-				PERR( "Unable to create pgsql dbi connection\n" );
-        		qof_backend_set_error( qbe, ERR_BACKEND_BAD_URL );
-				goto exit;
-			}
-			dbi_conn_error_handler( be->conn, pgsql_error_fn, be );
-			if( !set_standard_connection_options( qbe, be->conn, host, PGSQL_DEFAULT_PORT, dbname, username, password ) ) {
-				goto exit;
-			}
-			result = dbi_conn_connect( be->conn );
-			if( result < 0 ) {
-				PERR( "Unable to create database '%s'\n", dbname );
-        		qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-				goto exit;
-			}
-			success = TRUE;
-		} else {
-        	qof_backend_set_error( qbe, ERR_BACKEND_NO_SUCH_DB );
-		}
-	}
+            // Try again to connect to the db
+            be->conn = dbi_conn_new( "pgsql" );
+            if ( be->conn == NULL )
+            {
+                PERR( "Unable to create pgsql dbi connection\n" );
+                qof_backend_set_error( qbe, ERR_BACKEND_BAD_URL );
+                goto exit;
+            }
+            dbi_conn_error_handler( be->conn, pgsql_error_fn, be );
+            if ( !set_standard_connection_options( qbe, be->conn, host, PGSQL_DEFAULT_PORT, dbname, username, password ) )
+            {
+                goto exit;
+            }
+            result = dbi_conn_connect( be->conn );
+            if ( result < 0 )
+            {
+                PERR( "Unable to create database '%s'\n", dbname );
+                qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+                goto exit;
+            }
+            success = TRUE;
+        }
+        else
+        {
+            qof_backend_set_error( qbe, ERR_BACKEND_NO_SUCH_DB );
+        }
+    }
 
-	if( success ) {
-		if( be->sql_be.conn != NULL ) {
-			gnc_sql_connection_dispose( be->sql_be.conn );
-		}
-		be->sql_be.conn = create_dbi_connection( GNC_DBI_PROVIDER_PGSQL, qbe, be->conn );
-	}
-	be->sql_be.timespec_format = PGSQL_TIMESPEC_STR_FORMAT;
+    if ( success )
+    {
+        if ( be->sql_be.conn != NULL )
+        {
+            gnc_sql_connection_dispose( be->sql_be.conn );
+        }
+        be->sql_be.conn = create_dbi_connection( GNC_DBI_PROVIDER_PGSQL, qbe, be->conn );
+    }
+    be->sql_be.timespec_format = PGSQL_TIMESPEC_STR_FORMAT;
 exit:
-	if( dsn != NULL ) {
-		g_free( dsn );
-	}
+    if ( dsn != NULL )
+    {
+        g_free( dsn );
+    }
 
     LEAVE (" ");
 }
@@ -618,19 +691,21 @@
 {
     GncDbiBackend *be = (GncDbiBackend*)be_start;
 
-	g_return_if_fail( be_start != NULL );
+    g_return_if_fail( be_start != NULL );
 
     ENTER (" ");
 
-	if( be->conn != NULL ) {
+    if ( be->conn != NULL )
+    {
         dbi_conn_close( be->conn );
-		be->conn = NULL;
-	}
-	if( be->sql_be.conn != NULL ) {
-		gnc_sql_connection_dispose( be->sql_be.conn );
-		be->sql_be.conn = NULL;
+        be->conn = NULL;
     }
-	gnc_sql_finalize_version_info( &be->sql_be );
+    if ( be->sql_be.conn != NULL )
+    {
+        gnc_sql_connection_dispose( be->sql_be.conn );
+        be->sql_be.conn = NULL;
+    }
+    gnc_sql_finalize_version_info( &be->sql_be );
 
     LEAVE (" ");
 }
@@ -638,9 +713,9 @@
 static void
 gnc_dbi_destroy_backend( /*@ only @*/ QofBackend *be )
 {
-	g_return_if_fail( be != NULL );
+    g_return_if_fail( be != NULL );
 
-	qof_backend_destroy( be );
+    qof_backend_destroy( be );
 
     g_free( be );
 }
@@ -652,23 +727,24 @@
 {
     GncDbiBackend *be = (GncDbiBackend*)qbe;
 
-	g_return_if_fail( qbe != NULL );
-	g_return_if_fail( book != NULL );
+    g_return_if_fail( qbe != NULL );
+    g_return_if_fail( book != NULL );
 
     ENTER( "be=%p, book=%p", be, book );
 
-	if( loadType == LOAD_TYPE_INITIAL_LOAD ) {
-    	g_assert( be->primary_book == NULL );
-    	be->primary_book = book;
+    if ( loadType == LOAD_TYPE_INITIAL_LOAD )
+    {
+        g_assert( be->primary_book == NULL );
+        be->primary_book = book;
 
-		// Set up table version information
-		gnc_sql_init_version_info( &be->sql_be );
+        // Set up table version information
+        gnc_sql_init_version_info( &be->sql_be );
 
-    	// Call all object backends to create any required tables
-    	qof_object_foreach_backend( GNC_SQL_BACKEND, create_tables_cb, be );
-	}
+        // Call all object backends to create any required tables
+        qof_object_foreach_backend( GNC_SQL_BACKEND, create_tables_cb, be );
+    }
 
-	gnc_sql_load( &be->sql_be, book, loadType );
+    gnc_sql_load( &be->sql_be, book, loadType );
 
     LEAVE( "" );
 }
@@ -679,66 +755,72 @@
 gnc_dbi_save_may_clobber_data( QofBackend* qbe )
 {
     GncDbiBackend* be = (GncDbiBackend*)qbe;
-	const gchar* dbname;
-	GSList* table_name_list;
-	gint numTables = 0;
-	gint status;
+    const gchar* dbname;
+    GSList* table_name_list;
+    gint numTables = 0;
+    gint status;
 
-	/* Data may be clobbered iff the number of tables != 0 */
-	dbname = dbi_conn_get_option( be->conn, "dbname" );
-	table_name_list = ((GncDbiSqlConnection*)(be->sql_be.conn))->provider->get_table_list( be->conn, dbname );
-	if( table_name_list != NULL ) {
-		GSList* node;
-    	numTables = g_slist_length( table_name_list );
-		for( node = table_name_list; node != NULL; node = node->next ) {
-		    g_free( node->data );
-		}
-		g_slist_free( table_name_list );
-	}
+    /* Data may be clobbered iff the number of tables != 0 */
+    dbname = dbi_conn_get_option( be->conn, "dbname" );
+    table_name_list = ((GncDbiSqlConnection*)(be->sql_be.conn))->provider->get_table_list( be->conn, dbname );
+    if ( table_name_list != NULL )
+    {
+        GSList* node;
+        numTables = g_slist_length( table_name_list );
+        for ( node = table_name_list; node != NULL; node = node->next )
+        {
+            g_free( node->data );
+        }
+        g_slist_free( table_name_list );
+    }
 
-	return (numTables != 0);
+    return (numTables != 0);
 }
 
 static void
 gnc_dbi_sync_all( QofBackend* qbe, /*@ dependent @*/ QofBook *book )
 {
     GncDbiBackend* be = (GncDbiBackend*)qbe;
-	GSList* table_name_list;
-	const gchar* dbname;
-	gint status;
+    GSList* table_name_list;
+    const gchar* dbname;
+    gint status;
 
-	g_return_if_fail( be != NULL );
-	g_return_if_fail( book != NULL );
+    g_return_if_fail( be != NULL );
+    g_return_if_fail( book != NULL );
 
     ENTER( "book=%p, primary=%p", book, be->primary_book );
 
     /* Destroy the current contents of the database */
-	dbname = dbi_conn_get_option( be->conn, "dbname" );
-	table_name_list = ((GncDbiSqlConnection*)(be->sql_be.conn))->provider->get_table_list( be->conn, dbname );
-	if( table_name_list != NULL ) {
-		GSList* node;
+    dbname = dbi_conn_get_option( be->conn, "dbname" );
+    table_name_list = ((GncDbiSqlConnection*)(be->sql_be.conn))->provider->get_table_list( be->conn, dbname );
+    if ( table_name_list != NULL )
+    {
+        GSList* node;
 
-		for( node = table_name_list; node != NULL; node = node->next ) {
-			const gchar* table_name = (const gchar*)node->data;
-			dbi_result result;
+        for ( node = table_name_list; node != NULL; node = node->next )
+        {
+            const gchar* table_name = (const gchar*)node->data;
+            dbi_result result;
 
-			result = dbi_conn_queryf( be->conn, "DROP TABLE %s", table_name );
-			if( result != NULL ) {
-				status = dbi_result_free( result );
-				if( status < 0 ) {
-					PERR( "Error in dbi_result_free() result\n" );
-					qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
-				}
-			}
-			g_free( node->data );
-		}
-		g_slist_free( table_name_list );
-	}
+            result = dbi_conn_queryf( be->conn, "DROP TABLE %s", table_name );
+            if ( result != NULL )
+            {
+                status = dbi_result_free( result );
+                if ( status < 0 )
+                {
+                    PERR( "Error in dbi_result_free() result\n" );
+                    qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
+                }
+            }
+            g_free( node->data );
+        }
+        g_slist_free( table_name_list );
+    }
 
     /* Save all contents */
-	be->is_pristine_db = TRUE;
-	be->primary_book = book;
-	gnc_sql_sync_all( &be->sql_be, book );
+    be->is_pristine_db = TRUE;
+    be->primary_book = book;
+    gnc_sql_sync_all( &be->sql_be, book );
 
     LEAVE( "book=%p", book );
 }
@@ -749,10 +831,10 @@
 {
     GncDbiBackend* be = (GncDbiBackend*)qbe;
 
-	g_return_if_fail( be != NULL );
-	g_return_if_fail( inst != NULL );
+    g_return_if_fail( be != NULL );
+    g_return_if_fail( inst != NULL );
 
-	gnc_sql_begin_edit( &be->sql_be, inst );
+    gnc_sql_begin_edit( &be->sql_be, inst );
 }
 
 static void
@@ -760,10 +842,10 @@
 {
     GncDbiBackend* be = (GncDbiBackend*)qbe;
 
-	g_return_if_fail( be != NULL );
-	g_return_if_fail( inst != NULL );
+    g_return_if_fail( be != NULL );
+    g_return_if_fail( inst != NULL );
 
-	gnc_sql_rollback_edit( &be->sql_be, inst );
+    gnc_sql_rollback_edit( &be->sql_be, inst );
 }
 
 static void
@@ -771,10 +853,10 @@
 {
     GncDbiBackend* be = (GncDbiBackend*)qbe;
 
-	g_return_if_fail( be != NULL );
-	g_return_if_fail( inst != NULL );
+    g_return_if_fail( be != NULL );
+    g_return_if_fail( inst != NULL );
 
-	gnc_sql_commit_edit( &be->sql_be, inst );
+    gnc_sql_commit_edit( &be->sql_be, inst );
 }
 
 /* ================================================================= */
@@ -782,7 +864,7 @@
 static void
 init_sql_backend( GncDbiBackend* dbi_be )
 {
-	QofBackend* be;
+    QofBackend* be;
 
     be = (QofBackend*)dbi_be;
 
@@ -807,30 +889,30 @@
     be->load_config = NULL;
     be->get_config = NULL;
 
-	be->compile_query = gnc_sql_compile_query;
-	be->run_query = gnc_sql_run_query;
-	be->free_query = gnc_sql_free_query;
+    be->compile_query = gnc_sql_compile_query;
+    be->run_query = gnc_sql_run_query;
+    be->free_query = gnc_sql_free_query;
 
     be->export = NULL;
 
-	gnc_sql_init( &dbi_be->sql_be );
+    gnc_sql_init( &dbi_be->sql_be );
 }
 
 static QofBackend*
 new_backend( void (*session_begin)( QofBackend *, QofSession *, const gchar *,
-									/*@ unused @*/ gboolean, /*@ unused @*/ gboolean ) )
+                                    /*@ unused @*/ gboolean, /*@ unused @*/ gboolean ) )
 {
     GncDbiBackend *dbi_be;
     QofBackend *be;
 
     dbi_be = g_new0( GncDbiBackend, 1 );
-	g_assert( dbi_be != NULL );
+    g_assert( dbi_be != NULL );
 
     be = (QofBackend*)dbi_be;
     qof_backend_init( be );
 
     be->session_begin = session_begin;
-	init_sql_backend( dbi_be );
+    init_sql_backend( dbi_be );
 
     return be;
 }
@@ -838,7 +920,7 @@
 static QofBackend*
 gnc_dbi_backend_sqlite3_new( void )
 {
-	return new_backend( gnc_dbi_sqlite3_session_begin );
+    return new_backend( gnc_dbi_sqlite3_session_begin );
 }
 
 static QofBackend*
@@ -856,7 +938,7 @@
 static void
 gnc_dbi_provider_free( /*@ only @*/ QofBackendProvider *prov )
 {
-	g_return_if_fail( prov != NULL );
+    g_return_if_fail( prov != NULL );
 
     g_free( prov );
 }
@@ -868,36 +950,39 @@
 static gboolean
 gnc_dbi_check_sqlite3_file( const gchar *path )
 {
-	FILE* f;
-	gchar buf[50];
-	size_t chars_read;
-	gint status;
+    FILE* f;
+    gchar buf[50];
+    size_t chars_read;
+    gint status;
 
-	// BAD if the path is null
-	g_return_val_if_fail( path != NULL, FALSE );
+    // BAD if the path is null
+    g_return_val_if_fail( path != NULL, FALSE );
 
-	f = g_fopen( path, "r" );
+    f = g_fopen( path, "r" );
 
-	// OK if the file doesn't exist - new file
-	if( f == NULL ) {
-		PINFO( "doesn't exist (errno=%d) -> DBI", errno );
-		return TRUE;
-	}
+    // OK if the file doesn't exist - new file
+    if ( f == NULL )
+    {
+        PINFO( "doesn't exist (errno=%d) -> DBI", errno );
+        return TRUE;
+    }
 
-	// OK if file has the correct header
-	chars_read = fread( buf, sizeof(buf), 1, f );
-	status = fclose( f );
-	if( status < 0 ) {
-		PERR( "Error in fclose(): %d\n", errno );
-	}
-	if( g_str_has_prefix( buf, "SQLite format 3" ) ) {
-		PINFO( "has SQLite format string -> DBI" );
-		return TRUE;
-	}
-	PINFO( "exists, does not have SQLite format string -> not DBI" );
+    // OK if file has the correct header
+    chars_read = fread( buf, sizeof(buf), 1, f );
+    status = fclose( f );
+    if ( status < 0 )
+    {
+        PERR( "Error in fclose(): %d\n", errno );
+    }
+    if ( g_str_has_prefix( buf, "SQLite format 3" ) )
+    {
+        PINFO( "has SQLite format string -> DBI" );
+        return TRUE;
+    }
+    PINFO( "exists, does not have SQLite format string -> not DBI" );
 
-	// Otherwise, BAD
-	return FALSE;
+    // Otherwise, BAD
+    return FALSE;
 }
 
 G_MODULE_EXPORT void
@@ -905,96 +990,111 @@
 {
     QofBackendProvider *prov;
 #define DEFAULT_DBD_DIR "/usr/lib/dbd"
-	const gchar* driver_dir;
+    const gchar* driver_dir;
     int num_drivers;
-	gboolean have_sqlite3_driver = FALSE;
-	gboolean have_mysql_driver = FALSE;
-	gboolean have_pgsql_driver = FALSE;
+    gboolean have_sqlite3_driver = FALSE;
+    gboolean have_mysql_driver = FALSE;
+    gboolean have_pgsql_driver = FALSE;
 
-	/* Initialize libdbi and see which drivers are available.  Only register qof backends which
-	   have drivers available. */
-	driver_dir = g_getenv( "GNC_DBD_DIR" );
-	if( driver_dir == NULL ) {
-		PWARN( "GNC_DBD_DIR not set: using %s\n", DEFAULT_DBD_DIR );
-		driver_dir = DEFAULT_DBD_DIR;
-	}
+    /* Initialize libdbi and see which drivers are available.  Only register qof backends which
+       have drivers available. */
+    driver_dir = g_getenv( "GNC_DBD_DIR" );
+    if ( driver_dir == NULL )
+    {
+        PWARN( "GNC_DBD_DIR not set: using %s\n", DEFAULT_DBD_DIR );
+        driver_dir = DEFAULT_DBD_DIR;
+    }
 
     num_drivers = dbi_initialize( driver_dir );
-	if( num_drivers == 0 ) {
-		PWARN( "No DBD drivers found\n" );
-	} else {
-		dbi_driver driver = NULL;
-		PINFO( "%d DBD drivers found\n", num_drivers );
+    if ( num_drivers == 0 )
+    {
+        PWARN( "No DBD drivers found\n" );
+    }
+    else
+    {
+        dbi_driver driver = NULL;
+        PINFO( "%d DBD drivers found\n", num_drivers );
 
-		do {
-			driver = dbi_driver_list( driver );
-			if( driver != NULL ) {
-				const gchar* name = dbi_driver_get_name( driver );
+        do
+        {
+            driver = dbi_driver_list( driver );
+            if ( driver != NULL )
+            {
+                const gchar* name = dbi_driver_get_name( driver );
 
-				PINFO( "Driver: %s\n", name );
-				if( strcmp( name, "sqlite3" ) == 0 ) {
-					have_sqlite3_driver = TRUE;
-				} else if( strcmp( name, "mysql" ) == 0 ) {
-					have_mysql_driver = TRUE;
-				} else if( strcmp( name, "pgsql" ) == 0 ) {
-					have_pgsql_driver = TRUE;
-				}
-			}
-		} while( driver != NULL );
-	}
+                PINFO( "Driver: %s\n", name );
+                if ( strcmp( name, "sqlite3" ) == 0 )
+                {
+                    have_sqlite3_driver = TRUE;
+                }
+                else if ( strcmp( name, "mysql" ) == 0 )
+                {
+                    have_mysql_driver = TRUE;
+                }
+                else if ( strcmp( name, "pgsql" ) == 0 )
+                {
+                    have_pgsql_driver = TRUE;
+                }
+            }
+        }
+        while ( driver != NULL );
+    }
 
-	if( have_sqlite3_driver ) {
-    	prov = g_new0( QofBackendProvider, 1 );
-		g_assert( prov != NULL );
+    if ( have_sqlite3_driver )
+    {
+        prov = g_new0( QofBackendProvider, 1 );
+        g_assert( prov != NULL );
 
-    	prov->provider_name = "GnuCash Libdbi (SQLITE3) Backend";
-    	prov->access_method = FILE_URI_TYPE;
-    	prov->partial_book_supported = FALSE;
-    	prov->backend_new = gnc_dbi_backend_sqlite3_new;
-    	prov->provider_free = gnc_dbi_provider_free;
-    	prov->check_data_type = gnc_dbi_check_sqlite3_file;
-    	qof_backend_register_provider( prov );
+        prov->provider_name = "GnuCash Libdbi (SQLITE3) Backend";
+        prov->access_method = FILE_URI_TYPE;
+        prov->partial_book_supported = FALSE;
+        prov->backend_new = gnc_dbi_backend_sqlite3_new;
+        prov->provider_free = gnc_dbi_provider_free;
+        prov->check_data_type = gnc_dbi_check_sqlite3_file;
+        qof_backend_register_provider( prov );
 
-    	prov = g_new0( QofBackendProvider, 1 );
-		g_assert( prov != NULL );
+        prov = g_new0( QofBackendProvider, 1 );
+        g_assert( prov != NULL );
 
-    	prov->provider_name = "GnuCash Libdbi (SQLITE3) Backend";
-    	prov->access_method = SQLITE3_URI_TYPE;
-    	prov->partial_book_supported = FALSE;
-    	prov->backend_new = gnc_dbi_backend_sqlite3_new;
-    	prov->provider_free = gnc_dbi_provider_free;
-    	prov->check_data_type = gnc_dbi_check_sqlite3_file;
-    	qof_backend_register_provider( prov );
-	}
+        prov->provider_name = "GnuCash Libdbi (SQLITE3) Backend";
+        prov->access_method = SQLITE3_URI_TYPE;
+        prov->partial_book_supported = FALSE;
+        prov->backend_new = gnc_dbi_backend_sqlite3_new;
+        prov->provider_free = gnc_dbi_provider_free;
+        prov->check_data_type = gnc_dbi_check_sqlite3_file;
+        qof_backend_register_provider( prov );
+    }
 
-	if( have_mysql_driver ) {
-    	prov = g_new0( QofBackendProvider, 1 );
-		g_assert( prov != NULL );
+    if ( have_mysql_driver )
+    {
+        prov = g_new0( QofBackendProvider, 1 );
+        g_assert( prov != NULL );
 
-    	prov->provider_name = "GnuCash Libdbi (MYSQL) Backend";
-    	prov->access_method = "mysql";
-    	prov->partial_book_supported = FALSE;
-    	prov->backend_new = gnc_dbi_backend_mysql_new;
-    	prov->provider_free = gnc_dbi_provider_free;
-		prov->check_data_type = NULL;
-    	qof_backend_register_provider( prov );
-	}
+        prov->provider_name = "GnuCash Libdbi (MYSQL) Backend";
+        prov->access_method = "mysql";
+        prov->partial_book_supported = FALSE;
+        prov->backend_new = gnc_dbi_backend_mysql_new;
+        prov->provider_free = gnc_dbi_provider_free;
+        prov->check_data_type = NULL;
+        qof_backend_register_provider( prov );
+    }
 
-	if( have_pgsql_driver ) {
-    	prov = g_new0( QofBackendProvider, 1 );
-		g_assert( prov != NULL );
+    if ( have_pgsql_driver )
+    {
+        prov = g_new0( QofBackendProvider, 1 );
+        g_assert( prov != NULL );
 
-    	prov->provider_name = "GnuCash Libdbi (POSTGRESQL) Backend";
-    	prov->access_method = "postgres";
-    	prov->partial_book_supported = FALSE;
-    	prov->backend_new = gnc_dbi_backend_postgres_new;
-    	prov->provider_free = gnc_dbi_provider_free;
-		prov->check_data_type = NULL;
-    	qof_backend_register_provider( prov );
-	}
+        prov->provider_name = "GnuCash Libdbi (POSTGRESQL) Backend";
+        prov->access_method = "postgres";
+        prov->partial_book_supported = FALSE;
+        prov->backend_new = gnc_dbi_backend_postgres_new;
+        prov->provider_free = gnc_dbi_provider_free;
+        prov->check_data_type = NULL;
+        qof_backend_register_provider( prov );
+    }
 
-	/* For now, set log level to DEBUG so that SQl statements will be put into
-	   the gnucash.trace file. */
+    /* For now, set log level to DEBUG so that SQl statements will be put into
+       the gnucash.trace file. */
     qof_log_set_level( log_module, QOF_LOG_DEBUG );
 }
 
@@ -1007,802 +1107,917 @@
 /* --------------------------------------------------------- */
 typedef struct
 {
-	GncSqlRow base;
+    GncSqlRow base;
 
-	/*@ dependent @*/ dbi_result result;
-	GList* gvalue_list;
+    /*@ dependent @*/
+    dbi_result result;
+    GList* gvalue_list;
 } GncDbiSqlRow;
 
 static void
 row_dispose( /*@ only @*/ GncSqlRow* row )
 {
-	GncDbiSqlRow* dbi_row = (GncDbiSqlRow*)row;
-	GList* node;
+    GncDbiSqlRow* dbi_row = (GncDbiSqlRow*)row;
+    GList* node;
 
-	if( dbi_row->gvalue_list != NULL ) {
-		for( node = dbi_row->gvalue_list; node != NULL; node = node->next ) {
-			GValue* value = (GValue*)node->data;
-			if( G_VALUE_HOLDS_STRING(value) ) {
-				g_free( (gpointer)g_value_get_string( value ) );
-			}
-			g_free( value );
-		}
-		g_list_free( dbi_row->gvalue_list );
-	}
-	g_free( dbi_row );
+    if ( dbi_row->gvalue_list != NULL )
+    {
+        for ( node = dbi_row->gvalue_list; node != NULL; node = node->next )
+        {
+            GValue* value = (GValue*)node->data;
+            if ( G_VALUE_HOLDS_STRING(value) )
+            {
+                g_free( (gpointer)g_value_get_string( value ) );
+            }
+            g_free( value );
+        }
+        g_list_free( dbi_row->gvalue_list );
+    }
+    g_free( dbi_row );
 }
 
 static /*@ null @*/ const GValue*
 row_get_value_at_col_name( GncSqlRow* row, const gchar* col_name )
 {
-	GncDbiSqlRow* dbi_row = (GncDbiSqlRow*)row;
-	gushort type;
-	guint attrs;
-	GValue* value;
-	time_t time;
-	struct tm tm_struct;
+    GncDbiSqlRow* dbi_row = (GncDbiSqlRow*)row;
+    gushort type;
+    guint attrs;
+    GValue* value;
+    time_t time;
+    struct tm tm_struct;
 
-	type = dbi_result_get_field_type( dbi_row->result, col_name );
-	attrs = dbi_result_get_field_attribs( dbi_row->result, col_name );
-	value = g_new0( GValue, 1 );
-	g_assert( value != NULL );
+    type = dbi_result_get_field_type( dbi_row->result, col_name );
+    attrs = dbi_result_get_field_attribs( dbi_row->result, col_name );
+    value = g_new0( GValue, 1 );
+    g_assert( value != NULL );
 
-	switch( type ) {
-		case DBI_TYPE_INTEGER:
-			(void)g_value_init( value, G_TYPE_INT64 );
-			g_value_set_int64( value, dbi_result_get_longlong( dbi_row->result, col_name ) );
-			break;
-		case DBI_TYPE_DECIMAL:
-			if( (attrs & DBI_DECIMAL_SIZEMASK) == DBI_DECIMAL_SIZE4 ) {
-				(void)g_value_init( value, G_TYPE_FLOAT );
-				g_value_set_float( value, dbi_result_get_float( dbi_row->result, col_name ) );
-			} else if( (attrs & DBI_DECIMAL_SIZEMASK) == DBI_DECIMAL_SIZE8 ) {
-				(void)g_value_init( value, G_TYPE_DOUBLE );
-				g_value_set_double( value, dbi_result_get_double( dbi_row->result, col_name ) );
-			} else {
-				PERR( "Field %s: strange decimal length attrs=%d\n", col_name, attrs );
-			}
-			break;
-		case DBI_TYPE_STRING:
-			(void)g_value_init( value, G_TYPE_STRING );
-			g_value_take_string( value, dbi_result_get_string_copy( dbi_row->result, col_name ) );
-			break;
-		case DBI_TYPE_DATETIME:
-			if( dbi_result_field_is_null( dbi_row->result, col_name ) ) {
-				return NULL;
-			} else {
-		    	time = dbi_result_get_datetime( dbi_row->result, col_name );
-				(void)gmtime_r( &time, &tm_struct );
-				(void)g_value_init( value, G_TYPE_STRING );
-				g_value_take_string( value,
-						g_strdup_printf( "%d%02d%02d%02d%02d%02d",
-										1900+tm_struct.tm_year, tm_struct.tm_mon+1, tm_struct.tm_mday,
-										tm_struct.tm_hour, tm_struct.tm_min, tm_struct.tm_sec ) );
-			}
-		    break;
-		default:
-			PERR( "Field %s: unknown DBI_TYPE: %d\n", col_name, type );
-			g_free( value );
-			return NULL;
-	}
-	
-	dbi_row->gvalue_list = g_list_prepend( dbi_row->gvalue_list, value );
-	return value;
+    switch ( type )
+    {
+    case DBI_TYPE_INTEGER:
+        (void)g_value_init( value, G_TYPE_INT64 );
+        g_value_set_int64( value, dbi_result_get_longlong( dbi_row->result, col_name ) );
+        break;
+    case DBI_TYPE_DECIMAL:
+        if ( (attrs & DBI_DECIMAL_SIZEMASK) == DBI_DECIMAL_SIZE4 )
+        {
+            (void)g_value_init( value, G_TYPE_FLOAT );
+            g_value_set_float( value, dbi_result_get_float( dbi_row->result, col_name ) );
+        }
+        else if ( (attrs & DBI_DECIMAL_SIZEMASK) == DBI_DECIMAL_SIZE8 )
+        {
+            (void)g_value_init( value, G_TYPE_DOUBLE );
+            g_value_set_double( value, dbi_result_get_double( dbi_row->result, col_name ) );
+        }
+        else
+        {
+            PERR( "Field %s: strange decimal length attrs=%d\n", col_name, attrs );
+        }
+        break;
+    case DBI_TYPE_STRING:
+        (void)g_value_init( value, G_TYPE_STRING );
+        g_value_take_string( value, dbi_result_get_string_copy( dbi_row->result, col_name ) );
+        break;
+    case DBI_TYPE_DATETIME:
+        if ( dbi_result_field_is_null( dbi_row->result, col_name ) )
+        {
+            return NULL;
+        }
+        else
+        {
+            time = dbi_result_get_datetime( dbi_row->result, col_name );
+            (void)gmtime_r( &time, &tm_struct );
+            (void)g_value_init( value, G_TYPE_STRING );
+            g_value_take_string( value,
+                                 g_strdup_printf( "%d%02d%02d%02d%02d%02d",
+                                                  1900 + tm_struct.tm_year, tm_struct.tm_mon + 1, tm_struct.tm_mday,
+                                                  tm_struct.tm_hour, tm_struct.tm_min, tm_struct.tm_sec ) );
+        }
+        break;
+    default:
+        PERR( "Field %s: unknown DBI_TYPE: %d\n", col_name, type );
+        g_free( value );
+        return NULL;
+    }
+
+    dbi_row->gvalue_list = g_list_prepend( dbi_row->gvalue_list, value );
+    return value;
 }
 
 static GncSqlRow*
 create_dbi_row( /*@ dependent @*/ dbi_result result )
 {
-	GncDbiSqlRow* row;
+    GncDbiSqlRow* row;
 
-	row = g_new0( GncDbiSqlRow, 1 );
-	g_assert( row != NULL );
+    row = g_new0( GncDbiSqlRow, 1 );
+    g_assert( row != NULL );
 
-	row->base.getValueAtColName = row_get_value_at_col_name;
-	row->base.dispose = row_dispose;
-	row->result = result;
+    row->base.getValueAtColName = row_get_value_at_col_name;
+    row->base.dispose = row_dispose;
+    row->result = result;
 
-	return (GncSqlRow*)row;
+    return (GncSqlRow*)row;
 }
 /* --------------------------------------------------------- */
 typedef struct
 {
-	GncSqlResult base;
+    GncSqlResult base;
 
-	/*@ observer @*/ GncDbiSqlConnection* dbi_conn;
-	/*@ owned @*/ dbi_result result;
-	guint num_rows;
-	guint cur_row;
-	GncSqlRow* row;
+    /*@ observer @*/
+    GncDbiSqlConnection* dbi_conn;
+    /*@ owned @*/
+    dbi_result result;
+    guint num_rows;
+    guint cur_row;
+    GncSqlRow* row;
 } GncDbiSqlResult;
 
 static void
 result_dispose( /*@ only @*/ GncSqlResult* result )
 {
-	GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result;
+    GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result;
 
-	if( dbi_result->row != NULL ) {
-		gnc_sql_row_dispose( dbi_result->row );
-	}
-	if( dbi_result->result != NULL ) {
-		gint status;
+    if ( dbi_result->row != NULL )
+    {
+        gnc_sql_row_dispose( dbi_result->row );
+    }
+    if ( dbi_result->result != NULL )
+    {
+        gint status;
 
-		status = dbi_result_free( dbi_result->result );
-		if( status < 0 ) {
-			PERR( "Error in dbi_result_free() result\n" );
-			qof_backend_set_error( dbi_result->dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
-		}
-	}
-	g_free( result );
+        status = dbi_result_free( dbi_result->result );
+        if ( status < 0 )
+        {
+            PERR( "Error in dbi_result_free() result\n" );
+            qof_backend_set_error( dbi_result->dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
+        }
+    }
+    g_free( result );
 }
 
 static guint
 result_get_num_rows( GncSqlResult* result )
 {
-	GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result;
+    GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result;
 
-	return dbi_result->num_rows;
+    return dbi_result->num_rows;
 }
 
 static /*@ null @*/ GncSqlRow*
 result_get_first_row( GncSqlResult* result )
 {
-	GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result;
+    GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result;
 
-	if( dbi_result->row != NULL ) {
-		gnc_sql_row_dispose( dbi_result->row );
-		dbi_result->row = NULL;
-	}
-	if( dbi_result->num_rows > 0 ) {
-		gint status = dbi_result_first_row( dbi_result->result );
-		if( status == 0 ) {
-			PERR( "Error in dbi_result_first_row()\n" );
-			qof_backend_set_error( dbi_result->dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
-		}
-		dbi_result->cur_row = 1;
-		dbi_result->row = create_dbi_row( dbi_result->result );
-		return dbi_result->row;
-	} else {
-		return NULL;
-	}
+    if ( dbi_result->row != NULL )
+    {
+        gnc_sql_row_dispose( dbi_result->row );
+        dbi_result->row = NULL;
+    }
+    if ( dbi_result->num_rows > 0 )
+    {
+        gint status = dbi_result_first_row( dbi_result->result );
+        if ( status == 0 )
+        {
+            PERR( "Error in dbi_result_first_row()\n" );
+            qof_backend_set_error( dbi_result->dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
+        }
+        dbi_result->cur_row = 1;
+        dbi_result->row = create_dbi_row( dbi_result->result );
+        return dbi_result->row;
+    }
+    else
+    {
+        return NULL;
+    }
 }
 
 static /*@ null @*/ GncSqlRow*
 result_get_next_row( GncSqlResult* result )
 {
-	GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result;
+    GncDbiSqlResult* dbi_result = (GncDbiSqlResult*)result;
 
-	if( dbi_result->row != NULL ) {
-		gnc_sql_row_dispose( dbi_result->row );
-		dbi_result->row = NULL;
-	}
-	if( dbi_result->cur_row < dbi_result->num_rows ) {
-		gint status = dbi_result_next_row( dbi_result->result );
-		if( status == 0 ) {
-			PERR( "Error in dbi_result_first_row()\n" );
-			qof_backend_set_error( dbi_result->dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
-		}
-		dbi_result->cur_row++;
-		dbi_result->row = create_dbi_row( dbi_result->result );
-		return dbi_result->row;
-	} else {
-		return NULL;
-	}
+    if ( dbi_result->row != NULL )
+    {
+        gnc_sql_row_dispose( dbi_result->row );
+        dbi_result->row = NULL;
+    }
+    if ( dbi_result->cur_row < dbi_result->num_rows )
+    {
+        gint status = dbi_result_next_row( dbi_result->result );
+        if ( status == 0 )
+        {
+            PERR( "Error in dbi_result_first_row()\n" );
+            qof_backend_set_error( dbi_result->dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
+        }
+        dbi_result->cur_row++;
+        dbi_result->row = create_dbi_row( dbi_result->result );
+        return dbi_result->row;
+    }
+    else
+    {
+        return NULL;
+    }
 }
 
 static GncSqlResult*
 create_dbi_result( /*@ observer @*/ GncDbiSqlConnection* dbi_conn, /*@ owned @*/ dbi_result result )
 {
-	GncDbiSqlResult* dbi_result;
+    GncDbiSqlResult* dbi_result;
 
-	dbi_result = g_new0( GncDbiSqlResult, 1 );
-	g_assert( dbi_result != NULL );
+    dbi_result = g_new0( GncDbiSqlResult, 1 );
+    g_assert( dbi_result != NULL );
 
-	dbi_result->base.dispose = result_dispose;
-	dbi_result->base.getNumRows = result_get_num_rows;
-	dbi_result->base.getFirstRow = result_get_first_row;
-	dbi_result->base.getNextRow = result_get_next_row;
-	dbi_result->result = result;
-	dbi_result->num_rows = (guint)dbi_result_get_numrows( result );
-	dbi_result->cur_row = 0;
-	dbi_result->dbi_conn = dbi_conn;
+    dbi_result->base.dispose = result_dispose;
+    dbi_result->base.getNumRows = result_get_num_rows;
+    dbi_result->base.getFirstRow = result_get_first_row;
+    dbi_result->base.getNextRow = result_get_next_row;
+    dbi_result->result = result;
+    dbi_result->num_rows = (guint)dbi_result_get_numrows( result );
+    dbi_result->cur_row = 0;
+    dbi_result->dbi_conn = dbi_conn;
 
-	return (GncSqlResult*)dbi_result;
+    return (GncSqlResult*)dbi_result;
 }
 /* --------------------------------------------------------- */
 typedef struct
 {
-	GncSqlStatement base;
+    GncSqlStatement base;
 
-	GString* sql;
-	/*@ observer @*/ GncSqlConnection* conn;
+    GString* sql;
+    /*@ observer @*/
+    GncSqlConnection* conn;
 } GncDbiSqlStatement;
 
 static void
 stmt_dispose( /*@ only @*/ GncSqlStatement* stmt )
 {
-	GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt;
+    GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt;
 
-	if( dbi_stmt->sql != NULL ) {
-		(void)g_string_free( dbi_stmt->sql, TRUE );
-	}
-	g_free( stmt );
+    if ( dbi_stmt->sql != NULL )
+    {
+        (void)g_string_free( dbi_stmt->sql, TRUE );
+    }
+    g_free( stmt );
 }
 
 static gchar*
 stmt_to_sql( GncSqlStatement* stmt )
 {
-	GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt;
+    GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt;
 
-	return dbi_stmt->sql->str;
+    return dbi_stmt->sql->str;
 }
 
 static void
 stmt_add_where_cond( GncSqlStatement* stmt, /*@ unused @*/ QofIdTypeConst type_name,
-					/*@ unused @*/ gpointer obj, const GncSqlColumnTableEntry* table_row, GValue* value )
+                     /*@ unused @*/ gpointer obj, const GncSqlColumnTableEntry* table_row, GValue* value )
 {
-	GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt;
-	gchar* buf;
-	gchar* value_str;
+    GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt;
+    gchar* buf;
+    gchar* value_str;
 
-	value_str = gnc_sql_get_sql_value( dbi_stmt->conn, value );
-	buf = g_strdup_printf( " WHERE %s = %s", table_row->col_name,
-						value_str );
-	g_free( value_str );
-	(void)g_string_append( dbi_stmt->sql, buf );
-	g_free( buf );
+    value_str = gnc_sql_get_sql_value( dbi_stmt->conn, value );
+    buf = g_strdup_printf( " WHERE %s = %s", table_row->col_name,
+                           value_str );
+    g_free( value_str );
+    (void)g_string_append( dbi_stmt->sql, buf );
+    g_free( buf );
 }
 
 static GncSqlStatement*
 create_dbi_statement( /*@ observer @*/ GncSqlConnection* conn, const gchar* sql )
 {
-	GncDbiSqlStatement* stmt;
+    GncDbiSqlStatement* stmt;
 
-	stmt = g_new0( GncDbiSqlStatement, 1 );
-	g_assert( stmt != NULL );
+    stmt = g_new0( GncDbiSqlStatement, 1 );
+    g_assert( stmt != NULL );
 
-	stmt->base.dispose = stmt_dispose;
-	stmt->base.toSql = stmt_to_sql;
-	stmt->base.addWhereCond = stmt_add_where_cond;
-	stmt->sql = g_string_new( sql );
-	stmt->conn = conn;
+    stmt->base.dispose = stmt_dispose;
+    stmt->base.toSql = stmt_to_sql;
+    stmt->base.addWhereCond = stmt_add_where_cond;
+    stmt->sql = g_string_new( sql );
+    stmt->conn = conn;
 
-	return (GncSqlStatement*)stmt;
+    return (GncSqlStatement*)stmt;
 }
 /* --------------------------------------------------------- */
 static void
 conn_dispose( /*@ only @*/ GncSqlConnection* conn )
 {
-	//GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    //GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
 
-	g_free( conn );
+    g_free( conn );
 }
 
 static /*@ null @*/ GncSqlResult*
 conn_execute_select_statement( GncSqlConnection* conn, GncSqlStatement* stmt )
 {
-	GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
-	GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt;
-	dbi_result result;
-														
-	DEBUG( "SQL: %s\n", dbi_stmt->sql->str );
-	result = dbi_conn_query( dbi_conn->conn, dbi_stmt->sql->str );
-	if( result == NULL ) {
-		PERR( "Error executing SQL %s\n", dbi_stmt->sql->str );
-		return NULL;
-	}
-	return create_dbi_result( dbi_conn, result );
+    GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt;
+    dbi_result result;
+
+    DEBUG( "SQL: %s\n", dbi_stmt->sql->str );
+    result = dbi_conn_query( dbi_conn->conn, dbi_stmt->sql->str );
+    if ( result == NULL )
+    {
+        PERR( "Error executing SQL %s\n", dbi_stmt->sql->str );
+        return NULL;
+    }
+    return create_dbi_result( dbi_conn, result );
 }
 
 static gint
 conn_execute_nonselect_statement( GncSqlConnection* conn, GncSqlStatement* stmt )
 {
-	GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
-	GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt;
-	dbi_result result;
-	gint num_rows;
-	gint status;
+    GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    GncDbiSqlStatement* dbi_stmt = (GncDbiSqlStatement*)stmt;
+    dbi_result result;
+    gint num_rows;
+    gint status;
 
-	DEBUG( "SQL: %s\n", dbi_stmt->sql->str );
-	result = dbi_conn_query( dbi_conn->conn, dbi_stmt->sql->str );
-	if( result == NULL ) {
-		PERR( "Error executing SQL %s\n", dbi_stmt->sql->str );
-		return -1;
-	}
-	num_rows = (gint)dbi_result_get_numrows_affected( result );
-	status = dbi_result_free( result );
-	if( status < 0 ) {
-		PERR( "Error in dbi_result_free() result\n" );
-		qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
-	}
-	return num_rows;
+    DEBUG( "SQL: %s\n", dbi_stmt->sql->str );
+    result = dbi_conn_query( dbi_conn->conn, dbi_stmt->sql->str );
+    if ( result == NULL )
+    {
+        PERR( "Error executing SQL %s\n", dbi_stmt->sql->str );
+        return -1;
+    }
+    num_rows = (gint)dbi_result_get_numrows_affected( result );
+    status = dbi_result_free( result );
+    if ( status < 0 )
+    {
+        PERR( "Error in dbi_result_free() result\n" );
+        qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
+    }
+    return num_rows;
 }
 
 static GncSqlStatement*
 conn_create_statement_from_sql( /*@ observer @*/ GncSqlConnection* conn, const gchar* sql )
 {
-	//GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    //GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
 
-	return create_dbi_statement( conn, sql );
+    return create_dbi_statement( conn, sql );
 }
 
 static GValue*
 create_gvalue_from_string( /*@ only @*/ gchar* s )
 {
-	GValue* s_gval;
+    GValue* s_gval;
 
-	s_gval = g_new0( GValue, 1 );
-	g_assert( s_gval != NULL );
+    s_gval = g_new0( GValue, 1 );
+    g_assert( s_gval != NULL );
 
-	(void)g_value_init( s_gval, G_TYPE_STRING );
-	g_value_take_string( s_gval, s );
+    (void)g_value_init( s_gval, G_TYPE_STRING );
+    g_value_take_string( s_gval, s );
 
-	return s_gval;
+    return s_gval;
 }
 
 static gboolean
 conn_does_table_exist( GncSqlConnection* conn, const gchar* table_name )
 {
-	GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
-	gint nTables;
-	dbi_result tables;
-	const gchar* dbname;
-	gint status;
+    GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    gint nTables;
+    dbi_result tables;
+    const gchar* dbname;
+    gint status;
 
-	g_return_val_if_fail( conn != NULL, FALSE );
-	g_return_val_if_fail( table_name != NULL, FALSE );
+    g_return_val_if_fail( conn != NULL, FALSE );
+    g_return_val_if_fail( table_name != NULL, FALSE );
 
-	dbname = dbi_conn_get_option( dbi_conn->conn, "dbname" );
-	tables = dbi_conn_get_table_list( dbi_conn->conn, dbname, table_name );
-	nTables = (gint)dbi_result_get_numrows( tables );
-	status = dbi_result_free( tables );
-	if( status < 0 ) {
-		PERR( "Error in dbi_result_free() result\n" );
-		qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
-	}
+    dbname = dbi_conn_get_option( dbi_conn->conn, "dbname" );
+    tables = dbi_conn_get_table_list( dbi_conn->conn, dbname, table_name );
+    nTables = (gint)dbi_result_get_numrows( tables );
+    status = dbi_result_free( tables );
+    if ( status < 0 )
+    {
+        PERR( "Error in dbi_result_free() result\n" );
+        qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
+    }
 
-	if( nTables == 1 ) {
-		return TRUE;
-	} else {
-		return FALSE;
-	}
+    if ( nTables == 1 )
+    {
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 
 static gboolean
 conn_begin_transaction( /*@ unused @*/ GncSqlConnection* conn )
 {
-	GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
-	dbi_result result;
-	gint status;
+    GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    dbi_result result;
+    gint status;
 
-	DEBUG( "BEGIN\n" );
-	result = dbi_conn_queryf( dbi_conn->conn, "BEGIN" );
+    DEBUG( "BEGIN\n" );
+    result = dbi_conn_queryf( dbi_conn->conn, "BEGIN" );
 
-	/* Handle MySQL connection timeouts with reconnect */
-	if (result == NULL && dbi_conn_error( dbi_conn->conn, NULL ) == 2006 ) {
-		DEBUG( "MySQL server has gone away, reconnecting and retrying...\n" );
-		(void)dbi_conn_connect( dbi_conn->conn );
-		result = dbi_conn_queryf( dbi_conn->conn, "BEGIN" );
-	}
+    /* Handle MySQL connection timeouts with reconnect */
+    if (result == NULL && dbi_conn_error( dbi_conn->conn, NULL ) == 2006 )
+    {
+        DEBUG( "MySQL server has gone away, reconnecting and retrying...\n" );
+        (void)dbi_conn_connect( dbi_conn->conn );
+        result = dbi_conn_queryf( dbi_conn->conn, "BEGIN" );
+    }
 
-	status = dbi_result_free( result );
-	if( status < 0 ) {
-		PERR( "Error in dbi_result_free() result\n" );
-		qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
-	}
+    status = dbi_result_free( result );
+    if ( status < 0 )
+    {
+        PERR( "Error in dbi_result_free() result\n" );
+        qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 static gboolean
 conn_rollback_transaction( /*@ unused @*/ GncSqlConnection* conn )
 {
-	GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
-	dbi_result result;
-	gint status;
+    GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    dbi_result result;
+    gint status;
 
-	DEBUG( "ROLLBACK\n" );
-	result = dbi_conn_queryf( dbi_conn->conn, "ROLLBACK" );
-	status = dbi_result_free( result );
-	if( status < 0 ) {
-		PERR( "Error in dbi_result_free() result\n" );
-		qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
-	}
+    DEBUG( "ROLLBACK\n" );
+    result = dbi_conn_queryf( dbi_conn->conn, "ROLLBACK" );
+    status = dbi_result_free( result );
+    if ( status < 0 )
+    {
+        PERR( "Error in dbi_result_free() result\n" );
+        qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 static gboolean
 conn_commit_transaction( /*@ unused @*/ GncSqlConnection* conn )
 {
-	GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
-	dbi_result result;
-	gint status;
+    GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    dbi_result result;
+    gint status;
 
-	DEBUG( "COMMIT\n" );
-	result = dbi_conn_queryf( dbi_conn->conn, "COMMIT" );
-	status = dbi_result_free( result );
-	if( status < 0 ) {
-		PERR( "Error in dbi_result_free() result\n" );
-		qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
-	}
+    DEBUG( "COMMIT\n" );
+    result = dbi_conn_queryf( dbi_conn->conn, "COMMIT" );
+    status = dbi_result_free( result );
+    if ( status < 0 )
+    {
+        PERR( "Error in dbi_result_free() result\n" );
+        qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 static /*@ null @*/ gchar*
 create_index_ddl( GncSqlConnection* conn,
-					const gchar* index_name,
-					const gchar* table_name,
-					const GncSqlColumnTableEntry* col_table )
+                  const gchar* index_name,
+                  const gchar* table_name,
+                  const GncSqlColumnTableEntry* col_table )
 {
-	GString* ddl;
-	const GncSqlColumnTableEntry* table_row;
+    GString* ddl;
+    const GncSqlColumnTableEntry* table_row;
 
-	g_return_val_if_fail( conn != NULL, NULL );
-	g_return_val_if_fail( index_name != NULL, NULL );
-	g_return_val_if_fail( table_name != NULL, NULL );
-	g_return_val_if_fail( col_table != NULL, NULL );
-    
-	ddl = g_string_new( "" );
-	g_string_printf( ddl, "CREATE INDEX %s ON %s (", index_name, table_name );
-    for( table_row = col_table; table_row->col_name != NULL; ++table_row ) {
-		if( table_row != col_table ) {
-			(void)g_string_append( ddl, ", " );
-		}
-		g_string_append_printf( ddl, "%s", table_row->col_name );
+    g_return_val_if_fail( conn != NULL, NULL );
+    g_return_val_if_fail( index_name != NULL, NULL );
+    g_return_val_if_fail( table_name != NULL, NULL );
+    g_return_val_if_fail( col_table != NULL, NULL );
+
+    ddl = g_string_new( "" );
+    g_string_printf( ddl, "CREATE INDEX %s ON %s (", index_name, table_name );
+    for ( table_row = col_table; table_row->col_name != NULL; ++table_row )
+    {
+        if ( table_row != col_table )
+        {
+            (void)g_string_append( ddl, ", " );
+        }
+        g_string_append_printf( ddl, "%s", table_row->col_name );
     }
-	(void)g_string_append( ddl, ")" );
-        
-	return g_string_free( ddl, FALSE );
+    (void)g_string_append( ddl, ")" );
+
+    return g_string_free( ddl, FALSE );
 }
 
 static /*@ null @*/ gchar*
 conn_create_table_ddl_sqlite3( GncSqlConnection* conn,
-							const gchar* table_name,
-							const GList* col_info_list )
+                               const gchar* table_name,
+                               const GList* col_info_list )
 {
-	GString* ddl;
-	const GList* list_node;
-	guint col_num;
-	gchar* type_name;
+    GString* ddl;
+    const GList* list_node;
+    guint col_num;
+    gchar* type_name;
 
-	g_return_val_if_fail( conn != NULL, NULL );
-	g_return_val_if_fail( table_name != NULL, NULL );
-	g_return_val_if_fail( col_info_list != NULL, NULL );
-    
-	ddl = g_string_new( "" );
-	g_string_printf( ddl, "CREATE TABLE %s (", table_name );
-    for( list_node = col_info_list, col_num = 0; list_node != NULL;
-				list_node = list_node->next, col_num++ ) {
-		GncSqlColumnInfo* info = (GncSqlColumnInfo*)(list_node->data);
+    g_return_val_if_fail( conn != NULL, NULL );
+    g_return_val_if_fail( table_name != NULL, NULL );
+    g_return_val_if_fail( col_info_list != NULL, NULL );
 
-		if( col_num != 0 ) {
-			(void)g_string_append( ddl, ", " );
-		}
-		if( info->type == BCT_INT ) {
-			type_name = "integer";
-		} else if( info->type == BCT_INT64 ) {
-			type_name = "bigint";
-		} else if( info->type == BCT_DOUBLE ) {
-			type_name = "float8";
-		} else if( info->type == BCT_STRING || info->type == BCT_DATE
-				|| info->type == BCT_DATETIME ) {
-			type_name = "text";
-		} else {
-			PERR( "Unknown column type: %d\n", info->type );
-			type_name = "";
-		}
-		g_string_append_printf( ddl, "%s %s", info->name, type_name );
-    	if( info->size != 0 ) {
-			(void)g_string_append_printf( ddl, "(%d)", info->size );
-    	}
-		if( info->is_primary_key ) {
-			(void)g_string_append( ddl, " PRIMARY KEY" );
-		}
-		if( info->is_autoinc ) {
-		    (void)g_string_append( ddl, " AUTOINCREMENT" );
-		}
-		if( !info->null_allowed ) {
-			(void)g_string_append( ddl, " NOT NULL" );
-		}
-		g_free( info->name );
-		g_free( info );
+    ddl = g_string_new( "" );
+    g_string_printf( ddl, "CREATE TABLE %s (", table_name );
+    for ( list_node = col_info_list, col_num = 0; list_node != NULL;
+            list_node = list_node->next, col_num++ )
+    {
+        GncSqlColumnInfo* info = (GncSqlColumnInfo*)(list_node->data);
+
+        if ( col_num != 0 )
+        {
+            (void)g_string_append( ddl, ", " );
+        }
+        if ( info->type == BCT_INT )
+        {
+            type_name = "integer";
+        }
+        else if ( info->type == BCT_INT64 )
+        {
+            type_name = "bigint";
+        }
+        else if ( info->type == BCT_DOUBLE )
+        {
+            type_name = "float8";
+        }
+        else if ( info->type == BCT_STRING || info->type == BCT_DATE
+                  || info->type == BCT_DATETIME )
+        {
+            type_name = "text";
+        }
+        else
+        {
+            PERR( "Unknown column type: %d\n", info->type );
+            type_name = "";
+        }
+        g_string_append_printf( ddl, "%s %s", info->name, type_name );
+        if ( info->size != 0 )
+        {
+            (void)g_string_append_printf( ddl, "(%d)", info->size );
+        }
+        if ( info->is_primary_key )
+        {
+            (void)g_string_append( ddl, " PRIMARY KEY" );
+        }
+        if ( info->is_autoinc )
+        {
+            (void)g_string_append( ddl, " AUTOINCREMENT" );
+        }
+        if ( !info->null_allowed )
+        {
+            (void)g_string_append( ddl, " NOT NULL" );
+        }
+        g_free( info->name );
+        g_free( info );
     }
-	(void)g_string_append( ddl, ")" );
-        
-	return g_string_free( ddl, FALSE );
+    (void)g_string_append( ddl, ")" );
+
+    return g_string_free( ddl, FALSE );
 }
 
 static /*@ null @*/ gchar*
 conn_create_table_ddl_mysql( GncSqlConnection* conn, const gchar* table_name,
-				const GList* col_info_list )
+                             const GList* col_info_list )
 {
-	GString* ddl;
-	const GList* list_node;
-	guint col_num;
-	gchar* type_name;
+    GString* ddl;
+    const GList* list_node;
+    guint col_num;
+    gchar* type_name;
 
-	g_return_val_if_fail( conn != NULL, NULL );
-	g_return_val_if_fail( table_name != NULL, NULL );
-	g_return_val_if_fail( col_info_list != NULL, NULL );
-    
-	ddl = g_string_new( "" );
-	g_string_printf( ddl, "CREATE TABLE %s (", table_name );
-    for( list_node = col_info_list, col_num = 0; list_node != NULL;
-				list_node = list_node->next, col_num++ ) {
-		GncSqlColumnInfo* info = (GncSqlColumnInfo*)(list_node->data);
+    g_return_val_if_fail( conn != NULL, NULL );
+    g_return_val_if_fail( table_name != NULL, NULL );
+    g_return_val_if_fail( col_info_list != NULL, NULL );
 
-		if( col_num != 0 ) {
-			(void)g_string_append( ddl, ", " );
-		}
-		if( info->type == BCT_INT ) {
-			type_name = "integer";
-		} else if( info->type == BCT_INT64 ) {
-			type_name = "bigint";
-		} else if( info->type == BCT_DOUBLE ) {
-			type_name = "double";
-		} else if( info->type == BCT_STRING ) {
-			type_name = "varchar";
-		} else if( info->type == BCT_DATE ) {
-			info->size = 0;
-			type_name = "date";
-		} else if( info->type == BCT_DATETIME ) {
-			info->size = 0;
-			type_name = "timestamp";
-		} else {
-			PERR( "Unknown column type: %d\n", info->type );
-			type_name = "";
-		}
-		g_string_append_printf( ddl, "%s %s", info->name, type_name );
-    	if( info->size != 0 ) {
-			g_string_append_printf( ddl, "(%d)", info->size );
-    	}
-		if( info->is_unicode ) {
-		    (void)g_string_append( ddl, " CHARACTER SET utf8" );
-		}
-		if( info->is_primary_key ) {
-			(void)g_string_append( ddl, " PRIMARY KEY" );
-		}
-		if( info->is_autoinc ) {
-		    (void)g_string_append( ddl, " AUTO_INCREMENT" );
-		}
-		if( !info->null_allowed ) {
-			(void)g_string_append( ddl, " NOT NULL" );
-		}
-		g_free( info->name );
-		g_free( info );
+    ddl = g_string_new( "" );
+    g_string_printf( ddl, "CREATE TABLE %s (", table_name );
+    for ( list_node = col_info_list, col_num = 0; list_node != NULL;
+            list_node = list_node->next, col_num++ )
+    {
+        GncSqlColumnInfo* info = (GncSqlColumnInfo*)(list_node->data);
+
+        if ( col_num != 0 )
+        {
+            (void)g_string_append( ddl, ", " );
+        }
+        if ( info->type == BCT_INT )
+        {
+            type_name = "integer";
+        }
+        else if ( info->type == BCT_INT64 )
+        {
+            type_name = "bigint";
+        }
+        else if ( info->type == BCT_DOUBLE )
+        {
+            type_name = "double";
+        }
+        else if ( info->type == BCT_STRING )
+        {
+            type_name = "varchar";
+        }
+        else if ( info->type == BCT_DATE )
+        {
+            info->size = 0;
+            type_name = "date";
+        }
+        else if ( info->type == BCT_DATETIME )
+        {
+            info->size = 0;
+            type_name = "timestamp";
+        }
+        else
+        {
+            PERR( "Unknown column type: %d\n", info->type );
+            type_name = "";
+        }
+        g_string_append_printf( ddl, "%s %s", info->name, type_name );
+        if ( info->size != 0 )
+        {
+            g_string_append_printf( ddl, "(%d)", info->size );
+        }
+        if ( info->is_unicode )
+        {
+            (void)g_string_append( ddl, " CHARACTER SET utf8" );
+        }
+        if ( info->is_primary_key )
+        {
+            (void)g_string_append( ddl, " PRIMARY KEY" );
+        }
+        if ( info->is_autoinc )
+        {
+            (void)g_string_append( ddl, " AUTO_INCREMENT" );
+        }
+        if ( !info->null_allowed )
+        {
+            (void)g_string_append( ddl, " NOT NULL" );
+        }
+        g_free( info->name );
+        g_free( info );
     }
-	(void)g_string_append( ddl, ")" );
-        
-	return g_string_free( ddl, FALSE );
+    (void)g_string_append( ddl, ")" );
+
+    return g_string_free( ddl, FALSE );
 }
 
 static /*@ null @*/ gchar*
 conn_create_table_ddl_pgsql( GncSqlConnection* conn, const gchar* table_name,
-				const GList* col_info_list )
+                             const GList* col_info_list )
 {
-	GString* ddl;
-	const GList* list_node;
-	guint col_num;
-	gchar* type_name;
-	gboolean is_unicode = FALSE;
+    GString* ddl;
+    const GList* list_node;
+    guint col_num;
+    gchar* type_name;
+    gboolean is_unicode = FALSE;
 
-	g_return_val_if_fail( conn != NULL, NULL );
-	g_return_val_if_fail( table_name != NULL, NULL );
-	g_return_val_if_fail( col_info_list != NULL, NULL );
-    
-	ddl = g_string_new( "" );
-	g_string_printf( ddl, "CREATE TABLE %s (", table_name );
-    for( list_node = col_info_list, col_num = 0; list_node != NULL;
-				list_node = list_node->next, col_num++ ) {
-		GncSqlColumnInfo* info = (GncSqlColumnInfo*)(list_node->data);
+    g_return_val_if_fail( conn != NULL, NULL );
+    g_return_val_if_fail( table_name != NULL, NULL );
+    g_return_val_if_fail( col_info_list != NULL, NULL );
 
-		if( col_num != 0 ) {
-			(void)g_string_append( ddl, ", " );
-		}
-		if( info->type == BCT_INT ) {
-			if( info->is_autoinc ) {
-				type_name = "serial";
-			} else {
-				type_name = "integer";
-			}
-		} else if( info->type == BCT_INT64 ) {
-			type_name = "int8";
-		} else if( info->type == BCT_DOUBLE ) {
-			type_name = "double precision";
-		} else if( info->type == BCT_STRING ) {
-			type_name = "varchar";
-		} else if( info->type == BCT_DATE ) {
-			info->size = 0;
-			type_name = "date";
-		} else if( info->type == BCT_DATETIME ) {
-			info->size = 0;
-			type_name = "timestamp without time zone";
-		} else {
-			PERR( "Unknown column type: %d\n", info->type );
-			type_name = "";
-		}
-		g_string_append_printf( ddl, "%s %s", info->name, type_name );
-    	if( info->size != 0 ) {
-			g_string_append_printf( ddl, "(%d)", info->size );
-    	}
-		if( info->is_primary_key ) {
-			(void)g_string_append( ddl, " PRIMARY KEY" );
-		}
-		if( !info->null_allowed ) {
-			(void)g_string_append( ddl, " NOT NULL" );
-		}
-		is_unicode = is_unicode || info->is_unicode;
-		g_free( info->name );
-		g_free( info );
+    ddl = g_string_new( "" );
+    g_string_printf( ddl, "CREATE TABLE %s (", table_name );
+    for ( list_node = col_info_list, col_num = 0; list_node != NULL;
+            list_node = list_node->next, col_num++ )
+    {
+        GncSqlColumnInfo* info = (GncSqlColumnInfo*)(list_node->data);
+
+        if ( col_num != 0 )
+        {
+            (void)g_string_append( ddl, ", " );
+        }
+        if ( info->type == BCT_INT )
+        {
+            if ( info->is_autoinc )
+            {
+                type_name = "serial";
+            }
+            else
+            {
+                type_name = "integer";
+            }
+        }
+        else if ( info->type == BCT_INT64 )
+        {
+            type_name = "int8";
+        }
+        else if ( info->type == BCT_DOUBLE )
+        {
+            type_name = "double precision";
+        }
+        else if ( info->type == BCT_STRING )
+        {
+            type_name = "varchar";
+        }
+        else if ( info->type == BCT_DATE )
+        {
+            info->size = 0;
+            type_name = "date";
+        }
+        else if ( info->type == BCT_DATETIME )
+        {
+            info->size = 0;
+            type_name = "timestamp without time zone";
+        }
+        else
+        {
+            PERR( "Unknown column type: %d\n", info->type );
+            type_name = "";
+        }
+        g_string_append_printf( ddl, "%s %s", info->name, type_name );
+        if ( info->size != 0 )
+        {
+            g_string_append_printf( ddl, "(%d)", info->size );
+        }
+        if ( info->is_primary_key )
+        {
+            (void)g_string_append( ddl, " PRIMARY KEY" );
+        }
+        if ( !info->null_allowed )
+        {
+            (void)g_string_append( ddl, " NOT NULL" );
+        }
+        is_unicode = is_unicode || info->is_unicode;
+        g_free( info->name );
+        g_free( info );
     }
-	(void)g_string_append( ddl, ")" );
-	if( is_unicode ) {
-	}
-        
-	return g_string_free( ddl, FALSE );
+    (void)g_string_append( ddl, ")" );
+    if ( is_unicode )
+    {
+    }
+
+    return g_string_free( ddl, FALSE );
 }
 
 static gboolean
 conn_create_table( GncSqlConnection* conn, const gchar* table_name,
-				    GList* col_info_list )
+                   GList* col_info_list )
 {
-	GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
-	gchar* ddl;
-	dbi_result result;
+    GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    gchar* ddl;
+    dbi_result result;
 
-	g_return_val_if_fail( conn != NULL, FALSE );
-	g_return_val_if_fail( table_name != NULL, FALSE );
-	g_return_val_if_fail( col_info_list != NULL, FALSE );
-    
+    g_return_val_if_fail( conn != NULL, FALSE );
+    g_return_val_if_fail( table_name != NULL, FALSE );
+    g_return_val_if_fail( col_info_list != NULL, FALSE );
 
-	ddl = dbi_conn->provider->create_table_ddl( conn, table_name,
-										col_info_list );
+
+    ddl = dbi_conn->provider->create_table_ddl( conn, table_name,
+            col_info_list );
     g_list_free( col_info_list );
-	if( ddl != NULL ) {
-		gint status;
+    if ( ddl != NULL )
+    {
+        gint status;
 
-		DEBUG( "SQL: %s\n", ddl );
-		result = dbi_conn_query( dbi_conn->conn, ddl );
-		g_free( ddl );
-		status = dbi_result_free( result );
-		if( status < 0 ) {
-			PERR( "Error in dbi_result_free() result\n" );
-			qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
-		}
-	} else {
-		return FALSE;
-	}
+        DEBUG( "SQL: %s\n", ddl );
+        result = dbi_conn_query( dbi_conn->conn, ddl );
+        g_free( ddl );
+        status = dbi_result_free( result );
+        if ( status < 0 )
+        {
+            PERR( "Error in dbi_result_free() result\n" );
+            qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
+        }
+    }
+    else
+    {
+        return FALSE;
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 static gboolean
 conn_create_index( /*@ unused @*/ GncSqlConnection* conn, /*@ unused @*/ const gchar* index_name,
-					/*@ unused @*/ const gchar* table_name, /*@ unused @*/ const GncSqlColumnTableEntry* col_table )
+                                  /*@ unused @*/ const gchar* table_name, /*@ unused @*/ const GncSqlColumnTableEntry* col_table )
 {
-	GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
-	gchar* ddl;
-	dbi_result result;
-	gint status;
+    GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    gchar* ddl;
+    dbi_result result;
+    gint status;
 
-	g_return_val_if_fail( conn != NULL, FALSE );
-	g_return_val_if_fail( index_name != NULL, FALSE );
-	g_return_val_if_fail( table_name != NULL, FALSE );
-	g_return_val_if_fail( col_table != NULL, FALSE );
-    
-	ddl = create_index_ddl( conn, index_name, table_name, col_table );
-	if( ddl != NULL ) {
-		gint status;
+    g_return_val_if_fail( conn != NULL, FALSE );
+    g_return_val_if_fail( index_name != NULL, FALSE );
+    g_return_val_if_fail( table_name != NULL, FALSE );
+    g_return_val_if_fail( col_table != NULL, FALSE );
 
-		DEBUG( "SQL: %s\n", ddl );
-		result = dbi_conn_query( dbi_conn->conn, ddl );
-		g_free( ddl );
-		status = dbi_result_free( result );
-		if( status < 0 ) {
-			PERR( "Error in dbi_result_free() result\n" );
-			qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
-		}
-	} else {
-		return FALSE;
-	}
+    ddl = create_index_ddl( conn, index_name, table_name, col_table );
+    if ( ddl != NULL )
+    {
+        gint status;
 
-	return TRUE;
+        DEBUG( "SQL: %s\n", ddl );
+        result = dbi_conn_query( dbi_conn->conn, ddl );
+        g_free( ddl );
+        status = dbi_result_free( result );
+        if ( status < 0 )
+        {
+            PERR( "Error in dbi_result_free() result\n" );
+            qof_backend_set_error( dbi_conn->qbe, ERR_BACKEND_SERVER_ERR );
+        }
+    }
+    else
+    {
+        return FALSE;
+    }
+
+    return TRUE;
 }
 
 static /*@ null @*/ gchar*
 conn_quote_string( const GncSqlConnection* conn, gchar* unquoted_str )
 {
-	GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
-	gchar* quoted_str;
-	size_t size;
+    GncDbiSqlConnection* dbi_conn = (GncDbiSqlConnection*)conn;
+    gchar* quoted_str;
+    size_t size;
 
-	size = dbi_conn_quote_string_copy( dbi_conn->conn, unquoted_str,
-									&quoted_str );
-	if( size != 0 ) {
-		return quoted_str;
-	} else {
-		return NULL;
-	}
+    size = dbi_conn_quote_string_copy( dbi_conn->conn, unquoted_str,
+                                       &quoted_str );
+    if ( size != 0 )
+    {
+        return quoted_str;
+    }
+    else
+    {
+        return NULL;
+    }
 }
 
 static GSList*
 conn_get_table_list( dbi_conn conn, const gchar* dbname )
 {
-	dbi_result tables;
-	GSList* list = NULL;
+    dbi_result tables;
+    GSList* list = NULL;
 
-	tables = dbi_conn_get_table_list( conn, dbname, NULL );
-	while( dbi_result_next_row( tables ) != 0 ) {
-		const gchar* table_name;
-		dbi_result result;
+    tables = dbi_conn_get_table_list( conn, dbname, NULL );
+    while ( dbi_result_next_row( tables ) != 0 )
+    {
+        const gchar* table_name;
+        dbi_result result;
 
-		table_name = dbi_result_get_string_idx( tables, 1 );
-		list = g_slist_prepend( list, strdup( table_name ) );
-	}
-	dbi_result_free( tables );
+        table_name = dbi_result_get_string_idx( tables, 1 );
+        list = g_slist_prepend( list, strdup( table_name ) );
+    }
+    dbi_result_free( tables );
     return list;
 }
 
 static GSList*
 conn_get_table_list_pgsql( dbi_conn conn, const gchar* dbname )
 {
-	gboolean change_made;
+    gboolean change_made;
 
-	/* Return the list, but remove the tables that postgresql adds from the information schema. */
-	GSList* list = conn_get_table_list( conn, dbname );
-	change_made = TRUE;
-	while( list != NULL && change_made ) {
-		GSList* node;
+    /* Return the list, but remove the tables that postgresql adds from the information schema. */
+    GSList* list = conn_get_table_list( conn, dbname );
+    change_made = TRUE;
+    while ( list != NULL && change_made )
+    {
+        GSList* node;
 
-		change_made = FALSE;
-		for( node = list; node != NULL; node = node->next ) {
-			const gchar* table_name = (const gchar*)node->data;
+        change_made = FALSE;
+        for ( node = list; node != NULL; node = node->next )
+        {
+            const gchar* table_name = (const gchar*)node->data;
 
-			if( strcmp( table_name, "sql_features" ) == 0 ||
-					strcmp( table_name, "sql_implementation_info" ) == 0 ||
-					strcmp( table_name, "sql_languages" ) == 0 ||
-					strcmp( table_name, "sql_packages" ) == 0 ||
-					strcmp( table_name, "sql_parts" ) == 0 ||
-					strcmp( table_name, "sql_sizing" ) == 0 ||
-					strcmp( table_name, "sql_sizing_profiles" ) == 0 ) {
-				g_free( node->data );
-				list = g_slist_delete_link( list, node );
-				change_made = TRUE;
-				break;
-			}
-		}
-	}
+            if ( strcmp( table_name, "sql_features" ) == 0 ||
+                    strcmp( table_name, "sql_implementation_info" ) == 0 ||
+                    strcmp( table_name, "sql_languages" ) == 0 ||
+                    strcmp( table_name, "sql_packages" ) == 0 ||
+                    strcmp( table_name, "sql_parts" ) == 0 ||
+                    strcmp( table_name, "sql_sizing" ) == 0 ||
+                    strcmp( table_name, "sql_sizing_profiles" ) == 0 )
+            {
+                g_free( node->data );
+                list = g_slist_delete_link( list, node );
+                change_made = TRUE;
+                break;
+            }
+        }
+    }
     return list;
 }
 
 static GncSqlConnection*
 create_dbi_connection( /*@ observer @*/ provider_functions_t* provider,
-					/*@ observer @*/ QofBackend* qbe,
-					/*@ observer @*/ dbi_conn conn )
+                                        /*@ observer @*/ QofBackend* qbe,
+                                        /*@ observer @*/ dbi_conn conn )
 {
-	GncDbiSqlConnection* dbi_conn;
+    GncDbiSqlConnection* dbi_conn;
 
-	dbi_conn = g_new0( GncDbiSqlConnection, 1 );
-	g_assert( dbi_conn != NULL );
+    dbi_conn = g_new0( GncDbiSqlConnection, 1 );
+    g_assert( dbi_conn != NULL );
 
-	dbi_conn->base.dispose = conn_dispose;
-	dbi_conn->base.executeSelectStatement = conn_execute_select_statement;
-	dbi_conn->base.executeNonSelectStatement = conn_execute_nonselect_statement;
-	dbi_conn->base.createStatementFromSql = conn_create_statement_from_sql;
-	dbi_conn->base.doesTableExist = conn_does_table_exist;
-	dbi_conn->base.beginTransaction = conn_begin_transaction;
-	dbi_conn->base.rollbackTransaction = conn_rollback_transaction;
-	dbi_conn->base.commitTransaction = conn_commit_transaction;
-	dbi_conn->base.createTable = conn_create_table;
-	dbi_conn->base.createIndex = conn_create_index;
-	dbi_conn->base.quoteString = conn_quote_string;
-	dbi_conn->qbe = qbe;
-	dbi_conn->conn = conn;
-	dbi_conn->provider = provider;
+    dbi_conn->base.dispose = conn_dispose;
+    dbi_conn->base.executeSelectStatement = conn_execute_select_statement;
+    dbi_conn->base.executeNonSelectStatement = conn_execute_nonselect_statement;
+    dbi_conn->base.createStatementFromSql = conn_create_statement_from_sql;
+    dbi_conn->base.doesTableExist = conn_does_table_exist;
+    dbi_conn->base.beginTransaction = conn_begin_transaction;
+    dbi_conn->base.rollbackTransaction = conn_rollback_transaction;
+    dbi_conn->base.commitTransaction = conn_commit_transaction;
+    dbi_conn->base.createTable = conn_create_table;
+    dbi_conn->base.createIndex = conn_create_index;
+    dbi_conn->base.quoteString = conn_quote_string;
+    dbi_conn->qbe = qbe;
+    dbi_conn->conn = conn;
+    dbi_conn->provider = provider;
 
-	return (GncSqlConnection*)dbi_conn;
+    return (GncSqlConnection*)dbi_conn;
 }
 
 /* ========================== END OF FILE ===================== */

Modified: gnucash/trunk/src/backend/dbi/gncmod-backend-dbi.c
===================================================================
--- gnucash/trunk/src/backend/dbi/gncmod-backend-dbi.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/dbi/gncmod-backend-dbi.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,46 +20,50 @@
 int gnc_module_revision = 0;
 int gnc_module_age      = 0;
 
-/*@ dependent @*//*@ null @*/ static GNCModule engine;
+/*@ dependent @*//*@ null @*/
+static GNCModule engine;
 
 gchar *
 gnc_module_path(void)
 {
-	return g_strdup( "gnucash/backend/dbi" );
+    return g_strdup( "gnucash/backend/dbi" );
 }
 
 gchar *
 gnc_module_description(void)
 {
-	return g_strdup( "The DBI/SQL backend for GnuCash" );
+    return g_strdup( "The DBI/SQL backend for GnuCash" );
 }
 
 int
 gnc_module_init(int refcount)
 {
-	engine = gnc_module_load( "gnucash/engine", 0 );
-	if( !engine ) return FALSE;
+    engine = gnc_module_load( "gnucash/engine", 0 );
+    if ( !engine ) return FALSE;
 
-	/* Need to initialize g-type engine for gconf */
-	if (refcount == 0) {
-    	g_type_init();
-	}
+    /* Need to initialize g-type engine for gconf */
+    if (refcount == 0)
+    {
+        g_type_init();
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 int
 gnc_module_end(int refcount)
 {
-	int unload = TRUE;
+    int unload = TRUE;
 
-	if( engine != NULL ) {
-    	unload = gnc_module_unload(engine);
-	}
+    if ( engine != NULL )
+    {
+        unload = gnc_module_unload(engine);
+    }
 
-	if( refcount == 0 ) {
-    	engine = NULL;
-	}
+    if ( refcount == 0 )
+    {
+        engine = NULL;
+    }
 
-	return unload;
+    return unload;
 }

Modified: gnucash/trunk/src/backend/dbi/test/test-dbi-basic.c
===================================================================
--- gnucash/trunk/src/backend/dbi/test/test-dbi-basic.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/dbi/test/test-dbi-basic.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,7 +22,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 #include "qof.h"
 #include "cashobjects.h"
@@ -41,60 +41,62 @@
 create_session(void)
 {
     QofSession* session = qof_session_new();
-	QofBook* book = qof_session_get_book( session );
-	Account* root = gnc_book_get_root_account( book );
-	Account* a;
-	KvpFrame* frame;
-	Timespec ts;
-	struct timeval tv;
+    QofBook* book = qof_session_get_book( session );
+    Account* root = gnc_book_get_root_account( book );
+    Account* a;
+    KvpFrame* frame;
+    Timespec ts;
+    struct timeval tv;
 
-	a = xaccMallocAccount( book );
-	xaccAccountSetType( a, ACCT_TYPE_BANK );
-	xaccAccountSetName( a, "Bank" );
+    a = xaccMallocAccount( book );
+    xaccAccountSetType( a, ACCT_TYPE_BANK );
+    xaccAccountSetName( a, "Bank" );
 
-	frame = qof_instance_get_slots( QOF_INSTANCE(a) );
-	kvp_frame_set_gint64( frame, "int64-val", 100 );
-	kvp_frame_set_double( frame, "double-val", 3.14159 );
-	kvp_frame_set_numeric( frame, "numeric-val", gnc_numeric_zero() );
+    frame = qof_instance_get_slots( QOF_INSTANCE(a) );
+    kvp_frame_set_gint64( frame, "int64-val", 100 );
+    kvp_frame_set_double( frame, "double-val", 3.14159 );
+    kvp_frame_set_numeric( frame, "numeric-val", gnc_numeric_zero() );
 
-	time( &(tv.tv_sec) );
-	tv.tv_usec = 0;
-	ts.tv_sec = tv.tv_sec;
-	ts.tv_nsec = 1000*tv.tv_usec;
-	kvp_frame_set_timespec( frame, "timespec-val", ts );
+    time( &(tv.tv_sec) );
+    tv.tv_usec = 0;
+    ts.tv_sec = tv.tv_sec;
+    ts.tv_nsec = 1000 * tv.tv_usec;
+    kvp_frame_set_timespec( frame, "timespec-val", ts );
 
-	kvp_frame_set_string( frame, "string-val", "abcdefghijklmnop" );
-	kvp_frame_set_guid( frame, "guid-val", qof_instance_get_guid( QOF_INSTANCE(a) ) );
+    kvp_frame_set_string( frame, "string-val", "abcdefghijklmnop" );
+    kvp_frame_set_guid( frame, "guid-val", qof_instance_get_guid( QOF_INSTANCE(a) ) );
 
-	gnc_account_append_child( root, a );
+    gnc_account_append_child( root, a );
 
-	return session;
+    return session;
 }
 
 int main (int argc, char ** argv)
 {
-	gchar* filename;
+    gchar* filename;
     QofSession* session_1;
-	
+
     qof_init();
     cashobjects_register();
     qof_load_backend_library ("../.libs/", GNC_LIB_NAME);
 
-	// Create a session with data
-	session_1 = create_session();
-	filename = tempnam( "/tmp", "test-sqlite3-" );
-	printf( "Using filename: %s\n", filename );
-	test_dbi_store_and_reload( "sqlite3", session_1, filename );
-	printf( "TEST_MYSQL_URL='%s'\n", TEST_MYSQL_URL );
-	if( strlen( TEST_MYSQL_URL ) > 0 ) {
-	    session_1 = create_session();
-		test_dbi_store_and_reload( "mysql", session_1, TEST_MYSQL_URL );
-	}
-	printf( "TEST_PGSQL_URL='%s'\n", TEST_PGSQL_URL );
-	if( strlen( TEST_PGSQL_URL ) > 0 ) {
-	    session_1 = create_session();
-		test_dbi_store_and_reload( "pgsql", session_1, TEST_PGSQL_URL );
-	}
+    // Create a session with data
+    session_1 = create_session();
+    filename = tempnam( "/tmp", "test-sqlite3-" );
+    printf( "Using filename: %s\n", filename );
+    test_dbi_store_and_reload( "sqlite3", session_1, filename );
+    printf( "TEST_MYSQL_URL='%s'\n", TEST_MYSQL_URL );
+    if ( strlen( TEST_MYSQL_URL ) > 0 )
+    {
+        session_1 = create_session();
+        test_dbi_store_and_reload( "mysql", session_1, TEST_MYSQL_URL );
+    }
+    printf( "TEST_PGSQL_URL='%s'\n", TEST_PGSQL_URL );
+    if ( strlen( TEST_PGSQL_URL ) > 0 )
+    {
+        session_1 = create_session();
+        test_dbi_store_and_reload( "pgsql", session_1, TEST_PGSQL_URL );
+    }
     print_test_results();
     qof_close();
     exit(get_rv());

Modified: gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.c
===================================================================
--- gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,7 +22,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 #include "qof.h"
 #include "cashobjects.h"
@@ -40,317 +40,318 @@
 static gboolean
 test_commodity_equal(const gnc_commodity * a, const gnc_commodity * b)
 {
-  if (a == b) return TRUE;
+    if (a == b) return TRUE;
 
-  if (!a || !b)
-  {
-    DEBUG ("one is NULL");
-    return FALSE;
-  }
+    if (!a || !b)
+    {
+        DEBUG ("one is NULL");
+        return FALSE;
+    }
 
-  {
-	const gchar* ns1 = gnc_commodity_get_namespace(a);
-	const gchar* ns2 = gnc_commodity_get_namespace(b);
+    {
+        const gchar* ns1 = gnc_commodity_get_namespace(a);
+        const gchar* ns2 = gnc_commodity_get_namespace(b);
 
-  	if( ns1 != ns2 && safe_strcmp(ns1, ns2) != 0 )
+        if ( ns1 != ns2 && safe_strcmp(ns1, ns2) != 0 )
+        {
+            DEBUG ("namespaces differ: %s vs %s", ns1, ns2 );
+            return FALSE;
+        }
+    }
+
+    if (safe_strcmp(gnc_commodity_get_mnemonic(a), gnc_commodity_get_mnemonic(b)) != 0)
     {
-      DEBUG ("namespaces differ: %s vs %s", ns1, ns2 );
-      return FALSE;
+        DEBUG ("mnemonics differ: %s vs %s", gnc_commodity_get_mnemonic(a), gnc_commodity_get_mnemonic(b));
+        return FALSE;
     }
-  }
 
-  if (safe_strcmp(gnc_commodity_get_mnemonic(a), gnc_commodity_get_mnemonic(b)) != 0)
-  {
-    DEBUG ("mnemonics differ: %s vs %s", gnc_commodity_get_mnemonic(a), gnc_commodity_get_mnemonic(b));
-    return FALSE;
-  }
+    if (safe_strcmp(gnc_commodity_get_fullname(a), gnc_commodity_get_fullname(b)) != 0)
+    {
+        DEBUG ("fullnames differ: %s vs %s", gnc_commodity_get_fullname(a), gnc_commodity_get_fullname(b));
+        return FALSE;
+    }
 
-  if (safe_strcmp(gnc_commodity_get_fullname(a), gnc_commodity_get_fullname(b)) != 0)
-  {
-    DEBUG ("fullnames differ: %s vs %s", gnc_commodity_get_fullname(a), gnc_commodity_get_fullname(b));
-    return FALSE;
-  }
+    if (safe_strcmp(gnc_commodity_get_cusip(a), gnc_commodity_get_cusip(b)) != 0)
+    {
+        DEBUG ("cusips differ: %s vs %s", gnc_commodity_get_cusip(a), gnc_commodity_get_cusip(b));
+        return FALSE;
+    }
 
-  if (safe_strcmp(gnc_commodity_get_cusip(a), gnc_commodity_get_cusip(b)) != 0)
-  {
-    DEBUG ("cusips differ: %s vs %s", gnc_commodity_get_cusip(a), gnc_commodity_get_cusip(b));
-    return FALSE;
-  }
+    if (gnc_commodity_get_fraction(a) != gnc_commodity_get_fraction(b))
+    {
+        DEBUG ("fractions differ: %d vs %d", gnc_commodity_get_fraction(a), gnc_commodity_get_fraction(b));
+        return FALSE;
+    }
 
-  if (gnc_commodity_get_fraction(a) != gnc_commodity_get_fraction(b))
-  {
-    DEBUG ("fractions differ: %d vs %d", gnc_commodity_get_fraction(a), gnc_commodity_get_fraction(b));
-    return FALSE;
-  }
-
-  return TRUE;
+    return TRUE;
 }
 
 static gboolean
 testAcctChildrenEqual(const GList *na,
-		      const GList *nb,
-		      gboolean check_guids)
+                      const GList *nb,
+                      gboolean check_guids)
 {
-  if ((!na && nb) || (na && !nb))
-  {
-    PWARN ("only one has accounts");
-    return(FALSE);
-  }
+    if ((!na && nb) || (na && !nb))
+    {
+        PWARN ("only one has accounts");
+        return(FALSE);
+    }
 
-  while (na && nb)
-  {
-    Account *aa = na->data;
-    Account *ab = nb->data;
-
-    if (!testAccountEqual(aa, ab, check_guids))
+    while (na && nb)
     {
-      char sa[GUID_ENCODING_LENGTH + 1];
-      char sb[GUID_ENCODING_LENGTH + 1];
+        Account *aa = na->data;
+        Account *ab = nb->data;
 
-      guid_to_string_buff (xaccAccountGetGUID (aa), sa);
-      guid_to_string_buff (xaccAccountGetGUID (ab), sb);
+        if (!testAccountEqual(aa, ab, check_guids))
+        {
+            char sa[GUID_ENCODING_LENGTH + 1];
+            char sb[GUID_ENCODING_LENGTH + 1];
 
-      PWARN ("accounts %s and %s differ", sa, sb);
+            guid_to_string_buff (xaccAccountGetGUID (aa), sa);
+            guid_to_string_buff (xaccAccountGetGUID (ab), sb);
 
-      return(FALSE);
+            PWARN ("accounts %s and %s differ", sa, sb);
+
+            return(FALSE);
+        }
+
+        na = na->next;
+        nb = nb->next;
     }
 
-    na = na->next;
-    nb = nb->next;
-  }
+    if (na || nb)
+    {
+        PWARN ("different numbers of accounts");
+        return(FALSE);
+    }
 
-  if (na || nb)
-  {
-    PWARN ("different numbers of accounts");
-    return(FALSE);
-  }
-
-  return(TRUE);
+    return(TRUE);
 }
 
 static gboolean
 testAccountEqual(const Account *aa, const Account *ab, gboolean check_guids)
 {
-  if(!aa && !ab) return TRUE;
+    if (!aa && !ab) return TRUE;
 
-  g_return_val_if_fail(GNC_IS_ACCOUNT(aa), FALSE);
-  g_return_val_if_fail(GNC_IS_ACCOUNT(ab), FALSE);
+    g_return_val_if_fail(GNC_IS_ACCOUNT(aa), FALSE);
+    g_return_val_if_fail(GNC_IS_ACCOUNT(ab), FALSE);
 
-  if (xaccAccountGetType(aa) != xaccAccountGetType(ab))
-  {
-    PWARN ("'%s' and '%s': types differ: %d vs %d",
-			xaccAccountGetName(aa), xaccAccountGetName(ab),
-			xaccAccountGetType(aa), xaccAccountGetType(ab));
-    return FALSE;
-  }
+    if (xaccAccountGetType(aa) != xaccAccountGetType(ab))
+    {
+        PWARN ("'%s' and '%s': types differ: %d vs %d",
+               xaccAccountGetName(aa), xaccAccountGetName(ab),
+               xaccAccountGetType(aa), xaccAccountGetType(ab));
+        return FALSE;
+    }
 
-  if (safe_strcmp(xaccAccountGetName(aa), xaccAccountGetName(ab)) != 0)
-  {
-    PWARN ("names differ: %s vs %s", xaccAccountGetName(aa), xaccAccountGetName(ab));
-    return FALSE;
-  }
+    if (safe_strcmp(xaccAccountGetName(aa), xaccAccountGetName(ab)) != 0)
+    {
+        PWARN ("names differ: %s vs %s", xaccAccountGetName(aa), xaccAccountGetName(ab));
+        return FALSE;
+    }
 
-  if (safe_strcmp(xaccAccountGetCode(aa), xaccAccountGetCode(ab)) != 0)
-  {
-    PWARN ("codes differ: %s vs %s", xaccAccountGetCode(aa), xaccAccountGetCode(ab));
-    return FALSE;
-  }
+    if (safe_strcmp(xaccAccountGetCode(aa), xaccAccountGetCode(ab)) != 0)
+    {
+        PWARN ("codes differ: %s vs %s", xaccAccountGetCode(aa), xaccAccountGetCode(ab));
+        return FALSE;
+    }
 
-  if (safe_strcmp(xaccAccountGetDescription(aa), xaccAccountGetDescription(ab)) != 0)
-  {
-    PWARN ("descriptions differ: %s vs %s", xaccAccountGetDescription(aa), xaccAccountGetDescription(ab));
-    return FALSE;
-  }
+    if (safe_strcmp(xaccAccountGetDescription(aa), xaccAccountGetDescription(ab)) != 0)
+    {
+        PWARN ("descriptions differ: %s vs %s", xaccAccountGetDescription(aa), xaccAccountGetDescription(ab));
+        return FALSE;
+    }
 
-  if (!test_commodity_equal(xaccAccountGetCommodity(aa), xaccAccountGetCommodity(ab)))
-  {
-    PWARN ("commodities differ");
-    return FALSE;
-  }
+    if (!test_commodity_equal(xaccAccountGetCommodity(aa), xaccAccountGetCommodity(ab)))
+    {
+        PWARN ("commodities differ");
+        return FALSE;
+    }
 
-  if(check_guids) {
-    if(qof_instance_guid_compare(aa, ab) != 0)
+    if (check_guids)
     {
-	  gchar guid_a[33];
-	  gchar guid_b[33];
+        if (qof_instance_guid_compare(aa, ab) != 0)
+        {
+            gchar guid_a[33];
+            gchar guid_b[33];
 
-	  guid_to_string_buff( qof_entity_get_guid( QOF_INSTANCE(aa) ), guid_a );
-	  guid_to_string_buff( qof_entity_get_guid( QOF_INSTANCE(ab) ), guid_b );
-      PWARN ("'%s' and '%s': GUIDs differ %s vs %s",
-	  		xaccAccountGetName(aa), xaccAccountGetName(ab),
-			guid_a, guid_b);
-      return FALSE;
+            guid_to_string_buff( qof_entity_get_guid( QOF_INSTANCE(aa) ), guid_a );
+            guid_to_string_buff( qof_entity_get_guid( QOF_INSTANCE(ab) ), guid_b );
+            PWARN ("'%s' and '%s': GUIDs differ %s vs %s",
+                   xaccAccountGetName(aa), xaccAccountGetName(ab),
+                   guid_a, guid_b);
+            return FALSE;
+        }
     }
-  }
 
-  if (kvp_frame_compare(qof_instance_get_slots(QOF_INSTANCE(aa)), qof_instance_get_slots(QOF_INSTANCE(ab))) != 0)
-  {
-    char *frame_a;
-    char *frame_b;
+    if (kvp_frame_compare(qof_instance_get_slots(QOF_INSTANCE(aa)), qof_instance_get_slots(QOF_INSTANCE(ab))) != 0)
+    {
+        char *frame_a;
+        char *frame_b;
 
-    frame_a = kvp_frame_to_string (qof_instance_get_slots(QOF_INSTANCE(aa)));
-    frame_b = kvp_frame_to_string (qof_instance_get_slots(QOF_INSTANCE(ab)));
+        frame_a = kvp_frame_to_string (qof_instance_get_slots(QOF_INSTANCE(aa)));
+        frame_b = kvp_frame_to_string (qof_instance_get_slots(QOF_INSTANCE(ab)));
 
-    PWARN ("kvp frames differ:\n%s\n\nvs\n\n%s", frame_a, frame_b);
+        PWARN ("kvp frames differ:\n%s\n\nvs\n\n%s", frame_a, frame_b);
 
-    g_free (frame_a);
-    g_free (frame_b);
+        g_free (frame_a);
+        g_free (frame_b);
 
-    return FALSE;
-  }
+        return FALSE;
+    }
 
-  if (!gnc_numeric_equal(gnc_account_get_start_balance((Account*)aa), gnc_account_get_start_balance((Account*)ab)))
-  {
-    char *str_a;
-    char *str_b;
+    if (!gnc_numeric_equal(gnc_account_get_start_balance((Account*)aa), gnc_account_get_start_balance((Account*)ab)))
+    {
+        char *str_a;
+        char *str_b;
 
-    str_a = gnc_numeric_to_string(gnc_account_get_start_balance((Account*)aa));
-    str_b = gnc_numeric_to_string(gnc_account_get_start_balance((Account*)ab));
+        str_a = gnc_numeric_to_string(gnc_account_get_start_balance((Account*)aa));
+        str_b = gnc_numeric_to_string(gnc_account_get_start_balance((Account*)ab));
 
-    PWARN ("starting balances differ: %s vs %s", str_a, str_b);
+        PWARN ("starting balances differ: %s vs %s", str_a, str_b);
 
-    g_free (str_a);
-    g_free (str_b);
+        g_free (str_a);
+        g_free (str_b);
 
-    return FALSE;
-  }
+        return FALSE;
+    }
 
-  if (!gnc_numeric_equal(gnc_account_get_start_cleared_balance((Account*)aa),
-                         gnc_account_get_start_cleared_balance((Account*)ab)))
-  {
-    char *str_a;
-    char *str_b;
+    if (!gnc_numeric_equal(gnc_account_get_start_cleared_balance((Account*)aa),
+                           gnc_account_get_start_cleared_balance((Account*)ab)))
+    {
+        char *str_a;
+        char *str_b;
 
-    str_a = gnc_numeric_to_string(gnc_account_get_start_cleared_balance((Account*)aa));
-    str_b = gnc_numeric_to_string(gnc_account_get_start_cleared_balance((Account*)ab));
+        str_a = gnc_numeric_to_string(gnc_account_get_start_cleared_balance((Account*)aa));
+        str_b = gnc_numeric_to_string(gnc_account_get_start_cleared_balance((Account*)ab));
 
-    PWARN ("starting cleared balances differ: %s vs %s", str_a, str_b);
+        PWARN ("starting cleared balances differ: %s vs %s", str_a, str_b);
 
-    g_free (str_a);
-    g_free (str_b);
+        g_free (str_a);
+        g_free (str_b);
 
-    return FALSE;
-  }
+        return FALSE;
+    }
 
-  if (!gnc_numeric_equal(gnc_account_get_start_reconciled_balance((Account*)aa),
-                         gnc_account_get_start_reconciled_balance((Account*)ab)))
-  {
-    char *str_a;
-    char *str_b;
+    if (!gnc_numeric_equal(gnc_account_get_start_reconciled_balance((Account*)aa),
+                           gnc_account_get_start_reconciled_balance((Account*)ab)))
+    {
+        char *str_a;
+        char *str_b;
 
-    str_a = gnc_numeric_to_string(gnc_account_get_start_reconciled_balance((Account*)aa));
-    str_b = gnc_numeric_to_string(gnc_account_get_start_reconciled_balance((Account*)ab));
+        str_a = gnc_numeric_to_string(gnc_account_get_start_reconciled_balance((Account*)aa));
+        str_b = gnc_numeric_to_string(gnc_account_get_start_reconciled_balance((Account*)ab));
 
-    PWARN ("starting reconciled balances differ: %s vs %s", str_a, str_b);
+        PWARN ("starting reconciled balances differ: %s vs %s", str_a, str_b);
 
-    g_free (str_a);
-    g_free (str_b);
+        g_free (str_a);
+        g_free (str_b);
 
-    return FALSE;
-  }
+        return FALSE;
+    }
 
-  if (!gnc_numeric_equal(xaccAccountGetBalance(aa), xaccAccountGetBalance(ab)))
-  {
-    char *str_a;
-    char *str_b;
+    if (!gnc_numeric_equal(xaccAccountGetBalance(aa), xaccAccountGetBalance(ab)))
+    {
+        char *str_a;
+        char *str_b;
 
-    str_a = gnc_numeric_to_string(xaccAccountGetBalance(aa));
-    str_b = gnc_numeric_to_string(xaccAccountGetBalance(ab));
+        str_a = gnc_numeric_to_string(xaccAccountGetBalance(aa));
+        str_b = gnc_numeric_to_string(xaccAccountGetBalance(ab));
 
-    PWARN ("balances differ: %s vs %s", str_a, str_b);
+        PWARN ("balances differ: %s vs %s", str_a, str_b);
 
-    g_free (str_a);
-    g_free (str_b);
+        g_free (str_a);
+        g_free (str_b);
 
-    return FALSE;
-  }
+        return FALSE;
+    }
 
-  if (!gnc_numeric_equal(xaccAccountGetClearedBalance(aa), xaccAccountGetClearedBalance(ab)))
-  {
-    char *str_a;
-    char *str_b;
+    if (!gnc_numeric_equal(xaccAccountGetClearedBalance(aa), xaccAccountGetClearedBalance(ab)))
+    {
+        char *str_a;
+        char *str_b;
 
-    str_a = gnc_numeric_to_string(xaccAccountGetClearedBalance(aa));
-    str_b = gnc_numeric_to_string(xaccAccountGetClearedBalance(ab));
+        str_a = gnc_numeric_to_string(xaccAccountGetClearedBalance(aa));
+        str_b = gnc_numeric_to_string(xaccAccountGetClearedBalance(ab));
 
-    PWARN ("cleared balances differ: %s vs %s", str_a, str_b);
+        PWARN ("cleared balances differ: %s vs %s", str_a, str_b);
 
-    g_free (str_a);
-    g_free (str_b);
+        g_free (str_a);
+        g_free (str_b);
 
-    return FALSE;
-  }
+        return FALSE;
+    }
 
-  if (!gnc_numeric_equal(xaccAccountGetReconciledBalance(aa), xaccAccountGetReconciledBalance(ab)))
-  {
-    char *str_a;
-    char *str_b;
+    if (!gnc_numeric_equal(xaccAccountGetReconciledBalance(aa), xaccAccountGetReconciledBalance(ab)))
+    {
+        char *str_a;
+        char *str_b;
 
-    str_a = gnc_numeric_to_string(xaccAccountGetReconciledBalance(aa));
-    str_b = gnc_numeric_to_string(xaccAccountGetReconciledBalance(ab));
+        str_a = gnc_numeric_to_string(xaccAccountGetReconciledBalance(aa));
+        str_b = gnc_numeric_to_string(xaccAccountGetReconciledBalance(ab));
 
-    PWARN ("reconciled balances differ: %s vs %s", str_a, str_b);
+        PWARN ("reconciled balances differ: %s vs %s", str_a, str_b);
 
-    g_free (str_a);
-    g_free (str_b);
+        g_free (str_a);
+        g_free (str_b);
 
-    return FALSE;
-  }
+        return FALSE;
+    }
 
-  /* no parent; always compare downwards. */
+    /* no parent; always compare downwards. */
 
-  {
-    GList *la = xaccAccountGetSplitList(aa);
-    GList *lb = xaccAccountGetSplitList(ab);
-
-    if ((la && !lb) || (!la && lb))
     {
-      PWARN ("only one has splits");
-      return FALSE;
-    }
+        GList *la = xaccAccountGetSplitList(aa);
+        GList *lb = xaccAccountGetSplitList(ab);
 
-    if(la && lb)
-    {
-      /* presume that the splits are in the same order */
-      while (la && lb)
-      {
-        Split *sa = (Split *) la->data;
-        Split *sb = (Split *) lb->data;
-
-        if (!xaccSplitEqual(sa, sb, check_guids, TRUE, FALSE))
+        if ((la && !lb) || (!la && lb))
         {
-          PWARN ("splits differ");
-          return(FALSE);
+            PWARN ("only one has splits");
+            return FALSE;
         }
 
-        la = la->next;
-        lb = lb->next;
-      }
+        if (la && lb)
+        {
+            /* presume that the splits are in the same order */
+            while (la && lb)
+            {
+                Split *sa = (Split *) la->data;
+                Split *sb = (Split *) lb->data;
 
-      if ((la != NULL) || (lb != NULL))
-      {
-        PWARN ("number of splits differs");
-        return(FALSE);
-      }
+                if (!xaccSplitEqual(sa, sb, check_guids, TRUE, FALSE))
+                {
+                    PWARN ("splits differ");
+                    return(FALSE);
+                }
+
+                la = la->next;
+                lb = lb->next;
+            }
+
+            if ((la != NULL) || (lb != NULL))
+            {
+                PWARN ("number of splits differs");
+                return(FALSE);
+            }
+        }
     }
-  }
 
-  if (!testAcctChildrenEqual(gnc_account_get_children(aa), gnc_account_get_children(ab), check_guids))
-  {
-    PWARN ("children differ");
-    return FALSE;
-  }
+    if (!testAcctChildrenEqual(gnc_account_get_children(aa), gnc_account_get_children(ab), check_guids))
+    {
+        PWARN ("children differ");
+        return FALSE;
+    }
 
-  return(TRUE);
+    return(TRUE);
 }
 static void
 compare_accounts( QofBook* book_1, QofBook* book_2 )
 {
     Account* root_1 = gnc_book_get_root_account( book_1 );
-	Account* root_2 = gnc_book_get_root_account( book_2 );
+    Account* root_2 = gnc_book_get_root_account( book_2 );
 
-	xaccAccountSetHidden( root_1, xaccAccountGetHidden( root_1 ) );
-	do_test( testAccountEqual( root_1, root_2, TRUE ), "Accounts trees match" );
+    xaccAccountSetHidden( root_1, xaccAccountGetHidden( root_1 ) );
+    do_test( testAccountEqual( root_1, root_2, TRUE ), "Accounts trees match" );
 }
 
 static void
@@ -371,37 +372,37 @@
 static void
 compare_books( QofBook* book_1, QofBook* book_2 )
 {
-	compare_accounts( book_1, book_2 );
-	compare_pricedbs( book_1, book_2 );
-	compare_txs( book_1, book_2 );
-	compare_sxs( book_1, book_2 );
+    compare_accounts( book_1, book_2 );
+    compare_pricedbs( book_1, book_2 );
+    compare_txs( book_1, book_2 );
+    compare_sxs( book_1, book_2 );
 }
 
 void
 test_dbi_store_and_reload( const gchar* driver, QofSession* session_1, const gchar* url )
 {
-	QofSession* session_2;
-	QofSession* session_3;
+    QofSession* session_2;
+    QofSession* session_3;
 
-	printf( "Testing %s\n", driver );
+    printf( "Testing %s\n", driver );
 
-	// Save the session data
-	session_2 = qof_session_new();
-	qof_session_begin( session_2, url, TRUE, TRUE );
-	qof_session_swap_data( session_1, session_2 );
-	qof_session_save( session_2, NULL );
+    // Save the session data
+    session_2 = qof_session_new();
+    qof_session_begin( session_2, url, TRUE, TRUE );
+    qof_session_swap_data( session_1, session_2 );
+    qof_session_save( session_2, NULL );
 
-	// Reload the session data
-	session_3 = qof_session_new();
-	qof_session_begin( session_3, url, FALSE, FALSE );
-	qof_session_load( session_3, NULL );
+    // Reload the session data
+    session_3 = qof_session_new();
+    qof_session_begin( session_3, url, FALSE, FALSE );
+    qof_session_load( session_3, NULL );
 
-	// Compare with the original data
-	compare_books( qof_session_get_book( session_2 ), qof_session_get_book( session_3 ) );
-	qof_session_end( session_1 );
-	qof_session_destroy( session_1 );
-	qof_session_end( session_2 );
-	qof_session_destroy( session_2 );
-	qof_session_end( session_3 );
-	qof_session_destroy( session_3 );
+    // Compare with the original data
+    compare_books( qof_session_get_book( session_2 ), qof_session_get_book( session_3 ) );
+    qof_session_end( session_1 );
+    qof_session_destroy( session_1 );
+    qof_session_end( session_2 );
+    qof_session_destroy( session_2 );
+    qof_session_end( session_3 );
+    qof_session_destroy( session_3 );
 }

Modified: gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.h
===================================================================
--- gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,7 +22,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #ifndef _TEST_DBI_STUFF_H_
 #define _TEST_DBI_STUFF_H_
 

Modified: gnucash/trunk/src/backend/dbi/test/test-dbi.c
===================================================================
--- gnucash/trunk/src/backend/dbi/test/test-dbi.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/dbi/test/test-dbi.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,7 +22,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 #include "qof.h"
 #include "cashobjects.h"
@@ -40,37 +40,39 @@
 
 int main (int argc, char ** argv)
 {
-	gchar* filename;
+    gchar* filename;
     QofSession* session_1;
-	
+
     qof_init();
     cashobjects_register();
     qof_load_backend_library ("../.libs/", GNC_LIB_NAME);
 
-	// Create a session with data
-	session_1 = qof_session_new();
-	qof_session_begin( session_1, DBI_TEST_XML_FILENAME, FALSE, FALSE );
-	qof_session_load( session_1, NULL );
+    // Create a session with data
+    session_1 = qof_session_new();
+    qof_session_begin( session_1, DBI_TEST_XML_FILENAME, FALSE, FALSE );
+    qof_session_load( session_1, NULL );
 
-	filename = tempnam( "/tmp", "test-sqlite3-" );
-	printf( "Using filename: %s\n", filename );
-	test_dbi_store_and_reload( "sqlite3", session_1, filename );
+    filename = tempnam( "/tmp", "test-sqlite3-" );
+    printf( "Using filename: %s\n", filename );
+    test_dbi_store_and_reload( "sqlite3", session_1, filename );
 
-	printf( "TEST_MYSQL_URL='%s'\n", TEST_MYSQL_URL );
-	if( strlen( TEST_MYSQL_URL ) > 0 ) {
-	    session_1 = qof_session_new();
-	    qof_session_begin( session_1, DBI_TEST_XML_FILENAME, FALSE, FALSE );
-	    qof_session_load( session_1, NULL );
-		test_dbi_store_and_reload( "mysql", session_1, TEST_MYSQL_URL );
-	}
+    printf( "TEST_MYSQL_URL='%s'\n", TEST_MYSQL_URL );
+    if ( strlen( TEST_MYSQL_URL ) > 0 )
+    {
+        session_1 = qof_session_new();
+        qof_session_begin( session_1, DBI_TEST_XML_FILENAME, FALSE, FALSE );
+        qof_session_load( session_1, NULL );
+        test_dbi_store_and_reload( "mysql", session_1, TEST_MYSQL_URL );
+    }
 
-	printf( "TEST_PGSQL_URL='%s'\n", TEST_PGSQL_URL );
-	if( strlen( TEST_PGSQL_URL ) > 0 ) {
-	    session_1 = qof_session_new();
-	    qof_session_begin( session_1, DBI_TEST_XML_FILENAME, FALSE, FALSE );
-	    qof_session_load( session_1, NULL );
-		test_dbi_store_and_reload( "pgsql", session_1, TEST_PGSQL_URL );
-	}
+    printf( "TEST_PGSQL_URL='%s'\n", TEST_PGSQL_URL );
+    if ( strlen( TEST_PGSQL_URL ) > 0 )
+    {
+        session_1 = qof_session_new();
+        qof_session_begin( session_1, DBI_TEST_XML_FILENAME, FALSE, FALSE );
+        qof_session_load( session_1, NULL );
+        test_dbi_store_and_reload( "pgsql", session_1, TEST_PGSQL_URL );
+    }
     print_test_results();
     qof_close();
     exit(get_rv());

Modified: gnucash/trunk/src/backend/dbi/test/test-load-backend.c
===================================================================
--- gnucash/trunk/src/backend/dbi/test/test-load-backend.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/dbi/test/test-load-backend.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,7 +24,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 #include "qof.h"
 #include "cashobjects.h"

Modified: gnucash/trunk/src/backend/sql/gnc-backend-sql.h
===================================================================
--- gnucash/trunk/src/backend/sql/gnc-backend-sql.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/sql/gnc-backend-sql.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -31,11 +31,11 @@
 /** @addtogroup SQLBE
  *  The SQL backend core is a library which can form the core for a QOF
  *  backend based on an SQL library.
- *  
+ *
  *  @file gnc-backend-sql.h
  *  @brief load and save data to SQL
  *  @author Copyright (c) 2006-2008 Phil Longstaff <plongstaff at rogers.com>
- */ 
+ */
 
 #ifndef GNC_BACKEND_SQL_H_
 #define GNC_BACKEND_SQL_H_
@@ -53,16 +53,17 @@
  */
 struct GncSqlBackend
 {
-  QofBackend be;				/**< QOF backend */
-  GncSqlConnection* conn;		/**< SQL connection */
-  /*@ dependent @*/ QofBook *primary_book;	/**< The primary, main open book */
-  gboolean loading;				/**< We are performing an initial load */
-  gboolean in_query;			/**< We are processing a query */
-  gboolean is_pristine_db;		/**< Are we saving to a new pristine db? */
-  gint obj_total;				/**< Total # of objects (for percentage calculation) */
-  gint operations_done;			/**< Number of operations (save/load) done */
-  GHashTable* versions;			/**< Version number for each table */
-  const gchar* timespec_format;	/**< Format string for SQL for timespec values */
+    QofBackend be;				/**< QOF backend */
+    GncSqlConnection* conn;		/**< SQL connection */
+    /*@ dependent @*/
+    QofBook *primary_book;	/**< The primary, main open book */
+    gboolean loading;				/**< We are performing an initial load */
+    gboolean in_query;			/**< We are processing a query */
+    gboolean is_pristine_db;		/**< Are we saving to a new pristine db? */
+    gint obj_total;				/**< Total # of objects (for percentage calculation) */
+    gint operations_done;			/**< Number of operations (save/load) done */
+    GHashTable* versions;			/**< Version number for each table */
+    const gchar* timespec_format;	/**< Format string for SQL for timespec values */
 };
 typedef struct GncSqlBackend GncSqlBackend;
 
@@ -128,9 +129,10 @@
  */
 struct GncSqlStatement
 {
-	void (*dispose)( /*@ only @*/ GncSqlStatement* );
-	/*@ dependent @*/ gchar* (*toSql)( GncSqlStatement* );
-	void (*addWhereCond)( GncSqlStatement*, QofIdTypeConst, gpointer, const GncSqlColumnTableEntry*, GValue* );
+    void (*dispose)( /*@ only @*/ GncSqlStatement* );
+    /*@ dependent @*/
+    gchar* (*toSql)( GncSqlStatement* );
+    void (*addWhereCond)( GncSqlStatement*, QofIdTypeConst, gpointer, const GncSqlColumnTableEntry*, GValue* );
 };
 #define gnc_sql_statement_dispose(STMT) \
 		(STMT)->dispose(STMT)
@@ -147,17 +149,17 @@
  */
 struct GncSqlConnection
 {
-	void (*dispose)( /*@ only @*/ GncSqlConnection* );
-	GncSqlResult* (*executeSelectStatement)( GncSqlConnection*, GncSqlStatement* ); /**< Returns NULL if error */
-	gint (*executeNonSelectStatement)( GncSqlConnection*, GncSqlStatement* ); /**< Returns -1 if error */
-	GncSqlStatement* (*createStatementFromSql)( /*@ observer @*/ GncSqlConnection*, const gchar* );
-	gboolean (*doesTableExist)( GncSqlConnection*, const gchar* );
-	gboolean (*beginTransaction)( GncSqlConnection* ); /**< Returns TRUE if successful, FALSE if error */
-	gboolean (*rollbackTransaction)( GncSqlConnection* ); /**< Returns TRUE if successful, FALSE if error */
-	gboolean (*commitTransaction)( GncSqlConnection* ); /**< Returns TRUE if successful, FALSE if error */
-	gboolean (*createTable)( GncSqlConnection*, const gchar*, GList* ); /**< Returns TRUE if successful, FALSE if error */
-	gboolean (*createIndex)( GncSqlConnection*, const gchar*, const gchar*, const GncSqlColumnTableEntry* ); /**< Returns TRUE if successful, FALSE if error */
-	gchar* (*quoteString)( const GncSqlConnection*, gchar* );
+    void (*dispose)( /*@ only @*/ GncSqlConnection* );
+    GncSqlResult* (*executeSelectStatement)( GncSqlConnection*, GncSqlStatement* ); /**< Returns NULL if error */
+    gint (*executeNonSelectStatement)( GncSqlConnection*, GncSqlStatement* ); /**< Returns -1 if error */
+    GncSqlStatement* (*createStatementFromSql)( /*@ observer @*/ GncSqlConnection*, const gchar* );
+    gboolean (*doesTableExist)( GncSqlConnection*, const gchar* );
+    gboolean (*beginTransaction)( GncSqlConnection* ); /**< Returns TRUE if successful, FALSE if error */
+    gboolean (*rollbackTransaction)( GncSqlConnection* ); /**< Returns TRUE if successful, FALSE if error */
+    gboolean (*commitTransaction)( GncSqlConnection* ); /**< Returns TRUE if successful, FALSE if error */
+    gboolean (*createTable)( GncSqlConnection*, const gchar*, GList* ); /**< Returns TRUE if successful, FALSE if error */
+    gboolean (*createIndex)( GncSqlConnection*, const gchar*, const gchar*, const GncSqlColumnTableEntry* ); /**< Returns TRUE if successful, FALSE if error */
+    gchar* (*quoteString)( const GncSqlConnection*, gchar* );
 };
 #define gnc_sql_connection_dispose(CONN) (CONN)->dispose(CONN)
 #define gnc_sql_connection_execute_select_statement(CONN,STMT) \
@@ -189,8 +191,8 @@
  */
 struct GncSqlRow
 {
-	const GValue* (*getValueAtColName)( GncSqlRow*, const gchar* );
-	void (*dispose)( /*@ only @*/ GncSqlRow* );
+    const GValue* (*getValueAtColName)( GncSqlRow*, const gchar* );
+    void (*dispose)( /*@ only @*/ GncSqlRow* );
 };
 #define gnc_sql_row_get_value_at_col_name(ROW,N) \
 		(ROW)->getValueAtColName(ROW,N)
@@ -205,10 +207,10 @@
  */
 struct GncSqlResult
 {
-	guint (*getNumRows)( GncSqlResult* );
+    guint (*getNumRows)( GncSqlResult* );
     GncSqlRow* (*getFirstRow)( GncSqlResult* );
-	GncSqlRow* (*getNextRow)( GncSqlResult* );
-	void (*dispose)( /*@ only @*/ GncSqlResult* );
+    GncSqlRow* (*getNextRow)( GncSqlResult* );
+    void (*dispose)( /*@ only @*/ GncSqlResult* );
 };
 #define gnc_sql_result_get_num_rows(RESULT) \
 		(RESULT)->getNumRows(RESULT)
@@ -235,26 +237,33 @@
  */
 typedef struct
 {
-  int		version;		/**< Backend version number */
-  const gchar *	type_name;	/**< Engine object type name */
-  /** Commit an instance of this object to the database
-   * @return TRUE if successful, FALSE if error
-   */
-  /*@ null @*/ gboolean	(*commit)( GncSqlBackend* be, QofInstance* inst );
-  /** Load all objects of this type from the database */
-  /*@ null @*/ void		(*initial_load)( GncSqlBackend* be );
-  /** Create database tables for this object */
-  /*@ null @*/ void		(*create_tables)( GncSqlBackend* be );
-  /** Compile a query on these objects */
-  /*@ null @*/ gpointer	(*compile_query)( GncSqlBackend* be, QofQuery* pQuery );
-  /** Run a query on these objects */
-  /*@ null @*/ void		(*run_query)( GncSqlBackend* be, gpointer pQuery );
-  /** Free a query on these objects */
-  /*@ null @*/ void		(*free_query)( GncSqlBackend* be, gpointer pQuery );
-  /** Write all objects of this type to the database
-   * @return TRUE if successful, FALSE if error
-   */
-  /*@ null @*/ gboolean	(*write)( GncSqlBackend* be );
+    int		version;		/**< Backend version number */
+    const gchar *	type_name;	/**< Engine object type name */
+    /** Commit an instance of this object to the database
+     * @return TRUE if successful, FALSE if error
+     */
+    /*@ null @*/
+    gboolean	(*commit)( GncSqlBackend* be, QofInstance* inst );
+    /** Load all objects of this type from the database */
+    /*@ null @*/
+    void		(*initial_load)( GncSqlBackend* be );
+    /** Create database tables for this object */
+    /*@ null @*/
+    void		(*create_tables)( GncSqlBackend* be );
+    /** Compile a query on these objects */
+    /*@ null @*/
+    gpointer	(*compile_query)( GncSqlBackend* be, QofQuery* pQuery );
+    /** Run a query on these objects */
+    /*@ null @*/
+    void		(*run_query)( GncSqlBackend* be, gpointer pQuery );
+    /** Free a query on these objects */
+    /*@ null @*/
+    void		(*free_query)( GncSqlBackend* be, gpointer pQuery );
+    /** Write all objects of this type to the database
+     * @return TRUE if successful, FALSE if error
+     */
+    /*@ null @*/
+    gboolean	(*write)( GncSqlBackend* be );
 } GncSqlObjectBackend;
 #define GNC_SQL_BACKEND             "gnc:sql:1"
 #define GNC_SQL_BACKEND_VERSION	1
@@ -262,13 +271,14 @@
 /**
  * Basic column type
  */
-typedef enum {
+typedef enum
+{
     BCT_STRING,
-	BCT_INT,
-	BCT_INT64,
-	BCT_DATE,
-	BCT_DOUBLE,
-	BCT_DATETIME
+    BCT_INT,
+    BCT_INT64,
+    BCT_DATE,
+    BCT_DOUBLE,
+    BCT_DATETIME
 } GncSqlBasicColumnType;
 
 /**
@@ -277,14 +287,15 @@
  * The GncSqlColumnInfo structure contains information required to create
  * a column in a table.
  */
-typedef struct {
-	/*@ only @*/ gchar* name;				/**< Column name */
-	GncSqlBasicColumnType type;				/**< Column basic type */
-	gint size;								/**< Column size (string types) */
-	gboolean is_unicode;					/**< Column is unicode (string types) */
-	gboolean is_autoinc;					/**< Column is autoinc (int type) */
-	gboolean is_primary_key;				/**< Column is the primary key */
-	gboolean null_allowed;					/**< Column allows NULL values */
+typedef struct
+{
+    /*@ only @*/ gchar* name;				/**< Column name */
+    GncSqlBasicColumnType type;				/**< Column basic type */
+    gint size;								/**< Column size (string types) */
+    gboolean is_unicode;					/**< Column is unicode (string types) */
+    gboolean is_autoinc;					/**< Column is autoinc (int type) */
+    gboolean is_primary_key;				/**< Column is the primary key */
+    gboolean null_allowed;					/**< Column allows NULL values */
 } GncSqlColumnInfo;
 
 // Type for conversion of db row to object.
@@ -321,38 +332,44 @@
  * The database description for an object consists of an array of
  * GncSqlColumnTableEntry objects, with a final member having col_name == NULL.
  */
-struct GncSqlColumnTableEntry {
-	/*@ dependent @*/ const gchar* col_name;	/**< Column name */
-	const gchar* col_type;	/**< Column type */
-	gint size;				/**< Column size in bytes, for string columns */
+struct GncSqlColumnTableEntry
+{
+    /*@ dependent @*/ const gchar* col_name;	/**< Column name */
+    const gchar* col_type;	/**< Column type */
+    gint size;				/**< Column size in bytes, for string columns */
 #define COL_PKEY	0x01	/**< The column is a primary key */
 #define COL_NNUL	0x02	/**< The column may not contain a NULL value */
 #define COL_UNIQUE	0x04	/**< The column must contain unique values */
 #define COL_AUTOINC	0x08	/**< The column is an auto-incrementing int */
-	gint flags;				/**< Column flags */
-	/*@ null @*/ const gchar* gobj_param_name; /**< If non-null, g_object param name */
-	/*@ null @*/ const gchar* qof_param_name;  /**< If non-null, qof parameter name */
-	/*@ null @*/ QofAccessFunc getter;	/**< General access function */
-	/*@ null @*/ QofSetterFunc setter;	/**< General setter function */
+    gint flags;				/**< Column flags */
+    /*@ null @*/
+    const gchar* gobj_param_name; /**< If non-null, g_object param name */
+    /*@ null @*/
+    const gchar* qof_param_name;  /**< If non-null, qof parameter name */
+    /*@ null @*/
+    QofAccessFunc getter;	/**< General access function */
+    /*@ null @*/
+    QofSetterFunc setter;	/**< General setter function */
 };
 
-typedef enum {
-	OP_DB_INSERT,
-	OP_DB_UPDATE,
-	OP_DB_DELETE
+typedef enum
+{
+    OP_DB_INSERT,
+    OP_DB_UPDATE,
+    OP_DB_DELETE
 } E_DB_OPERATION;
 
 typedef void (*GNC_SQL_LOAD_FN)( const GncSqlBackend* be,
-								GncSqlRow* row,
-                                /*@ null @*/ QofSetterFunc setter, gpointer pObject,
-                                const GncSqlColumnTableEntry* table );
+                                 GncSqlRow* row,
+                                 /*@ null @*/ QofSetterFunc setter, gpointer pObject,
+                                 const GncSqlColumnTableEntry* table );
 typedef void (*GNC_SQL_ADD_COL_INFO_TO_LIST_FN)( const GncSqlBackend* be,
-                        						const GncSqlColumnTableEntry* table_row,
-												GList** pList );
+        const GncSqlColumnTableEntry* table_row,
+        GList** pList );
 typedef void (*GNC_SQL_ADD_COLNAME_TO_LIST_FN)( const GncSqlColumnTableEntry* table_row, GList** pList );
 typedef void (*GNC_SQL_ADD_GVALUE_TO_SLIST_FN)( const GncSqlBackend* be,
-                QofIdTypeConst obj_name, const gpointer pObject,
-                const GncSqlColumnTableEntry* table_row, GSList** pList );
+        QofIdTypeConst obj_name, const gpointer pObject,
+        const GncSqlColumnTableEntry* table_row, GSList** pList );
 
 /**
  * @struct GncSqlColumnTypeHandler
@@ -362,27 +379,28 @@
  *
  * A column type maps a property value to one or more columns in the database.
  */
-typedef struct {
-	/**
-	 * Routine to load a value into an object from the database row.
-	 */
+typedef struct
+{
+    /**
+     * Routine to load a value into an object from the database row.
+     */
     GNC_SQL_LOAD_FN                 load_fn;
 
-	/**
-	 * Routine to add a GncSqlColumnInfo structure for the column type to a
-	 * GList.
-	 */
+    /**
+     * Routine to add a GncSqlColumnInfo structure for the column type to a
+     * GList.
+     */
     GNC_SQL_ADD_COL_INFO_TO_LIST_FN add_col_info_to_list_fn;
 
-	/**
-	 * Routine to add a column name string for the column type to a GList.
-	 */
+    /**
+     * Routine to add a column name string for the column type to a GList.
+     */
     GNC_SQL_ADD_COLNAME_TO_LIST_FN  add_colname_to_list_fn;
 
-	/**
-	 * Routine to add a GValue for the property to a GSList.
-	 */
-	GNC_SQL_ADD_GVALUE_TO_SLIST_FN	add_gvalue_to_slist_fn;
+    /**
+     * Routine to add a GValue for the property to a GSList.
+     */
+    GNC_SQL_ADD_GVALUE_TO_SLIST_FN	add_gvalue_to_slist_fn;
 } GncSqlColumnTypeHandler;
 
 /**
@@ -392,7 +410,8 @@
  * @param table_row DB table column
  * @return Access function
  */
-/*@ null @*/ QofAccessFunc gnc_sql_get_getter( QofIdTypeConst obj_name, const GncSqlColumnTableEntry* table_row );
+/*@ null @*/
+QofAccessFunc gnc_sql_get_getter( QofIdTypeConst obj_name, const GncSqlColumnTableEntry* table_row );
 
 /**
  * Adds a column name to a list.  If the column type spans multiple columns,
@@ -415,11 +434,11 @@
  * @return TRUE if successful, FALSE if not
  */
 gboolean gnc_sql_do_db_operation( GncSqlBackend* be,
-									E_DB_OPERATION op,
-									const gchar* table_name,
-									QofIdTypeConst obj_name,
-									gpointer pObject,
-									const GncSqlColumnTableEntry* table );
+                                  E_DB_OPERATION op,
+                                  const gchar* table_name,
+                                  QofIdTypeConst obj_name,
+                                  gpointer pObject,
+                                  const GncSqlColumnTableEntry* table );
 
 /**
  * Executes an SQL SELECT statement and returns the result rows.  If an error
@@ -430,7 +449,8 @@
  * @param statement Statement
  * @return Results, or NULL if an error has occured
  */
-/*@ null @*/ GncSqlResult* gnc_sql_execute_select_statement( GncSqlBackend* be, GncSqlStatement* statement );
+/*@ null @*/
+GncSqlResult* gnc_sql_execute_select_statement( GncSqlBackend* be, GncSqlStatement* statement );
 
 /**
  * Executes an SQL SELECT statement from an SQL char string and returns the
@@ -441,7 +461,8 @@
  * @param sql SQL SELECT string
  * @return Results, or NULL if an error has occured
  */
-/*@ null @*/ GncSqlResult* gnc_sql_execute_select_sql( GncSqlBackend* be, const gchar* sql );
+/*@ null @*/
+GncSqlResult* gnc_sql_execute_select_sql( GncSqlBackend* be, const gchar* sql );
 
 /**
  * Executes an SQL non-SELECT statement from an SQL char string.
@@ -459,7 +480,8 @@
  * @param sql SQL char string
  * @return Statement
  */
-/*@ null @*/ GncSqlStatement* gnc_sql_create_statement_from_sql( GncSqlBackend* be, const gchar* sql );
+/*@ null @*/
+GncSqlStatement* gnc_sql_create_statement_from_sql( GncSqlBackend* be, const gchar* sql );
 
 /**
  * Loads a Gnucash object from the database.
@@ -471,8 +493,8 @@
  * @param table DB table description
  */
 void gnc_sql_load_object( const GncSqlBackend* be, GncSqlRow* row,
-						/*@ null @*/ QofIdTypeConst obj_name, gpointer pObject,
-						const GncSqlColumnTableEntry* table );
+                          /*@ null @*/ QofIdTypeConst obj_name, gpointer pObject,
+                          const GncSqlColumnTableEntry* table );
 
 /**
  * Checks whether an object is in the database or not.
@@ -485,9 +507,9 @@
  * @return TRUE if the object is in the database, FALSE otherwise
  */
 gboolean gnc_sql_object_is_it_in_db( GncSqlBackend* be,
-									const gchar* table_name,
-									QofIdTypeConst obj_name, const gpointer pObject,
-									const GncSqlColumnTableEntry* table );
+                                     const gchar* table_name,
+                                     QofIdTypeConst obj_name, const gpointer pObject,
+                                     const GncSqlColumnTableEntry* table );
 
 /**
  * Returns the version number for a DB table.
@@ -507,8 +529,8 @@
  * @return TRUE if successful, FALSE if unsuccessful
  */
 gboolean gnc_sql_set_table_version( GncSqlBackend* be,
-									const gchar* table_name,
-									gint table_version );
+                                    const gchar* table_name,
+                                    gint table_version );
 
 /**
  * Creates a table in the database
@@ -520,9 +542,9 @@
  * @return TRUE if successful, FALSE if unsuccessful
  */
 gboolean gnc_sql_create_table( GncSqlBackend* be,
-								const gchar* table_name,
-								gint table_version,
-								const GncSqlColumnTableEntry* col_table );
+                               const gchar* table_name,
+                               gint table_version,
+                               const GncSqlColumnTableEntry* col_table );
 
 /**
  * Creates a temporary table in the database.  A temporary table does not
@@ -534,8 +556,8 @@
  * @return TRUE if successful, FALSE if unsuccessful
  */
 gboolean gnc_sql_create_temp_table( const GncSqlBackend* be,
-									const gchar* table_name,
-									const GncSqlColumnTableEntry* col_table );
+                                    const gchar* table_name,
+                                    const GncSqlColumnTableEntry* col_table );
 
 /**
  * Creates an index in the database
@@ -547,7 +569,7 @@
  * @return TRUE if successful, FALSE if unsuccessful
  */
 gboolean gnc_sql_create_index( const GncSqlBackend* be, const gchar* index_name,
-						const gchar* table_name, const GncSqlColumnTableEntry* col_table );
+                               const gchar* table_name, const GncSqlColumnTableEntry* col_table );
 
 /**
  * Loads the object guid from a database row.  The table must have a column
@@ -557,7 +579,8 @@
  * @param row Database row
  * @return GUID
  */
-/*@ dependent @*//*@ null @*/ const GUID* gnc_sql_load_guid( const GncSqlBackend* be, GncSqlRow* row );
+/*@ dependent @*//*@ null @*/
+const GUID* gnc_sql_load_guid( const GncSqlBackend* be, GncSqlRow* row );
 
 /**
  * Loads the transaction guid from a database row.  The table must have a column
@@ -567,7 +590,8 @@
  * @param row Database row
  * @return GUID
  */
-/*@ dependent @*//*@ null @*/ const GUID* gnc_sql_load_tx_guid( const GncSqlBackend* be, GncSqlRow* row );
+/*@ dependent @*//*@ null @*/
+const GUID* gnc_sql_load_tx_guid( const GncSqlBackend* be, GncSqlRow* row );
 
 /**
  * Creates a basic SELECT statement for a table.
@@ -576,8 +600,9 @@
  * @param table_name Table name
  * @return Statement
  */
-/*@ null @*/ GncSqlStatement* gnc_sql_create_select_statement( GncSqlBackend* be,
-										const gchar* table_name );
+/*@ null @*/
+GncSqlStatement* gnc_sql_create_select_statement( GncSqlBackend* be,
+        const gchar* table_name );
 
 /**
  * Registers a column handler for a new column type.
@@ -597,8 +622,8 @@
  * @param pList List
  */
 void gnc_sql_add_gvalue_objectref_guid_to_slist( const GncSqlBackend* be,
-							QofIdTypeConst obj_name, const gpointer pObject,
-							const GncSqlColumnTableEntry* table_row, GSList** pList );
+        QofIdTypeConst obj_name, const gpointer pObject,
+        const GncSqlColumnTableEntry* table_row, GSList** pList );
 
 /**
  * Adds a column info structure for an object reference GUID to the end of a
@@ -609,7 +634,7 @@
  * @param pList List
  */
 void gnc_sql_add_objectref_guid_col_info_to_list( const GncSqlBackend* be,
-	            const GncSqlColumnTableEntry* table_row, GList** pList );
+        const GncSqlColumnTableEntry* table_row, GList** pList );
 
 /**
  * Appends the ascii strings for a list of GUIDs to the end of an SQL string.
@@ -629,8 +654,8 @@
  * @param pList List
  */
 void gnc_sql_add_subtable_colnames_to_list( const GncSqlColumnTableEntry* table_row,
-								const GncSqlColumnTableEntry* subtable,
-								GList** pList );
+        const GncSqlColumnTableEntry* subtable,
+        GList** pList );
 
 /**
  * Returns a string corresponding to the SQL representation of a GValue.  The
@@ -668,7 +693,7 @@
  * @return TRUE if successful, FALSE if not
  */
 gboolean gnc_sql_commit_standard_item( GncSqlBackend* be, QofInstance* inst, const gchar* tableName,
-                        	QofIdTypeConst obj_name, const GncSqlColumnTableEntry* col_table );
+                                       QofIdTypeConst obj_name, const GncSqlColumnTableEntry* col_table );
 
 /**
  * Gets an integer value (of any size) from a GValue.
@@ -698,17 +723,19 @@
  * @param col_table Column table
  */
 void gnc_sql_upgrade_table( GncSqlBackend* be, const gchar* table_name,
-	               			const GncSqlColumnTableEntry* col_table );
+                            const GncSqlColumnTableEntry* col_table );
 
 void _retrieve_guid_( gpointer pObject, /*@ null @*/ gpointer pValue );
 
-/*@ null @*/ gpointer gnc_sql_compile_query( QofBackend* pBEnd, QofQuery* pQuery );
+/*@ null @*/
+gpointer gnc_sql_compile_query( QofBackend* pBEnd, QofQuery* pQuery );
 void gnc_sql_free_query( QofBackend* pBEnd, gpointer pQuery );
 void gnc_sql_run_query( QofBackend* pBEnd, gpointer pQuery );
 
-typedef struct {
-	/*@ dependent @*/ GncSqlBackend* be;
-	gboolean is_ok;
+typedef struct
+{
+    /*@ dependent @*/ GncSqlBackend* be;
+    gboolean is_ok;
 } write_objects_t;
 
 #endif /* GNC_BACKEND_SQL_H_ */

Modified: gnucash/trunk/src/backend/sql/gnc-recurrence-sql.h
===================================================================
--- gnucash/trunk/src/backend/sql/gnc-recurrence-sql.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/sql/gnc-recurrence-sql.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -35,8 +35,10 @@
 gboolean gnc_sql_recurrence_save( GncSqlBackend* be, const GUID* guid, const Recurrence* pRecurrence );
 void gnc_sql_recurrence_save_list( GncSqlBackend* be, const GUID* guid, GList* schedule );
 gboolean gnc_sql_recurrence_delete( GncSqlBackend* be, const GUID* guid );
-/*@ null @*/ Recurrence* gnc_sql_recurrence_load( GncSqlBackend* be, const GUID* guid );
-/*@ null @*/ GList* gnc_sql_recurrence_load_list( GncSqlBackend* be, const GUID* guid );
+/*@ null @*/
+Recurrence* gnc_sql_recurrence_load( GncSqlBackend* be, const GUID* guid );
+/*@ null @*/
+GList* gnc_sql_recurrence_load_list( GncSqlBackend* be, const GUID* guid );
 
 void gnc_sql_init_recurrence_handler( void );
 

Modified: gnucash/trunk/src/backend/sql/gnc-slots-sql.h
===================================================================
--- gnucash/trunk/src/backend/sql/gnc-slots-sql.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/sql/gnc-slots-sql.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -42,7 +42,7 @@
  * @return TRUE if successful, FALSE if error
  */
 gboolean gnc_sql_slots_save( GncSqlBackend* be, const GUID* guid,
-					gboolean is_infant, KvpFrame* pFrame );
+                             gboolean is_infant, KvpFrame* pFrame );
 
 /**
  * gnc_sql_slots_delete - Deletes slots for an object from the db.
@@ -83,7 +83,7 @@
 typedef QofInstance* (*BookLookupFn)( const GUID* guid, const QofBook* book );
 
 void gnc_sql_slots_load_for_sql_subquery( GncSqlBackend* be, const gchar* subquery,
-						BookLookupFn lookup_fn );
+        BookLookupFn lookup_fn );
 
 void gnc_sql_init_slots_handler( void );
 

Modified: gnucash/trunk/src/backend/sql/gnc-transaction-sql.h
===================================================================
--- gnucash/trunk/src/backend/sql/gnc-transaction-sql.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/sql/gnc-transaction-sql.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -66,11 +66,12 @@
  */
 void gnc_sql_transaction_load_all_tx( GncSqlBackend* be );
 
-typedef struct {
-	Account* acct;
-	gnc_numeric balance;
-	gnc_numeric cleared_balance;
-	gnc_numeric reconciled_balance;
+typedef struct
+{
+    Account* acct;
+    gnc_numeric balance;
+    gnc_numeric cleared_balance;
+    gnc_numeric reconciled_balance;
 } acct_balances_t;
 
 /**
@@ -80,6 +81,7 @@
  * @param be SQL backend
  * @return GSList of acct_balances_t structures
  */
-/*@ null @*/ GSList* gnc_sql_get_account_balances_slist( GncSqlBackend* be );
+/*@ null @*/
+GSList* gnc_sql_get_account_balances_slist( GncSqlBackend* be );
 
 #endif /* GNC_TRANSACTION_SQL_H_ */

Modified: gnucash/trunk/src/backend/sql/test/test-column-types.c
===================================================================
--- gnucash/trunk/src/backend/sql/test/test-column-types.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/sql/test/test-column-types.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -23,7 +23,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 #include "qof.h"
 #include "cashobjects.h"
@@ -35,11 +35,11 @@
 {
     qof_init();
     cashobjects_register();
-	gnc_sql_init( NULL );
-/*    do_test(
-        qof_load_backend_library ("../.libs/", GNC_LIB_NAME),
-        " loading gnc-backend-gda GModule failed");
-*/
+    gnc_sql_init( NULL );
+    /*    do_test(
+            qof_load_backend_library ("../.libs/", GNC_LIB_NAME),
+            " loading gnc-backend-gda GModule failed");
+    */
     print_test_results();
     qof_close();
     exit( get_rv() );

Modified: gnucash/trunk/src/backend/xml/gnc-backend-xml.c
===================================================================
--- gnucash/trunk/src/backend/xml/gnc-backend-xml.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/xml/gnc-backend-xml.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -715,10 +715,12 @@
                   tmp_name ? tmp_name : "(null)",
                   strerror(errno) ? strerror(errno) : "");
             /* already in an error just flow on through */
-        } else {
-             /* Use a generic write error code */
-             qof_backend_set_error(be, ERR_FILEIO_WRITE_ERROR);
         }
+        else
+        {
+            /* Use a generic write error code */
+            qof_backend_set_error(be, ERR_FILEIO_WRITE_ERROR);
+        }
         g_free(tmp_name);
         LEAVE("");
         return FALSE;

Modified: gnucash/trunk/src/backend/xml/gnc-book-xml-v2.c
===================================================================
--- gnucash/trunk/src/backend/xml/gnc-book-xml-v2.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/xml/gnc-book-xml-v2.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -160,7 +160,7 @@
     xmlFreeNode (domnode);
 
     if (ferror(out) || fprintf(out, "\n") < 0)
-         return FALSE;
+        return FALSE;
 
     if (qof_book_get_slots(book))
     {
@@ -172,7 +172,7 @@
             xmlFreeNode(kvpnode);
 
             if (ferror(out) || fprintf(out, "\n") < 0)
-                 return FALSE;
+                return FALSE;
         }
     }
 

Modified: gnucash/trunk/src/backend/xml/io-gncxml-v2.c
===================================================================
--- gnucash/trunk/src/backend/xml/io-gncxml-v2.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/backend/xml/io-gncxml-v2.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -971,12 +971,12 @@
     qof_object_foreach_backend (GNC_FILE_BACKEND, write_counts_cb, &be_data);
 
     if (ferror(out)
-        || !write_commodities(out, book, gd)
-        || !write_pricedb(out, book, gd)
-        || !write_accounts(out, book, gd)
-        || !write_transactions(out, book, gd)
-        || !write_template_transaction_data(out, book, gd)
-        || !write_schedXactions(out, book, gd))
+            || !write_commodities(out, book, gd)
+            || !write_pricedb(out, book, gd)
+            || !write_accounts(out, book, gd)
+            || !write_transactions(out, book, gd)
+            || !write_template_transaction_data(out, book, gd)
+            || !write_schedXactions(out, book, gd))
 
         return FALSE;
 
@@ -1093,9 +1093,9 @@
     be_data.out = out;
     be_data.gd = gd;
     return 0 ==
-        xaccAccountTreeForEachTransaction(gnc_book_get_root_account(book),
-                                          xml_add_trn_data,
-                                          (gpointer) &be_data);
+           xaccAccountTreeForEachTransaction(gnc_book_get_root_account(book),
+                   xml_add_trn_data,
+                   (gpointer) &be_data);
 }
 
 static gboolean
@@ -1111,9 +1111,9 @@
     if ( gnc_account_n_descendants(ra) > 0 )
     {
         if (fprintf(out, "<%s>\n", TEMPLATE_TRANSACTION_TAG) < 0
-            || !write_account_tree(out, ra, gd)
-            || xaccAccountTreeForEachTransaction(ra, xml_add_trn_data, (gpointer)&be_data)
-            || fprintf(out, "</%s>\n", TEMPLATE_TRANSACTION_TAG) < 0)
+                || !write_account_tree(out, ra, gd)
+                || xaccAccountTreeForEachTransaction(ra, xml_add_trn_data, (gpointer)&be_data)
+                || fprintf(out, "</%s>\n", TEMPLATE_TRANSACTION_TAG) < 0)
 
             return FALSE;
     }
@@ -1195,23 +1195,23 @@
 write_v2_header (FILE *out)
 {
     if (fprintf(out, "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n") < 0
-        || fprintf(out, "<" GNC_V2_STRING) < 0
+            || fprintf(out, "<" GNC_V2_STRING) < 0
 
-        || !gnc_xml2_write_namespace_decl (out, "gnc")
-        || !gnc_xml2_write_namespace_decl (out, "act")
-        || !gnc_xml2_write_namespace_decl (out, "book")
-        || !gnc_xml2_write_namespace_decl (out, "cd")
-        || !gnc_xml2_write_namespace_decl (out, "cmdty")
-        || !gnc_xml2_write_namespace_decl (out, "price")
-        || !gnc_xml2_write_namespace_decl (out, "slot")
-        || !gnc_xml2_write_namespace_decl (out, "split")
-        || !gnc_xml2_write_namespace_decl (out, "sx")
-        || !gnc_xml2_write_namespace_decl (out, "trn")
-        || !gnc_xml2_write_namespace_decl (out, "ts")
-        || !gnc_xml2_write_namespace_decl (out, "fs")
-        || !gnc_xml2_write_namespace_decl (out, "bgt")
-        || !gnc_xml2_write_namespace_decl (out, "recurrence")
-        || !gnc_xml2_write_namespace_decl (out, "lot"))
+            || !gnc_xml2_write_namespace_decl (out, "gnc")
+            || !gnc_xml2_write_namespace_decl (out, "act")
+            || !gnc_xml2_write_namespace_decl (out, "book")
+            || !gnc_xml2_write_namespace_decl (out, "cd")
+            || !gnc_xml2_write_namespace_decl (out, "cmdty")
+            || !gnc_xml2_write_namespace_decl (out, "price")
+            || !gnc_xml2_write_namespace_decl (out, "slot")
+            || !gnc_xml2_write_namespace_decl (out, "split")
+            || !gnc_xml2_write_namespace_decl (out, "sx")
+            || !gnc_xml2_write_namespace_decl (out, "trn")
+            || !gnc_xml2_write_namespace_decl (out, "ts")
+            || !gnc_xml2_write_namespace_decl (out, "fs")
+            || !gnc_xml2_write_namespace_decl (out, "bgt")
+            || !gnc_xml2_write_namespace_decl (out, "recurrence")
+            || !gnc_xml2_write_namespace_decl (out, "lot"))
 
         return FALSE;
 
@@ -1234,7 +1234,7 @@
     if (!out) return FALSE;
 
     if (!write_v2_header(out)
-        || !write_counts(out, "book", 1, NULL))
+            || !write_counts(out, "book", 1, NULL))
         return FALSE;
 
     be = qof_book_get_backend(book);
@@ -1250,7 +1250,7 @@
                                     qof_book_get_collection(book, GNC_ID_BUDGET));
 
     if (!write_book(out, book, gd)
-        || fprintf(out, "</" GNC_V2_STRING ">\n\n") < 0)
+            || fprintf(out, "</" GNC_V2_STRING ">\n\n") < 0)
         success = FALSE;
 
     g_free(gd);
@@ -1278,7 +1278,7 @@
     ncom = gnc_commodity_table_get_size(table);
 
     if (!write_v2_header(out)
-        || !write_counts(out, "commodity", ncom, "account", nacc, NULL))
+            || !write_counts(out, "commodity", ncom, "account", nacc, NULL))
         return FALSE;
 
     gd = gnc_sixtp_gdv2_new(book, TRUE, file_rw_feedback, be->percentage);
@@ -1286,8 +1286,8 @@
     gd->counter.accounts_total = nacc;
 
     if (!write_commodities(out, book, gd)
-        || !write_accounts(out, book, gd)
-        || fprintf(out, "</" GNC_V2_STRING ">\n\n") < 0)
+            || !write_accounts(out, book, gd)
+            || fprintf(out, "</" GNC_V2_STRING ">\n\n") < 0)
         success = FALSE;
 
     g_free(gd);
@@ -1511,8 +1511,8 @@
 
     /* Try to write as much as possible */
     if (!out
-        || !gnc_book_write_to_xml_filehandle_v2(book, out)
-        || !write_emacs_trailer(out))
+            || !gnc_book_write_to_xml_filehandle_v2(book, out)
+            || !write_emacs_trailer(out))
         success = FALSE;
 
     /* Close the output stream */
@@ -1545,8 +1545,8 @@
 
     /* Try to write as much as possible */
     if (!out
-        || !gnc_book_write_accounts_to_xml_filehandle_v2 (be, book, out)
-        || !write_emacs_trailer(out))
+            || !gnc_book_write_accounts_to_xml_filehandle_v2 (be, book, out)
+            || !write_emacs_trailer(out))
         success = FALSE;
 
     /* Close the output stream */
@@ -1554,7 +1554,8 @@
         success = FALSE;
 
     if (!success
-        && qof_backend_get_error(be) == ERR_BACKEND_NO_ERR) {
+            && qof_backend_get_error(be) == ERR_BACKEND_NO_ERR)
+    {
 
         /* Use a generic write error code */
         qof_backend_set_error(be, ERR_FILEIO_WRITE_ERROR);

Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/bin/gnucash-bin.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -81,11 +81,11 @@
     if (!is_development_version) return;
 
     g_print("\n\n%s%s%s%s%s\n%s%s\n\n",
-	    _("This is a development version. It may or may not work.\n"),
-	    _("Report bugs and other problems to gnucash-devel at gnucash.org.\n"),
-	    _("You can also lookup and file bug reports at http://bugzilla.gnome.org\n"),
-	    _("The last stable version was "), "GnuCash 2.2.9",
-	    _("The next stable version will be "), "GnuCash 2.4");
+            _("This is a development version. It may or may not work.\n"),
+            _("Report bugs and other problems to gnucash-devel at gnucash.org.\n"),
+            _("You can also lookup and file bug reports at http://bugzilla.gnome.org\n"),
+            _("The last stable version was "), "GnuCash 2.2.9",
+            _("The next stable version will be "), "GnuCash 2.4");
 }
 
 /* Priority of paths: The default is set at build time.  It may be
@@ -100,7 +100,7 @@
 environment_override()
 {
     const char *path;
-    
+
     if ((path = g_getenv("GNC_CONFIG_PATH")))
         config_path = g_strdup(path);
     if ((path = g_getenv("GNC_SHARE_PATH")))
@@ -126,9 +126,11 @@
     gchar *filename;
     int i;
 
-    for (i = 0; fns[i]; i++) {
+    for (i = 0; fns[i]; i++)
+    {
         filename = gnc_build_dotgnucash_path(fns[i]);
-        if (gfec_try_load(filename)) {
+        if (gfec_try_load(filename))
+        {
             g_free(filename);
             return TRUE;
         }
@@ -136,7 +138,7 @@
     }
     return FALSE;
 }
- 
+
 static void
 update_message(const gchar *msg)
 {
@@ -164,14 +166,20 @@
 {
     /* Don't continue adding to this list. When 2.0 rolls around bump
        the 1.4 (unnumbered) files off the list. */
-    static const gchar *user_config_files[] = {
-        "config-2.0.user", "config-1.8.user", "config-1.6.user", 
-        "config.user", NULL };
-    static const gchar *auto_config_files[] = {
+    static const gchar *user_config_files[] =
+    {
+        "config-2.0.user", "config-1.8.user", "config-1.6.user",
+        "config.user", NULL
+    };
+    static const gchar *auto_config_files[] =
+    {
         "config-2.0.auto", "config-1.8.auto", "config-1.6.auto",
-	"config.auto", NULL};
-    static const gchar *saved_report_files[] = {
-      "saved-reports-2.4", "saved-reports-2.0", NULL};
+        "config.auto", NULL
+    };
+    static const gchar *saved_report_files[] =
+    {
+        "saved-reports-2.4", "saved-reports-2.0", NULL
+    };
     static const gchar *stylesheet_files[] = { "stylesheets-2.0", NULL};
     static int is_user_config_loaded = FALSE;
 
@@ -198,14 +206,14 @@
  * with lots of '?v's and it doesn't allow us to describe the
  * [DATAFILE] argument in the usage.  Weighing those factors, we're
  * just going to use popt directly.
- * 
+ *
  * Glib-2.6 introduced GOptionContext and GOptionGroup, which are
  * meant to replace popt usage.  In Gnome-2.14, the popt usage is
  * offically deprecated, and the GNOME_PARAM_GOPTION_CONTEXT can be
  * used.
  */
 
-static void 
+static void
 gnucash_command_line(int *argc, char **argv)
 {
     char *p;
@@ -213,98 +221,126 @@
     char *namespace_regexp = NULL;
     GError *error = NULL;
     GOptionContext *context;
-    GOptionEntry options[] = {
-        {"version", 'v', 0, G_OPTION_ARG_NONE, &gnucash_show_version,
-         _("Show GnuCash version"), NULL},
+    GOptionEntry options[] =
+    {
+        {
+            "version", 'v', 0, G_OPTION_ARG_NONE, &gnucash_show_version,
+            _("Show GnuCash version"), NULL
+        },
 
-        {"debug", '\0', 0, G_OPTION_ARG_NONE, &debugging,
-         _("Enable debugging mode: increasing logging to provide deep detail."), NULL},
+        {
+            "debug", '\0', 0, G_OPTION_ARG_NONE, &debugging,
+            _("Enable debugging mode: increasing logging to provide deep detail."), NULL
+        },
 
-        {"extra", '\0', 0, G_OPTION_ARG_NONE, &extra,
-         _("Enable extra/development/debugging features."), NULL},
+        {
+            "extra", '\0', 0, G_OPTION_ARG_NONE, &extra,
+            _("Enable extra/development/debugging features."), NULL
+        },
 
-        {"log", '\0', 0, G_OPTION_ARG_STRING_ARRAY, &log_flags,
-         _("Log level overrides, of the form \"log.ger.path={debug,info,warn,crit,error}\""),
-         NULL},
+        {
+            "log", '\0', 0, G_OPTION_ARG_STRING_ARRAY, &log_flags,
+            _("Log level overrides, of the form \"log.ger.path={debug,info,warn,crit,error}\""),
+            NULL
+        },
 
-        {"logto", '\0', 0, G_OPTION_ARG_STRING, &log_to_filename,
-         _("File to log into; defaults to \"/tmp/gnucash.trace\"; can be \"stderr\" or \"stdout\"."),
-         NULL},
+        {
+            "logto", '\0', 0, G_OPTION_ARG_STRING, &log_to_filename,
+            _("File to log into; defaults to \"/tmp/gnucash.trace\"; can be \"stderr\" or \"stdout\"."),
+            NULL
+        },
 
 #if 0
-        {"loglevel", '\0', 0, G_OPTION_ARG_INT, &loglevel,
-	 /* Translators: This is the command line option autohelp text; see popt(3) */
-        _("Set the logging level from 0 (least) to 6 (most)"), 
-	 /* Translators: Argument description for autohelp; see
-	    http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
-         _("LOGLEVEL")},
+        {
+            "loglevel", '\0', 0, G_OPTION_ARG_INT, &loglevel,
+            /* Translators: This is the command line option autohelp text; see popt(3) */
+            _("Set the logging level from 0 (least) to 6 (most)"),
+            /* Translators: Argument description for autohelp; see
+               http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
+            _("LOGLEVEL")
+        },
 #endif // 0
 
-        {"nofile", '\0', 0, G_OPTION_ARG_NONE, &nofile,
-         _("Do not load the last file opened"), NULL},
+        {
+            "nofile", '\0', 0, G_OPTION_ARG_NONE, &nofile,
+            _("Do not load the last file opened"), NULL
+        },
 
-        {"config-path", '\0', 0, G_OPTION_ARG_STRING, &config_path,
-         _("Set configuration path"),
-         /* Translators: Argument description for autohelp; see
-            http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
-         _("CONFIGPATH")},
+        {
+            "config-path", '\0', 0, G_OPTION_ARG_STRING, &config_path,
+            _("Set configuration path"),
+            /* Translators: Argument description for autohelp; see
+               http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
+            _("CONFIGPATH")
+        },
 
-        {"share-path", '\0', 0, G_OPTION_ARG_STRING, &share_path,
-         _("Set shared data file search path"),
-	 /* Translators: Argument description for autohelp; see
-	    http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
-	 _("SHAREPATH")},
-        {"doc-path", '\0', 0, G_OPTION_ARG_STRING, &help_path,
-         _("Set the search path for documentation files"),
-	 /* Translators: Argument description for autohelp; see
-	    http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
-	 _("DOCPATH")},
-        {"gconf-path", '\0', 0, G_OPTION_ARG_STRING, &gconf_path,
-         _("Set the prefix path for gconf queries"),
-	 /* Translators: Argument description for autohelp; see
-	    http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
-	 _("GCONFPATH")},
-        {"add-price-quotes", '\0', 0, G_OPTION_ARG_STRING, &add_quotes_file,
-         _("Add price quotes to given GnuCash datafile"),
-	 /* Translators: Argument description for autohelp; see
-	    http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
-	 _("FILE")},
-        {"namespace", '\0', 0, G_OPTION_ARG_STRING, &namespace_regexp,
-         _("Regular expression determining which namespace commodities will be retrieved"), 
-	 /* Translators: Argument description for autohelp; see
-	    http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
-         _("REGEXP")},
+        {
+            "share-path", '\0', 0, G_OPTION_ARG_STRING, &share_path,
+            _("Set shared data file search path"),
+            /* Translators: Argument description for autohelp; see
+               http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
+            _("SHAREPATH")
+        },
+        {
+            "doc-path", '\0', 0, G_OPTION_ARG_STRING, &help_path,
+            _("Set the search path for documentation files"),
+            /* Translators: Argument description for autohelp; see
+               http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
+            _("DOCPATH")
+        },
+        {
+            "gconf-path", '\0', 0, G_OPTION_ARG_STRING, &gconf_path,
+            _("Set the prefix path for gconf queries"),
+            /* Translators: Argument description for autohelp; see
+               http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
+            _("GCONFPATH")
+        },
+        {
+            "add-price-quotes", '\0', 0, G_OPTION_ARG_STRING, &add_quotes_file,
+            _("Add price quotes to given GnuCash datafile"),
+            /* Translators: Argument description for autohelp; see
+               http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
+            _("FILE")
+        },
+        {
+            "namespace", '\0', 0, G_OPTION_ARG_STRING, &namespace_regexp,
+            _("Regular expression determining which namespace commodities will be retrieved"),
+            /* Translators: Argument description for autohelp; see
+               http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
+            _("REGEXP")
+        },
         { NULL }
     };
-    
+
     /* Pretend that argv[0] is "gnucash" */
-    if ((p = strstr(argv[0], "-bin"))) *p = '\0';
+    if ((p = strstr(argv[0], "-bin"))) * p = '\0';
 
     context = g_option_context_new (" [datafile]");
     g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
     g_option_context_add_group (context, gtk_get_option_group (FALSE));
     if (!g_option_context_parse (context, argc, &argv, &error))
     {
-         g_warning("Error parsing command line arguments: [%s]; try `gnucash --help` for available options.", error->message);
-         exit(1);
+        g_warning("Error parsing command line arguments: [%s]; try `gnucash --help` for available options.", error->message);
+        exit(1);
     }
     g_option_context_free (context);
     if (error)
-         g_error_free(error);
+        g_error_free(error);
 
     if (*argc > 0)
-         file_to_load = argv[1];
+        file_to_load = argv[1];
 
-    if (gnucash_show_version) {
+    if (gnucash_show_version)
+    {
         if (is_development_version)
         {
-             /* Translators: %s is the version number */
-             g_print(_("GnuCash %s development version"), VERSION);
+            /* Translators: %s is the version number */
+            g_print(_("GnuCash %s development version"), VERSION);
         }
         else
         {
-             /* Translators: %s is the version number */
-             g_print(_("GnuCash %s"), VERSION);
+            /* Translators: %s is the version number */
+            g_print(_("GnuCash %s"), VERSION);
         }
         g_print("\n");
         /* Translators: 1st %s is the build date; 2nd %s is the SVN
@@ -326,11 +362,13 @@
 load_gnucash_modules()
 {
     int i, len;
-    struct {
+    struct
+    {
         gchar * name;
         int version;
         gboolean optional;
-    } modules[] = {
+    } modules[] =
+    {
         { "gnucash/app-utils", 0, FALSE },
         { "gnucash/engine", 0, FALSE },
         { "gnucash/register/ledger-core", 0, FALSE },
@@ -350,17 +388,19 @@
         { "gnucash/report/report-gnome", 0, FALSE },
         { "gnucash/business-gnome", 0, TRUE }
     };
-    
+
     /* module initializations go here */
     len = sizeof(modules) / sizeof(*modules);
-    for (i = 0; i < len; i++) {
+    for (i = 0; i < len; i++)
+    {
         gnc_update_splash_screen(modules[i].name, GNC_SPLASH_PERCENTAGE_UNKNOWN);
         if (modules[i].optional)
             gnc_module_load_optional(modules[i].name, modules[i].version);
         else
             gnc_module_load(modules[i].name, modules[i].version);
     }
-    if (!gnc_engine_is_initialized()) {
+    if (!gnc_engine_is_initialized())
+    {
         /* On Windows this check used to fail anyway, see
          * https://lists.gnucash.org/pipermail/gnucash-devel/2006-September/018529.html
          * but more recently it seems to work as expected
@@ -377,7 +417,7 @@
     QofSession *session = NULL;
 
     scm_c_eval_string("(debug-set! stack 200000)");
-    
+
     mod = scm_c_resolve_module("gnucash price-quotes");
     scm_set_current_module(mod);
 
@@ -386,9 +426,10 @@
     qof_event_suspend();
     scm_c_eval_string("(gnc:price-quotes-install-sources)");
 
-    if (!gnc_quote_source_fq_installed()) {
+    if (!gnc_quote_source_fq_installed())
+    {
         g_print("%s", _("No quotes retrieved. Finance::Quote isn't "
-                  "installed properly.\n"));
+                        "installed properly.\n"));
         goto fail;
     }
 
@@ -409,7 +450,8 @@
     if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR) goto fail;
 
     qof_session_destroy(session);
-    if (!scm_is_true(scm_result)) {
+    if (!scm_is_true(scm_result))
+    {
         g_warning("Failed to add quotes to %s.", add_quotes_file);
         goto fail;
     }
@@ -417,7 +459,7 @@
     qof_event_resume();
     gnc_shutdown(0);
     return;
- fail:
+fail:
     if (session && qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
         g_warning("Session Error: %s", qof_session_get_error_message(session));
     qof_event_resume();
@@ -441,7 +483,7 @@
     GError *error = NULL;
 
     scm_c_eval_string("(debug-set! stack 200000)");
-    
+
     main_mod = scm_c_resolve_module("gnucash main");
     scm_set_current_module(main_mod);
 
@@ -469,15 +511,16 @@
     /* Install Price Quote Sources */
     gnc_update_splash_screen(_("Checking Finance::Quote..."), GNC_SPLASH_PERCENTAGE_UNKNOWN);
     scm_c_use_module("gnucash price-quotes");
-    scm_c_eval_string("(gnc:price-quotes-install-sources)");  
+    scm_c_eval_string("(gnc:price-quotes-install-sources)");
 
     gnc_hook_run(HOOK_STARTUP, NULL);
-    
-    if (!nofile && (fn = get_file_to_load())) {
+
+    if (!nofile && (fn = get_file_to_load()))
+    {
         gnc_update_splash_screen(_("Loading data..."), GNC_SPLASH_PERCENTAGE_UNKNOWN);
         gnc_file_open_file(fn);
         g_free(fn);
-    } 
+    }
     else if (gnc_gconf_get_bool("dialogs/new_user", "first_startup", &error)
              && !error)
     {
@@ -500,62 +543,62 @@
 static void
 gnc_log_init()
 {
-     if (log_to_filename != NULL)
-     {
-          qof_log_init_filename_special(log_to_filename);
-     }
-     else
-     {
-          /* initialize logging to our file. */
-          gchar *tracefilename;
-          tracefilename = g_build_filename(g_get_tmp_dir(), "gnucash.trace",
-                                           (gchar *)NULL);
-          qof_log_init_filename(tracefilename);
-          g_free(tracefilename);
-     }
+    if (log_to_filename != NULL)
+    {
+        qof_log_init_filename_special(log_to_filename);
+    }
+    else
+    {
+        /* initialize logging to our file. */
+        gchar *tracefilename;
+        tracefilename = g_build_filename(g_get_tmp_dir(), "gnucash.trace",
+                                         (gchar *)NULL);
+        qof_log_init_filename(tracefilename);
+        g_free(tracefilename);
+    }
 
-     // set a reasonable default.
-     qof_log_set_default(QOF_LOG_WARNING);
+    // set a reasonable default.
+    qof_log_set_default(QOF_LOG_WARNING);
 
-     gnc_log_default();
+    gnc_log_default();
 
-     if (gnc_is_debugging())
-     {
-          qof_log_set_level("", QOF_LOG_INFO);
-          qof_log_set_level("qof", QOF_LOG_INFO);
-          qof_log_set_level("gnc", QOF_LOG_INFO);
-     }
+    if (gnc_is_debugging())
+    {
+        qof_log_set_level("", QOF_LOG_INFO);
+        qof_log_set_level("qof", QOF_LOG_INFO);
+        qof_log_set_level("gnc", QOF_LOG_INFO);
+    }
 
-     {
-          gchar *log_config_filename;
-          log_config_filename = gnc_build_dotgnucash_path("log.conf");
-          if (g_file_test(log_config_filename, G_FILE_TEST_EXISTS))
-               qof_log_parse_log_config(log_config_filename);
-          g_free(log_config_filename);
-     }
+    {
+        gchar *log_config_filename;
+        log_config_filename = gnc_build_dotgnucash_path("log.conf");
+        if (g_file_test(log_config_filename, G_FILE_TEST_EXISTS))
+            qof_log_parse_log_config(log_config_filename);
+        g_free(log_config_filename);
+    }
 
-     if (log_flags != NULL)
-     {
-          int i = 0;
-          for (; log_flags[i] != NULL; i++)
-          {
-               QofLogLevel level;
-               gchar **parts = NULL;
+    if (log_flags != NULL)
+    {
+        int i = 0;
+        for (; log_flags[i] != NULL; i++)
+        {
+            QofLogLevel level;
+            gchar **parts = NULL;
 
-               gchar *log_opt = log_flags[i];
-               parts = g_strsplit(log_opt, "=", 2);
-               if (parts == NULL || parts[0] == NULL || parts[1] == NULL)
-               {
-                    g_warning("string [%s] not parseable", log_opt);
-                    continue;
-               }
+            gchar *log_opt = log_flags[i];
+            parts = g_strsplit(log_opt, "=", 2);
+            if (parts == NULL || parts[0] == NULL || parts[1] == NULL)
+            {
+                g_warning("string [%s] not parseable", log_opt);
+                continue;
+            }
 
-               level = qof_log_level_from_string(parts[1]);
-               qof_log_set_level(parts[0], level);
-               g_strfreev(parts);
-          }
-     }
- }
+            level = qof_log_level_from_string(parts[1]);
+            qof_log_set_level(parts[0], level);
+            g_strfreev(parts);
+        }
+    }
+}
 
 int
 main(int argc, char ** argv)
@@ -568,7 +611,8 @@
 #ifdef ENABLE_BINRELOC
     {
         GError *binreloc_error = NULL;
-        if (!gbr_init(&binreloc_error)) {
+        if (!gbr_init(&binreloc_error))
+        {
             g_print("main: Error on gbr_init: %s\n", binreloc_error->message);
             g_error_free(binreloc_error);
         }
@@ -591,7 +635,7 @@
 
     qof_log_init();
     qof_log_set_default(QOF_LOG_INFO);
- 
+
     environment_override();
     gnucash_command_line(&argc, argv);
     gnc_print_unstable_message();
@@ -599,7 +643,8 @@
 
     gnc_module_system_init();
 
-    if (add_quotes_file) {
+    if (add_quotes_file)
+    {
         gchar *prefix = gnc_path_get_prefix ();
         gchar *pkgsysconfdir = gnc_path_get_pkgsysconfdir ();
         gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
@@ -609,11 +654,11 @@
         gnome_program_init(
             "gnucash", VERSION, LIBGNOME_MODULE,
             argc, argv,
-	    GNOME_PARAM_APP_PREFIX, prefix,
-	    GNOME_PARAM_APP_SYSCONFDIR, pkgsysconfdir,
-	    GNOME_PARAM_APP_DATADIR, pkgdatadir,
-	    GNOME_PARAM_APP_LIBDIR, pkglibdir,
-	    GNOME_PARAM_NONE);
+            GNOME_PARAM_APP_PREFIX, prefix,
+            GNOME_PARAM_APP_SYSCONFDIR, pkgsysconfdir,
+            GNOME_PARAM_APP_DATADIR, pkgdatadir,
+            GNOME_PARAM_APP_LIBDIR, pkglibdir,
+            GNOME_PARAM_NONE);
         g_free (prefix);
         g_free (pkgsysconfdir);
         g_free (pkgdatadir);

Modified: gnucash/trunk/src/business/business-core/gncmod-business-core.c
===================================================================
--- gnucash/trunk/src/business/business-core/gncmod-business-core.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/business/business-core/gncmod-business-core.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -58,47 +58,49 @@
 char *
 libgncmod_business_core_gnc_module_path(void)
 {
-  return g_strdup("gnucash/business-core");
+    return g_strdup("gnucash/business-core");
 }
 
 char *
 libgncmod_business_core_gnc_module_description(void)
 {
-  return g_strdup("The GnuCash business core");
+    return g_strdup("The GnuCash business core");
 }
 
 int
 libgncmod_business_core_gnc_module_init(int refcount)
 {
-  /* load the engine (we depend on it) */
-  if(!gnc_module_load("gnucash/engine", 0)) {
-    return FALSE;
-  }
+    /* load the engine (we depend on it) */
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
 
-  if(refcount == 0)
-  {
-    /* initialize known types */
-    gncInvoiceRegister ();
-    gncJobRegister ();
-    gncBillTermRegister ();
-    gncCustomerRegister ();
-    gncAddressRegister ();
-    gncEmployeeRegister ();
-    gncEntryRegister ();
-    gncOrderRegister ();
-    gncOwnerRegister ();
-    gncTaxTableRegister ();
-    gncVendorRegister ();
-  }
+    if (refcount == 0)
+    {
+        /* initialize known types */
+        gncInvoiceRegister ();
+        gncJobRegister ();
+        gncBillTermRegister ();
+        gncCustomerRegister ();
+        gncAddressRegister ();
+        gncEmployeeRegister ();
+        gncEntryRegister ();
+        gncOrderRegister ();
+        gncOwnerRegister ();
+        gncTaxTableRegister ();
+        gncVendorRegister ();
+    }
 
-  scm_init_sw_business_core_module();
-  scm_c_eval_string("(use-modules (sw_business_core))");
-  scm_c_eval_string("(use-modules (gnucash business-core))");
+    scm_init_sw_business_core_module();
+    scm_c_eval_string("(use-modules (sw_business_core))");
+    scm_c_eval_string("(use-modules (gnucash business-core))");
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_business_core_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_business_core_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/business/business-core/sql/gncmod-business-backend-sql.c
===================================================================
--- gnucash/trunk/src/business/business-core/sql/gncmod-business-backend-sql.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/business/business-core/sql/gncmod-business-backend-sql.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -78,12 +78,16 @@
 int
 libgncmod_business_backend_sql_gnc_module_init(int refcount)
 {
-    if(!gnc_engine_is_initialized()) { return FALSE; }
+    if (!gnc_engine_is_initialized())
+    {
+        return FALSE;
+    }
 
     bus_core = gnc_module_load( "gnucash/business-core", 0 );
-    if( !bus_core ) return FALSE;
+    if ( !bus_core ) return FALSE;
 
-    if( refcount == 0 ) {
+    if ( refcount == 0 )
+    {
         /* Initialize our pointers into the backend subsystem */
         gnc_address_sql_initialize();
         gnc_billterm_sql_initialize();
@@ -93,8 +97,8 @@
         gnc_invoice_sql_initialize();
         gnc_job_sql_initialize();
         gnc_order_sql_initialize();
-	    gnc_owner_sql_initialize();
-	    gnc_taxtable_sql_initialize();
+        gnc_owner_sql_initialize();
+        gnc_taxtable_sql_initialize();
         gnc_vendor_sql_initialize();
     }
 
@@ -106,11 +110,13 @@
 {
     int unload = TRUE;
 
-    if( bus_core ) {
+    if ( bus_core )
+    {
         unload = gnc_module_unload( bus_core );
-	}
+    }
 
-    if( refcount == 0 ) {
+    if ( refcount == 0 )
+    {
         bus_core = NULL;
     }
 

Modified: gnucash/trunk/src/business/business-core/xml/gncmod-business-backend-xml.c
===================================================================
--- gnucash/trunk/src/business/business-core/xml/gncmod-business-backend-xml.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/business/business-core/xml/gncmod-business-backend-xml.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -60,53 +60,58 @@
 char *
 libgncmod_business_backend_xml_gnc_module_path(void)
 {
-  return g_strdup("gnucash/business-core-xml");
+    return g_strdup("gnucash/business-core-xml");
 }
 
 char *
 libgncmod_business_backend_xml_gnc_module_description(void)
 {
-  return g_strdup("The XML (v2) parsers for GnuCash business objects");
+    return g_strdup("The XML (v2) parsers for GnuCash business objects");
 }
 
 int
 libgncmod_business_backend_xml_gnc_module_init(int refcount)
 {
-  if(!gnc_engine_is_initialized()) { return FALSE; }
+    if (!gnc_engine_is_initialized())
+    {
+        return FALSE;
+    }
 
-  bus_core = gnc_module_load("gnucash/business-core", 0);
-  if(!bus_core) return FALSE;
+    bus_core = gnc_module_load("gnucash/business-core", 0);
+    if (!bus_core) return FALSE;
 
-  if (refcount == 0) {
-    /* Initialize our pointers into the backend subsystem */
-    gnc_address_xml_initialize ();
-    gnc_billterm_xml_initialize ();
-    gnc_customer_xml_initialize ();
-    gnc_employee_xml_initialize ();
-    gnc_entry_xml_initialize ();
-    gnc_invoice_xml_initialize ();
-    gnc_job_xml_initialize ();
-    gnc_order_xml_initialize ();
-    gnc_owner_xml_initialize ();
-    gnc_taxtable_xml_initialize ();
-    gnc_vendor_xml_initialize ();
-  }
+    if (refcount == 0)
+    {
+        /* Initialize our pointers into the backend subsystem */
+        gnc_address_xml_initialize ();
+        gnc_billterm_xml_initialize ();
+        gnc_customer_xml_initialize ();
+        gnc_employee_xml_initialize ();
+        gnc_entry_xml_initialize ();
+        gnc_invoice_xml_initialize ();
+        gnc_job_xml_initialize ();
+        gnc_order_xml_initialize ();
+        gnc_owner_xml_initialize ();
+        gnc_taxtable_xml_initialize ();
+        gnc_vendor_xml_initialize ();
+    }
 
-  return TRUE;
+    return TRUE;
 }
 
 int
 libgncmod_business_backend_xml_gnc_module_end(int refcount)
 {
-  int unload = TRUE;
+    int unload = TRUE;
 
-  if (bus_core)
-    unload = gnc_module_unload(bus_core);
+    if (bus_core)
+        unload = gnc_module_unload(bus_core);
 
-  if (refcount == 0) {
-    bus_core = NULL;
-    file = NULL;
-  }
+    if (refcount == 0)
+    {
+        bus_core = NULL;
+        file = NULL;
+    }
 
-  return unload;
+    return unload;
 }

Modified: gnucash/trunk/src/business/business-gnome/gncmod-business-gnome.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/gncmod-business-gnome.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/business/business-gnome/gncmod-business-gnome.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -63,82 +63,89 @@
 char *
 libgncmod_business_gnome_gnc_module_path(void)
 {
-  return g_strdup("gnucash/business-gnome");
+    return g_strdup("gnucash/business-gnome");
 }
 
 char *
 libgncmod_business_gnome_gnc_module_description(void)
 {
-  return g_strdup("The GnuCash business module GNOME UI");
+    return g_strdup("The GnuCash business module GNOME UI");
 }
 
 int
 libgncmod_business_gnome_gnc_module_init(int refcount)
 {
-  /* load business-core: we depend on it -- and it depends on the engine */
-  if (!gnc_module_load ("gnucash/business-core", 0)) {
-    return FALSE;
-  }
-  /* We also depend on app-utils, gnome-utils, and gnome-search modules */
-  if (!gnc_module_load ("gnucash/app-utils", 0)) {
-    return FALSE;
-  }
-  if (!gnc_module_load ("gnucash/gnome-utils", 0)) {
-    return FALSE;
-  }
-  if (!gnc_module_load ("gnucash/gnome-search", 0)) {
-    return FALSE;
-  }
-  if (!gnc_module_load ("gnucash/report/report-gnome", 0)) {
-    return FALSE;
-  }
-  //  if (!libgncmod_business_gnome_gnc_module_load ("gnucash/report/standard-reports", 0)) {
-  //    return FALSE;
-  //  }
+    /* load business-core: we depend on it -- and it depends on the engine */
+    if (!gnc_module_load ("gnucash/business-core", 0))
+    {
+        return FALSE;
+    }
+    /* We also depend on app-utils, gnome-utils, and gnome-search modules */
+    if (!gnc_module_load ("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load ("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load ("gnucash/gnome-search", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load ("gnucash/report/report-gnome", 0))
+    {
+        return FALSE;
+    }
+    //  if (!libgncmod_business_gnome_gnc_module_load ("gnucash/report/standard-reports", 0)) {
+    //    return FALSE;
+    //  }
 
-  scm_c_eval_string("(use-modules (gnucash business-gnome))");
-  scm_c_eval_string("(use-modules (gnucash report business-reports))");
+    scm_c_eval_string("(use-modules (gnucash business-gnome))");
+    scm_c_eval_string("(use-modules (gnucash report business-reports))");
 
-  // temp code until gnc:url-type is wrapped
-  /*
-  {
-      SCM wct_gnc_url_type = scm_c_eval_string("<gnc:url-type>");
-      SCM tmp;
+    // temp code until gnc:url-type is wrapped
+    /*
+    {
+        SCM wct_gnc_url_type = scm_c_eval_string("<gnc:url-type>");
+        SCM tmp;
 
-      tmp = gw_wcp_assimilate_ptr(GNC_CUSTOMER_MODULE_NAME, wct_gnc_url_type);
-      scm_c_define("gnc:url-type-customer", tmp);
-      tmp = gw_wcp_assimilate_ptr(GNC_VENDOR_MODULE_NAME, wct_gnc_url_type);
-      scm_c_define("gnc:url-type-vendor", tmp);
-      tmp = gw_wcp_assimilate_ptr(GNC_EMPLOYEE_MODULE_NAME, wct_gnc_url_type);
-      scm_c_define("gnc:url-type-employee", tmp);
-      tmp = gw_wcp_assimilate_ptr(GNC_INVOICE_MODULE_NAME, wct_gnc_url_type);
-      scm_c_define("gnc:url-type-invoice", tmp);
-      tmp = gw_wcp_assimilate_ptr(URL_TYPE_OWNERREPORT, wct_gnc_url_type);
-      scm_c_define("gnc:url-type-ownerreport", tmp);
-  }
-  */
+        tmp = gw_wcp_assimilate_ptr(GNC_CUSTOMER_MODULE_NAME, wct_gnc_url_type);
+        scm_c_define("gnc:url-type-customer", tmp);
+        tmp = gw_wcp_assimilate_ptr(GNC_VENDOR_MODULE_NAME, wct_gnc_url_type);
+        scm_c_define("gnc:url-type-vendor", tmp);
+        tmp = gw_wcp_assimilate_ptr(GNC_EMPLOYEE_MODULE_NAME, wct_gnc_url_type);
+        scm_c_define("gnc:url-type-employee", tmp);
+        tmp = gw_wcp_assimilate_ptr(GNC_INVOICE_MODULE_NAME, wct_gnc_url_type);
+        scm_c_define("gnc:url-type-invoice", tmp);
+        tmp = gw_wcp_assimilate_ptr(URL_TYPE_OWNERREPORT, wct_gnc_url_type);
+        scm_c_define("gnc:url-type-ownerreport", tmp);
+    }
+    */
 
-  if (refcount == 0) {
-    /* Register the Owner search type */
-    gnc_search_core_register_type (GNC_OWNER_MODULE_NAME,
-				   (GNCSearchCoreNew) gnc_search_owner_new);
-    gnc_business_urls_initialize ();
-    gnc_business_options_gnome_initialize ();
+    if (refcount == 0)
+    {
+        /* Register the Owner search type */
+        gnc_search_core_register_type (GNC_OWNER_MODULE_NAME,
+                                       (GNCSearchCoreNew) gnc_search_owner_new);
+        gnc_business_urls_initialize ();
+        gnc_business_options_gnome_initialize ();
 
-    gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (),
-				   gnc_plugin_business_new ());
+        gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (),
+                                       gnc_plugin_business_new ());
 
-    gnc_hook_add_dangler(HOOK_BOOK_OPENED,
-			 (GFunc)gnc_invoice_remind_bills_due_cb, NULL);
+        gnc_hook_add_dangler(HOOK_BOOK_OPENED,
+                             (GFunc)gnc_invoice_remind_bills_due_cb, NULL);
 
-    gnc_preferences_add_page("businessprefs.glade", "business_prefs",
-			     _("Business"));
-  }
+        gnc_preferences_add_page("businessprefs.glade", "business_prefs",
+                                 _("Business"));
+    }
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_business_gnome_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_business_gnome_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/business/business-utils/gncmod-business-utils.c
===================================================================
--- gnucash/trunk/src/business/business-utils/gncmod-business-utils.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/business/business-utils/gncmod-business-utils.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -43,39 +43,42 @@
 char *
 libgncmod_business_utils_gnc_module_path(void)
 {
-  return g_strdup("gnucash/business-utils");
+    return g_strdup("gnucash/business-utils");
 }
 
 char *
 libgncmod_business_utils_gnc_module_description(void)
 {
-  return g_strdup("The GnuCash business utilities module");
+    return g_strdup("The GnuCash business utilities module");
 }
 
 int
 libgncmod_business_utils_gnc_module_init(int refcount)
 {
-  /* load the business-core (we depend on it) */
-  if (!gnc_module_load("gnucash/business-core", 0)) {
-    return FALSE;
-  }
+    /* load the business-core (we depend on it) */
+    if (!gnc_module_load("gnucash/business-core", 0))
+    {
+        return FALSE;
+    }
 
-  /* Load the application utils.. */
-  if (!gnc_module_load("gnucash/app-utils", 0)) {
-    return FALSE;
-  }
+    /* Load the application utils.. */
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
 
-  if(refcount == 0)
-  {
-    /* initialize known types */
-  }
+    if (refcount == 0)
+    {
+        /* initialize known types */
+    }
 
-  scm_c_eval_string("(use-modules (gnucash business-utils))");
+    scm_c_eval_string("(use-modules (gnucash business-utils))");
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_business_utils_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_business_utils_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/business/dialog-tax-table/gncmod-dialog-tax-table.c
===================================================================
--- gnucash/trunk/src/business/dialog-tax-table/gncmod-dialog-tax-table.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/business/dialog-tax-table/gncmod-dialog-tax-table.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -44,37 +44,41 @@
 char *
 libgncmod_dialog_tax_table_gnc_module_path(void)
 {
-  return g_strdup("gnucash/dialog-tax-table");
+    return g_strdup("gnucash/dialog-tax-table");
 }
 
 char *
 libgncmod_dialog_tax_table_gnc_module_description(void)
 {
-  return g_strdup("The GnuCash tax-table GNOME UI module");
+    return g_strdup("The GnuCash tax-table GNOME UI module");
 }
 
 int
 libgncmod_dialog_tax_table_gnc_module_init(int refcount)
 {
-  /* load business-core: we depend on it -- and it depends on the engine */
-  if (!gnc_module_load ("gnucash/business-core", 0)) {
-    return FALSE;
-  }
-  /* We also depend on app-utils and gnome-utils modules */
-  if (!gnc_module_load ("gnucash/app-utils", 0)) {
-    return FALSE;
-  }
-  if (!gnc_module_load ("gnucash/gnome-utils", 0)) {
-    return FALSE;
-  }
+    /* load business-core: we depend on it -- and it depends on the engine */
+    if (!gnc_module_load ("gnucash/business-core", 0))
+    {
+        return FALSE;
+    }
+    /* We also depend on app-utils and gnome-utils modules */
+    if (!gnc_module_load ("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load ("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
 
-  scm_init_sw_dialog_tax_table_module();
-  scm_c_eval_string("(use-modules (sw_dialog_tax_table))");
+    scm_init_sw_dialog_tax_table_module();
+    scm_c_eval_string("(use-modules (sw_dialog_tax_table))");
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_dialog_tax_table_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_dialog_tax_table_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/calculation/amort_opt.c
===================================================================
--- gnucash/trunk/src/calculation/amort_opt.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/calculation/amort_opt.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -40,7 +40,7 @@
     var_store       value;
     numeric_ptr     nval;
     struct tm      *times_E,
-                *times_I;
+            *times_I;
 
     /* print amortization options */
     times_E = (struct tm *)calloc(1, sizeof(struct tm));

Modified: gnucash/trunk/src/calculation/amort_prt.c
===================================================================
--- gnucash/trunk/src/calculation/amort_prt.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/calculation/amort_prt.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -37,16 +37,16 @@
     FILE            *ofile)      /* output file                               */
 {
     unsigned            j,
-    jj,
-    prec = amortsched->prec,
+           jj,
+           prec = amortsched->prec,
            option = amortsched->option,
-                    fv_case = amortsched->fv_case;
+           fv_case = amortsched->fv_case;
     unsigned char       datel[100],
-    summary = amortsched->summary;
+             summary = amortsched->summary;
     struct tm          *times_E,
-                *times_I;
+            *times_I;
     amort_sched_yr_ptr  amortyr,
-    prst_yr;
+                     prst_yr;
     sched_pmt_ptr       pmtsched = NULL;
     yearly_summary_ptr  annual_summary;
 

Modified: gnucash/trunk/src/calculation/fin-interactive.c
===================================================================
--- gnucash/trunk/src/calculation/fin-interactive.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/calculation/fin-interactive.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -254,15 +254,15 @@
     var_store_ptr   value_list;
     numeric_ptr     nval;
     unsigned        compute,
-    jj,
-    yrE,
-    monthE,
-    dayE,
-    yrI,
-    monthI,
-    dayI;
+           jj,
+           yrE,
+           monthE,
+           dayE,
+           yrI,
+           monthI,
+           dayI;
     struct tm      *times_E,
-                *times_I;
+            *times_I;
     void           *parse_env;
     amort_sched     amortsched;
     financial_info  fininfo;

Modified: gnucash/trunk/src/calculation/fin.c
===================================================================
--- gnucash/trunk/src/calculation/fin.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/calculation/fin.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1532,7 +1532,7 @@
     double CC = _C (eint, pmt, bep);
     double D = (AA + 1.0) / (1.0 + eint);
     g_return_val_if_fail(CC != 0.0, 0.0);
-    return (double) per *(pv + CC) * D - (AA * CC) / eint;
+    return (double) per * (pv + CC) * D - (AA * CC) / eint;
 }				/* fip */
 
 void
@@ -1621,13 +1621,13 @@
     unsigned new_n;
     unsigned prec = amortsched->prec;
     unsigned long s,
-    d,
-    days_to_yr_end,
-    Eff_Date_jdn =
-        julian_day_number (amortsched->year_E, amortsched->month_E,
-                           amortsched->day_E), Init_Date_jdn =
-            julian_day_number (amortsched->year_I, amortsched->month_I,
-                               amortsched->day_I);
+             d,
+             days_to_yr_end,
+             Eff_Date_jdn =
+                 julian_day_number (amortsched->year_E, amortsched->month_E,
+                                    amortsched->day_E), Init_Date_jdn =
+                     julian_day_number (amortsched->year_I, amortsched->month_I,
+                                        amortsched->day_I);
 
     amortsched->Eff_Date_jdn = Eff_Date_jdn;
     amortsched->Init_Date_jdn = Init_Date_jdn;

Modified: gnucash/trunk/src/calculation/fin_spl_protos.h
===================================================================
--- gnucash/trunk/src/calculation/fin_spl_protos.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/calculation/fin_spl_protos.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -39,6 +39,6 @@
     void          *negate_numeric(void *value),
     void           free_numeric(void *numeric_value),
     void		 *func_op( const char *fname,
-                     int argc, void **argv ) );
+                           int argc, void **argv ) );
 
 #endif

Modified: gnucash/trunk/src/calculation/numeric_ops.c
===================================================================
--- gnucash/trunk/src/calculation/numeric_ops.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/calculation/numeric_ops.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -91,16 +91,16 @@
 {
     double         dblval = 0.0;
     int            exp = 0,
-                         dchr,
-                         err = 0,
-                               base = 10;
+                   dchr,
+                   err = 0,
+                   base = 10;
     long int       inum = 0;
     unsigned long  msdec = 0,
-                           lsdec = 0,
-                                   msscale = 1;
+                   lsdec = 0,
+                   msscale = 1;
     unsigned       radix = 0,
-                           sign = 0,
-                                  digit_cnt = 0;
+                   sign = 0,
+                   digit_cnt = 0;
     const char    *strinit = str;
     numeric_ptr    rslt = NULL;
 
@@ -306,8 +306,8 @@
     void *r_value)
 {
     numeric_ptr lval = (numeric_ptr)l_value,
-                       rval = (numeric_ptr)r_value,
-                              rslt = (op_symbol == ASN_OP) ? lval : (numeric_ptr)calloc(1, sizeof(numeric));
+                rval = (numeric_ptr)r_value,
+                rslt = (op_symbol == ASN_OP) ? lval : (numeric_ptr)calloc(1, sizeof(numeric));
 
     switch ( op_symbol )
     {

Modified: gnucash/trunk/src/engine/AccountP.h
===================================================================
--- gnucash/trunk/src/engine/AccountP.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/AccountP.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -32,7 +32,7 @@
  * in an inconsistent state.  If they are not used in the proper
  * setting, they can leave the account structures in an inconsistent
  * state.  Thus, these methods should never be used outside of
- * the engine, which is why they are "hidden" here. 
+ * the engine, which is why they are "hidden" here.
  *
  */
 
@@ -43,7 +43,7 @@
 
 /** STRUCTS *********************************************************/
 
-/** This is the data that describes an account. 
+/** This is the data that describes an account.
  *
  * This is the *private* header for the account structure.
  * No one outside of the engine should ever include this file.
@@ -52,7 +52,7 @@
 /** \struct Account */
 struct account_s
 {
-  QofInstance inst;
+    QofInstance inst;
 };
 
 /* Set the account's GUID. This should only be done when reading

Modified: gnucash/trunk/src/engine/FreqSpec.h
===================================================================
--- gnucash/trunk/src/engine/FreqSpec.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/FreqSpec.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -43,8 +43,8 @@
 DEFINE_ENUM(FreqType, ENUM_LIST_TYPE) /**< \enum FreqType
 Frequency specification.
 
-For BI_WEEKLY, use weekly[2] 
- SEMI_MONTHLY, use composite 
+For BI_WEEKLY, use weekly[2]
+ SEMI_MONTHLY, use composite
  YEARLY, monthly[12] */
 
 AS_STRING_DEC(FreqType, ENUM_LIST_TYPE)
@@ -63,14 +63,14 @@
         _(UIFREQ_TRI_ANUALLY,) /**< Repeat three times a year. */ \
         _(UIFREQ_SEMI_YEARLY,) /**< Repeat twice a year. */ \
         _(UIFREQ_YEARLY,) /**< Repeat once a year. */ \
-        _(UIFREQ_NUM_UI_FREQSPECS,) 
+        _(UIFREQ_NUM_UI_FREQSPECS,)
 
 DEFINE_ENUM( UIFreqType, ENUM_LIST_UI) /**< \enum UIFreqType
 
  * The user's conception of the frequency.  It is expected that this
  * list will grow, while the former ::FreqType will not. */
 
-AS_STRING_DEC(UIFreqType, ENUM_LIST_UI) 
+AS_STRING_DEC(UIFreqType, ENUM_LIST_UI)
 FROM_STRING_DEC(UIFreqType, ENUM_LIST_UI)
 
 /** @} */

Modified: gnucash/trunk/src/engine/GNCId.h
===================================================================
--- gnucash/trunk/src/engine/GNCId.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/GNCId.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -6,24 +6,24 @@
  */
 #define xaccGUIDNew(guid,book)     \
       qof_instance_guid_new (qof_book_get_entity_table (book), (guid))
-                                                                                
 
-		#define xaccGUIDNULL guid_null
-		#define xaccGUIDMalloc guid_malloc
-		#define xaccGUIDFree guid_free
 
-		#define GNCIdTypeConst QofIdTypeConst
-		#define GNCIdType QofIdType
-		#define GNCEntityTable QofInstanceTable
-		#define xaccGUIDTypeEntityTable qof_guid_type
+#define xaccGUIDNULL guid_null
+#define xaccGUIDMalloc guid_malloc
+#define xaccGUIDFree guid_free
 
-		#define xaccEntityTableNew qof_instance_new
-		#define xaccEntityTableDestroy qof_instance_destroy
-		#define xaccGUIDNewEntityTable qof_instance_guid_new
-		#define xaccLookupEntity qof_instance_lookup
-		#define xaccStoreEntity qof_instance_store
-		#define xaccRemoveEntity qof_instance_remove
-		#define xaccForeachEntity qof_instance_foreach
+#define GNCIdTypeConst QofIdTypeConst
+#define GNCIdType QofIdType
+#define GNCEntityTable QofInstanceTable
+#define xaccGUIDTypeEntityTable qof_guid_type
 
-		#define foreachObjectCB QofInstanceForeachCB
+#define xaccEntityTableNew qof_instance_new
+#define xaccEntityTableDestroy qof_instance_destroy
+#define xaccGUIDNewEntityTable qof_instance_guid_new
+#define xaccLookupEntity qof_instance_lookup
+#define xaccStoreEntity qof_instance_store
+#define xaccRemoveEntity qof_instance_remove
+#define xaccForeachEntity qof_instance_foreach
 
+#define foreachObjectCB QofInstanceForeachCB
+

Modified: gnucash/trunk/src/engine/Period.h
===================================================================
--- gnucash/trunk/src/engine/Period.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/Period.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -45,26 +45,26 @@
  *    book will have a copy of every account in the open book,
  *    and that these copies will have new GUID's issued to them.
  *    Thus, every account has a 'twin' in the other book.
- * 
- *    This routine will also create 'equity transactions' in 
+ *
+ *    This routine will also create 'equity transactions' in
  *    order to preserve the balances on accounts.  For any
  *    account that is not of income, expense, trading or equity type,
  *    this routine wil find the closing balance of each account
  *    in the closed book.  It will then create an 'equity
- *    transaction' in the open book, creating an opening balance 
- *    between an equity account and the twin account to the 
+ *    transaction' in the open book, creating an opening balance
+ *    between an equity account and the twin account to the
  *    closed account.  The 'memo' field will be used to set
  *    the description in the equity transaction.  Typically,
  *    you will want to set this field to _("Opening Balance").
  *
- *    The equity_account argument is supposed to indicate the 
+ *    The equity_account argument is supposed to indicate the
  *    equity account in the open book into which the opening
  *    balances will be placed.   This argument may be NULL,
- *    if it is NULL, then a search algorithm will be used to 
- *    find a suitable equity account.  If NULL, this routine 
- *    searches for the 'nearest' account of GNCAccountType ACCT_TYPE_EQUITY 
- *    among its siblings, or the siblings of its parents.  It 
- *    does not search downwards.  If it does not find such an 
+ *    if it is NULL, then a search algorithm will be used to
+ *    find a suitable equity account.  If NULL, this routine
+ *    searches for the 'nearest' account of GNCAccountType ACCT_TYPE_EQUITY
+ *    among its siblings, or the siblings of its parents.  It
+ *    does not search downwards.  If it does not find such an
  *    account, it will create one, hanging off the top-most group.
  *
  *    This routine also populates a number of KVP values in
@@ -73,49 +73,49 @@
  *    to safely re-open and re-close a closed book.  In particular,
  *    if a closed book is re-opened, the 'equity transaction'
  *    would need to be adjusted.
- * 
+ *
  *    The kvp values that are set are:
  *
  *    Implemented in the closed book:
  *    /book/close-date       Latest date in this book. Must not change.
  *    /book/log-date         Date on which user called this routine.
  *    /book/next-book        GUID of next book (the still-open book).
- *    
+ *
  *    Implemented in still-open book:
  *    /book/open-date        Earliest date in this book.
  *    /book/prev-book        GUID of previous book (the closed book).
- *    
+ *
  *    Implemented in the balancing transaction:
  *    /book/closed-acct      GUID of account whose balance was brought forward
  *    /book/closed-book      GUID of book whose balance was brought forward
- *    
+ *
  *    Implemented in the closed account:
  *    /book/balancing-trans  GUID of equity-balancing transaction.
  *    /book/next-book        GUID of equity-balancing book.
  *    /book/next-acct        GUID of twin of this account in the open book.
- *    
+ *
  *    Implemented in the still-open account:
  *    /book/prev-acct         GUID of twin of this account in the closed book.
  *    /book/prev-book         GUID of previous book (the closed book)
- *    
+ *
  */
-QofBook * gnc_book_close_period (QofBook *, Timespec, 
-                                 Account *equity_acct, 
+QofBook * gnc_book_close_period (QofBook *, Timespec,
+                                 Account *equity_acct,
                                  const char *memo);
 
 /** The gnc_book_partition_txn() uses the result of the indicated query
  *    to move a set of transactions from the "src" book to the "dest"
- *    book.  Before moving the transactions, it will first place a 
- *    copy of all of the accounts in "src" into "dest".  This is done 
+ *    book.  Before moving the transactions, it will first place a
+ *    copy of all of the accounts in "src" into "dest".  This is done
  *    in order to ensure that all of the moved transactions will have
  *    the corrrect set of accounts to reference.  The transactions
  *    that will be moved are precisely those specified by the query.
- *    Any query that returns a list of transactions will work to 
- *    partition a book; however, its expected that this routine will 
- *    mostly serve as a utility to break up a book into accounting 
- *    periods. 
+ *    Any query that returns a list of transactions will work to
+ *    partition a book; however, its expected that this routine will
+ *    mostly serve as a utility to break up a book into accounting
+ *    periods.
  *
- *    This routine intentionally does not copy scheduled/recurring 
+ *    This routine intentionally does not copy scheduled/recurring
  *    transactions.
  *
  *    This routine will also copy closed lots to the destination book.
@@ -131,33 +131,33 @@
  *    The GUID of its sibling is placed in the 'gemini' KVP value
  *    (See kvp_doc.txt for more detail).   Transactions and splits
  *    are moved without reassigning them a new GUID.  Note they
- *    are removed from one book's entity table and placed into the 
+ *    are removed from one book's entity table and placed into the
  *    other book:  Once moved, they won't be findable in the entity
  *    table of the old book.
- * 
- *    Known Bugs: 
+ *
+ *    Known Bugs:
  *    When this routine copies accounts, it does not check to see
- *    if they already exist in the 'dest' book; it should.  
- *    For the current usage, this bug aint important, and I'm too 
+ *    if they already exist in the 'dest' book; it should.
+ *    For the current usage, this bug aint important, and I'm too
  *    lazy to fix it.
  */
 void gnc_book_partition_txn (QofBook *dest, QofBook *src, QofQuery *);
 
 /** The gnc_book_partition_pricedb() routine uses te result of the
- *   indicated query to move a set of prices from the "src" book 
+ *   indicated query to move a set of prices from the "src" book
  *   to the "dest" book.  The query passed into it must be set up
  *   to return a list of prices.
  */
 void gnc_book_partition_pricedb (QofBook *dest, QofBook *src, QofQuery *);
 
-/** The gnc_book_insert_trans_clobber() routine takes an existing 
- *    transaction that is located in one book, and moves it to 
- *    another book.  It moves all of the splits as well.  In the 
- *    course of the move, the transaction is literally deleted 
- *    from the first book as its placed into the second.  The 
- *    transaction and split GUID's are not changed in the move.  
- *    This routine assumes that twin accounts already exist in 
- *    both books (and can be located with the standard twining 
+/** The gnc_book_insert_trans_clobber() routine takes an existing
+ *    transaction that is located in one book, and moves it to
+ *    another book.  It moves all of the splits as well.  In the
+ *    course of the move, the transaction is literally deleted
+ *    from the first book as its placed into the second.  The
+ *    transaction and split GUID's are not changed in the move.
+ *    This routine assumes that twin accounts already exist in
+ *    both books (and can be located with the standard twining
  *    proceedure).
  *
  *    Note that this routine does *not* move the lots that any
@@ -171,7 +171,7 @@
  *    merely moves the transaction and split GUID's to the new
  *    books' entity tables, and not much else.
  *
- * The gnc_book_insert_lot() routine, as above, but for lots ... 
+ * The gnc_book_insert_lot() routine, as above, but for lots ...
  */
 
 void gnc_book_insert_trans (QofBook *book, Transaction *trans);

Modified: gnucash/trunk/src/engine/Query.h
===================================================================
--- gnucash/trunk/src/engine/Query.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/Query.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -63,23 +63,24 @@
 
 #define xaccQueryEqual		qof_query_equal
 
-typedef enum {
-  QUERY_TXN_MATCH_ALL=1,   /* match all accounts */
-  QUERY_TXN_MATCH_ANY=2    /* match any account */
+typedef enum
+{
+    QUERY_TXN_MATCH_ALL = 1, /* match all accounts */
+    QUERY_TXN_MATCH_ANY = 2  /* match any account */
 } query_txn_match_t;
 
-/* After the query has been set up, call one of these to run the query. 
+/* After the query has been set up, call one of these to run the query.
  *    XXX The routines below should be replaced by a query
  *    that explicitly asks for a list of the desired item.
  *
- * The xaccQueryGetSplits() routine returns all splits matching the 
+ * The xaccQueryGetSplits() routine returns all splits matching the
  *    query.  Any given split will appear at most once in the result;
  *    however, several splits from one transaction may appear in the list.
  *    The caller MUST NOT change the GList.
  *
  * The xaccQueryGetSplitsUniqueTrans() routine returns splits matching
- *    the query, but only one matching split per transaction will be 
- *    returned.  In other words, any given transaction will be 
+ *    the query, but only one matching split per transaction will be
+ *    returned.  In other words, any given transaction will be
  *    represented at most once in the returned list.  The caller must
  *    free the GList.
  *
@@ -91,17 +92,17 @@
  * The xaccQueryGetLots() routine is just like GetTransactions() except
  *    it returns a list of Lots.
  *
- *    query_txn_match_t describes how to match accounts when querying 
+ *    query_txn_match_t describes how to match accounts when querying
  *    for transactions with xaccQueryGetTransactions().
- *    What is the difference between 'ANY' and 'ALL', you 
+ *    What is the difference between 'ANY' and 'ALL', you
  *    may ask?  First, let us recall that a transaction consists
  *    of splits, and each split belongs to exactly one account.
- *    Specifying "MATCH_ALL"  means that *every* account that 
- *    shows up in the query must also show up in some split in 
- *    the transaction (in order for that transaction to be 
+ *    Specifying "MATCH_ALL"  means that *every* account that
+ *    shows up in the query must also show up in some split in
+ *    the transaction (in order for that transaction to be
  *    selected).  By contrast, specifying 'ANY' means that
  *    any account in the query must show up in some split
- *    in the transaction (in order for the transaction to 
+ *    in the transaction (in order for the transaction to
  *    be selected).  Thus, 'ANY' acts as a boolean-OR when
  *    matching accounts, whereas 'AND' acts as a boolean-AND
  *    for matching accounts.  Whew. Got that?
@@ -112,7 +113,7 @@
 LotList     * xaccQueryGetLots(Query * q, query_txn_match_t type);
 
 /*******************************************************************
- *  match-adding API 
+ *  match-adding API
  *******************************************************************/
 
 void xaccQueryAddAccountMatch(Query *, AccountList *,
@@ -124,9 +125,9 @@
 void xaccQueryAddSingleAccountMatch(Query *, Account *, QofQueryOp);
 
 void xaccQueryAddStringMatch (Query* q, const char *matchstring,
-			      gboolean case_sens, gboolean use_regexp,
+                              gboolean case_sens, gboolean use_regexp,
                               QofQueryOp op,
-			      const char * path, ...);
+                              const char * path, ...);
 void
 xaccQueryAddDescriptionMatch(Query *q, const char *m, gboolean c, gboolean r,
                              QofQueryOp o);
@@ -152,15 +153,15 @@
 xaccQueryAddBalanceMatch(Query *q, QofQueryCompare bal, QofQueryOp op);
 
 void xaccQueryAddNumericMatch (Query *q, gnc_numeric amount,
-			       QofNumericMatch sign, QofQueryCompare how,
-			       QofQueryOp op, const char * path, ...);
+                               QofNumericMatch sign, QofQueryCompare how,
+                               QofQueryOp op, const char * path, ...);
 
 /** The DateMatch queries match transactions whose posted date
  *    is in a date range.  If use_start is TRUE, then a matching
- *    posted date will be greater than the start date.   If 
- *    use_end is TRUE, then a match occurs for posted dates earlier 
- *    than the end date.  If both flags are set, then *both* 
- *    conditions must hold ('and').  If neither flag is set, then 
+ *    posted date will be greater than the start date.   If
+ *    use_end is TRUE, then a match occurs for posted dates earlier
+ *    than the end date.  If both flags are set, then *both*
+ *    conditions must hold ('and').  If neither flag is set, then
  *    all transactions are matched.
  */
 
@@ -168,29 +169,30 @@
                            int sday, int smonth, int syear,
                            gboolean use_end, int eday, int emonth, int eyear,
                            QofQueryOp op);
-void xaccQueryAddDateMatchTS(Query * q, 
+void xaccQueryAddDateMatchTS(Query * q,
                              gboolean use_start, Timespec sts,
                              gboolean use_end, Timespec ets,
                              QofQueryOp op);
-void xaccQueryAddDateMatchTT(Query * q, 
+void xaccQueryAddDateMatchTT(Query * q,
                              gboolean use_start, time_t stt,
                              gboolean use_end, time_t ett,
                              QofQueryOp op);
-void xaccQueryGetDateMatchTS (Query * q, 
-			      Timespec * sts,
-			      Timespec * ets);
-void xaccQueryGetDateMatchTT (Query * q, 
-			      time_t * stt,
-			      time_t * ett);
+void xaccQueryGetDateMatchTS (Query * q,
+                              Timespec * sts,
+                              Timespec * ets);
+void xaccQueryGetDateMatchTT (Query * q,
+                              time_t * stt,
+                              time_t * ett);
 
-typedef enum {
-  CLEARED_NONE       = 0x0000,
-  CLEARED_NO         = 0x0001,
-  CLEARED_CLEARED    = 0x0002,
-  CLEARED_RECONCILED = 0x0004, 
-  CLEARED_FROZEN     = 0x0008,
-  CLEARED_VOIDED     = 0x0010,
-  CLEARED_ALL        = 0x001F
+typedef enum
+{
+    CLEARED_NONE       = 0x0000,
+    CLEARED_NO         = 0x0001,
+    CLEARED_CLEARED    = 0x0002,
+    CLEARED_RECONCILED = 0x0004,
+    CLEARED_FROZEN     = 0x0008,
+    CLEARED_VOIDED     = 0x0010,
+    CLEARED_ALL        = 0x001F
 } cleared_match_t;
 
 void xaccQueryAddClearedMatch(Query * q, cleared_match_t how, QofQueryOp op);
@@ -203,7 +205,7 @@
                           QofQueryOp op);
 
 /*******************************************************************
- *  compatibility interface with old Query API 
+ *  compatibility interface with old Query API
  *******************************************************************/
 time_t xaccQueryGetEarliestDateFound(Query * q);
 time_t xaccQueryGetLatestDateFound(Query * q);

Modified: gnucash/trunk/src/engine/QueryCore.h
===================================================================
--- gnucash/trunk/src/engine/QueryCore.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/QueryCore.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,68 +1,68 @@
 
 #include "qof.h"
 
-		#define QueryPredData_t QofQueryPredData*
+#define QueryPredData_t QofQueryPredData*
 
-		#define gncQueryStringPredicate qof_query_string_predicate
-		#define gncQueryDatePredicate qof_query_date_predicate
-		#define gncQueryNumericPredicate qof_query_numeric_predicate
-		#define gncQueryGUIDPredicate qof_query_guid_predicate
-		#define gncQueryInt32Predicate qof_query_int32_predicate
-		#define gncQueryInt64Predicate qof_query_int64_predicate
-		#define gncQueryDoublePredicate qof_query_double_predicate
-		#define gncQueryBooleanPredicate qof_query_boolean_predicate
-		#define gncQueryCharPredicate qof_query_char_predicate
-		#define gncQueryKVPPredicate qof_query_kvp_predicate
-		#define gncQueryCorePredicateFree qof_query_core_predicate_free
+#define gncQueryStringPredicate qof_query_string_predicate
+#define gncQueryDatePredicate qof_query_date_predicate
+#define gncQueryNumericPredicate qof_query_numeric_predicate
+#define gncQueryGUIDPredicate qof_query_guid_predicate
+#define gncQueryInt32Predicate qof_query_int32_predicate
+#define gncQueryInt64Predicate qof_query_int64_predicate
+#define gncQueryDoublePredicate qof_query_double_predicate
+#define gncQueryBooleanPredicate qof_query_boolean_predicate
+#define gncQueryCharPredicate qof_query_char_predicate
+#define gncQueryKVPPredicate qof_query_kvp_predicate
+#define gncQueryCorePredicateFree qof_query_core_predicate_free
 
-		#define COMPARE_LT QOF_COMPARE_LT
-		#define COMPARE_LTE QOF_COMPARE_LTE
-		#define COMPARE_EQUAL QOF_COMPARE_EQUAL
-		#define COMPARE_GT QOF_COMPARE_GT
-		#define COMPARE_GTE QOF_COMPARE_GTE
-		#define COMPARE_NEQ QOF_COMPARE_NEQ
+#define COMPARE_LT QOF_COMPARE_LT
+#define COMPARE_LTE QOF_COMPARE_LTE
+#define COMPARE_EQUAL QOF_COMPARE_EQUAL
+#define COMPARE_GT QOF_COMPARE_GT
+#define COMPARE_GTE QOF_COMPARE_GTE
+#define COMPARE_NEQ QOF_COMPARE_NEQ
 
-		#define STRING_MATCH_NORMAL QOF_STRING_MATCH_NORMAL
-		#define STRING_MATCH_CASEINSENSITIVE QOF_STRING_MATCH_CASEINSENSITIVE
+#define STRING_MATCH_NORMAL QOF_STRING_MATCH_NORMAL
+#define STRING_MATCH_CASEINSENSITIVE QOF_STRING_MATCH_CASEINSENSITIVE
 
-		#define DATE_MATCH_NORMAL QOF_DATE_MATCH_NORMAL
-		#define DATE_MATCH_ROUNDED QOF_DATE_MATCH_ROUNDED
+#define DATE_MATCH_NORMAL QOF_DATE_MATCH_NORMAL
+#define DATE_MATCH_ROUNDED QOF_DATE_MATCH_ROUNDED
 
-		#define NUMERIC_MATCH_ANY QOF_NUMERIC_MATCH_ANY
-		#define NUMERIC_MATCH_CREDIT QOF_NUMERIC_MATCH_CREDIT
-		#define NUMERIC_MATCH_DEBIT QOF_NUMERIC_MATCH_DEBIT
+#define NUMERIC_MATCH_ANY QOF_NUMERIC_MATCH_ANY
+#define NUMERIC_MATCH_CREDIT QOF_NUMERIC_MATCH_CREDIT
+#define NUMERIC_MATCH_DEBIT QOF_NUMERIC_MATCH_DEBIT
 
-		#define GUID_MATCH_ANY QOF_GUID_MATCH_ANY
-		#define GUID_MATCH_NONE QOF_GUID_MATCH_NONE
-		#define GUID_MATCH_NULL QOF_GUID_MATCH_NULL
-		#define GUID_MATCH_ALL QOF_GUID_MATCH_ALL
-		#define GUID_MATCH_LIST_ANY QOF_GUID_MATCH_LIST_ANY
+#define GUID_MATCH_ANY QOF_GUID_MATCH_ANY
+#define GUID_MATCH_NONE QOF_GUID_MATCH_NONE
+#define GUID_MATCH_NULL QOF_GUID_MATCH_NULL
+#define GUID_MATCH_ALL QOF_GUID_MATCH_ALL
+#define GUID_MATCH_LIST_ANY QOF_GUID_MATCH_LIST_ANY
 
-		#define CHAR_MATCH_ANY QOF_CHAR_MATCH_ANY
-		#define CHAR_MATCH_NONE QOF_CHAR_MATCH_NONE
+#define CHAR_MATCH_ANY QOF_CHAR_MATCH_ANY
+#define CHAR_MATCH_NONE QOF_CHAR_MATCH_NONE
 
-		#define char_match_t QofCharMatch
-		#define guid_match_t QofGuidMatch
-		#define numeric_match_t QofNumericMatch
-		#define date_match_t QofDateMatch
-		#define string_match_t QofStringMatch
-		#define query_compare_t QofQueryCompare
+#define char_match_t QofCharMatch
+#define guid_match_t QofGuidMatch
+#define numeric_match_t QofNumericMatch
+#define date_match_t QofDateMatch
+#define string_match_t QofStringMatch
+#define query_compare_t QofQueryCompare
 
-		#define gncQueryCoreInit qof_query_core_init
-		#define gncQueryCoreShutdown qof_query_core_shutdown
-		#define gncQueryCoreGetPredicate qof_query_core_get_predicate
-		#define gncQueryCoreGetCompare qof_query_core_get_compare
-		
-		#define gncQueryCorePredicateEqual qof_query_core_predicate_equal
-		
-		#define QUERYCORE_GUID QOF_TYPE_GUID
-		#define QUERYCORE_DEBCRED QOF_TYPE_DEBCRED
-		#define QUERYCORE_BOOLEAN QOF_TYPE_BOOLEAN
-		#define QUERYCORE_NUMERIC QOF_TYPE_NUMERIC
-		#define QUERYCORE_STRING QOF_TYPE_STRING
-		#define QUERYCORE_DATE QOF_TYPE_DATE
-		#define QUERYCORE_INT64 QOF_TYPE_INT64
-		#define QUERYCORE_DOUBLE QOF_TYPE_DOUBLE
+#define gncQueryCoreInit qof_query_core_init
+#define gncQueryCoreShutdown qof_query_core_shutdown
+#define gncQueryCoreGetPredicate qof_query_core_get_predicate
+#define gncQueryCoreGetCompare qof_query_core_get_compare
 
-		#define QueryAccess QofAccessFunc
-		#define gncQueryCoreToString qof_query_core_to_string
+#define gncQueryCorePredicateEqual qof_query_core_predicate_equal
+
+#define QUERYCORE_GUID QOF_TYPE_GUID
+#define QUERYCORE_DEBCRED QOF_TYPE_DEBCRED
+#define QUERYCORE_BOOLEAN QOF_TYPE_BOOLEAN
+#define QUERYCORE_NUMERIC QOF_TYPE_NUMERIC
+#define QUERYCORE_STRING QOF_TYPE_STRING
+#define QUERYCORE_DATE QOF_TYPE_DATE
+#define QUERYCORE_INT64 QOF_TYPE_INT64
+#define QUERYCORE_DOUBLE QOF_TYPE_DOUBLE
+
+#define QueryAccess QofAccessFunc
+#define gncQueryCoreToString qof_query_core_to_string

Modified: gnucash/trunk/src/engine/QueryNew.h
===================================================================
--- gnucash/trunk/src/engine/QueryNew.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/QueryNew.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,48 +1,48 @@
 #include "qof.h"
 
 
-		#define QUERY_AND QOF_QUERY_AND
-		#define QUERY_OR QOF_QUERY_OR
-		#define QUERY_NAND QOF_QUERY_NAND
-		#define QUERY_NOR QOF_QUERY_NOR
-		#define QUERY_XOR QOF_QUERY_XOR
-		#define QUERY_PARAM_BOOK QOF_PARAM_BOOK
-		#define QUERY_PARAM_GUID QOF_PARAM_GUID
-		#define QUERY_PARAM_ACTIVE QOF_PARAM_ACTIVE
+#define QUERY_AND QOF_QUERY_AND
+#define QUERY_OR QOF_QUERY_OR
+#define QUERY_NAND QOF_QUERY_NAND
+#define QUERY_NOR QOF_QUERY_NOR
+#define QUERY_XOR QOF_QUERY_XOR
+#define QUERY_PARAM_BOOK QOF_PARAM_BOOK
+#define QUERY_PARAM_GUID QOF_PARAM_GUID
+#define QUERY_PARAM_ACTIVE QOF_PARAM_ACTIVE
 
-		#define querynew_s _QofQuery
-		#define QueryNew QofQuery
-		#define QueryOp QofQueryOp
-		#define query_new_term _QofQueryTerm
-		#define query_new_sort _QofSortFunc
+#define querynew_s _QofQuery
+#define QueryNew QofQuery
+#define QueryOp QofQueryOp
+#define query_new_term _QofQueryTerm
+#define query_new_sort _QofSortFunc
 
-		#define gncQueryBuildParamList qof_query_build_param_list
-		#define gncQueryCreate qof_query_create
-		#define gncQueryCreateFor qof_query_create_for
-		#define gncQueryDestroy qof_query_destroy
-		#define gncQuerySearchFor qof_query_search_for
-		#define gncQuerySetBook qof_query_set_book
-		#define gncQueryAddTerm qof_query_add_term
-		#define gncQueryAddGUIDMatch qof_query_add_guid_match
-		#define gncQueryAddGUIDListMatch qof_query_add_guid_list_match
-		#define gncQueryAddBooleanMatch qof_query_add_boolean_match
-		#define gncQueryRun qof_query_run
-		#define gncQueryLastRun qof_query_last_run
-		#define gncQueryClear qof_query_clear
-		#define gncQueryPurgeTerms qof_query_purge_terms
-		#define gncQueryHasTerms qof_query_has_terms
-		#define gncQueryNumTerms qof_query_num_terms
-		#define gncQueryHasTermType qof_query_has_term_type
-		#define gncQueryCopy qof_query_copy
-		#define gncQueryInvert qof_query_invert
-		#define gncQueryMerge qof_query_merge
-		#define gncQueryMergeInPlace qof_query_merge_in_place
-		#define gncQuerySetSortOrder qof_query_set_sort_order
-		#define gncQuerySetSortOptions qof_query_set_sort_options
-		#define gncQuerySetSortIncreasing qof_query_set_sort_increasing
-		#define gncQuerySetMaxResults qof_query_set_max_results
-		#define gncQueryEqual qof_query_equal
-		#define gncQueryPrint qof_query_print
-		#define gncQueryGetSearchFor qof_query_get_search_for
-		#define gncQueryGetBooks qof_query_get_books
+#define gncQueryBuildParamList qof_query_build_param_list
+#define gncQueryCreate qof_query_create
+#define gncQueryCreateFor qof_query_create_for
+#define gncQueryDestroy qof_query_destroy
+#define gncQuerySearchFor qof_query_search_for
+#define gncQuerySetBook qof_query_set_book
+#define gncQueryAddTerm qof_query_add_term
+#define gncQueryAddGUIDMatch qof_query_add_guid_match
+#define gncQueryAddGUIDListMatch qof_query_add_guid_list_match
+#define gncQueryAddBooleanMatch qof_query_add_boolean_match
+#define gncQueryRun qof_query_run
+#define gncQueryLastRun qof_query_last_run
+#define gncQueryClear qof_query_clear
+#define gncQueryPurgeTerms qof_query_purge_terms
+#define gncQueryHasTerms qof_query_has_terms
+#define gncQueryNumTerms qof_query_num_terms
+#define gncQueryHasTermType qof_query_has_term_type
+#define gncQueryCopy qof_query_copy
+#define gncQueryInvert qof_query_invert
+#define gncQueryMerge qof_query_merge
+#define gncQueryMergeInPlace qof_query_merge_in_place
+#define gncQuerySetSortOrder qof_query_set_sort_order
+#define gncQuerySetSortOptions qof_query_set_sort_options
+#define gncQuerySetSortIncreasing qof_query_set_sort_increasing
+#define gncQuerySetMaxResults qof_query_set_max_results
+#define gncQueryEqual qof_query_equal
+#define gncQueryPrint qof_query_print
+#define gncQueryGetSearchFor qof_query_get_search_for
+#define gncQueryGetBooks qof_query_get_books
 

Modified: gnucash/trunk/src/engine/QueryObject.h
===================================================================
--- gnucash/trunk/src/engine/QueryObject.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/QueryObject.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,12 +1,12 @@
 
 #include "qof.h"
 
-		#define query_object_def _QofParam
-		#define QueryObjectDef QofParam
-		#define QuerySort QofSortFunc
+#define query_object_def _QofParam
+#define QueryObjectDef QofParam
+#define QuerySort QofSortFunc
 
-		#define gncQueryObjectRegister qof_class_register
-		#define gncQueryObjectParameterType qof_class_get_parameter_type
-		#define gncQueryObjectGetParameterGetter qof_class_get_parameter_getter
-		#define gncQueryObjectGetParameter qof_class_get_parameter
+#define gncQueryObjectRegister qof_class_register
+#define gncQueryObjectParameterType qof_class_get_parameter_type
+#define gncQueryObjectGetParameterGetter qof_class_get_parameter_getter
+#define gncQueryObjectGetParameter qof_class_get_parameter
 

Modified: gnucash/trunk/src/engine/QueryP.h
===================================================================
--- gnucash/trunk/src/engine/QueryP.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/QueryP.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,123 +24,136 @@
 #ifndef GNUCASH_QUERY_P_H
 #define GNUCASH_QUERY_P_H
 
-#include "Query.h" 
+#include "Query.h"
 
 #if 0
 
-typedef struct {
-  pd_type_t       type;
-  pr_type_t       term_type;
-  int             sense;
+typedef struct
+{
+    pd_type_t       type;
+    pr_type_t       term_type;
+    int             sense;
 } BasePredicateData;
 
-typedef struct {
-  pd_type_t       type;
-  pr_type_t       term_type;
-  int             sense;
-  acct_match_t    how;
-  AccountList     *accounts;
-  AccountGUIDList *account_guids;
+typedef struct
+{
+    pd_type_t       type;
+    pr_type_t       term_type;
+    int             sense;
+    acct_match_t    how;
+    AccountList     *accounts;
+    AccountGUIDList *account_guids;
 } AccountPredicateData;
 
-typedef struct {
-  pd_type_t       type;
-  pr_type_t       term_type;
-  int             sense;
-  amt_match_t     how;
-  amt_match_sgn_t amt_sgn;
-  double          amount;
+typedef struct
+{
+    pd_type_t       type;
+    pr_type_t       term_type;
+    int             sense;
+    amt_match_t     how;
+    amt_match_sgn_t amt_sgn;
+    double          amount;
 } AmountPredicateData;
 
-typedef struct {
-  pd_type_t       type;
-  pr_type_t       term_type;
-  int             sense;
-  balance_match_t how;
+typedef struct
+{
+    pd_type_t       type;
+    pr_type_t       term_type;
+    int             sense;
+    balance_match_t how;
 } BalancePredicateData;
 
-typedef struct {
-  pd_type_t       type;
-  pr_type_t       term_type;
-  int             sense;
-  book_match_t    how;
-  BookList        *books;
-  BookGUIDList    *book_guids;
+typedef struct
+{
+    pd_type_t       type;
+    pr_type_t       term_type;
+    int             sense;
+    book_match_t    how;
+    BookList        *books;
+    BookGUIDList    *book_guids;
 } BookPredicateData;
 
-typedef struct {
-  pd_type_t       type;
-  pr_type_t       term_type;
-  int             sense;
-  cleared_match_t how;
+typedef struct
+{
+    pd_type_t       type;
+    pr_type_t       term_type;
+    int             sense;
+    cleared_match_t how;
 } ClearedPredicateData;
 
-typedef struct {
-  pd_type_t       type;
-  pr_type_t       term_type;
-  int             sense;
-  GUID            guid;
-  QofIdType       id_type;
+typedef struct
+{
+    pd_type_t       type;
+    pr_type_t       term_type;
+    int             sense;
+    GUID            guid;
+    QofIdType       id_type;
 } GUIDPredicateData;
 
-typedef struct {
-  pd_type_t       type;
-  pr_type_t       term_type;
-  int             sense;
-  int             use_start;
-  Timespec        start;
-  int             use_end;
-  Timespec        end;
+typedef struct
+{
+    pd_type_t       type;
+    pr_type_t       term_type;
+    int             sense;
+    int             use_start;
+    Timespec        start;
+    int             use_end;
+    Timespec        end;
 } DatePredicateData;
 
-typedef struct {
-  pd_type_t         type;
-  pr_type_t         term_type;
-  int               sense;
-  kvp_match_t       how;
-  kvp_match_where_t where;
-  GSList           *path;
-  KvpValue        *value;
+typedef struct
+{
+    pd_type_t         type;
+    pr_type_t         term_type;
+    int               sense;
+    kvp_match_t       how;
+    kvp_match_where_t where;
+    GSList           *path;
+    KvpValue        *value;
 } KVPPredicateData;
 
-typedef struct {
-  pd_type_t       type;
-  pr_type_t       term_type;
-  int             sense;
-  int             how;
-  int             data;
+typedef struct
+{
+    pd_type_t       type;
+    pr_type_t       term_type;
+    int             sense;
+    int             how;
+    int             data;
 } MiscPredicateData;
 
-typedef struct {
-  pd_type_t       type;
-  pr_type_t       term_type;
-  int             sense;
-  int             case_sens;
-  int             use_regexp;
-  char           *matchstring;
-  regex_t         compiled;
+typedef struct
+{
+    pd_type_t       type;
+    pr_type_t       term_type;
+    int             sense;
+    int             case_sens;
+    int             use_regexp;
+    char           *matchstring;
+    regex_t         compiled;
 } StringPredicateData;
 
-typedef union { 
-  pd_type_t            type;
-  BasePredicateData    base;
-  AccountPredicateData acct;
-  AmountPredicateData  amount;
-  BalancePredicateData balance;
-  BookPredicateData    book;
-  ClearedPredicateData cleared;
-  DatePredicateData    date;
-  GUIDPredicateData    guid;
-  KVPPredicateData     kvp;
-  StringPredicateData  str;
-  MiscPredicateData    misc;
+typedef union
+{
+    pd_type_t            type;
+    BasePredicateData    base;
+    AccountPredicateData acct;
+    AmountPredicateData  amount;
+    BalancePredicateData balance;
+    BookPredicateData    book;
+    ClearedPredicateData cleared;
+    DatePredicateData    date;
+    GUIDPredicateData    guid;
+    KVPPredicateData     kvp;
+    StringPredicateData  str;
+    MiscPredicateData    misc;
 } PredicateData;
 
 typedef int (* Predicate)(Split * to_test, PredicateData * test_data);
 
-typedef struct {
-  PredicateData data;
-  Predicate     p;
+typedef struct
+{
+    PredicateData data;
+    Predicate     p;
 } QueryTerm;
 
 void xaccQueryAddMiscMatch(Query * q, Predicate p, int how, int data,

Modified: gnucash/trunk/src/engine/Recurrence.h
===================================================================
--- gnucash/trunk/src/engine/Recurrence.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/Recurrence.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -44,7 +44,8 @@
 #include "Account.h"
 #include "gnc-numeric.h"
 
-typedef enum {
+typedef enum
+{
     PERIOD_ONCE,         /* Not a true period at all, but convenient here. */
     PERIOD_DAY,
     PERIOD_WEEK,
@@ -57,7 +58,8 @@
     PERIOD_INVALID = -1,
 } PeriodType;
 
-typedef enum {
+typedef enum
+{
     WEEKEND_ADJ_NONE,
     WEEKEND_ADJ_BACK,    /* Previous weekday */
     WEEKEND_ADJ_FORWARD, /* Next weekday */
@@ -67,16 +69,17 @@
 
 /* Recurrences represent both the phase and period of a recurring event. */
 
-typedef struct {
+typedef struct
+{
     GDate start;         /* First date in the recurrence; specifies phase. */
     PeriodType ptype;    /* see PeriodType enum */
     guint16 mult;        /* a period multiplier */
-	WeekendAdjust wadj;  /* see WeekendAdjust enum */
+    WeekendAdjust wadj;  /* see WeekendAdjust enum */
 } Recurrence;
 
 
 /* recurrenceSet() will enforce internal consistency by overriding
-   inconsistent inputs so that 'r' will _always_ end up being a valid 
+   inconsistent inputs so that 'r' will _always_ end up being a valid
    recurrence.
 
      - if the period type is invalid, PERIOD_MONTH is used.
@@ -138,8 +141,8 @@
  * @return the amount that an Account's value changed between the beginning
  * and end of the nth instance of the Recurrence.
  **/
-gnc_numeric recurrenceGetAccountPeriodValue(const Recurrence *r, 
-                                            Account *acct, guint n);
+gnc_numeric recurrenceGetAccountPeriodValue(const Recurrence *r,
+        Account *acct, guint n);
 
 /** @return the earliest of the next occurances -- a "composite" recurrence **/
 void recurrenceListNextInstance(const GList *r, const GDate *refDate,

Modified: gnucash/trunk/src/engine/SX-book.h
===================================================================
--- gnucash/trunk/src/engine/SX-book.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/SX-book.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -31,7 +31,7 @@
  *        See src/doc/books.txt for design overview.
  * @author Copyright (c) 2003 Linas Vepstas <linas at linas.org>
  * @author Copyright (c) 2006 Joshua Sled <jsled at asynchronous.org>
- * 
+ *
  * XXX currently, this is crufty, it should be modified to use
  * entities a bit more whole-heartedly than it does.
  **/
@@ -46,15 +46,16 @@
 #include "SchedXaction.h"
 #include "qof.h"
 
-struct xaccSchedXactionsDef {
-  QofInstance inst;
-  GList* sx_list;
-  gboolean sx_notsaved;
+struct xaccSchedXactionsDef
+{
+    QofInstance inst;
+    GList* sx_list;
+    gboolean sx_notsaved;
 };
 
 struct _SchedXactionsClass
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 };
 
 /* --- type macros --- */
@@ -80,7 +81,8 @@
 void gnc_sxes_del_sx(SchedXactions* sxes, SchedXaction* sx);
 
 /** Returns the template group from the book. **/
-/*@ dependent @*/ Account *gnc_book_get_template_root(const QofBook *book);
+/*@ dependent @*/
+Account *gnc_book_get_template_root(const QofBook *book);
 
 /** @return The list of SXes which reference the given Account. Caller should free this list. **/
 GList* gnc_sx_get_sxes_referencing_account(QofBook *book, Account *acct);

Modified: gnucash/trunk/src/engine/SX-ttinfo.h
===================================================================
--- gnucash/trunk/src/engine/SX-ttinfo.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/SX-ttinfo.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -70,13 +70,13 @@
 void gnc_ttsplitinfo_set_credit_formula(TTSplitInfo *split_i,
                                         const char *credit_formula);
 void gnc_ttsplitinfo_set_credit_formula_numeric(TTSplitInfo *split_i,
-                                                gnc_numeric credit_formula);
+        gnc_numeric credit_formula);
 const char *gnc_ttsplitinfo_get_credit_formula(TTSplitInfo *split_i);
 
 void gnc_ttsplitinfo_set_debit_formula(TTSplitInfo *split_i,
                                        const char *debit_formula);
 void gnc_ttsplitinfo_set_debit_formula_numeric(TTSplitInfo *split_i,
-                                               gnc_numeric debit_formula);
+        gnc_numeric debit_formula);
 const char *gnc_ttsplitinfo_get_debit_formula(TTSplitInfo *split_i);
 
 void gnc_ttsplitinfo_set_account(TTSplitInfo *split_i, Account *acc);

Modified: gnucash/trunk/src/engine/SchedXaction.h
===================================================================
--- gnucash/trunk/src/engine/SchedXaction.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/SchedXaction.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,7 +24,7 @@
    @addtogroup SchedXaction Scheduled/Periodic/Recurring Transactions
 
    Scheduled Transactions provide a framework for remembering
-   information about a transactions that are set to occur in the 
+   information about a transactions that are set to occur in the
    future, either once or periodically.
  @{ */
 /**
@@ -86,48 +86,49 @@
  **/
 struct _SchedXaction
 {
-  QofInstance     inst;
-  gchar           *name;
+    QofInstance     inst;
+    gchar           *name;
 
-  GList           *schedule;
-  
-  GDate           last_date;
-  
-  GDate           start_date;
-  /* if end_date is invalid, then no end. */
-  GDate           end_date;
+    GList           *schedule;
 
-  /* if num_occurances_total == 0, then no limit */
-  gint            num_occurances_total;
-  /* reminaing occurances are as-of the 'last_date'. */
-  gint            num_occurances_remain;
+    GDate           last_date;
 
-  /* the current instance-count of the SX. */
-  gint            instance_num;
-  
-  gboolean        enabled;
-  gboolean        autoCreateOption;
-  gboolean        autoCreateNotify;
-  gint            advanceCreateDays;
-  gint            advanceRemindDays;
- 
-  Account        *template_acct;
-  
-  /** The list of deferred SX instances.  This list is of temporalStateData
-   * instances.  */
-  GList /* <temporalStateData*> */ *deferredList;
+    GDate           start_date;
+    /* if end_date is invalid, then no end. */
+    GDate           end_date;
+
+    /* if num_occurances_total == 0, then no limit */
+    gint            num_occurances_total;
+    /* reminaing occurances are as-of the 'last_date'. */
+    gint            num_occurances_remain;
+
+    /* the current instance-count of the SX. */
+    gint            instance_num;
+
+    gboolean        enabled;
+    gboolean        autoCreateOption;
+    gboolean        autoCreateNotify;
+    gint            advanceCreateDays;
+    gint            advanceRemindDays;
+
+    Account        *template_acct;
+
+    /** The list of deferred SX instances.  This list is of temporalStateData
+     * instances.  */
+    GList /* <temporalStateData*> */ *deferredList;
 };
 
 struct _SchedXactionClass
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 };
 
 /** Just the variable temporal bits from the SX structure. */
-typedef struct _temporalStateData {
-  GDate last_date;
-  gint num_occur_rem;
-  gint num_inst;
+typedef struct _temporalStateData
+{
+    GDate last_date;
+    gint num_occur_rem;
+    gint num_inst;
 } temporalStateData;
 
 #define xaccSchedXactionSetGUID(X,G) qof_instance_set_guid(QOF_INSTANCE(X),(G))
@@ -148,7 +149,8 @@
 void gnc_sx_commit_edit (SchedXaction *sx);
 
 /** @return GList<Recurrence*> **/
-/*@ dependent @*/ GList* gnc_sx_get_schedule(const SchedXaction *sx);
+/*@ dependent @*/
+GList* gnc_sx_get_schedule(const SchedXaction *sx);
 /** @param[in] schedule A GList<Recurrence*> **/
 void gnc_sx_set_schedule(SchedXaction *sx, /*@ null @*//*@ only @*/ GList *schedule);
 
@@ -314,12 +316,12 @@
 #define xaccSchedXactionGetSlots(X) qof_instance_get_slots(QOF_INSTANCE(X))
 
 /** \deprecated to be replaced with 'dirty' kvp's */
-KvpValue *xaccSchedXactionGetSlot( const SchedXaction *sx, 
-				    const char *slot );
+KvpValue *xaccSchedXactionGetSlot( const SchedXaction *sx,
+                                   const char *slot );
 /** \deprecated to be replaced with 'dirty' kvp's */
-void xaccSchedXactionSetSlot( SchedXaction *sx, 
-			      const char *slot,
-			      const KvpValue *value );
+void xaccSchedXactionSetSlot( SchedXaction *sx,
+                              const char *slot,
+                              const KvpValue *value );
 
 
 #endif /* XACC_SCHEDXACTION_H */

Modified: gnucash/trunk/src/engine/Scrub.h
===================================================================
--- gnucash/trunk/src/engine/Scrub.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/Scrub.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -30,19 +30,19 @@
     compatibility with older versions of GnuCash, and to fix
     or at least paper over possible current problems.
 
-    It is typically expected that the scrub routines are run 
+    It is typically expected that the scrub routines are run
     over newly imported data, as well as during data file input.
-    
+
     In some cases, it is entirely appropriate to invoke these
-    routines from the GUI, to validate that the user input 
-    through the GUI is in a format that the system likes.  
+    routines from the GUI, to validate that the user input
+    through the GUI is in a format that the system likes.
     This includes things like balancing individual transactions,
-    or assigning splits to lots, so that capital gains can be 
+    or assigning splits to lots, so that capital gains can be
     computed.
     @{ */
 
 /** @file Scrub.h
- *  @brief convert single-entry accounts to clean double-entry 
+ *  @brief convert single-entry accounts to clean double-entry
  *  @author Created by Linas Vepstas December 1998
  *  @author Copyright (c) 1998-2000, 2003 Linas Vepstas <linas at linas.org>
  */
@@ -53,7 +53,7 @@
 #include "gnc-engine.h"
 
 /** @name Double-Entry Scrubbing
-    Convert single-entry accounts to clean double-entry 
+    Convert single-entry accounts to clean double-entry
 
     Provides a set of functions and utilities for checking and
     repairing (formerly called 'scrubbing clean') single-entry accounts
@@ -64,29 +64,29 @@
 
     The ScrubOrphans() methods search for transacations that contain
     splits that do not have a parent account. These "orphaned splits"
-    are placed into an "orphan account" which the user will have to 
+    are placed into an "orphan account" which the user will have to
     go into and clean up.  Kind of like the unix "Lost+Found" directory
-    for orphaned inodes.  
+    for orphaned inodes.
     @{  */
 
 /** The xaccTransScrubOrphans() method scrubs only the splits in the
- *    given transaction. 
+ *    given transaction.
  */
 void xaccTransScrubOrphans (Transaction *trans);
 
-/** The xaccAccountScrubOrphans() method performs this scrub only for the 
+/** The xaccAccountScrubOrphans() method performs this scrub only for the
  *    indicated account, and not for any of its children.
  */
 void xaccAccountScrubOrphans (Account *acc);
 
-/** The xaccAccountTreeScrubOrphans() method performs this scrub for the 
+/** The xaccAccountTreeScrubOrphans() method performs this scrub for the
  *    indicated account and its children.
  */
 void xaccAccountTreeScrubOrphans (Account *acc);
 
 /** The xaccSplitScrub method ensures that if this split has the same
- *   commodity and currency, then it will have the same amount and value.  
- *   If the commodity is the currency, the split->amount is set to the 
+ *   commodity and currency, then it will have the same amount and value.
+ *   If the commodity is the currency, the split->amount is set to the
  *   split value.  In addition, if this split is an orphan, that is
  *   fixed first.  If the split account doesn't have a commodity declared,
  *   an attempt is made to fix that first.
@@ -94,7 +94,7 @@
 void xaccSplitScrub (Split *split);
 
 /** The xacc*ScrubSplits() calls xaccSplitScrub() on each split
- *    in the respective structure: transaction, account, 
+ *    in the respective structure: transaction, account,
  *    account & it's children, account-group.
  */
 void xaccTransScrubSplits (Transaction *trans);
@@ -118,8 +118,8 @@
 
 /** The xaccTransScrubCurrencyFromSplits method fixes transactions
  * where the currency doesn't match the currency used in the splits
- * in the transaction.  If all splits where the amount equals the 
- * value and where the commodity is a currency have the same 
+ * in the transaction.  If all splits where the amount equals the
+ * value and where the commodity is a currency have the same
  * currency, it sets the transaction's currency to that if it is
  * anything else.  If the splits don't match that description the
  * transaction currency is not changed. */

Modified: gnucash/trunk/src/engine/Scrub2.h
===================================================================
--- gnucash/trunk/src/engine/Scrub2.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/Scrub2.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -35,13 +35,13 @@
 #include "gnc-engine.h"
 
 /** @name Lot Management Routines
- * Provides the low-level API for checking and repairing ('scrubbing 
- * clean') the usage of Lots and lot balances in stock and commodity 
- * accounts.  Broken lots are repaired using a first-in, first-out 
+ * Provides the low-level API for checking and repairing ('scrubbing
+ * clean') the usage of Lots and lot balances in stock and commodity
+ * accounts.  Broken lots are repaired using a first-in, first-out
  * (FIFO) accounting schedule.
- * 
- * This is a 'low-level' API in the sense that each routine accomplishes 
- * only one particular task needed to clean up a Lot.  To clean up a 
+ *
+ * This is a 'low-level' API in the sense that each routine accomplishes
+ * only one particular task needed to clean up a Lot.  To clean up a
  * Lot as a whole, you almost certainly want to use one of the
  * high-level API routines from the Scrub3.h file.
  @{ */
@@ -49,11 +49,11 @@
 /** The xaccAccountAssignLots() routine will walk over all of
  *   the splits in an account, and make sure that each belongs
  *   to a lot.  Currently, the default (and only implemented)
- *   assignment policy is a FIFO policy: Any splits that are 
+ *   assignment policy is a FIFO policy: Any splits that are
  *   not in a lot will be used to close the oldest open lot(s).
- *   If there are no open lots, a new lot will be started.  
+ *   If there are no open lots, a new lot will be started.
  *   By trying to close the oldest lots, this effectively
- *   implements a FIFO acounting policy.  
+ *   implements a FIFO acounting policy.
  */
 void xaccAccountAssignLots (Account *acc);
 
@@ -61,20 +61,20 @@
  *  indicated lot until the lot balance goes to zero, or until
  *  there are no suitable (i.e. unassigned) splits left in the
  *  account.  It uses the default accounting policy to choose
- *  the splits to fill out the lot. 
+ *  the splits to fill out the lot.
  */
 void xaccLotFill (GNCLot *lot);
 
 /** The xaccLotScrubDoubleBalance() routine examines the indicated
  *   lot.  If it is open, it does nothing. If it is closed,
- *   it then verifies that the lot is 'double balanced'.  
- *   By 'double balance', we mean that both the sum of the 
- *   split amounts is zero, and that the sum of the split 
+ *   it then verifies that the lot is 'double balanced'.
+ *   By 'double balance', we mean that both the sum of the
+ *   split amounts is zero, and that the sum of the split
  *   values is zero.  If the lot is closed and the sum of the
- *   values is not zero, the lot is considered to have a 
- *   'realized gain or loss' that hadn't been correctly handled.  
+ *   values is not zero, the lot is considered to have a
+ *   'realized gain or loss' that hadn't been correctly handled.
  *   This routine then creates a balancing transaction to so
- *   as to record the realized gain/loss, adds it to the lot, 
+ *   as to record the realized gain/loss, adds it to the lot,
  *   and adds it to a gain/loss account.  If there is no default
  *   gain/loss account, it creates one.
  */
@@ -88,7 +88,7 @@
  * of each so that they all have the same price.
  *
  * There is a bit of a problem with the interpretation of 'rounding
- * errors' because there are pathological corner cases of small 
+ * errors' because there are pathological corner cases of small
  * amounts.  So this routine is loose, hopefully loose enough so
  * that the user can manually fine tune without having this routine
  * clobber thier work.
@@ -96,7 +96,7 @@
  * This routine ignores price differences smaller than 1/maxmult.
  * This routine ignores price differences when the split with a crazy
  * price involes only a small amount: specifically, an amount that
- * is less than maxamtscu/amount.denom. 
+ * is less than maxamtscu/amount.denom.
  *
  * Reasonable/recommended values might be maxmult=3, maxamtscu = 2.
  */
@@ -107,16 +107,16 @@
  *    split, but are no longer needed to be kept separate.  Splits
  *    might be split up if they need to be divided over multiple
  *    lots; they can be merged back together if the lots change.
- *    In particular, two sub-splits may be merged if they are in 
+ *    In particular, two sub-splits may be merged if they are in
  *    the same lot, or in no lot.  Note that, by definition, all
  *    subsplits belong to the same transaction.
- * 
- *    The routine returns TRUE if a merger was performed, else 
- *    it returns FALSE. 
  *
- *  The xaccScrubMergeTransSubSplits() routine does the same, except 
+ *    The routine returns TRUE if a merger was performed, else
+ *    it returns FALSE.
+ *
+ *  The xaccScrubMergeTransSubSplits() routine does the same, except
  *    that it does it for all of the splits in the transaction.
- *  The xaccScrubMergeLotSubSplits() routine does the same, except 
+ *  The xaccScrubMergeLotSubSplits() routine does the same, except
  *    that it does it for all of the splits in the lot.
  */
 gboolean xaccScrubMergeSubSplits (Split *split);

Modified: gnucash/trunk/src/engine/Scrub3.h
===================================================================
--- gnucash/trunk/src/engine/Scrub3.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/Scrub3.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -35,15 +35,15 @@
 #include "gnc-engine.h"
 
 /** @name High-Level Lot Constraint
- * Provides the high-level API for checking and repairing ('scrubbing 
- * clean') the usage of Lots and Cap Gains transactions in stock and 
- * commodity accounts.  
+ * Provides the high-level API for checking and repairing ('scrubbing
+ * clean') the usage of Lots and Cap Gains transactions in stock and
+ * commodity accounts.
  @{ */
 
 /** The xaccScrubLot() routine makes sure that the indicated lot is
  *    self-consistent and properly balanced, and fixes it if its not.
  *    This is an important routine to call if the amount of any split
- *    in the lot is changed.  That's because (obviously) changing 
+ *    in the lot is changed.  That's because (obviously) changing
  *    split values is gaurenteed to throw off lot balances.
  *    This routine may end up closing the lot, or at least trying
  *    to. It will also cause cap gains to be recomputed.
@@ -58,12 +58,12 @@
  *    in the account is assigned to a lot, and that then, every
  *    lot is self-consistent (by calling xaccScrubLot() on each lot).
  *
- *    This routine is the primary routine for ensuring that the 
- *    lot structure, and the cap-gains for an account are in good 
+ *    This routine is the primary routine for ensuring that the
+ *    lot structure, and the cap-gains for an account are in good
  *    order.
  *
  * Most GUI routines will want to use one of these xacc[*]ScrubLots()
- * routines, instead of the various component routines, since it will 
+ * routines, instead of the various component routines, since it will
  * usually makes sense to work only with these high-level routines.
  */
 void xaccAccountScrubLots (Account *acc);

Modified: gnucash/trunk/src/engine/ScrubP.h
===================================================================
--- gnucash/trunk/src/engine/ScrubP.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/ScrubP.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,7 +22,7 @@
  * This is the *private* header for the scrub routines.
  * No one outside of the engine should ever include this file.
  *
- * Copyright (C) 2003, Linas Vepstas <linas at linas.org> 
+ * Copyright (C) 2003, Linas Vepstas <linas at linas.org>
  */
 
 #ifndef XACC_SCRUB_P_H
@@ -33,9 +33,9 @@
 #include "gnc-engine.h"
 
 /* Utility to make account by name.  Not for public use. */
-Account * xaccScrubUtilityGetOrMakeAccount (Account *root, 
-       gnc_commodity * currency, const char *accname,
-       GNCAccountType acctype, gboolean placeholder);
+Account * xaccScrubUtilityGetOrMakeAccount (Account *root,
+        gnc_commodity * currency, const char *accname,
+        GNCAccountType acctype, gboolean placeholder);
 
 
 #endif /* XACC_SCRUB_P_H */

Modified: gnucash/trunk/src/engine/Split.h
===================================================================
--- gnucash/trunk/src/engine/Split.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/Split.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,12 +20,12 @@
 /** @addtogroup Engine
     @{ */
 /** @addtogroup Transaction Financial Transactions
-    A good overview of transactions, splits and accounts can be 
+    A good overview of transactions, splits and accounts can be
     found in the texinfo documentation, together with an overview of
     how to use this API.
 
     @{ */
-/** @file Split.h 
+/** @file Split.h
     @brief API for Transactions and Splits (journal entries)
     @author Copyright (C) 1997 Robin D. Clark
     @author Copyright (C) 1997-2001 Linas Vepstas <linas at linas.org>
@@ -134,7 +134,7 @@
 void xaccSplitSetLot(Split* split, GNCLot* lot);
 
 
-/** Returns the KvpFrame slots of this split for direct editing. 
+/** Returns the KvpFrame slots of this split for direct editing.
  *
  * Split slots are used to store arbitrary strings, numbers, and
  * structures which aren't members of the transaction struct.  See
@@ -156,7 +156,7 @@
 /** Returns the memo string. */
 const char *  xaccSplitGetMemo (const Split *split);
 
-/** The Action is an arbitrary user-assigned string. 
+/** The Action is an arbitrary user-assigned string.
  * The action field is an arbitrary user-assigned value.
  * It is meant to be a very short (one to ten character) string that
  * signifies the "type" of this split, such as e.g. Buy, Sell, Div,
@@ -186,15 +186,15 @@
 void          xaccSplitSetDateReconciledTS (Split *split, Timespec *ts);
 /** Get the date on which this split was reconciled by having it
  * written into the Timespec that 'ts' is pointing to. */
-void          xaccSplitGetDateReconciledTS (const Split *split, 
-					    Timespec *ts);
+void          xaccSplitGetDateReconciledTS (const Split *split,
+        Timespec *ts);
 /** Returns the date (as Timespec) on which this split was reconciled. */
 Timespec      xaccSplitRetDateReconciledTS (const Split *split);
 
 /** @} */
 
 
-/** @name Split amount getters/setters 
+/** @name Split amount getters/setters
  *
  * 'value' vs. 'amount' of a Split: The 'value' is the amount of the
  * _transaction_ balancing commodity (i.e. currency) involved,
@@ -202,7 +202,7 @@
 @{
 */
 
-/** The xaccSplitSetAmount() method sets the amount in the account's 
+/** The xaccSplitSetAmount() method sets the amount in the account's
  * commodity that the split should have.
  *
  * The following four setter functions set the prices and amounts.
@@ -213,30 +213,30 @@
  * IMPORTANT: The split should be parented by an account before
  * any of these routines are invoked!  This is because the actual
  * setting of amounts/values requires SCU settings from the account.
- * If these are not available, then amounts/values will be set to 
+ * If these are not available, then amounts/values will be set to
  * -1/0, which is an invalid value.  I believe this order dependency
- * is a bug, but I'm too lazy to find, fix & test at the moment ... 
+ * is a bug, but I'm too lazy to find, fix & test at the moment ...
  *
  * @note If you use this on a newly created transaction, make sure
  * that the 'value' is also set so that it doesn't remain zero.
  */
 void         xaccSplitSetAmount (Split *split, gnc_numeric amount);
 
-/** Returns the amount of the split in the account's commodity. 
+/** Returns the amount of the split in the account's commodity.
  *   Note that for cap-gains splits, this is slaved to the transaction
  *   that is causing the gains to occur.
  */
 gnc_numeric   xaccSplitGetAmount (const Split * split);
 
 /** The xaccSplitSetValue() method sets the value of this split in the
- * transaction's commodity. 
+ * transaction's commodity.
  *
  * @note If you use this on a newly created transaction, make sure
  * that the 'amount' is also set so that it doesn't remain zero.
  */
 void         xaccSplitSetValue (Split *split, gnc_numeric value);
 
-/** Returns the value of this split in the transaction's commodity. 
+/** Returns the value of this split in the transaction's commodity.
  *   Note that for cap-gains splits, this is slaved to the transaction
  *   that is causing the gains to occur.
 */
@@ -247,9 +247,9 @@
  * routine that is equivalent to a xaccSplitSetSharePrice() followed
  * by and xaccSplitSetAmount(), except that it incurs the processing
  * overhead of balancing only once, instead of twice. */
-void         xaccSplitSetSharePriceAndAmount (Split *split, 
-					      gnc_numeric price,
-					      gnc_numeric amount);
+void         xaccSplitSetSharePriceAndAmount (Split *split,
+        gnc_numeric price,
+        gnc_numeric amount);
 
 /** Returns the price of the split, that is, the value divided by the
  * amount. If the amount is zero, returns a gnc_numeric of value
@@ -259,7 +259,7 @@
 /** Depending on the base_currency, set either the value or the amount
  * of this split or both: If the base_currency is the transaction's
  * commodity, set the value.  If it is the account's commodity, set the
- * amount. If both, set both. 
+ * amount. If both, set both.
  *
  * @note <b>WATCH OUT:</b> When using this function and the
  * transaction's and account's commodities are different, the amount
@@ -278,24 +278,24 @@
  * return the amount. If it is neither print a warning message and
  * return gnc_numeric_zero().
  */
-gnc_numeric xaccSplitGetBaseValue (const Split *split, 
+gnc_numeric xaccSplitGetBaseValue (const Split *split,
                                    const gnc_commodity * base_currency);
 
-/** Returns the running balance up to and including the indicated split. 
+/** Returns the running balance up to and including the indicated split.
  * The balance is the currency-denominated balance.  For accounts
  * with non-unit share prices, it is correctly adjusted for
  * share prices.
  *
- * Returns the running balance up to & including the indicated split. 
+ * Returns the running balance up to & including the indicated split.
  */
 gnc_numeric xaccSplitGetBalance (const Split *split);
 
 /**
- * The cleared-balance is the currency-denominated balance 
+ * The cleared-balance is the currency-denominated balance
  * of all transactions that have been marked as cleared or reconciled.
  * It is correctly adjusted for price fluctuations.
  *
- * Returns the running balance up to & including the indicated split. 
+ * Returns the running balance up to & including the indicated split.
  */
 gnc_numeric xaccSplitGetClearedBalance (const Split *split);
 
@@ -304,13 +304,13 @@
  * reconciled-balance is the currency-denominated balance of all
  * transactions that have been marked as reconciled.
  *
- * Returns the running balance up to & including the indicated split. 
+ * Returns the running balance up to & including the indicated split.
  */
 gnc_numeric xaccSplitGetReconciledBalance (const Split *split);
 
 /** @} */
 
-/** @name Split utility functions 
+/** @name Split utility functions
 @{
 */
 
@@ -336,7 +336,7 @@
  */
 gboolean xaccSplitEqual(const Split *sa, const Split *sb,
                         gboolean check_guids,
-                	gboolean check_balances,
+                        gboolean check_balances,
                         gboolean check_txn_splits);
 
 /** The xaccSplitLookup() subroutine will return the
@@ -346,9 +346,9 @@
 #define      xaccSplitLookupDirect(g,b) xaccSplitLookup(&(g),b)
 
 
-/** 
+/**
  * The xaccSplitGetOtherSplit() is a convenience routine that returns
- *    the other of a pair of splits.  If there are more than two 
+ *    the other of a pair of splits.  If there are more than two
  *    splits, it returns NULL.
  */
 Split * xaccSplitGetOtherSplit (const Split *split);
@@ -372,8 +372,8 @@
  *    if sa and sb have different transactions, return their xaccTransOrder
  *    return a negative value if split sa has a smaller currency-value than sb,
  *    return a positive value if split sa has a larger currency-value than sb,
- *    return a negative value if split sa has a smaller share-price than sb,  
- *    return a positive value if split sa has a larger share-price than sb,  
+ *    return a negative value if split sa has a smaller share-price than sb,
+ *    return a positive value if split sa has a larger share-price than sb,
  *    then compares memo and action using the strcmp()
  *    c-library routine, returning  what strcmp would return.
  *    Then it compares the reconciled flags, then the reconciled dates,
@@ -384,9 +384,9 @@
 
 
 /*
- * These functions compare two splits by different criteria.   
+ * These functions compare two splits by different criteria.
  *
- * These functions were added because converting strings to guile 
+ * These functions were added because converting strings to guile
  * for comparisons in the transaction report is terribly inefficient.
  * More may be added here in future if it turns out that other types
  * of comparisons also induces guile slowdowns.
@@ -411,11 +411,11 @@
 /**
  * These functions take a split, get the corresponding split on the
  * "other side" of the transaction, and extract either the name or code
- * of that split, reverting to returning a constant "Split" if the 
+ * of that split, reverting to returning a constant "Split" if the
  * transaction has more than one split on the "other side".  These
  * were added for the transaction report, and is in C because the code
- * was already written in C for the above functions and duplication 
- * is silly. 
+ * was already written in C for the above functions and duplication
+ * is silly.
  */
 
 char * xaccSplitGetCorrAccountFullName(const Split *sa);
@@ -432,7 +432,7 @@
 
 
 
-/** @name Split deprecated functions 
+/** @name Split deprecated functions
 @{
 */
 

Modified: gnucash/trunk/src/engine/SplitP.h
===================================================================
--- gnucash/trunk/src/engine/SplitP.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/SplitP.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -28,7 +28,7 @@
  * SplitP.h
  *
  * FUNCTION:
- * The is the *private* split header file.  Code outside of 
+ * The is the *private* split header file.  Code outside of
  * engine should *not* include this file.  This is because code
  * outside of the engine should *never* access any of the structure
  * members directly.
@@ -70,66 +70,66 @@
 
 struct split_s
 {
-  QofInstance inst;
+    QofInstance inst;
 
-  Account *acc;              /* back-pointer to debited/credited account  */
-  Account *orig_acc;
-  GNCLot *lot;               /* back-pointer to debited/credited lot */
+    Account *acc;              /* back-pointer to debited/credited account  */
+    Account *orig_acc;
+    GNCLot *lot;               /* back-pointer to debited/credited lot */
 
-  Transaction *parent;       /* parent of split                           */
-  Transaction *orig_parent;
+    Transaction *parent;       /* parent of split                           */
+    Transaction *orig_parent;
 
-  /* The memo field is an arbitrary user-assiged value. 
-   * It is intended to hold a short (zero to forty character) string 
-   * that is displayed by the GUI along with this split. 
-   */
-  char  * memo;
+    /* The memo field is an arbitrary user-assiged value.
+     * It is intended to hold a short (zero to forty character) string
+     * that is displayed by the GUI along with this split.
+     */
+    char  * memo;
 
-  /* The action field is an arbitrary user-assigned value.
-   * It is meant to be a very short (one to ten character) string that
-   * signifies the "type" of this split, such as e.g. Buy, Sell, Div,
-   * Withdraw, Deposit, ATM, Check, etc. The idea is that this field
-   * can be used to create custom reports or graphs of data.
-   */ 
-  char  * action;            /* Buy, Sell, Div, etc.                      */
+    /* The action field is an arbitrary user-assigned value.
+     * It is meant to be a very short (one to ten character) string that
+     * signifies the "type" of this split, such as e.g. Buy, Sell, Div,
+     * Withdraw, Deposit, ATM, Check, etc. The idea is that this field
+     * can be used to create custom reports or graphs of data.
+     */
+    char  * action;            /* Buy, Sell, Div, etc.                      */
 
-  Timespec date_reconciled;  /* date split was reconciled                 */
-  char    reconciled;        /* The reconciled field                      */
+    Timespec date_reconciled;  /* date split was reconciled                 */
+    char    reconciled;        /* The reconciled field                      */
 
-  /* gains is a flag used to track the relationship between 
-   * capital-gains splits. Depending on its value, this flag indicates
-   * if this split is the source of gains, if this split is a record
-   * of the gains, and if values are 'dirty' and need to be recomputed.
-   */
-  unsigned char  gains;      
+    /* gains is a flag used to track the relationship between
+     * capital-gains splits. Depending on its value, this flag indicates
+     * if this split is the source of gains, if this split is a record
+     * of the gains, and if values are 'dirty' and need to be recomputed.
+     */
+    unsigned char  gains;
 
-  /* 'gains_split' is a convenience pointer used to track down the
-   * other end of a cap-gains transaction pair.  NULL if this split
-   * doesn't involve cap gains.
-   */
-  Split *gains_split;
+    /* 'gains_split' is a convenience pointer used to track down the
+     * other end of a cap-gains transaction pair.  NULL if this split
+     * doesn't involve cap gains.
+     */
+    Split *gains_split;
 
-  /* 'value' is the quantity of the transaction balancing commodity
-   * (i.e. currency) involved, 'amount' is the amount of the account's
-   * commodity involved. */
-  gnc_numeric  value;
-  gnc_numeric  amount;
+    /* 'value' is the quantity of the transaction balancing commodity
+     * (i.e. currency) involved, 'amount' is the amount of the account's
+     * commodity involved. */
+    gnc_numeric  value;
+    gnc_numeric  amount;
 
-  /* -------------------------------------------------------------- */
-  /* Below follow some 'temporary' fields */
+    /* -------------------------------------------------------------- */
+    /* Below follow some 'temporary' fields */
 
-  /* The various "balances" are the sum of all of the values of 
-   * all the splits in the account, up to and including this split.
-   * These balances apply to a sorting order by date posted
-   * (not by date entered). */
-  gnc_numeric  balance;
-  gnc_numeric  cleared_balance;
-  gnc_numeric  reconciled_balance;
+    /* The various "balances" are the sum of all of the values of
+     * all the splits in the account, up to and including this split.
+     * These balances apply to a sorting order by date posted
+     * (not by date entered). */
+    gnc_numeric  balance;
+    gnc_numeric  cleared_balance;
+    gnc_numeric  reconciled_balance;
 };
 
 struct _SplitClass
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 };
 
 
@@ -140,8 +140,8 @@
 
 /* The xaccFreeSplit() method simply frees all memory associated
  * with the split.  It does not verify that the split isn't
- * referenced in some account.  If the split is referenced by an 
- * account, then calling this method will leave the system in an 
+ * referenced in some account.  If the split is referenced by an
+ * account, then calling this method will leave the system in an
  * inconsistent state.  This *will* lead to crashes and hangs.
  */
 void  xaccFreeSplit (Split *split);    /* frees memory */
@@ -164,35 +164,35 @@
 /* Code to register Split type with the engine */
 gboolean xaccSplitRegister (void);
 
-/* The xaccSplitDetermineGainStatus() routine will analyze the 
- *   the split, and try to set the internal status flags 
+/* The xaccSplitDetermineGainStatus() routine will analyze the
+ *   the split, and try to set the internal status flags
  *   appropriately for the split.  These flags indicate if the split
- *   represents cap gains, and if the gains value/amount needs to be 
+ *   represents cap gains, and if the gains value/amount needs to be
  *   recomputed.
  */
 void xaccSplitDetermineGainStatus (Split *split);
 
 /* ---------------------------------------------------------------- */
 /* Deprecated routines */
-void         DxaccSplitSetSharePriceAndAmount (Split *split, 
-                                               double price,
-                                               double amount);
+void         DxaccSplitSetSharePriceAndAmount (Split *split,
+        double price,
+        double amount);
 void         DxaccSplitSetShareAmount (Split *split, double amount);
 
 /********************************************************************\
  * sorting comparison function
  *
- * returns a negative value if transaction a is dated earlier than b, 
- * returns a positive value if transaction a is dated later than b, 
+ * returns a negative value if transaction a is dated earlier than b,
+ * returns a positive value if transaction a is dated later than b,
  *
  * This function tries very hard to uniquely order all transactions.
  * If two transactions occur on the same date, then their "num" fields
  * are compared.  If the num fields are identical, then the description
- * fields are compared.  If these are identical, then the memo fields 
+ * fields are compared.  If these are identical, then the memo fields
  * are compared.  Hopefully, there will not be any transactions that
  * occur on the same day that have all three of these values identical.
  *
- * Note that being able to establish this kind of absolute order is 
+ * Note that being able to establish this kind of absolute order is
  * important for some of the ledger display functions.
  *
  * Yes, this kind of code dependency is ugly, but the alternatives seem

Modified: gnucash/trunk/src/engine/TransLog.c
===================================================================
--- gnucash/trunk/src/engine/TransLog.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/TransLog.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -34,7 +34,7 @@
 #include "TransLog.h"
 #include "qof.h"
 
-/* 
+/*
  * Some design philosphy that I think would be good to keep in mind:
  * (0) Simplicity and foolproofness are the over-riding design points.
  *     This is supposed to be a fail-safe safety net.   We don't want
@@ -47,31 +47,31 @@
  * (2.a) Keep the format, simple, flat, more or less unstructured,
  *       record oriented.  This will help parsing by perl scripts.
  *       No, using a perl script to analyze a file that's supposed to
- *       be human readable is not a contradication in terms -- that's 
+ *       be human readable is not a contradication in terms -- that's
  *       exactly the point.
- * (2.b) Use tabs as a human friendly field separator; its also a 
- *       character that does not (should not) appear naturally anywhere 
- *       in the data, as it serves no formatting purpose in the current 
- *       GUI design.  (hack alert -- this is not currently tested for 
- *       or enforced, so this is a very unsafe assumption. Maybe 
+ * (2.b) Use tabs as a human friendly field separator; its also a
+ *       character that does not (should not) appear naturally anywhere
+ *       in the data, as it serves no formatting purpose in the current
+ *       GUI design.  (hack alert -- this is not currently tested for
+ *       or enforced, so this is a very unsafe assumption. Maybe
  *       urlencoding should be used.)
- * (2.c) Don't print redundant information in a single record. This 
+ * (2.c) Don't print redundant information in a single record. This
  *       would just confuse any potential user of this file.
  * (2.d) Saving space, being compact is not a priority, I don't think.
- *       
+ *
  * (3) There are no compatibility requirements from release to release.
  *     Sounds OK to me to change the format of the output when needed.
  *
  * (-) print transaction start and end delimiters
- * (-) print a unique transaction id as a handy label for anyone 
- *     who actually examines these logs.  
- *     The C address pointer to the transaction struct should be fine, 
+ * (-) print a unique transaction id as a handy label for anyone
+ *     who actually examines these logs.
+ *     The C address pointer to the transaction struct should be fine,
  *     as it is simple and unique until the transaction is deleted ...
  *     and we log deletions, so that's OK.  Just note that the id
  *     for a deleted transaction might be recycled.
  * (-) print the current timestamp, so that if it is known that a bug
  *     occurred at a certain time, it can be located.
- * (-) hack alert -- something better than just the account name 
+ * (-) hack alert -- something better than just the account name
  *     is needed for identifying the account.
  */
 /* ------------------------------------------------------------------ */
@@ -85,34 +85,42 @@
 /********************************************************************\
 \********************************************************************/
 
-void xaccLogDisable (void) { gen_logs = 0; }
-void xaccLogEnable  (void) { gen_logs = 1; }
+void xaccLogDisable (void)
+{
+    gen_logs = 0;
+}
+void xaccLogEnable  (void)
+{
+    gen_logs = 1;
+}
 
 /********************************************************************\
 \********************************************************************/
 
-void 
+void
 xaccReopenLog (void)
 {
-   if (trans_log) {
-      xaccCloseLog();
-      xaccOpenLog();
-   }
+    if (trans_log)
+    {
+        xaccCloseLog();
+        xaccOpenLog();
+    }
 }
 
 
-void 
+void
 xaccLogSetBaseName (const char *basepath)
 {
-   if (!basepath) return;
+    if (!basepath) return;
 
-   g_free (log_base_name);
-   log_base_name = g_strdup (basepath);
+    g_free (log_base_name);
+    log_base_name = g_strdup (basepath);
 
-   if (trans_log) {
-      xaccCloseLog();
-      xaccOpenLog();
-   }
+    if (trans_log)
+    {
+        xaccCloseLog();
+        xaccOpenLog();
+    }
 }
 
 
@@ -125,16 +133,16 @@
 gboolean
 xaccFileIsCurrentLog (const gchar *name)
 {
-  gchar *base;
-  gint result;
+    gchar *base;
+    gint result;
 
-  if (!name || !trans_log_name)
-    return FALSE;
+    if (!name || !trans_log_name)
+        return FALSE;
 
-  base = g_path_get_basename(name);
-  result = (strcmp(base, trans_log_name) == 0);
-  g_free(base);
-  return result;
+    base = g_path_get_basename(name);
+    result = (strcmp(base, trans_log_name) == 0);
+    g_free(base);
+    return result;
 }
 
 /********************************************************************\
@@ -143,45 +151,46 @@
 void
 xaccOpenLog (void)
 {
-   char * filename;
-   char * timestamp;
+    char * filename;
+    char * timestamp;
 
-   if (!gen_logs) return;
-   if (trans_log) return;
+    if (!gen_logs) return;
+    if (trans_log) return;
 
-   if (!log_base_name) log_base_name = g_strdup ("translog");
+    if (!log_base_name) log_base_name = g_strdup ("translog");
 
-   /* tag each filename with a timestamp */
-   timestamp = xaccDateUtilGetStampNow ();
+    /* tag each filename with a timestamp */
+    timestamp = xaccDateUtilGetStampNow ();
 
-   filename = g_strconcat (log_base_name, ".", timestamp, ".log", NULL);
+    filename = g_strconcat (log_base_name, ".", timestamp, ".log", NULL);
 
-   trans_log = g_fopen (filename, "a");
-   if (!trans_log) {
-      int norr = errno;
-      printf ("Error: xaccOpenLog(): cannot open journal \n"
-              "\t %d %s\n", norr, strerror (norr));
+    trans_log = g_fopen (filename, "a");
+    if (!trans_log)
+    {
+        int norr = errno;
+        printf ("Error: xaccOpenLog(): cannot open journal \n"
+                "\t %d %s\n", norr, strerror (norr));
 
-      g_free (filename);
-      g_free (timestamp);
-      return;
-   }
+        g_free (filename);
+        g_free (timestamp);
+        return;
+    }
 
-   /* Save the log file name */
-   if (trans_log_name)
-     g_free (trans_log_name);
-   trans_log_name = g_path_get_basename(filename);
+    /* Save the log file name */
+    if (trans_log_name)
+        g_free (trans_log_name);
+    trans_log_name = g_path_get_basename(filename);
 
-   g_free (filename);
-   g_free (timestamp);
+    g_free (filename);
+    g_free (timestamp);
 
-   /*  Note: this must match src/import-export/log-replay/gnc-log-replay.c */
-   fprintf (trans_log, "mod\ttrans_guid\tsplit_guid\ttime_now\t"
-                       "date_entered\tdate_posted\t"
-                       "acc_guid\tacc_name\tnum\tdescription\t"
-                       "notes\tmemo\taction\treconciled\t"
-                       "amount\tvalue\tdate_reconciled\n");
-   fprintf (trans_log, "-----------------\n");
+    /*  Note: this must match src/import-export/log-replay/gnc-log-replay.c */
+    fprintf (trans_log, "mod\ttrans_guid\tsplit_guid\ttime_now\t"
+             "date_entered\tdate_posted\t"
+             "acc_guid\tacc_name\tnum\tdescription\t"
+             "notes\tmemo\taction\treconciled\t"
+             "amount\tvalue\tdate_reconciled\n");
+    fprintf (trans_log, "-----------------\n");
 }
 
 /********************************************************************\
@@ -190,10 +199,10 @@
 void
 xaccCloseLog (void)
 {
-   if (!trans_log) return;
-   fflush (trans_log);
-   fclose (trans_log);
-   trans_log = NULL;
+    if (!trans_log) return;
+    fflush (trans_log);
+    fclose (trans_log);
+    trans_log = NULL;
 }
 
 /********************************************************************\
@@ -202,85 +211,85 @@
 void
 xaccTransWriteLog (Transaction *trans, char flag)
 {
-   GList *node;
-   char trans_guid_str[GUID_ENCODING_LENGTH+1];
-   char split_guid_str[GUID_ENCODING_LENGTH+1];
-   const char *trans_notes; 
-   char dnow[100], dent[100], dpost[100], drecn[100]; 
-   Timespec ts;
+    GList *node;
+    char trans_guid_str[GUID_ENCODING_LENGTH+1];
+    char split_guid_str[GUID_ENCODING_LENGTH+1];
+    const char *trans_notes;
+    char dnow[100], dent[100], dpost[100], drecn[100];
+    Timespec ts;
 
-   if (!gen_logs) return;
-   if (!trans_log) return;
+    if (!gen_logs) return;
+    if (!trans_log) return;
 
-   timespecFromTime_t(&ts,time(NULL));
-   gnc_timespec_to_iso8601_buff (ts, dnow);
+    timespecFromTime_t(&ts, time(NULL));
+    gnc_timespec_to_iso8601_buff (ts, dnow);
 
-   timespecFromTime_t(&ts,trans->date_entered.tv_sec);
-   gnc_timespec_to_iso8601_buff (ts, dent);
+    timespecFromTime_t(&ts, trans->date_entered.tv_sec);
+    gnc_timespec_to_iso8601_buff (ts, dent);
 
-   timespecFromTime_t(&ts,trans->date_posted.tv_sec);
-   gnc_timespec_to_iso8601_buff (ts, dpost);
+    timespecFromTime_t(&ts, trans->date_posted.tv_sec);
+    gnc_timespec_to_iso8601_buff (ts, dpost);
 
-   guid_to_string_buff (xaccTransGetGUID(trans), trans_guid_str);
-   trans_notes = xaccTransGetNotes(trans);
-   fprintf (trans_log, "===== START\n");
+    guid_to_string_buff (xaccTransGetGUID(trans), trans_guid_str);
+    trans_notes = xaccTransGetNotes(trans);
+    fprintf (trans_log, "===== START\n");
 
-   for (node = trans->splits; node; node = node->next) 
-   {
-      Split *split = node->data;
-      const char * accname = "";
-      char acc_guid_str[GUID_ENCODING_LENGTH+1];
-      gnc_numeric amt,val;
+    for (node = trans->splits; node; node = node->next)
+    {
+        Split *split = node->data;
+        const char * accname = "";
+        char acc_guid_str[GUID_ENCODING_LENGTH+1];
+        gnc_numeric amt, val;
 
-      if (xaccSplitGetAccount(split))
-      {
-        accname = xaccAccountGetName (xaccSplitGetAccount(split));
-        guid_to_string_buff(xaccAccountGetGUID(xaccSplitGetAccount(split)),
-                            acc_guid_str);
-      } 
-      else 
-      {
-        acc_guid_str[0] = '\0';
-      }
-      
-      timespecFromTime_t(&ts,split->date_reconciled.tv_sec);
-      gnc_timespec_to_iso8601_buff (ts, drecn);
+        if (xaccSplitGetAccount(split))
+        {
+            accname = xaccAccountGetName (xaccSplitGetAccount(split));
+            guid_to_string_buff(xaccAccountGetGUID(xaccSplitGetAccount(split)),
+                                acc_guid_str);
+        }
+        else
+        {
+            acc_guid_str[0] = '\0';
+        }
 
-      guid_to_string_buff (xaccSplitGetGUID(split), split_guid_str);
-      amt = xaccSplitGetAmount (split);
-      val = xaccSplitGetValue (split);
+        timespecFromTime_t(&ts, split->date_reconciled.tv_sec);
+        gnc_timespec_to_iso8601_buff (ts, drecn);
 
-      /* use tab-separated fields */
-      fprintf (trans_log,
-               "%c\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t"
-               "%s\t%s\t%s\t%s\t%c\t%" G_GINT64_FORMAT "/%" G_GINT64_FORMAT "\t%" G_GINT64_FORMAT "/%" G_GINT64_FORMAT "\t%s\n",
-               flag,
-               trans_guid_str, split_guid_str,  /* trans+split make up unique id */
-	       /* Note that the next three strings always exist,
-		* so we don't need to test them. */
-               dnow,
-               dent,
-               dpost,
-               acc_guid_str,
-               accname ? accname : "",
-               trans->num ? trans->num : "", 
-               trans->description ? trans->description : "",
-               trans_notes ? trans_notes : "",
-               split->memo ? split->memo : "",
-               split->action ? split->action : "",
-               split->reconciled,
-               gnc_numeric_num(amt), 
-               gnc_numeric_denom(amt),
-               gnc_numeric_num(val), 
-               gnc_numeric_denom(val),
-	       /* The next string always exists. No need to test it. */
-               drecn);
-   }
+        guid_to_string_buff (xaccSplitGetGUID(split), split_guid_str);
+        amt = xaccSplitGetAmount (split);
+        val = xaccSplitGetValue (split);
 
-   fprintf (trans_log, "===== END\n");
+        /* use tab-separated fields */
+        fprintf (trans_log,
+                 "%c\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t"
+                 "%s\t%s\t%s\t%s\t%c\t%" G_GINT64_FORMAT "/%" G_GINT64_FORMAT "\t%" G_GINT64_FORMAT "/%" G_GINT64_FORMAT "\t%s\n",
+                 flag,
+                 trans_guid_str, split_guid_str,  /* trans+split make up unique id */
+                 /* Note that the next three strings always exist,
+                 		* so we don't need to test them. */
+                 dnow,
+                 dent,
+                 dpost,
+                 acc_guid_str,
+                 accname ? accname : "",
+                 trans->num ? trans->num : "",
+                 trans->description ? trans->description : "",
+                 trans_notes ? trans_notes : "",
+                 split->memo ? split->memo : "",
+                 split->action ? split->action : "",
+                 split->reconciled,
+                 gnc_numeric_num(amt),
+                 gnc_numeric_denom(amt),
+                 gnc_numeric_num(val),
+                 gnc_numeric_denom(val),
+                 /* The next string always exists. No need to test it. */
+                 drecn);
+    }
 
-   /* get data out to the disk */
-   fflush (trans_log);
+    fprintf (trans_log, "===== END\n");
+
+    /* get data out to the disk */
+    fflush (trans_log);
 }
 
 /********************************************************************\
@@ -294,109 +303,122 @@
  */
 
 char *
-xaccSplitAsString(Split *split, const char prefix[]) 
+xaccSplitAsString(Split *split, const char prefix[])
 {
-  char *result = NULL;
-  size_t result_size;
-  FILE *stream = open_memstream(&result, &result_size); 
-  const char *split_memo = xaccSplitGetMemo(split);
-  const double split_value = gnc_numeric_to_double(xaccSplitGetValue(split));
-  Account *split_dest = xaccSplitGetAccount(split);
-  const char *dest_name =
-    split_dest ? xaccAccountGetName(split_dest) : NULL;
+    char *result = NULL;
+    size_t result_size;
+    FILE *stream = open_memstream(&result, &result_size);
+    const char *split_memo = xaccSplitGetMemo(split);
+    const double split_value = gnc_numeric_to_double(xaccSplitGetValue(split));
+    Account *split_dest = xaccSplitGetAccount(split);
+    const char *dest_name =
+        split_dest ? xaccAccountGetName(split_dest) : NULL;
 
-  g_return_val_if_fail (stream, NULL);
+    g_return_val_if_fail (stream, NULL);
 
-  fputc('\n', stream);
-  fputs(prefix, stream);
-  fprintf(stream, "  %10.2f | %15s | %s",
-          split_value,
-          dest_name ? dest_name : "<no-account-name>",
-          split_memo ? split_memo : "<no-split-memo>");
-  fclose(stream); 
-  return(result);
+    fputc('\n', stream);
+    fputs(prefix, stream);
+    fprintf(stream, "  %10.2f | %15s | %s",
+            split_value,
+            dest_name ? dest_name : "<no-account-name>",
+            split_memo ? split_memo : "<no-split-memo>");
+    fclose(stream);
+    return(result);
 }
 
 static char *
 xaccTransGetDateStr (Transaction *trans)
 {
-   char buf [MAX_DATE_LENGTH];
-   struct tm *date;
-   time_t secs;
+    char buf [MAX_DATE_LENGTH];
+    struct tm *date;
+    time_t secs;
 
-   secs = xaccTransGetDate (trans);
+    secs = xaccTransGetDate (trans);
 
-   date = localtime (&secs);
+    date = localtime (&secs);
 
-   qof_print_date_buff(buf, date->tm_mday, date->tm_mon+1, date->tm_year +1900);
+    qof_print_date_buff(buf, date->tm_mday, date->tm_mon + 1, date->tm_year + 1900);
 
-   return g_strdup (buf);
+    return g_strdup (buf);
 }
 
 char *
-xaccTransAsString(Transaction *txn, const char prefix[]) 
+xaccTransAsString(Transaction *txn, const char prefix[])
 {
-  char *result = NULL;
-  size_t result_size;
-  FILE *stream = open_memstream(&result, &result_size); 
-  time_t date = xaccTransGetDate(txn);
-  const char *num = xaccTransGetNum(txn);
-  const char *desc = xaccTransGetDescription(txn);
-  const char *memo = xaccSplitGetMemo(xaccTransGetSplit(txn, 0));
-  const double total = gnc_numeric_to_double(xaccSplitGetValue(xaccTransGetSplit(txn, 0)));
-  
-  g_return_val_if_fail (stream, NULL);
+    char *result = NULL;
+    size_t result_size;
+    FILE *stream = open_memstream(&result, &result_size);
+    time_t date = xaccTransGetDate(txn);
+    const char *num = xaccTransGetNum(txn);
+    const char *desc = xaccTransGetDescription(txn);
+    const char *memo = xaccSplitGetMemo(xaccTransGetSplit(txn, 0));
+    const double total = gnc_numeric_to_double(xaccSplitGetValue(xaccTransGetSplit(txn, 0)));
 
-  fputs(prefix, stream);
-  if(date) {
-    char *datestr = xaccTransGetDateStr(txn);
-    fprintf(stream, "%s", datestr);
-    free(datestr);
-  } else {
-    fprintf(stream, "<no-date>");
-  }
-  fputc(' ', stream); 
-  if(num) {
-    fputs(num, stream);
-  } else {
-    fprintf(stream, "<no-num>");
-  }
+    g_return_val_if_fail (stream, NULL);
 
-  fputc('\n', stream);
-  fputs(prefix, stream);
-  if(desc) {
-    fputs("  ", stream);
-    fputs(desc, stream);
-  } else {
-    fprintf(stream, "<no-description>");
-  }
-  
-  fputc('\n', stream);
-  fputs(prefix, stream);
-  if(memo) {
-    fputs("  ", stream);
-    fputs(memo, stream);
-  } else {
-    fprintf(stream, "<no-transaction-memo>");
-  }
-  
-  {
-    int split_count = xaccTransCountSplits(txn);
-    int i;
-    for(i = 1; i < split_count; i++) {
-      Split *split = xaccTransGetSplit(txn, i);
-      char *split_text = xaccSplitAsString(split, prefix);
-      fputs(split_text, stream);
-      free(split_text);
+    fputs(prefix, stream);
+    if (date)
+    {
+        char *datestr = xaccTransGetDateStr(txn);
+        fprintf(stream, "%s", datestr);
+        free(datestr);
     }
-  }
-  fputc('\n', stream);
+    else
+    {
+        fprintf(stream, "<no-date>");
+    }
+    fputc(' ', stream);
+    if (num)
+    {
+        fputs(num, stream);
+    }
+    else
+    {
+        fprintf(stream, "<no-num>");
+    }
 
-  fputs(prefix, stream);
-  fprintf(stream, "  %10.2f -- Transaction total\n", total);
-  fclose(stream); 
+    fputc('\n', stream);
+    fputs(prefix, stream);
+    if (desc)
+    {
+        fputs("  ", stream);
+        fputs(desc, stream);
+    }
+    else
+    {
+        fprintf(stream, "<no-description>");
+    }
 
-  return(result);
+    fputc('\n', stream);
+    fputs(prefix, stream);
+    if (memo)
+    {
+        fputs("  ", stream);
+        fputs(memo, stream);
+    }
+    else
+    {
+        fprintf(stream, "<no-transaction-memo>");
+    }
+
+    {
+        int split_count = xaccTransCountSplits(txn);
+        int i;
+        for (i = 1; i < split_count; i++)
+        {
+            Split *split = xaccTransGetSplit(txn, i);
+            char *split_text = xaccSplitAsString(split, prefix);
+            fputs(split_text, stream);
+            free(split_text);
+        }
+    }
+    fputc('\n', stream);
+
+    fputs(prefix, stream);
+    fprintf(stream, "  %10.2f -- Transaction total\n", total);
+    fclose(stream);
+
+    return(result);
 }
 
 #endif

Modified: gnucash/trunk/src/engine/TransLog.h
===================================================================
--- gnucash/trunk/src/engine/TransLog.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/TransLog.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -21,7 +21,7 @@
 /** @addtogroup Engine
     @{ */
 /** @addtogroup TransLog  Transaction Logging
-    The transaction logging mechanism provides a very simple, 
+    The transaction logging mechanism provides a very simple,
     low-level logging of user input to a file.   The goal of
     the transaction logger is to provide mechanism of last resort
     for recovering lost user data in the event of a crash.
@@ -33,7 +33,7 @@
     that can be used to recover user input.
     There are some simple command-line tools that will read a log
     and replay it.
-    
+
     @{ */
 /** @file TransLog.h
     @brief API for the transaction logger

Modified: gnucash/trunk/src/engine/Transaction.h
===================================================================
--- gnucash/trunk/src/engine/Transaction.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/Transaction.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,7 +20,7 @@
 /** @addtogroup Engine
     @{ */
 /** @addtogroup Transaction Financial Transactions
-    A good overview of transactions, splits and accounts can be 
+    A good overview of transactions, splits and accounts can be
     found in the texinfo documentation, together with an overview of
     how to use this API.
 
@@ -31,27 +31,27 @@
 the parent Transaction, a pointer to the debited Account, a reconciled
 flag and timestamp, an "Action" field, and a key-value frame which can
 store arbitrary data.
-                                                                              
-Transactions embody the notion of "double entry" accounting. 
-A Transaction consists of a date, a description, an ID number, 
+
+Transactions embody the notion of "double entry" accounting.
+A Transaction consists of a date, a description, an ID number,
 a list of one or more Splits, and a key-value frame.  The transaction
 also specifies the currency with which all of the splits will be valued.
-When double-entry rules are enforced, the sum total value of the splits 
-are zero.  If there are only two splits, then the value of one must be 
-positive, the other negative: this denotes that one account is debited, 
+When double-entry rules are enforced, the sum total value of the splits
+are zero.  If there are only two splits, then the value of one must be
+positive, the other negative: this denotes that one account is debited,
 and another is credited by an equal amount.  By forcing the value of the
 splits to always 'add up' to zero, we can guarantee that the balances
 of the accounts are always correctly balanced.
 
 The engine does not enforce double-entry accounting, but provides an API
 to enable user-code to find unbalanced transactions and 'repair' them so
-that they are in balance. 
+that they are in balance.
 
 Note the sum of the values of Splits in a Transaction is always computed
 with respect to a currency; thus splits can be balanced even when they
 are in different currencies, as long as they share a common currency.
 This feature allows currency-trading accounts to be established.
-                                                                              
+
 Every Split must point to its parent Transaction, and that Transaction
 must in turn include that Split in the Transaction's list of Splits. A
 Split can belong to at most one Transaction. These relationships are
@@ -67,9 +67,9 @@
 list of Splits, the Account structure also gives the Account a name, a
 code number, description and notes fields, a key-value frame, a pointer
 to the commodity that is used for all splits in this account. The
-commodity can be the name of anything traded and tradable: a stock 
+commodity can be the name of anything traded and tradable: a stock
 (e.g. "IBM", "McDonald's"), a currency (e.g. "USD", "GBP"), or anything
-added to the commodity table.  
+added to the commodity table.
 
 Accounts can be arranged in a hierarchical tree. The nodes of the tree
 are called "Account Groups". By accounting
@@ -77,7 +77,7 @@
 Splits plus the value of all of its sub-Accounts.
 
     @{ */
-/** @file Transaction.h 
+/** @file Transaction.h
     @brief API for Transactions and Splits (journal entries)
     @author Copyright (C) 1997 Robin D. Clark
     @author Copyright (C) 1997-2001 Linas Vepstas <linas at linas.org>
@@ -127,11 +127,11 @@
 /** @name Transaction creation and editing
  @{
 */
-/** 
+/**
  The xaccMallocTransaction() will malloc memory and initialize it.
  Once created, it is usually unsafe to merely "free" this memory;
- the xaccTransDestroy() method should be called. */ 
-Transaction * xaccMallocTransaction (QofBook *book); 
+ the xaccTransDestroy() method should be called. */
+Transaction * xaccMallocTransaction (QofBook *book);
 
 /** Destroys a transaction.
  *  Each split in transaction @a trans is removed from its
@@ -141,8 +141,8 @@
  *  ::xaccTransBeginEdit() then the changes are committed immediately.
  *  Otherwise, the caller must follow up with either
  *  ::xaccTransCommitEdit(), in which case the transaction and
- *  split memory will be freed, or xaccTransRollbackEdit(), in which 
- *  case nothing at all is freed, and everything is put back into 
+ *  split memory will be freed, or xaccTransRollbackEdit(), in which
+ *  case nothing at all is freed, and everything is put back into
  *  original order.
  *
  *  @param trans the transaction to destroy
@@ -186,7 +186,7 @@
                         gboolean assume_ordered);
 
 /** The xaccTransBeginEdit() method must be called before any changes
-    are made to a transaction or any of its component splits.  If 
+    are made to a transaction or any of its component splits.  If
     this is not done, errors will result. */
 void          xaccTransBeginEdit (Transaction *trans);
 
@@ -197,15 +197,15 @@
     of xaccTransDestroy() was called on the transaction. */
 void          xaccTransCommitEdit (Transaction *trans);
 
-/** The xaccTransRollbackEdit() routine rejects all edits made, and 
-    sets the transaction back to where it was before the editing 
+/** The xaccTransRollbackEdit() routine rejects all edits made, and
+    sets the transaction back to where it was before the editing
     started.  This includes restoring any deleted splits, removing
     any added splits, and undoing the effects of xaccTransDestroy,
     as well as restoring share quantities, memos, descriptions, etc. */
 void          xaccTransRollbackEdit (Transaction *trans);
 
 /** The xaccTransIsOpen() method returns TRUE if the transaction
-    is open for editing. Otherwise, it returns false.  
+    is open for editing. Otherwise, it returns false.
     XXX this routne should probably be deprecated.  its, umm,
     hard to imagine legitimate uses (but it is used by
     the import/export code for reasons I can't understand.)
@@ -215,24 +215,25 @@
 /** The xaccTransLookup() subroutine will return the
     transaction associated with the given id, or NULL
     if there is no such transaction. */
-/*@ dependent @*//*@ null @*/ Transaction * xaccTransLookup (const GUID *guid, QofBook *book);
+/*@ dependent @*//*@ null @*/
+Transaction * xaccTransLookup (const GUID *guid, QofBook *book);
 #define xaccTransLookupDirect(g,b) xaccTransLookup(&(g),b)
 
-Split * xaccTransFindSplitByAccount(const Transaction *trans, 
+Split * xaccTransFindSplitByAccount(const Transaction *trans,
                                     const Account *acc);
 
 /** The xaccTransScrubGains() routine performs a number of cleanup
  *  functions on the indicated transaction, with the end-goal of
  *  setting up a consistent set of gains/losses for all the splits
  *  in the transaction.  This includes making sure that the lot
- *  assignments of all the splits are good, and that the lots 
+ *  assignments of all the splits are good, and that the lots
  *  balance appropriately.
  */
 void xaccTransScrubGains (Transaction *trans, Account *gain_acc);
 
 
-/** \warning XXX FIXME 
- * gnc_book_count_transactions is a utility function, 
+/** \warning XXX FIXME
+ * gnc_book_count_transactions is a utility function,
  * probably needs to be moved to a utility file somewhere.
  */
 guint gnc_book_count_transactions(QofBook *book);
@@ -283,18 +284,18 @@
 
 
 /** Add a split to the transaction
- * 
- The xaccTransAppendSplit() method will append the indicated 
+ *
+ The xaccTransAppendSplit() method will append the indicated
  split to the collection of splits in this transaction.
  @note If the split is already a part of another transaction,
  it will be removed from that transaction first.
 */
 #define xaccTransAppendSplit(t, s) xaccSplitSetParent((s), (t))
 
-/** The xaccTransGetSplit() method returns a pointer to each of the 
+/** The xaccTransGetSplit() method returns a pointer to each of the
     splits in this transaction.
-    @param trans The transaction  
-    @param i The split number.  Valid values for i are zero to 
+    @param trans The transaction
+    @param i The split number.  Valid values for i are zero to
     (number_of__splits-1).  An invalid value of i will cause NULL to
     be returned.  A convenient way of cycling through all splits is
     to start at zero, and keep incrementing until a null value is returned. */
@@ -304,10 +305,11 @@
 int xaccTransGetSplitIndex(const Transaction *trans, const Split *split);
 
 /** The xaccTransGetSplitList() method returns a GList of the splits
-    in a transaction.  
+    in a transaction.
     @return The list of splits. This list must NOT be modified.  Do *NOT* free
     this list when you are done with it. */
-/*@ dependent @*/ SplitList *   xaccTransGetSplitList (const Transaction *trans);
+/*@ dependent @*/
+SplitList *   xaccTransGetSplitList (const Transaction *trans);
 gboolean xaccTransStillHasSplit(const Transaction *trans, const Split *s);
 
 
@@ -324,24 +326,25 @@
 gboolean      xaccTransHasReconciledSplits (const Transaction *trans);
 /** FIXME: document me */
 gboolean      xaccTransHasReconciledSplitsByAccount (const Transaction *trans,
-						     const Account *account);
+        const Account *account);
 
 /** FIXME: document me */
 gboolean      xaccTransHasSplitsInState (const Transaction *trans, const char state);
 /** FIXME: document me */
 gboolean      xaccTransHasSplitsInStateByAccount (const Transaction *trans,
-						  const char state,
-						  const Account *account);
+        const char state,
+        const Account *account);
 
 
 /** Returns the valuation commodity of this transaction.
  *
  * Each transaction's valuation commodity, or 'currency' is, by definition,
  * the common currency in which all splits in the transaction can be valued.
- * The total value of the transaction must be zero when all splits 
+ * The total value of the transaction must be zero when all splits
  * are valued in this currency.
  * @note What happens if the Currency isn't set?  Ans: bad things.  */
-/*@ dependent @*/ gnc_commodity * xaccTransGetCurrency (const Transaction *trans);
+/*@ dependent @*/
+gnc_commodity * xaccTransGetCurrency (const Transaction *trans);
 
 /** Set the commodity of this transaction. */
 void xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr);
@@ -353,9 +356,9 @@
  * transactions can sneak in, and this routine can be used to find
  * out how much things are off by.  The value returned is denominated
  * in the currency that is returned by the xaccTransFindCommonCurrency()
- * method. 
+ * method.
  *
- * If the use of currency exchange accounts is enabled then the a 
+ * If the use of currency exchange accounts is enabled then the a
  * a transaction must be balanced in each currency it uses to be considered
  * to be balanced.  The method xaccTransGetImbalance is used by most
  * code to take this into consideration.  This method is only used in a few
@@ -363,8 +366,8 @@
  * are enabled. */
 gnc_numeric xaccTransGetImbalanceValue (const Transaction * trans);
 
-/** The xaccTransGetImbalance method returns a list giving the value of 
- * the transaction in each currency for which the balance is not zero. 
+/** The xaccTransGetImbalance method returns a list giving the value of
+ * the transaction in each currency for which the balance is not zero.
  * If the use of currency accounts is disabled, then this will be only
  * the common currency for the transaction and xaccTransGetImbalance
  * becomes equivalent to xaccTransGetImbalanceValue.  Otherwise it will
@@ -381,8 +384,8 @@
  *  trying to balance Lots) -- this function is just a convienience to
  *  view everything at once.
  */
-gnc_numeric xaccTransGetAccountValue (const Transaction *trans, 
-				      const Account *account);
+gnc_numeric xaccTransGetAccountValue (const Transaction *trans,
+                                      const Account *account);
 
 /** Same as xaccTransGetAccountValue, but uses the Account's commodity. */
 gnc_numeric xaccTransGetAccountAmount (const Transaction *trans,
@@ -426,7 +429,7 @@
 /** @name Transaction date setters/getters
 @{
 */
-   
+
 /** The xaccTransSetDate() method does the same thing as
     xaccTransSetDate[Posted]Secs(), but takes a convenient
     day-month-year format.
@@ -457,7 +460,7 @@
 /** Modify the date of when the transaction was entered. The entered
  * date is the date when the register entry was made. */
 void          xaccTransSetDateEnteredTS (Transaction *trans,
-                                        const Timespec *ts);
+        const Timespec *ts);
 
 /** Dates and txn-type for A/R and A/P "invoice" postings */
 void	      xaccTransSetDateDueTS (Transaction *trans, const Timespec *ts);
@@ -510,8 +513,8 @@
  *  @param reason The textual reason why this transaction is being
  *  voided.
  */
-void xaccTransVoid(Transaction *transaction, 
-		   const char *reason);
+void xaccTransVoid(Transaction *transaction,
+                   const char *reason);
 
 /** xaccTransUnvoid restores a voided transaction to its original
  *  state.  At some point when gnucash is enhanced to support an audit

Modified: gnucash/trunk/src/engine/TransactionP.h
===================================================================
--- gnucash/trunk/src/engine/TransactionP.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/TransactionP.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -28,7 +28,7 @@
  * TransactionP.h
  *
  * FUNCTION:
- * The is the *private* transaction header file.  Code outside of 
+ * The is the *private* transaction header file.  Code outside of
  * engine should *not* include this file.  This is because code
  * outside of the engine should *never* access any of the structure
  * members directly.
@@ -54,7 +54,7 @@
 
 
 /** STRUCTS *********************************************************/
-/* 
+/*
  * Double-entry is forced by having at least two splits in every
  * transaction.  By convention, (and only by convention, not by
  * any innate requirement), the first split is considered to be
@@ -73,48 +73,48 @@
 
 struct transaction_s
 {
-  QofInstance inst;     /* glbally unique id */
+    QofInstance inst;     /* glbally unique id */
 
-  Timespec date_entered;     /* date register entry was made              */
-  Timespec date_posted;      /* date transaction was posted at bank       */
+    Timespec date_entered;     /* date register entry was made              */
+    Timespec date_posted;      /* date transaction was posted at bank       */
 
-  /* The num field is a arbitrary user-assigned field.  
-   * It is intended to store a short id number, typically the check number,
-   * deposit number, invoice number or other tracking number.
-   */
-  char * num;  
+    /* The num field is a arbitrary user-assigned field.
+     * It is intended to store a short id number, typically the check number,
+     * deposit number, invoice number or other tracking number.
+     */
+    char * num;
 
-  /* The description field is an arbitrary user-assigned value. 
-   * It is meant to be a short descriptive phrase.
-   */
-  char * description;        
+    /* The description field is an arbitrary user-assigned value.
+     * It is meant to be a short descriptive phrase.
+     */
+    char * description;
 
-  /* The common_currency field is the balancing common currency for
-   * all the splits in the transaction.  Alternate, better(?) name: 
-   * "valuation currency": it is the currency in which all of the 
-   * splits can be valued.  */
-  gnc_commodity *common_currency;
+    /* The common_currency field is the balancing common currency for
+     * all the splits in the transaction.  Alternate, better(?) name:
+     * "valuation currency": it is the currency in which all of the
+     * splits can be valued.  */
+    gnc_commodity *common_currency;
 
-  GList * splits; /* list of splits */
+    GList * splits; /* list of splits */
 
-  /* marker is used to track the progress of transaction traversals. 
-   * 0 is never a legitimate marker value, so we can tell is we hit
-   * a new transaction in the middle of a traversal. All each new
-   * traversal cares about is whether or not the marker stored in
-   * a transaction is the same as or different than the one
-   * corresponding to the current traversal. */
-  unsigned char  marker;      
+    /* marker is used to track the progress of transaction traversals.
+     * 0 is never a legitimate marker value, so we can tell is we hit
+     * a new transaction in the middle of a traversal. All each new
+     * traversal cares about is whether or not the marker stored in
+     * a transaction is the same as or different than the one
+     * corresponding to the current traversal. */
+    unsigned char  marker;
 
-  /* The orig pointer points at a copy of the original transaction,
-   * before editing was started.  This orig copy is used to rollback 
-   * any changes made if/when the edit is abandoned.
-   */
-  Transaction *orig;
+    /* The orig pointer points at a copy of the original transaction,
+     * before editing was started.  This orig copy is used to rollback
+     * any changes made if/when the edit is abandoned.
+     */
+    Transaction *orig;
 };
 
 struct _TransactionClass
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 };
 
 /* Set the transaction's GUID. This should only be done when reading
@@ -126,10 +126,10 @@
  * This routine cannot be exposed publically since the duplicate
  * is wrong in many ways: it is not issued a unique guid, and thus
  * not a properly registered Entity.  The splits are copied, but
- * these are also funny: they aren't inserted into the accounts 
+ * these are also funny: they aren't inserted into the accounts
  * they claim to be in.  The splits also have bogus GUID's.
  * Another 'feature': the splits point at the old transaction
- * as the parent, not the new transaction.  
+ * as the parent, not the new transaction.
  */
 Transaction * xaccDupeTransaction (const Transaction *t);
 
@@ -145,14 +145,14 @@
 gboolean xaccTransRegister (void);
 
 /* The xaccTransactionGetBackend() subroutine will find the
- *    persistent-data storage backend associated with this 
+ *    persistent-data storage backend associated with this
  *    transaction.
  */
 QofBackend * xaccTransactionGetBackend (Transaction *trans);
 
 /* The xaccEnable/DisableDataScrubbing() routines affect what
  *   happens during transaction commit.  When scrubbing is enabled,
- *   then transactions are fixed up during transaction commit, 
+ *   then transactions are fixed up during transaction commit,
  *   so that only consistent transactions are commited to the engine.
  *   However, when data is being loaded from a backend (in particular,
  *   from the file backend), the data might not be consistent until

Modified: gnucash/trunk/src/engine/binreloc.c
===================================================================
--- gnucash/trunk/src/engine/binreloc.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/binreloc.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -15,9 +15,9 @@
 #include "config.h"
 
 #ifdef ENABLE_BINRELOC
-	#include <sys/types.h>
-	#include <sys/stat.h>
-	#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #ifdef MAC_INTEGRATION
 #include <igemacintegration/ige-mac-bundle.h>
 #endif
@@ -43,172 +43,185 @@
 _br_find_exe (GbrInitError *error)
 {
 #ifndef ENABLE_BINRELOC
-	if (error)
-		*error = GBR_INIT_ERROR_DISABLED;
-	return NULL;
+    if (error)
+        *error = GBR_INIT_ERROR_DISABLED;
+    return NULL;
 #else
 #ifdef G_OS_WIN32
-	/* I *thought* this program code already included the
-	   relocation code for windows. Unfortunately this is not
-	   the case and we have to add this manually. This is only
-	   one possibility; other ways of looking up the full path
-	   of gnucash-bin.exe probably exist.*/
-	gchar *prefix;
-	gchar *result;
+    /* I *thought* this program code already included the
+       relocation code for windows. Unfortunately this is not
+       the case and we have to add this manually. This is only
+       one possibility; other ways of looking up the full path
+       of gnucash-bin.exe probably exist.*/
+    gchar *prefix;
+    gchar *result;
 
-	/* From the glib docs: When passed NULL, this function looks
-	   up installation the directory of the main executable of
-	   the current process */
-	prefix = g_win32_get_package_installation_directory_of_module (NULL);
-	result = g_build_filename (prefix,
-				   "bin", "gnucash-bin.exe",
-				   (char*)NULL);
-	g_free (prefix);
-	return result;
+    /* From the glib docs: When passed NULL, this function looks
+       up installation the directory of the main executable of
+       the current process */
+    prefix = g_win32_get_package_installation_directory_of_module (NULL);
+    result = g_build_filename (prefix,
+                               "bin", "gnucash-bin.exe",
+                               (char*)NULL);
+    g_free (prefix);
+    return result;
 #elif MAC_INTEGRATION
-	gchar *prefix = NULL, *result = NULL;
-	g_type_init();
-	bundle = ige_mac_bundle_new();
-	if (!bundle) {
-	    *error = GBR_INIT_ERROR_MAC_NOT_BUNDLE;
-	    return NULL;
-	}
-	if (!ige_mac_bundle_get_is_app_bundle (bundle)) {
-	    g_object_unref(bundle);
-	    bundle = NULL;
-	    *error = GBR_INIT_ERROR_MAC_NOT_APP_BUNDLE;
-	    return NULL;
-	}
-	ige_mac_bundle_setup_environment(bundle);
-	prefix = g_strdup(ige_mac_bundle_get_path(bundle));
-	result = g_build_filename(prefix, "Contents/MacOS", 
-					 "gnucash-bin", NULL);
-	g_free(prefix);
-	return result;
+    gchar *prefix = NULL, *result = NULL;
+    g_type_init();
+    bundle = ige_mac_bundle_new();
+    if (!bundle)
+    {
+        *error = GBR_INIT_ERROR_MAC_NOT_BUNDLE;
+        return NULL;
+    }
+    if (!ige_mac_bundle_get_is_app_bundle (bundle))
+    {
+        g_object_unref(bundle);
+        bundle = NULL;
+        *error = GBR_INIT_ERROR_MAC_NOT_APP_BUNDLE;
+        return NULL;
+    }
+    ige_mac_bundle_setup_environment(bundle);
+    prefix = g_strdup(ige_mac_bundle_get_path(bundle));
+    result = g_build_filename(prefix, "Contents/MacOS",
+                              "gnucash-bin", NULL);
+    g_free(prefix);
+    return result;
 #else
-	char *path, *path2, *line, *result;
-	size_t buf_size;
-	ssize_t size;
-	struct stat stat_buf;
-	FILE *f;
+    char *path, *path2, *line, *result;
+    size_t buf_size;
+    ssize_t size;
+    struct stat stat_buf;
+    FILE *f;
 
-	/* Read from /proc/self/exe (symlink) */
-	if (sizeof (path) > SSIZE_MAX)
-		buf_size = SSIZE_MAX - 1;
-	else
-		buf_size = PATH_MAX - 1;
-	path = (char *) g_try_malloc (buf_size);
-	if (path == NULL) {
-		/* Cannot allocate memory. */
-		if (error)
-			*error = GBR_INIT_ERROR_NOMEM;
-		return NULL;
-	}
-	path2 = (char *) g_try_malloc (buf_size);
-	if (path2 == NULL) {
-		/* Cannot allocate memory. */
-		if (error)
-			*error = GBR_INIT_ERROR_NOMEM;
-		g_free (path);
-		return NULL;
-	}
+    /* Read from /proc/self/exe (symlink) */
+    if (sizeof (path) > SSIZE_MAX)
+        buf_size = SSIZE_MAX - 1;
+    else
+        buf_size = PATH_MAX - 1;
+    path = (char *) g_try_malloc (buf_size);
+    if (path == NULL)
+    {
+        /* Cannot allocate memory. */
+        if (error)
+            *error = GBR_INIT_ERROR_NOMEM;
+        return NULL;
+    }
+    path2 = (char *) g_try_malloc (buf_size);
+    if (path2 == NULL)
+    {
+        /* Cannot allocate memory. */
+        if (error)
+            *error = GBR_INIT_ERROR_NOMEM;
+        g_free (path);
+        return NULL;
+    }
 
-	strncpy (path2, "/proc/self/exe", buf_size - 1);
+    strncpy (path2, "/proc/self/exe", buf_size - 1);
 
-	while (1) {
-		int i;
+    while (1)
+    {
+        int i;
 
-		size = readlink (path2, path, buf_size - 1);
-		if (size == -1) {
-			/* Error. */
-			g_free (path2);
-			break;
-		}
+        size = readlink (path2, path, buf_size - 1);
+        if (size == -1)
+        {
+            /* Error. */
+            g_free (path2);
+            break;
+        }
 
-		/* readlink() success. */
-		path[size] = '\0';
+        /* readlink() success. */
+        path[size] = '\0';
 
-		/* Check whether the symlink's target is also a symlink.
-		 * We want to get the final target. */
-		i = stat (path, &stat_buf);
-		if (i == -1) {
-			/* Error. */
-			g_free (path2);
-			break;
-		}
+        /* Check whether the symlink's target is also a symlink.
+         * We want to get the final target. */
+        i = stat (path, &stat_buf);
+        if (i == -1)
+        {
+            /* Error. */
+            g_free (path2);
+            break;
+        }
 
-		/* stat() success. */
-		if (!S_ISLNK (stat_buf.st_mode)) {
-			/* path is not a symlink. Done. */
-			g_free (path2);
-			return path;
-		}
+        /* stat() success. */
+        if (!S_ISLNK (stat_buf.st_mode))
+        {
+            /* path is not a symlink. Done. */
+            g_free (path2);
+            return path;
+        }
 
-		/* path is a symlink. Continue loop and resolve this. */
-		strncpy (path, path2, buf_size - 1);
-	}
+        /* path is a symlink. Continue loop and resolve this. */
+        strncpy (path, path2, buf_size - 1);
+    }
 
 
-	/* readlink() or stat() failed; this can happen when the program is
-	 * running in Valgrind 2.2. Read from /proc/self/maps as fallback. */
+    /* readlink() or stat() failed; this can happen when the program is
+     * running in Valgrind 2.2. Read from /proc/self/maps as fallback. */
 
-	buf_size = PATH_MAX + 128;
-	line = (char *) g_try_realloc (path, buf_size);
-	if (line == NULL) {
-		/* Cannot allocate memory. */
-		g_free (path);
-		if (error)
-			*error = GBR_INIT_ERROR_NOMEM;
-		return NULL;
-	}
+    buf_size = PATH_MAX + 128;
+    line = (char *) g_try_realloc (path, buf_size);
+    if (line == NULL)
+    {
+        /* Cannot allocate memory. */
+        g_free (path);
+        if (error)
+            *error = GBR_INIT_ERROR_NOMEM;
+        return NULL;
+    }
 
-	f = fopen ("/proc/self/maps", "r");
-	if (f == NULL) {
-		g_free (line);
-		if (error)
-			*error = GBR_INIT_ERROR_OPEN_MAPS;
-		return NULL;
-	}
+    f = fopen ("/proc/self/maps", "r");
+    if (f == NULL)
+    {
+        g_free (line);
+        if (error)
+            *error = GBR_INIT_ERROR_OPEN_MAPS;
+        return NULL;
+    }
 
-	/* The first entry should be the executable name. */
-	result = fgets (line, (int) buf_size, f);
-	if (result == NULL) {
-		fclose (f);
-		g_free (line);
-		if (error)
-			*error = GBR_INIT_ERROR_READ_MAPS;
-		return NULL;
-	}
+    /* The first entry should be the executable name. */
+    result = fgets (line, (int) buf_size, f);
+    if (result == NULL)
+    {
+        fclose (f);
+        g_free (line);
+        if (error)
+            *error = GBR_INIT_ERROR_READ_MAPS;
+        return NULL;
+    }
 
-	/* Get rid of newline character. */
-	buf_size = strlen (line);
-	if (buf_size <= 0) {
-		/* Huh? An empty string? */
-		fclose (f);
-		g_free (line);
-		if (error)
-			*error = GBR_INIT_ERROR_INVALID_MAPS;
-		return NULL;
-	}
-	if (line[buf_size - 1] == 10)
-		line[buf_size - 1] = 0;
+    /* Get rid of newline character. */
+    buf_size = strlen (line);
+    if (buf_size <= 0)
+    {
+        /* Huh? An empty string? */
+        fclose (f);
+        g_free (line);
+        if (error)
+            *error = GBR_INIT_ERROR_INVALID_MAPS;
+        return NULL;
+    }
+    if (line[buf_size - 1] == 10)
+        line[buf_size - 1] = 0;
 
-	/* Extract the filename; it is always an absolute path. */
-	path = strchr (line, '/');
+    /* Extract the filename; it is always an absolute path. */
+    path = strchr (line, '/');
 
-	/* Sanity check. */
-	if (strstr (line, " r-xp ") == NULL || path == NULL) {
-		fclose (f);
-		g_free (line);
-		if (error)
-			*error = GBR_INIT_ERROR_INVALID_MAPS;
-		return NULL;
-	}
+    /* Sanity check. */
+    if (strstr (line, " r-xp ") == NULL || path == NULL)
+    {
+        fclose (f);
+        g_free (line);
+        if (error)
+            *error = GBR_INIT_ERROR_INVALID_MAPS;
+        return NULL;
+    }
 
-	path = g_strdup (path);
-	g_free (line);
-	fclose (f);
-	return path;
+    path = g_strdup (path);
+    g_free (line);
+    fclose (f);
+    return path;
 #endif /* G_OS_WINDOWS */
 #endif /* ENABLE_BINRELOC */
 }
@@ -222,108 +235,111 @@
 _br_find_exe_for_symbol (const void *symbol, GbrInitError *error)
 {
 #ifndef ENABLE_BINRELOC
-	if (error)
-		*error = GBR_INIT_ERROR_DISABLED;
-	return (char *) NULL;
+    if (error)
+        *error = GBR_INIT_ERROR_DISABLED;
+    return (char *) NULL;
 #else
-#if defined G_OS_WIN32 
-	g_warning ("_br_find_exe_for_symbol not implemented on win32.");
-	if (error)
-		*error = GBR_INIT_ERROR_DISABLED;
-	return (char *) NULL;
+#if defined G_OS_WIN32
+    g_warning ("_br_find_exe_for_symbol not implemented on win32.");
+    if (error)
+        *error = GBR_INIT_ERROR_DISABLED;
+    return (char *) NULL;
 #else
-	#define SIZE PATH_MAX + 100
-	FILE *f;
-	size_t address_string_len;
-	char *address_string, line[SIZE], *found;
+#define SIZE PATH_MAX + 100
+    FILE *f;
+    size_t address_string_len;
+    char *address_string, line[SIZE], *found;
 
-	if (symbol == NULL)
-		return (char *) NULL;
+    if (symbol == NULL)
+        return (char *) NULL;
 
-	f = fopen ("/proc/self/maps", "r");
-	if (f == NULL)
-		return (char *) NULL;
+    f = fopen ("/proc/self/maps", "r");
+    if (f == NULL)
+        return (char *) NULL;
 
-	address_string_len = 4;
-	address_string = (char *) g_try_malloc (address_string_len);
-	found = (char *) NULL;
+    address_string_len = 4;
+    address_string = (char *) g_try_malloc (address_string_len);
+    found = (char *) NULL;
 
-	while (!feof (f)) {
-		char *start_addr, *end_addr, *end_addr_end, *file;
-		void *start_addr_p, *end_addr_p;
-		size_t len;
+    while (!feof (f))
+    {
+        char *start_addr, *end_addr, *end_addr_end, *file;
+        void *start_addr_p, *end_addr_p;
+        size_t len;
 
-		if (fgets (line, SIZE, f) == NULL)
-			break;
+        if (fgets (line, SIZE, f) == NULL)
+            break;
 
-		/* Sanity check. */
-		if (strstr (line, " r-xp ") == NULL || strchr (line, '/') == NULL)
-			continue;
+        /* Sanity check. */
+        if (strstr (line, " r-xp ") == NULL || strchr (line, '/') == NULL)
+            continue;
 
-		/* Parse line. */
-		start_addr = line;
-		end_addr = strchr (line, '-');
-		file = strchr (line, '/');
+        /* Parse line. */
+        start_addr = line;
+        end_addr = strchr (line, '-');
+        file = strchr (line, '/');
 
-		/* More sanity check. */
-		if (!(file > end_addr && end_addr != NULL && end_addr[0] == '-'))
-			continue;
+        /* More sanity check. */
+        if (!(file > end_addr && end_addr != NULL && end_addr[0] == '-'))
+            continue;
 
-		end_addr[0] = '\0';
-		end_addr++;
-		end_addr_end = strchr (end_addr, ' ');
-		if (end_addr_end == NULL)
-			continue;
+        end_addr[0] = '\0';
+        end_addr++;
+        end_addr_end = strchr (end_addr, ' ');
+        if (end_addr_end == NULL)
+            continue;
 
-		end_addr_end[0] = '\0';
-		len = strlen (file);
-		if (len == 0)
-			continue;
-		if (file[len - 1] == '\n')
-			file[len - 1] = '\0';
+        end_addr_end[0] = '\0';
+        len = strlen (file);
+        if (len == 0)
+            continue;
+        if (file[len - 1] == '\n')
+            file[len - 1] = '\0';
 
-		/* Get rid of "(deleted)" from the filename. */
-		len = strlen (file);
-		if (len > 10 && strcmp (file + len - 10, " (deleted)") == 0)
-			file[len - 10] = '\0';
+        /* Get rid of "(deleted)" from the filename. */
+        len = strlen (file);
+        if (len > 10 && strcmp (file + len - 10, " (deleted)") == 0)
+            file[len - 10] = '\0';
 
-		/* I don't know whether this can happen but better safe than sorry. */
-		len = strlen (start_addr);
-		if (len != strlen (end_addr))
-			continue;
+        /* I don't know whether this can happen but better safe than sorry. */
+        len = strlen (start_addr);
+        if (len != strlen (end_addr))
+            continue;
 
 
-		/* Transform the addresses into a string in the form of 0xdeadbeef,
-		 * then transform that into a pointer. */
-		if (address_string_len < len + 3) {
-			address_string_len = len + 3;
-			address_string = (char *) g_try_realloc (address_string, address_string_len);
-		}
+        /* Transform the addresses into a string in the form of 0xdeadbeef,
+         * then transform that into a pointer. */
+        if (address_string_len < len + 3)
+        {
+            address_string_len = len + 3;
+            address_string = (char *) g_try_realloc (address_string, address_string_len);
+        }
 
-		memcpy (address_string, "0x", 2);
-		memcpy (address_string + 2, start_addr, len);
-		address_string[2 + len] = '\0';
-		sscanf (address_string, "%p", &start_addr_p);
+        memcpy (address_string, "0x", 2);
+        memcpy (address_string + 2, start_addr, len);
+        address_string[2 + len] = '\0';
+        sscanf (address_string, "%p", &start_addr_p);
 
-		memcpy (address_string, "0x", 2);
-		memcpy (address_string + 2, end_addr, len);
-		address_string[2 + len] = '\0';
-		sscanf (address_string, "%p", &end_addr_p);
+        memcpy (address_string, "0x", 2);
+        memcpy (address_string + 2, end_addr, len);
+        address_string[2 + len] = '\0';
+        sscanf (address_string, "%p", &end_addr_p);
 
 
-		if (symbol >= start_addr_p && symbol < end_addr_p) {
-			found = file;
-			break;
-		}
-	}
+        if (symbol >= start_addr_p && symbol < end_addr_p)
+        {
+            found = file;
+            break;
+        }
+    }
 
-	g_free (address_string);
-	fclose (f);
+    g_free (address_string);
+    fclose (f);
 
-	if (found == NULL)
-		return (char *) NULL;
-	else
-		return g_strdup (found);
+    if (found == NULL)
+        return (char *) NULL;
+    else
+        return g_strdup (found);
 #endif /* G_OS_WIN32 */
 #endif /* ENABLE_BINRELOC */
 }
@@ -352,18 +368,19 @@
 gboolean
 gbr_init (GError **error)
 {
-	GbrInitError errcode = 0;
+    GbrInitError errcode = 0;
 
-	/* Locate the application's filename. */
-	exe = _br_find_exe (&errcode);
-	if (exe != NULL)
-		/* Success! */
-		return TRUE;
-	else {
-		/* Failed :-( */
-		set_gerror (error, errcode);
-		return FALSE;
-	}
+    /* Locate the application's filename. */
+    exe = _br_find_exe (&errcode);
+    if (exe != NULL)
+        /* Success! */
+        return TRUE;
+    else
+    {
+        /* Failed :-( */
+        set_gerror (error, errcode);
+        return FALSE;
+    }
 }
 
 
@@ -380,56 +397,58 @@
 gboolean
 gbr_init_lib (GError **error)
 {
-	GbrInitError errcode = 0;
+    GbrInitError errcode = 0;
 
-	exe = _br_find_exe_for_symbol ((const void *) "", &errcode);
-	if (exe != NULL)
-		/* Success! */
-		return TRUE;
-	else {
-		/* Failed :-( */
-		set_gerror (error, errcode);
-		return exe != NULL;
-	}
+    exe = _br_find_exe_for_symbol ((const void *) "", &errcode);
+    if (exe != NULL)
+        /* Success! */
+        return TRUE;
+    else
+    {
+        /* Failed :-( */
+        set_gerror (error, errcode);
+        return exe != NULL;
+    }
 }
 
 
 static void
 set_gerror (GError **error, GbrInitError errcode)
 {
-	gchar *error_message;
+    gchar *error_message;
 
-	if (error == NULL)
-		return;
+    if (error == NULL)
+        return;
 
-	switch (errcode) {
-	case GBR_INIT_ERROR_NOMEM:
-		error_message = "Cannot allocate memory.";
-		break;
-	case GBR_INIT_ERROR_OPEN_MAPS:
-		error_message = "Unable to open /proc/self/maps for reading.";
-		break;
-	case GBR_INIT_ERROR_READ_MAPS:
-		error_message = "Unable to read from /proc/self/maps.";
-		break;
-	case GBR_INIT_ERROR_INVALID_MAPS:
-		error_message = "The file format of /proc/self/maps is invalid.";
-		break;
-        case GBR_INIT_ERROR_MAC_NOT_BUNDLE:
-	    error_message = "Binreloc did not find a bundle";
-	    break;
-	case GBR_INIT_ERROR_MAC_NOT_APP_BUNDLE:
-	    error_message = "Binreloc found that the bundle is not an app bundle";
-	    break;
-	case GBR_INIT_ERROR_DISABLED:
-		error_message = "Binary relocation support is disabled.";
-		break;
-	default:
-		error_message = "Unknown error.";
-		break;
-	};
-	g_set_error (error, g_quark_from_static_string ("GBinReloc"),
-		     errcode, "%s", error_message);
+    switch (errcode)
+    {
+    case GBR_INIT_ERROR_NOMEM:
+        error_message = "Cannot allocate memory.";
+        break;
+    case GBR_INIT_ERROR_OPEN_MAPS:
+        error_message = "Unable to open /proc/self/maps for reading.";
+        break;
+    case GBR_INIT_ERROR_READ_MAPS:
+        error_message = "Unable to read from /proc/self/maps.";
+        break;
+    case GBR_INIT_ERROR_INVALID_MAPS:
+        error_message = "The file format of /proc/self/maps is invalid.";
+        break;
+    case GBR_INIT_ERROR_MAC_NOT_BUNDLE:
+        error_message = "Binreloc did not find a bundle";
+        break;
+    case GBR_INIT_ERROR_MAC_NOT_APP_BUNDLE:
+        error_message = "Binreloc found that the bundle is not an app bundle";
+        break;
+    case GBR_INIT_ERROR_DISABLED:
+        error_message = "Binary relocation support is disabled.";
+        break;
+    default:
+        error_message = "Unknown error.";
+        break;
+    };
+    g_set_error (error, g_quark_from_static_string ("GBinReloc"),
+                 errcode, "%s", error_message);
 }
 
 
@@ -445,14 +464,15 @@
 gchar *
 gbr_find_exe (const gchar *default_exe)
 {
-	if (exe == NULL) {
-		/* BinReloc is not initialized. */
-		if (default_exe != NULL)
-			return g_strdup (default_exe);
-		else
-			return NULL;
-	}
-	return g_strdup (exe);
+    if (exe == NULL)
+    {
+        /* BinReloc is not initialized. */
+        if (default_exe != NULL)
+            return g_strdup (default_exe);
+        else
+            return NULL;
+    }
+    return g_strdup (exe);
 }
 
 
@@ -473,15 +493,16 @@
 gchar *
 gbr_find_exe_dir (const gchar *default_dir)
 {
-	if (exe == NULL) {
-		/* BinReloc not initialized. */
-		if (default_dir != NULL)
-			return g_strdup (default_dir);
-		else
-			return NULL;
-	}
+    if (exe == NULL)
+    {
+        /* BinReloc not initialized. */
+        if (default_dir != NULL)
+            return g_strdup (default_dir);
+        else
+            return NULL;
+    }
 
-	return g_path_get_dirname (exe);
+    return g_path_get_dirname (exe);
 }
 
 
@@ -502,34 +523,36 @@
 gchar *
 gbr_find_prefix (const gchar *default_prefix)
 {
-	gchar *dir1, *dir2;
+    gchar *dir1, *dir2;
 
 #if defined ENABLE_BINRELOC && defined MAC_INTEGRATION
-	gchar *prefix = NULL, *result = NULL;
-	if (bundle == NULL) {
-		/* BinReloc not initialized. */
-		if (default_prefix != NULL)
-			return g_strdup (default_prefix);
-		else
-			return NULL;
-	}
-	prefix = g_strdup(ige_mac_bundle_get_path(bundle));
-	result = g_build_filename(prefix, "Contents/Resources", NULL);
-	g_free(prefix);
-	return result;
+    gchar *prefix = NULL, *result = NULL;
+    if (bundle == NULL)
+    {
+        /* BinReloc not initialized. */
+        if (default_prefix != NULL)
+            return g_strdup (default_prefix);
+        else
+            return NULL;
+    }
+    prefix = g_strdup(ige_mac_bundle_get_path(bundle));
+    result = g_build_filename(prefix, "Contents/Resources", NULL);
+    g_free(prefix);
+    return result;
 #else
 
-	if (exe == NULL) {
-		/* BinReloc not initialized. */
-		if (default_prefix != NULL)
-			return g_strdup (default_prefix);
-		else
-			return NULL;
-	}
-	dir1 = g_path_get_dirname (exe);
-	dir2 = g_path_get_dirname (dir1);
-	g_free (dir1);
-	return dir2;
+    if (exe == NULL)
+    {
+        /* BinReloc not initialized. */
+        if (default_prefix != NULL)
+            return g_strdup (default_prefix);
+        else
+            return NULL;
+    }
+    dir1 = g_path_get_dirname (exe);
+    dir2 = g_path_get_dirname (dir1);
+    g_free (dir1);
+    return dir2;
 #endif //ENABLE_BINRELOC && MAC_INTEGRATION
 }
 
@@ -550,33 +573,35 @@
 gchar *
 gbr_find_bin_dir (const gchar *default_bin_dir)
 {
-	gchar *prefix, *dir;
+    gchar *prefix, *dir;
 #if defined ENABLE_BINRELOC && defined MAC_INTEGRATION
-	if (bundle == NULL) {
-	    /* BinReloc not initialized. */
-	    if (default_bin_dir != NULL)
-		return g_strdup (default_bin_dir);
-	    else
-		return NULL;
-	}
-	prefix = g_strdup(ige_mac_bundle_get_path(bundle));
-	dir = g_build_filename(prefix, "Contents/MacOS", NULL);
-	g_free(prefix);
-	return dir;
+    if (bundle == NULL)
+    {
+        /* BinReloc not initialized. */
+        if (default_bin_dir != NULL)
+            return g_strdup (default_bin_dir);
+        else
+            return NULL;
+    }
+    prefix = g_strdup(ige_mac_bundle_get_path(bundle));
+    dir = g_build_filename(prefix, "Contents/MacOS", NULL);
+    g_free(prefix);
+    return dir;
 #else
 
-	prefix = gbr_find_prefix (NULL);
-	if (prefix == NULL) {
-		/* BinReloc not initialized. */
-		if (default_bin_dir != NULL)
-			return g_strdup (default_bin_dir);
-		else
-			return NULL;
-	}
+    prefix = gbr_find_prefix (NULL);
+    if (prefix == NULL)
+    {
+        /* BinReloc not initialized. */
+        if (default_bin_dir != NULL)
+            return g_strdup (default_bin_dir);
+        else
+            return NULL;
+    }
 
-	dir = g_build_filename (prefix, "bin", NULL);
-	g_free (prefix);
-	return dir;
+    dir = g_build_filename (prefix, "bin", NULL);
+    g_free (prefix);
+    return dir;
 #endif //ENABLE_BINRELOC && MAC_INTEGRATION
 }
 
@@ -597,20 +622,21 @@
 gchar *
 gbr_find_sbin_dir (const gchar *default_sbin_dir)
 {
-	gchar *prefix, *dir;
+    gchar *prefix, *dir;
 
-	prefix = gbr_find_prefix (NULL);
-	if (prefix == NULL) {
-		/* BinReloc not initialized. */
-		if (default_sbin_dir != NULL)
-			return g_strdup (default_sbin_dir);
-		else
-			return NULL;
-	}
+    prefix = gbr_find_prefix (NULL);
+    if (prefix == NULL)
+    {
+        /* BinReloc not initialized. */
+        if (default_sbin_dir != NULL)
+            return g_strdup (default_sbin_dir);
+        else
+            return NULL;
+    }
 
-	dir = g_build_filename (prefix, "sbin", NULL);
-	g_free (prefix);
-	return dir;
+    dir = g_build_filename (prefix, "sbin", NULL);
+    g_free (prefix);
+    return dir;
 }
 
 
@@ -631,20 +657,21 @@
 gchar *
 gbr_find_data_dir (const gchar *default_data_dir)
 {
-	gchar *prefix, *dir;
+    gchar *prefix, *dir;
 
-	prefix = gbr_find_prefix (NULL);
-	if (prefix == NULL) {
-		/* BinReloc not initialized. */
-		if (default_data_dir != NULL)
-			return g_strdup (default_data_dir);
-		else
-			return NULL;
-	}
+    prefix = gbr_find_prefix (NULL);
+    if (prefix == NULL)
+    {
+        /* BinReloc not initialized. */
+        if (default_data_dir != NULL)
+            return g_strdup (default_data_dir);
+        else
+            return NULL;
+    }
 
-	dir = g_build_filename (prefix, "share", NULL);
-	g_free (prefix);
-	return dir;
+    dir = g_build_filename (prefix, "share", NULL);
+    g_free (prefix);
+    return dir;
 }
 
 
@@ -664,20 +691,21 @@
 gchar *
 gbr_find_lib_dir (const gchar *default_lib_dir)
 {
-	gchar *prefix, *dir;
+    gchar *prefix, *dir;
 
-	prefix = gbr_find_prefix (NULL);
-	if (prefix == NULL) {
-		/* BinReloc not initialized. */
-		if (default_lib_dir != NULL)
-			return g_strdup (default_lib_dir);
-		else
-			return NULL;
-	}
+    prefix = gbr_find_prefix (NULL);
+    if (prefix == NULL)
+    {
+        /* BinReloc not initialized. */
+        if (default_lib_dir != NULL)
+            return g_strdup (default_lib_dir);
+        else
+            return NULL;
+    }
 
-	dir = g_build_filename (prefix, "lib", NULL);
-	g_free (prefix);
-	return dir;
+    dir = g_build_filename (prefix, "lib", NULL);
+    g_free (prefix);
+    return dir;
 }
 
 
@@ -697,20 +725,21 @@
 gchar *
 gbr_find_libexec_dir (const gchar *default_libexec_dir)
 {
-	gchar *prefix, *dir;
+    gchar *prefix, *dir;
 
-	prefix = gbr_find_prefix (NULL);
-	if (prefix == NULL) {
-		/* BinReloc not initialized. */
-		if (default_libexec_dir != NULL)
-			return g_strdup (default_libexec_dir);
-		else
-			return NULL;
-	}
+    prefix = gbr_find_prefix (NULL);
+    if (prefix == NULL)
+    {
+        /* BinReloc not initialized. */
+        if (default_libexec_dir != NULL)
+            return g_strdup (default_libexec_dir);
+        else
+            return NULL;
+    }
 
-	dir = g_build_filename (prefix, "libexec", NULL);
-	g_free (prefix);
-	return dir;
+    dir = g_build_filename (prefix, "libexec", NULL);
+    g_free (prefix);
+    return dir;
 }
 
 
@@ -730,20 +759,21 @@
 gchar *
 gbr_find_etc_dir (const gchar *default_etc_dir)
 {
-	gchar *prefix, *dir;
+    gchar *prefix, *dir;
 
-	prefix = gbr_find_prefix (NULL);
-	if (prefix == NULL) {
-		/* BinReloc not initialized. */
-		if (default_etc_dir != NULL)
-			return g_strdup (default_etc_dir);
-		else
-			return NULL;
-	}
+    prefix = gbr_find_prefix (NULL);
+    if (prefix == NULL)
+    {
+        /* BinReloc not initialized. */
+        if (default_etc_dir != NULL)
+            return g_strdup (default_etc_dir);
+        else
+            return NULL;
+    }
 
-	dir = g_build_filename (prefix, "etc", NULL);
-	g_free (prefix);
-	return dir;
+    dir = g_build_filename (prefix, "etc", NULL);
+    g_free (prefix);
+    return dir;
 }
 
 

Modified: gnucash/trunk/src/engine/binreloc.h
===================================================================
--- gnucash/trunk/src/engine/binreloc.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/binreloc.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -19,35 +19,36 @@
 
 
 /** These error codes can be returned by br_init(), br_init_lib(), gbr_init() or gbr_init_lib(). */
-typedef enum {
-	/** Cannot allocate memory. */
-	GBR_INIT_ERROR_NOMEM,
-	/** Unable to open /proc/self/maps; see errno for details. */
-	GBR_INIT_ERROR_OPEN_MAPS,
-	/** Unable to read from /proc/self/maps; see errno for details. */
-	GBR_INIT_ERROR_READ_MAPS,
-	/** The file format of /proc/self/maps is invalid; kernel bug? */
-	GBR_INIT_ERROR_INVALID_MAPS,
-	/** BinReloc determined that gnucash is not running from a bundle */
-	GBR_INIT_ERROR_MAC_NOT_BUNDLE,
-	/** Binreloc determined that the bundle is not an app bundle */
-	GBR_INIT_ERROR_MAC_NOT_APP_BUNDLE,
-	/** BinReloc is disabled (the ENABLE_BINRELOC macro is not defined). */
-	GBR_INIT_ERROR_DISABLED
+typedef enum
+{
+    /** Cannot allocate memory. */
+    GBR_INIT_ERROR_NOMEM,
+    /** Unable to open /proc/self/maps; see errno for details. */
+    GBR_INIT_ERROR_OPEN_MAPS,
+    /** Unable to read from /proc/self/maps; see errno for details. */
+    GBR_INIT_ERROR_READ_MAPS,
+    /** The file format of /proc/self/maps is invalid; kernel bug? */
+    GBR_INIT_ERROR_INVALID_MAPS,
+    /** BinReloc determined that gnucash is not running from a bundle */
+    GBR_INIT_ERROR_MAC_NOT_BUNDLE,
+    /** Binreloc determined that the bundle is not an app bundle */
+    GBR_INIT_ERROR_MAC_NOT_APP_BUNDLE,
+    /** BinReloc is disabled (the ENABLE_BINRELOC macro is not defined). */
+    GBR_INIT_ERROR_DISABLED
 } GbrInitError;
 
 
 #ifndef BINRELOC_RUNNING_DOXYGEN
 /* Mangle symbol names to avoid symbol collisions with other ELF objects. */
-	#define gbr_find_exe         ffEt66859784967989_gbr_find_exe
-	#define gbr_find_exe_dir     ffEt66859784967989_gbr_find_exe_dir
-	#define gbr_find_prefix      ffEt66859784967989_gbr_find_prefix
-	#define gbr_find_bin_dir     ffEt66859784967989_gbr_find_bin_dir
-	#define gbr_find_sbin_dir    ffEt66859784967989_gbr_find_sbin_dir
-	#define gbr_find_data_dir    ffEt66859784967989_gbr_find_data_dir
-	#define gbr_find_lib_dir     ffEt66859784967989_gbr_find_lib_dir
-	#define gbr_find_libexec_dir ffEt66859784967989_gbr_find_libexec_dir
-	#define gbr_find_etc_dir     ffEt66859784967989_gbr_find_etc_dir
+#define gbr_find_exe         ffEt66859784967989_gbr_find_exe
+#define gbr_find_exe_dir     ffEt66859784967989_gbr_find_exe_dir
+#define gbr_find_prefix      ffEt66859784967989_gbr_find_prefix
+#define gbr_find_bin_dir     ffEt66859784967989_gbr_find_bin_dir
+#define gbr_find_sbin_dir    ffEt66859784967989_gbr_find_sbin_dir
+#define gbr_find_data_dir    ffEt66859784967989_gbr_find_data_dir
+#define gbr_find_lib_dir     ffEt66859784967989_gbr_find_lib_dir
+#define gbr_find_libexec_dir ffEt66859784967989_gbr_find_libexec_dir
+#define gbr_find_etc_dir     ffEt66859784967989_gbr_find_etc_dir
 
 
 #endif

Modified: gnucash/trunk/src/engine/cap-gains.h
===================================================================
--- gnucash/trunk/src/engine/cap-gains.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/cap-gains.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,19 +24,19 @@
 
 /** @addtogroup CapGains Cap Gains
  *  This file implements the various routines to automatically
- *  compute and handle Cap Gains/Losses resulting from trading 
- *  activities.  Some of these routines might have broader 
- *  applicability, for handling depreciation & etc. 
+ *  compute and handle Cap Gains/Losses resulting from trading
+ *  activities.  Some of these routines might have broader
+ *  applicability, for handling depreciation & etc.
  *
  *  This code is under development, and is 'beta': we think we're
  *  mostly done, and we've tested and "things work for us", but there
- *  may still be something missing, and there might still be some 
+ *  may still be something missing, and there might still be some
  *  bugs.
  *
  *  This code does not currently handle tax distinctions, e.g
- *  the different tax treatment that short-term and long-term 
- *  cap gains have. 
- * 
+ *  the different tax treatment that short-term and long-term
+ *  cap gains have.
+ *
  * The computation of (Realized) Gains/Losses is performed automatically by
  * the lot "scrub" routines, using a "double-balance" algorithm. Every
  * split has two numbers associated with it: an "amount", which is the
@@ -46,8 +46,8 @@
  * sold; thus the amount-balance is zero. But since the purchase/sale of
  * the items in the lot typically happen at different prices, there will
  * typically be a gain/loss. This gain/loss is the grand-total value of all
- * the items in the lot (total costs minus total income). 
- * 
+ * the items in the lot (total costs minus total income).
+ *
  * In order to properly account for the gains/losses, an "adjusting split"
  * is added that brings the total gains/losses back to exactly zero (this
  * is the second "balance" of "double balance"). This adjusting split will
@@ -58,17 +58,17 @@
  * and then the sale of some item, the "gains transaction" will record $300
  * in income in an income account. Thus, the change in the bank balance is
  * always reflected by an equal change in income, assuring that the books
- * are balanced. 
+ * are balanced.
  *
- * Notes about auto-recompute:  If the amount in a split is changed, 
+ * Notes about auto-recompute:  If the amount in a split is changed,
  * then the lot has to be recomputed.
- * This has a potential trickle-through effect on all later lots. 
- * Ideally, later lots are dissolved, and recomputed.  However, some 
+ * This has a potential trickle-through effect on all later lots.
+ * Ideally, later lots are dissolved, and recomputed.  However, some
  * lots may have been user-hand-built. These should be left alone.
  *
 ToDo:
  o XXX Need to create a data-integrity scrubber, tht makes sure that
-   the various flags, and pointers & etc. match. 
+   the various flags, and pointers & etc. match.
  *     @{ */
 
 /** @file cap-gains.h
@@ -82,9 +82,9 @@
 
 #include "gnc-engine.h"
 
-/** The xaccSplitGetCapGains() method returns the value of 
- *    capital gains (if any) associated with the indicated 
- *    split. In order for there to be any capital gains, 
+/** The xaccSplitGetCapGains() method returns the value of
+ *    capital gains (if any) associated with the indicated
+ *    split. In order for there to be any capital gains,
  *    several things must hold true about this split:
  *    (1) It must have been involved in trading (for aexample,
  *        by belonging to a stock or trading account)
@@ -95,9 +95,9 @@
  */
 gnc_numeric xaccSplitGetCapGains(Split *);
 
-/** The xaccAccountHasTrades() method checks to see if the 
+/** The xaccAccountHasTrades() method checks to see if the
  *    indicated account is used in the trading of commodities.
- *    A 'trading' account will contain transactions whose 
+ *    A 'trading' account will contain transactions whose
  *    transaction currency is not the same as the account
  *    commodity.  The existance of such transactions is
  *    the very definition of a 'trade'.   This routine returns
@@ -108,24 +108,24 @@
 
 /** The xaccAccountFindEarliestOpenLot() method is a handy
  *   utility routine for finding the earliest open lot in
- *   an account whose lot balance is *opposite* to the 
+ *   an account whose lot balance is *opposite* to the
  *   passed argument 'sign'.   By 'earliest lot', we mean
  *   the lot that has a split with the earliest 'date_posted'.
- *   The sign comparison helps identify a lot that can be 
+ *   The sign comparison helps identify a lot that can be
  *   added to: usually, one wants to add splits to a lot so
  *   that the balance only decreases.
  *   If 'currency' is non-null, then this attempts to find
  *   a lot whose opening transaction has the same currency.
  */
-GNCLot * xaccAccountFindEarliestOpenLot (Account *acc, 
-                                         gnc_numeric sign,
-                                         gnc_commodity *currency);
-GNCLot * xaccAccountFindLatestOpenLot (Account *acc, 
+GNCLot * xaccAccountFindEarliestOpenLot (Account *acc,
+        gnc_numeric sign,
+        gnc_commodity *currency);
+GNCLot * xaccAccountFindLatestOpenLot (Account *acc,
                                        gnc_numeric sign,
                                        gnc_commodity *currency);
 
 /** The xaccAccountGetDefaultGainAccount() routine will return
- *   the account to which realized gains/losses may be posted.  
+ *   the account to which realized gains/losses may be posted.
  *   Because gains may be in different currencies, one must
  *   specify the currency type in which the gains will be posted.
  *   This routine does nothing more than return the value of
@@ -135,10 +135,10 @@
  */
 Account * xaccAccountGetDefaultGainAccount (const Account *acc, const gnc_commodity * currency);
 
-/** The xaccAccountSetDefaultGainAccount() routine can be used 
- *   to set the account to which realized gains/losses will be 
- *   posted by default. This routine does nothing more than set 
- *   value of the "/lot-mgmt/gains-act/XXX" key, where XXX is the 
+/** The xaccAccountSetDefaultGainAccount() routine can be used
+ *   to set the account to which realized gains/losses will be
+ *   posted by default. This routine does nothing more than set
+ *   value of the "/lot-mgmt/gains-act/XXX" key, where XXX is the
  *   unique currency name of the currency of gains account.
  */
 void xaccAccountSetDefaultGainAccount (Account *acc, const Account *gains_acct);
@@ -147,25 +147,25 @@
  *  that records the cap gains for this split.  It returns NULL
  *  if not found.  This routine does nothing more than search for
  *  the split recorded in the KVP key "/gains-split"
- */                                       
+ */
 Split * xaccSplitGetCapGainsSplit (const Split *);
 
 /** The xaccSplitGetGainsSourceSplit() routine returns the split
  *  that is the source of the cap gains in this split.  It returns
- *  NULL if not found.  This routine does nothing more than search 
+ *  NULL if not found.  This routine does nothing more than search
  *  for the split recorded in the KVP key "/gains-source"
- */                                       
+ */
 Split * xaccSplitGetGainsSourceSplit (const Split *);
 
 /** The`xaccSplitAssign() routine will take the indicated
- *  split and, if it doesn't already belong to a lot, it will attempt 
+ *  split and, if it doesn't already belong to a lot, it will attempt
  *  to assign it to an appropriate lot.
  *  If the split already belongs to a Lot, this routine does nothing.
  *  If there are no open Lots, this routine will create a new lot
  *  and place the split into it.  If there's an open lot, and its
  *  big enough to accept the split in it's entirety, then the split
  *  will be placed into that lot.  If the split is too big to fit
- *  into the currently open lot, it will be busted up into two 
+ *  into the currently open lot, it will be busted up into two
  *  (or more) pieces, and each placed into a lot accordingly.
  *  If the split needed to be broken up into several pieces, this
  *  routine will return TRUE, else it returns FALSE.
@@ -174,7 +174,7 @@
  *  directory is used to identify the peers. 'gemini'-style kvp's
  *  are used.
  *
- *  This routine uses the "FIFOPolicy" callback, and thus 
+ *  This routine uses the "FIFOPolicy" callback, and thus
  *  implements a "FIFO" First-In First-Out accounting policy.
  *  This is currently the only implemented policy; adding new
  *  policies should be 'easy'; read the source luke.
@@ -208,7 +208,7 @@
  *  default account is used (and created, if needed).
  *
  *  To compute the gains, the split must belong to a lot. If the
- *  split is the 'opening split', i.e. the earliest split in the 
+ *  split is the 'opening split', i.e. the earliest split in the
  *  lot, then nothing is done, as there are no gains/losses (something
  *  must be bought *and* sold for there to be a gain/loss).
  *

Modified: gnucash/trunk/src/engine/cashobjects.c
===================================================================
--- gnucash/trunk/src/engine/cashobjects.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/cashobjects.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,7 +22,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 #include "cashobjects.h"
 #include "gnc-engine.h"
@@ -37,15 +37,15 @@
 gboolean
 cashobjects_register(void)
 {
-	g_return_val_if_fail(gnc_commodity_table_register(), FALSE);
-	g_return_val_if_fail(xaccAccountRegister(), FALSE);
-	g_return_val_if_fail ( xaccTransRegister(), FALSE);
-	g_return_val_if_fail ( xaccSplitRegister(), FALSE);
-	g_return_val_if_fail ( SXRegister (),       FALSE);
-	g_return_val_if_fail ( gnc_sxtt_register(), FALSE);
-	g_return_val_if_fail(gnc_pricedb_register(),FALSE);
-	g_return_val_if_fail (gnc_budget_register(),FALSE);
-	g_return_val_if_fail ( gnc_lot_register (), FALSE); 
-	return TRUE;
+    g_return_val_if_fail(gnc_commodity_table_register(), FALSE);
+    g_return_val_if_fail(xaccAccountRegister(), FALSE);
+    g_return_val_if_fail ( xaccTransRegister(), FALSE);
+    g_return_val_if_fail ( xaccSplitRegister(), FALSE);
+    g_return_val_if_fail ( SXRegister (),       FALSE);
+    g_return_val_if_fail ( gnc_sxtt_register(), FALSE);
+    g_return_val_if_fail(gnc_pricedb_register(), FALSE);
+    g_return_val_if_fail (gnc_budget_register(), FALSE);
+    g_return_val_if_fail ( gnc_lot_register (), FALSE);
+    return TRUE;
 }
 

Modified: gnucash/trunk/src/engine/cashobjects.h
===================================================================
--- gnucash/trunk/src/engine/cashobjects.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/cashobjects.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,9 +22,9 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
- /* a convenience header for anyone working with the libcashobjects.la library. */
- 
+
+/* a convenience header for anyone working with the libcashobjects.la library. */
+
 #ifndef _CASHOBJECTS_H
 #define _CASHOBJECTS_H
 

Modified: gnucash/trunk/src/engine/glib-helpers.h
===================================================================
--- gnucash/trunk/src/engine/glib-helpers.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/glib-helpers.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,7 +1,7 @@
 /********************************************************************\
  * glib-helpers.h -- gnucash glib helper functions                  *
  * Copyright (C) 2000 Linas Vepstas                                 *
- * Copyright (C) 2006 Chris Shoemaker <c.shoemaker at cox.net>         * 
+ * Copyright (C) 2006 Chris Shoemaker <c.shoemaker at cox.net>         *
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *

Modified: gnucash/trunk/src/engine/gnc-associate-account.h
===================================================================
--- gnucash/trunk/src/engine/gnc-associate-account.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gnc-associate-account.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -2,10 +2,10 @@
  * gnc-associate-account.h : api for associating income and        *
  * expense accounts with stock/mutual fund accounts, for tracking   *
  * dividends, brokerage, and other stock-related expenses and       *
- * income so that they can be reported                              *  
+ * income so that they can be reported                              *
  * Copyright 2000 Gnumatic Incorporated                             *
  * Written by Robert Merkel <rgmerk at mira.net>                       *
- * 
+ *
  * WARNING WARNING WARNING: THIS CODE IS TOTALLY UNTESTED.          *
  * THE ONLY REASON IT'S IN CVS IS FOR SAFEKEEPING                   *
  *                                                                  *
@@ -31,7 +31,7 @@
 #include <Account.h>
 #include <glib.h>
 
-/* 
+/*
  * account_list is a list of account *'s, all of which much be expense
  * accounts
  */
@@ -40,50 +40,52 @@
               GNC_TR_INC__DIVIDEND,
               GNC_TR_INC_LT_CG,
               GNC_TR_INC_ST_CG,
-              GNC_TR_INC_N_CATEGORIES} GNCTrackingIncomeCategory;
+              GNC_TR_INC_N_CATEGORIES
+             } GNCTrackingIncomeCategory;
 
 typedef enum {GNC_TR_EXP_MISC,
               GNC_TR_EXP_COMMISSION,
-              GNC_TR_EXP_N_CATEGORIES} GNCTrackingExpenseCategory;
-             
+              GNC_TR_EXP_N_CATEGORIES
+             } GNCTrackingExpenseCategory;
 
-/* 
+
+/*
  * account_list is a list of account *'s, all of which much be expense
  * accounts.  You can clear associations by setting account_list to NULL
- */         
-               
-void gnc_tracking_associate_income_accounts(Account *stock_account, 
-                                            GNCTrackingIncomeCategory category, 
-                                            AccountList *account_list);
+ */
 
+void gnc_tracking_associate_income_accounts(Account *stock_account,
+        GNCTrackingIncomeCategory category,
+        AccountList *account_list);
 
+
 void gnc_tracking_asssociate_expense_account(Account *stock_account,
-                                             GNCTrackingExpenseCategory category,
-                                             AccountList *account_list);
+        GNCTrackingExpenseCategory category,
+        AccountList *account_list);
 
-/* 
- * returns a list of account *'s, 
- * returns null if no association specified 
+/*
+ * returns a list of account *'s,
+ * returns null if no association specified
  */
 
-AccountList *gnc_tracking_find_expense_accounts(Account *stock_account, 
-                                                    GNCTrackingExpenseCategory category);
+AccountList *gnc_tracking_find_expense_accounts(Account *stock_account,
+        GNCTrackingExpenseCategory category);
 
-AccountList *gnc_tracking_find_income_accounts(Account *stock_account, 
-                                                    GNCTrackingIncomeCategory category);
+AccountList *gnc_tracking_find_income_accounts(Account *stock_account,
+        GNCTrackingIncomeCategory category);
 
 /* for ROI purposes we don't care about categories, these are "grab
 all" for that purpose */
- 
+
 AccountList *gnc_tracking_find_all_expense_accounts(Account *stock_account);
 
 AccountList *gnc_tracking_find_all_income_accounts(Account *stock_account);
 
 
-/* 
+/*
  * reverse lookup - obviously returns a stock account (or NULL if none
  * associated), and argument must be an income or expense account
- */ 
+ */
 Account *gnc_tracking_find_stock_account(Account *inc_or_expense_acc);
 
 void gnc_tracking_dissociate_account(Account *inc_or_expense_account);

Modified: gnucash/trunk/src/engine/gnc-budget.h
===================================================================
--- gnucash/trunk/src/engine/gnc-budget.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gnc-budget.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,7 +22,7 @@
  *                                                                  *
 \********************************************************************/
 
-/** @addtogroup budget 
+/** @addtogroup budget
  @{
 */
 /** @file gnc-budget.h
@@ -95,7 +95,8 @@
 /**
  * Creates and initializes a Budget.
  **/
-/*@ dependent @*/ GncBudget *gnc_budget_new(QofBook *book);
+/*@ dependent @*/
+GncBudget *gnc_budget_new(QofBook *book);
 
 /** Deletes the given budget object.*/
 void gnc_budget_destroy(GncBudget* budget);
@@ -103,24 +104,28 @@
 void gnc_budget_begin_edit(GncBudget *bgt);
 void gnc_budget_commit_edit(GncBudget *bgt);
 
-/*@ dependent @*/ const GUID* gnc_budget_get_guid(GncBudget* budget);
+/*@ dependent @*/
+const GUID* gnc_budget_get_guid(GncBudget* budget);
 #define gnc_budget_return_guid(X) \
   (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
 
 /** Set/Get the name of the Budget */
 void gnc_budget_set_name(GncBudget* budget, const gchar* name);
-/*@ dependent @*/ const gchar* gnc_budget_get_name(GncBudget* budget);
+/*@ dependent @*/
+const gchar* gnc_budget_get_name(GncBudget* budget);
 
 /** Set/Get the description of the Budget */
 void gnc_budget_set_description(GncBudget* budget, const gchar* description);
-/*@ dependent @*/ const gchar* gnc_budget_get_description(GncBudget* budget);
+/*@ dependent @*/
+const gchar* gnc_budget_get_description(GncBudget* budget);
 
 /** Set/Get the number of periods in the Budget */
 void gnc_budget_set_num_periods(GncBudget* budget, guint num_periods);
 guint gnc_budget_get_num_periods(GncBudget* budget);
 
 void gnc_budget_set_recurrence(GncBudget *budget, const Recurrence *r);
-/*@ dependent @*/ const Recurrence * gnc_budget_get_recurrence(GncBudget *budget);
+/*@ dependent @*/
+const Recurrence * gnc_budget_get_recurrence(GncBudget *budget);
 
 /** Get the starting date of the Budget period*/
 Timespec gnc_budget_get_period_start_date(GncBudget* budget, guint period_num);
@@ -149,7 +154,8 @@
 GncBudget* gnc_budget_get_default(QofBook *book);
 
 /* Get the budget associated with the given GUID from the given book. */
-/*@ dependent @*/ GncBudget* gnc_budget_lookup (const GUID *guid, QofBook *book);
+/*@ dependent @*/
+GncBudget* gnc_budget_lookup (const GUID *guid, QofBook *book);
 #define  gnc_budget_lookup_direct(g,b) gnc_budget_lookup(&(g),(b))
 
 #endif // __BUDGET_H__

Modified: gnucash/trunk/src/engine/gnc-commodity.h
===================================================================
--- gnucash/trunk/src/engine/gnc-commodity.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gnc-commodity.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -26,19 +26,19 @@
     A commodity is something of value that is easily tradeable or
     sellable; for example, currencies, stocks, bonds, grain,
     copper, and oil are all commodities.  This file provides
-    an API for defining a commodities, and for working with 
+    an API for defining a commodities, and for working with
     collections of commodities.  All GnuCash financial transactions
     must identify the commodity that is being traded.
 
     @warning The system used here does not follow the object
     handling and identification system (GUID's, Entities, etc.)
     that the other parts of GnuCash use.  The API really should be
-    ported over.  This would allow us to get rid of the 
-    commodity table routines defined below. 
+    ported over.  This would allow us to get rid of the
+    commodity table routines defined below.
 
     @{ */
 /** @file gnc-commodity.h
- *  @brief Commodity handling public routines   
+ *  @brief Commodity handling public routines
  *  @author Copyright (C) 2000 Bill Gribble
  *  @author Copyright (C) 2001 Linas Vepstas <linas at linas.org>
  */
@@ -85,7 +85,7 @@
 
 /** The commodity namespace definitions are used to tag a commodity by
  *  its type, or a stocks by the exchange where it is traded.
- *  
+ *
  *  The LEGACY name is only used by the file i/o routines, and is
  *  converted to another commodity namespace before it is seen by the
  *  rest of the system.  The ISO namespace represents currencies.
@@ -107,7 +107,7 @@
 
 typedef GList CommodityList;
 
-/** @name Commodity Quote Source functions 
+/** @name Commodity Quote Source functions
  @{
 */
 
@@ -117,19 +117,19 @@
  */
 typedef enum
 {
-  SOURCE_SINGLE = 0,	/**< This quote source pulls from a single
+    SOURCE_SINGLE = 0,	/**< This quote source pulls from a single
 			 *   specific web site.  For example, the
 			 *   yahoo_australia source only pulls from
 			 *   the yahoo web site. */
-  SOURCE_MULTI,		/**< This quote source may pull from multiple
+    SOURCE_MULTI,		/**< This quote source may pull from multiple
 			 *   web sites.  For example, the australia
 			 *   source may pull from ASX, yahoo, etc. */
-  SOURCE_UNKNOWN,	/**< This is a locally installed quote source
+    SOURCE_UNKNOWN,	/**< This is a locally installed quote source
 			 *   that gnucash knows nothing about. May
 			 *   pull from single or multiple
 			 *   locations. */
-  SOURCE_MAX,
-  SOURCE_CURRENCY = SOURCE_MAX, /**< The special currency quote source. */
+    SOURCE_MAX,
+    SOURCE_CURRENCY = SOURCE_MAX, /**< The special currency quote source. */
 } QuoteSourceType;
 
 /** This function indicates whether or not the Finance::Quote module
@@ -180,7 +180,8 @@
  *  @return A pointer to the price quote source that has the specified
  *  internal name.
  */
-/*@ dependent @*/ gnc_quote_source *gnc_quote_source_lookup_by_internal(const char * internal_name);
+/*@ dependent @*/
+gnc_quote_source *gnc_quote_source_lookup_by_internal(const char * internal_name);
 
 /** Given the type/index of a quote source, find the data structure
  *  identified by this pair.
@@ -230,7 +231,8 @@
  *
  *  @return The user friendly name.
  */
-/*@ dependent @*/ const char *gnc_quote_source_get_user_name (const gnc_quote_source *source);
+/*@ dependent @*/
+const char *gnc_quote_source_get_user_name (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the internal name
  *  of this quote source.  This is the name used by both gnucash and
@@ -240,7 +242,8 @@
  *
  *  @return The internal name.
  */
-/*@ dependent @*/ const char *gnc_quote_source_get_internal_name (const gnc_quote_source *source);
+/*@ dependent @*/
+const char *gnc_quote_source_get_internal_name (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the internal name
  *  of this quote source.  This is the name used by both gnucash and
@@ -258,8 +261,8 @@
 /** @} */
 
 
-/** @name Commodity Creation 
- @{ 
+/** @name Commodity Creation
+ @{
 */
 
 /** Create a new commodity. This function allocates a new commodity
@@ -294,8 +297,9 @@
  *
  *  @return A pointer to the new commodity.
  */
-/*@ dependent @*/ gnc_commodity * gnc_commodity_new(QofBook *book,
-				  /*@ null @*/ const char * fullname, 
+/*@ dependent @*/
+gnc_commodity * gnc_commodity_new(QofBook *book,
+                                  /*@ null @*/ const char * fullname,
                                   /*@ null @*/ const char * namespace,
                                   /*@ null @*/ const char * mnemonic,
                                   /*@ null @*/ const char * cusip,
@@ -451,8 +455,10 @@
  *
  *  @return A pointer to the price quote source for this commodity.
  */
-/*@ dependent @*/ gnc_quote_source* gnc_commodity_get_quote_source(const gnc_commodity *cm);
-/*@ dependent @*/ gnc_quote_source* gnc_commodity_get_default_quote_source(const gnc_commodity *cm);
+/*@ dependent @*/
+gnc_quote_source* gnc_commodity_get_quote_source(const gnc_commodity *cm);
+/*@ dependent @*/
+gnc_quote_source* gnc_commodity_get_default_quote_source(const gnc_commodity *cm);
 
 /** Retrieve the automatic price quote timezone for the specified
  *  commodity.  This will be a pointer to a null terminated string of
@@ -615,7 +621,7 @@
 /** @} */
 
 
-/** @name Commodity Comparison 
+/** @name Commodity Comparison
  @{
 */
 
@@ -650,7 +656,7 @@
 /** @} */
 
 
-/** @name Currency Checks 
+/** @name Currency Checks
  @{
 */
 
@@ -681,13 +687,14 @@
 
 
 /* =============================================================== */
-/** @name Commodity Table 
+/** @name Commodity Table
 @{
 */
 
 /** Returns the commodity table assoicated with a book.
  */
-/*@ dependent @*/ gnc_commodity_table * gnc_commodity_table_get_table(QofBook *book);
+/*@ dependent @*/
+gnc_commodity_table * gnc_commodity_table_get_table(QofBook *book);
 
 /* XXX backwards compat function; remove me someday */
 #define gnc_book_get_commodity_table gnc_commodity_table_get_table
@@ -705,17 +712,18 @@
 /** @name Commodity Table Lookup functions
 @{
 */
-gnc_commodity * gnc_commodity_table_lookup(const gnc_commodity_table * table, 
-                                           const char * namespace, 
-                                           const char * mnemonic);
+gnc_commodity * gnc_commodity_table_lookup(const gnc_commodity_table * table,
+        const char * namespace,
+        const char * mnemonic);
 gnc_commodity *
 gnc_commodity_table_lookup_unique(const gnc_commodity_table *table,
                                   const char * unique_name);
 gnc_commodity * gnc_commodity_table_find_full(const gnc_commodity_table * t,
-                                              const char * namespace,
-                                              const char * fullname);
+        const char * namespace,
+        const char * fullname);
 
-/*@ dependent @*/ gnc_commodity * gnc_commodity_find_commodity_by_guid(const GUID *guid, QofBook *book);
+/*@ dependent @*/
+gnc_commodity * gnc_commodity_find_commodity_by_guid(const GUID *guid, QofBook *book);
 gnc_commodity_namespace * gnc_commodity_find_namespace_by_guid(const GUID *guid, QofBook *book);
 
 /** @} */
@@ -730,7 +738,7 @@
  *  nothing), or another entries has the same namespace and mnemonic
  *  (updates the existing entry).
  *
- *  @param table A pointer to the commodity table 
+ *  @param table A pointer to the commodity table
  *
  *  @param comm A pointer to the commodity to add.
  *
@@ -739,17 +747,18 @@
  *  @note The commodity pointer passed to this function should not be
  *  used after its return, as it may have been destroyed.  Use the
  *  return value which is guaranteed to be valid. */
-/*@ dependent @*/ gnc_commodity * gnc_commodity_table_insert(gnc_commodity_table * table,
-                                           gnc_commodity * comm);
+/*@ dependent @*/
+gnc_commodity * gnc_commodity_table_insert(gnc_commodity_table * table,
+        gnc_commodity * comm);
 
 /** Remove a commodity from the commodity table. If the commodity to
  *  remove doesn't exist, nothing happens.
  *
- *  @param table A pointer to the commodity table 
+ *  @param table A pointer to the commodity table
  *
  *  @param comm A pointer to the commodity to remove. */
 void gnc_commodity_table_remove(gnc_commodity_table * table,
-				gnc_commodity * comm);
+                                gnc_commodity * comm);
 
 /** Add all the standard namespaces and currencies to the commodity
  *  table.  This routine creates the namespaces for the NYSE, NASDAQ,
@@ -794,14 +803,14 @@
 
 /** Test to see if the indicated namespace exits in the commodity table.
  *
- *  @param table A pointer to the commodity table 
+ *  @param table A pointer to the commodity table
  *
  *  @param namespace The new namespace to check.
  *
  *  @return 1 if the namespace exists. 0 if it doesn't exist, or the
  *  routine was passed a bad argument. */
 int gnc_commodity_table_has_namespace(const gnc_commodity_table * table,
-				      const char * namespace);
+                                      const char * namespace);
 
 /** Return a list of all namespaces in the commodity table.  This
  *  returns both system and user defined namespaces.
@@ -824,7 +833,7 @@
 /** This function adds a new string to the list of commodity namespaces.
  *  If the new namespace already exists, nothing happens.
  *
- *  @param table A pointer to the commodity table 
+ *  @param table A pointer to the commodity table
  *
  *  @param namespace The new namespace to be added.
  *
@@ -832,31 +841,31 @@
  *
  *  @return A pointer to the newly created namespace. */
 gnc_commodity_namespace * gnc_commodity_table_add_namespace(gnc_commodity_table * table,
-							    const char * namespace,
-							    QofBook *book);
+        const char * namespace,
+        QofBook *book);
 
 /** This function finds a commodity namespace in the set of existing commodity namespaces.
  *
- *  @param table A pointer to the commodity table 
+ *  @param table A pointer to the commodity table
  *
  *  @param namespace The new namespace to be added.
  *
  *  @return The a pointer to the namespace found, or NULL if the
  *  namespace doesn't exist. */
 gnc_commodity_namespace * gnc_commodity_table_find_namespace(const gnc_commodity_table * table,
-							     const char * namespace);
+        const char * namespace);
 
 /** This function deletes a string from the list of commodity namespaces.
  *  If the namespace does not exist, nothing happens.
  *
- *  @param table A pointer to the commodity table 
+ *  @param table A pointer to the commodity table
  *
  *  @param namespace The namespace to be deleted.
  *
  *  @note This routine will destroy any commodities that exist as part
  *  of this namespace.  Use it carefully. */
 void      gnc_commodity_table_delete_namespace(gnc_commodity_table * table,
-                                               const char * namespace);
+        const char * namespace);
 /** @} */
 /* ---------------------------------------------------------- */
 /** @name Commodity Table Accessor functions
@@ -865,7 +874,7 @@
 
 /** Returns the number of commodities in the commodity table.
  *
- *  @param tbl A pointer to the commodity table 
+ *  @param tbl A pointer to the commodity table
  *
  *  @return The number of commodities in the table. 0 if there are no
  *  commodities, or the routine was passed a bad argument. */
@@ -874,7 +883,7 @@
 /** Return a list of all commodities in the commodity table that are
  *  in the given namespace.
  *
- *  @param table A pointer to the commodity table 
+ *  @param table A pointer to the commodity table
  *
  *  @param namespace A string indicating which commodities should be
  *  returned. It is a required argument.
@@ -896,7 +905,7 @@
  *  regular expression are checked.  If none was given, all
  *  commodities are checked.
  *
- *  @param table A pointer to the commodity table 
+ *  @param table A pointer to the commodity table
  *
  *  @return A pointer to a list of commodities.  NULL if invalid
  *  arguments were supplied or if there no commodities are flagged for
@@ -910,16 +919,16 @@
  *  This table walk returns whenever the end of the table is reached,
  *  or the function returns FALSE.
  *
- *  @param table A pointer to the commodity table 
+ *  @param table A pointer to the commodity table
  *
  *  @param f The function to call for each commodity.
  *
  *  @param user_data A pointer that is passed into the function
  *  unchanged by the table walk routine. */
 gboolean gnc_commodity_table_foreach_commodity(const gnc_commodity_table * table,
-                                       gboolean (*f)(gnc_commodity *cm,
-                                                     gpointer user_data),
-                                       gpointer user_data);
+        gboolean (*f)(gnc_commodity *cm,
+                      gpointer user_data),
+        gpointer user_data);
 /** @} */
 
 
@@ -936,7 +945,7 @@
 void          gnc_commodity_table_destroy(gnc_commodity_table * table);
 
 /** Given the commodity 'from', this routine will find and return the
- *   equivalent commodity (commodity with the same 'unique name') in 
+ *   equivalent commodity (commodity with the same 'unique name') in
  *   the indicated book.  This routine is primarily useful for setting
  *   up clones of things across multiple books.
  */
@@ -950,7 +959,7 @@
 
 void gnc_commodity_begin_edit (gnc_commodity *cm);
 void gnc_commodity_commit_edit (gnc_commodity *cm);
-		  
+
 /** @} */
 
 /** @name Monetary value, commodity identity and numeric value
@@ -958,55 +967,62 @@
   */
 struct _gnc_monetary
 {
-  gnc_commodity *commodity;
-  gnc_numeric value;
+    gnc_commodity *commodity;
+    gnc_numeric value;
 };
 
 typedef struct _gnc_monetary gnc_monetary;
 
 /* A list of monetary values.  This could be a hash table, but as currently
-* used it rarely contains more than one or two different commodities so 
-* it doesn't seem worth the trouble. 
+* used it rarely contains more than one or two different commodities so
+* it doesn't seem worth the trouble.
 */
 typedef GList MonetaryList;
 
 /** @name Constructors
 @{
   Make a gnc_monetary from a gnc_commodity and gnc_numeric */
-  static inline
-  gnc_monetary gnc_monetary_create(gnc_commodity *commod, gnc_numeric val) {
+static inline
+gnc_monetary gnc_monetary_create(gnc_commodity *commod, gnc_numeric val)
+{
     gnc_monetary out;
     out.commodity = commod;
     out.value = val;
     return out;
-  }
-  /** @} */
-  
-  /** @name Accessors
-  @{
-    */
-  static inline
-  gnc_commodity * gnc_monetary_commodity(gnc_monetary a) { return a.commodity; }
-  
-  static inline
-  gnc_numeric gnc_monetary_value(gnc_monetary a) { return a.value; }
-  /** @} */
-  
-  /** @name Manipulate MonetaryList lists
+}
+/** @} */
+
+/** @name Accessors
 @{
   */
+static inline
+gnc_commodity * gnc_monetary_commodity(gnc_monetary a)
+{
+    return a.commodity;
+}
 
+static inline
+gnc_numeric gnc_monetary_value(gnc_monetary a)
+{
+    return a.value;
+}
+/** @} */
+
+/** @name Manipulate MonetaryList lists
+@{
+*/
+
 /** Add a gnc_monetary to the list */
 MonetaryList *gnc_monetary_list_add_monetary(MonetaryList *list, gnc_monetary mon);
 
 /** Add something to the list given a commodity and value */
 static inline
-MonetaryList *gnc_monetary_list_add_value(MonetaryList *list, 
-                                          gnc_commodity *commod, 
-                                          gnc_numeric value)
+MonetaryList *gnc_monetary_list_add_value(MonetaryList *list,
+        gnc_commodity *commod,
+        gnc_numeric value)
 {
-  return gnc_monetary_list_add_monetary(list,
-                                        gnc_monetary_create(commod, value));
+    return gnc_monetary_list_add_monetary(list,
+                                          gnc_monetary_create(commod, value));
 }
 
 /** Delete all the zero-value entries from a list */

Modified: gnucash/trunk/src/engine/gnc-engine.h
===================================================================
--- gnucash/trunk/src/engine/gnc-engine.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gnc-engine.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,10 +22,10 @@
 /** @addtogroup Engine GnuCash Engine: Core, Non-GUI Accounting Functions
     The GnuCash Engine provides a set of objects and classes that
     encapsulate typical financial accounting concepts.  The GnuCash
-    GUI is expected to manipulate these objects through the provided 
+    GUI is expected to manipulate these objects through the provided
     engine API.
     @{ */
-/** @file gnc-engine.h 
+/** @file gnc-engine.h
     @brief All type declarations for the whole Gnucash engine
     @author Copyright (C) 1997 Robin D. Clark
     @author Copyright (C) 2000 Bill Gribble <grib at billgribble.com>
@@ -68,7 +68,7 @@
 //@}
 
 /** @brief IDENTIFIERS
- *  GUID Identifiers can be used to reference Accounts, Transactions, 
+ *  GUID Identifiers can be used to reference Accounts, Transactions,
  *  Splits and other objects. These Gnucash types are referred to as Gnucash
  *  entities. GUID Identifiers are globally-unique and permanent, i.e., once
  *  an entity has been assigned an identifier, it retains that same
@@ -81,7 +81,7 @@
  *  to any entity. An identifier with any other type may refer to an
  *  actual entity, but that is not guaranteed. If an id does refer to
  *  an entity, the type of the entity will match the type of the
- *  identifier. 
+ *  identifier.
  */
 
 #define GNC_ID_NONE           QOF_ID_NONE
@@ -124,14 +124,14 @@
 */
 
 
-/** @brief Account in Gnucash. 
+/** @brief Account in Gnucash.
  * This is the typename for an account. The actual structure is
  * defined in the private header AccountP.h, but no one outside the
  * engine should include that file. Instead, access that data only
  * through the functions in Account.h .*/
 typedef struct account_s             Account;
 
-/** @brief Split in Gnucash. 
+/** @brief Split in Gnucash.
  * A "split" is more commonly refered to as a "entry" in a
  * "transaction". Each split belongs to one Account and one
  * Transaction. The split is one out of several parts a Transaction is
@@ -143,7 +143,7 @@
  * the functions in Transaction.h .*/
 typedef struct split_s               Split;
 
-/** @brief Transaction in Gnucash.  
+/** @brief Transaction in Gnucash.
  * A Transaction is a piece of business done; the transfer of money
  * from one account to one or more other accounts. Each Transaction is
  * divided into one or more Splits (usually two).
@@ -154,7 +154,7 @@
  * through the functions in Transaction.h .*/
 typedef struct transaction_s         Transaction;
 
-/** @brief An article that is bought and sold. 
+/** @brief An article that is bought and sold.
  * A Commodity is the most general term of what an account keeps track
  * of. Usually this is a monetary currency, but it can also be a stock
  * share or even a precious metal. Every account keeps track of
@@ -177,8 +177,8 @@
 typedef struct gnc_commodity_table_s gnc_commodity_table;
 
 /** @brief Identifies that something sold at one time was bought at another.
- * A GNCLot provides a way of tracking physical items as they are 
- * bought and sold in different transactions.  By identifying 
+ * A GNCLot provides a way of tracking physical items as they are
+ * bought and sold in different transactions.  By identifying
  * the individual, underlying physical objects, it provides the
  * needed framework for implementing depreciation, capital gains,
  * inventory control and invoices.
@@ -189,7 +189,7 @@
 
 /** @brief Price of commodity on a given date.
  * A GNCPrice encapsulates price information: the cost of a commodity
- * expressed as a currency, on a given date.  It also holds info about 
+ * expressed as a currency, on a given date.  It also holds info about
  * the provenance of the price: where it came from, its general validity.
  */
 typedef struct gnc_price_s           GNCPrice;
@@ -241,7 +241,7 @@
 /** enable default log modules */
 void gnc_log_default(void);
 
-/** Pass a function pointer to gnc_engine_add_init_hook and 
+/** Pass a function pointer to gnc_engine_add_init_hook and
  * it will be called during the evaluation of gnc_engine_init */
 void gnc_engine_add_init_hook(gnc_engine_init_hook_t hook);
 

Modified: gnucash/trunk/src/engine/gnc-event.h
===================================================================
--- gnucash/trunk/src/engine/gnc-event.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gnc-event.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -26,7 +26,8 @@
 #include <glib.h>
 #include <qof.h>
 
-typedef struct {
+typedef struct
+{
     gpointer node;
     gint idx;
 } GncEventData;

Modified: gnucash/trunk/src/engine/gnc-lot-p.h
===================================================================
--- gnucash/trunk/src/engine/gnc-lot-p.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gnc-lot-p.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -42,27 +42,27 @@
 
 struct gnc_lot_struct
 {
-  QofInstance inst;
+    QofInstance inst;
 
-  /* Account to which this lot applies.  All splits in the lot must
-   * belong to this account.
-   */
-  Account * account;
+    /* Account to which this lot applies.  All splits in the lot must
+     * belong to this account.
+     */
+    Account * account;
 
-  /* List of splits that belong to this lot. */
-  SplitList *splits;
+    /* List of splits that belong to this lot. */
+    SplitList *splits;
 
-  /* Handy cached value to indicate if lot is closed. */
-  /* If value is negative, then the cache is invalid. */
-  signed char is_closed;
+    /* Handy cached value to indicate if lot is closed. */
+    /* If value is negative, then the cache is invalid. */
+    signed char is_closed;
 
-  /* traversal marker, handy for preventing recursion */
-  unsigned char marker;
+    /* traversal marker, handy for preventing recursion */
+    unsigned char marker;
 };
 
 struct _GncLotClass
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 };
 
 #define gnc_lot_set_guid(L,G)  qof_instance_set_guid(QOF_INSTANCE(L),&(G))

Modified: gnucash/trunk/src/engine/gnc-lot.h
===================================================================
--- gnucash/trunk/src/engine/gnc-lot.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gnc-lot.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -25,8 +25,8 @@
  * is the same one as the item 'sold' in a different transaction.
  * Lots are used to make this association.  One Lot holds all of the
  * splits that involve the same item.   A lot is typically formed when
- * the item is bought, and is closed when the item is sold out. 
- * A lot need not be a single item, it can be a quantity of the same 
+ * the item is bought, and is closed when the item is sold out.
+ * A lot need not be a single item, it can be a quantity of the same
  * thing e.g. 500 gallons of paint (sold off a few gallons at a time).
  *
  * Lots are required to correctly implement invoices, inventory,
@@ -36,9 +36,9 @@
  * A lot is "closed" when the number of items in the lot has gone to zero.
  * It is very easy to compute the gains/losses for a closed lot: it is the
  * sum-total of the values of the items put into/taken out of the lot.
- * (Realized) Gains on still-open lots can be computed by pro-rating the 
- * purchase prices. 
- * 
+ * (Realized) Gains on still-open lots can be computed by pro-rating the
+ * purchase prices.
+ *
  * Lots are nothing more than a collection or grouping of splits in an
  * account. All of the splits in a lot must belong to the same account;
  * there's no mix-n-match.  Thus, in this sense, a lot belongs to an
@@ -46,12 +46,12 @@
  *
  * Lots have an implicit "opening date": the date of the earliest split in
  * the lot. The "close date" is the date of the split that brought the lot
- * item balance down to zero. 
+ * item balance down to zero.
  *
  @{ */
 
 /** @file gnc-lot.h
- * 
+ *
  * @author Created by Linas Vepstas May 2002
  * @author Copyright (c) 2002,2003 Linas Vepstas <linas at linas.org>
  */
@@ -79,11 +79,13 @@
 GType gnc_lot_get_type(void);
 
 
-/*@ dependent @*/ GNCLot * gnc_lot_new (QofBook *);
+/*@ dependent @*/
+GNCLot * gnc_lot_new (QofBook *);
 void gnc_lot_destroy (GNCLot *);
 
-/*@ dependent @*/ GNCLot * gnc_lot_lookup (const GUID *guid, QofBook *book);
-QofBook * gnc_lot_get_book (GNCLot *);		  
+/*@ dependent @*/
+GNCLot * gnc_lot_lookup (const GUID *guid, QofBook *book);
+QofBook * gnc_lot_get_book (GNCLot *);
 
 void gnc_lot_begin_edit (GNCLot *lot);
 void gnc_lot_commit_edit (GNCLot *lot);
@@ -92,7 +94,7 @@
  *    that *all* splits in a lot must also be in the same account.
  *    Note that this routine adds the split unconditionally, with
  *    no regard for the accounting policy.  To enforce a particular
- *    accounting policy, use the xaccSplitAssignToLot() routine 
+ *    accounting policy, use the xaccSplitAssignToLot() routine
  *    instead.
  */
 void gnc_lot_add_split (GNCLot *, Split *);
@@ -108,12 +110,13 @@
 SplitList * gnc_lot_get_split_list (const GNCLot *);
 gint gnc_lot_count_splits (const GNCLot *);
 
-/** The gnc_lot_get_account() routine returns the account with which 
+/** The gnc_lot_get_account() routine returns the account with which
  *    this lot is associated. */
-/*@ dependent @*/ Account * gnc_lot_get_account (const GNCLot *);
+/*@ dependent @*/
+Account * gnc_lot_get_account (const GNCLot *);
 
-/** The gnc_lot_get_balance() routine returns the balance of the lot. 
- *    The commodity in which this balance is expressed is the commodity 
+/** The gnc_lot_get_balance() routine returns the balance of the lot.
+ *    The commodity in which this balance is expressed is the commodity
  *    of the account. */
 gnc_numeric gnc_lot_get_balance (GNCLot *);
 
@@ -124,10 +127,10 @@
 void gnc_lot_get_balance_before (const GNCLot *, const Split *,
                                  gnc_numeric *, gnc_numeric *);
 
-/** The gnc_lot_is_closed() routine returns a boolean flag: is this 
- *    lot closed?  A lot is closed if its balance is zero.  This 
+/** The gnc_lot_is_closed() routine returns a boolean flag: is this
+ *    lot closed?  A lot is closed if its balance is zero.  This
  *    routine is faster than using gnc_lot_get_balance() because
- *    once the balance goes to zero, this fact is cached.  
+ *    once the balance goes to zero, this fact is cached.
  */
 gboolean gnc_lot_is_closed (GNCLot *);
 
@@ -152,7 +155,7 @@
 void gnc_lot_set_notes (GNCLot *, const char *);
 
 /** Every lot has a place to hang kvp data.  This routine returns that
- *     place. 
+ *     place.
  * */
 KvpFrame * gnc_lot_get_slots (const GNCLot *);
 

Modified: gnucash/trunk/src/engine/gnc-pricedb-p.h
===================================================================
--- gnucash/trunk/src/engine/gnc-pricedb-p.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gnc-pricedb-p.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -32,72 +32,73 @@
 
 struct gnc_price_s
 {
-  /* 'public' data fields */
-  QofInstance inst;              /* globally unique object identifier */
+    /* 'public' data fields */
+    QofInstance inst;              /* globally unique object identifier */
 
-  GNCPriceDB *db;
-  gnc_commodity *commodity;
-  gnc_commodity *currency;
-  Timespec tmspec;
-  char *source;
-  char *type;
-  gnc_numeric value;
+    GNCPriceDB *db;
+    gnc_commodity *commodity;
+    gnc_commodity *currency;
+    Timespec tmspec;
+    char *source;
+    char *type;
+    gnc_numeric value;
 
-  /* 'private' object management fields */
-  guint32  refcount;             /* garbage collection reference count */
+    /* 'private' object management fields */
+    guint32  refcount;             /* garbage collection reference count */
 };
 
 struct _GncPriceClass
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 };
 
 struct gnc_price_db_s
 {
-  QofInstance inst;              /* globally unique object identifier */
-  GHashTable *commodity_hash;
-  gboolean bulk_update;		 /* TRUE while reading XML file, etc. */
+    QofInstance inst;              /* globally unique object identifier */
+    GHashTable *commodity_hash;
+    gboolean bulk_update;		 /* TRUE while reading XML file, etc. */
 };
 
 struct _GncPriceDBClass
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 };
 
 /* These structs define the kind of price lookup being done
  * so that it can be passed to the backend.  This is a rather
  * cheesy, low-brow interface.  It could stand improvement.
  */
-typedef enum {
-  LOOKUP_LATEST = 1,
-  LOOKUP_ALL,
-  LOOKUP_AT_TIME,
-  LOOKUP_NEAREST_IN_TIME,
-  LOOKUP_LATEST_BEFORE,
-  LOOKUP_EARLIEST_AFTER
+typedef enum
+{
+    LOOKUP_LATEST = 1,
+    LOOKUP_ALL,
+    LOOKUP_AT_TIME,
+    LOOKUP_NEAREST_IN_TIME,
+    LOOKUP_LATEST_BEFORE,
+    LOOKUP_EARLIEST_AFTER
 } PriceLookupType;
 
 
 struct gnc_price_lookup_s
 {
-  PriceLookupType type;
-  GNCPriceDB     *prdb;
-  const gnc_commodity  *commodity;
-  const gnc_commodity  *currency;
-  Timespec        date;
+    PriceLookupType type;
+    GNCPriceDB     *prdb;
+    const gnc_commodity  *commodity;
+    const gnc_commodity  *currency;
+    Timespec        date;
 };
 
 
 typedef struct gnc_price_lookup_helper_s
 {
-  GList    **return_list;
-  Timespec time;
+    GList    **return_list;
+    Timespec time;
 } GNCPriceLookupHelper;
 
 #define  gnc_price_set_guid(P,G)  qof_instance_set_guid(QOF_INSTANCE(P),(G))
 void     gnc_pricedb_substitute_commodity(GNCPriceDB *db,
-                                          gnc_commodity *old_c,
-                                          gnc_commodity *new_c);
+        gnc_commodity *old_c,
+        gnc_commodity *new_c);
 
 /** register the pricedb object with the gncObject system */
 gboolean gnc_pricedb_register (void);

Modified: gnucash/trunk/src/engine/gnc-pricedb.h
===================================================================
--- gnucash/trunk/src/engine/gnc-pricedb.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gnc-pricedb.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -100,7 +100,7 @@
     2001-02-03.
 
     \par Fields:
-    
+
     - commodity: the item being priced.
     - currency: the denomination of the value of the item being priced.
     - value: the value of the item being priced.
@@ -162,7 +162,8 @@
 
 /** gnc_price_create - returns a newly allocated and initialized price
    with a reference count of 1. */
-/*@ dependent @*/ GNCPrice *gnc_price_create(QofBook *book);
+/*@ dependent @*/
+GNCPrice *gnc_price_create(QofBook *book);
 
 /** gnc_price_clone - returns a newly allocated price that's a
    content-wise duplicate of the given price, p.  The returned clone
@@ -188,11 +189,11 @@
  * All of the setters store copies of the data
  * given, with the exception of the commodity field which just stores
  * the pointer given.  It is assumed that commodities are a global
- * resource and are pointer unique. 
+ * resource and are pointer unique.
  *
  * Invocations of the setters should be wrapped with calls to
  * gnc_price_begin_edit() and commit_edit().  The begin/commit
- * calls help ensure that the local price db is synchronized with 
+ * calls help ensure that the local price db is synchronized with
  * the backend.
    @{ */
 void gnc_price_begin_edit (GNCPrice *p);
@@ -213,8 +214,10 @@
     @{ */
 
 GNCPrice *      gnc_price_lookup (const GUID *guid, QofBook *book);
-/*@ dependent @*/ gnc_commodity * gnc_price_get_commodity(const GNCPrice *p);
-/*@ dependent @*/ gnc_commodity * gnc_price_get_currency(const GNCPrice *p);
+/*@ dependent @*/
+gnc_commodity * gnc_price_get_commodity(const GNCPrice *p);
+/*@ dependent @*/
+gnc_commodity * gnc_price_get_currency(const GNCPrice *p);
 Timespec        gnc_price_get_time(const GNCPrice *p);
 const char *    gnc_price_get_source(const GNCPrice *p);
 const char *    gnc_price_get_typestr(const GNCPrice *p);
@@ -308,7 +311,7 @@
 gboolean     gnc_pricedb_remove_price(GNCPriceDB *db, GNCPrice *p);
 
 gboolean     gnc_pricedb_remove_old_prices(GNCPriceDB *db, Timespec cutoff,
-					   const gboolean delete_user, gboolean delete_last);
+        const gboolean delete_user, gboolean delete_last);
 
 /** gnc_pricedb_lookup_latest - find the most recent price for the
      given commodity in the given currency.  Returns NULL on
@@ -321,7 +324,7 @@
      for the given commodity in any available currency. Prices will be
      returned as a GNCPrice list (see above). */
 PriceList * gnc_pricedb_lookup_latest_any_currency(GNCPriceDB *db,
-                                                 const gnc_commodity *commodity);
+        const gnc_commodity *commodity);
 
 /** gnc_pricedb_has_prices - return an indication of whether or not
     there are any prices for a given commodity in the given currency.
@@ -334,92 +337,92 @@
      commodity in the given currency.  Returns NULL on failure.  The
      result is a GNCPrice list (see above).  */
 PriceList * gnc_pricedb_get_prices(GNCPriceDB *db,
-                                 const gnc_commodity *commodity,
-                                 const gnc_commodity *currency);
+                                   const gnc_commodity *commodity,
+                                   const gnc_commodity *currency);
 
 /** gnc_pricedb_lookup_at_time - return all prices that match the given
      commodity, currency, and timespec.  Prices will be returned as a
      GNCPrice list (see above). */
 PriceList * gnc_pricedb_lookup_at_time(GNCPriceDB *db,
-                                     const gnc_commodity *commodity,
-                                     const gnc_commodity *currency,
-                                     Timespec t);
+                                       const gnc_commodity *commodity,
+                                       const gnc_commodity *currency,
+                                       Timespec t);
 
 /** gnc_pricedb_lookup_at_time_any_currency - return all prices that match the
      given commodity and timespec in any available currency.  Prices will be
      returned as a GNCPrice list (see above). */
 PriceList * gnc_pricedb_lookup_at_time_any_currency(GNCPriceDB *db,
-                                                  const gnc_commodity *c,
-                                                  Timespec t);
+        const gnc_commodity *c,
+        Timespec t);
 
 /** gnc_pricedb_lookup_day - return all prices that match the given
      commodity, currency, and timespec.  Prices will be returned as a
      GNCPrice list (see above). */
 PriceList * gnc_pricedb_lookup_day(GNCPriceDB *db,
-                                 const gnc_commodity *commodity,
-                                 const gnc_commodity *currency,
-                                 Timespec t);
+                                   const gnc_commodity *commodity,
+                                   const gnc_commodity *currency,
+                                   Timespec t);
 
 /** gnc_pricedb_lookup_day_any_currency - return all prices that match the
      given commodity and timespec in any available currency.  Prices will be
      returned as a GNCPrice list (see above). */
 PriceList * gnc_pricedb_lookup_day_any_currency(GNCPriceDB *db,
-                                              const gnc_commodity *c,
-                                              Timespec t);
+        const gnc_commodity *c,
+        Timespec t);
 
 /** gnc_pricedb_lookup_nearest_in_time - return the price for the given
      commodity in the given currency nearest to the given time t. */
 GNCPrice   * gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
-                                                const gnc_commodity *c,
-                                                const gnc_commodity *currency,
-                                                Timespec t);
+        const gnc_commodity *c,
+        const gnc_commodity *currency,
+        Timespec t);
 
 /** gnc_pricedb_lookup_nearest_in_time_any_currency - return all prices that
      match the given commodity and timespec in any available currency. Prices
      will be returned as a GNCPrice list (see above). */
 PriceList * gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
-                                                          const gnc_commodity *c,
-                                                          Timespec t);
+        const gnc_commodity *c,
+        Timespec t);
 /** gnc_pricedb_lookup_latest_before - return the latest price for the given commodity
     in the given currency up to and including time t. */
 GNCPrice * gnc_pricedb_lookup_latest_before(GNCPriceDB *db,
-					    gnc_commodity *c,
-					    gnc_commodity *currency,
-					    Timespec t);
+        gnc_commodity *c,
+        gnc_commodity *currency,
+        Timespec t);
 
 /** gnc_pricedb_lookup_latest_before_any_currency - return recent prices that
      match the given commodity up to and including time t in any available currency. Prices
      will be returned as a GNCPrice list (see above). */
 PriceList * gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
-                                                        gnc_commodity *c,
-                                                        Timespec t);
+        gnc_commodity *c,
+        Timespec t);
 
 
 /** gnc_pricedb_convert_balance_latest_price - Convert a balance
     from one currency to another. */
 gnc_numeric
 gnc_pricedb_convert_balance_latest_price(GNCPriceDB *pdb,
-				         gnc_numeric balance,
-				         const gnc_commodity *balance_currency,
-				         const gnc_commodity *new_currency);
+        gnc_numeric balance,
+        const gnc_commodity *balance_currency,
+        const gnc_commodity *new_currency);
 
 /** gnc_pricedb_convert_balance_nearest_price - Convert a balance
     from one currency to another. */
 gnc_numeric
 gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb,
-				          gnc_numeric balance,
-				          const gnc_commodity *balance_currency,
-				          const gnc_commodity *new_currency,
-					  Timespec t);
+        gnc_numeric balance,
+        const gnc_commodity *balance_currency,
+        const gnc_commodity *new_currency,
+        Timespec t);
 
 /** gnc_pricedb_convert_balance_latest_before - Convert a balance from one currency
     to another using the lastest price prior to Timespec t. */
 gnc_numeric
 gnc_pricedb_convert_balance_latest_before(GNCPriceDB *pdb,
-                                          gnc_numeric balance,
-                                          gnc_commodity *balance_currency,
-                                          gnc_commodity *new_currency,
-                                          Timespec t);
+        gnc_numeric balance,
+        gnc_commodity *balance_currency,
+        gnc_commodity *new_currency,
+        Timespec t);
 
 
 /** gnc_pricedb_foreach_price - call f once for each price in db, until
@@ -429,7 +432,7 @@
      less efficient).  */
 gboolean     gnc_pricedb_foreach_price(GNCPriceDB *db,
                                        gboolean (*f)(GNCPrice *p,
-                                                     gpointer user_data),
+                                               gpointer user_data),
                                        gpointer user_data,
                                        gboolean stable_order);
 

Modified: gnucash/trunk/src/engine/gnc-session-scm.h
===================================================================
--- gnucash/trunk/src/engine/gnc-session-scm.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gnc-session-scm.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -28,7 +28,7 @@
  * FUNCTION:
  * Encapsulates a connection to a GnuCash backend.  That is, it
  * manages the connection to a persistant data store; whereas
- * the backend is the thing that performs the actual datastore 
+ * the backend is the thing that performs the actual datastore
  * access.
  *
  * HISTORY:

Modified: gnucash/trunk/src/engine/gncObject.h
===================================================================
--- gnucash/trunk/src/engine/gncObject.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gncObject.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,21 +1,21 @@
 #include "qof.h"
 
 
-		#define GncObject_t QofObject
-		#define gncObjectLookup qof_object_lookup
-		#define gncObjectRegister qof_object_register
-		#define gncObjectGetTypeLabel qof_object_get_type_label
-		#define gncObjectRegisterBackend qof_object_register_backend
-		#define gncObjectLookupBackend qof_object_lookup_backend
-		#define gncObjectForeachBackend qof_object_foreach_backend
+#define GncObject_t QofObject
+#define gncObjectLookup qof_object_lookup
+#define gncObjectRegister qof_object_register
+#define gncObjectGetTypeLabel qof_object_get_type_label
+#define gncObjectRegisterBackend qof_object_register_backend
+#define gncObjectLookupBackend qof_object_lookup_backend
+#define gncObjectForeachBackend qof_object_foreach_backend
 
-		#define gncObjectInitialize qof_object_initialize
-		#define gncObjectShutdown qof_object_shutdown
-		#define gncObjectBookBegin qof_object_book_begin
-		#define gncObjectBookEnd qof_object_book_end
-		#define gncObjectIsDirty qof_object_is_dirty
-		#define gncObjectMarkClean qof_object_mark_clean
+#define gncObjectInitialize qof_object_initialize
+#define gncObjectShutdown qof_object_shutdown
+#define gncObjectBookBegin qof_object_book_begin
+#define gncObjectBookEnd qof_object_book_end
+#define gncObjectIsDirty qof_object_is_dirty
+#define gncObjectMarkClean qof_object_mark_clean
 
-		#define gncObjectForeachType qof_object_foreach_type
-		#define gncObjectForeach qof_object_foreach
-		#define gncObjectPrintable qof_object_printable
+#define gncObjectForeachType qof_object_foreach_type
+#define gncObjectForeach qof_object_foreach
+#define gncObjectPrintable qof_object_printable

Modified: gnucash/trunk/src/engine/gncmod-engine.c
===================================================================
--- gnucash/trunk/src/engine/gncmod-engine.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/gncmod-engine.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -26,13 +26,13 @@
 char *
 libgncmod_engine_gnc_module_path(void)
 {
-  return g_strdup("gnucash/engine");
+    return g_strdup("gnucash/engine");
 }
 
 char *
 libgncmod_engine_gnc_module_description(void)
 {
-  return g_strdup("The GnuCash accounting engine");
+    return g_strdup("The GnuCash accounting engine");
 }
 
 extern SCM scm_init_sw_engine_module(void);
@@ -40,20 +40,21 @@
 int
 libgncmod_engine_gnc_module_init(int refcount)
 {
-  if(refcount == 0)
-  {
-    /* initialize the engine on the first load */
-    gnc_engine_init(0, NULL);
-  }
+    if (refcount == 0)
+    {
+        /* initialize the engine on the first load */
+        gnc_engine_init(0, NULL);
+    }
 
-  scm_init_sw_engine_module();
-  scm_c_eval_string("(use-modules (sw_engine))");
-  scm_c_eval_string("(use-modules (gnucash engine))");
+    scm_init_sw_engine_module();
+    scm_c_eval_string("(use-modules (sw_engine))");
+    scm_c_eval_string("(use-modules (gnucash engine))");
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_engine_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_engine_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/engine/policy-p.h
===================================================================
--- gnucash/trunk/src/engine/policy-p.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/policy-p.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,14 +24,14 @@
  *  @author Created by Linas Vepstas August 2003
  *  @author Copyright (c) 2003 Linas Vepstas <linas at linas.org>
  *
- *  This file implements Accounting Policy.  The Accounting Policy 
+ *  This file implements Accounting Policy.  The Accounting Policy
  *  determines how splits are assigned to lots.  The default policy
- *  is the FIFO policy: the first thing bought is also the first 
- *  thing sold. 
+ *  is the FIFO policy: the first thing bought is also the first
+ *  thing sold.
  */
 
-#ifndef XACC_POLICY_P_H 
-#define XACC_POLICY_P_H 
+#ifndef XACC_POLICY_P_H
+#define XACC_POLICY_P_H
 
 #include "gnc-engine.h"
 #include "policy.h"
@@ -39,39 +39,39 @@
 /* ============================================================== */
 /** The Policy routines try to encapsulate the FIFO/LIFO-specific
  *  parts of the cap-gains routine, and can be replaced by something
- *  else for other policies. 
- * 
- *  The PolicyGetLot() routine returns a lot into which the 
+ *  else for other policies.
+ *
+ *  The PolicyGetLot() routine returns a lot into which the
  *     indicated split should be placed.
  *
  *  The PolicyGetSplit() routine returns an unassinged split
  *     from the account that is appropriate for placing into the
- *     indicated lot.  For the FIFO policy, that would be the 
+ *     indicated lot.  For the FIFO policy, that would be the
  *     earliest split that is not in any account, and is of the
  *     appropriate sign.  For a LIFO, it would be the latest.
  *
  *  The PolicyIsOpeningSplit() predicate returns a true/false
  *     value, indicating if the indicated split was used to 'open'
- *     or 'grow' the lot. 
+ *     or 'grow' the lot.
  *
  *  The PolicyGetLotOpening() routine returns information about
- *     the opening balances for the lot.  The 'opening balances' 
+ *     the opening balances for the lot.  The 'opening balances'
  *     are the sum of all the splits used to grow (increase the size
- *     of) the lot.  For a LIFO or FIFO policy, there is only one 
+ *     of) the lot.  For a LIFO or FIFO policy, there is only one
  *     split that opens a lot.
  */
 
 struct gncpolicy_s
 {
-   GNCLot * (*PolicyGetLot) (GNCPolicy *, Split *split);
-   Split  * (*PolicyGetSplit) (GNCPolicy *, GNCLot *lot);
-   void     (*PolicyGetLotOpening) (GNCPolicy *, GNCLot *lot,
-                                   gnc_numeric *ret_amount, 
-                                   gnc_numeric *ret_value,
-                                   gnc_commodity **ret_currency);
+    GNCLot * (*PolicyGetLot) (GNCPolicy *, Split *split);
+    Split  * (*PolicyGetSplit) (GNCPolicy *, GNCLot *lot);
+    void     (*PolicyGetLotOpening) (GNCPolicy *, GNCLot *lot,
+                                     gnc_numeric *ret_amount,
+                                     gnc_numeric *ret_value,
+                                     gnc_commodity **ret_currency);
 
-   gboolean (*PolicyIsOpeningSplit) (GNCPolicy *, GNCLot *lot, 
-                                    Split *split);
+    gboolean (*PolicyIsOpeningSplit) (GNCPolicy *, GNCLot *lot,
+                                      Split *split);
 };
 
 #endif /* XACC_POLICY_P_H */

Modified: gnucash/trunk/src/engine/policy.h
===================================================================
--- gnucash/trunk/src/engine/policy.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/policy.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -21,11 +21,11 @@
 /** @addtogroup Engine
     @{ */
 /** @addtogroup Policy Accounting Policy (FIFO/LIFO)
- *  This file implements Accounting Policy.  The Accounting Policy 
+ *  This file implements Accounting Policy.  The Accounting Policy
  *  determines how Splits are assigned to Lots.  The contents
  *  of a Lot determines the Gains on that Lot.  The default policy
- *  is the FIFO policy: the first thing bought is also the first 
- *  thing sold.  
+ *  is the FIFO policy: the first thing bought is also the first
+ *  thing sold.
  @{ */
 
 /** @file policy.h
@@ -34,12 +34,12 @@
  *  @author Copyright (c) 2003,2004 Linas Vepstas <linas at linas.org>
  */
 
-#ifndef XACC_POLICY_H 
-#define XACC_POLICY_H 
+#ifndef XACC_POLICY_H
+#define XACC_POLICY_H
 
 typedef struct gncpolicy_s GNCPolicy;
 
-/** First-in, First-out Policy 
+/** First-in, First-out Policy
  *  This policy will create FIFO Lots.  FIFO Lots have the following
  *  properties:
  *  -- The lot is started with the earliest posted split that isn't
@@ -49,7 +49,7 @@
  *  -- All splits in the lot share the same transaction currency as
  *     the split that opened the lot.
  */
-GNCPolicy *xaccGetFIFOPolicy (void); 
+GNCPolicy *xaccGetFIFOPolicy (void);
 
 /** Last-in, First-out Policy
  *  This policy will create LIFO Lots.  LIFO Lots have the following
@@ -58,7 +58,7 @@
  *  -- All splits in the lot share the same transaction currency as
  *     the split that opened the lot.
  */
-GNCPolicy *xaccGetLIFOPolicy (void); 
+GNCPolicy *xaccGetLIFOPolicy (void);
 
 #endif /* XACC_POLICY_H */
 /** @} */

Modified: gnucash/trunk/src/engine/test/test-account-object.c
===================================================================
--- gnucash/trunk/src/engine/test/test-account-object.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-account-object.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -19,7 +19,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
-/** 
+/**
  * @file test-account-object.c
  * @brief Minimal test of reading/writing account parameters
  * @author David Hampton <hampton at employees.org>
@@ -37,43 +37,43 @@
 static void
 run_test (void)
 {
-  QofSession *sess;
-  QofBook *book;
-  Account *acc;
-  gnc_numeric *start, *end, end2, delta, zero, five;
+    QofSession *sess;
+    QofBook *book;
+    Account *acc;
+    gnc_numeric *start, *end, end2, delta, zero, five;
 
-  sess = get_random_session ();
-  book = qof_session_get_book (sess);
-  do_test ((NULL != book), "create random data");
-  acc = get_random_account(book);
+    sess = get_random_session ();
+    book = qof_session_get_book (sess);
+    do_test ((NULL != book), "create random data");
+    acc = get_random_account(book);
 
-  /*****/
+    /*****/
 
-  g_object_get(acc, "start-balance", &start, "end-balance", &end, NULL);
-  end2 = xaccAccountGetBalance(acc);
-  delta = gnc_numeric_sub(*end, *start, GNC_DENOM_AUTO, GNC_HOW_DENOM_FIXED);
+    g_object_get(acc, "start-balance", &start, "end-balance", &end, NULL);
+    end2 = xaccAccountGetBalance(acc);
+    delta = gnc_numeric_sub(*end, *start, GNC_DENOM_AUTO, GNC_HOW_DENOM_FIXED);
 
-  do_test (gnc_numeric_zero_p(*start), "start balance is zero");
-  do_test (gnc_numeric_zero_p(*end), "end balance is zero");
-  do_test (gnc_numeric_zero_p(delta), "delta is zero");
-  do_test (gnc_numeric_zero_p(end2), "end2 balance is zero");
+    do_test (gnc_numeric_zero_p(*start), "start balance is zero");
+    do_test (gnc_numeric_zero_p(*end), "end balance is zero");
+    do_test (gnc_numeric_zero_p(delta), "delta is zero");
+    do_test (gnc_numeric_zero_p(end2), "end2 balance is zero");
 
-  /*****/
+    /*****/
 
-  five = gnc_numeric_create(5, 1);
-  g_object_set(acc, "start-balance", &five, NULL);
-  xaccAccountRecomputeBalance(acc);
-  g_object_get(acc, "start-balance", &start, "end-balance", &end, NULL);
-  end2 = xaccAccountGetBalance(acc);
+    five = gnc_numeric_create(5, 1);
+    g_object_set(acc, "start-balance", &five, NULL);
+    xaccAccountRecomputeBalance(acc);
+    g_object_get(acc, "start-balance", &start, "end-balance", &end, NULL);
+    end2 = xaccAccountGetBalance(acc);
 
-  delta = gnc_numeric_sub(*end, five, GNC_DENOM_AUTO, GNC_HOW_DENOM_FIXED);
-  do_test (gnc_numeric_zero_p(delta), "end balance matches");
-  delta = gnc_numeric_sub(end2, five, GNC_DENOM_AUTO, GNC_HOW_DENOM_FIXED);
-  do_test (gnc_numeric_zero_p(delta), "end2 balance matches");
+    delta = gnc_numeric_sub(*end, five, GNC_DENOM_AUTO, GNC_HOW_DENOM_FIXED);
+    do_test (gnc_numeric_zero_p(delta), "end balance matches");
+    delta = gnc_numeric_sub(end2, five, GNC_DENOM_AUTO, GNC_HOW_DENOM_FIXED);
+    do_test (gnc_numeric_zero_p(delta), "end2 balance matches");
 
-  /*****/
+    /*****/
 
-  qof_session_end (sess);
+    qof_session_end (sess);
 
 }
 

Modified: gnucash/trunk/src/engine/test/test-book-merge.c
===================================================================
--- gnucash/trunk/src/engine/test/test-book-merge.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-book-merge.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,9 +20,9 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                    *
  *                                                                   *
  ********************************************************************/
- /* Test the qof_book_merge infrastructure. */
+/* Test the qof_book_merge infrastructure. */
 
-#include "config.h" 
+#include "config.h"
 #include <glib.h>
 
 #include "qof.h"
@@ -47,20 +47,20 @@
 /* simple object structure */
 typedef struct obj_s
 {
-	QofInstance inst;
-	char     	*Name;
-	gnc_numeric	Amount;
-	const GUID 	*obj_guid;
-	Timespec 	date;
-	double 		discount; /* cheap pun, I know. */
-	gboolean 	active;
-	gint32   	version;
-	gint64 		minor;
-}myobj;
+    QofInstance inst;
+    char     	*Name;
+    gnc_numeric	Amount;
+    const GUID 	*obj_guid;
+    Timespec 	date;
+    double 		discount; /* cheap pun, I know. */
+    gboolean 	active;
+    gint32   	version;
+    gint64 		minor;
+} myobj;
 
 typedef struct objclass_s
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 } myobjClass;
 
 myobj* obj_create(QofBook*);
@@ -120,394 +120,415 @@
 myobj*
 obj_create(QofBook *book)
 {
-	myobj *g;
-	g_return_val_if_fail(book, NULL);
-	g = g_object_new(GNC_TYPE_MYOBJ, NULL);
-	qof_instance_init_data (&g->inst, TEST_MODULE_NAME, book);
-	obj_setGUID(g,qof_instance_get_guid(&g->inst));
-	g->date.tv_nsec = 0;
-	g->date.tv_sec = 0;
-	g->discount = 0;
-	g->active = TRUE;
-	g->version = 1;
-	g->minor = 1;
-	qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
-	return g;
+    myobj *g;
+    g_return_val_if_fail(book, NULL);
+    g = g_object_new(GNC_TYPE_MYOBJ, NULL);
+    qof_instance_init_data (&g->inst, TEST_MODULE_NAME, book);
+    obj_setGUID(g, qof_instance_get_guid(&g->inst));
+    g->date.tv_nsec = 0;
+    g->date.tv_sec = 0;
+    g->discount = 0;
+    g->active = TRUE;
+    g->version = 1;
+    g->minor = 1;
+    qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
+    return g;
 }
 
 void
 obj_setMinor(myobj *g, gint64 h)
 {
-	g_return_if_fail(g != NULL);
-	g->minor = h;
+    g_return_if_fail(g != NULL);
+    g->minor = h;
 }
 
 gint64
 obj_getMinor(myobj *g)
 {
-	g_return_val_if_fail((g != NULL),0);
-	return g->minor;
+    g_return_val_if_fail((g != NULL), 0);
+    return g->minor;
 }
 
 void
 obj_setVersion(myobj *g, gint32 h)
 {
-	g_return_if_fail(g != NULL);
-	g->version = h;
+    g_return_if_fail(g != NULL);
+    g->version = h;
 }
 
 gint32
 obj_getVersion(myobj *g)
 {
-	if(!g) return 0;
-	return g->version;
+    if (!g) return 0;
+    return g->version;
 }
 
 void
 obj_setActive(myobj *g, gboolean h)
 {
-	if(!g) return;
-	g->active = h;
+    if (!g) return;
+    g->active = h;
 }
 
 gboolean
 obj_getActive(myobj *g)
 {
-	if(!g) return FALSE;
-	return g->active;
+    if (!g) return FALSE;
+    return g->active;
 }
 
 void
 obj_setDiscount(myobj *g, double h)
 {
-	if(!g) return;
-	g->discount = h;
+    if (!g) return;
+    g->discount = h;
 }
 
 double
 obj_getDiscount(myobj *g)
 {
-	if(!g) return 0;
-	return g->discount;
+    if (!g) return 0;
+    return g->discount;
 }
 
 void
 obj_setDate(myobj *g, Timespec h)
 {
-	if(!g) return;
-	g->date = h;
+    if (!g) return;
+    g->date = h;
 }
 
 Timespec
 obj_getDate(myobj *g)
 {
-  Timespec ts = {0};
-	if(!g) return ts;
-	ts = g->date;
-	return ts;
+    Timespec ts = {0};
+    if (!g) return ts;
+    ts = g->date;
+    return ts;
 }
 
 void
 obj_setGUID(myobj* g, const GUID* h)
 {
-	if(!g) return;
-	g->obj_guid = h;
+    if (!g) return;
+    g->obj_guid = h;
 }
 
-const GUID* 
+const GUID*
 obj_getGUID(myobj *g)
 {
-	if(!g) return NULL;
-	return g->obj_guid;
+    if (!g) return NULL;
+    return g->obj_guid;
 }
 
-void 
+void
 obj_setName(myobj* g, char* h)
 {
-	if(!g || !h) return;
-	g->Name = strdup(h);
+    if (!g || !h) return;
+    g->Name = strdup(h);
 }
 
 char*
 obj_getName(myobj *g)
 {
-	if(!g) return NULL;
-	return g->Name;
+    if (!g) return NULL;
+    return g->Name;
 }
 
 void
 obj_setAmount(myobj *g, gnc_numeric h)
 {
-	if(!g) return;
-	g->Amount = h;
+    if (!g) return;
+    g->Amount = h;
 }
 
 gnc_numeric
 obj_getAmount(myobj *g)
 {
-	if(!g) return gnc_numeric_zero();
-	return g->Amount;
+    if (!g) return gnc_numeric_zero();
+    return g->Amount;
 }
 
-static QofObject obj_object_def = {
-  interface_version:     QOF_OBJECT_VERSION,
-  e_type:                TEST_MODULE_NAME,
-  type_label:            TEST_MODULE_DESC,
-  create:                (gpointer)obj_create,
-  book_begin:            NULL,
-  book_end:              NULL,
-  is_dirty:              NULL,
-  mark_clean:            NULL,
-  foreach:               qof_collection_foreach,
-  printable:             NULL,
-  version_cmp:           (int (*)(gpointer,gpointer)) qof_instance_version_cmp,
+static QofObject obj_object_def =
+{
+interface_version:
+    QOF_OBJECT_VERSION,
+e_type:
+    TEST_MODULE_NAME,
+type_label:
+    TEST_MODULE_DESC,
+create:
+    (gpointer)obj_create,
+book_begin:
+    NULL,
+book_end:
+    NULL,
+is_dirty:
+    NULL,
+mark_clean:
+    NULL,
+foreach:
+    qof_collection_foreach,
+printable:
+    NULL,
+version_cmp:
+    (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
 };
 
 gboolean myobjRegister (void)
 {
-  static QofParam params[] = {
-	{ OBJ_NAME,		QOF_TYPE_STRING,	(QofAccessFunc)obj_getName,		(QofSetterFunc)obj_setName		},
-	{ OBJ_AMOUNT,   QOF_TYPE_NUMERIC,   (QofAccessFunc)obj_getAmount,   (QofSetterFunc)obj_setAmount	},
-	{ OBJ_GUID,		QOF_TYPE_GUID,		(QofAccessFunc)obj_getGUID,		(QofSetterFunc)obj_setGUID		},
-	{ OBJ_DATE,		QOF_TYPE_DATE,		(QofAccessFunc)obj_getDate,		(QofSetterFunc)obj_setDate		},
-	{ OBJ_DISCOUNT, QOF_TYPE_DOUBLE,	(QofAccessFunc)obj_getDiscount, (QofSetterFunc)obj_setDiscount  },
-	{ OBJ_ACTIVE,   QOF_TYPE_BOOLEAN,   (QofAccessFunc)obj_getActive,   (QofSetterFunc)obj_setActive	},
-	{ OBJ_VERSION,  QOF_TYPE_INT32,		(QofAccessFunc)obj_getVersion,  (QofSetterFunc)obj_setVersion   },
-	{ OBJ_MINOR,	QOF_TYPE_INT64,		(QofAccessFunc)obj_getMinor,	(QofSetterFunc)obj_setMinor		},
-    { QOF_PARAM_BOOK, QOF_ID_BOOK,		(QofAccessFunc)qof_instance_get_book, NULL },
-    { QOF_PARAM_GUID, QOF_TYPE_GUID,	(QofAccessFunc)qof_instance_get_guid, NULL },
-    { NULL },
-  };
+    static QofParam params[] =
+    {
+        { OBJ_NAME,		QOF_TYPE_STRING,	(QofAccessFunc)obj_getName,		(QofSetterFunc)obj_setName		},
+        { OBJ_AMOUNT,   QOF_TYPE_NUMERIC,   (QofAccessFunc)obj_getAmount,   (QofSetterFunc)obj_setAmount	},
+        { OBJ_GUID,		QOF_TYPE_GUID,		(QofAccessFunc)obj_getGUID,		(QofSetterFunc)obj_setGUID		},
+        { OBJ_DATE,		QOF_TYPE_DATE,		(QofAccessFunc)obj_getDate,		(QofSetterFunc)obj_setDate		},
+        { OBJ_DISCOUNT, QOF_TYPE_DOUBLE,	(QofAccessFunc)obj_getDiscount, (QofSetterFunc)obj_setDiscount  },
+        { OBJ_ACTIVE,   QOF_TYPE_BOOLEAN,   (QofAccessFunc)obj_getActive,   (QofSetterFunc)obj_setActive	},
+        { OBJ_VERSION,  QOF_TYPE_INT32,		(QofAccessFunc)obj_getVersion,  (QofSetterFunc)obj_setVersion   },
+        { OBJ_MINOR,	QOF_TYPE_INT64,		(QofAccessFunc)obj_getMinor,	(QofSetterFunc)obj_setMinor		},
+        { QOF_PARAM_BOOK, QOF_ID_BOOK,		(QofAccessFunc)qof_instance_get_book, NULL },
+        { QOF_PARAM_GUID, QOF_TYPE_GUID,	(QofAccessFunc)qof_instance_get_guid, NULL },
+        { NULL },
+    };
 
-  qof_class_register (TEST_MODULE_NAME, NULL, params);
+    qof_class_register (TEST_MODULE_NAME, NULL, params);
 
-  return qof_object_register (&obj_object_def);
+    return qof_object_register (&obj_object_def);
 }
 
-static void 
+static void
 test_merge (void)
 {
-	QofBook *target, *import;
-	double init_value, discount;
-	myobj *import_obj, *target_obj, *new_obj;
-	int result;
-	Timespec ts, tc;
-	gboolean active;
-	gint32 version;
-	gint64 minor;
-	gchar *import_init, *target_init;
-	gnc_numeric obj_amount;
-	QofBookMergeData *mergeData;
-	
-	target = qof_book_new();
-	import = qof_book_new();
-	init_value = 1.00;
-	result = 0;
-	discount = 0.5;
-	active = TRUE;
-	version = 1;
-	minor = 1;
-	import_init = "test";
-	target_init = "testing";
-	qof_date_format_set(QOF_DATE_FORMAT_UK);
-	timespecFromTime_t(&ts,time(NULL));
+    QofBook *target, *import;
+    double init_value, discount;
+    myobj *import_obj, *target_obj, *new_obj;
+    int result;
+    Timespec ts, tc;
+    gboolean active;
+    gint32 version;
+    gint64 minor;
+    gchar *import_init, *target_init;
+    gnc_numeric obj_amount;
+    QofBookMergeData *mergeData;
 
-	do_test ((NULL != target), "#1 target book is NULL");
+    target = qof_book_new();
+    import = qof_book_new();
+    init_value = 1.00;
+    result = 0;
+    discount = 0.5;
+    active = TRUE;
+    version = 1;
+    minor = 1;
+    import_init = "test";
+    target_init = "testing";
+    qof_date_format_set(QOF_DATE_FORMAT_UK);
+    timespecFromTime_t(&ts, time(NULL));
 
-	/* import book objects - tests used */
-	do_test ((NULL != import), "#2 import book is NULL");
-	import_obj = g_object_new(GNC_TYPE_MYOBJ, NULL);
-	do_test ((NULL != import_obj), "#3 new object create");
-	qof_instance_init_data (&import_obj->inst, TEST_MODULE_NAME, import);
-	do_test ((NULL != &import_obj->inst), "#4 instance init");
-	obj_setGUID(import_obj,qof_instance_get_guid(&import_obj->inst));
-	do_test ((NULL != &import_obj->obj_guid), "#5 guid set");
-	qof_event_gen(&import_obj->inst, QOF_EVENT_CREATE, NULL);
-	do_test ((NULL != &import_obj->inst), "#6 gnc event create");
-	obj_setName(import_obj, import_init);
-	do_test ((NULL != &import_obj->Name), "#7 string set");
-	obj_amount = double_to_gnc_numeric(init_value,1, GNC_HOW_DENOM_EXACT);
-	obj_setAmount(import_obj, obj_amount);
-	do_test ((gnc_numeric_check(obj_getAmount(import_obj)) == GNC_ERROR_OK), "#8 gnc_numeric set");
-	obj_setActive(import_obj, active);
-	do_test ((FALSE != &import_obj->active), "#9 gboolean set");
-	obj_setDiscount(import_obj, discount);
-	do_test ((discount == import_obj->discount), "#10 double set");
-	obj_setVersion(import_obj, version);
-	do_test ((version == import_obj->version), "#11 gint32 set");
-	obj_setMinor(import_obj, minor);
-	do_test ((minor == import_obj->minor), "#12 gint64 set");
-	obj_setDate(import_obj, ts );
-	tc = import_obj->date;
-	do_test ((timespec_cmp(&ts, &tc) == 0), "#13 date set");
+    do_test ((NULL != target), "#1 target book is NULL");
 
-	obj_amount = gnc_numeric_add(obj_amount, obj_amount, 1, GNC_HOW_DENOM_EXACT);
-	discount = 0.25;
-	version = 2;
-	minor = 3;
+    /* import book objects - tests used */
+    do_test ((NULL != import), "#2 import book is NULL");
+    import_obj = g_object_new(GNC_TYPE_MYOBJ, NULL);
+    do_test ((NULL != import_obj), "#3 new object create");
+    qof_instance_init_data (&import_obj->inst, TEST_MODULE_NAME, import);
+    do_test ((NULL != &import_obj->inst), "#4 instance init");
+    obj_setGUID(import_obj, qof_instance_get_guid(&import_obj->inst));
+    do_test ((NULL != &import_obj->obj_guid), "#5 guid set");
+    qof_event_gen(&import_obj->inst, QOF_EVENT_CREATE, NULL);
+    do_test ((NULL != &import_obj->inst), "#6 gnc event create");
+    obj_setName(import_obj, import_init);
+    do_test ((NULL != &import_obj->Name), "#7 string set");
+    obj_amount = double_to_gnc_numeric(init_value, 1, GNC_HOW_DENOM_EXACT);
+    obj_setAmount(import_obj, obj_amount);
+    do_test ((gnc_numeric_check(obj_getAmount(import_obj)) == GNC_ERROR_OK), "#8 gnc_numeric set");
+    obj_setActive(import_obj, active);
+    do_test ((FALSE != &import_obj->active), "#9 gboolean set");
+    obj_setDiscount(import_obj, discount);
+    do_test ((discount == import_obj->discount), "#10 double set");
+    obj_setVersion(import_obj, version);
+    do_test ((version == import_obj->version), "#11 gint32 set");
+    obj_setMinor(import_obj, minor);
+    do_test ((minor == import_obj->minor), "#12 gint64 set");
+    obj_setDate(import_obj, ts );
+    tc = import_obj->date;
+    do_test ((timespec_cmp(&ts, &tc) == 0), "#13 date set");
 
-	/* second import object - test results would be the same, so not tested. */
-	new_obj = g_object_new(GNC_TYPE_MYOBJ, NULL);
-	qof_instance_init_data (&new_obj->inst, TEST_MODULE_NAME, import);
-	obj_setGUID(new_obj,qof_instance_get_guid(&new_obj->inst));
-	qof_event_gen (&new_obj->inst, QOF_EVENT_CREATE, NULL);
-	obj_setName(new_obj, import_init);
-	obj_setAmount(new_obj, obj_amount);
-	obj_setActive(new_obj, active);
-	obj_setDiscount(new_obj, discount);
-	obj_setVersion(new_obj, version);
-	obj_setMinor(new_obj, minor);
-	obj_setDate(new_obj, ts);
+    obj_amount = gnc_numeric_add(obj_amount, obj_amount, 1, GNC_HOW_DENOM_EXACT);
+    discount = 0.25;
+    version = 2;
+    minor = 3;
 
-	obj_amount = gnc_numeric_add(obj_amount, obj_amount, 1, GNC_HOW_DENOM_EXACT);
-	discount = 0.35;
-	version = 2;
-	minor = 3;
-	tc.tv_sec = ts.tv_sec -1;
-	tc.tv_nsec = 0;
+    /* second import object - test results would be the same, so not tested. */
+    new_obj = g_object_new(GNC_TYPE_MYOBJ, NULL);
+    qof_instance_init_data (&new_obj->inst, TEST_MODULE_NAME, import);
+    obj_setGUID(new_obj, qof_instance_get_guid(&new_obj->inst));
+    qof_event_gen (&new_obj->inst, QOF_EVENT_CREATE, NULL);
+    obj_setName(new_obj, import_init);
+    obj_setAmount(new_obj, obj_amount);
+    obj_setActive(new_obj, active);
+    obj_setDiscount(new_obj, discount);
+    obj_setVersion(new_obj, version);
+    obj_setMinor(new_obj, minor);
+    obj_setDate(new_obj, ts);
 
-	/* target object - test results would be the same, so not tested. */
-	target_obj = g_object_new(GNC_TYPE_MYOBJ, NULL);
-	qof_instance_init_data (&target_obj->inst, TEST_MODULE_NAME, target);
-	obj_setGUID(target_obj,qof_instance_get_guid(&target_obj->inst));
-	qof_event_gen (&target_obj->inst, QOF_EVENT_CREATE, NULL);
-	obj_setName(target_obj, target_init);
-	obj_setAmount(target_obj, obj_amount);
-	obj_setActive(target_obj, active);
-	obj_setDiscount(target_obj, discount);
-	obj_setVersion(target_obj, version);
-	obj_setMinor(target_obj, minor);
-	obj_setDate(target_obj, tc );
-	
-	mergeData = qof_book_merge_init(import, target);
-	do_test ( mergeData != NULL, "FATAL: Merge could not be initialised!\t aborting . . ");
-	g_return_if_fail(mergeData != NULL);
- 	qof_book_merge_rule_foreach(mergeData, test_rule_loop, MERGE_REPORT);
-	qof_book_merge_rule_foreach(mergeData, test_rule_loop, MERGE_UPDATE);
-	qof_book_merge_rule_foreach(mergeData, test_rule_loop, MERGE_NEW);
- 	/* reserved calls - test only */
- 	qof_book_merge_rule_foreach(mergeData, test_rule_loop, MERGE_ABSOLUTE);
- 	qof_book_merge_rule_foreach(mergeData, test_rule_loop, MERGE_DUPLICATE);
+    obj_amount = gnc_numeric_add(obj_amount, obj_amount, 1, GNC_HOW_DENOM_EXACT);
+    discount = 0.35;
+    version = 2;
+    minor = 3;
+    tc.tv_sec = ts.tv_sec - 1;
+    tc.tv_nsec = 0;
 
-	/* import should not be in the target - pass if import_init fails match with target */
-	do_test (((safe_strcmp(obj_getName(import_obj),obj_getName(target_obj))) != 0), "Init value test #1");
-	
-	/* a good commit returns zero */
- 	do_test (qof_book_merge_commit(mergeData) == 0, "Commit failed");
+    /* target object - test results would be the same, so not tested. */
+    target_obj = g_object_new(GNC_TYPE_MYOBJ, NULL);
+    qof_instance_init_data (&target_obj->inst, TEST_MODULE_NAME, target);
+    obj_setGUID(target_obj, qof_instance_get_guid(&target_obj->inst));
+    qof_event_gen (&target_obj->inst, QOF_EVENT_CREATE, NULL);
+    obj_setName(target_obj, target_init);
+    obj_setAmount(target_obj, obj_amount);
+    obj_setActive(target_obj, active);
+    obj_setDiscount(target_obj, discount);
+    obj_setVersion(target_obj, version);
+    obj_setMinor(target_obj, minor);
+    obj_setDate(target_obj, tc );
 
-	/* import should be in the target - pass if import_init matches target */
-	do_test (((safe_strcmp(import_init,obj_getName(target_obj))) == 0), "Merged value test #1");
+    mergeData = qof_book_merge_init(import, target);
+    do_test ( mergeData != NULL, "FATAL: Merge could not be initialised!\t aborting . . ");
+    g_return_if_fail(mergeData != NULL);
+    qof_book_merge_rule_foreach(mergeData, test_rule_loop, MERGE_REPORT);
+    qof_book_merge_rule_foreach(mergeData, test_rule_loop, MERGE_UPDATE);
+    qof_book_merge_rule_foreach(mergeData, test_rule_loop, MERGE_NEW);
+    /* reserved calls - test only */
+    qof_book_merge_rule_foreach(mergeData, test_rule_loop, MERGE_ABSOLUTE);
+    qof_book_merge_rule_foreach(mergeData, test_rule_loop, MERGE_DUPLICATE);
 
-	/* import should be the same as target - pass if values are the same */
-	do_test (((safe_strcmp(obj_getName(target_obj),obj_getName(import_obj))) == 0), "Merged value test #2");
+    /* import should not be in the target - pass if import_init fails match with target */
+    do_test (((safe_strcmp(obj_getName(import_obj), obj_getName(target_obj))) != 0), "Init value test #1");
 
-	/* check that the Amount really is a gnc_numeric */
-	do_test ((gnc_numeric_check(obj_getAmount(import_obj)) == GNC_ERROR_OK), "import gnc_numeric check");
-	do_test ((gnc_numeric_check(obj_getAmount(target_obj)) == GNC_ERROR_OK), "target gnc_numeric check");
+    /* a good commit returns zero */
+    do_test (qof_book_merge_commit(mergeData) == 0, "Commit failed");
 
-	/* obj_amount was changed after the import object was set, so expect a difference. */
-	do_test ((gnc_numeric_compare(obj_getAmount(import_obj), obj_amount) != GNC_ERROR_OK),
-			"gnc_numeric value check #1");
+    /* import should be in the target - pass if import_init matches target */
+    do_test (((safe_strcmp(import_init, obj_getName(target_obj))) == 0), "Merged value test #1");
 
-	/* obj_amount is in the target object with the import value, expect a difference/ */
-	do_test ((gnc_numeric_compare(obj_getAmount(target_obj), obj_amount) != GNC_ERROR_OK),
-			"gnc_numeric value check #2");
-	
-	/* target had a different date, so import date should now be set */
-	/* note: If sensible defaults are not set in the create: 
-	an empty Timespec caused problems with the update - fix */
-	tc = target_obj->date;
-	do_test ((timespec_cmp(&ts, &tc) == 0), "date value check: 1");
-	tc = import_obj->date;
-	do_test ((timespec_cmp(&tc, &ts) == 0), "date value check: 2");
-	do_test ((timespec_cmp(&import_obj->date, &target_obj->date) == 0), "date value check: 3");
+    /* import should be the same as target - pass if values are the same */
+    do_test (((safe_strcmp(obj_getName(target_obj), obj_getName(import_obj))) == 0), "Merged value test #2");
 
+    /* check that the Amount really is a gnc_numeric */
+    do_test ((gnc_numeric_check(obj_getAmount(import_obj)) == GNC_ERROR_OK), "import gnc_numeric check");
+    do_test ((gnc_numeric_check(obj_getAmount(target_obj)) == GNC_ERROR_OK), "target gnc_numeric check");
+
+    /* obj_amount was changed after the import object was set, so expect a difference. */
+    do_test ((gnc_numeric_compare(obj_getAmount(import_obj), obj_amount) != GNC_ERROR_OK),
+             "gnc_numeric value check #1");
+
+    /* obj_amount is in the target object with the import value, expect a difference/ */
+    do_test ((gnc_numeric_compare(obj_getAmount(target_obj), obj_amount) != GNC_ERROR_OK),
+             "gnc_numeric value check #2");
+
+    /* target had a different date, so import date should now be set */
+    /* note: If sensible defaults are not set in the create:
+    an empty Timespec caused problems with the update - fix */
+    tc = target_obj->date;
+    do_test ((timespec_cmp(&ts, &tc) == 0), "date value check: 1");
+    tc = import_obj->date;
+    do_test ((timespec_cmp(&tc, &ts) == 0), "date value check: 2");
+    do_test ((timespec_cmp(&import_obj->date, &target_obj->date) == 0), "date value check: 3");
+
 }
 
 static void
 test_rule_loop (QofBookMergeData *mergeData, QofBookMergeRule *rule, guint remainder)
 {
-	GSList *testing;
-	QofParam *eachParam;
-	char *importstring;
-	char *targetstring;
-	/* In this test rule_loop, any lines beginning with do_test() can be removed
-	from a working rule_loop routine. It would be wise to still use some of the
-	more obvious checks, e.g. that an entity or rule exists before querying the parameters.
-	
-	Take particular care with MERGE_NEW - targetEnt is always NULL until the Commit.
-	Do not attempt to use param_getfcn on targetEnt in the loop called by 
-	QofBookMergeRuleForeach(rule_loop, MERGE_NEW);
-	
-	*/
-	gboolean skip_target;
-	
-	importstring = NULL;
-	targetstring = NULL;
-	skip_target = FALSE;
-	mergeData->currentRule = rule;
-	do_test ((rule != NULL), "loop:#1 Rule is NULL");
-	do_test (remainder > 0, "loop:#2 remainder error.");
-	do_test ((safe_strcmp(NULL, rule->mergeLabel) != 0), "loop:#3 object label\n");
-	do_test ((rule->importEnt != NULL), "loop:#4 empty import entity");
-	/* targetEnt is always NULL at this stage if MERGE_NEW is set */
-	if(rule->targetEnt == NULL) { skip_target = TRUE; }
-	if(!skip_target) {
-		do_test ((safe_strcmp(rule->importEnt->e_type, rule->targetEnt->e_type) == 0),
-			"loop: entity type mismatch");
-	}
-	do_test ((rule->mergeParam != NULL), "loop: empty parameter list");
-	testing = rule->mergeParam;
-	
-	while(testing != NULL) { // start of param loop
-		eachParam = testing->data;
-		do_test ((eachParam != NULL), "loop:#8 no QofParam data");
-		do_test ((eachParam->param_name != NULL), "loop:#9 no parameter name");
-		do_test ((eachParam->param_getfcn != NULL), "loop:#10 no get function");
-		do_test ((eachParam->param_setfcn != NULL), "loop:#11 no set function");
-		/* non-generic - test routines only! */
-		if(safe_strcmp(eachParam->param_type, QOF_TYPE_STRING) == 0) {
-			/* if you use this format, you would need to check the QOF_TYPE and
-			configure the get_fcn pointers yourself. This example only works for strings. */
-			importstring = g_strdup(eachParam->param_getfcn(rule->importEnt, eachParam));
-			do_test ((importstring != NULL), "loop:#12 direct get_fcn import");
-			do_test ((safe_strcmp(importstring, "test") == 0), "loop:#13 direct import comparison");
-			if(!skip_target) {
-			targetstring = eachParam->param_getfcn(rule->targetEnt, eachParam);		
-			do_test ((targetstring != NULL), "loop:#14 direct get_fcn target");
-			do_test ((safe_strcmp(targetstring, "testing") == 0), "loop:#15 direct target comparison");
-		}
-		}
-		/* param_as_string does the conversion for display purposes only */
-		/* do NOT use as_string for calculations or set_fcn */
-		importstring = qof_book_merge_param_as_string(eachParam, rule->importEnt);
-		do_test ((importstring != NULL), "loop:#16 import param_as_string is null");
-/*		printf("importstring %s\t%s Type\n", importstring, eachParam->param_type);*/
-		if(!skip_target) {
-		targetstring = qof_book_merge_param_as_string(eachParam, rule->targetEnt);
-		do_test ((targetstring != NULL), "loop:#17 target param_as_string is null");
-/*		printf("targetstring %s\t%s Type\n", targetstring, eachParam->param_type);*/
-			}
-		/* add your own code for user involvement here. */
-		/* either store the importstring and targetstring values and display separately,
-		perhaps in alphabetical/object_type/priority order, or, obtain user input as each
-		string is available. */
-		
-		testing = g_slist_next(testing);
-	} // end param loop
-	/* set each rule dependent on the user involvement response above. */
-	/* test routine just sets all MERGE_REPORT to MERGE_UPDATE */
-	mergeData = qof_book_merge_update_result(mergeData, MERGE_UPDATE);
-	do_test ((rule->mergeResult != MERGE_REPORT), "update result fail");
+    GSList *testing;
+    QofParam *eachParam;
+    char *importstring;
+    char *targetstring;
+    /* In this test rule_loop, any lines beginning with do_test() can be removed
+    from a working rule_loop routine. It would be wise to still use some of the
+    more obvious checks, e.g. that an entity or rule exists before querying the parameters.
+
+    Take particular care with MERGE_NEW - targetEnt is always NULL until the Commit.
+    Do not attempt to use param_getfcn on targetEnt in the loop called by
+    QofBookMergeRuleForeach(rule_loop, MERGE_NEW);
+
+    */
+    gboolean skip_target;
+
+    importstring = NULL;
+    targetstring = NULL;
+    skip_target = FALSE;
+    mergeData->currentRule = rule;
+    do_test ((rule != NULL), "loop:#1 Rule is NULL");
+    do_test (remainder > 0, "loop:#2 remainder error.");
+    do_test ((safe_strcmp(NULL, rule->mergeLabel) != 0), "loop:#3 object label\n");
+    do_test ((rule->importEnt != NULL), "loop:#4 empty import entity");
+    /* targetEnt is always NULL at this stage if MERGE_NEW is set */
+    if (rule->targetEnt == NULL)
+    {
+        skip_target = TRUE;
+    }
+    if (!skip_target)
+    {
+        do_test ((safe_strcmp(rule->importEnt->e_type, rule->targetEnt->e_type) == 0),
+                 "loop: entity type mismatch");
+    }
+    do_test ((rule->mergeParam != NULL), "loop: empty parameter list");
+    testing = rule->mergeParam;
+
+    while (testing != NULL)  // start of param loop
+    {
+        eachParam = testing->data;
+        do_test ((eachParam != NULL), "loop:#8 no QofParam data");
+        do_test ((eachParam->param_name != NULL), "loop:#9 no parameter name");
+        do_test ((eachParam->param_getfcn != NULL), "loop:#10 no get function");
+        do_test ((eachParam->param_setfcn != NULL), "loop:#11 no set function");
+        /* non-generic - test routines only! */
+        if (safe_strcmp(eachParam->param_type, QOF_TYPE_STRING) == 0)
+        {
+            /* if you use this format, you would need to check the QOF_TYPE and
+            configure the get_fcn pointers yourself. This example only works for strings. */
+            importstring = g_strdup(eachParam->param_getfcn(rule->importEnt, eachParam));
+            do_test ((importstring != NULL), "loop:#12 direct get_fcn import");
+            do_test ((safe_strcmp(importstring, "test") == 0), "loop:#13 direct import comparison");
+            if (!skip_target)
+            {
+                targetstring = eachParam->param_getfcn(rule->targetEnt, eachParam);
+                do_test ((targetstring != NULL), "loop:#14 direct get_fcn target");
+                do_test ((safe_strcmp(targetstring, "testing") == 0), "loop:#15 direct target comparison");
+            }
+        }
+        /* param_as_string does the conversion for display purposes only */
+        /* do NOT use as_string for calculations or set_fcn */
+        importstring = qof_book_merge_param_as_string(eachParam, rule->importEnt);
+        do_test ((importstring != NULL), "loop:#16 import param_as_string is null");
+        /*		printf("importstring %s\t%s Type\n", importstring, eachParam->param_type);*/
+        if (!skip_target)
+        {
+            targetstring = qof_book_merge_param_as_string(eachParam, rule->targetEnt);
+            do_test ((targetstring != NULL), "loop:#17 target param_as_string is null");
+            /*		printf("targetstring %s\t%s Type\n", targetstring, eachParam->param_type);*/
+        }
+        /* add your own code for user involvement here. */
+        /* either store the importstring and targetstring values and display separately,
+        perhaps in alphabetical/object_type/priority order, or, obtain user input as each
+        string is available. */
+
+        testing = g_slist_next(testing);
+    } // end param loop
+    /* set each rule dependent on the user involvement response above. */
+    /* test routine just sets all MERGE_REPORT to MERGE_UPDATE */
+    mergeData = qof_book_merge_update_result(mergeData, MERGE_UPDATE);
+    do_test ((rule->mergeResult != MERGE_REPORT), "update result fail");
 }
 
 int
 main (int argc, char **argv)
 {
-	qof_init();
-	myobjRegister();
-	test_merge();
-	print_test_results();
-	qof_close();
-	return get_rv();
+    qof_init();
+    myobjRegister();
+    test_merge();
+    print_test_results();
+    qof_close();
+    return get_rv();
 }

Modified: gnucash/trunk/src/engine/test/test-commodities.c
===================================================================
--- gnucash/trunk/src/engine/test/test-commodities.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-commodities.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -125,9 +125,9 @@
         do_test(
             gnc_commodity_equiv(com, com2), "commodity equiv");
 
-	qof_book_destroy (book);
+        qof_book_destroy (book);
     }
-    
+
     {
         int i, j, num_total = 0;
         gnc_commodity_table *tbl;
@@ -140,13 +140,13 @@
         do_test(gnc_commodity_table_get_size(tbl) == 0,
                 "test size for 0 table");
 
-        for(i = 0; i < 20; i++)
+        for (i = 0; i < 20; i++)
         {
             coms[i] = get_random_commodity(book);
 
             if (!gnc_commodity_table_lookup(
-                tbl, gnc_commodity_get_namespace(coms[i]),
-                gnc_commodity_get_mnemonic(coms[i])))
+                        tbl, gnc_commodity_get_namespace(coms[i]),
+                        gnc_commodity_get_mnemonic(coms[i])))
                 num_total++;
             do_test(
                 gnc_commodity_table_insert(tbl, coms[i]) != NULL,
@@ -158,14 +158,14 @@
                 "should be %d and is %d", num_total,
                 gnc_commodity_table_get_size(tbl));
 
-            for(j = 0; j <= i; j++)
+            for (j = 0; j <= i; j++)
             {
                 gnc_commodity *testcom;
 
                 do_test(
                     (testcom = gnc_commodity_table_lookup(
-                        tbl, gnc_commodity_get_namespace(coms[j]),
-                        gnc_commodity_get_mnemonic(coms[j]))) != NULL,
+                                   tbl, gnc_commodity_get_namespace(coms[j]),
+                                   gnc_commodity_get_mnemonic(coms[j]))) != NULL,
                     "lookup commodity");
                 do_test(
                     gnc_commodity_equiv(testcom, coms[j]),
@@ -178,7 +178,7 @@
                 "test have namespace");
         }
     }
-    
+
 }
 
 int

Modified: gnucash/trunk/src/engine/test/test-date.c
===================================================================
--- gnucash/trunk/src/engine/test/test-date.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-date.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -16,370 +16,370 @@
 static gboolean
 check_time (Timespec ts, gboolean always_print)
 {
-  Timespec ts_2;
-  char str[128];
-  gboolean ok;
+    Timespec ts_2;
+    char str[128];
+    gboolean ok;
 
-  ts.tv_nsec = MIN (ts.tv_nsec, 999999999);
-  ts.tv_nsec /= 1000;
-  ts.tv_nsec *= 1000;
+    ts.tv_nsec = MIN (ts.tv_nsec, 999999999);
+    ts.tv_nsec /= 1000;
+    ts.tv_nsec *= 1000;
 
-  /* We just can't handle dates whose time_t doesn't fit in int - skip those
-   * cases. */
-  if (ts.tv_sec > (0x7fffffff - 3600*25))
-      return TRUE;
+    /* We just can't handle dates whose time_t doesn't fit in int - skip those
+     * cases. */
+    if (ts.tv_sec > (0x7fffffff - 3600 * 25))
+        return TRUE;
 
-  /* If we are east of UTC, we also can't handle dates whose tv_sec member
-   * falls in the range [0, -gnc_timezone(tm)) - make sure were are at least 12
-   * hours past the epoch to skip those cases too */
-  if (ts.tv_sec < 3600*12)
-      return TRUE;
+    /* If we are east of UTC, we also can't handle dates whose tv_sec member
+     * falls in the range [0, -gnc_timezone(tm)) - make sure were are at least 12
+     * hours past the epoch to skip those cases too */
+    if (ts.tv_sec < 3600 * 12)
+        return TRUE;
 
-  gnc_timespec_to_iso8601_buff (ts, str);
+    gnc_timespec_to_iso8601_buff (ts, str);
 
-  /* The time, in seconds, everywhere on the planet, is always
-   * the same, and is independent of location.  In particular,
-   * the time, in seconds, is identical to the local time in 
-   * Greenwich (GMT).
-   */
-  ts_2 = gnc_iso8601_to_timespec_gmt (str);
+    /* The time, in seconds, everywhere on the planet, is always
+     * the same, and is independent of location.  In particular,
+     * the time, in seconds, is identical to the local time in
+     * Greenwich (GMT).
+     */
+    ts_2 = gnc_iso8601_to_timespec_gmt (str);
 
-  ok = timespec_equal (&ts, &ts_2);
+    ok = timespec_equal (&ts, &ts_2);
 
-  if (!ok || always_print)
-  {
-    fprintf (stderr,
-             "\n%" G_GINT64_FORMAT ":%ld -> %s ->\n"
-             "\t%" G_GINT64_FORMAT ":%ld"
-             " (diff of %" G_GINT64_FORMAT " secs %ld nsecs)\n",
-             ts.tv_sec, ts.tv_nsec, str,
-             ts_2.tv_sec, ts_2.tv_nsec,
-             ts.tv_sec - ts_2.tv_sec, ts.tv_nsec - ts_2.tv_nsec);
+    if (!ok || always_print)
+    {
+        fprintf (stderr,
+                 "\n%" G_GINT64_FORMAT ":%ld -> %s ->\n"
+                 "\t%" G_GINT64_FORMAT ":%ld"
+                 " (diff of %" G_GINT64_FORMAT " secs %ld nsecs)\n",
+                 ts.tv_sec, ts.tv_nsec, str,
+                 ts_2.tv_sec, ts_2.tv_nsec,
+                 ts.tv_sec - ts_2.tv_sec, ts.tv_nsec - ts_2.tv_nsec);
 
-    if (!ok)
-    {
-      failure ("timespec to iso8601 string conversion failed");
-      return FALSE;
+        if (!ok)
+        {
+            failure ("timespec to iso8601 string conversion failed");
+            return FALSE;
+        }
     }
-  }
 
-  success ("timespec to iso8601 string conversion passes");
+    success ("timespec to iso8601 string conversion passes");
 
-  return TRUE;
+    return TRUE;
 }
 
 static gboolean
 check_conversion (const char * str, Timespec expected_ts)
 {
-  Timespec ts;
+    Timespec ts;
 
-  ts = gnc_iso8601_to_timespec_gmt (str);
+    ts = gnc_iso8601_to_timespec_gmt (str);
 
-  if ((expected_ts.tv_sec != ts.tv_sec) || (expected_ts.tv_nsec != ts.tv_nsec)) 
-  {
-    fprintf (stderr, 
-             "\nmis-converted \"%s\" to %" G_GUINT64_FORMAT ".%09ld seconds\n"
-             "\twas expecting %" G_GUINT64_FORMAT ".%09ld seconds\n", 
-             str, ts.tv_sec, ts.tv_nsec, 
-             expected_ts.tv_sec, expected_ts.tv_nsec); 
-    failure ("misconverted timespec");
-    return FALSE;
-  }
-  success ("good conversion");
-  return TRUE;
+    if ((expected_ts.tv_sec != ts.tv_sec) || (expected_ts.tv_nsec != ts.tv_nsec))
+    {
+        fprintf (stderr,
+                 "\nmis-converted \"%s\" to %" G_GUINT64_FORMAT ".%09ld seconds\n"
+                 "\twas expecting %" G_GUINT64_FORMAT ".%09ld seconds\n",
+                 str, ts.tv_sec, ts.tv_nsec,
+                 expected_ts.tv_sec, expected_ts.tv_nsec);
+        failure ("misconverted timespec");
+        return FALSE;
+    }
+    success ("good conversion");
+    return TRUE;
 }
 
 static void
 run_test (void)
 {
-  Timespec ts;
-  int i;
-  gboolean do_print = FALSE;
+    Timespec ts;
+    int i;
+    gboolean do_print = FALSE;
 
-  /* Now leaving the 60's:
-   *
-   * Black Panthers
-   * Weather Underground
-   * Kent State
-   * Evacuation of Vietnam
-   * Impeachment 
-   * Gas Crisis
-   * New York Garbage Crisis
-   * Stagflation
-   * Delapidated Bicentennial
-   * Sex Pistols
-   * Punk Rock
-   *
-   * Of course, anything had to be better than the miserable 70's, 
-   * which explains why Reagan was elected.  Food for thought.
-   */
-  ts.tv_sec = 10*365*24*3600 + 2*24*3600;
-  ts.tv_nsec = 0;
-  check_conversion ("1979-12-31 15:00:00.000000 -0900", ts);
-  check_conversion ("1979-12-31 16:00:00.000000 -0800", ts);
-  check_conversion ("1979-12-31 17:00:00.000000 -0700", ts);
-  check_conversion ("1979-12-31 18:00:00.000000 -0600", ts);
-  check_conversion ("1979-12-31 19:00:00.000000 -0500", ts);
-  check_conversion ("1979-12-31 20:00:00.000000 -0400", ts);
-  check_conversion ("1979-12-31 21:00:00.000000 -0300", ts);
-  check_conversion ("1979-12-31 22:00:00.000000 -0200", ts);
-  check_conversion ("1979-12-31 23:00:00.000000 -0100", ts);
+    /* Now leaving the 60's:
+     *
+     * Black Panthers
+     * Weather Underground
+     * Kent State
+     * Evacuation of Vietnam
+     * Impeachment
+     * Gas Crisis
+     * New York Garbage Crisis
+     * Stagflation
+     * Delapidated Bicentennial
+     * Sex Pistols
+     * Punk Rock
+     *
+     * Of course, anything had to be better than the miserable 70's,
+     * which explains why Reagan was elected.  Food for thought.
+     */
+    ts.tv_sec = 10 * 365 * 24 * 3600 + 2 * 24 * 3600;
+    ts.tv_nsec = 0;
+    check_conversion ("1979-12-31 15:00:00.000000 -0900", ts);
+    check_conversion ("1979-12-31 16:00:00.000000 -0800", ts);
+    check_conversion ("1979-12-31 17:00:00.000000 -0700", ts);
+    check_conversion ("1979-12-31 18:00:00.000000 -0600", ts);
+    check_conversion ("1979-12-31 19:00:00.000000 -0500", ts);
+    check_conversion ("1979-12-31 20:00:00.000000 -0400", ts);
+    check_conversion ("1979-12-31 21:00:00.000000 -0300", ts);
+    check_conversion ("1979-12-31 22:00:00.000000 -0200", ts);
+    check_conversion ("1979-12-31 23:00:00.000000 -0100", ts);
 
-  check_conversion ("1980-01-01 00:00:00.000000 -0000", ts);
-  check_conversion ("1980-01-01 00:00:00.000000 +0000", ts);
+    check_conversion ("1980-01-01 00:00:00.000000 -0000", ts);
+    check_conversion ("1980-01-01 00:00:00.000000 +0000", ts);
 
-  check_conversion ("1980-01-01 01:00:00.000000 +0100", ts);
-  check_conversion ("1980-01-01 02:00:00.000000 +0200", ts);
-  check_conversion ("1980-01-01 03:00:00.000000 +0300", ts);
-  check_conversion ("1980-01-01 04:00:00.000000 +0400", ts);
-  check_conversion ("1980-01-01 05:00:00.000000 +0500", ts);
-  check_conversion ("1980-01-01 06:00:00.000000 +0600", ts);
-  check_conversion ("1980-01-01 07:00:00.000000 +0700", ts);
-  check_conversion ("1980-01-01 08:00:00.000000 +0800", ts);
+    check_conversion ("1980-01-01 01:00:00.000000 +0100", ts);
+    check_conversion ("1980-01-01 02:00:00.000000 +0200", ts);
+    check_conversion ("1980-01-01 03:00:00.000000 +0300", ts);
+    check_conversion ("1980-01-01 04:00:00.000000 +0400", ts);
+    check_conversion ("1980-01-01 05:00:00.000000 +0500", ts);
+    check_conversion ("1980-01-01 06:00:00.000000 +0600", ts);
+    check_conversion ("1980-01-01 07:00:00.000000 +0700", ts);
+    check_conversion ("1980-01-01 08:00:00.000000 +0800", ts);
 
-  /* check minute-offsets as well */
-  check_conversion ("1980-01-01 08:01:00.000000 +0801", ts);
-  check_conversion ("1980-01-01 08:02:00.000000 +0802", ts);
-  check_conversion ("1980-01-01 08:03:00.000000 +0803", ts);
-  check_conversion ("1980-01-01 08:23:00.000000 +0823", ts);
-  check_conversion ("1980-01-01 08:35:00.000000 +0835", ts);
-  check_conversion ("1980-01-01 08:47:00.000000 +0847", ts);
-  check_conversion ("1980-01-01 08:59:00.000000 +0859", ts);
+    /* check minute-offsets as well */
+    check_conversion ("1980-01-01 08:01:00.000000 +0801", ts);
+    check_conversion ("1980-01-01 08:02:00.000000 +0802", ts);
+    check_conversion ("1980-01-01 08:03:00.000000 +0803", ts);
+    check_conversion ("1980-01-01 08:23:00.000000 +0823", ts);
+    check_conversion ("1980-01-01 08:35:00.000000 +0835", ts);
+    check_conversion ("1980-01-01 08:47:00.000000 +0847", ts);
+    check_conversion ("1980-01-01 08:59:00.000000 +0859", ts);
 
-  check_conversion ("1979-12-31 15:01:00.000000 -0859", ts);
-  check_conversion ("1979-12-31 15:02:00.000000 -0858", ts);
-  check_conversion ("1979-12-31 15:03:00.000000 -0857", ts);
-  check_conversion ("1979-12-31 15:23:00.000000 -0837", ts);
-  check_conversion ("1979-12-31 15:45:00.000000 -0815", ts);
+    check_conversion ("1979-12-31 15:01:00.000000 -0859", ts);
+    check_conversion ("1979-12-31 15:02:00.000000 -0858", ts);
+    check_conversion ("1979-12-31 15:03:00.000000 -0857", ts);
+    check_conversion ("1979-12-31 15:23:00.000000 -0837", ts);
+    check_conversion ("1979-12-31 15:45:00.000000 -0815", ts);
 
 
-  /* The 90's */
-  ts.tv_sec = 20*365*24*3600 + 5*24*3600;
-  ts.tv_nsec = 0;
-  check_conversion ("1989-12-31 15:00:00.000000 -0900", ts);
-  check_conversion ("1989-12-31 16:00:00.000000 -0800", ts);
-  check_conversion ("1989-12-31 17:00:00.000000 -0700", ts);
-  check_conversion ("1989-12-31 18:00:00.000000 -0600", ts);
-  check_conversion ("1989-12-31 19:00:00.000000 -0500", ts);
-  check_conversion ("1989-12-31 20:00:00.000000 -0400", ts);
-  check_conversion ("1989-12-31 21:00:00.000000 -0300", ts);
-  check_conversion ("1989-12-31 22:00:00.000000 -0200", ts);
-  check_conversion ("1989-12-31 23:00:00.000000 -0100", ts);
+    /* The 90's */
+    ts.tv_sec = 20 * 365 * 24 * 3600 + 5 * 24 * 3600;
+    ts.tv_nsec = 0;
+    check_conversion ("1989-12-31 15:00:00.000000 -0900", ts);
+    check_conversion ("1989-12-31 16:00:00.000000 -0800", ts);
+    check_conversion ("1989-12-31 17:00:00.000000 -0700", ts);
+    check_conversion ("1989-12-31 18:00:00.000000 -0600", ts);
+    check_conversion ("1989-12-31 19:00:00.000000 -0500", ts);
+    check_conversion ("1989-12-31 20:00:00.000000 -0400", ts);
+    check_conversion ("1989-12-31 21:00:00.000000 -0300", ts);
+    check_conversion ("1989-12-31 22:00:00.000000 -0200", ts);
+    check_conversion ("1989-12-31 23:00:00.000000 -0100", ts);
 
-  check_conversion ("1990-01-01 00:00:00.000000 -0000", ts);
-  check_conversion ("1990-01-01 00:00:00.000000 +0000", ts);
+    check_conversion ("1990-01-01 00:00:00.000000 -0000", ts);
+    check_conversion ("1990-01-01 00:00:00.000000 +0000", ts);
 
-  check_conversion ("1990-01-01 01:00:00.000000 +0100", ts);
-  check_conversion ("1990-01-01 02:00:00.000000 +0200", ts);
-  check_conversion ("1990-01-01 03:00:00.000000 +0300", ts);
-  check_conversion ("1990-01-01 04:00:00.000000 +0400", ts);
-  check_conversion ("1990-01-01 05:00:00.000000 +0500", ts);
-  check_conversion ("1990-01-01 06:00:00.000000 +0600", ts);
-  check_conversion ("1990-01-01 07:00:00.000000 +0700", ts);
-  check_conversion ("1990-01-01 08:00:00.000000 +0800", ts);
+    check_conversion ("1990-01-01 01:00:00.000000 +0100", ts);
+    check_conversion ("1990-01-01 02:00:00.000000 +0200", ts);
+    check_conversion ("1990-01-01 03:00:00.000000 +0300", ts);
+    check_conversion ("1990-01-01 04:00:00.000000 +0400", ts);
+    check_conversion ("1990-01-01 05:00:00.000000 +0500", ts);
+    check_conversion ("1990-01-01 06:00:00.000000 +0600", ts);
+    check_conversion ("1990-01-01 07:00:00.000000 +0700", ts);
+    check_conversion ("1990-01-01 08:00:00.000000 +0800", ts);
 
-  /* check minute-offsets as well */
-  check_conversion ("1990-01-01 08:01:00.000000 +0801", ts);
-  check_conversion ("1990-01-01 08:02:00.000000 +0802", ts);
-  check_conversion ("1990-01-01 08:03:00.000000 +0803", ts);
-  check_conversion ("1990-01-01 08:23:00.000000 +0823", ts);
-  check_conversion ("1990-01-01 08:35:00.000000 +0835", ts);
-  check_conversion ("1990-01-01 08:47:00.000000 +0847", ts);
-  check_conversion ("1990-01-01 08:59:00.000000 +0859", ts);
+    /* check minute-offsets as well */
+    check_conversion ("1990-01-01 08:01:00.000000 +0801", ts);
+    check_conversion ("1990-01-01 08:02:00.000000 +0802", ts);
+    check_conversion ("1990-01-01 08:03:00.000000 +0803", ts);
+    check_conversion ("1990-01-01 08:23:00.000000 +0823", ts);
+    check_conversion ("1990-01-01 08:35:00.000000 +0835", ts);
+    check_conversion ("1990-01-01 08:47:00.000000 +0847", ts);
+    check_conversion ("1990-01-01 08:59:00.000000 +0859", ts);
 
-  check_conversion ("1989-12-31 15:01:00.000000 -0859", ts);
-  check_conversion ("1989-12-31 15:02:00.000000 -0858", ts);
-  check_conversion ("1989-12-31 15:03:00.000000 -0857", ts);
-  check_conversion ("1989-12-31 15:23:00.000000 -0837", ts);
-  check_conversion ("1989-12-31 15:45:00.000000 -0815", ts);
+    check_conversion ("1989-12-31 15:01:00.000000 -0859", ts);
+    check_conversion ("1989-12-31 15:02:00.000000 -0858", ts);
+    check_conversion ("1989-12-31 15:03:00.000000 -0857", ts);
+    check_conversion ("1989-12-31 15:23:00.000000 -0837", ts);
+    check_conversion ("1989-12-31 15:45:00.000000 -0815", ts);
 
 
-  /* The naughties */
-  ts.tv_sec = 30*365*24*3600 + 7*24*3600;
-  ts.tv_nsec = 0;
-  check_conversion ("1999-12-31 15:00:00.000000 -0900", ts);
-  check_conversion ("1999-12-31 16:00:00.000000 -0800", ts);
-  check_conversion ("1999-12-31 17:00:00.000000 -0700", ts);
-  check_conversion ("1999-12-31 18:00:00.000000 -0600", ts);
-  check_conversion ("1999-12-31 19:00:00.000000 -0500", ts);
-  check_conversion ("1999-12-31 20:00:00.000000 -0400", ts);
-  check_conversion ("1999-12-31 21:00:00.000000 -0300", ts);
-  check_conversion ("1999-12-31 22:00:00.000000 -0200", ts);
-  check_conversion ("1999-12-31 23:00:00.000000 -0100", ts);
+    /* The naughties */
+    ts.tv_sec = 30 * 365 * 24 * 3600 + 7 * 24 * 3600;
+    ts.tv_nsec = 0;
+    check_conversion ("1999-12-31 15:00:00.000000 -0900", ts);
+    check_conversion ("1999-12-31 16:00:00.000000 -0800", ts);
+    check_conversion ("1999-12-31 17:00:00.000000 -0700", ts);
+    check_conversion ("1999-12-31 18:00:00.000000 -0600", ts);
+    check_conversion ("1999-12-31 19:00:00.000000 -0500", ts);
+    check_conversion ("1999-12-31 20:00:00.000000 -0400", ts);
+    check_conversion ("1999-12-31 21:00:00.000000 -0300", ts);
+    check_conversion ("1999-12-31 22:00:00.000000 -0200", ts);
+    check_conversion ("1999-12-31 23:00:00.000000 -0100", ts);
 
-  check_conversion ("2000-01-01 00:00:00.000000 -0000", ts);
-  check_conversion ("2000-01-01 00:00:00.000000 +0000", ts);
+    check_conversion ("2000-01-01 00:00:00.000000 -0000", ts);
+    check_conversion ("2000-01-01 00:00:00.000000 +0000", ts);
 
-  check_conversion ("2000-01-01 01:00:00.000000 +0100", ts);
-  check_conversion ("2000-01-01 02:00:00.000000 +0200", ts);
-  check_conversion ("2000-01-01 03:00:00.000000 +0300", ts);
-  check_conversion ("2000-01-01 04:00:00.000000 +0400", ts);
-  check_conversion ("2000-01-01 05:00:00.000000 +0500", ts);
-  check_conversion ("2000-01-01 06:00:00.000000 +0600", ts);
-  check_conversion ("2000-01-01 07:00:00.000000 +0700", ts);
-  check_conversion ("2000-01-01 08:00:00.000000 +0800", ts);
+    check_conversion ("2000-01-01 01:00:00.000000 +0100", ts);
+    check_conversion ("2000-01-01 02:00:00.000000 +0200", ts);
+    check_conversion ("2000-01-01 03:00:00.000000 +0300", ts);
+    check_conversion ("2000-01-01 04:00:00.000000 +0400", ts);
+    check_conversion ("2000-01-01 05:00:00.000000 +0500", ts);
+    check_conversion ("2000-01-01 06:00:00.000000 +0600", ts);
+    check_conversion ("2000-01-01 07:00:00.000000 +0700", ts);
+    check_conversion ("2000-01-01 08:00:00.000000 +0800", ts);
 
-  /* check minute-offsets as well */
-  check_conversion ("2000-01-01 08:01:00.000000 +0801", ts);
-  check_conversion ("2000-01-01 08:02:00.000000 +0802", ts);
-  check_conversion ("2000-01-01 08:03:00.000000 +0803", ts);
-  check_conversion ("2000-01-01 08:23:00.000000 +0823", ts);
-  check_conversion ("2000-01-01 08:35:00.000000 +0835", ts);
-  check_conversion ("2000-01-01 08:47:00.000000 +0847", ts);
-  check_conversion ("2000-01-01 08:59:00.000000 +0859", ts);
+    /* check minute-offsets as well */
+    check_conversion ("2000-01-01 08:01:00.000000 +0801", ts);
+    check_conversion ("2000-01-01 08:02:00.000000 +0802", ts);
+    check_conversion ("2000-01-01 08:03:00.000000 +0803", ts);
+    check_conversion ("2000-01-01 08:23:00.000000 +0823", ts);
+    check_conversion ("2000-01-01 08:35:00.000000 +0835", ts);
+    check_conversion ("2000-01-01 08:47:00.000000 +0847", ts);
+    check_conversion ("2000-01-01 08:59:00.000000 +0859", ts);
 
-  check_conversion ("1999-12-31 15:01:00.000000 -0859", ts);
-  check_conversion ("1999-12-31 15:02:00.000000 -0858", ts);
-  check_conversion ("1999-12-31 15:03:00.000000 -0857", ts);
-  check_conversion ("1999-12-31 15:23:00.000000 -0837", ts);
-  check_conversion ("1999-12-31 15:45:00.000000 -0815", ts);
+    check_conversion ("1999-12-31 15:01:00.000000 -0859", ts);
+    check_conversion ("1999-12-31 15:02:00.000000 -0858", ts);
+    check_conversion ("1999-12-31 15:03:00.000000 -0857", ts);
+    check_conversion ("1999-12-31 15:23:00.000000 -0837", ts);
+    check_conversion ("1999-12-31 15:45:00.000000 -0815", ts);
 
 
-  /* The nows */
-  ts.tv_sec = 35*365*24*3600 + 9*24*3600;
-  ts.tv_nsec = 0;
-  check_conversion ("2004-12-31 15:00:00.000000 -0900", ts);
-  check_conversion ("2004-12-31 16:00:00.000000 -0800", ts);
-  check_conversion ("2004-12-31 17:00:00.000000 -0700", ts);
-  check_conversion ("2004-12-31 18:00:00.000000 -0600", ts);
-  check_conversion ("2004-12-31 19:00:00.000000 -0500", ts);
-  check_conversion ("2004-12-31 20:00:00.000000 -0400", ts);
-  check_conversion ("2004-12-31 21:00:00.000000 -0300", ts);
-  check_conversion ("2004-12-31 22:00:00.000000 -0200", ts);
-  check_conversion ("2004-12-31 23:00:00.000000 -0100", ts);
+    /* The nows */
+    ts.tv_sec = 35 * 365 * 24 * 3600 + 9 * 24 * 3600;
+    ts.tv_nsec = 0;
+    check_conversion ("2004-12-31 15:00:00.000000 -0900", ts);
+    check_conversion ("2004-12-31 16:00:00.000000 -0800", ts);
+    check_conversion ("2004-12-31 17:00:00.000000 -0700", ts);
+    check_conversion ("2004-12-31 18:00:00.000000 -0600", ts);
+    check_conversion ("2004-12-31 19:00:00.000000 -0500", ts);
+    check_conversion ("2004-12-31 20:00:00.000000 -0400", ts);
+    check_conversion ("2004-12-31 21:00:00.000000 -0300", ts);
+    check_conversion ("2004-12-31 22:00:00.000000 -0200", ts);
+    check_conversion ("2004-12-31 23:00:00.000000 -0100", ts);
 
-  check_conversion ("2005-01-01 00:00:00.000000 -0000", ts);
-  check_conversion ("2005-01-01 00:00:00.000000 +0000", ts);
+    check_conversion ("2005-01-01 00:00:00.000000 -0000", ts);
+    check_conversion ("2005-01-01 00:00:00.000000 +0000", ts);
 
-  check_conversion ("2005-01-01 01:00:00.000000 +0100", ts);
-  check_conversion ("2005-01-01 02:00:00.000000 +0200", ts);
-  check_conversion ("2005-01-01 03:00:00.000000 +0300", ts);
-  check_conversion ("2005-01-01 04:00:00.000000 +0400", ts);
-  check_conversion ("2005-01-01 05:00:00.000000 +0500", ts);
-  check_conversion ("2005-01-01 06:00:00.000000 +0600", ts);
-  check_conversion ("2005-01-01 07:00:00.000000 +0700", ts);
-  check_conversion ("2005-01-01 08:00:00.000000 +0800", ts);
+    check_conversion ("2005-01-01 01:00:00.000000 +0100", ts);
+    check_conversion ("2005-01-01 02:00:00.000000 +0200", ts);
+    check_conversion ("2005-01-01 03:00:00.000000 +0300", ts);
+    check_conversion ("2005-01-01 04:00:00.000000 +0400", ts);
+    check_conversion ("2005-01-01 05:00:00.000000 +0500", ts);
+    check_conversion ("2005-01-01 06:00:00.000000 +0600", ts);
+    check_conversion ("2005-01-01 07:00:00.000000 +0700", ts);
+    check_conversion ("2005-01-01 08:00:00.000000 +0800", ts);
 
-  /* check minute-offsets as well */
-  check_conversion ("2005-01-01 08:01:00.000000 +0801", ts);
-  check_conversion ("2005-01-01 08:02:00.000000 +0802", ts);
-  check_conversion ("2005-01-01 08:03:00.000000 +0803", ts);
-  check_conversion ("2005-01-01 08:23:00.000000 +0823", ts);
-  check_conversion ("2005-01-01 08:35:00.000000 +0835", ts);
-  check_conversion ("2005-01-01 08:47:00.000000 +0847", ts);
-  check_conversion ("2005-01-01 08:59:00.000000 +0859", ts);
+    /* check minute-offsets as well */
+    check_conversion ("2005-01-01 08:01:00.000000 +0801", ts);
+    check_conversion ("2005-01-01 08:02:00.000000 +0802", ts);
+    check_conversion ("2005-01-01 08:03:00.000000 +0803", ts);
+    check_conversion ("2005-01-01 08:23:00.000000 +0823", ts);
+    check_conversion ("2005-01-01 08:35:00.000000 +0835", ts);
+    check_conversion ("2005-01-01 08:47:00.000000 +0847", ts);
+    check_conversion ("2005-01-01 08:59:00.000000 +0859", ts);
 
-  check_conversion ("2004-12-31 15:01:00.000000 -0859", ts);
-  check_conversion ("2004-12-31 15:02:00.000000 -0858", ts);
-  check_conversion ("2004-12-31 15:03:00.000000 -0857", ts);
-  check_conversion ("2004-12-31 15:23:00.000000 -0837", ts);
-  check_conversion ("2004-12-31 15:45:00.000000 -0815", ts);
+    check_conversion ("2004-12-31 15:01:00.000000 -0859", ts);
+    check_conversion ("2004-12-31 15:02:00.000000 -0858", ts);
+    check_conversion ("2004-12-31 15:03:00.000000 -0857", ts);
+    check_conversion ("2004-12-31 15:23:00.000000 -0837", ts);
+    check_conversion ("2004-12-31 15:45:00.000000 -0815", ts);
 
 
-  /* Various leap-year days and near-leap times. */
-  ts = gnc_iso8601_to_timespec_gmt ("1980-02-29 00:00:00.000000 -0000");
-  check_time (ts, do_print);
+    /* Various leap-year days and near-leap times. */
+    ts = gnc_iso8601_to_timespec_gmt ("1980-02-29 00:00:00.000000 -0000");
+    check_time (ts, do_print);
 
-  ts = gnc_iso8601_to_timespec_gmt ("1979-02-28 00:00:00.000000 -0000");
-  check_time (ts, do_print);
+    ts = gnc_iso8601_to_timespec_gmt ("1979-02-28 00:00:00.000000 -0000");
+    check_time (ts, do_print);
 
-  ts = gnc_iso8601_to_timespec_gmt ("1990-02-28 00:00:00.000000 -0000");
-  check_time (ts, do_print);
+    ts = gnc_iso8601_to_timespec_gmt ("1990-02-28 00:00:00.000000 -0000");
+    check_time (ts, do_print);
 
-  ts = gnc_iso8601_to_timespec_gmt ("2000-02-29 00:00:00.000000 -0000");
-  check_time (ts, do_print);
+    ts = gnc_iso8601_to_timespec_gmt ("2000-02-29 00:00:00.000000 -0000");
+    check_time (ts, do_print);
 
-  ts = gnc_iso8601_to_timespec_gmt ("2004-02-29 00:00:00.000000 -0000");
-  check_time (ts, do_print);
+    ts = gnc_iso8601_to_timespec_gmt ("2004-02-29 00:00:00.000000 -0000");
+    check_time (ts, do_print);
 
-  ts = gnc_iso8601_to_timespec_gmt ("2008-02-29 00:00:00.000000 -0000");
-  check_time (ts, do_print);
+    ts = gnc_iso8601_to_timespec_gmt ("2008-02-29 00:00:00.000000 -0000");
+    check_time (ts, do_print);
 
-  ts = gnc_iso8601_to_timespec_gmt ("2008-02-29 00:01:00.000000 -0000");
-  check_time (ts, do_print);
+    ts = gnc_iso8601_to_timespec_gmt ("2008-02-29 00:01:00.000000 -0000");
+    check_time (ts, do_print);
 
-  ts = gnc_iso8601_to_timespec_gmt ("2008-02-29 02:02:00.000000 -0000");
-  check_time (ts, do_print);
+    ts = gnc_iso8601_to_timespec_gmt ("2008-02-29 02:02:00.000000 -0000");
+    check_time (ts, do_print);
 
-  ts = gnc_iso8601_to_timespec_gmt ("2008-02-28 23:23:23.000000 -0000");
-  check_time (ts, do_print);
+    ts = gnc_iso8601_to_timespec_gmt ("2008-02-28 23:23:23.000000 -0000");
+    check_time (ts, do_print);
 
-  /* Here's a date ten days after the 2038 rollover that should work
-     if/when we support it. */
-  ts.tv_nsec = 0;
-  ts.tv_sec = (long long int) 0x7fffffff + 3600*24*10;
-  //check_time(ts, do_print);
+    /* Here's a date ten days after the 2038 rollover that should work
+       if/when we support it. */
+    ts.tv_nsec = 0;
+    ts.tv_sec = (long long int) 0x7fffffff + 3600 * 24 * 10;
+    //check_time(ts, do_print);
 
-  /* Various 'special' times. What makes these so special? */
-  ts.tv_sec = 152098136;
-  ts.tv_nsec = 0;
-  check_time (ts, do_print);
+    /* Various 'special' times. What makes these so special? */
+    ts.tv_sec = 152098136;
+    ts.tv_nsec = 0;
+    check_time (ts, do_print);
 
-  ts.tv_sec = 1162088421;
-  ts.tv_nsec = 12548000;
-  check_time (ts, do_print);
+    ts.tv_sec = 1162088421;
+    ts.tv_nsec = 12548000;
+    check_time (ts, do_print);
 
-  ts.tv_sec = 325659000 - 6500;
-  ts.tv_nsec = 0;
-  check_time (ts, do_print);
+    ts.tv_sec = 325659000 - 6500;
+    ts.tv_nsec = 0;
+    check_time (ts, do_print);
 
-  ts.tv_sec = 1143943200;
-  ts.tv_nsec = 0;
-  check_time (ts, do_print);
+    ts.tv_sec = 1143943200;
+    ts.tv_nsec = 0;
+    check_time (ts, do_print);
 
-  ts.tv_sec = 1603591171;
-  ts.tv_nsec = 595311000;
-  check_time (ts, do_print);
+    ts.tv_sec = 1603591171;
+    ts.tv_nsec = 595311000;
+    check_time (ts, do_print);
 
-  ts.tv_sec = 1738909365;
-  ts.tv_nsec = 204102000;
-  check_time (ts, do_print);
+    ts.tv_sec = 1738909365;
+    ts.tv_nsec = 204102000;
+    check_time (ts, do_print);
 
-  ts.tv_sec = 1603591171;
-  ts.tv_nsec = 595311000;
-  check_time (ts, do_print);
+    ts.tv_sec = 1603591171;
+    ts.tv_nsec = 595311000;
+    check_time (ts, do_print);
 
-  ts.tv_sec = 1143943200 - 1;
-  ts.tv_nsec = 0;
-  check_time (ts, do_print);
+    ts.tv_sec = 1143943200 - 1;
+    ts.tv_nsec = 0;
+    check_time (ts, do_print);
 
-  ts.tv_sec = 1143943200;
-  ts.tv_nsec = 0;
-  check_time (ts, do_print);
+    ts.tv_sec = 1143943200;
+    ts.tv_nsec = 0;
+    check_time (ts, do_print);
 
-  ts.tv_sec = 1143943200 + (7 * 60 * 60);
-  ts.tv_nsec = 0;
-  check_time (ts, do_print);
+    ts.tv_sec = 1143943200 + (7 * 60 * 60);
+    ts.tv_nsec = 0;
+    check_time (ts, do_print);
 
-  ts.tv_sec = 1143943200 + (8 * 60 * 60);
-  ts.tv_nsec = 0;
-  check_time (ts, do_print);
+    ts.tv_sec = 1143943200 + (8 * 60 * 60);
+    ts.tv_nsec = 0;
+    check_time (ts, do_print);
 
-  ts = *get_random_timespec ();
+    ts = *get_random_timespec ();
 
-  for (i = 0; i < 10000; i++)
-  {
-    ts.tv_sec += 10800;
-    if (!check_time (ts, FALSE))
-      return;
-  }
+    for (i = 0; i < 10000; i++)
+    {
+        ts.tv_sec += 10800;
+        if (!check_time (ts, FALSE))
+            return;
+    }
 
-  for (i = 0; i < 5000; i++)
-  {
-    ts = *get_random_timespec ();
+    for (i = 0; i < 5000; i++)
+    {
+        ts = *get_random_timespec ();
 
-    if (!check_time (ts, FALSE))
-      return;
-  }
+        if (!check_time (ts, FALSE))
+            return;
+    }
 }
 
 int
 main (int argc, char **argv)
 {
-  run_test ();
+    run_test ();
 
-  success ("dates seem to work");
+    success ("dates seem to work");
 
-  print_test_results();
-  exit(get_rv());
+    print_test_results();
+    exit(get_rv());
 }

Modified: gnucash/trunk/src/engine/test/test-group-vs-book.c
===================================================================
--- gnucash/trunk/src/engine/test/test-group-vs-book.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-group-vs-book.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -34,142 +34,143 @@
 static gboolean
 account_tree_has_book (Account *parent, QofBook *book)
 {
-  GList *children, *node;
+    GList *children, *node;
 
-  if (!parent)
-    return (book == NULL);
+    if (!parent)
+        return (book == NULL);
 
-  if (gnc_account_get_book(parent) != book)
-    return FALSE;
+    if (gnc_account_get_book(parent) != book)
+        return FALSE;
 
-  children = gnc_account_get_children(parent);
-  for (node = children; node; node = node->next)
-  {
-    if (!account_tree_has_book (node->data, book))
-      return FALSE;
-  }
-  g_list_free(children);
+    children = gnc_account_get_children(parent);
+    for (node = children; node; node = node->next)
+    {
+        if (!account_tree_has_book (node->data, book))
+            return FALSE;
+    }
+    g_list_free(children);
 
-  return TRUE;
+    return TRUE;
 }
 
 
 static void
 run_test (void)
 {
-  Account *root1;
-  Account *root2;
-  Account *account1;
-  Account *account2;
-  QofBook *book;
+    Account *root1;
+    Account *root2;
+    Account *account1;
+    Account *account2;
+    QofBook *book;
 
-  book = qof_book_new ();
-  if (!book)
-  {
-    failure("book not created");
-    exit(get_rv());
-  }
+    book = qof_book_new ();
+    if (!book)
+    {
+        failure("book not created");
+        exit(get_rv());
+    }
 
-  root1 = get_random_account (book);
-  if(!root1)
-  {
-    failure("root1 not created");
-    exit(get_rv());
-  }
+    root1 = get_random_account (book);
+    if (!root1)
+    {
+        failure("root1 not created");
+        exit(get_rv());
+    }
 
-  if (!account_tree_has_book (root1, book))
-  {
-    failure("new root has wrong book");
-    exit(get_rv());
-  }
+    if (!account_tree_has_book (root1, book))
+    {
+        failure("new root has wrong book");
+        exit(get_rv());
+    }
 
-  /* This test is testing routines that are private
-   * to the engine. these tests are intended to test
-   * the engine as a whole, not just the public
-   * interface. the maintenance of the correct
-   * book pointers is important for correct
-   * engine operation. */
-  gnc_book_set_root_account (book, root1);
-  if (!account_tree_has_book (root1, book))
-  {
-    failure("gnc_book_set_root_account didn't take");
-    exit(get_rv());
-  }
+    /* This test is testing routines that are private
+     * to the engine. these tests are intended to test
+     * the engine as a whole, not just the public
+     * interface. the maintenance of the correct
+     * book pointers is important for correct
+     * engine operation. */
+    gnc_book_set_root_account (book, root1);
+    if (!account_tree_has_book (root1, book))
+    {
+        failure("gnc_book_set_root_account didn't take");
+        exit(get_rv());
+    }
 
-  root2 = get_random_account (book);
-  if(!root2)
-  {
-    failure("root2 not created");
-    exit(get_rv());
-  }
+    root2 = get_random_account (book);
+    if (!root2)
+    {
+        failure("root2 not created");
+        exit(get_rv());
+    }
 
-  gnc_book_set_root_account (book, root2);
+    gnc_book_set_root_account (book, root2);
 
 #if 0
-  /* a group cannot have a 'null' book; this test is nonsense. */
-  if (!account_tree_has_book (root1, NULL))
-  {
-    failure("gnc_book_set_root_account didn't clear old");
-    exit(get_rv());
-  }
+    /* a group cannot have a 'null' book; this test is nonsense. */
+    if (!account_tree_has_book (root1, NULL))
+    {
+        failure("gnc_book_set_root_account didn't clear old");
+        exit(get_rv());
+    }
 #endif
 
-  if (!account_tree_has_book (root2, book))
-  {
-    failure("gnc_book_set_root_account didn't take");
-    exit(get_rv());
-  }
+    if (!account_tree_has_book (root2, book))
+    {
+        failure("gnc_book_set_root_account didn't take");
+        exit(get_rv());
+    }
 
-  account1 = get_random_account (book);
-  if(!account1)
-  {
-    failure("account1 not created");
-    exit(get_rv());
-  }
+    account1 = get_random_account (book);
+    if (!account1)
+    {
+        failure("account1 not created");
+        exit(get_rv());
+    }
 
-  gnc_account_append_child (root2, account1);
-  if (root2 != gnc_account_get_parent (account1))
-  {
-    failure("group insert account didn't work");
-    exit(get_rv());
-  }
+    gnc_account_append_child (root2, account1);
+    if (root2 != gnc_account_get_parent (account1))
+    {
+        failure("group insert account didn't work");
+        exit(get_rv());
+    }
 
-  account2 = get_random_account (book);
-  if(!account2)
-  {
-    failure("account2 not created");
-    exit(get_rv());
-  }
+    account2 = get_random_account (book);
+    if (!account2)
+    {
+        failure("account2 not created");
+        exit(get_rv());
+    }
 
-  gnc_account_append_child (account1, account2);
-  if (!account_tree_has_book (gnc_account_get_parent (account2), book))
-  {
-    failure("account2 has wrong book");
-    exit(get_rv());
-  }
+    gnc_account_append_child (account1, account2);
+    if (!account_tree_has_book (gnc_account_get_parent (account2), book))
+    {
+        failure("account2 has wrong book");
+        exit(get_rv());
+    }
 
-  gnc_account_remove_child (root2, account1);
-  if (gnc_account_get_parent (account1) != NULL)
-  {
-    failure("remove group didn't take");
-    exit(get_rv());
-  }
+    gnc_account_remove_child (root2, account1);
+    if (gnc_account_get_parent (account1) != NULL)
+    {
+        failure("remove group didn't take");
+        exit(get_rv());
+    }
 }
 
 int
 main (int argc, char **argv)
 {
-	gint i;
-	qof_init();
-	if(cashobjects_register()) {
-  xaccLogDisable ();
-  for (i = 0; i < 10; i++)
-		{
-    run_test ();
-		}
-  success ("group/book stuff seems to work");
-  print_test_results();
-	}
-	qof_close();
-  return get_rv();
+    gint i;
+    qof_init();
+    if (cashobjects_register())
+    {
+        xaccLogDisable ();
+        for (i = 0; i < 10; i++)
+        {
+            run_test ();
+        }
+        success ("group/book stuff seems to work");
+        print_test_results();
+    }
+    qof_close();
+    return get_rv();
 }

Modified: gnucash/trunk/src/engine/test/test-guid.c
===================================================================
--- gnucash/trunk/src/engine/test/test-guid.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-guid.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -38,62 +38,63 @@
 
 static void test_null_guid(void)
 {
-  GUID g;
-  GUID *gp;
+    GUID g;
+    GUID *gp;
 
-  g = guid_new_return();
-  gp = guid_malloc();
-  guid_new(gp);
+    g = guid_new_return();
+    gp = guid_malloc();
+    guid_new(gp);
 
-  do_test(guid_equal(guid_null(), guid_null()), "null guids equal");
-  do_test(!guid_equal(&g, gp), "two guids equal");
+    do_test(guid_equal(guid_null(), guid_null()), "null guids equal");
+    do_test(!guid_equal(&g, gp), "two guids equal");
 }
 
 static void
 run_test (void)
 {
-  int i;
-  QofSession *sess;
-  QofBook *book;
-  QofInstance *ent, *eblk[NENT];
-  QofCollection *col;
-  QofIdType type;
-  GUID guid;
+    int i;
+    QofSession *sess;
+    QofBook *book;
+    QofInstance *ent, *eblk[NENT];
+    QofCollection *col;
+    QofIdType type;
+    GUID guid;
 
-  sess = get_random_session ();
-  book = qof_session_get_book (sess);
-  do_test ((NULL != book), "book not created");
+    sess = get_random_session ();
+    book = qof_session_get_book (sess);
+    do_test ((NULL != book), "book not created");
 
-  col = qof_book_get_collection (book, "asdf");
-  type = qof_collection_get_type (col);
-  
-  for (i=0; i<NENT; i++)
-  {
-    ent = g_object_new(QOF_TYPE_INSTANCE, NULL);
-    eblk[i] = ent;
-    guid_new(&guid);
-    ent = g_object_new(QOF_TYPE_INSTANCE, "guid", &guid, NULL);
-    do_test ((NULL == qof_collection_lookup_entity (col, &guid)),
-						  "duplicate guid");
-	 ent->e_type = type;
-	 qof_collection_insert_entity (col, ent);
-         do_test ((NULL != qof_collection_lookup_entity (col, &guid)),
-                  "guid not found");
-  }
+    col = qof_book_get_collection (book, "asdf");
+    type = qof_collection_get_type (col);
 
-  /* Make valgrind happy -- destroy the session. */
-  qof_session_destroy(sess);
+    for (i = 0; i < NENT; i++)
+    {
+        ent = g_object_new(QOF_TYPE_INSTANCE, NULL);
+        eblk[i] = ent;
+        guid_new(&guid);
+        ent = g_object_new(QOF_TYPE_INSTANCE, "guid", &guid, NULL);
+        do_test ((NULL == qof_collection_lookup_entity (col, &guid)),
+                 "duplicate guid");
+        ent->e_type = type;
+        qof_collection_insert_entity (col, ent);
+        do_test ((NULL != qof_collection_lookup_entity (col, &guid)),
+                 "guid not found");
+    }
+
+    /* Make valgrind happy -- destroy the session. */
+    qof_session_destroy(sess);
 }
 
 int
 main (int argc, char **argv)
 {
-	qof_init();
-	if(cashobjects_register()) {
-		test_null_guid();
-		run_test ();
-		print_test_results();
-	}
-	qof_close();
-  return get_rv();
+    qof_init();
+    if (cashobjects_register())
+    {
+        test_null_guid();
+        run_test ();
+        print_test_results();
+    }
+    qof_close();
+    return get_rv();
 }

Modified: gnucash/trunk/src/engine/test/test-link.c
===================================================================
--- gnucash/trunk/src/engine/test/test-link.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-link.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
 int
 main(int argc, char ** argv)
 {
-  return 0;
+    return 0;
 }

Modified: gnucash/trunk/src/engine/test/test-load-engine.c
===================================================================
--- gnucash/trunk/src/engine/test/test-load-engine.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-load-engine.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,7 +20,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -31,17 +31,18 @@
 static void
 run_test(void)
 {
-	do_test(TRUE, "test engine loaded OK");
+    do_test(TRUE, "test engine loaded OK");
 }
 
 int
 main (int argc, char ** argv)
 {
-	qof_init();
-	if(cashobjects_register()) {
-		run_test ();
-		print_test_results();
-	}
-	qof_close();
-  return get_rv();
+    qof_init();
+    if (cashobjects_register())
+    {
+        run_test ();
+        print_test_results();
+    }
+    qof_close();
+    return get_rv();
 }

Modified: gnucash/trunk/src/engine/test/test-lots.c
===================================================================
--- gnucash/trunk/src/engine/test/test-lots.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-lots.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -19,7 +19,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
-/** 
+/**
  * @file test-lots.c
  * @brief Minimal test to see if automatic lot scrubbing works.
  * @author Linas Vepstas <linas at linas.org>
@@ -42,30 +42,30 @@
 static void
 run_test (void)
 {
-  QofSession *sess;
-  QofBook *book;
-  Account *root;
+    QofSession *sess;
+    QofBook *book;
+    Account *root;
 
-  /* --------------------------------------------------------- */
-  /* In the first test, we will merely try to see if we can run
-   * without crashing.  We don't check to see if data is good. */
-  sess = get_random_session ();
-  book = qof_session_get_book (sess);
-  do_test ((NULL != book), "create random data");
+    /* --------------------------------------------------------- */
+    /* In the first test, we will merely try to see if we can run
+     * without crashing.  We don't check to see if data is good. */
+    sess = get_random_session ();
+    book = qof_session_get_book (sess);
+    do_test ((NULL != book), "create random data");
 
-  add_random_transactions_to_book (book, transaction_num);
+    add_random_transactions_to_book (book, transaction_num);
 
-  root = gnc_book_get_root_account (book);
-  xaccAccountTreeScrubLots (root);
+    root = gnc_book_get_root_account (book);
+    xaccAccountTreeScrubLots (root);
 
-  /* --------------------------------------------------------- */
-  /* In the second test, we create an account with unrealized gains,
-   * and see if that gets fixed correctly, with the correct balances,
-   * and etc.
-   * XXX not implemented 
-   */
-  success ("automatic lot scrubbing lightly tested and seem to work");
-  qof_session_end (sess);
+    /* --------------------------------------------------------- */
+    /* In the second test, we create an account with unrealized gains,
+     * and see if that gets fixed correctly, with the correct balances,
+     * and etc.
+     * XXX not implemented
+     */
+    success ("automatic lot scrubbing lightly tested and seem to work");
+    qof_session_end (sess);
 
 }
 
@@ -84,9 +84,10 @@
     /* Set up a reproducible test-case */
     srand(0);
     /* Iterate the test a number of times */
-    for (i=0; i< max_iterate; i++) {
+    for (i = 0; i < max_iterate; i++)
+    {
         fprintf(stdout, " Lots: %d of %d paired tests . . . \r",
-                (i + 1)*2, max_iterate * 2);
+                (i + 1) * 2, max_iterate * 2);
         fflush(stdout);
         run_test ();
     }

Modified: gnucash/trunk/src/engine/test/test-numeric.c
===================================================================
--- gnucash/trunk/src/engine/test/test-numeric.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-numeric.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -21,8 +21,8 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
 
+
 #include "config.h"
 #include <ctype.h>
 #include <glib.h>
@@ -34,46 +34,46 @@
 #define NREPS 2000
 
 static char *
-gnc_numeric_print(gnc_numeric in) 
+gnc_numeric_print(gnc_numeric in)
 {
-  char * retval;
-  if(gnc_numeric_check(in)) 
-  {
-    retval = g_strdup_printf("<ERROR> [%" G_GINT64_FORMAT " / %" G_GINT64_FORMAT "]",
-                             in.num,
-                             in.denom); 
-  }
-  else 
-  {
-    retval = g_strdup_printf("[%" G_GINT64_FORMAT " / %" G_GINT64_FORMAT "]",
-                             in.num,
-                             in.denom); 
-  }
-  return retval;
+    char * retval;
+    if (gnc_numeric_check(in))
+    {
+        retval = g_strdup_printf("<ERROR> [%" G_GINT64_FORMAT " / %" G_GINT64_FORMAT "]",
+                                 in.num,
+                                 in.denom);
+    }
+    else
+    {
+        retval = g_strdup_printf("[%" G_GINT64_FORMAT " / %" G_GINT64_FORMAT "]",
+                                 in.num,
+                                 in.denom);
+    }
+    return retval;
 }
 
 /* ======================================================= */
 
 #define check_unary_op(eq,ex,a,i,e) check_unary_op_r(eq,ex,a,i,e,__LINE__)
 static void
-check_unary_op_r (gboolean (*eqtest) (gnc_numeric, gnc_numeric), 
-		  gnc_numeric expected, 
-		  gnc_numeric actual, 
-		  gnc_numeric input, 
-		  const char * errmsg,
-		  int line)
+check_unary_op_r (gboolean (*eqtest) (gnc_numeric, gnc_numeric),
+                  gnc_numeric expected,
+                  gnc_numeric actual,
+                  gnc_numeric input,
+                  const char * errmsg,
+                  int line)
 {
-	char *e = gnc_numeric_print (expected);
-	char *r = gnc_numeric_print (actual);
-	char *a = gnc_numeric_print (input);
-	char *str = g_strdup_printf (errmsg, e,r, a);
-	
-	do_test_call (eqtest(expected, actual), str, __FILE__, line);
-	
-	g_free (a);
-	g_free (r);
-	g_free (e);
-	g_free (str);
+    char *e = gnc_numeric_print (expected);
+    char *r = gnc_numeric_print (actual);
+    char *a = gnc_numeric_print (input);
+    char *str = g_strdup_printf (errmsg, e, r, a);
+
+    do_test_call (eqtest(expected, actual), str, __FILE__, line);
+
+    g_free (a);
+    g_free (r);
+    g_free (e);
+    g_free (str);
 }
 
 /* ======================================================= */
@@ -81,27 +81,27 @@
 #define check_binary_op(ex,a,ia,ib,e) check_binary_op_r(ex,a,ia,ib,e,__LINE__,gnc_numeric_eq)
 #define check_binary_op_equal(ex,a,ia,ib,e) check_binary_op_r(ex,a,ia,ib,e,__LINE__,gnc_numeric_equal)
 static void
-check_binary_op_r (gnc_numeric expected, 
-		   gnc_numeric actual, 
-		   gnc_numeric input_a, 
-		   gnc_numeric input_b, 
-		   const char * errmsg,
-		   int line,
-		   gboolean (*eq)(gnc_numeric, gnc_numeric))
+check_binary_op_r (gnc_numeric expected,
+                   gnc_numeric actual,
+                   gnc_numeric input_a,
+                   gnc_numeric input_b,
+                   const char * errmsg,
+                   int line,
+                   gboolean (*eq)(gnc_numeric, gnc_numeric))
 {
-	char *e = gnc_numeric_print (expected);
-	char *r = gnc_numeric_print (actual);
-	char *a = gnc_numeric_print (input_a);
-	char *b = gnc_numeric_print (input_b);
-	char *str = g_strdup_printf (errmsg, e,r,a,b);
-	
-	do_test_call ((eq)(expected, actual), str, __FILE__, line);
-	
-	g_free (a);
-	g_free (b);
-	g_free (r);
-	g_free (e);
-	g_free (str);
+    char *e = gnc_numeric_print (expected);
+    char *r = gnc_numeric_print (actual);
+    char *a = gnc_numeric_print (input_a);
+    char *b = gnc_numeric_print (input_b);
+    char *str = g_strdup_printf (errmsg, e, r, a, b);
+
+    do_test_call ((eq)(expected, actual), str, __FILE__, line);
+
+    g_free (a);
+    g_free (b);
+    g_free (r);
+    g_free (e);
+    g_free (str);
 }
 
 /* ======================================================= */
@@ -109,24 +109,24 @@
 static gboolean
 gnc_numeric_unequal (gnc_numeric a, gnc_numeric b)
 {
-	return (0 == gnc_numeric_equal (a,b));
+    return (0 == gnc_numeric_equal (a, b));
 }
 
 /* ======================================================= */
 
-/* Make sure that the equivalence operator we use for 
+/* Make sure that the equivalence operator we use for
  * later tests actually works */
 static void
 check_eq_operator (void)
 {
-	gnc_numeric a = gnc_numeric_create (42, 58);
-	gnc_numeric b = gnc_numeric_create (42, 58);
-	gnc_numeric c = gnc_numeric_create (40, 58);
-	
-	/* Check strict equivalence and non-equivalence */
-	do_test (gnc_numeric_eq(a, a), "expected self-equivalence");
-	do_test (gnc_numeric_eq(a, b), "expected equivalence");
-	do_test (0 == gnc_numeric_eq(a, c), "expected inequivalence");
+    gnc_numeric a = gnc_numeric_create (42, 58);
+    gnc_numeric b = gnc_numeric_create (42, 58);
+    gnc_numeric c = gnc_numeric_create (40, 58);
+
+    /* Check strict equivalence and non-equivalence */
+    do_test (gnc_numeric_eq(a, a), "expected self-equivalence");
+    do_test (gnc_numeric_eq(a, b), "expected equivalence");
+    do_test (0 == gnc_numeric_eq(a, c), "expected inequivalence");
 }
 
 /* ======================================================= */
@@ -134,40 +134,40 @@
 static void
 check_reduce (void)
 {
-	gnc_numeric one, rone;
-	gnc_numeric four, rfour;
-	gnc_numeric val, rval;
-	/* Check common factor elimination (needed for equality checks) */
-	one = gnc_numeric_create (1,1);
-	rone = gnc_numeric_create (1000000,1000000);
-	rone = gnc_numeric_reduce (rone);
-	do_test (gnc_numeric_eq(one, rone), "reduce to one");
+    gnc_numeric one, rone;
+    gnc_numeric four, rfour;
+    gnc_numeric val, rval;
+    /* Check common factor elimination (needed for equality checks) */
+    one = gnc_numeric_create (1, 1);
+    rone = gnc_numeric_create (1000000, 1000000);
+    rone = gnc_numeric_reduce (rone);
+    do_test (gnc_numeric_eq(one, rone), "reduce to one");
 
-	four = gnc_numeric_create (4,1);
-	rfour = gnc_numeric_create (480,120);
-	rfour = gnc_numeric_reduce (rfour);
-	do_test (gnc_numeric_eq(four, rfour), "reduce to four");
+    four = gnc_numeric_create (4, 1);
+    rfour = gnc_numeric_create (480, 120);
+    rfour = gnc_numeric_reduce (rfour);
+    do_test (gnc_numeric_eq(four, rfour), "reduce to four");
 
-	val = gnc_numeric_create(10023234LL, 334216654LL);
-	rval = gnc_numeric_reduce (val);
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (5011617,167108327),
-	                rval,
-                   val, "check_reduce(1) expected %s = %s = reduce(%s)");
+    val = gnc_numeric_create(10023234LL, 334216654LL);
+    rval = gnc_numeric_reduce (val);
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (5011617, 167108327),
+                    rval,
+                    val, "check_reduce(1) expected %s = %s = reduce(%s)");
 
-	val = gnc_numeric_create(17474724864LL,136048896LL);
-	rval = gnc_numeric_reduce (val);
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (4*17*17,9),
-	                rval,
-                   val, "check_reduce(2) expected %s = %s = reduce(%s)");
+    val = gnc_numeric_create(17474724864LL, 136048896LL);
+    rval = gnc_numeric_reduce (val);
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (4 * 17 * 17, 9),
+                    rval,
+                    val, "check_reduce(2) expected %s = %s = reduce(%s)");
 
-	val = gnc_numeric_create(1024LL,1099511627776LL);
-	rval = gnc_numeric_reduce (val);
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (1,1024*1024*1024),
-	                rval,
-                   val, "check_reduce(3): expected %s = %s = reduce(%s)");
+    val = gnc_numeric_create(1024LL, 1099511627776LL);
+    rval = gnc_numeric_reduce (val);
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (1, 1024 * 1024 * 1024),
+                    rval,
+                    val, "check_reduce(3): expected %s = %s = reduce(%s)");
 }
 
 /* ======================================================= */
@@ -175,154 +175,158 @@
 static void
 check_equality_operator (void)
 {
-	int i, m;
-	gint mult;
-	gint64 f, deno, numer;
-	gnc_numeric big, rbig;
-	gnc_numeric val, mval;
-	gnc_numeric bval, rval;
-	/* Check equality operator for some large numer/denom values */
-	numer = 1<<30;
-	numer <<= 30;   /* we don't trust cpp to compute 1<<60 correctly */
-	deno = 1<<30;
-	deno <<= 20;
-	rbig = gnc_numeric_create (numer, deno);
-	
-	big = gnc_numeric_create (1<<10,1);
-	do_test (gnc_numeric_equal(big, rbig), "equal to billion");
-	
-	big = gnc_numeric_create (1<<20,1<<10);
-	do_test (gnc_numeric_equal(big, rbig), "equal to 1<<20/1<<10");
+    int i, m;
+    gint mult;
+    gint64 f, deno, numer;
+    gnc_numeric big, rbig;
+    gnc_numeric val, mval;
+    gnc_numeric bval, rval;
+    /* Check equality operator for some large numer/denom values */
+    numer = 1 << 30;
+    numer <<= 30;   /* we don't trust cpp to compute 1<<60 correctly */
+    deno = 1 << 30;
+    deno <<= 20;
+    rbig = gnc_numeric_create (numer, deno);
 
-	big = gnc_numeric_create (1<<30,1<<20);
-	do_test (gnc_numeric_equal(big, rbig), "equal to 1<<30/1<<20");
+    big = gnc_numeric_create (1 << 10, 1);
+    do_test (gnc_numeric_equal(big, rbig), "equal to billion");
 
-	numer = 1<<30;
-	numer <<= 30;   /* we don't trust cpp to compute 1<<60 correctly */
-	deno = 1<<30;
-	rbig = gnc_numeric_create (numer, deno);
-	
-	big = gnc_numeric_create (1<<30,1);
-	do_test (gnc_numeric_equal(big, rbig), "equal to 1<<30");
+    big = gnc_numeric_create (1 << 20, 1 << 10);
+    do_test (gnc_numeric_equal(big, rbig), "equal to 1<<20/1<<10");
 
-	numer = 1<<30;
-	numer <<= 10;
-	big = gnc_numeric_create (numer, 1<<10);
-	do_test (gnc_numeric_equal(big, rbig), "equal to 1<<40/1<<10");
-	
-	numer <<= 10;
-	big = gnc_numeric_create (numer, 1<<20);
-	do_test (gnc_numeric_equal(big, rbig), "equal to 1<<50/1<<20");
+    big = gnc_numeric_create (1 << 30, 1 << 20);
+    do_test (gnc_numeric_equal(big, rbig), "equal to 1<<30/1<<20");
 
-	/* We assume RAND_MAX is less that 1<<32 */
-	for (i=0; i<NREPS; i++) 
-	{
-		deno = rand() / 2;
-		mult = rand() / 2;
-		numer = rand() / 2;
+    numer = 1 << 30;
+    numer <<= 30;   /* we don't trust cpp to compute 1<<60 correctly */
+    deno = 1 << 30;
+    rbig = gnc_numeric_create (numer, deno);
 
-		/* avoid 0 */
-		if (deno == 0 || mult == 0) { i--; continue; }
+    big = gnc_numeric_create (1 << 30, 1);
+    do_test (gnc_numeric_equal(big, rbig), "equal to 1<<30");
 
-		val = gnc_numeric_create (numer, deno);
-		mval = gnc_numeric_create (numer*mult, deno*mult);
-		
-		/* The reduced version should be equivalent */
-		bval = gnc_numeric_reduce (val);
-		rval = gnc_numeric_reduce (mval);
-		check_unary_op (gnc_numeric_eq, 
-                      bval, rval, mval, "expected %s = %s = reduce(%s)");
-		
-		/* The unreduced versions should be equal */
-		check_unary_op (gnc_numeric_equal, 
-                      val, mval, mval, "expected %s = %s");
-		
-      /* Certain modulo's should be very cleary un-equal; this
-		 * helps stop funky modulo-64 aliasing in compares that 
-		 * might creep in. */
-		mval.denom >>= 1;
-		mval.num >>= 1;
-		m=0;
-		f = mval.denom;
-		while (f%2 == 0)
-		{
-			f >>= 1;
-			m++;
-		}
-		if (1 < m)
-		{
-			gint64 nn = 1 << (32-m);
-			nn <<= 32;
-			nn += mval.num;
-			val = gnc_numeric_create (2*nn, 2*mval.denom);
-			check_unary_op (gnc_numeric_unequal, 
-                      val, mval, mval, "expected unequality %s != %s");
-		
-		}
-	}
+    numer = 1 << 30;
+    numer <<= 10;
+    big = gnc_numeric_create (numer, 1 << 10);
+    do_test (gnc_numeric_equal(big, rbig), "equal to 1<<40/1<<10");
+
+    numer <<= 10;
+    big = gnc_numeric_create (numer, 1 << 20);
+    do_test (gnc_numeric_equal(big, rbig), "equal to 1<<50/1<<20");
+
+    /* We assume RAND_MAX is less that 1<<32 */
+    for (i = 0; i < NREPS; i++)
+    {
+        deno = rand() / 2;
+        mult = rand() / 2;
+        numer = rand() / 2;
+
+        /* avoid 0 */
+        if (deno == 0 || mult == 0)
+        {
+            i--;
+            continue;
+        }
+
+        val = gnc_numeric_create (numer, deno);
+        mval = gnc_numeric_create (numer * mult, deno * mult);
+
+        /* The reduced version should be equivalent */
+        bval = gnc_numeric_reduce (val);
+        rval = gnc_numeric_reduce (mval);
+        check_unary_op (gnc_numeric_eq,
+                        bval, rval, mval, "expected %s = %s = reduce(%s)");
+
+        /* The unreduced versions should be equal */
+        check_unary_op (gnc_numeric_equal,
+                        val, mval, mval, "expected %s = %s");
+
+        /* Certain modulo's should be very cleary un-equal; this
+         * helps stop funky modulo-64 aliasing in compares that
+         * might creep in. */
+        mval.denom >>= 1;
+        mval.num >>= 1;
+        m = 0;
+        f = mval.denom;
+        while (f % 2 == 0)
+        {
+            f >>= 1;
+            m++;
+        }
+        if (1 < m)
+        {
+            gint64 nn = 1 << (32 - m);
+            nn <<= 32;
+            nn += mval.num;
+            val = gnc_numeric_create (2 * nn, 2 * mval.denom);
+            check_unary_op (gnc_numeric_unequal,
+                            val, mval, mval, "expected unequality %s != %s");
+
+        }
+    }
 }
-	
+
 /* ======================================================= */
 
-static void 
+static void
 check_rounding (void)
 {
-	gnc_numeric val;
+    gnc_numeric val;
 
-	val = gnc_numeric_create(7, 16);
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (43,100),
-	                gnc_numeric_convert (val, 100, GNC_HOW_RND_FLOOR),
-                   val, "expected %s = %s = (%s as 100th's floor)");
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (44,100),
-	                gnc_numeric_convert (val, 100, GNC_HOW_RND_CEIL),
-                   val, "expected %s = %s = (%s as 100th's ceiling)");
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (43,100),
-	                gnc_numeric_convert (val, 100, GNC_HOW_RND_TRUNC),
-                   val, "expected %s = %s = (%s as 100th's trunc)");
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (44,100),
-	                gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s = (%s as 100th's round)");
+    val = gnc_numeric_create(7, 16);
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (43, 100),
+                    gnc_numeric_convert (val, 100, GNC_HOW_RND_FLOOR),
+                    val, "expected %s = %s = (%s as 100th's floor)");
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (44, 100),
+                    gnc_numeric_convert (val, 100, GNC_HOW_RND_CEIL),
+                    val, "expected %s = %s = (%s as 100th's ceiling)");
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (43, 100),
+                    gnc_numeric_convert (val, 100, GNC_HOW_RND_TRUNC),
+                    val, "expected %s = %s = (%s as 100th's trunc)");
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (44, 100),
+                    gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s = (%s as 100th's round)");
 
-	val = gnc_numeric_create(1511, 1000);
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (151,100),
-	                gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s = (%s as 100th's round)");
+    val = gnc_numeric_create(1511, 1000);
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (151, 100),
+                    gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s = (%s as 100th's round)");
 
-	val = gnc_numeric_create(1516, 1000);
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (152,100),
-	                gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s = (%s as 100th's round)");
+    val = gnc_numeric_create(1516, 1000);
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (152, 100),
+                    gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s = (%s as 100th's round)");
 
-	/* Half-values always get rounded to nearest even number */
-	val = gnc_numeric_create(1515, 1000);
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (152,100),
-	                gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s = (%s as 100th's round)");
+    /* Half-values always get rounded to nearest even number */
+    val = gnc_numeric_create(1515, 1000);
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (152, 100),
+                    gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s = (%s as 100th's round)");
 
-	val = gnc_numeric_create(1525, 1000);
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (152,100),
-	                gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s = (%s as 100th's round)");
+    val = gnc_numeric_create(1525, 1000);
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (152, 100),
+                    gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s = (%s as 100th's round)");
 
-	val = gnc_numeric_create(1535, 1000);
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (154,100),
-	                gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s = (%s as 100th's round)");
+    val = gnc_numeric_create(1535, 1000);
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (154, 100),
+                    gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s = (%s as 100th's round)");
 
-	val = gnc_numeric_create(1545, 1000);
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (154,100),
-	                gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s = (%s as 100th's round)");
+    val = gnc_numeric_create(1545, 1000);
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (154, 100),
+                    gnc_numeric_convert (val, 100, GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s = (%s as 100th's round)");
 }
 
 /* ======================================================= */
@@ -330,42 +334,42 @@
 static void
 check_double (void)
 {
-	double flo;
-	gnc_numeric val = gnc_numeric_create (0,1);
+    double flo;
+    gnc_numeric val = gnc_numeric_create (0, 1);
 
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (112346,100000),
-                   double_to_gnc_numeric(1.1234567890123, 
-                                         GNC_DENOM_AUTO, 
-                                         GNC_HOW_DENOM_SIGFIGS(6) |
-                                         GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s double 6 figs");
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (112346, 100000),
+                    double_to_gnc_numeric(1.1234567890123,
+                                          GNC_DENOM_AUTO,
+                                          GNC_HOW_DENOM_SIGFIGS(6) |
+                                          GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s double 6 figs");
 
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (112346,10000000),
-                   double_to_gnc_numeric(0.011234567890123, 
-                                         GNC_DENOM_AUTO, 
-                                         GNC_HOW_DENOM_SIGFIGS(6) |
-                                         GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s double 6 figs");
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (112346, 10000000),
+                    double_to_gnc_numeric(0.011234567890123,
+                                          GNC_DENOM_AUTO,
+                                          GNC_HOW_DENOM_SIGFIGS(6) |
+                                          GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s double 6 figs");
 
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (112346,100),
-                   double_to_gnc_numeric(1123.4567890123, 
-                                         GNC_DENOM_AUTO, 
-                                         GNC_HOW_DENOM_SIGFIGS(6) |
-                                         GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s double 6 figs");
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (112346,10000000000LL),
-                   double_to_gnc_numeric(1.1234567890123e-5, 
-                                         GNC_DENOM_AUTO, 
-                                         GNC_HOW_DENOM_SIGFIGS(6) |
-                                         GNC_HOW_RND_ROUND),
-                   val, "expected %s = %s double 6 figs");
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (112346, 100),
+                    double_to_gnc_numeric(1123.4567890123,
+                                          GNC_DENOM_AUTO,
+                                          GNC_HOW_DENOM_SIGFIGS(6) |
+                                          GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s double 6 figs");
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (112346, 10000000000LL),
+                    double_to_gnc_numeric(1.1234567890123e-5,
+                                          GNC_DENOM_AUTO,
+                                          GNC_HOW_DENOM_SIGFIGS(6) |
+                                          GNC_HOW_RND_ROUND),
+                    val, "expected %s = %s double 6 figs");
 
-	flo = gnc_numeric_to_double(gnc_numeric_create(7, 16));
-	do_test ((0.4375 == flo), "float pt conversion");
+    flo = gnc_numeric_to_double(gnc_numeric_create(7, 16));
+    do_test ((0.4375 == flo), "float pt conversion");
 }
 
 /* ======================================================= */
@@ -373,18 +377,18 @@
 static void
 check_neg (void)
 {
-	gnc_numeric a = gnc_numeric_create(2, 6);
-	gnc_numeric b = gnc_numeric_create(1, 4);
-	gnc_numeric c = gnc_numeric_neg (a);
-	gnc_numeric d = gnc_numeric_neg (b);
+    gnc_numeric a = gnc_numeric_create(2, 6);
+    gnc_numeric b = gnc_numeric_create(1, 4);
+    gnc_numeric c = gnc_numeric_neg (a);
+    gnc_numeric d = gnc_numeric_neg (b);
 
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (-2,6), c, 
-                   a, "expected %s = %s = -(%s)");
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (-2, 6), c,
+                    a, "expected %s = %s = -(%s)");
 
-	check_unary_op (gnc_numeric_eq,
-	                gnc_numeric_create (-1,4), d, 
-                   b, "expected %s = %s = -(%s)");
+    check_unary_op (gnc_numeric_eq,
+                    gnc_numeric_create (-1, 4), d,
+                    b, "expected %s = %s = -(%s)");
 
 }
 
@@ -393,153 +397,153 @@
 static void
 check_add_subtract (void)
 {
-  int i;
-  gnc_numeric a, b, c, d, z;
+    int i;
+    gnc_numeric a, b, c, d, z;
 #if CHECK_ERRORS_TOO
-  gnc_numeric c;
+    gnc_numeric c;
 #endif
-  
-  a = gnc_numeric_create(2, 6);
-  b = gnc_numeric_create(1, 4);
 
-  /* Well, actually 14/24 would be acceptable/better in this case */
-  check_binary_op (gnc_numeric_create(7,12), 
-                   gnc_numeric_add(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-						 a, b, "expected %s got %s = %s + %s for add exact");
-  
-  check_binary_op (gnc_numeric_create(58,100), 
-                   gnc_numeric_add(a, b, 100, GNC_HOW_RND_ROUND),
-						 a, b, "expected %s got %s = %s + %s for add 100ths (banker's)");
-  
-  check_binary_op (gnc_numeric_create(5833,10000), 
-                   gnc_numeric_add(a, b, GNC_DENOM_AUTO, 
-                                         GNC_HOW_DENOM_SIGFIGS(4) |
-                                         GNC_HOW_RND_ROUND),
-						 a, b, "expected %s got %s = %s + %s for add 4 sig figs");
-  
-  check_binary_op (gnc_numeric_create(583333,1000000), 
-                   gnc_numeric_add(a, b, GNC_DENOM_AUTO, 
-                                         GNC_HOW_DENOM_SIGFIGS(6) |
-                                         GNC_HOW_RND_ROUND),
-						 a, b, "expected %s got %s = %s + %s for add 6 sig figs");
-  
-  check_binary_op (gnc_numeric_create(1,12), 
-                   gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-						 a, b, "expected %s got %s = %s - %s for sub exact");
-  
-  /* We should try something trickier for reduce & lcd */
-  check_binary_op (gnc_numeric_create(1,12), 
-                   gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
-						 a, b, "expected %s got %s = %s - %s for sub reduce");
-  
-  check_binary_op (gnc_numeric_create(1,12), 
-                   gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD),
-						 a, b, "expected %s got %s = %s - %s for sub reduce");
-  
-  check_binary_op (gnc_numeric_create(8,100), 
-                   gnc_numeric_sub(a, b, 100, GNC_HOW_RND_ROUND),
-						 a, b, "expected %s got %s = %s - %s for sub 100ths (banker's)");
-  
-  /* ------------------------------------------------------------ */
-  /* This test has failed before */
-  c = gnc_numeric_neg (a);
-  d = gnc_numeric_neg (b);
-  z = gnc_numeric_zero();
-  check_binary_op (c, gnc_numeric_add_fixed(z,c),
-						 z, c, "expected %s got %s = %s + %s for add fixed");
-  
-  check_binary_op (d, gnc_numeric_add_fixed(z,d),
-						 z, d, "expected %s got %s = %s + %s for add fixed");
-  
-  /* ------------------------------------------------------------ */
-  /* Same as above, but with signs reviersed */
-  a = c;
-  b = d;
-  /* Well, actually 14/24 would be acceptable/better in this case */
-  check_binary_op (gnc_numeric_create(-7,12), 
-                   gnc_numeric_add(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-						 a, b, "expected %s got %s = %s + %s for add exact");
-  
-  check_binary_op (gnc_numeric_create(-58,100), 
-                   gnc_numeric_add(a, b, 100, GNC_HOW_RND_ROUND),
-						 a, b, "expected %s got %s = %s + %s for add 100ths (banker's)");
-  
-  check_binary_op (gnc_numeric_create(-5833,10000), 
-                   gnc_numeric_add(a, b, GNC_DENOM_AUTO, 
-                                         GNC_HOW_DENOM_SIGFIGS(4) |
-                                         GNC_HOW_RND_ROUND),
-						 a, b, "expected %s got %s = %s + %s for add 4 sig figs");
-  
-  check_binary_op (gnc_numeric_create(-583333,1000000), 
-                   gnc_numeric_add(a, b, GNC_DENOM_AUTO, 
-                                         GNC_HOW_DENOM_SIGFIGS(6) |
-                                         GNC_HOW_RND_ROUND),
-						 a, b, "expected %s got %s = %s + %s for add 6 sig figs");
-  
-  check_binary_op (gnc_numeric_create(-1,12), 
-                   gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-						 a, b, "expected %s got %s = %s - %s for sub exact");
-  
-  /* We should try something trickier for reduce & lcd */
-  check_binary_op (gnc_numeric_create(-1,12), 
-                   gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
-						 a, b, "expected %s got %s = %s - %s for sub reduce");
-  
-  check_binary_op (gnc_numeric_create(-1,12), 
-                   gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD),
-						 a, b, "expected %s got %s = %s - %s for sub reduce");
-  
-  check_binary_op (gnc_numeric_create(-8,100), 
-                   gnc_numeric_sub(a, b, 100, GNC_HOW_RND_ROUND),
-						 a, b, "expected %s got %s = %s - %s for sub 100ths (banker's)");
-  
-  /* ------------------------------------------------------------ */
+    a = gnc_numeric_create(2, 6);
+    b = gnc_numeric_create(1, 4);
+
+    /* Well, actually 14/24 would be acceptable/better in this case */
+    check_binary_op (gnc_numeric_create(7, 12),
+                     gnc_numeric_add(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                     a, b, "expected %s got %s = %s + %s for add exact");
+
+    check_binary_op (gnc_numeric_create(58, 100),
+                     gnc_numeric_add(a, b, 100, GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s + %s for add 100ths (banker's)");
+
+    check_binary_op (gnc_numeric_create(5833, 10000),
+                     gnc_numeric_add(a, b, GNC_DENOM_AUTO,
+                                     GNC_HOW_DENOM_SIGFIGS(4) |
+                                     GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s + %s for add 4 sig figs");
+
+    check_binary_op (gnc_numeric_create(583333, 1000000),
+                     gnc_numeric_add(a, b, GNC_DENOM_AUTO,
+                                     GNC_HOW_DENOM_SIGFIGS(6) |
+                                     GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s + %s for add 6 sig figs");
+
+    check_binary_op (gnc_numeric_create(1, 12),
+                     gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                     a, b, "expected %s got %s = %s - %s for sub exact");
+
+    /* We should try something trickier for reduce & lcd */
+    check_binary_op (gnc_numeric_create(1, 12),
+                     gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
+                     a, b, "expected %s got %s = %s - %s for sub reduce");
+
+    check_binary_op (gnc_numeric_create(1, 12),
+                     gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD),
+                     a, b, "expected %s got %s = %s - %s for sub reduce");
+
+    check_binary_op (gnc_numeric_create(8, 100),
+                     gnc_numeric_sub(a, b, 100, GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s - %s for sub 100ths (banker's)");
+
+    /* ------------------------------------------------------------ */
+    /* This test has failed before */
+    c = gnc_numeric_neg (a);
+    d = gnc_numeric_neg (b);
+    z = gnc_numeric_zero();
+    check_binary_op (c, gnc_numeric_add_fixed(z, c),
+                     z, c, "expected %s got %s = %s + %s for add fixed");
+
+    check_binary_op (d, gnc_numeric_add_fixed(z, d),
+                     z, d, "expected %s got %s = %s + %s for add fixed");
+
+    /* ------------------------------------------------------------ */
+    /* Same as above, but with signs reviersed */
+    a = c;
+    b = d;
+    /* Well, actually 14/24 would be acceptable/better in this case */
+    check_binary_op (gnc_numeric_create(-7, 12),
+                     gnc_numeric_add(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                     a, b, "expected %s got %s = %s + %s for add exact");
+
+    check_binary_op (gnc_numeric_create(-58, 100),
+                     gnc_numeric_add(a, b, 100, GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s + %s for add 100ths (banker's)");
+
+    check_binary_op (gnc_numeric_create(-5833, 10000),
+                     gnc_numeric_add(a, b, GNC_DENOM_AUTO,
+                                     GNC_HOW_DENOM_SIGFIGS(4) |
+                                     GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s + %s for add 4 sig figs");
+
+    check_binary_op (gnc_numeric_create(-583333, 1000000),
+                     gnc_numeric_add(a, b, GNC_DENOM_AUTO,
+                                     GNC_HOW_DENOM_SIGFIGS(6) |
+                                     GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s + %s for add 6 sig figs");
+
+    check_binary_op (gnc_numeric_create(-1, 12),
+                     gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                     a, b, "expected %s got %s = %s - %s for sub exact");
+
+    /* We should try something trickier for reduce & lcd */
+    check_binary_op (gnc_numeric_create(-1, 12),
+                     gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
+                     a, b, "expected %s got %s = %s - %s for sub reduce");
+
+    check_binary_op (gnc_numeric_create(-1, 12),
+                     gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD),
+                     a, b, "expected %s got %s = %s - %s for sub reduce");
+
+    check_binary_op (gnc_numeric_create(-8, 100),
+                     gnc_numeric_sub(a, b, 100, GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s - %s for sub 100ths (banker's)");
+
+    /* ------------------------------------------------------------ */
 #if CHECK_ERRORS_TOO
-  c = gnc_numeric_add_with_error(a, b, 100, GNC_HOW_RND_ROUND, &err);
-  printf("add 100ths/error : %s + %s = %s + (error) %s\n\n",
-         gnc_numeric_print(a), gnc_numeric_print(b),
-         gnc_numeric_print(c),
-         gnc_numeric_print(err));
-  
-  c = gnc_numeric_sub_with_error(a, b, 100, GNC_HOW_RND_FLOOR, &err);
-  printf("sub 100ths/error : %s - %s = %s + (error) %s\n\n",
-         gnc_numeric_print(a), gnc_numeric_print(b),
-         gnc_numeric_print(c),
-         gnc_numeric_print(err));
-  
+    c = gnc_numeric_add_with_error(a, b, 100, GNC_HOW_RND_ROUND, &err);
+    printf("add 100ths/error : %s + %s = %s + (error) %s\n\n",
+           gnc_numeric_print(a), gnc_numeric_print(b),
+           gnc_numeric_print(c),
+           gnc_numeric_print(err));
+
+    c = gnc_numeric_sub_with_error(a, b, 100, GNC_HOW_RND_FLOOR, &err);
+    printf("sub 100ths/error : %s - %s = %s + (error) %s\n\n",
+           gnc_numeric_print(a), gnc_numeric_print(b),
+           gnc_numeric_print(c),
+           gnc_numeric_print(err));
+
 #endif
 
-  /* ------------------------------------------------------------ */
-	/* Add and subtract some random numbers */
-	for (i=0; i<NREPS; i++)
-	{
-		gnc_numeric e;
-		gint64 deno = rand() +1;
-		gint64 na = get_random_gint64();
-		gint64 nb = get_random_gint64();
-		gint64 ne;
+    /* ------------------------------------------------------------ */
+    /* Add and subtract some random numbers */
+    for (i = 0; i < NREPS; i++)
+    {
+        gnc_numeric e;
+        gint64 deno = rand() + 1;
+        gint64 na = get_random_gint64();
+        gint64 nb = get_random_gint64();
+        gint64 ne;
 
-		/* avoid overflow; */
-		na /=2;
-		nb /=2;
-		
-		a = gnc_numeric_create(na, deno);
-		b = gnc_numeric_create(nb, deno);
+        /* avoid overflow; */
+        na /= 2;
+        nb /= 2;
 
-		/* Add */
-		ne = na+nb;
-		e = gnc_numeric_create(ne, deno);
-		check_binary_op (e,
-                   gnc_numeric_add(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-						 a, b, "expected %s got %s = %s + %s for exact addition");
+        a = gnc_numeric_create(na, deno);
+        b = gnc_numeric_create(nb, deno);
 
-		/* Subtract */
-		ne = na-nb;
-		e = gnc_numeric_create(ne, deno);
-		check_binary_op (e,
-                   gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-						 a, b, "expected %s got %s = %s - %s for exact subtraction");
-	}
+        /* Add */
+        ne = na + nb;
+        e = gnc_numeric_create(ne, deno);
+        check_binary_op (e,
+                         gnc_numeric_add(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                         a, b, "expected %s got %s = %s + %s for exact addition");
+
+        /* Subtract */
+        ne = na - nb;
+        e = gnc_numeric_create(ne, deno);
+        check_binary_op (e,
+                         gnc_numeric_sub(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                         a, b, "expected %s got %s = %s - %s for exact subtraction");
+    }
 }
 
 /* ======================================================= */
@@ -547,233 +551,237 @@
 static void
 check_mult_div (void)
 {
-  int i, j;
-  gint64 v;
-  gnc_numeric c, d;
-  gnc_numeric amt_a, amt_tot, frac, val_tot, val_a;
-  gnc_numeric a, b;
+    int i, j;
+    gint64 v;
+    gnc_numeric c, d;
+    gnc_numeric amt_a, amt_tot, frac, val_tot, val_a;
+    gnc_numeric a, b;
 
-  a = gnc_numeric_create(-100, 100);
-  b = gnc_numeric_create(1, 1);
-  check_binary_op (gnc_numeric_create(-100, 100), 
-                   gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-                   a, b, "expected %s got %s = %s / %s div exact");
+    a = gnc_numeric_create(-100, 100);
+    b = gnc_numeric_create(1, 1);
+    check_binary_op (gnc_numeric_create(-100, 100),
+                     gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                     a, b, "expected %s got %s = %s / %s div exact");
 
-  a = gnc_numeric_create(-100, 100);
-  b = gnc_numeric_create(-1, 1);
-  check_binary_op (gnc_numeric_create(100, 100), 
-                   gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-                   a, b, "expected %s got %s = %s / %s div exact");
+    a = gnc_numeric_create(-100, 100);
+    b = gnc_numeric_create(-1, 1);
+    check_binary_op (gnc_numeric_create(100, 100),
+                     gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                     a, b, "expected %s got %s = %s / %s div exact");
 
-  a = gnc_numeric_create(-100, 100);
-  b = gnc_numeric_create(-1, 1);
-  check_binary_op (gnc_numeric_create(100, 100), 
-                   gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-                   a, b, "expected %s got %s = %s * %s mult exact");
+    a = gnc_numeric_create(-100, 100);
+    b = gnc_numeric_create(-1, 1);
+    check_binary_op (gnc_numeric_create(100, 100),
+                     gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                     a, b, "expected %s got %s = %s * %s mult exact");
 
-  a = gnc_numeric_create(2, 6);
-  b = gnc_numeric_create(1, 4);
+    a = gnc_numeric_create(2, 6);
+    b = gnc_numeric_create(1, 4);
 
-  check_binary_op (gnc_numeric_create(2,24), 
-                   gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-                   a, b, "expected %s got %s = %s * %s for mult exact");
+    check_binary_op (gnc_numeric_create(2, 24),
+                     gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                     a, b, "expected %s got %s = %s * %s for mult exact");
 
-  check_binary_op (gnc_numeric_create(1,12), 
-                   gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
-                   a, b, "expected %s got %s = %s * %s for mult reduce");
+    check_binary_op (gnc_numeric_create(1, 12),
+                     gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
+                     a, b, "expected %s got %s = %s * %s for mult reduce");
 
-  check_binary_op (gnc_numeric_create(8,100), 
-                   gnc_numeric_mul(a, b, 100, GNC_HOW_RND_ROUND),
-                   a, b, "expected %s got %s = %s * %s for mult 100th's");
+    check_binary_op (gnc_numeric_create(8, 100),
+                     gnc_numeric_mul(a, b, 100, GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s * %s for mult 100th's");
 
-  check_binary_op (gnc_numeric_create(8,6), 
-                   gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-                   a, b, "expected %s got %s = %s / %s for div exact");
+    check_binary_op (gnc_numeric_create(8, 6),
+                     gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                     a, b, "expected %s got %s = %s / %s for div exact");
 
-  check_binary_op (gnc_numeric_create(4,3), 
-                   gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
-                   a, b, "expected %s got %s = %s / %s for div reduce");
+    check_binary_op (gnc_numeric_create(4, 3),
+                     gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
+                     a, b, "expected %s got %s = %s / %s for div reduce");
 
-  check_binary_op (gnc_numeric_create(133,100), 
-                   gnc_numeric_div(a, b, 100, GNC_HOW_RND_ROUND),
-                   a, b, "expected %s got %s = %s * %s for div 100th's");
+    check_binary_op (gnc_numeric_create(133, 100),
+                     gnc_numeric_div(a, b, 100, GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s * %s for div 100th's");
 
 #if CHECK_ERRORS_TOO
-  gnc_numeric c;
-  c = gnc_numeric_mul_with_error(a, b, 100, GNC_HOW_RND_ROUND, &err);
-  printf("mul 100ths/error : %s * %s = %s + (error) %s\n\n",
-         gnc_numeric_print(a), gnc_numeric_print(b),
-         gnc_numeric_print(c),
-         gnc_numeric_print(err));
+    gnc_numeric c;
+    c = gnc_numeric_mul_with_error(a, b, 100, GNC_HOW_RND_ROUND, &err);
+    printf("mul 100ths/error : %s * %s = %s + (error) %s\n\n",
+           gnc_numeric_print(a), gnc_numeric_print(b),
+           gnc_numeric_print(c),
+           gnc_numeric_print(err));
 
-  c = gnc_numeric_div_with_error(a, b, 100, GNC_HOW_RND_ROUND, &err);
-  printf("div 100ths/error : %s / %s = %s + (error) %s\n\n",
-         gnc_numeric_print(a), gnc_numeric_print(b),
-         gnc_numeric_print(c),
-         gnc_numeric_print(err));
-  
+    c = gnc_numeric_div_with_error(a, b, 100, GNC_HOW_RND_ROUND, &err);
+    printf("div 100ths/error : %s / %s = %s + (error) %s\n\n",
+           gnc_numeric_print(a), gnc_numeric_print(b),
+           gnc_numeric_print(c),
+           gnc_numeric_print(err));
+
 #endif
-  
-  /* Check for math with 2^63 < num*num < 2^64 which previously failed 
-   * see http://bugzilla.gnome.org/show_bug.cgi?id=144980 
-   */
-  v = 1000000;
-  a = gnc_numeric_create(1*v, v);
-  b = gnc_numeric_create(10000000*v, v);
 
-  check_binary_op (b,
-	                gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD),
-						 a, b, "expected %s got %s = %s * %s for multiply");
+    /* Check for math with 2^63 < num*num < 2^64 which previously failed
+     * see http://bugzilla.gnome.org/show_bug.cgi?id=144980
+     */
+    v = 1000000;
+    a = gnc_numeric_create(1 * v, v);
+    b = gnc_numeric_create(10000000 * v, v);
 
-	/* Multiply some random numbers.  This test presumes that
-	 * RAND_MAX is approx 2^32 
-	 */
-	for (i=0; i<NREPS; i++)
-	{
-		gint64 deno = 1;
-		gint64 na = rand();
-		gint64 nb = rand();
-		gint64 ne;
+    check_binary_op (b,
+                     gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD),
+                     a, b, "expected %s got %s = %s * %s for multiply");
 
-		/* avoid 0 */
-		if (nb/4 == 0) { i--; continue; }
+    /* Multiply some random numbers.  This test presumes that
+     * RAND_MAX is approx 2^32
+     */
+    for (i = 0; i < NREPS; i++)
+    {
+        gint64 deno = 1;
+        gint64 na = rand();
+        gint64 nb = rand();
+        gint64 ne;
 
-		/* avoid overflow; */
-		na /= 2;
-		nb /= 2;
-		ne = na*nb;
-		
-		a = gnc_numeric_create(na, deno);
-		b = gnc_numeric_create(nb, deno);
+        /* avoid 0 */
+        if (nb / 4 == 0)
+        {
+            i--;
+            continue;
+        }
 
-		check_binary_op_equal (gnc_numeric_create(ne,1), 
-			          gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-						 a, b, "expected %s got %s = %s * %s for mult exact");
+        /* avoid overflow; */
+        na /= 2;
+        nb /= 2;
+        ne = na * nb;
 
-		/* Force 128-bit math to come into play */
-		for (j=1; j<31; j++)
-		{
-			a = gnc_numeric_create(na << j, 1<<j);
-			b = gnc_numeric_create(nb << j, 1<<j);
-			check_binary_op (gnc_numeric_create(ne, 1), 
-			          gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
-						 a, b, "expected %s got %s = %s * %s for mult reduce");
-		}
+        a = gnc_numeric_create(na, deno);
+        b = gnc_numeric_create(nb, deno);
 
-		/* Do some hokey random 128-bit division too */
-		b = gnc_numeric_create(deno, nb);
+        check_binary_op_equal (gnc_numeric_create(ne, 1),
+                               gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                               a, b, "expected %s got %s = %s * %s for mult exact");
 
-		check_binary_op_equal (gnc_numeric_create(ne,1), 
-			          gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
-						 a, b, "expected %s got %s = %s / %s for div exact");
+        /* Force 128-bit math to come into play */
+        for (j = 1; j < 31; j++)
+        {
+            a = gnc_numeric_create(na << j, 1 << j);
+            b = gnc_numeric_create(nb << j, 1 << j);
+            check_binary_op (gnc_numeric_create(ne, 1),
+                             gnc_numeric_mul(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
+                             a, b, "expected %s got %s = %s * %s for mult reduce");
+        }
 
-		/* avoid overflow; */
-		na /= 2;
-		nb /= 2;
-		ne = na*nb;
-		for (j=1; j<16; j++)
-		{
-			a = gnc_numeric_create(na << j, 1<<j);
-			b = gnc_numeric_create(1<<j, nb << j);
-			check_binary_op (gnc_numeric_create(ne, 1), 
-			          gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
-						 a, b, "expected %s got %s = %s / %s for div reduce");
-		}
-	}
+        /* Do some hokey random 128-bit division too */
+        b = gnc_numeric_create(deno, nb);
 
-	a = gnc_numeric_create(782592055622866ULL,89025);
-	b = gnc_numeric_create(2222554708930978ULL,85568);
-	/* Dividing the above pair overflows, in that after
-	 * the division the denominator won't fit into a 
-	 * 64-bit quantity.  This can be seen from
-	 * the factorization int primes:
-	 * 782592055622866 = 2 * 2283317 * 171371749
-	 * (yes, thats a seven and a nine digit prime)
-	 * 2222554708930978 = 2 * 1111277354465489
-	 * (yes, that's a sixteen-digit prime number)
-	 * 89025 = 3*5*5*1187 
-	 * 85568= 64*7*191   
-	 * If the rounding method is exact/no-round, then 
-	 * an overflow error should be signalled; else the 
-	 * divide routine should shift down the results till
-	 * the overflow is eliminated.
-	 * 
-	 */
-	check_binary_op (gnc_numeric_error (GNC_ERROR_OVERFLOW),
-			 gnc_numeric_div(a, b, GNC_DENOM_AUTO,
-					 GNC_HOW_RND_NEVER | GNC_HOW_DENOM_EXACT),
-			 a, b, "expected %s got %s = %s / %s for div exact");
+        check_binary_op_equal (gnc_numeric_create(ne, 1),
+                               gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT),
+                               a, b, "expected %s got %s = %s / %s for div exact");
 
-	check_binary_op (gnc_numeric_create(338441, 1000000),
-			 gnc_numeric_div(a, b, GNC_DENOM_AUTO,
-					 GNC_HOW_DENOM_SIGFIGS(6) | GNC_HOW_RND_ROUND),
-			 a, b, "expected %s got %s = %s / %s for div round");
+        /* avoid overflow; */
+        na /= 2;
+        nb /= 2;
+        ne = na * nb;
+        for (j = 1; j < 16; j++)
+        {
+            a = gnc_numeric_create(na << j, 1 << j);
+            b = gnc_numeric_create(1 << j, nb << j);
+            check_binary_op (gnc_numeric_create(ne, 1),
+                             gnc_numeric_div(a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE),
+                             a, b, "expected %s got %s = %s / %s for div reduce");
+        }
+    }
 
-	/* The below is a 'typical' value calculation: 
-	 * value_frac = value_tot * amt_frace / amt_tot
-	 * and has some typical potential-overflow values. 
-	 * 82718 = 2 * 59 * 701
-	 * 47497125586 = 2 * 1489 * 15949337
-	 * 69100955 = 5 * 7 * 11 * 179483
-	 * 32005637020 = 4 * 5 * 7 * 43 * 71 * 103 * 727
-	 */
-	a = gnc_numeric_create (-47497125586LL, 82718);
-	b = gnc_numeric_create (-69100955LL, 55739);
-	c = gnc_numeric_mul (a,b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT);
-	d = gnc_numeric_create (-32005637020LL, 55739);
+    a = gnc_numeric_create(782592055622866ULL, 89025);
+    b = gnc_numeric_create(2222554708930978ULL, 85568);
+    /* Dividing the above pair overflows, in that after
+     * the division the denominator won't fit into a
+     * 64-bit quantity.  This can be seen from
+     * the factorization int primes:
+     * 782592055622866 = 2 * 2283317 * 171371749
+     * (yes, thats a seven and a nine digit prime)
+     * 2222554708930978 = 2 * 1111277354465489
+     * (yes, that's a sixteen-digit prime number)
+     * 89025 = 3*5*5*1187
+     * 85568= 64*7*191
+     * If the rounding method is exact/no-round, then
+     * an overflow error should be signalled; else the
+     * divide routine should shift down the results till
+     * the overflow is eliminated.
+     *
+     */
+    check_binary_op (gnc_numeric_error (GNC_ERROR_OVERFLOW),
+                     gnc_numeric_div(a, b, GNC_DENOM_AUTO,
+                                     GNC_HOW_RND_NEVER | GNC_HOW_DENOM_EXACT),
+                     a, b, "expected %s got %s = %s / %s for div exact");
 
-	check_binary_op (gnc_numeric_create(-102547458LL, 82718),
-			 gnc_numeric_div(c, d, 82718,
-					 GNC_HOW_DENOM_EXACT),
-			 c, d, "expected %s got %s = %s / %s for div round");
+    check_binary_op (gnc_numeric_create(338441, 1000000),
+                     gnc_numeric_div(a, b, GNC_DENOM_AUTO,
+                                     GNC_HOW_DENOM_SIGFIGS(6) | GNC_HOW_RND_ROUND),
+                     a, b, "expected %s got %s = %s / %s for div round");
 
-	/* If we specify GNC_HOW_RND_NEVER, then we shoukld get an error,
-	 * since the exact result won't fit into a 64-bit quantity. */
-	check_binary_op (gnc_numeric_error (GNC_ERROR_REMAINDER),
-			 gnc_numeric_div(c, d, 82718,
-					 GNC_HOW_DENOM_EXACT|GNC_HOW_RND_NEVER),
-			 c, d, "expected %s got %s = %s / %s for div round");
+    /* The below is a 'typical' value calculation:
+     * value_frac = value_tot * amt_frace / amt_tot
+     * and has some typical potential-overflow values.
+     * 82718 = 2 * 59 * 701
+     * 47497125586 = 2 * 1489 * 15949337
+     * 69100955 = 5 * 7 * 11 * 179483
+     * 32005637020 = 4 * 5 * 7 * 43 * 71 * 103 * 727
+     */
+    a = gnc_numeric_create (-47497125586LL, 82718);
+    b = gnc_numeric_create (-69100955LL, 55739);
+    c = gnc_numeric_mul (a, b, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT);
+    d = gnc_numeric_create (-32005637020LL, 55739);
 
-	/* A simple irreducible ratio, involving negative numbers */
-	amt_a = gnc_numeric_create (-6005287905LL, 40595);
-	amt_tot = gnc_numeric_create (-8744187958LL, 40595);
-	frac = gnc_numeric_div (amt_a, amt_tot,
-                        GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE);
+    check_binary_op (gnc_numeric_create(-102547458LL, 82718),
+                     gnc_numeric_div(c, d, 82718,
+                                     GNC_HOW_DENOM_EXACT),
+                     c, d, "expected %s got %s = %s / %s for div round");
 
-	check_binary_op (gnc_numeric_create(6005287905LL, 8744187958LL),
-	                 frac, amt_a, amt_tot, 
-	                 "expected %s got %s = %s / %s for div reduce");
+    /* If we specify GNC_HOW_RND_NEVER, then we shoukld get an error,
+     * since the exact result won't fit into a 64-bit quantity. */
+    check_binary_op (gnc_numeric_error (GNC_ERROR_REMAINDER),
+                     gnc_numeric_div(c, d, 82718,
+                                     GNC_HOW_DENOM_EXACT | GNC_HOW_RND_NEVER),
+                     c, d, "expected %s got %s = %s / %s for div round");
 
-	/* Another overflow-prone condition */
-	val_tot = gnc_numeric_create (-4280656418LL, 19873);
-	val_a = gnc_numeric_mul (frac, val_tot,
-                        gnc_numeric_denom(val_tot),
-                        GNC_HOW_RND_ROUND| GNC_HOW_DENOM_EXACT);
-	check_binary_op (gnc_numeric_create(-2939846940LL, 19873),
-	                 val_a, val_tot, frac,
-	                 "expected %s got %s = %s * %s for mult round");
+    /* A simple irreducible ratio, involving negative numbers */
+    amt_a = gnc_numeric_create (-6005287905LL, 40595);
+    amt_tot = gnc_numeric_create (-8744187958LL, 40595);
+    frac = gnc_numeric_div (amt_a, amt_tot,
+                            GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE);
 
-	frac = gnc_numeric_create (396226789777979LL, 328758834367851752LL);
-	val_tot = gnc_numeric_create (467013515494988LL, 100);
-	val_a = gnc_numeric_mul (frac, val_tot,
-                        gnc_numeric_denom(val_tot),
-                        GNC_HOW_RND_ROUND| GNC_HOW_DENOM_EXACT);
-	check_binary_op (gnc_numeric_create(562854125307LL, 100),
-	                 val_a, val_tot, frac,
-	                 "expected %s got %s = %s * %s for mult round");
+    check_binary_op (gnc_numeric_create(6005287905LL, 8744187958LL),
+                     frac, amt_a, amt_tot,
+                     "expected %s got %s = %s / %s for div reduce");
 
-	/* Yet another bug from bugzilla ... */
-	a = gnc_numeric_create (40066447153986554LL, 4518);
-	b = gnc_numeric_create (26703286457229LL, 3192);
-	frac = gnc_numeric_div(a, b,
-	                      GNC_DENOM_AUTO,
-	                      GNC_HOW_DENOM_SIGFIGS(6) |
-	                      GNC_HOW_RND_ROUND);
+    /* Another overflow-prone condition */
+    val_tot = gnc_numeric_create (-4280656418LL, 19873);
+    val_a = gnc_numeric_mul (frac, val_tot,
+                             gnc_numeric_denom(val_tot),
+                             GNC_HOW_RND_ROUND | GNC_HOW_DENOM_EXACT);
+    check_binary_op (gnc_numeric_create(-2939846940LL, 19873),
+                     val_a, val_tot, frac,
+                     "expected %s got %s = %s * %s for mult round");
 
-	check_binary_op (gnc_numeric_create(106007, 100),
-	                 frac, a, b,
-	                 "expected %s got %s = %s / %s for mult sigfigs");
+    frac = gnc_numeric_create (396226789777979LL, 328758834367851752LL);
+    val_tot = gnc_numeric_create (467013515494988LL, 100);
+    val_a = gnc_numeric_mul (frac, val_tot,
+                             gnc_numeric_denom(val_tot),
+                             GNC_HOW_RND_ROUND | GNC_HOW_DENOM_EXACT);
+    check_binary_op (gnc_numeric_create(562854125307LL, 100),
+                     val_a, val_tot, frac,
+                     "expected %s got %s = %s * %s for mult round");
 
+    /* Yet another bug from bugzilla ... */
+    a = gnc_numeric_create (40066447153986554LL, 4518);
+    b = gnc_numeric_create (26703286457229LL, 3192);
+    frac = gnc_numeric_div(a, b,
+                           GNC_DENOM_AUTO,
+                           GNC_HOW_DENOM_SIGFIGS(6) |
+                           GNC_HOW_RND_ROUND);
+
+    check_binary_op (gnc_numeric_create(106007, 100),
+                     frac, a, b,
+                     "expected %s got %s = %s / %s for mult sigfigs");
+
 }
 
 static void
@@ -782,9 +790,9 @@
     gnc_numeric a, b, ans, val;
     double flo;
 
-    val = gnc_numeric_create(-60,20);
+    val = gnc_numeric_create(-60, 20);
     check_unary_op (gnc_numeric_eq, gnc_numeric_create (-3, -1),
-                    gnc_numeric_convert(val, GNC_DENOM_RECIPROCAL(1), 
+                    gnc_numeric_convert(val, GNC_DENOM_RECIPROCAL(1),
                                         GNC_HOW_RND_NEVER),
                     val, "expected %s = %s = (%s as RECIP(1))");
 
@@ -795,7 +803,7 @@
     ans = gnc_numeric_add(a, b, GNC_DENOM_RECIPROCAL(1), GNC_HOW_RND_NEVER);
     check_binary_op (gnc_numeric_create(5, -1),
                      ans, a, b, "expected %s got %s = %s + %s for reciprocal");
-                   
+
     /* 2 + 3 = 5 */
     a = gnc_numeric_create(2, -1);
     b = gnc_numeric_create(300, 100);
@@ -832,7 +840,7 @@
     ans = gnc_numeric_mul(a, b, GNC_DENOM_RECIPROCAL(1), GNC_HOW_RND_NEVER);
     check_binary_op (gnc_numeric_create(6, -1),
                      ans, a, b, "expected %s got %s = %s * %s for reciprocal");
-    
+
     /* check gnc_numeric_div */
     /* -60 / 20 = -3 */
     a = gnc_numeric_create(-60, 1);
@@ -847,36 +855,37 @@
     ans = gnc_numeric_div(a, b, GNC_DENOM_RECIPROCAL(1), GNC_HOW_RND_NEVER);
     check_binary_op (gnc_numeric_create(3, -1),
                      ans, a, b, "expected %s got %s = %s / %s for reciprocal");
-    
 
+
 }
-  
+
 /* ======================================================= */
 
 static void
 run_test (void)
 {
-	check_eq_operator ();
-	check_reduce ();
-	check_equality_operator ();
-	check_rounding();
-	check_double();
-	check_neg();
-	check_add_subtract();
-	check_mult_div ();
-	check_reciprocal();
+    check_eq_operator ();
+    check_reduce ();
+    check_equality_operator ();
+    check_rounding();
+    check_double();
+    check_neg();
+    check_add_subtract();
+    check_mult_div ();
+    check_reciprocal();
 }
 
 int
 main (int argc, char **argv)
 {
-	qof_init();
-	if(cashobjects_register()) {
-		run_test ();
-		print_test_results();
-	}
-	qof_close();
-  return get_rv();
+    qof_init();
+    if (cashobjects_register())
+    {
+        run_test ();
+        print_test_results();
+    }
+    qof_close();
+    return get_rv();
 }
 
 /* ======================== END OF FILE ====================== */

Modified: gnucash/trunk/src/engine/test/test-object.c
===================================================================
--- gnucash/trunk/src/engine/test/test-object.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-object.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,9 +20,9 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- /*
- * Lightly test the QofObject infrastructure.
- */
+/*
+* Lightly test the QofObject infrastructure.
+*/
 #include "config.h"
 #include <glib.h>
 #include <glib/gi18n.h>
@@ -38,121 +38,134 @@
 static void test_printable (const char *name, gpointer obj);
 static void test_foreach (QofBook *, const char *);
 
-static QofObject bus_obj = {
-  interface_version:  QOF_OBJECT_VERSION,
-  e_type:             TEST_MODULE_NAME,
-  type_label:         TEST_MODULE_DESC,
-  create:             NULL,
-  book_begin:         NULL,
-  book_end:           NULL,
-  is_dirty:           NULL,
-  mark_clean:         NULL,
-  foreach:            obj_foreach,
-  printable:          printable,
-  version_cmp:        NULL,
+static QofObject bus_obj =
+{
+interface_version:
+    QOF_OBJECT_VERSION,
+e_type:
+    TEST_MODULE_NAME,
+type_label:
+    TEST_MODULE_DESC,
+create:
+    NULL,
+book_begin:
+    NULL,
+book_end:
+    NULL,
+is_dirty:
+    NULL,
+mark_clean:
+    NULL,
+foreach:
+    obj_foreach,
+printable:
+    printable,
+version_cmp:
+    NULL,
 };
 
-static void 
+static void
 test_object (void)
 {
-  QofBook *book = qof_book_new();
+    QofBook *book = qof_book_new();
 
-  do_test ((NULL != book), "book null");
+    do_test ((NULL != book), "book null");
 
-  /* Test the global registration and lookup functions */
-  {
-    do_test (!qof_object_register (NULL), "register NULL");
-    do_test (qof_object_register (&bus_obj), "register test object");
-    do_test (!qof_object_register (&bus_obj), "register test object again");
-    do_test (qof_object_lookup (TEST_MODULE_NAME) == &bus_obj,
-	     "lookup our installed object");
-    do_test (qof_object_lookup ("snm98sn snml say  dyikh9y9ha") == NULL,
-	     "lookup non-existant object object");
+    /* Test the global registration and lookup functions */
+    {
+        do_test (!qof_object_register (NULL), "register NULL");
+        do_test (qof_object_register (&bus_obj), "register test object");
+        do_test (!qof_object_register (&bus_obj), "register test object again");
+        do_test (qof_object_lookup (TEST_MODULE_NAME) == &bus_obj,
+                 "lookup our installed object");
+        do_test (qof_object_lookup ("snm98sn snml say  dyikh9y9ha") == NULL,
+                 "lookup non-existant object object");
 
-    do_test (!safe_strcmp (qof_object_get_type_label (TEST_MODULE_NAME),
-		      _(TEST_MODULE_DESC)),
-	     "test description return");
-  }
+        do_test (!safe_strcmp (qof_object_get_type_label (TEST_MODULE_NAME),
+                               _(TEST_MODULE_DESC)),
+                 "test description return");
+    }
 
-  test_foreach (book, TEST_MODULE_NAME);
-  test_printable (TEST_MODULE_NAME, (gpointer)1);
+    test_foreach (book, TEST_MODULE_NAME);
+    test_printable (TEST_MODULE_NAME, (gpointer)1);
 }
 
 static void
 obj_foreach (const QofCollection *col, QofInstanceForeachCB cb, gpointer u_d)
 {
-  int *foo = u_d;
+    int *foo = u_d;
 
-  do_test (col != NULL, "foreach: NULL collection");
-  success ("called foreach callback");
+    do_test (col != NULL, "foreach: NULL collection");
+    success ("called foreach callback");
 
-  *foo = 1;
+    *foo = 1;
 }
 
 static void foreachCB (QofInstance *ent, gpointer u_d)
 {
-  do_test (FALSE, "FAIL");
+    do_test (FALSE, "FAIL");
 }
 
 static const char *
 printable (gpointer obj)
 {
-  do_test (obj != NULL, "printable: object is NULL");
-  success ("called printable callback");
-  return ((const char *)obj);
+    do_test (obj != NULL, "printable: object is NULL");
+    success ("called printable callback");
+    return ((const char *)obj);
 }
 
 static void
 test_foreach (QofBook *book, const char *name)
 {
-  int res = 0;
+    int res = 0;
 
-  qof_object_foreach (NULL, NULL, NULL, &res);
-  do_test (res == 0, "object: Foreach: NULL, NULL, NULL");
-  qof_object_foreach (NULL, NULL, foreachCB, &res);
-  do_test (res == 0, "object: Foreach: NULL, NULL, foreachCB");
+    qof_object_foreach (NULL, NULL, NULL, &res);
+    do_test (res == 0, "object: Foreach: NULL, NULL, NULL");
+    qof_object_foreach (NULL, NULL, foreachCB, &res);
+    do_test (res == 0, "object: Foreach: NULL, NULL, foreachCB");
 
-  qof_object_foreach (NULL, book, NULL, &res);
-  do_test (res == 0, "object: Foreach: NULL, book, NULL");
-  qof_object_foreach (NULL, book, foreachCB, &res);
-  do_test (res == 0, "object: Foreach: NULL, book, foreachCB");
+    qof_object_foreach (NULL, book, NULL, &res);
+    do_test (res == 0, "object: Foreach: NULL, book, NULL");
+    qof_object_foreach (NULL, book, foreachCB, &res);
+    do_test (res == 0, "object: Foreach: NULL, book, foreachCB");
 
-  qof_object_foreach (name, NULL, NULL, &res);
-  do_test (res == 0, "object: Foreach: name, NULL, NULL");
-  qof_object_foreach (name, NULL, foreachCB, &res);
-  do_test (res == 0, "object: Foreach: name, NULL, foreachCB");
+    qof_object_foreach (name, NULL, NULL, &res);
+    do_test (res == 0, "object: Foreach: name, NULL, NULL");
+    qof_object_foreach (name, NULL, foreachCB, &res);
+    do_test (res == 0, "object: Foreach: name, NULL, foreachCB");
 
-  qof_object_foreach (name, book, NULL, &res);
-  do_test (res != 0, "object: Foreach: name, book, NULL");
+    qof_object_foreach (name, book, NULL, &res);
+    do_test (res != 0, "object: Foreach: name, book, NULL");
 
-  res = 0;
-  qof_object_foreach (name, book, foreachCB, &res);
-  do_test (res != 0, "object: Foreach: name, book, foreachCB");
+    res = 0;
+    qof_object_foreach (name, book, foreachCB, &res);
+    do_test (res != 0, "object: Foreach: name, book, foreachCB");
 }
 
 static void
 test_printable (const char *name, gpointer obj)
 {
-  const char *res;
+    const char *res;
 
-  do_test (qof_object_printable (NULL, NULL) == NULL,
-	   "object: Printable: NULL, NULL");
-  do_test (qof_object_printable (NULL, obj) == NULL,
-	   "object: Printable: NULL, object");
-  do_test (qof_object_printable (name, NULL) == NULL,
-	   "object: Printable: mod_name, NULL");
-  res = qof_object_printable (name, obj);
-  do_test (res != NULL, "object: Printable: mod_name, object");
+    do_test (qof_object_printable (NULL, NULL) == NULL,
+             "object: Printable: NULL, NULL");
+    do_test (qof_object_printable (NULL, obj) == NULL,
+             "object: Printable: NULL, object");
+    do_test (qof_object_printable (name, NULL) == NULL,
+             "object: Printable: mod_name, NULL");
+    res = qof_object_printable (name, obj);
+    do_test (res != NULL, "object: Printable: mod_name, object");
 }
 
 int
 main (int argc, char **argv)
 {
-	qof_init();
-	if(cashobjects_register()) {
-		test_object();
-		print_test_results();
-	}
-	qof_close();
-  return get_rv();
+    qof_init();
+    if (cashobjects_register())
+    {
+        test_object();
+        print_test_results();
+    }
+    qof_close();
+    return get_rv();
 }

Modified: gnucash/trunk/src/engine/test/test-period.c
===================================================================
--- gnucash/trunk/src/engine/test/test-period.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-period.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,10 +20,10 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- /* 
- * Minimal test to see if a book can be split into two periods
- * without crashing.
- */
+/*
+* Minimal test to see if a book can be split into two periods
+* without crashing.
+*/
 
 #include "config.h"
 #include <ctype.h>
@@ -41,93 +41,93 @@
 static void
 run_test (void)
 {
-  QofSession *sess1, *sess2;
-  QofBook *openbook, *closedbook;
-  GList *acclist, *anode;
-  Account *root, *acc, *equity;
-  SplitList *splist;
-  Split *sfirst, *slast;
-  Transaction *tfirst, *tlast;
-  Timespec tsfirst, tslast, tsmiddle;
-  
-  sess1 = get_random_session ();
-  openbook = qof_session_get_book (sess1);
-  sess2 = get_random_session ();
-  closedbook = qof_session_get_book(sess2);
-  acc = NULL;
-  equity = get_random_account(openbook);
-  if (!openbook)
-  {
-    failure("book not created");
-    exit(get_rv());
-  }
+    QofSession *sess1, *sess2;
+    QofBook *openbook, *closedbook;
+    GList *acclist, *anode;
+    Account *root, *acc, *equity;
+    SplitList *splist;
+    Split *sfirst, *slast;
+    Transaction *tfirst, *tlast;
+    Timespec tsfirst, tslast, tsmiddle;
 
-  add_random_transactions_to_book (openbook, num_trans);
+    sess1 = get_random_session ();
+    openbook = qof_session_get_book (sess1);
+    sess2 = get_random_session ();
+    closedbook = qof_session_get_book(sess2);
+    acc = NULL;
+    equity = get_random_account(openbook);
+    if (!openbook)
+    {
+        failure("book not created");
+        exit(get_rv());
+    }
 
-  root = gnc_book_get_root_account (openbook);
+    add_random_transactions_to_book (openbook, num_trans);
 
-  acclist = gnc_account_get_descendants (root);
-  for (anode=acclist; anode; anode=anode->next)
-  {
-    int ns;
-    acc = anode->data;
-    ns = g_list_length (xaccAccountGetSplitList (acc));
-    if (2 <= ns) break;
-    acc = NULL;
-  }
-  g_list_free(acclist);
+    root = gnc_book_get_root_account (openbook);
 
-  if(!acc)
-  {
-    failure("book didn't have accounts with enough splits");
-    exit(get_rv());
-  }
+    acclist = gnc_account_get_descendants (root);
+    for (anode = acclist; anode; anode = anode->next)
+    {
+        int ns;
+        acc = anode->data;
+        ns = g_list_length (xaccAccountGetSplitList (acc));
+        if (2 <= ns) break;
+        acc = NULL;
+    }
+    g_list_free(acclist);
 
-  splist = xaccAccountGetSplitList(acc);
-  if(!splist)
-  {
-    failure("account has no transactions");
-    exit(get_rv());
-  }
+    if (!acc)
+    {
+        failure("book didn't have accounts with enough splits");
+        exit(get_rv());
+    }
 
-  sfirst = splist->data;
-  slast = g_list_last(splist) ->data;
-  if (sfirst == slast)
-  {
-    failure("account doesn't have enough transactions");
-    exit(get_rv());
-  }
+    splist = xaccAccountGetSplitList(acc);
+    if (!splist)
+    {
+        failure("account has no transactions");
+        exit(get_rv());
+    }
 
-  tfirst = xaccSplitGetParent (sfirst);
-  tlast = xaccSplitGetParent (slast);
-  
-  if (!tfirst || !tlast)
-  {
-    failure("malformed transactions in account");
-    exit(get_rv());
-  }
+    sfirst = splist->data;
+    slast = g_list_last(splist) ->data;
+    if (sfirst == slast)
+    {
+        failure("account doesn't have enough transactions");
+        exit(get_rv());
+    }
 
-  tsfirst = xaccTransRetDatePostedTS (tfirst);
-  tslast = xaccTransRetDatePostedTS (tlast);
+    tfirst = xaccSplitGetParent (sfirst);
+    tlast = xaccSplitGetParent (slast);
 
-  if (tsfirst.tv_sec == tslast.tv_sec)
-  {
-    failure("transactions not time separated");
-    exit(get_rv());
-  }
+    if (!tfirst || !tlast)
+    {
+        failure("malformed transactions in account");
+        exit(get_rv());
+    }
 
-  tsmiddle = tsfirst;
-  tsmiddle.tv_sec = (tsfirst.tv_sec + tslast.tv_sec)/2;
-  closedbook = gnc_book_close_period (openbook, tsmiddle, 
-                  equity, "this is opening balance dude");
+    tsfirst = xaccTransRetDatePostedTS (tfirst);
+    tslast = xaccTransRetDatePostedTS (tlast);
 
-  if (!closedbook)
-  {
-    failure("closed book not created");
-    exit(get_rv());
-  }
+    if (tsfirst.tv_sec == tslast.tv_sec)
+    {
+        failure("transactions not time separated");
+        exit(get_rv());
+    }
 
-  success ("periods lightly tested and seem to work");
+    tsmiddle = tsfirst;
+    tsmiddle.tv_sec = (tsfirst.tv_sec + tslast.tv_sec) / 2;
+    closedbook = gnc_book_close_period (openbook, tsmiddle,
+                                        equity, "this is opening balance dude");
+
+    if (!closedbook)
+    {
+        failure("closed book not created");
+        exit(get_rv());
+    }
+
+    success ("periods lightly tested and seem to work");
 }
 
 int
@@ -140,7 +140,8 @@
     qof_init();
     g_log_set_always_fatal( G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING );
 
-    if(cashobjects_register()) {
+    if (cashobjects_register())
+    {
         srand(num_trans);
         run_test ();
         print_test_results();

Modified: gnucash/trunk/src/engine/test/test-query.c
===================================================================
--- gnucash/trunk/src/engine/test/test-query.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-query.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -34,80 +34,81 @@
 static int
 test_trans_query (Transaction *trans, gpointer data)
 {
-  QofBook *book = data;
-  GList *list;
-  Query *q;
+    QofBook *book = data;
+    GList *list;
+    Query *q;
 
-  q = make_trans_query (trans, ALL_QT);
-  xaccQuerySetBook (q, book);
+    q = make_trans_query (trans, ALL_QT);
+    xaccQuerySetBook (q, book);
 
-  list = xaccQueryGetTransactions (q, QUERY_TXN_MATCH_ANY);
-  if (g_list_length (list) != 1)
-  {
-    failure_args ("test number returned", __FILE__, __LINE__,
-                  "number of matching transactions %d not 1",
-                  g_list_length (list));
-    g_list_free (list);
-    return 13;
-  }
+    list = xaccQueryGetTransactions (q, QUERY_TXN_MATCH_ANY);
+    if (g_list_length (list) != 1)
+    {
+        failure_args ("test number returned", __FILE__, __LINE__,
+                      "number of matching transactions %d not 1",
+                      g_list_length (list));
+        g_list_free (list);
+        return 13;
+    }
 
-  if (list->data != trans)
-  {
-    failure ("matching transaction is wrong");
+    if (list->data != trans)
+    {
+        failure ("matching transaction is wrong");
+        g_list_free (list);
+        return 13;
+    }
+
+    success ("found right transaction");
+    xaccFreeQuery (q);
     g_list_free (list);
-    return 13;
-  }
 
-  success ("found right transaction");
-  xaccFreeQuery (q);
-  g_list_free (list);
-
-  return 0;
+    return 0;
 }
 
 static void
 run_test (void)
 {
-  QofSession *session;
-  Account *root;
-  QofBook *book;
+    QofSession *session;
+    Account *root;
+    QofBook *book;
 
-  session = get_random_session ();
-  book = qof_session_get_book (session);
-  root = gnc_book_get_root_account (book);
+    session = get_random_session ();
+    book = qof_session_get_book (session);
+    root = gnc_book_get_root_account (book);
 
-  add_random_transactions_to_book (book, 20);
+    add_random_transactions_to_book (book, 20);
 
-  xaccAccountTreeForEachTransaction (root, test_trans_query, book);
+    xaccAccountTreeForEachTransaction (root, test_trans_query, book);
 
-  qof_session_end (session);
+    qof_session_end (session);
 }
 
 int
 main (int argc, char **argv)
 {
-  int i;
+    int i;
 
-  qof_init();
-  g_log_set_always_fatal( G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING );
+    qof_init();
+    g_log_set_always_fatal( G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING );
 
-  xaccLogDisable ();
+    xaccLogDisable ();
 
-  /* Always start from the same random seed so we fail consistently */
-  srand(0);
-  if(!cashobjects_register()) {
-    failure("can't register cashbojects");
-    goto cleanup;
-  }
+    /* Always start from the same random seed so we fail consistently */
+    srand(0);
+    if (!cashobjects_register())
+    {
+        failure("can't register cashbojects");
+        goto cleanup;
+    }
 
-  /* Loop the test. */
-  for (i=0; i < 10; i++)
-  {
-    run_test ();
-  }
-  success("queries seem to work");
+    /* Loop the test. */
+    for (i = 0; i < 10; i++)
+    {
+        run_test ();
+    }
+    success("queries seem to work");
 
- cleanup:
-  qof_close();
-  return get_rv();
+cleanup:
+    qof_close();
+    return get_rv();
 }

Modified: gnucash/trunk/src/engine/test/test-querynew.c
===================================================================
--- gnucash/trunk/src/engine/test/test-querynew.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-querynew.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,7 +20,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 #include <glib.h>
 #include <stdio.h>
@@ -35,49 +35,50 @@
 
 static int test_sort (gpointer a, gpointer b)
 {
-  return 0;
+    return 0;
 }
 
 static int test_core_param (gpointer a)
 {
-  return 0;
+    return 0;
 }
 
 static void test_class (void)
 {
-  static QofParam params[] = {
-    { TEST_PARAM, TEST_CORE, (QofAccessFunc)test_core_param, NULL },
-    { NULL },
-  };
+    static QofParam params[] =
+    {
+        { TEST_PARAM, TEST_CORE, (QofAccessFunc)test_core_param, NULL },
+        { NULL },
+    };
 
-  fprintf (stderr, "\tTesting the qof_query_object interface. \n"
-	   "\tYou may see some \"** CRITICAL **\" messages, which you can safely ignore\n");
+    fprintf (stderr, "\tTesting the qof_query_object interface. \n"
+             "\tYou may see some \"** CRITICAL **\" messages, which you can safely ignore\n");
 
-  qof_class_register (TEST_MODULE_NAME, (QofSortFunc)test_sort, params);
+    qof_class_register (TEST_MODULE_NAME, (QofSortFunc)test_sort, params);
 
-  do_test (qof_class_get_parameter (TEST_MODULE_NAME, TEST_PARAM)
-	   == &params[0], "qof_class_get_parameter");
-  do_test (qof_class_get_parameter (NULL, NULL) == NULL,
-	   "qof_class_get_parameter (NULL, NULL)");
-  do_test (qof_class_get_parameter (TEST_MODULE_NAME, NULL) == NULL,
-	   "qof_class_get_parameter (TEST_MODULE_NAME, NULL)");
-  do_test (qof_class_get_parameter (TEST_MODULE_NAME, BAD_PARAM) == NULL,
-	   "qof_class_get_parameter (TEST_MODULE_NAME, BAD_PARAM)");
-  do_test (qof_class_get_parameter (NULL, TEST_PARAM) == NULL,
-	   "qof_class_get_parameter (NULL, TEST_PARAM)");
+    do_test (qof_class_get_parameter (TEST_MODULE_NAME, TEST_PARAM)
+             == &params[0], "qof_class_get_parameter");
+    do_test (qof_class_get_parameter (NULL, NULL) == NULL,
+             "qof_class_get_parameter (NULL, NULL)");
+    do_test (qof_class_get_parameter (TEST_MODULE_NAME, NULL) == NULL,
+             "qof_class_get_parameter (TEST_MODULE_NAME, NULL)");
+    do_test (qof_class_get_parameter (TEST_MODULE_NAME, BAD_PARAM) == NULL,
+             "qof_class_get_parameter (TEST_MODULE_NAME, BAD_PARAM)");
+    do_test (qof_class_get_parameter (NULL, TEST_PARAM) == NULL,
+             "qof_class_get_parameter (NULL, TEST_PARAM)");
 
-  do_test (qof_class_get_parameter_getter (TEST_MODULE_NAME, TEST_PARAM)
-	   == (QofAccessFunc)test_core_param,
-	   "qof_class_get_parameter_getter");
+    do_test (qof_class_get_parameter_getter (TEST_MODULE_NAME, TEST_PARAM)
+             == (QofAccessFunc)test_core_param,
+             "qof_class_get_parameter_getter");
 
-  do_test (safe_strcmp (qof_class_get_parameter_type (TEST_MODULE_NAME,
-						     TEST_PARAM),
-			TEST_CORE) == 0, "qof_class_get_parameter_type");
+    do_test (safe_strcmp (qof_class_get_parameter_type (TEST_MODULE_NAME,
+                          TEST_PARAM),
+                          TEST_CORE) == 0, "qof_class_get_parameter_type");
 
-/*  do_test (qof_class_get_default_sort (TEST_MODULE_NAME) == test_sort,
-	   "qof_class_get_default_sort");
-  do_test (qof_class_get_default_sort (NULL) == NULL,
-	   "qof_class_get_default_sort (NULL)");*/
+    /*  do_test (qof_class_get_default_sort (TEST_MODULE_NAME) == test_sort,
+    	   "qof_class_get_default_sort");
+      do_test (qof_class_get_default_sort (NULL) == NULL,
+    	   "qof_class_get_default_sort (NULL)");*/
 }
 
 static void test_query_core (void)
@@ -92,13 +93,14 @@
 int
 main (int argc, char **argv)
 {
-     qof_init();
-     if(cashobjects_register()) {
-          test_query_core();
-          test_class();
-          test_querynew();
-     }
-     qof_close();
-     print_test_results();
-     return get_rv();
+    qof_init();
+    if (cashobjects_register())
+    {
+        test_query_core();
+        test_class();
+        test_querynew();
+    }
+    qof_close();
+    print_test_results();
+    return get_rv();
 }

Modified: gnucash/trunk/src/engine/test/test-recurrence.c
===================================================================
--- gnucash/trunk/src/engine/test/test-recurrence.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-recurrence.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -51,7 +51,8 @@
     startToNext = g_date_get_julian(next) - g_date_get_julian(start);
 
     // Phase test
-    switch (pt) {
+    switch (pt)
+    {
     case PERIOD_YEAR:
         do_test((g_date_get_year(next) - g_date_get_year(start)) % mult == 0,
                 "year period phase wrong"); // redundant
@@ -63,21 +64,23 @@
         // fall-through
     case PERIOD_LAST_WEEKDAY:
     case PERIOD_NTH_WEEKDAY:
-    case PERIOD_MONTH: {
+    case PERIOD_MONTH:
+    {
         gint monthdiff;
         GDateDay day_start, day_next;
 
         monthdiff = (g_date_get_month(next) - g_date_get_month(start)) +
-            12 * (g_date_get_year(next) - g_date_get_year(start));
+                    12 * (g_date_get_year(next) - g_date_get_year(start));
         do_test(monthdiff % mult == 0, "month or year phase wrong");
 
-        if (pt == PERIOD_NTH_WEEKDAY || pt == PERIOD_LAST_WEEKDAY) {
+        if (pt == PERIOD_NTH_WEEKDAY || pt == PERIOD_LAST_WEEKDAY)
+        {
             guint sweek, nweek;
 
             do_test(g_date_get_weekday(next) == g_date_get_weekday(start),
                     "weekday phase wrong");
-            sweek = (g_date_get_day(start)-1) / 7;
-            nweek = (g_date_get_day(next)-1) / 7;
+            sweek = (g_date_get_day(start) - 1) / 7;
+            nweek = (g_date_get_day(next) - 1) / 7;
 
             /* 3 cases: either the weeks agree, OR 'next' didn't have
                5 of the weekday that 'start' did, so it's only the
@@ -86,17 +89,20 @@
                5th of that weekday */
             do_test(sweek == nweek ||
                     (sweek == 4 && nweek == 3 && (g_date_get_day(next) + 7) >
-                    g_date_get_days_in_month(
-                        g_date_get_month(next), g_date_get_year(next))) ||
+                     g_date_get_days_in_month(
+                         g_date_get_month(next), g_date_get_year(next))) ||
                     (sweek == 3 && nweek == 4 && (pt == PERIOD_LAST_WEEKDAY)),
                     "week of month phase wrong");
 
-        } else {
+        }
+        else
+        {
             day_start = g_date_get_day(start);
             day_next = g_date_get_day(next);
             if (day_start < 28)
                 do_test(day_start == day_next, "dom don't match");
-            else if (pt != PERIOD_END_OF_MONTH) {
+            else if (pt != PERIOD_END_OF_MONTH)
+            {
                 // the end of month case was already checked above.  near
                 // the end of the month, the days should still agree,
                 // unless they can't because of a short month.
@@ -105,7 +111,7 @@
             }
         }
     }
-        break;
+    break;
     case PERIOD_WEEK:
         mult *= 7;
         // fall-through
@@ -140,15 +146,20 @@
     gint32 j1, j2;
     gint i_ref;
 
-    for (pt = PERIOD_ONCE; pt < NUM_PERIOD_TYPES; pt++) {
-        for (wadj = WEEKEND_ADJ_NONE; wadj < NUM_WEEKEND_ADJS; wadj++) {
-            for (j1 = JULIAN_START; j1 < JULIAN_START + NUM_DATES_TO_TEST; j1++) {
+    for (pt = PERIOD_ONCE; pt < NUM_PERIOD_TYPES; pt++)
+    {
+        for (wadj = WEEKEND_ADJ_NONE; wadj < NUM_WEEKEND_ADJS; wadj++)
+        {
+            for (j1 = JULIAN_START; j1 < JULIAN_START + NUM_DATES_TO_TEST; j1++)
+            {
                 g_date_set_julian(&d_start, j1);
-                for (i_ref = 0; i_ref < NUM_DATES_TO_TEST_REF; i_ref++) {
+                for (i_ref = 0; i_ref < NUM_DATES_TO_TEST_REF; i_ref++)
+                {
                     j2 = (guint32) get_random_int_in_range(1, 1 << 19);
                     g_date_set_julian(&d_ref, j2);
 
-                    for (mult = 0; mult < NUM_MULT_TO_TEST; mult++) {
+                    for (mult = 0; mult < NUM_MULT_TO_TEST; mult++)
+                    {
                         recurrenceSet(&r, mult, pt, &d_start, wadj);
                         pt_reg = recurrenceGetPeriodType(&r);
                         d_start_reg = recurrenceGetDate(&r);
@@ -160,7 +171,7 @@
                                     mult_reg, pt_reg, wadj_reg);
 
                     }
-               }
+                }
             }
         }
     }
@@ -168,7 +179,8 @@
 
 static gboolean test_equal(GDate *d1, GDate *d2)
 {
-    if (!do_test(g_date_compare(d1, d2) == 0, "dates don't match")) {
+    if (!do_test(g_date_compare(d1, d2) == 0, "dates don't match"))
+    {
         gchar s1[21];
         gchar s2[21];
         g_date_strftime(s1, 20, "%x", d1);
@@ -199,7 +211,8 @@
     recurrenceNextInstance(&r, &ref, &next);
 
     check_valid(&next, &ref, &start, mult, pt, WEEKEND_ADJ_NONE);
-    if (!test_equal(&next, &true_next)) {
+    if (!test_equal(&next, &true_next))
+    {
         gchar s1[21], s2[21], s3[21];
         g_date_strftime(s1, 20, "%x", &start);
         g_date_strftime(s2, 20, "%x", &ref);
@@ -226,89 +239,89 @@
 
 static void test_nth_compare()
 {
-    test_nth(4,1,2005,   4,2,2005, -1, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   4,4,2005, -3, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   4,7,2005, -6, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   4,8,2005, -7, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   4,14,2005, -13, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   4,30,2005, -29, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   5,1,2005, 5, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   5,5,2005, 1, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   5,6,2005, 0, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   5,7,2005, -1, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   5,8,2005, -2, PERIOD_NTH_WEEKDAY);
-    test_nth(4,1,2005,   5,21,2005, -15, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   4, 2, 2005, -1, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   4, 4, 2005, -3, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   4, 7, 2005, -6, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   4, 8, 2005, -7, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   4, 14, 2005, -13, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   4, 30, 2005, -29, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   5, 1, 2005, 5, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   5, 5, 2005, 1, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   5, 6, 2005, 0, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   5, 7, 2005, -1, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   5, 8, 2005, -2, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 1, 2005,   5, 21, 2005, -15, PERIOD_NTH_WEEKDAY);
 
 
-    test_nth(4,6,2005,   4,1,2005, 5, PERIOD_NTH_WEEKDAY);
-    test_nth(4,6,2005,   4,4,2005, 2, PERIOD_NTH_WEEKDAY);
-    test_nth(4,6,2005,   4,6,2005, 0, PERIOD_NTH_WEEKDAY);
-    test_nth(4,6,2005,   4,9,2005, -3, PERIOD_NTH_WEEKDAY);
-    test_nth(4,6,2005,   4,11,2005, -5, PERIOD_NTH_WEEKDAY);
-    test_nth(4,6,2005,   4,13,2005, -7, PERIOD_NTH_WEEKDAY);
-    test_nth(4,6,2005,   4,14,2005, -8, PERIOD_NTH_WEEKDAY);
-    test_nth(4,6,2005,   4,29,2005, -23, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 6, 2005,   4, 1, 2005, 5, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 6, 2005,   4, 4, 2005, 2, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 6, 2005,   4, 6, 2005, 0, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 6, 2005,   4, 9, 2005, -3, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 6, 2005,   4, 11, 2005, -5, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 6, 2005,   4, 13, 2005, -7, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 6, 2005,   4, 14, 2005, -8, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 6, 2005,   4, 29, 2005, -23, PERIOD_NTH_WEEKDAY);
 
-    test_nth(4,12,2005,   4,1,2005, 11, PERIOD_NTH_WEEKDAY);
-    test_nth(4,12,2005,   4,4,2005, 8, PERIOD_NTH_WEEKDAY);
-    test_nth(4,12,2005,   4,11,2005, 1, PERIOD_NTH_WEEKDAY);
-    test_nth(4,12,2005,   4,12,2005, 0, PERIOD_NTH_WEEKDAY);
-    test_nth(4,12,2005,   4,13,2005, -1, PERIOD_NTH_WEEKDAY);
-    test_nth(4,12,2005,   4,17,2005, -5, PERIOD_NTH_WEEKDAY);
-    test_nth(4,12,2005,   4,19,2005, -7, PERIOD_NTH_WEEKDAY);
-    test_nth(4,12,2005,   4,28,2005, -16, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 12, 2005,   4, 1, 2005, 11, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 12, 2005,   4, 4, 2005, 8, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 12, 2005,   4, 11, 2005, 1, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 12, 2005,   4, 12, 2005, 0, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 12, 2005,   4, 13, 2005, -1, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 12, 2005,   4, 17, 2005, -5, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 12, 2005,   4, 19, 2005, -7, PERIOD_NTH_WEEKDAY);
+    test_nth(4, 12, 2005,   4, 28, 2005, -16, PERIOD_NTH_WEEKDAY);
 
-    test_nth(4,29,2005,   4,30,2005, -1, PERIOD_LAST_WEEKDAY);
-    test_nth(4,29,2005,   5,1,2005, 26, PERIOD_LAST_WEEKDAY);
-    test_nth(4,29,2005,   7,9,2005, 20, PERIOD_LAST_WEEKDAY);
-    test_nth(4,29,2005,   7,31,2005, -2, PERIOD_LAST_WEEKDAY);
+    test_nth(4, 29, 2005,   4, 30, 2005, -1, PERIOD_LAST_WEEKDAY);
+    test_nth(4, 29, 2005,   5, 1, 2005, 26, PERIOD_LAST_WEEKDAY);
+    test_nth(4, 29, 2005,   7, 9, 2005, 20, PERIOD_LAST_WEEKDAY);
+    test_nth(4, 29, 2005,   7, 31, 2005, -2, PERIOD_LAST_WEEKDAY);
 
-    test_nth(4,28,2005,   4,30,2005, -2, PERIOD_LAST_WEEKDAY);
-    test_nth(4,28,2005,   5,1,2005, 25, PERIOD_LAST_WEEKDAY);
-    test_nth(4,28,2005,   7,9,2005, 19, PERIOD_LAST_WEEKDAY);
-    test_nth(4,28,2005,   7,31,2005, -3, PERIOD_LAST_WEEKDAY);
-    test_nth(4,28,2005,   9,21,2005, 8, PERIOD_LAST_WEEKDAY);
+    test_nth(4, 28, 2005,   4, 30, 2005, -2, PERIOD_LAST_WEEKDAY);
+    test_nth(4, 28, 2005,   5, 1, 2005, 25, PERIOD_LAST_WEEKDAY);
+    test_nth(4, 28, 2005,   7, 9, 2005, 19, PERIOD_LAST_WEEKDAY);
+    test_nth(4, 28, 2005,   7, 31, 2005, -3, PERIOD_LAST_WEEKDAY);
+    test_nth(4, 28, 2005,   9, 21, 2005, 8, PERIOD_LAST_WEEKDAY);
 
 }
 #endif
 static void test_some()
 {
-    test_specific(PERIOD_NTH_WEEKDAY, 1, 4,1,2005,    4,2,2005,  5,6,2005);
-    test_specific(PERIOD_NTH_WEEKDAY, 1, 7,14,2005,   11,15,2005,  12,8,2005);
-    test_specific(PERIOD_NTH_WEEKDAY, 1, 7,14,2005,   11,5,2005,  11,10,2005);
-    test_specific(PERIOD_NTH_WEEKDAY, 1, 4,1,2005,    4,2,2005,  5,6,2005);
-    test_specific(PERIOD_NTH_WEEKDAY, 1, 4,1,2005,    4,2,2005,  5,6,2005);
+    test_specific(PERIOD_NTH_WEEKDAY, 1, 4, 1, 2005,    4, 2, 2005,  5, 6, 2005);
+    test_specific(PERIOD_NTH_WEEKDAY, 1, 7, 14, 2005,   11, 15, 2005,  12, 8, 2005);
+    test_specific(PERIOD_NTH_WEEKDAY, 1, 7, 14, 2005,   11, 5, 2005,  11, 10, 2005);
+    test_specific(PERIOD_NTH_WEEKDAY, 1, 4, 1, 2005,    4, 2, 2005,  5, 6, 2005);
+    test_specific(PERIOD_NTH_WEEKDAY, 1, 4, 1, 2005,    4, 2, 2005,  5, 6, 2005);
 
-    test_specific(PERIOD_LAST_WEEKDAY, 1, 4,29,2005,    4,30,2005,  5,27,2005);
-    test_specific(PERIOD_LAST_WEEKDAY, 1, 4,29,2005,    5,1,2005,  5,27,2005);
-    test_specific(PERIOD_LAST_WEEKDAY, 1, 4,29,2005,    7,9,2005,  7,29,2005);
-    test_specific(PERIOD_LAST_WEEKDAY, 1, 4,29,2005,    6,30,2005,  7,29,2005);
-    test_specific(PERIOD_LAST_WEEKDAY, 1, 4,29,2005,    7,31,2005,  8,26,2005);
+    test_specific(PERIOD_LAST_WEEKDAY, 1, 4, 29, 2005,    4, 30, 2005,  5, 27, 2005);
+    test_specific(PERIOD_LAST_WEEKDAY, 1, 4, 29, 2005,    5, 1, 2005,  5, 27, 2005);
+    test_specific(PERIOD_LAST_WEEKDAY, 1, 4, 29, 2005,    7, 9, 2005,  7, 29, 2005);
+    test_specific(PERIOD_LAST_WEEKDAY, 1, 4, 29, 2005,    6, 30, 2005,  7, 29, 2005);
+    test_specific(PERIOD_LAST_WEEKDAY, 1, 4, 29, 2005,    7, 31, 2005,  8, 26, 2005);
 
-    test_specific(PERIOD_NTH_WEEKDAY, 2, 4,27,2005,    4,27,2005,  6,22,2005);
+    test_specific(PERIOD_NTH_WEEKDAY, 2, 4, 27, 2005,    4, 27, 2005,  6, 22, 2005);
     //exit(1);
     //return;
-    test_specific(PERIOD_YEAR,          3,   9,8,838,    6,30,1094,  9,8,1096);
-    test_specific(PERIOD_YEAR,          2,   9,8,838,    6,30,1094,  9,8,1094);
-    test_specific(PERIOD_YEAR,          1,   1,10,1000,  1,5,1002,  1,10,1002);
+    test_specific(PERIOD_YEAR,          3,   9, 8, 838,    6, 30, 1094,  9, 8, 1096);
+    test_specific(PERIOD_YEAR,          2,   9, 8, 838,    6, 30, 1094,  9, 8, 1094);
+    test_specific(PERIOD_YEAR,          1,   1, 10, 1000,  1, 5, 1002,  1, 10, 1002);
     //return;
-    test_specific(PERIOD_MONTH, 1,     1,12,1,    2,6,1,    2,12,1);
+    test_specific(PERIOD_MONTH, 1,     1, 12, 1,    2, 6, 1,    2, 12, 1);
 
-    test_specific(PERIOD_MONTH, 1,     1,12,1,    2,12,1,   3,12,1);
-    test_specific(PERIOD_MONTH, 1,     1,12,1,    2,20,1,   3,12,1);
-    test_specific(PERIOD_MONTH, 1,     1,30,1,    2,28,1,   3,30,1);
-    test_specific(PERIOD_MONTH, 1,     1,30,1,    2,27,1,   2,28,1);
-    test_specific(PERIOD_MONTH, 1,     2,28,1,    3,30,1,   4,28,1);
+    test_specific(PERIOD_MONTH, 1,     1, 12, 1,    2, 12, 1,   3, 12, 1);
+    test_specific(PERIOD_MONTH, 1,     1, 12, 1,    2, 20, 1,   3, 12, 1);
+    test_specific(PERIOD_MONTH, 1,     1, 30, 1,    2, 28, 1,   3, 30, 1);
+    test_specific(PERIOD_MONTH, 1,     1, 30, 1,    2, 27, 1,   2, 28, 1);
+    test_specific(PERIOD_MONTH, 1,     2, 28, 1,    3, 30, 1,   4, 28, 1);
 
-    test_specific(PERIOD_END_OF_MONTH, 1,   2,28,1,    3,30,1,   3,31,1);
-    test_specific(PERIOD_END_OF_MONTH, 5,   4,30,1,    4,21,1,  4,30,1);
-    test_specific(PERIOD_END_OF_MONTH, 5,   2,28,1,    5,21,1,  7,31,1);
+    test_specific(PERIOD_END_OF_MONTH, 1,   2, 28, 1,    3, 30, 1,   3, 31, 1);
+    test_specific(PERIOD_END_OF_MONTH, 5,   4, 30, 1,    4, 21, 1,  4, 30, 1);
+    test_specific(PERIOD_END_OF_MONTH, 5,   2, 28, 1,    5, 21, 1,  7, 31, 1);
 
-    test_specific(PERIOD_YEAR,          7,   6,8,199,    9,10,1338,  6,8,1340);
-    test_specific(PERIOD_YEAR,          2,   9,8,838,    6,30,1094,  9,8,1094);
+    test_specific(PERIOD_YEAR,          7,   6, 8, 199,    9, 10, 1338,  6, 8, 1340);
+    test_specific(PERIOD_YEAR,          2,   9, 8, 838,    6, 30, 1094,  9, 8, 1094);
 
-    test_specific(PERIOD_YEAR,1,    5,2,13, 1,11,101,   5,2,101);
-    test_specific(PERIOD_DAY, 7,    4,1,2000,    4,8,2000,  4,15,2000);
+    test_specific(PERIOD_YEAR, 1,    5, 2, 13, 1, 11, 101,   5, 2, 101);
+    test_specific(PERIOD_DAY, 7,    4, 1, 2000,    4, 8, 2000,  4, 15, 2000);
 }
 
 static void test_use()

Modified: gnucash/trunk/src/engine/test/test-recursive.c
===================================================================
--- gnucash/trunk/src/engine/test/test-recursive.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-recursive.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -19,7 +19,7 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor
- *  Boston, MA  02110-1301,  USA 
+ *  Boston, MA  02110-1301,  USA
  */
 
 #include "config.h"
@@ -54,61 +54,61 @@
 /* simple object structure */
 typedef struct child_s
 {
-	QofInstance inst;
-	gchar       *Name;
-	gchar       flag;
-	gnc_numeric Amount;
-	Timespec    date;
-	double      discount; /* cheap pun, I know. */
-	gboolean    active;
-	gint32      version;
-	gint64 	    minor;
-}mychild;
+    QofInstance inst;
+    gchar       *Name;
+    gchar       flag;
+    gnc_numeric Amount;
+    Timespec    date;
+    double      discount; /* cheap pun, I know. */
+    gboolean    active;
+    gint32      version;
+    gint64 	    minor;
+} mychild;
 
 typedef struct childClass_s
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 } mychildClass;
 
 /* simple object structure */
 typedef struct parent_s
 {
-	QofInstance inst;
-	mychild     *child;
-	gchar       *Name;
-	gchar       flag;
-	gnc_numeric Amount;
-	Timespec    date;
-	double      discount; /* cheap pun, I know. */
-	gboolean    active;
-	gint32      version;
-	gint64      minor;
-}myparent;
+    QofInstance inst;
+    mychild     *child;
+    gchar       *Name;
+    gchar       flag;
+    gnc_numeric Amount;
+    Timespec    date;
+    double      discount; /* cheap pun, I know. */
+    gboolean    active;
+    gint32      version;
+    gint64      minor;
+} myparent;
 
 typedef struct parentClass_s
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 } myparentClass;
 
-	/* simple object structure */
+/* simple object structure */
 typedef struct grand_s
 {
-	QofInstance  inst;
-	myparent     *child;
-	GList        *descend;
-	gchar        *Name;
-	gchar        flag;
-	gnc_numeric  Amount;
-	Timespec     date;
-	double       discount; /* cheap pun, I know. */
-	gboolean     active;
-	gint32       version;
-	gint64       minor;
-}mygrand;
+    QofInstance  inst;
+    myparent     *child;
+    GList        *descend;
+    gchar        *Name;
+    gchar        flag;
+    gnc_numeric  Amount;
+    Timespec     date;
+    double       discount; /* cheap pun, I know. */
+    gboolean     active;
+    gint32       version;
+    gint64       minor;
+} mygrand;
 
 typedef struct grandClass_s
 {
-  QofInstanceClass parent_class;
+    QofInstanceClass parent_class;
 } mygrandClass;
 
 mygrand* grand_create(QofBook*);
@@ -278,827 +278,946 @@
 mygrand*
 grand_create(QofBook *book)
 {
-	mygrand *g;
+    mygrand *g;
 
-	g_return_val_if_fail(book, NULL);
-	g = g_object_new(GNC_TYPE_MYGRAND, NULL);
-	qof_instance_init_data (&g->inst, GRAND_MODULE_NAME, book);
-	g->date = *get_random_timespec();
-	g->discount = get_random_double();;
-	g->active = get_random_boolean();
-	g->version = get_random_int_in_range(1,10000);
-	g->minor = get_random_int_in_range(100001,99999999);
-	g->flag = get_random_character();
-	g->Name = get_random_string();
-	g->Amount = get_random_gnc_numeric();
-	g->child = NULL;
-	g->descend = NULL;
-	qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
-	return g;
+    g_return_val_if_fail(book, NULL);
+    g = g_object_new(GNC_TYPE_MYGRAND, NULL);
+    qof_instance_init_data (&g->inst, GRAND_MODULE_NAME, book);
+    g->date = *get_random_timespec();
+    g->discount = get_random_double();;
+    g->active = get_random_boolean();
+    g->version = get_random_int_in_range(1, 10000);
+    g->minor = get_random_int_in_range(100001, 99999999);
+    g->flag = get_random_character();
+    g->Name = get_random_string();
+    g->Amount = get_random_gnc_numeric();
+    g->child = NULL;
+    g->descend = NULL;
+    qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
+    return g;
 }
 
 myparent*
 parent_create(QofBook *book)
 {
-	myparent *g;
+    myparent *g;
 
-	g_return_val_if_fail(book, NULL);
-	g = g_object_new(GNC_TYPE_MYPARENT, NULL);
-	qof_instance_init_data (&g->inst, PARENT_MODULE_NAME, book);
-	g->date = *get_random_timespec();
-	g->discount = get_random_double();
-	g->active = get_random_boolean();
-	g->version = get_random_int_in_range(1,10000);
-	g->minor = get_random_int_in_range(100001,99999999);
-	g->flag = get_random_character();
-	g->Name = get_random_string();
-	g->Amount = get_random_gnc_numeric();
-	g->child = NULL;
-	qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
-	return g;
+    g_return_val_if_fail(book, NULL);
+    g = g_object_new(GNC_TYPE_MYPARENT, NULL);
+    qof_instance_init_data (&g->inst, PARENT_MODULE_NAME, book);
+    g->date = *get_random_timespec();
+    g->discount = get_random_double();
+    g->active = get_random_boolean();
+    g->version = get_random_int_in_range(1, 10000);
+    g->minor = get_random_int_in_range(100001, 99999999);
+    g->flag = get_random_character();
+    g->Name = get_random_string();
+    g->Amount = get_random_gnc_numeric();
+    g->child = NULL;
+    qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
+    return g;
 }
 
 mychild*
 child_create(QofBook *book)
 {
-	mychild *g;
+    mychild *g;
 
-	g_return_val_if_fail(book, NULL);
-	g = g_object_new(GNC_TYPE_MYCHILD, NULL);
-	qof_instance_init_data (&g->inst, CHILD_MODULE_NAME, book);
-	g->date = *get_random_timespec();
-	g->discount = get_random_double();
-	g->active = get_random_boolean();
-	g->version = get_random_int_in_range(1,10000);
-	g->minor = get_random_int_in_range(100001,99999999);
-	g->flag = get_random_character();
-	g->Name = get_random_string();
-	g->Amount = get_random_gnc_numeric();
-	qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
-	return g;
+    g_return_val_if_fail(book, NULL);
+    g = g_object_new(GNC_TYPE_MYCHILD, NULL);
+    qof_instance_init_data (&g->inst, CHILD_MODULE_NAME, book);
+    g->date = *get_random_timespec();
+    g->discount = get_random_double();
+    g->active = get_random_boolean();
+    g->version = get_random_int_in_range(1, 10000);
+    g->minor = get_random_int_in_range(100001, 99999999);
+    g->flag = get_random_character();
+    g->Name = get_random_string();
+    g->Amount = get_random_gnc_numeric();
+    qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
+    return g;
 }
 
 static void
 descend_cb (QofInstance *ent, gpointer user_data)
 {
-	mygrand *g = (mygrand*)user_data;
+    mygrand *g = (mygrand*)user_data;
 
-	g_return_if_fail(g || ent);
-	g->descend = g_list_prepend(g->descend, (mychild*)ent);
+    g_return_if_fail(g || ent);
+    g->descend = g_list_prepend(g->descend, (mychild*)ent);
 }
 
 static void
 grand_setDescend(mygrand *g, QofCollection *coll)
 {
-	g_return_if_fail(g || coll);
-	if(0 != safe_strcmp(qof_collection_get_type(coll), CHILD_MODULE_NAME))
-	{
-		return;
-	}
-	qof_collection_foreach(coll, descend_cb, g);
+    g_return_if_fail(g || coll);
+    if (0 != safe_strcmp(qof_collection_get_type(coll), CHILD_MODULE_NAME))
+    {
+        return;
+    }
+    qof_collection_foreach(coll, descend_cb, g);
 }
 
 static QofCollection*
 grand_getDescend(mygrand *g)
 {
-	QofCollection *col;
-	QofInstance *ent;
-	GList *list;
+    QofCollection *col;
+    QofInstance *ent;
+    GList *list;
 
-	g_return_val_if_fail(g, NULL);
-	col = qof_collection_new(CHILD_MODULE_NAME);
-	for(list = g_list_copy(g->descend);list;list=list->next)
-	{
-		ent = QOF_INSTANCE(list->data);
-		if(!ent) { break; }
-		do_test(0 == safe_strcmp(ent->e_type, CHILD_MODULE_NAME), "wrong entity");
-		qof_collection_add_entity(col, ent);
-	}
-	return col;
+    g_return_val_if_fail(g, NULL);
+    col = qof_collection_new(CHILD_MODULE_NAME);
+    for (list = g_list_copy(g->descend); list; list = list->next)
+    {
+        ent = QOF_INSTANCE(list->data);
+        if (!ent)
+        {
+            break;
+        }
+        do_test(0 == safe_strcmp(ent->e_type, CHILD_MODULE_NAME), "wrong entity");
+        qof_collection_add_entity(col, ent);
+    }
+    return col;
 }
 
 static void
 grand_setChild(mygrand *g, myparent *p)
 {
-	g_return_if_fail(g || p);
-	g->child = p;
+    g_return_if_fail(g || p);
+    g->child = p;
 }
 
 static myparent*
 grand_getChild(mygrand *g)
 {
-	g_return_val_if_fail(g, NULL);
-	return g->child;
+    g_return_val_if_fail(g, NULL);
+    return g->child;
 }
 
 void
 grand_setFlag(mygrand *g, gchar f)
 {
-	g_return_if_fail(g);
-	g->flag = f;
+    g_return_if_fail(g);
+    g->flag = f;
 }
 
 gchar
 grand_getFlag(mygrand *g)
 {
-	g_return_val_if_fail(g, 'n');
-	return g->flag;
+    g_return_val_if_fail(g, 'n');
+    return g->flag;
 }
 
 void
 grand_setMinor(mygrand *g, gint64 h)
 {
-	g_return_if_fail(g != NULL);
-	g->minor = h;
+    g_return_if_fail(g != NULL);
+    g->minor = h;
 }
 
 gint64
 grand_getMinor(mygrand *g)
 {
-	g_return_val_if_fail((g != NULL),0);
-	return g->minor;
+    g_return_val_if_fail((g != NULL), 0);
+    return g->minor;
 }
 
 void
 grand_setVersion(mygrand *g, gint32 h)
 {
-	g_return_if_fail(g != NULL);
-	g->version = h;
+    g_return_if_fail(g != NULL);
+    g->version = h;
 }
 
 gint32
 grand_getVersion(mygrand *g)
 {
-	if(!g) return 0;
-	return g->version;
+    if (!g) return 0;
+    return g->version;
 }
 
 void
 grand_setActive(mygrand *g, gboolean h)
 {
-	if(!g) return;
-	g->active = h;
+    if (!g) return;
+    g->active = h;
 }
 
 gboolean
 grand_getActive(mygrand *g)
 {
-	if(!g) return FALSE;
-	return g->active;
+    if (!g) return FALSE;
+    return g->active;
 }
 
 void
 grand_setDiscount(mygrand *g, double h)
 {
-	if(!g) return;
-	g->discount = h;
+    if (!g) return;
+    g->discount = h;
 }
 
 double
 grand_getDiscount(mygrand *g)
 {
-	if(!g) return 0;
-	return g->discount;
+    if (!g) return 0;
+    return g->discount;
 }
 
 void
 grand_setDate(mygrand *g, Timespec h)
 {
-	if(!g) return;
-	g->date = h;
+    if (!g) return;
+    g->date = h;
 }
 
 Timespec
 grand_getDate(mygrand *g)
 {
-	Timespec ts;
-	ts.tv_sec = 0;
-	ts.tv_nsec = 0;
-	if(!g) return ts;
-	ts = g->date;
-	return ts;
+    Timespec ts;
+    ts.tv_sec = 0;
+    ts.tv_nsec = 0;
+    if (!g) return ts;
+    ts = g->date;
+    return ts;
 }
 
 void
 grand_setName(mygrand* g, gchar* h)
 {
-	if(!g || !h) return;
-	g->Name = strdup(h);
+    if (!g || !h) return;
+    g->Name = strdup(h);
 }
 
 gchar*
 grand_getName(mygrand *g)
 {
-	if(!g) return NULL;
-	return g->Name;
+    if (!g) return NULL;
+    return g->Name;
 }
 
 void
 grand_setAmount(mygrand *g, gnc_numeric h)
 {
-	if(!g) return;
-	g->Amount = h;
+    if (!g) return;
+    g->Amount = h;
 }
 
 gnc_numeric
 grand_getAmount(mygrand *g)
 {
-	if(!g) return gnc_numeric_zero();
-	return g->Amount;
+    if (!g) return gnc_numeric_zero();
+    return g->Amount;
 }
 
 static void
 parent_setChild(myparent *p, mychild *c)
 {
-	g_return_if_fail(p || c);
-	p->child = c;
+    g_return_if_fail(p || c);
+    p->child = c;
 }
 
 static mychild*
 parent_getChild(myparent* p)
 {
-	g_return_val_if_fail(p, NULL);
-	return p->child;
+    g_return_val_if_fail(p, NULL);
+    return p->child;
 }
 
 void
 parent_setFlag(myparent *p, gchar f)
 {
-	g_return_if_fail(p);
-	p->flag = f;
+    g_return_if_fail(p);
+    p->flag = f;
 }
 
 gchar
 parent_getFlag(myparent *p)
 {
-	g_return_val_if_fail(p, 'n');
-	return p->flag;
+    g_return_val_if_fail(p, 'n');
+    return p->flag;
 }
 
 void
 parent_setMinor(myparent *p, gint64 h)
 {
-	g_return_if_fail(p != NULL);
-	p->minor = h;
+    g_return_if_fail(p != NULL);
+    p->minor = h;
 }
 
 gint64
 parent_getMinor(myparent *p)
 {
-	g_return_val_if_fail((p != NULL),0);
-	return p->minor;
+    g_return_val_if_fail((p != NULL), 0);
+    return p->minor;
 }
 
 void
 parent_setVersion(myparent *p, gint32 h)
 {
-	g_return_if_fail(p != NULL);
-	p->version = h;
+    g_return_if_fail(p != NULL);
+    p->version = h;
 }
 
 gint32
 parent_getVersion(myparent *p)
 {
-	if(!p) return 0;
-	return p->version;
+    if (!p) return 0;
+    return p->version;
 }
 
 void
 parent_setActive(myparent *p, gboolean h)
 {
-	if(!p) return;
-	p->active = h;
+    if (!p) return;
+    p->active = h;
 }
 
 gboolean
 parent_getActive(myparent *p)
 {
-	if(!p) return FALSE;
-	return p->active;
+    if (!p) return FALSE;
+    return p->active;
 }
 
 void
 parent_setDiscount(myparent *p, double h)
 {
-	if(!p) return;
-	p->discount = h;
+    if (!p) return;
+    p->discount = h;
 }
 
 double
 parent_getDiscount(myparent *p)
 {
-	if(!p) return 0;
-	return p->discount;
+    if (!p) return 0;
+    return p->discount;
 }
 
 void
 parent_setDate(myparent *p, Timespec h)
 {
-	if(!p) return;
-	p->date = h;
+    if (!p) return;
+    p->date = h;
 }
 
 Timespec
 parent_getDate(myparent *p)
 {
-	Timespec ts;
-	ts.tv_sec = 0;
-	ts.tv_nsec = 0;
-	if(!p) return ts;
-	ts = p->date;
-	return ts;
+    Timespec ts;
+    ts.tv_sec = 0;
+    ts.tv_nsec = 0;
+    if (!p) return ts;
+    ts = p->date;
+    return ts;
 }
 
 void
 parent_setName(myparent* p, gchar* h)
 {
-	if(!p || !h) return;
-	p->Name = strdup(h);
+    if (!p || !h) return;
+    p->Name = strdup(h);
 }
 
 gchar*
 parent_getName(myparent *p)
 {
-	if(!p) return NULL;
-	return p->Name;
+    if (!p) return NULL;
+    return p->Name;
 }
 
 void
 parent_setAmount(myparent *p, gnc_numeric h)
 {
-	if(!p) return;
-	p->Amount = h;
+    if (!p) return;
+    p->Amount = h;
 }
 
 gnc_numeric
 parent_getAmount(myparent *p)
 {
-	if(!p) return gnc_numeric_zero();
-	return p->Amount;
+    if (!p) return gnc_numeric_zero();
+    return p->Amount;
 }
 
 void
 child_setFlag(mychild *c, gchar f)
 {
-	g_return_if_fail(c);
-	c->flag = f;
+    g_return_if_fail(c);
+    c->flag = f;
 }
 
 gchar
 child_getFlag(mychild *c)
 {
-	g_return_val_if_fail(c, 'n');
-	return c->flag;
+    g_return_val_if_fail(c, 'n');
+    return c->flag;
 }
 
 void
 child_setMinor(mychild *c, gint64 h)
 {
-	g_return_if_fail(c != NULL);
-	c->minor = h;
+    g_return_if_fail(c != NULL);
+    c->minor = h;
 }
 
 gint64
 child_getMinor(mychild *c)
 {
-	g_return_val_if_fail((c != NULL),0);
-	return c->minor;
+    g_return_val_if_fail((c != NULL), 0);
+    return c->minor;
 }
 
 void
 child_setVersion(mychild *c, gint32 h)
 {
-	g_return_if_fail(c != NULL);
-	c->version = h;
+    g_return_if_fail(c != NULL);
+    c->version = h;
 }
 
 gint32
 child_getVersion(mychild *c)
 {
-	if(!c) return 0;
-	return c->version;
+    if (!c) return 0;
+    return c->version;
 }
 
 void
 child_setActive(mychild *c, gboolean h)
 {
-	if(!c) return;
-	c->active = h;
+    if (!c) return;
+    c->active = h;
 }
 
 gboolean
 child_getActive(mychild *c)
 {
-	if(!c) return FALSE;
-	return c->active;
+    if (!c) return FALSE;
+    return c->active;
 }
 
 void
 child_setDiscount(mychild *c, double h)
 {
-	if(!c) return;
-	c->discount = h;
+    if (!c) return;
+    c->discount = h;
 }
 
 double
 child_getDiscount(mychild *c)
 {
-	if(!c) return 0;
-	return c->discount;
+    if (!c) return 0;
+    return c->discount;
 }
 
 void
 child_setDate(mychild *c, Timespec h)
 {
-	if(!c) return;
-	c->date = h;
+    if (!c) return;
+    c->date = h;
 }
 
 Timespec
 child_getDate(mychild *c)
 {
-	Timespec ts;
-	ts.tv_sec = 0;
-	ts.tv_nsec = 0;
-	if(!c) return ts;
-	ts = c->date;
-	return ts;
+    Timespec ts;
+    ts.tv_sec = 0;
+    ts.tv_nsec = 0;
+    if (!c) return ts;
+    ts = c->date;
+    return ts;
 }
 
 void
 child_setName(mychild* c, gchar* h)
 {
-	if(!c || !h) return;
-	c->Name = strdup(h);
+    if (!c || !h) return;
+    c->Name = strdup(h);
 }
 
 gchar*
 child_getName(mychild *c)
 {
-	if(!c) return NULL;
-	return c->Name;
+    if (!c) return NULL;
+    return c->Name;
 }
 
 void
 child_setAmount(mychild *c, gnc_numeric h)
 {
-	if(!c) return;
-	c->Amount = h;
+    if (!c) return;
+    c->Amount = h;
 }
 
 gnc_numeric
 child_getAmount(mychild *c)
 {
-	if(!c) return gnc_numeric_zero();
-	return c->Amount;
+    if (!c) return gnc_numeric_zero();
+    return c->Amount;
 }
 
-static QofObject grand_object_def = {
-  interface_version:     QOF_OBJECT_VERSION,
-  e_type:                GRAND_MODULE_NAME,
-  type_label:            GRAND_MODULE_DESC,
-  create:                (gpointer)grand_create,
-  book_begin:            NULL,
-  book_end:              NULL,
-  is_dirty:              qof_collection_is_dirty,
-  mark_clean:            qof_collection_mark_clean,
-  foreach:               qof_collection_foreach,
-  printable:             NULL,
-  version_cmp:           (int (*)(gpointer,gpointer)) qof_instance_version_cmp,
+static QofObject grand_object_def =
+{
+interface_version:
+    QOF_OBJECT_VERSION,
+e_type:
+    GRAND_MODULE_NAME,
+type_label:
+    GRAND_MODULE_DESC,
+create:
+    (gpointer)grand_create,
+book_begin:
+    NULL,
+book_end:
+    NULL,
+is_dirty:
+    qof_collection_is_dirty,
+mark_clean:
+    qof_collection_mark_clean,
+foreach:
+    qof_collection_foreach,
+printable:
+    NULL,
+version_cmp:
+    (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
 };
 
 gboolean mygrandRegister (void)
 {
-  static QofParam params[] = {
-    { OBJ_NAME,     QOF_TYPE_STRING,  (QofAccessFunc)grand_getName, 
-	(QofSetterFunc)grand_setName },
-    { OBJ_AMOUNT,   QOF_TYPE_NUMERIC, (QofAccessFunc)grand_getAmount,
- 	(QofSetterFunc)grand_setAmount },
-    { OBJ_DATE,     QOF_TYPE_DATE,    (QofAccessFunc)grand_getDate,	
-	(QofSetterFunc)grand_setDate },
-    { OBJ_DISCOUNT, QOF_TYPE_DOUBLE,  (QofAccessFunc)grand_getDiscount, 
-	(QofSetterFunc)grand_setDiscount },
-    { OBJ_ACTIVE,   QOF_TYPE_BOOLEAN, (QofAccessFunc)grand_getActive,   
-	(QofSetterFunc)grand_setActive },
-    { OBJ_VERSION,  QOF_TYPE_INT32,   (QofAccessFunc)grand_getVersion,  
-	(QofSetterFunc)grand_setVersion },
-    { OBJ_MINOR,    QOF_TYPE_INT64,	  (QofAccessFunc)grand_getMinor,	
-	(QofSetterFunc)grand_setMinor },
-    { OBJ_FLAG,     QOF_TYPE_CHAR,    (QofAccessFunc)grand_getFlag,
-	(QofSetterFunc)grand_setFlag },
-    { OBJ_RELATIVE,	PARENT_MODULE_NAME, (QofAccessFunc)grand_getChild,
-	(QofSetterFunc)grand_setChild },
-	{ OBJ_LIST,    QOF_TYPE_COLLECT,  (QofAccessFunc)grand_getDescend,
-	(QofSetterFunc)grand_setDescend },
-    { QOF_PARAM_BOOK, QOF_ID_BOOK,	(QofAccessFunc)qof_instance_get_book, NULL },
-    { QOF_PARAM_GUID, QOF_TYPE_GUID,	(QofAccessFunc)qof_instance_get_guid, NULL },
-    { NULL },
-  };
+    static QofParam params[] =
+    {
+        {
+            OBJ_NAME,     QOF_TYPE_STRING,  (QofAccessFunc)grand_getName,
+            (QofSetterFunc)grand_setName
+        },
+        {
+            OBJ_AMOUNT,   QOF_TYPE_NUMERIC, (QofAccessFunc)grand_getAmount,
+            (QofSetterFunc)grand_setAmount
+        },
+        {
+            OBJ_DATE,     QOF_TYPE_DATE,    (QofAccessFunc)grand_getDate,
+            (QofSetterFunc)grand_setDate
+        },
+        {
+            OBJ_DISCOUNT, QOF_TYPE_DOUBLE,  (QofAccessFunc)grand_getDiscount,
+            (QofSetterFunc)grand_setDiscount
+        },
+        {
+            OBJ_ACTIVE,   QOF_TYPE_BOOLEAN, (QofAccessFunc)grand_getActive,
+            (QofSetterFunc)grand_setActive
+        },
+        {
+            OBJ_VERSION,  QOF_TYPE_INT32,   (QofAccessFunc)grand_getVersion,
+            (QofSetterFunc)grand_setVersion
+        },
+        {
+            OBJ_MINOR,    QOF_TYPE_INT64,	  (QofAccessFunc)grand_getMinor,
+            (QofSetterFunc)grand_setMinor
+        },
+        {
+            OBJ_FLAG,     QOF_TYPE_CHAR,    (QofAccessFunc)grand_getFlag,
+            (QofSetterFunc)grand_setFlag
+        },
+        {
+            OBJ_RELATIVE,	PARENT_MODULE_NAME, (QofAccessFunc)grand_getChild,
+            (QofSetterFunc)grand_setChild
+        },
+        {
+            OBJ_LIST,    QOF_TYPE_COLLECT,  (QofAccessFunc)grand_getDescend,
+            (QofSetterFunc)grand_setDescend
+        },
+        { QOF_PARAM_BOOK, QOF_ID_BOOK,	(QofAccessFunc)qof_instance_get_book, NULL },
+        { QOF_PARAM_GUID, QOF_TYPE_GUID,	(QofAccessFunc)qof_instance_get_guid, NULL },
+        { NULL },
+    };
 
-  qof_class_register (GRAND_MODULE_NAME, NULL, params);
-/*  if(!qof_choice_create(GRAND_MODULE_NAME)) { return FALSE; }*/
+    qof_class_register (GRAND_MODULE_NAME, NULL, params);
+    /*  if(!qof_choice_create(GRAND_MODULE_NAME)) { return FALSE; }*/
 
-  return qof_object_register (&grand_object_def);
+    return qof_object_register (&grand_object_def);
 }
 
-static QofObject parent_object_def = {
-  interface_version:     QOF_OBJECT_VERSION,
-  e_type:                PARENT_MODULE_NAME,
-  type_label:            PARENT_MODULE_DESC,
-  create:                (gpointer)parent_create,
-  book_begin:            NULL,
-  book_end:              NULL,
-  is_dirty:              qof_collection_is_dirty,
-  mark_clean:            qof_collection_mark_clean,
-  foreach:               qof_collection_foreach,
-  printable:             NULL,
-  version_cmp:           (int (*)(gpointer,gpointer)) qof_instance_version_cmp,
+static QofObject parent_object_def =
+{
+interface_version:
+    QOF_OBJECT_VERSION,
+e_type:
+    PARENT_MODULE_NAME,
+type_label:
+    PARENT_MODULE_DESC,
+create:
+    (gpointer)parent_create,
+book_begin:
+    NULL,
+book_end:
+    NULL,
+is_dirty:
+    qof_collection_is_dirty,
+mark_clean:
+    qof_collection_mark_clean,
+foreach:
+    qof_collection_foreach,
+printable:
+    NULL,
+version_cmp:
+    (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
 };
 
 gboolean myparentRegister (void)
 {
-  static QofParam params[] = {
-    { OBJ_NAME,     QOF_TYPE_STRING,  (QofAccessFunc)parent_getName, 
-	(QofSetterFunc)parent_setName },
-    { OBJ_AMOUNT,   QOF_TYPE_NUMERIC, (QofAccessFunc)parent_getAmount,
-	(QofSetterFunc)parent_setAmount },
-    { OBJ_DATE,     QOF_TYPE_DATE,    (QofAccessFunc)parent_getDate,	
-	(QofSetterFunc)parent_setDate },
-    { OBJ_DISCOUNT, QOF_TYPE_DOUBLE,  (QofAccessFunc)parent_getDiscount, 
-	(QofSetterFunc)parent_setDiscount },
-    { OBJ_ACTIVE,   QOF_TYPE_BOOLEAN, (QofAccessFunc)parent_getActive,   
-	(QofSetterFunc)parent_setActive },
-    { OBJ_VERSION,  QOF_TYPE_INT32,   (QofAccessFunc)parent_getVersion,  
-	(QofSetterFunc)parent_setVersion },
-    { OBJ_MINOR,    QOF_TYPE_INT64,	  (QofAccessFunc)parent_getMinor,	
-	(QofSetterFunc)parent_setMinor },
-    { OBJ_FLAG,     QOF_TYPE_CHAR,    (QofAccessFunc)parent_getFlag,
-	(QofSetterFunc)parent_setFlag },
-    { OBJ_RELATIVE,	CHILD_MODULE_NAME, (QofAccessFunc)parent_getChild,
-	(QofSetterFunc)parent_setChild },
-    { QOF_PARAM_BOOK, QOF_ID_BOOK,	(QofAccessFunc)qof_instance_get_book, NULL },
-    { QOF_PARAM_GUID, QOF_TYPE_GUID,	(QofAccessFunc)qof_instance_get_guid, NULL },
-    { NULL },
-  };
+    static QofParam params[] =
+    {
+        {
+            OBJ_NAME,     QOF_TYPE_STRING,  (QofAccessFunc)parent_getName,
+            (QofSetterFunc)parent_setName
+        },
+        {
+            OBJ_AMOUNT,   QOF_TYPE_NUMERIC, (QofAccessFunc)parent_getAmount,
+            (QofSetterFunc)parent_setAmount
+        },
+        {
+            OBJ_DATE,     QOF_TYPE_DATE,    (QofAccessFunc)parent_getDate,
+            (QofSetterFunc)parent_setDate
+        },
+        {
+            OBJ_DISCOUNT, QOF_TYPE_DOUBLE,  (QofAccessFunc)parent_getDiscount,
+            (QofSetterFunc)parent_setDiscount
+        },
+        {
+            OBJ_ACTIVE,   QOF_TYPE_BOOLEAN, (QofAccessFunc)parent_getActive,
+            (QofSetterFunc)parent_setActive
+        },
+        {
+            OBJ_VERSION,  QOF_TYPE_INT32,   (QofAccessFunc)parent_getVersion,
+            (QofSetterFunc)parent_setVersion
+        },
+        {
+            OBJ_MINOR,    QOF_TYPE_INT64,	  (QofAccessFunc)parent_getMinor,
+            (QofSetterFunc)parent_setMinor
+        },
+        {
+            OBJ_FLAG,     QOF_TYPE_CHAR,    (QofAccessFunc)parent_getFlag,
+            (QofSetterFunc)parent_setFlag
+        },
+        {
+            OBJ_RELATIVE,	CHILD_MODULE_NAME, (QofAccessFunc)parent_getChild,
+            (QofSetterFunc)parent_setChild
+        },
+        { QOF_PARAM_BOOK, QOF_ID_BOOK,	(QofAccessFunc)qof_instance_get_book, NULL },
+        { QOF_PARAM_GUID, QOF_TYPE_GUID,	(QofAccessFunc)qof_instance_get_guid, NULL },
+        { NULL },
+    };
 
-  qof_class_register (PARENT_MODULE_NAME, NULL, params);
+    qof_class_register (PARENT_MODULE_NAME, NULL, params);
 
-  return qof_object_register (&parent_object_def);
+    return qof_object_register (&parent_object_def);
 }
 
-static QofObject child_object_def = {
-  interface_version:     QOF_OBJECT_VERSION,
-  e_type:                CHILD_MODULE_NAME,
-  type_label:            CHILD_MODULE_DESC,
-  create:                (gpointer)child_create,
-  book_begin:            NULL,
-  book_end:              NULL,
-  is_dirty:              qof_collection_is_dirty,
-  mark_clean:            qof_collection_mark_clean,
-  foreach:               qof_collection_foreach,
-  printable:             NULL,
-  version_cmp:           (int (*)(gpointer,gpointer)) qof_instance_version_cmp,
+static QofObject child_object_def =
+{
+interface_version:
+    QOF_OBJECT_VERSION,
+e_type:
+    CHILD_MODULE_NAME,
+type_label:
+    CHILD_MODULE_DESC,
+create:
+    (gpointer)child_create,
+book_begin:
+    NULL,
+book_end:
+    NULL,
+is_dirty:
+    qof_collection_is_dirty,
+mark_clean:
+    qof_collection_mark_clean,
+foreach:
+    qof_collection_foreach,
+printable:
+    NULL,
+version_cmp:
+    (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
 };
 
 gboolean mychildRegister (void)
 {
-  static QofParam params[] = {
-    { OBJ_NAME,     QOF_TYPE_STRING,  (QofAccessFunc)child_getName, 
-	(QofSetterFunc)child_setName },
-    { OBJ_AMOUNT,   QOF_TYPE_NUMERIC, (QofAccessFunc)child_getAmount,
-	(QofSetterFunc)child_setAmount },
-    { OBJ_DATE,     QOF_TYPE_DATE,    (QofAccessFunc)child_getDate,	
-	(QofSetterFunc)child_setDate },
-    { OBJ_DISCOUNT, QOF_TYPE_DOUBLE,  (QofAccessFunc)child_getDiscount, 
-	(QofSetterFunc)child_setDiscount },
-    { OBJ_ACTIVE,   QOF_TYPE_BOOLEAN, (QofAccessFunc)child_getActive,   
-	(QofSetterFunc)child_setActive },
-    { OBJ_VERSION,  QOF_TYPE_INT32,   (QofAccessFunc)child_getVersion,  
-	(QofSetterFunc)child_setVersion },
-    { OBJ_MINOR,    QOF_TYPE_INT64,	  (QofAccessFunc)child_getMinor,	
-	(QofSetterFunc)child_setMinor },
-    { OBJ_FLAG,     QOF_TYPE_CHAR,    (QofAccessFunc)child_getFlag,
-	(QofSetterFunc)child_setFlag },
-    { QOF_PARAM_BOOK, QOF_ID_BOOK,	(QofAccessFunc)qof_instance_get_book, NULL },
-    { QOF_PARAM_GUID, QOF_TYPE_GUID,	(QofAccessFunc)qof_instance_get_guid, NULL },
-    { NULL },
-  };
+    static QofParam params[] =
+    {
+        {
+            OBJ_NAME,     QOF_TYPE_STRING,  (QofAccessFunc)child_getName,
+            (QofSetterFunc)child_setName
+        },
+        {
+            OBJ_AMOUNT,   QOF_TYPE_NUMERIC, (QofAccessFunc)child_getAmount,
+            (QofSetterFunc)child_setAmount
+        },
+        {
+            OBJ_DATE,     QOF_TYPE_DATE,    (QofAccessFunc)child_getDate,
+            (QofSetterFunc)child_setDate
+        },
+        {
+            OBJ_DISCOUNT, QOF_TYPE_DOUBLE,  (QofAccessFunc)child_getDiscount,
+            (QofSetterFunc)child_setDiscount
+        },
+        {
+            OBJ_ACTIVE,   QOF_TYPE_BOOLEAN, (QofAccessFunc)child_getActive,
+            (QofSetterFunc)child_setActive
+        },
+        {
+            OBJ_VERSION,  QOF_TYPE_INT32,   (QofAccessFunc)child_getVersion,
+            (QofSetterFunc)child_setVersion
+        },
+        {
+            OBJ_MINOR,    QOF_TYPE_INT64,	  (QofAccessFunc)child_getMinor,
+            (QofSetterFunc)child_setMinor
+        },
+        {
+            OBJ_FLAG,     QOF_TYPE_CHAR,    (QofAccessFunc)child_getFlag,
+            (QofSetterFunc)child_setFlag
+        },
+        { QOF_PARAM_BOOK, QOF_ID_BOOK,	(QofAccessFunc)qof_instance_get_book, NULL },
+        { QOF_PARAM_GUID, QOF_TYPE_GUID,	(QofAccessFunc)qof_instance_get_guid, NULL },
+        { NULL },
+    };
 
-  qof_class_register (CHILD_MODULE_NAME, NULL, params);
+    qof_class_register (CHILD_MODULE_NAME, NULL, params);
 
-  return qof_object_register (&child_object_def);
+    return qof_object_register (&child_object_def);
 }
 
 static void
 create_data (QofSession *original, guint counter)
 {
-	QofCollection *coll;
-	QofBook *start;
-	mygrand *grand1;
-	myparent *parent1;
-	mychild *child1;
+    QofCollection *coll;
+    QofBook *start;
+    mygrand *grand1;
+    myparent *parent1;
+    mychild *child1;
 
-	start = qof_session_get_book(original);
-	grand1 = (mygrand*)qof_object_new_instance(GRAND_MODULE_NAME, start);
-	do_test ((NULL != &grand1->inst), "instance init");
-	switch (counter)
-	{
-		case 0 : { /* NULL tree */ 
-			do_test((grand1 != NULL), "empty tree check");
-			coll = qof_book_get_collection(start, GRAND_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 1), 
-				"Too many grandparents found - should be 1");
-			coll = qof_book_get_collection(start, CHILD_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 0), 
-				"child found, should be empty");
-			coll = qof_book_get_collection(start, PARENT_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 0), 
-				"tree not empty: parent found");
-			break;
-		}
-		case 1 : { /* one parent, no child */ 
-			parent1 = (myparent*)qof_object_new_instance(PARENT_MODULE_NAME, start);
-			grand_setChild(grand1, parent1);
-			do_test((parent1 != NULL), "single parent check");
-			do_test((grand_getChild(grand1) == parent1), "set child in grandparent");
-			coll = qof_book_get_collection(start, GRAND_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 1), 
-				"Wrong number of grandparents, should be 1");
-			coll = qof_book_get_collection(start, CHILD_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 0), 
-				"Should be no child entities this iteration.");
-			coll = qof_book_get_collection(start, PARENT_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 1), 
-				"Wrong number of parents found, should be 1");
-			break;
-		}
-		case 2 : { /* one parent, one child */ 
-			parent1 = (myparent*)qof_object_new_instance(PARENT_MODULE_NAME, start);
-			grand_setChild(grand1, parent1);
-			child1 = (mychild*)qof_object_new_instance(CHILD_MODULE_NAME, start);
-			parent1 = grand_getChild(grand1);
-			parent_setChild(parent1, child1);
-			do_test((child1 != NULL), "one parent with one related child");
-			do_test((child1 == parent_getChild(parent1)), "child of single parent");
-			coll = qof_book_get_collection(start, GRAND_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 1), 
-				"Wrong number of grandparents. Should be 1");
-			coll = qof_book_get_collection(start, CHILD_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 1), 
-				"Wrong number of child entities, should be 1");
-			coll = qof_book_get_collection(start, PARENT_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 1), 
-				"Wrong number of parents. Should be 1");
-			break;
-		}
-		case 3 : { /* same grand, new parent, same child */
-			child1 = (mychild*)qof_object_new_instance(CHILD_MODULE_NAME, start);
-			parent1 = (myparent*)qof_object_new_instance(PARENT_MODULE_NAME, start);
-			grand_setChild(grand1, parent1);
-			parent_setChild(parent1, child1);
-			do_test((parent1 == grand_getChild(grand1)), "same grandparent, new parent");
-			do_test((child1 == parent_getChild(parent1)), "new parent, same child");
-			coll = qof_book_get_collection(start, GRAND_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 1), 
-				"Wrong number of grandparents. Should be 1, Iteration 3.");
-			coll = qof_book_get_collection(start, CHILD_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 1), 
-				"Wrong number of child entities, should be 1. Iteration 3.");
-			coll = qof_book_get_collection(start, PARENT_MODULE_NAME);
-			do_test((qof_collection_count(coll) == 1), 
-				"Wrong number of parents. Should be 1. Iteration 3.");
-			break; 
-		}
-		case 4 : { /* new grand, unrelated parent, child unrelated to grand */
-			grand1 = (mygrand*)qof_object_new_instance(GRAND_MODULE_NAME, start);
-			parent1 = (myparent*)qof_object_new_instance(PARENT_MODULE_NAME, start);
-			child1 = (mychild*)qof_object_new_instance(CHILD_MODULE_NAME, start);
-			parent_setChild(parent1, child1);
-			do_test((NULL == grand_getChild(grand1)), "new grand, unrelated parent");
-			do_test((child1 == parent_getChild(parent1)), "child unrelated to grand");
-			coll = grand_getDescend(grand1);
-			do_test((coll != NULL), "grandparent not valid");
-			if(coll)
-			{
-				QofInstance *ent;
+    start = qof_session_get_book(original);
+    grand1 = (mygrand*)qof_object_new_instance(GRAND_MODULE_NAME, start);
+    do_test ((NULL != &grand1->inst), "instance init");
+    switch (counter)
+    {
+    case 0 :   /* NULL tree */
+    {
+        do_test((grand1 != NULL), "empty tree check");
+        coll = qof_book_get_collection(start, GRAND_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 1),
+                "Too many grandparents found - should be 1");
+        coll = qof_book_get_collection(start, CHILD_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 0),
+                "child found, should be empty");
+        coll = qof_book_get_collection(start, PARENT_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 0),
+                "tree not empty: parent found");
+        break;
+    }
+    case 1 :   /* one parent, no child */
+    {
+        parent1 = (myparent*)qof_object_new_instance(PARENT_MODULE_NAME, start);
+        grand_setChild(grand1, parent1);
+        do_test((parent1 != NULL), "single parent check");
+        do_test((grand_getChild(grand1) == parent1), "set child in grandparent");
+        coll = qof_book_get_collection(start, GRAND_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 1),
+                "Wrong number of grandparents, should be 1");
+        coll = qof_book_get_collection(start, CHILD_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 0),
+                "Should be no child entities this iteration.");
+        coll = qof_book_get_collection(start, PARENT_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 1),
+                "Wrong number of parents found, should be 1");
+        break;
+    }
+    case 2 :   /* one parent, one child */
+    {
+        parent1 = (myparent*)qof_object_new_instance(PARENT_MODULE_NAME, start);
+        grand_setChild(grand1, parent1);
+        child1 = (mychild*)qof_object_new_instance(CHILD_MODULE_NAME, start);
+        parent1 = grand_getChild(grand1);
+        parent_setChild(parent1, child1);
+        do_test((child1 != NULL), "one parent with one related child");
+        do_test((child1 == parent_getChild(parent1)), "child of single parent");
+        coll = qof_book_get_collection(start, GRAND_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 1),
+                "Wrong number of grandparents. Should be 1");
+        coll = qof_book_get_collection(start, CHILD_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 1),
+                "Wrong number of child entities, should be 1");
+        coll = qof_book_get_collection(start, PARENT_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 1),
+                "Wrong number of parents. Should be 1");
+        break;
+    }
+    case 3 :   /* same grand, new parent, same child */
+    {
+        child1 = (mychild*)qof_object_new_instance(CHILD_MODULE_NAME, start);
+        parent1 = (myparent*)qof_object_new_instance(PARENT_MODULE_NAME, start);
+        grand_setChild(grand1, parent1);
+        parent_setChild(parent1, child1);
+        do_test((parent1 == grand_getChild(grand1)), "same grandparent, new parent");
+        do_test((child1 == parent_getChild(parent1)), "new parent, same child");
+        coll = qof_book_get_collection(start, GRAND_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 1),
+                "Wrong number of grandparents. Should be 1, Iteration 3.");
+        coll = qof_book_get_collection(start, CHILD_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 1),
+                "Wrong number of child entities, should be 1. Iteration 3.");
+        coll = qof_book_get_collection(start, PARENT_MODULE_NAME);
+        do_test((qof_collection_count(coll) == 1),
+                "Wrong number of parents. Should be 1. Iteration 3.");
+        break;
+    }
+    case 4 :   /* new grand, unrelated parent, child unrelated to grand */
+    {
+        grand1 = (mygrand*)qof_object_new_instance(GRAND_MODULE_NAME, start);
+        parent1 = (myparent*)qof_object_new_instance(PARENT_MODULE_NAME, start);
+        child1 = (mychild*)qof_object_new_instance(CHILD_MODULE_NAME, start);
+        parent_setChild(parent1, child1);
+        do_test((NULL == grand_getChild(grand1)), "new grand, unrelated parent");
+        do_test((child1 == parent_getChild(parent1)), "child unrelated to grand");
+        coll = grand_getDescend(grand1);
+        do_test((coll != NULL), "grandparent not valid");
+        if (coll)
+        {
+            QofInstance *ent;
 
-				ent = QOF_INSTANCE(child1);
-				qof_collection_add_entity(coll, ent);
-				grand_setDescend(grand1, coll);
-				qof_collection_destroy(coll);
-				do_test((g_list_length(grand1->descend) > 0), "entity not added");
-				do_test((qof_collection_count(grand_getDescend(grand1)) > 0), 
-					"empty collection returned");
-			}
-			break;
-		}
-	}
+            ent = QOF_INSTANCE(child1);
+            qof_collection_add_entity(coll, ent);
+            grand_setDescend(grand1, coll);
+            qof_collection_destroy(coll);
+            do_test((g_list_length(grand1->descend) > 0), "entity not added");
+            do_test((qof_collection_count(grand_getDescend(grand1)) > 0),
+                    "empty collection returned");
+        }
+        break;
+    }
+    }
 }
 
 struct tally
 {
-	guint nulls, total, collect;
-	QofBook *book;
+    guint nulls, total, collect;
+    QofBook *book;
 };
 
 static void
 check_cb (QofInstance *ent, gpointer data)
 {
-	QofInstance *parent, *child;
-	QofCollection *coll;
-	struct tally *c;
-	const QofParam *param;
-	mygrand  *testg;
-	myparent *testp;
-	mychild  *testc;
+    QofInstance *parent, *child;
+    QofCollection *coll;
+    struct tally *c;
+    const QofParam *param;
+    mygrand  *testg;
+    myparent *testp;
+    mychild  *testc;
 
-	c = (struct tally*)data;
-	/* check the same number and type of entities
-	exist in the copied book */
-	testg = (mygrand*)ent;
-	/* we always have a grandparent */
-	do_test((testg != NULL), "grandparent not found");
-	c->total++;
-	param = qof_class_get_parameter(GRAND_MODULE_NAME, OBJ_LIST);
-	coll = (QofCollection*)param->param_getfcn(ent, param);
-	c->collect = qof_collection_count(coll);
-	if(c->book) { qof_book_set_references(c->book); }
-	param = qof_class_get_parameter(GRAND_MODULE_NAME, OBJ_RELATIVE);
-	parent = QOF_INSTANCE(param->param_getfcn(ent, param));
-	testp = grand_getChild((mygrand*)ent);
-	/* not all grandparents have family so just keep count. */
-	if(!parent) { c->nulls++; return; }
-	do_test((0 == safe_strcmp(parent_getName(testp), 
-		parent_getName((myparent*)parent))), "parent copy test");
-	param = qof_class_get_parameter(PARENT_MODULE_NAME, OBJ_RELATIVE);
-	child = param->param_getfcn(parent, param);
-	testc = parent_getChild((myparent*)parent);
-	if(!child) { c->nulls++; return; }
-	do_test((0 == safe_strcmp(child_getName(testc), 
-		child_getName((mychild*)child))), "child copy test");
+    c = (struct tally*)data;
+    /* check the same number and type of entities
+    exist in the copied book */
+    testg = (mygrand*)ent;
+    /* we always have a grandparent */
+    do_test((testg != NULL), "grandparent not found");
+    c->total++;
+    param = qof_class_get_parameter(GRAND_MODULE_NAME, OBJ_LIST);
+    coll = (QofCollection*)param->param_getfcn(ent, param);
+    c->collect = qof_collection_count(coll);
+    if (c->book)
+    {
+        qof_book_set_references(c->book);
+    }
+    param = qof_class_get_parameter(GRAND_MODULE_NAME, OBJ_RELATIVE);
+    parent = QOF_INSTANCE(param->param_getfcn(ent, param));
+    testp = grand_getChild((mygrand*)ent);
+    /* not all grandparents have family so just keep count. */
+    if (!parent)
+    {
+        c->nulls++;
+        return;
+    }
+    do_test((0 == safe_strcmp(parent_getName(testp),
+                              parent_getName((myparent*)parent))), "parent copy test");
+    param = qof_class_get_parameter(PARENT_MODULE_NAME, OBJ_RELATIVE);
+    child = param->param_getfcn(parent, param);
+    testc = parent_getChild((myparent*)parent);
+    if (!child)
+    {
+        c->nulls++;
+        return;
+    }
+    do_test((0 == safe_strcmp(child_getName(testc),
+                              child_getName((mychild*)child))), "child copy test");
 }
 
 static void
 test_recursion (QofSession *original, guint counter)
 {
-	QofSession *copy;
-	QofCollection *grand_coll;
-	struct tally c;
-	QofBook *book;
-	guint d, e, f;
+    QofSession *copy;
+    QofCollection *grand_coll;
+    struct tally c;
+    QofBook *book;
+    guint d, e, f;
 
-	c.nulls = 0;
-	c.total = 0;
-	c.collect = 0;
-	c.book = NULL;
-	book = qof_session_get_book(original);
-	grand_coll = qof_book_get_collection(book, GRAND_MODULE_NAME);
-	copy = qof_session_new();
-	if(debug) { qof_session_begin(copy, QOF_STDOUT, TRUE, FALSE); }
-	/* TODO: implement QOF_TYPE_CHOICE testing. */
-	qof_instance_copy_coll_r(copy, grand_coll);
-	/* test the original */
-	qof_object_foreach(GRAND_MODULE_NAME, book, check_cb, &c);
-	book = qof_session_get_book(copy);
-	/* test the copy */
-	d = c.nulls;
-	e = c.total;
-	f = c.collect;
-	c.nulls = 0;
-	c.total = 0;
-	c.collect = 0;
-	c.book = book;
-	qof_object_foreach(GRAND_MODULE_NAME, book, check_cb, &c);
-	do_test((d == c.nulls), "Null parents do not match");
-	do_test((e == c.total), "Total parents do not match");
-	do_test((f == c.collect), "Number of children in descendents does not match");
-	if(counter == 4 && debug == TRUE) { 
-		qof_session_save(copy, NULL);
-		qof_session_save(original, NULL);
-	}
-	qof_session_end(copy);
-	copy = NULL;
+    c.nulls = 0;
+    c.total = 0;
+    c.collect = 0;
+    c.book = NULL;
+    book = qof_session_get_book(original);
+    grand_coll = qof_book_get_collection(book, GRAND_MODULE_NAME);
+    copy = qof_session_new();
+    if (debug)
+    {
+        qof_session_begin(copy, QOF_STDOUT, TRUE, FALSE);
+    }
+    /* TODO: implement QOF_TYPE_CHOICE testing. */
+    qof_instance_copy_coll_r(copy, grand_coll);
+    /* test the original */
+    qof_object_foreach(GRAND_MODULE_NAME, book, check_cb, &c);
+    book = qof_session_get_book(copy);
+    /* test the copy */
+    d = c.nulls;
+    e = c.total;
+    f = c.collect;
+    c.nulls = 0;
+    c.total = 0;
+    c.collect = 0;
+    c.book = book;
+    qof_object_foreach(GRAND_MODULE_NAME, book, check_cb, &c);
+    do_test((d == c.nulls), "Null parents do not match");
+    do_test((e == c.total), "Total parents do not match");
+    do_test((f == c.collect), "Number of children in descendents does not match");
+    if (counter == 4 && debug == TRUE)
+    {
+        qof_session_save(copy, NULL);
+        qof_session_save(original, NULL);
+    }
+    qof_session_end(copy);
+    copy = NULL;
 }
 
 int
 main (int argc, const char *argv[])
 {
-	QofSession *original;
-	guint counter;
+    QofSession *original;
+    guint counter;
 
-	qof_init ();
-	mygrandRegister();
-	myparentRegister();
-	mychildRegister();
-	for(counter = 0; counter < 35; counter++)
-	{
-		original = qof_session_new();
-		if(debug) { qof_session_begin(original, QOF_STDOUT, TRUE, FALSE); }
-		create_data(original, (counter % 5));
-		test_recursion(original, (counter % 5));
-		qof_session_end(original);
-	}
-	print_test_results();
-	qof_close();
-	return EXIT_SUCCESS;
+    qof_init ();
+    mygrandRegister();
+    myparentRegister();
+    mychildRegister();
+    for (counter = 0; counter < 35; counter++)
+    {
+        original = qof_session_new();
+        if (debug)
+        {
+            qof_session_begin(original, QOF_STDOUT, TRUE, FALSE);
+        }
+        create_data(original, (counter % 5));
+        test_recursion(original, (counter % 5));
+        qof_session_end(original);
+    }
+    print_test_results();
+    qof_close();
+    return EXIT_SUCCESS;
 }

Modified: gnucash/trunk/src/engine/test/test-resolve-file-path.c
===================================================================
--- gnucash/trunk/src/engine/test/test-resolve-file-path.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-resolve-file-path.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -39,15 +39,24 @@
 
 typedef struct test_strings_struct test_strings;
 
-test_strings strs[] = {
-    { G_DIR_SEPARATOR_S ".gnucash" G_DIR_SEPARATOR_S "test-account-name",
-      G_DIR_SEPARATOR_S ".gnucash" G_DIR_SEPARATOR_S "test-account-name", 1 },
-    { G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name2",
-      G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name2", 0 },
-    { "postgres://localhost/foo/bar",
-      G_DIR_SEPARATOR_S ".gnucash" G_DIR_SEPARATOR_S "data" G_DIR_SEPARATOR_S "postgres___localhost_foo_bar", 2 },
-    { "file:" G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name3",
-      G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name3", 0 },
+test_strings strs[] =
+{
+    {
+        G_DIR_SEPARATOR_S ".gnucash" G_DIR_SEPARATOR_S "test-account-name",
+        G_DIR_SEPARATOR_S ".gnucash" G_DIR_SEPARATOR_S "test-account-name", 1
+    },
+    {
+        G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name2",
+        G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name2", 0
+    },
+    {
+        "postgres://localhost/foo/bar",
+        G_DIR_SEPARATOR_S ".gnucash" G_DIR_SEPARATOR_S "data" G_DIR_SEPARATOR_S "postgres___localhost_foo_bar", 2
+    },
+    {
+        "file:" G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name3",
+        G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name3", 0
+    },
     { NULL, NULL, 0 },
 };
 
@@ -58,26 +67,26 @@
 
     qof_init();
 
-    for(i = 0; strs[i].input != NULL; i++)
+    for (i = 0; strs[i].input != NULL; i++)
     {
         char *daout;
         char *dain;
         char *wantout;
-        
-        if(strs[i].prefix_home == 1) 
+
+        if (strs[i].prefix_home == 1)
         {
             dain = g_build_filename(g_get_home_dir(), strs[i].input,
-				    (gchar *)NULL);
+                                    (gchar *)NULL);
             wantout = g_build_filename(g_get_home_dir(), strs[i].output,
-				       (gchar *)NULL);
+                                       (gchar *)NULL);
         }
-        else if(strs[i].prefix_home == 2)
+        else if (strs[i].prefix_home == 2)
         {
             dain = g_strdup(strs[i].input);
             wantout = g_build_filename(g_get_home_dir(), strs[i].output,
-				       (gchar *)NULL);
+                                       (gchar *)NULL);
         }
-         else
+        else
         {
             dain = g_strdup(strs[i].input);
             wantout = g_strdup(strs[i].output);

Modified: gnucash/trunk/src/engine/test/test-scm-query.c
===================================================================
--- gnucash/trunk/src/engine/test/test-scm-query.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-scm-query.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -14,71 +14,71 @@
 static void
 test_query (Query *q)
 {
-  SCM scm_q;
-  Query *q2;
+    SCM scm_q;
+    Query *q2;
 
-  scm_q = gnc_query2scm (q);
+    scm_q = gnc_query2scm (q);
 
-  q2 = gnc_scm2query (scm_q);
+    q2 = gnc_scm2query (scm_q);
 
-  if (!xaccQueryEqual (q, q2))
-  {
-    failure ("queries don't match");
-    scm_display (scm_q, SCM_UNDEFINED);
-    scm_newline (SCM_UNDEFINED);
-    scm_q = gnc_query2scm (q2);
-    scm_display (scm_q, SCM_UNDEFINED);
-    scm_newline (SCM_UNDEFINED);
-    exit (1);
-  }
-  else
-  {
-    success ("queries match");
-  }
+    if (!xaccQueryEqual (q, q2))
+    {
+        failure ("queries don't match");
+        scm_display (scm_q, SCM_UNDEFINED);
+        scm_newline (SCM_UNDEFINED);
+        scm_q = gnc_query2scm (q2);
+        scm_display (scm_q, SCM_UNDEFINED);
+        scm_newline (SCM_UNDEFINED);
+        exit (1);
+    }
+    else
+    {
+        success ("queries match");
+    }
 
-  xaccFreeQuery (q2);
+    xaccFreeQuery (q2);
 }
 
 static void
 run_tests (void)
 {
-  Query *q;
-  int i;
+    Query *q;
+    int i;
 
-  test_query (NULL);
+    test_query (NULL);
 
-  q = xaccMallocQuery ();
-  test_query (q);
-  xaccFreeQuery (q);
-
-  for (i = 0; i < 50; i++)
-  {
-    q = get_random_query ();
+    q = xaccMallocQuery ();
     test_query (q);
     xaccFreeQuery (q);
-  }
+
+    for (i = 0; i < 50; i++)
+    {
+        q = get_random_query ();
+        test_query (q);
+        xaccFreeQuery (q);
+    }
 }
 
 static void
 main_helper (void *closure, int argc, char **argv)
 {
-  gnc_module_load("gnucash/engine", 0);
+    gnc_module_load("gnucash/engine", 0);
 
-  xaccLogDisable ();
+    xaccLogDisable ();
 
-  /* scm conversion doesn't handle binary atm */
-  kvp_exclude_type (KVP_TYPE_BINARY);
+    /* scm conversion doesn't handle binary atm */
+    kvp_exclude_type (KVP_TYPE_BINARY);
 
-  run_tests ();
+    run_tests ();
 
-  print_test_results ();
+    print_test_results ();
 
-  exit (get_rv ());
+    exit (get_rv ());
 }
 
 int
 main (int argc, char **argv)
 {
-  scm_boot_guile (argc, argv, main_helper, NULL);
-  return 0;
+    scm_boot_guile (argc, argv, main_helper, NULL);
+    return 0;
 }

Modified: gnucash/trunk/src/engine/test/test-split-vs-account.c
===================================================================
--- gnucash/trunk/src/engine/test/test-split-vs-account.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-split-vs-account.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -65,7 +65,8 @@
 main (int argc, char **argv)
 {
     qof_init();
-    if(cashobjects_register()) {
+    if (cashobjects_register())
+    {
         xaccLogDisable ();
         run_test ();
         print_test_results();

Modified: gnucash/trunk/src/engine/test/test-transaction-reversal.c
===================================================================
--- gnucash/trunk/src/engine/test/test-transaction-reversal.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-transaction-reversal.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -21,7 +21,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 #include <glib.h>
 #include <string.h>
@@ -37,91 +37,93 @@
 static void
 transaction_set_splits_to_accounts(Transaction *tr, Account *a1, Account *a2)
 {
-  Split *split;
+    Split *split;
 
-  split  = xaccTransGetSplit(tr, 0);
-  
-  xaccAccountInsertSplit(a1, split);
+    split  = xaccTransGetSplit(tr, 0);
 
-  split = xaccTransGetSplit(tr, 1);
-  xaccAccountInsertSplit(a2, split);
-  return;
+    xaccAccountInsertSplit(a1, split);
+
+    split = xaccTransGetSplit(tr, 1);
+    xaccAccountInsertSplit(a2, split);
+    return;
 }
 
 static void
 run_test (void)
 {
-  Account *acc1, *acc2;
-  Transaction *transaction, *new_trans;
-  gnc_numeric old, new, result;
-  QofBook *book;
-  char *msg;
-  int i;
+    Account *acc1, *acc2;
+    Transaction *transaction, *new_trans;
+    gnc_numeric old, new, result;
+    QofBook *book;
+    char *msg;
+    int i;
 
-  book = qof_book_new();
+    book = qof_book_new();
 
-  acc1 = get_random_account(book);
-  acc2 = get_random_account(book);
+    acc1 = get_random_account(book);
+    acc2 = get_random_account(book);
 
-  if (!acc1 || !acc2)
-  {
-    failure("accounts not created");
-    return;
-  }
-
-  /* Find a transaction that isn't voided */
-  do
-  {
-    gboolean voyd;
-    
-    transaction = get_random_transaction (book);
-    voyd = xaccTransGetVoidStatus (transaction);
-    if (voyd)
+    if (!acc1 || !acc2)
     {
-      xaccTransBeginEdit (transaction);
-      xaccTransDestroy (transaction);
-      xaccTransCommitEdit (transaction);
-      transaction = NULL;
+        failure("accounts not created");
+        return;
     }
-  } while (!transaction);
-  transaction_set_splits_to_accounts(transaction, acc1, acc2);
-  xaccTransSortSplits(transaction);
 
-  new_trans = xaccTransReverse(transaction);
-  for (i = 0; i < 2; i++) 
-  {
-    old = xaccSplitGetAmount(xaccTransGetSplit(transaction, i));
-    new = xaccSplitGetAmount(xaccTransGetSplit(new_trans, i));
-    result = gnc_numeric_add(old, new, GNC_DENOM_AUTO, GNC_DENOM_FIXED);
-    if (gnc_numeric_eq(old, gnc_numeric_neg(new))) 
+    /* Find a transaction that isn't voided */
+    do
     {
-      msg = g_strdup_printf("Amount of split %d wrong after reversal\n", i);
-      failure(msg);
+        gboolean voyd;
+
+        transaction = get_random_transaction (book);
+        voyd = xaccTransGetVoidStatus (transaction);
+        if (voyd)
+        {
+            xaccTransBeginEdit (transaction);
+            xaccTransDestroy (transaction);
+            xaccTransCommitEdit (transaction);
+            transaction = NULL;
+        }
     }
+    while (!transaction);
+    transaction_set_splits_to_accounts(transaction, acc1, acc2);
+    xaccTransSortSplits(transaction);
 
-    old = xaccSplitGetValue(xaccTransGetSplit(transaction, i));
-    new = xaccSplitGetValue(xaccTransGetSplit(new_trans, i));
-    result = gnc_numeric_add(old, new, GNC_DENOM_AUTO, GNC_DENOM_FIXED);
-    if (gnc_numeric_eq(old, gnc_numeric_neg(new))) 
+    new_trans = xaccTransReverse(transaction);
+    for (i = 0; i < 2; i++)
     {
-      msg = g_strdup_printf("Value of split %d wrong after reversal\n", i);
-      failure(msg);
+        old = xaccSplitGetAmount(xaccTransGetSplit(transaction, i));
+        new = xaccSplitGetAmount(xaccTransGetSplit(new_trans, i));
+        result = gnc_numeric_add(old, new, GNC_DENOM_AUTO, GNC_DENOM_FIXED);
+        if (gnc_numeric_eq(old, gnc_numeric_neg(new)))
+        {
+            msg = g_strdup_printf("Amount of split %d wrong after reversal\n", i);
+            failure(msg);
+        }
+
+        old = xaccSplitGetValue(xaccTransGetSplit(transaction, i));
+        new = xaccSplitGetValue(xaccTransGetSplit(new_trans, i));
+        result = gnc_numeric_add(old, new, GNC_DENOM_AUTO, GNC_DENOM_FIXED);
+        if (gnc_numeric_eq(old, gnc_numeric_neg(new)))
+        {
+            msg = g_strdup_printf("Value of split %d wrong after reversal\n", i);
+            failure(msg);
+        }
+
     }
-
-  }
-  return;
+    return;
 }
 
 int
 main (int argc, char **argv)
 {
-	qof_init();
-	if(cashobjects_register()) {
-  set_success_print (TRUE);
-  run_test ();
-  success("transaction voiding seems OK");
-  print_test_results();
-	}
-	qof_close();
-  return get_rv();
+    qof_init();
+    if (cashobjects_register())
+    {
+        set_success_print (TRUE);
+        run_test ();
+        success("transaction voiding seems OK");
+        print_test_results();
+    }
+    qof_close();
+    return get_rv();
 }

Modified: gnucash/trunk/src/engine/test/test-transaction-voiding.c
===================================================================
--- gnucash/trunk/src/engine/test/test-transaction-voiding.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test/test-transaction-voiding.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -21,7 +21,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 #include <glib.h>
 #include <string.h>
@@ -38,169 +38,170 @@
 transaction_set_splits_to_accounts(Transaction *tr, Account *a1, Account *a2)
 {
 
-  Split *split;
+    Split *split;
 
-  split  = xaccTransGetSplit(tr, 0);
-  
-  xaccAccountInsertSplit(a1, split);
+    split  = xaccTransGetSplit(tr, 0);
 
-  split = xaccTransGetSplit(tr, 1);
-  xaccAccountInsertSplit(a2, split);
-  return;
+    xaccAccountInsertSplit(a1, split);
+
+    split = xaccTransGetSplit(tr, 1);
+    xaccAccountInsertSplit(a2, split);
+    return;
 }
 
 static void
 run_test (void)
 {
-  Account *acc1, *acc2;
-  Transaction *transaction;
-  gnc_numeric old_amt, new_amt, old_val, new_val;
-  QofBook *book;
-  Timespec ts;
-  time_t now;
+    Account *acc1, *acc2;
+    Transaction *transaction;
+    gnc_numeric old_amt, new_amt, old_val, new_val;
+    QofBook *book;
+    Timespec ts;
+    time_t now;
 
-  char *reason = "because I can";
+    char *reason = "because I can";
 
-  book = qof_book_new();
+    book = qof_book_new();
 
-  acc1 = get_random_account(book);
-  acc2 = get_random_account(book);
+    acc1 = get_random_account(book);
+    acc2 = get_random_account(book);
 
-  if (!acc1 || !acc2)
-  {
-    failure("accounts not created");
-  }
+    if (!acc1 || !acc2)
+    {
+        failure("accounts not created");
+    }
 
-  do
-  {
-    transaction = get_random_transaction (book);
-    if (xaccTransGetVoidStatus (transaction))
+    do
     {
-      xaccTransBeginEdit (transaction);
-      xaccTransDestroy (transaction);
-      xaccTransCommitEdit (transaction);
-      transaction = NULL;
+        transaction = get_random_transaction (book);
+        if (xaccTransGetVoidStatus (transaction))
+        {
+            xaccTransBeginEdit (transaction);
+            xaccTransDestroy (transaction);
+            xaccTransCommitEdit (transaction);
+            transaction = NULL;
+        }
     }
-  } while (!transaction);
+    while (!transaction);
 
-  transaction_set_splits_to_accounts(transaction, acc1, acc2);
+    transaction_set_splits_to_accounts(transaction, acc1, acc2);
 
-  /*  Compromise, check amount on one and value on the other */
+    /*  Compromise, check amount on one and value on the other */
 
-  old_amt = xaccSplitGetAmount(xaccTransGetSplit(transaction, 0));
-  old_val = xaccSplitGetValue(xaccTransGetSplit(transaction, 1));
+    old_amt = xaccSplitGetAmount(xaccTransGetSplit(transaction, 0));
+    old_val = xaccSplitGetValue(xaccTransGetSplit(transaction, 1));
 
-  now = time (NULL);
+    now = time (NULL);
 
-  xaccTransVoid(transaction, reason);
+    xaccTransVoid(transaction, reason);
 
-  ts = xaccTransGetVoidTime (transaction);
+    ts = xaccTransGetVoidTime (transaction);
 
-  /* figure at most 2 seconds difference */
-  if ((ts.tv_sec < now) || ((ts.tv_sec - now) > 2))
-  {
-    failure("bad void time");
-  }
+    /* figure at most 2 seconds difference */
+    if ((ts.tv_sec < now) || ((ts.tv_sec - now) > 2))
+    {
+        failure("bad void time");
+    }
 
-  if (!xaccTransGetVoidStatus(transaction))
-  {
-    failure("void status reports false after setting void");
-  }
+    if (!xaccTransGetVoidStatus(transaction))
+    {
+        failure("void status reports false after setting void");
+    }
 
-  if (strcmp(reason, xaccTransGetVoidReason(transaction)) != 0)
-  {
-    failure("Reasons didn't match");
-  }
- 
-  new_amt = xaccSplitGetAmount(xaccTransGetSplit(transaction, 0));
-  /* print_gnc_numeric(new_amt); */
+    if (strcmp(reason, xaccTransGetVoidReason(transaction)) != 0)
+    {
+        failure("Reasons didn't match");
+    }
 
-  if (!gnc_numeric_zero_p( new_amt))
-  {
-    failure("Amount of split0 not zero after voiding");
-  }      
+    new_amt = xaccSplitGetAmount(xaccTransGetSplit(transaction, 0));
+    /* print_gnc_numeric(new_amt); */
 
-  new_val = xaccSplitGetValue(xaccTransGetSplit(transaction, 1));
- 
-  if (!(gnc_numeric_zero_p(new_val)))
-  {
-    failure("Value of split1 not zero after voiding");
-  }
- 
+    if (!gnc_numeric_zero_p( new_amt))
+    {
+        failure("Amount of split0 not zero after voiding");
+    }
 
-  if(!(gnc_numeric_eq(old_amt, xaccSplitVoidFormerAmount(xaccTransGetSplit(transaction, 0)))))
-  {
-    failure("former amount (after voiding) didn't match actual old amount");
-  }
+    new_val = xaccSplitGetValue(xaccTransGetSplit(transaction, 1));
 
-  if(!(gnc_numeric_eq(old_val, xaccSplitVoidFormerValue(xaccTransGetSplit(transaction, 1)))))
-  {
-    failure("former value (after voiding) didn't match actual old value");
-  }
+    if (!(gnc_numeric_zero_p(new_val)))
+    {
+        failure("Value of split1 not zero after voiding");
+    }
 
-  /*
-   * Retore the transaction to its former glory.
-   */
-  xaccTransUnvoid(transaction);
 
-  ts = xaccTransGetVoidTime (transaction);
+    if (!(gnc_numeric_eq(old_amt, xaccSplitVoidFormerAmount(xaccTransGetSplit(transaction, 0)))))
+    {
+        failure("former amount (after voiding) didn't match actual old amount");
+    }
 
-  /* figure at most 2 seconds difference */
-  if ((ts.tv_sec != 0) || (ts.tv_sec != 0))
-  {
-    failure("void time not zero after restore");
-  }
+    if (!(gnc_numeric_eq(old_val, xaccSplitVoidFormerValue(xaccTransGetSplit(transaction, 1)))))
+    {
+        failure("former value (after voiding) didn't match actual old value");
+    }
 
-  if (xaccTransGetVoidStatus(transaction))
-  {
-    failure("void status reports trus after restoring transaction");
-  }
+    /*
+     * Retore the transaction to its former glory.
+     */
+    xaccTransUnvoid(transaction);
 
-  if (xaccTransGetVoidReason(transaction))
-  {
-    failure("void reason exists after restoring transaction");
-  }
- 
-  new_amt = xaccSplitGetAmount(xaccTransGetSplit(transaction, 0));
-  /* print_gnc_numeric(new_amt); */
+    ts = xaccTransGetVoidTime (transaction);
 
-  if(!(gnc_numeric_eq(old_amt, new_amt)))
-  {
-    failure("Amount of split0 not correct after restoring transaction");
-  }      
+    /* figure at most 2 seconds difference */
+    if ((ts.tv_sec != 0) || (ts.tv_sec != 0))
+    {
+        failure("void time not zero after restore");
+    }
 
-  new_val = xaccSplitGetValue(xaccTransGetSplit(transaction, 1));
- 
-  if(!(gnc_numeric_eq(old_val, new_val)))
-  {
-    failure("Value of split1 not correct after restoring transaction");
-  }
- 
+    if (xaccTransGetVoidStatus(transaction))
+    {
+        failure("void status reports trus after restoring transaction");
+    }
 
-  if (!(gnc_numeric_zero_p(xaccSplitVoidFormerAmount(xaccTransGetSplit(transaction, 0)))))
-  {
-    failure("former amount (after restore) should be zero");
-  }
+    if (xaccTransGetVoidReason(transaction))
+    {
+        failure("void reason exists after restoring transaction");
+    }
 
-  if (!(gnc_numeric_zero_p(xaccSplitVoidFormerValue(xaccTransGetSplit(transaction, 1)))))
-  {
-    failure("former value (after restore) should be zero");
-  }
+    new_amt = xaccSplitGetAmount(xaccTransGetSplit(transaction, 0));
+    /* print_gnc_numeric(new_amt); */
 
-  return;
+    if (!(gnc_numeric_eq(old_amt, new_amt)))
+    {
+        failure("Amount of split0 not correct after restoring transaction");
+    }
+
+    new_val = xaccSplitGetValue(xaccTransGetSplit(transaction, 1));
+
+    if (!(gnc_numeric_eq(old_val, new_val)))
+    {
+        failure("Value of split1 not correct after restoring transaction");
+    }
+
+
+    if (!(gnc_numeric_zero_p(xaccSplitVoidFormerAmount(xaccTransGetSplit(transaction, 0)))))
+    {
+        failure("former amount (after restore) should be zero");
+    }
+
+    if (!(gnc_numeric_zero_p(xaccSplitVoidFormerValue(xaccTransGetSplit(transaction, 1)))))
+    {
+        failure("former value (after restore) should be zero");
+    }
+
+    return;
 }
 
 int
 main (int argc, char **argv)
 {
-  qof_init();
-  if(cashobjects_register())
+    qof_init();
+    if (cashobjects_register())
     {
-      xaccLogDisable ();
-      run_test ();
-      success("transaction voiding seems OK");
-      print_test_results();
+        xaccLogDisable ();
+        run_test ();
+        success("transaction voiding seems OK");
+        print_test_results();
     }
-  qof_close();
-  return get_rv();
+    qof_close();
+    return get_rv();
 }

Modified: gnucash/trunk/src/engine/test-core/gncmod-test-engine.c
===================================================================
--- gnucash/trunk/src/engine/test-core/gncmod-test-engine.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test-core/gncmod-test-engine.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -23,21 +23,25 @@
 
 
 char *
-libgncmod_test_engine_gnc_module_path(void) {
-  return g_strdup("gnucash/engine/test");
+libgncmod_test_engine_gnc_module_path(void)
+{
+    return g_strdup("gnucash/engine/test");
 }
 
 char *
-libgncmod_test_engine_gnc_module_description(void) {
-  return g_strdup("GnuCash Engine test infrastructure.");
+libgncmod_test_engine_gnc_module_description(void)
+{
+    return g_strdup("GnuCash Engine test infrastructure.");
 }
 
 int
-libgncmod_test_engine_gnc_module_init(int refcount) {
-  return TRUE;
+libgncmod_test_engine_gnc_module_init(int refcount)
+{
+    return TRUE;
 }
 
 int
-libgncmod_test_engine_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_test_engine_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/engine/test-core/test-engine-strings.h
===================================================================
--- gnucash/trunk/src/engine/test-core/test-engine-strings.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test-core/test-engine-strings.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,152 +1,155 @@
 
-static const gchar* sane_account_names[] = {
-  "Bank CD",
-  "Brokerage Account",
-  "Bond",
-  "Stock",
-  "Market Index",
-  "Mutual Fund",
-  "Checking Account",
-  "Money Market",
-  "Retirement",
-  "Bond",
-  "Stock",
-  "Market Index",
-  "Mutual Fund",
-  "Savings Account",
-  "Spouse Retirement",
-  "Bond",
-  "Stock",
-  "Market Index",
-  "Mutual Fund",
-  "Currency Trading",
-  "Cash in Wallet",
-  "House",
-  "Other Asset",
-  "Vehicle",
-  "Credit Card",
-  "Line of Credit",
-  "Education Loan",
-  "Mortgage Loan",
-  "Other Loan",
-  "Vehicle Loan",
-  "Bonus",
-  "Dividend Income",
-  "Gifts Received",
-  "Interest Income",
-  "Bond Interest",
-  "CD Interest",
-  "Checking Interest",
-  "Money Market Interest",
-  "Other Interest",
-  "Savings Interest",
-  "Other Income",
-  "Salary",
-  "Salary (Spouse)",
-  "Adjustment",
-  "Auto",
-  "Fees",
-  "Gas",
-  "Parking",
-  "Repair and Maintenance",
-  "Bank Service Charge",
-  "Books",
-  "Cable",
-  "Charity",
-  "Childcare",
-  "Clothes",
-  "Commissions",
-  "Computer",
-  "Dining",
-  "Education",
-  "Entertainment",
-  "Music/Movies",
-  "Recreation",
-  "Travel",
-  "Gifts",
-  "Groceries",
-  "Hobbies",
-  "Home Repair",
-  "Insurance",
-  "Auto Insurance",
-  "Health Insurance",
-  "Home Insurance",
-  "Life Insurance",
-  "Rental Insurance",
-  "Interest",
-  "Education Loan Interest",
-  "Mortgage Interest",
-  "Other Interest",
-  "Vehicle Loan Interest",
-  "Laundry/Dry Cleaning",
-  "Medical Expenses",
-  "Miscellaneous",
-  "Online Services",
-  "Phone",
-  "Public Transportation",
-  "Rent",
-  "Subscriptions",
-  "Supplies",
-  "Taxes",
-  "Federal",
-  "Medicare",
-  "Other Tax",
-  "Property Tax",
-  "Social Security",
-  "State/Province",
-  "Taxes (Spouse)",
-  "Federal",
-  "Medicare",
-  "Other Tax",
-  "Social Security",
-  "State/Province",
-  "Utilities",
-  "Electric",
-  "Garbage collection",
-  "Gas",
-  "Water",
-  "Opening Balances",
-  NULL,
+static const gchar* sane_account_names[] =
+{
+    "Bank CD",
+    "Brokerage Account",
+    "Bond",
+    "Stock",
+    "Market Index",
+    "Mutual Fund",
+    "Checking Account",
+    "Money Market",
+    "Retirement",
+    "Bond",
+    "Stock",
+    "Market Index",
+    "Mutual Fund",
+    "Savings Account",
+    "Spouse Retirement",
+    "Bond",
+    "Stock",
+    "Market Index",
+    "Mutual Fund",
+    "Currency Trading",
+    "Cash in Wallet",
+    "House",
+    "Other Asset",
+    "Vehicle",
+    "Credit Card",
+    "Line of Credit",
+    "Education Loan",
+    "Mortgage Loan",
+    "Other Loan",
+    "Vehicle Loan",
+    "Bonus",
+    "Dividend Income",
+    "Gifts Received",
+    "Interest Income",
+    "Bond Interest",
+    "CD Interest",
+    "Checking Interest",
+    "Money Market Interest",
+    "Other Interest",
+    "Savings Interest",
+    "Other Income",
+    "Salary",
+    "Salary (Spouse)",
+    "Adjustment",
+    "Auto",
+    "Fees",
+    "Gas",
+    "Parking",
+    "Repair and Maintenance",
+    "Bank Service Charge",
+    "Books",
+    "Cable",
+    "Charity",
+    "Childcare",
+    "Clothes",
+    "Commissions",
+    "Computer",
+    "Dining",
+    "Education",
+    "Entertainment",
+    "Music/Movies",
+    "Recreation",
+    "Travel",
+    "Gifts",
+    "Groceries",
+    "Hobbies",
+    "Home Repair",
+    "Insurance",
+    "Auto Insurance",
+    "Health Insurance",
+    "Home Insurance",
+    "Life Insurance",
+    "Rental Insurance",
+    "Interest",
+    "Education Loan Interest",
+    "Mortgage Interest",
+    "Other Interest",
+    "Vehicle Loan Interest",
+    "Laundry/Dry Cleaning",
+    "Medical Expenses",
+    "Miscellaneous",
+    "Online Services",
+    "Phone",
+    "Public Transportation",
+    "Rent",
+    "Subscriptions",
+    "Supplies",
+    "Taxes",
+    "Federal",
+    "Medicare",
+    "Other Tax",
+    "Property Tax",
+    "Social Security",
+    "State/Province",
+    "Taxes (Spouse)",
+    "Federal",
+    "Medicare",
+    "Other Tax",
+    "Social Security",
+    "State/Province",
+    "Utilities",
+    "Electric",
+    "Garbage collection",
+    "Gas",
+    "Water",
+    "Opening Balances",
+    NULL,
 };
 
-static const gchar* sane_descriptions[] = {
-  "401k Income",
-  "401k match 50%",
-  "Cap. gain (long)",
-  "Cap. gain (short)",
-  "Car Repair",
-  "Charity",
-  "Child Care",
-  "Credit Card Refund",
-  "Dividends",
-  "Fed Est Tax",
-  "Fed Tax Witholding",
-  "Insurance Rembersal",
-  "Interect Earned",
-  "Interest Earned",
-  "Investment Interest",
-  "IRA Contrib, non Deductable",
-  "IRA Contrib, Non work Spouse",
-  "IRA Contrib, Spouse",
-  "IRA Contribution",
-  "IRA Management Fee",
-  "Job One",
-  "Job Two",
-  "Medical, Dental",
-  "Medicare",
-  "Medicine",
-  "Mortgage Interest",
-  "Opening Balance",
-  "Pointe Paid",
-  "Real Estate Tax",
-  "Soc Sec",
-  "State and Local",
-  "test dup ",
-  "Unemployment Comp",
-  NULL,
+static const gchar* sane_descriptions[] =
+{
+    "401k Income",
+    "401k match 50%",
+    "Cap. gain (long)",
+    "Cap. gain (short)",
+    "Car Repair",
+    "Charity",
+    "Child Care",
+    "Credit Card Refund",
+    "Dividends",
+    "Fed Est Tax",
+    "Fed Tax Witholding",
+    "Insurance Rembersal",
+    "Interect Earned",
+    "Interest Earned",
+    "Investment Interest",
+    "IRA Contrib, non Deductable",
+    "IRA Contrib, Non work Spouse",
+    "IRA Contrib, Spouse",
+    "IRA Contribution",
+    "IRA Management Fee",
+    "Job One",
+    "Job Two",
+    "Medical, Dental",
+    "Medicare",
+    "Medicine",
+    "Mortgage Interest",
+    "Opening Balance",
+    "Pointe Paid",
+    "Real Estate Tax",
+    "Soc Sec",
+    "State and Local",
+    "test dup ",
+    "Unemployment Comp",
+    NULL,
 };
 
-static const gchar* sane_actions[] = {
+static const gchar* sane_actions[] =
+{
     "Dep",
     "Wthdrw",
     "Check",

Modified: gnucash/trunk/src/engine/test-core/test-engine-stuff.c
===================================================================
--- gnucash/trunk/src/engine/test-core/test-engine-stuff.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test-core/test-engine-stuff.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -5,8 +5,8 @@
  * account heirarchies, etc.
  *
  * XXX We should modify routines to create really, ugly, dirty
- * transactions 
- * -- 3 or more splits (TBD) 
+ * transactions
+ * -- 3 or more splits (TBD)
  * -- splits without parent accounts  (done)
  * -- splits that have accounts but aren't in a transaction (TBD)
  * -- splits that share a currency with the transaction, but whose
@@ -57,10 +57,10 @@
 static gint min_scu = 100; //1;
 
 
-/* The inverse fraction of split/transaction data that should 
- * contain invalid/inconsistent fields/values.  Thus, 
+/* The inverse fraction of split/transaction data that should
+ * contain invalid/inconsistent fields/values.  Thus,
  * if borked==1000, then one in 1000 fields will have bad data.
- * This is used to test the data integrity scrubbers, which are 
+ * This is used to test the data integrity scrubbers, which are
  * supposed to clean up any crud they find.
  */
 static gint borked = 80;
@@ -73,59 +73,59 @@
 void
 set_max_account_tree_depth (gint max_tree_depth_in)
 {
-  max_tree_depth = MAX (max_tree_depth_in, 1);
+    max_tree_depth = MAX (max_tree_depth_in, 1);
 }
 
 void
 set_max_accounts_per_level (gint max_level_accounts_in)
 {
-  max_level_accounts = MAX (max_level_accounts_in, 1);
+    max_level_accounts = MAX (max_level_accounts_in, 1);
 }
 
 void
 set_max_kvp_depth (gint max_kvp_depth)
 {
-  kvp_max_depth = MAX (max_kvp_depth, 1);
+    kvp_max_depth = MAX (max_kvp_depth, 1);
 }
 
 void
 set_max_kvp_frame_elements (gint max_kvp_frame_elements)
 {
-  kvp_frame_max_elements = MAX (max_kvp_frame_elements, 1);
+    kvp_frame_max_elements = MAX (max_kvp_frame_elements, 1);
 }
 
 void
 kvp_exclude_type (KvpValueType kvp_type)
 {
-  gint *key;
+    gint *key;
 
-  if (!exclude_kvp_types)
-    exclude_kvp_types = g_hash_table_new (g_int_hash, g_int_equal);
+    if (!exclude_kvp_types)
+        exclude_kvp_types = g_hash_table_new (g_int_hash, g_int_equal);
 
-  key = g_new (gint, 1);
-  *key = kvp_type;
+    key = g_new (gint, 1);
+    *key = kvp_type;
 
-  g_hash_table_insert (exclude_kvp_types, key, exclude_kvp_types);
+    g_hash_table_insert (exclude_kvp_types, key, exclude_kvp_types);
 }
 
 static gboolean
 kvp_type_excluded (KvpValueType kvp_type)
 {
-  gint key = kvp_type;
+    gint key = kvp_type;
 
-  if (!exclude_kvp_types)
-    return FALSE;
+    if (!exclude_kvp_types)
+        return FALSE;
 
-  if (g_hash_table_lookup (exclude_kvp_types, &key))
-    return TRUE;
+    if (g_hash_table_lookup (exclude_kvp_types, &key))
+        return TRUE;
 
-  return FALSE;
+    return FALSE;
 }
 
 void
 random_glist_strings_only (gboolean strings_only)
 {
-  glist_strings_only = strings_only;
+    glist_strings_only = strings_only;
 }
 
 static gboolean zero_nsec = FALSE;
@@ -133,7 +133,7 @@
 void
 random_timespec_zero_nsec (gboolean zero_nsec_in)
 {
-  zero_nsec = zero_nsec_in;
+    zero_nsec = zero_nsec_in;
 }
 
 static gboolean usec_resolution = FALSE;
@@ -141,7 +141,7 @@
 void
 random_timespec_usec_resolution (gboolean usec_resolution_in)
 {
-  usec_resolution = usec_resolution_in;
+    usec_resolution = usec_resolution_in;
 }
 
 /* ========================================================== */
@@ -149,11 +149,11 @@
 static inline gboolean
 do_bork (void)
 {
-  if (1 == get_random_int_in_range (0, borked)) 
-  {
-    return TRUE;
-  }
-  return FALSE;
+    if (1 == get_random_int_in_range (0, borked))
+    {
+        return TRUE;
+    }
+    return FALSE;
 }
 
 /* ========================================================== */
@@ -162,11 +162,11 @@
 static gpointer
 get_random_list_element (GList *list)
 {
-  g_return_val_if_fail (list, NULL);
+    g_return_val_if_fail (list, NULL);
 
-  return g_list_nth_data (list,
-                          get_random_int_in_range (0,
-                                                   g_list_length (list) - 1));
+    return g_list_nth_data (list,
+                            get_random_int_in_range (0,
+                                    g_list_length (list) - 1));
 }
 
 static kvp_value* get_random_kvp_value_depth (int type, gint depth);
@@ -179,7 +179,7 @@
     int i;
 
     if (depth >= kvp_max_depth)
-      return NULL;
+        return NULL;
 
     for (i = 0; i < count; i++)
     {
@@ -190,7 +190,7 @@
 
         do
         {
-          value = get_random_kvp_value_depth (kvpt, depth + 1);
+            value = get_random_kvp_value_depth (kvpt, depth + 1);
         }
         while (!value);
 
@@ -203,7 +203,7 @@
 GList*
 get_random_glist(void)
 {
-  return get_random_glist_depth (0);
+    return get_random_glist_depth (0);
 }
 
 /* ========================================================== */
@@ -212,28 +212,28 @@
 Timespec*
 get_random_timespec(void)
 {
-  Timespec *ret;
+    Timespec *ret;
 
-  ret = g_new0(Timespec, 1);
+    ret = g_new0(Timespec, 1);
 
-  while (ret->tv_sec <= 0)
-    ret->tv_sec = rand();
+    while (ret->tv_sec <= 0)
+        ret->tv_sec = rand();
 
-  if (zero_nsec)
-    ret->tv_nsec = 0;
-  else
-  {
-    ret->tv_nsec = rand();
+    if (zero_nsec)
+        ret->tv_nsec = 0;
+    else
+    {
+        ret->tv_nsec = rand();
 
-    if (usec_resolution)
-    {
-      ret->tv_nsec = MIN (ret->tv_nsec, 999999999);
-      ret->tv_nsec /= 1000;
-      ret->tv_nsec *= 1000;
+        if (usec_resolution)
+        {
+            ret->tv_nsec = MIN (ret->tv_nsec, 999999999);
+            ret->tv_nsec /= 1000;
+            ret->tv_nsec *= 1000;
+        }
     }
-  }
 
-  return ret;
+    return ret;
 }
 
 GUID*
@@ -253,14 +253,14 @@
     int len;
     bin_data *ret;
 
-    len = get_random_int_in_range(20,100);
+    len = get_random_int_in_range(20, 100);
     ret = g_new(bin_data, 1);
     ret->data = g_new(guchar, len);
     ret->len = len;
 
-    for(len--; len >= 0; len--)
+    for (len--; len >= 0; len--)
     {
-        ret->data[len] = (guchar)get_random_int_in_range(0,255);
+        ret->data[len] = (guchar)get_random_int_in_range(0, 255);
     }
 
     return ret;
@@ -288,15 +288,15 @@
     }
 
     if (datype == KVP_TYPE_FRAME && depth >= kvp_max_depth)
-      return NULL;
+        return NULL;
 
     if (datype == KVP_TYPE_GLIST && depth >= kvp_max_depth)
-      return NULL;
+        return NULL;
 
     if (kvp_type_excluded (datype))
-      return NULL;
+        return NULL;
 
-    switch(datype)
+    switch (datype)
     {
     case KVP_TYPE_GINT64:
         ret = kvp_value_new_gint64(get_random_gint64());
@@ -314,13 +314,13 @@
     {
         gchar *tmp_str;
         tmp_str = get_random_string();
-        if(!tmp_str)
-	  return NULL;
-        
+        if (!tmp_str)
+            return NULL;
+
         ret = kvp_value_new_string(tmp_str);
         g_free(tmp_str);
     }
-        break;
+    break;
 
     case KVP_TYPE_GUID:
     {
@@ -329,7 +329,7 @@
         ret = kvp_value_new_guid(tmp_guid);
         g_free(tmp_guid);
     }
-        break;
+    break;
 
     case KVP_TYPE_TIMESPEC:
     {
@@ -337,8 +337,8 @@
         ret = kvp_value_new_timespec (*ts);
         g_free(ts);
     }
-	break;
-    
+    break;
+
     case KVP_TYPE_BINARY:
     {
         bin_data *tmp_data;
@@ -347,8 +347,8 @@
         g_free(tmp_data->data);
         g_free(tmp_data);
     }
-        break;
- 
+    break;
+
     case KVP_TYPE_GLIST:
         ret = kvp_value_new_glist_nc(get_random_glist_depth (depth + 1));
         break;
@@ -360,7 +360,7 @@
         ret = kvp_value_new_frame(tmp_frame);
         kvp_frame_delete(tmp_frame);
     }
-        break;
+    break;
 
     default:
         ret = NULL;
@@ -377,34 +377,36 @@
     gboolean val_added;
 
     if (depth >= kvp_max_depth)
-      return NULL;
+        return NULL;
 
     ret = kvp_frame_new();
 
-    vals_to_add = get_random_int_in_range(1,kvp_frame_max_elements);
+    vals_to_add = get_random_int_in_range(1, kvp_frame_max_elements);
     val_added = FALSE;
 
-    for (;vals_to_add > 0; vals_to_add--)
+    for (; vals_to_add > 0; vals_to_add--)
     {
         gchar *key;
         KvpValue *val;
 
-	key = NULL;
-	while (key == NULL) {
-	  key = get_random_string_without("/");
-	  if (*key == '\0') {
-	    g_free(key);
-	    key = NULL;
-	  }
-	}
-	
+        key = NULL;
+        while (key == NULL)
+        {
+            key = get_random_string_without("/");
+            if (*key == '\0')
+            {
+                g_free(key);
+                key = NULL;
+            }
+        }
+
         val = get_random_kvp_value_depth (-1, depth + 1);
         if (!val)
         {
-	  g_free(key);
-          if (!val_added)
-            vals_to_add++;
-          continue;
+            g_free(key);
+            if (!val_added)
+                vals_to_add++;
+            continue;
         }
 
         val_added = TRUE;
@@ -420,13 +422,13 @@
 KvpFrame *
 get_random_kvp_frame (void)
 {
-  return get_random_kvp_frame_depth (0);
+    return get_random_kvp_frame_depth (0);
 }
 
 KvpValue *
 get_random_kvp_value(int type)
 {
-  return get_random_kvp_value_depth (type, 0);
+    return get_random_kvp_value_depth (type, 0);
 }
 
 /* ================================================================= */
@@ -440,34 +442,36 @@
     gint64 numer;
     gint64 deno;
 
-    if (RAND_MAX/8 > rand())
+    if (RAND_MAX / 8 > rand())
     {
-       /* Random number between 1 and 6000 */
-       deno = RAND_IN_RANGE(6000ULL);
+        /* Random number between 1 and 6000 */
+        deno = RAND_IN_RANGE(6000ULL);
     }
     else
     {
-       gint64 norm = RAND_IN_RANGE (7ULL);
+        gint64 norm = RAND_IN_RANGE (7ULL);
 
-       /* multiple of 10, between 1 and 1 million */
-       deno = 1;
-       while (norm) 
-       {
-          deno *= 10;
-          norm --;
-       }
+        /* multiple of 10, between 1 and 1 million */
+        deno = 1;
+        while (norm)
+        {
+            deno *= 10;
+            norm --;
+        }
     }
 
-    /* Arbitrary random numbers can cause pointless overflow 
-     * during calculations.  Limit dynamic range in hopes 
+    /* Arbitrary random numbers can cause pointless overflow
+     * during calculations.  Limit dynamic range in hopes
      * of avoiding overflow. Right now limit it to approx 2^48.
      * The initial division is to help us down towards the range.
      * The loop is to "make sure" we get there.  We might
      * want to make this dependent on "deno" in the future.
      */
-    do {
-      numer = get_random_gint64()/1000000;
-    } while ((numer >> 31) > 0x1FFFF);
+    do
+    {
+        numer = get_random_gint64() / 1000000;
+    }
+    while ((numer >> 31) > 0x1FFFF);
     if (0 == numer) numer = 1;
     /* Make sure we have a non-zero denominator */
     if (0 == deno) deno = 1;
@@ -496,34 +500,35 @@
 static gnc_commodity *
 get_random_commodity_from_table (gnc_commodity_table *table)
 {
-  GList *namespaces;
-  gnc_commodity *com = NULL;
+    GList *namespaces;
+    gnc_commodity *com = NULL;
 
-  g_return_val_if_fail (table, NULL);
+    g_return_val_if_fail (table, NULL);
 
-  namespaces = gnc_commodity_table_get_namespaces (table);
+    namespaces = gnc_commodity_table_get_namespaces (table);
 
-  do
-  {
-    GList *commodities;
-    char *namespace;
+    do
+    {
+        GList *commodities;
+        char *namespace;
 
-    namespace = get_random_list_element (namespaces);
+        namespace = get_random_list_element (namespaces);
 
-    commodities = gnc_commodity_table_get_commodities (table, namespace);
-    if (!commodities)
-      continue;
+        commodities = gnc_commodity_table_get_commodities (table, namespace);
+        if (!commodities)
+            continue;
 
-    com = get_random_list_element (commodities);
+        com = get_random_list_element (commodities);
 
-    g_list_free (commodities);
+        g_list_free (commodities);
 
-  } while (!com);
+    }
+    while (!com);
 
 
-  g_list_free (namespaces);
+    g_list_free (namespaces);
 
-  return com;
+    return com;
 }
 
 gnc_commodity*
@@ -541,9 +546,9 @@
 
 #if 0
     if (table &&
-        (gnc_commodity_table_get_size (table) > 0) &&
-        get_random_int_in_range (1, 5) < 5)
-      return get_random_commodity_from_table (table);
+            (gnc_commodity_table_get_size (table) > 0) &&
+            get_random_int_in_range (1, 5) < 5)
+        return get_random_commodity_from_table (table);
 #endif
 
     mn = get_random_string_length_in_range(1, 3);
@@ -551,13 +556,13 @@
 
     if (table)
     {
-      ret = gnc_commodity_table_lookup (table, space, mn);
+        ret = gnc_commodity_table_lookup (table, space, mn);
 
-      if (ret)
-      {
-        g_free (mn);
-        return ret;
-      }
+        if (ret)
+        {
+            g_free (mn);
+            return ret;
+        }
     }
 
     name = get_random_string();
@@ -572,7 +577,7 @@
     g_free(cusip);
 
     if (table)
-      ret = gnc_commodity_table_insert (table, ret);
+        ret = gnc_commodity_table_insert (table, ret);
 
     return ret;
 }
@@ -580,63 +585,63 @@
 void
 make_random_changes_to_commodity (gnc_commodity *com)
 {
-  char *str;
+    char *str;
 
-  g_return_if_fail (com);
+    g_return_if_fail (com);
 
-  str = get_random_string ();
-  gnc_commodity_set_namespace (com, str);
-  g_free (str);
+    str = get_random_string ();
+    gnc_commodity_set_namespace (com, str);
+    g_free (str);
 
-  str = get_random_string ();
-  gnc_commodity_set_mnemonic (com, str);
-  g_free (str);
+    str = get_random_string ();
+    gnc_commodity_set_mnemonic (com, str);
+    g_free (str);
 
-  str = get_random_string ();
-  gnc_commodity_set_fullname (com, str);
-  g_free (str);
+    str = get_random_string ();
+    gnc_commodity_set_fullname (com, str);
+    g_free (str);
 
-  str = get_random_string ();
-  gnc_commodity_set_cusip (com, str);
-  g_free (str);
+    str = get_random_string ();
+    gnc_commodity_set_cusip (com, str);
+    g_free (str);
 
-  gnc_commodity_set_fraction (com, get_random_int_in_range (1, 100000));
+    gnc_commodity_set_fraction (com, get_random_int_in_range (1, 100000));
 }
 
 void
 make_random_changes_to_commodity_table (gnc_commodity_table *table)
 {
-  GList *namespaces;
-  GList *node;
+    GList *namespaces;
+    GList *node;
 
-  g_return_if_fail (table);
+    g_return_if_fail (table);
 
-  namespaces = gnc_commodity_table_get_namespaces (table);
+    namespaces = gnc_commodity_table_get_namespaces (table);
 
-  for (node = namespaces; node; node = node->next)
-  {
-    const char *ns = node->data;
-    GList *commodities;
-    GList *com_node;
+    for (node = namespaces; node; node = node->next)
+    {
+        const char *ns = node->data;
+        GList *commodities;
+        GList *com_node;
 
-    if (gnc_commodity_namespace_is_iso (ns))
-      continue;
+        if (gnc_commodity_namespace_is_iso (ns))
+            continue;
 
-    commodities = gnc_commodity_table_get_commodities (table, ns);
+        commodities = gnc_commodity_table_get_commodities (table, ns);
 
-    for (com_node = commodities; com_node; com_node = com_node->next)
-    {
-      gnc_commodity *com = com_node->data;
+        for (com_node = commodities; com_node; com_node = com_node->next)
+        {
+            gnc_commodity *com = com_node->data;
 
-      gnc_commodity_table_remove (table, com);
-      make_random_changes_to_commodity (com);
-      gnc_commodity_table_insert (table, com);
+            gnc_commodity_table_remove (table, com);
+            make_random_changes_to_commodity (com);
+            gnc_commodity_table_insert (table, com);
+        }
+
+        g_list_free (commodities);
     }
 
-    g_list_free (commodities);
-  }
-
-  g_list_free (namespaces);
+    g_list_free (namespaces);
 }
 /* ================================================================= */
 /* Price stuff */
@@ -644,167 +649,173 @@
 void
 make_random_changes_to_price (QofBook *book, GNCPrice *p)
 {
-  Timespec *ts;
-  char *string;
-  gnc_commodity *c;
+    Timespec *ts;
+    char *string;
+    gnc_commodity *c;
 
-  g_return_if_fail (book && p);
+    g_return_if_fail (book && p);
 
-  gnc_price_begin_edit (p);
+    gnc_price_begin_edit (p);
 
-  c = get_random_commodity (book);
-  gnc_price_set_commodity (p, c);
+    c = get_random_commodity (book);
+    gnc_price_set_commodity (p, c);
 
-  c = get_random_commodity (book);
-  gnc_price_set_currency (p, c);
+    c = get_random_commodity (book);
+    gnc_price_set_currency (p, c);
 
-  ts = get_random_timespec ();
-  gnc_price_set_time (p, *ts);
-  g_free (ts);
+    ts = get_random_timespec ();
+    gnc_price_set_time (p, *ts);
+    g_free (ts);
 
-  string = get_random_string ();
-  gnc_price_set_source (p, string);
-  g_free (string);
+    string = get_random_string ();
+    gnc_price_set_source (p, string);
+    g_free (string);
 
-  string = get_random_string ();
-  gnc_price_set_typestr (p, string);
-  g_free (string);
+    string = get_random_string ();
+    gnc_price_set_typestr (p, string);
+    g_free (string);
 
-  gnc_price_set_value (p, get_random_gnc_numeric ());
+    gnc_price_set_value (p, get_random_gnc_numeric ());
 
-  gnc_price_commit_edit (p);
+    gnc_price_commit_edit (p);
 }
 
 GNCPrice *
 get_random_price(QofBook *book)
 {
-  GNCPrice *p;
+    GNCPrice *p;
 
-  p = gnc_price_create (book);
-  if(!p)
-  {
-      failure_args("engine-stuff", __FILE__, __LINE__,
-                   "get_random_price failed");
-      return NULL;
-  }
+    p = gnc_price_create (book);
+    if (!p)
+    {
+        failure_args("engine-stuff", __FILE__, __LINE__,
+                     "get_random_price failed");
+        return NULL;
+    }
 
-  make_random_changes_to_price (book, p);
-  if(!p)
-  {
-      failure_args("engine-stuff", __FILE__, __LINE__,
-                   "make_random_changes_to_price failed");
-      return NULL;
-  }
+    make_random_changes_to_price (book, p);
+    if (!p)
+    {
+        failure_args("engine-stuff", __FILE__, __LINE__,
+                     "make_random_changes_to_price failed");
+        return NULL;
+    }
 
-  return p;
+    return p;
 }
 
 gboolean
 make_random_pricedb (QofBook *book, GNCPriceDB *db)
 {
-  int num_prices;
-   gboolean check;
+    int num_prices;
+    gboolean check;
 
-  num_prices = get_random_int_in_range (1, 41);
-  if(num_prices < 1) /* should be impossible */
-  {
-      failure_args("engine-stuff", __FILE__, __LINE__,
-                   "get_random_int_in_range failed");
-        return FALSE;
-  }
-
-  while (num_prices-- > 0)
-  {
-    GNCPrice *p;
-
-    p = get_random_price (book);
-    if(!p)
+    num_prices = get_random_int_in_range (1, 41);
+    if (num_prices < 1) /* should be impossible */
     {
         failure_args("engine-stuff", __FILE__, __LINE__,
-                     "get_random_price failed");
-                return FALSE;
+                     "get_random_int_in_range failed");
+        return FALSE;
     }
 
+    while (num_prices-- > 0)
+    {
+        GNCPrice *p;
+
+        p = get_random_price (book);
+        if (!p)
+        {
+            failure_args("engine-stuff", __FILE__, __LINE__,
+                         "get_random_price failed");
+            return FALSE;
+        }
+
         check = gnc_pricedb_add_price (db, p);
-        if(!check) { return check; }
+        if (!check)
+        {
+            return check;
+        }
 
-    gnc_price_unref (p);
-  }
-	return TRUE;
+        gnc_price_unref (p);
+    }
+    return TRUE;
 }
 
 GNCPriceDB *
 get_random_pricedb(QofBook *book)
 {
-  GNCPriceDB *db;
+    GNCPriceDB *db;
 
-  db = gnc_pricedb_get_db (book);
-  if(!db)
-  {
-      failure_args("engine-stuff", __FILE__, __LINE__,
-                   "gnc_pricedb_get_db failed");
-      return NULL;
-  }
-  if(!make_random_pricedb (book, db)) { return NULL; }
+    db = gnc_pricedb_get_db (book);
+    if (!db)
+    {
+        failure_args("engine-stuff", __FILE__, __LINE__,
+                     "gnc_pricedb_get_db failed");
+        return NULL;
+    }
+    if (!make_random_pricedb (book, db))
+    {
+        return NULL;
+    }
 
-  return db;
+    return db;
 }
 
 static gboolean
 price_accumulator (GNCPrice *p, gpointer data)
 {
-  GList **list = data;
+    GList **list = data;
 
-  *list = g_list_prepend (*list, p);
+    *list = g_list_prepend (*list, p);
 
-  return TRUE;
+    return TRUE;
 }
 
 void
 make_random_changes_to_pricedb (QofBook *book, GNCPriceDB *pdb)
 {
-  GList *list = NULL;
-  GList *node;
+    GList *list = NULL;
+    GList *node;
 
-  g_return_if_fail (pdb);
+    g_return_if_fail (pdb);
 
-  gnc_pricedb_foreach_price (pdb, price_accumulator, &list, FALSE);
+    gnc_pricedb_foreach_price (pdb, price_accumulator, &list, FALSE);
 
-  for (node = list; node; node = node->next)
-  {
-    GNCPrice *p = node->data;
-
-    switch (get_random_int_in_range (0, 5))
+    for (node = list; node; node = node->next)
     {
-      case 0: /* Delete */
-        gnc_pricedb_remove_price (pdb, p);
-        break;
+        GNCPrice *p = node->data;
 
-      case 1:
-      case 2: /* Change */
-        make_random_changes_to_price (book, p);
-        break;
+        switch (get_random_int_in_range (0, 5))
+        {
+        case 0: /* Delete */
+            gnc_pricedb_remove_price (pdb, p);
+            break;
 
-      default: /* nothing */
-        break;
+        case 1:
+        case 2: /* Change */
+            make_random_changes_to_price (book, p);
+            break;
+
+        default: /* nothing */
+            break;
+        }
     }
-  }
 
-  g_list_free (list);
+    g_list_free (list);
 
-  /* Add a few new ones */
-  {
-    int i = get_random_int_in_range (1, 5);
-
-    while (i--)
+    /* Add a few new ones */
     {
-      GNCPrice *p = get_random_price (book);
+        int i = get_random_int_in_range (1, 5);
 
-      gnc_pricedb_add_price (pdb, p);
+        while (i--)
+        {
+            GNCPrice *p = get_random_price (book);
 
-      gnc_price_unref (p);
+            gnc_pricedb_add_price (pdb, p);
+
+            gnc_price_unref (p);
+        }
     }
-  }
 }
 
 /* ================================================================= */
@@ -815,7 +826,7 @@
                           void(*func)(Account *act, const gchar*str))
 {
     gchar *tmp_str = get_random_string();
-    if(tmp_str)
+    if (tmp_str)
     {
         (func)(act, tmp_str);
         g_free(tmp_str);
@@ -828,7 +839,7 @@
     const gchar *list[])
 {
     const gchar *tmp_str = get_random_string_in_array(list);
-    if(tmp_str)
+    if (tmp_str)
         (func)(act, tmp_str);
 
 }
@@ -836,60 +847,60 @@
 static void
 account_add_subaccounts (QofBook *book, Account *account, int depth)
 {
-  int num_accounts;
+    int num_accounts;
 
-  if (depth == 0)
-    return;
+    if (depth == 0)
+        return;
 
-  num_accounts = get_random_int_in_range (1, 10);
-  while (num_accounts-- > 0)
-  {
-    Account *sub = get_random_account (book);
+    num_accounts = get_random_int_in_range (1, 10);
+    while (num_accounts-- > 0)
+    {
+        Account *sub = get_random_account (book);
 
-    gnc_account_append_child (account, sub);
+        gnc_account_append_child (account, sub);
 
-    total_num_accounts ++;
-    if (total_num_accounts > max_total_accounts) return;
+        total_num_accounts ++;
+        if (total_num_accounts > max_total_accounts) return;
 
-    account_add_subaccounts (book, sub, depth - 1);
-  }
+        account_add_subaccounts (book, sub, depth - 1);
+    }
 }
 
 static void
 make_random_account_tree (QofBook *book, Account *root)
 {
-  int depth;
+    int depth;
 
-  g_return_if_fail (book);
-  g_return_if_fail (root);
+    g_return_if_fail (book);
+    g_return_if_fail (root);
 
-  total_num_accounts = 0;
-  depth = get_random_int_in_range (1, max_tree_depth);
+    total_num_accounts = 0;
+    depth = get_random_int_in_range (1, max_tree_depth);
 
-  account_add_subaccounts (book, root, depth);
+    account_add_subaccounts (book, root, depth);
 
-  /* Make sure we have at least two accounts! */
-  if (total_num_accounts <= 1)
-    account_add_subaccounts (book, root, 1);
+    /* Make sure we have at least two accounts! */
+    if (total_num_accounts <= 1)
+        account_add_subaccounts (book, root, 1);
 }
 
 Account *
 get_random_account_tree (QofBook *book)
 {
-  Account * root;
+    Account * root;
 
-  g_return_val_if_fail (book, NULL);
+    g_return_val_if_fail (book, NULL);
 
-  root = gnc_book_get_root_account (book);
-  if (!root)
-  {
-    root = xaccMallocAccount (book);
-    gnc_book_set_root_account (book, root);
-  }
+    root = gnc_book_get_root_account (book);
+    if (!root)
+    {
+        root = xaccMallocAccount (book);
+        gnc_book_set_root_account (book, root);
+    }
 
-  make_random_account_tree (book, root);
+    make_random_account_tree (book, root);
 
-  return root;
+    return root;
 }
 
 /* ================================================================= */
@@ -897,7 +908,7 @@
 
 /** This routine creates a random, but otherwise self-consistent,
  *  'legal' transaction.  It's been modified to occasionally build
- *   cruddy, inconsistent transactions, so that the engine 'scrub' 
+ *   cruddy, inconsistent transactions, so that the engine 'scrub'
  *   routines get tested.
  */
 static void
@@ -916,14 +927,15 @@
 
     bcc = get_random_list_element (account_list);
     if ((bcc == acc) && (!do_bork()))
-    { 
-      /* Make sure that each side of the transaction is in 
-       * a different account; otherwise get weirdness in lot
-       * calculcations.  ... Hmm maybe should fix lots in 
-       * this case? */
-      while (bcc == acc) {
-         bcc = get_random_list_element (account_list);
-      }
+    {
+        /* Make sure that each side of the transaction is in
+         * a different account; otherwise get weirdness in lot
+         * calculcations.  ... Hmm maybe should fix lots in
+         * this case? */
+        while (bcc == acc)
+        {
+            bcc = get_random_list_element (account_list);
+        }
     }
 
     /* Set up two splits whose values really are opposites. */
@@ -931,24 +943,26 @@
     s = get_random_split(book, bcc, trn);
 
     /* Other split should have equal and opposite value */
-    if (do_bork()) 
+    if (do_bork())
     {
-       val = get_random_gnc_numeric();
+        val = get_random_gnc_numeric();
     }
     val = gnc_numeric_neg(val);
     xaccSplitSetValue(s, val);
 
-    if (gnc_commodity_equal (xaccTransGetCurrency(trn), 
-                             xaccAccountGetCommodity(bcc)) && 
-        (!do_bork()))
+    if (gnc_commodity_equal (xaccTransGetCurrency(trn),
+                             xaccAccountGetCommodity(bcc)) &&
+            (!do_bork()))
     {
         amt = val;
-    } else {
+    }
+    else
+    {
         gnc_numeric amt2 = xaccSplitGetAmount(s);
         if (gnc_numeric_positive_p(amt2) ^ gnc_numeric_positive_p(val))
             amt = gnc_numeric_neg(amt2);
-    }   
-    
+    }
+
     if (gnc_numeric_zero_p(val))
         amt = val;
 
@@ -958,230 +972,232 @@
 
 typedef struct
 {
-  GUID guid;
+    GUID guid;
 } TransInfo;
 
 void
 make_random_changes_to_transaction_and_splits (QofBook *book,
-                                               Transaction *trans,
-                                               GList *accounts)
+        Transaction *trans,
+        GList *accounts)
 {
-  GList *splits;
-  GList *node;
-  Split *split;
+    GList *splits;
+    GList *node;
+    Split *split;
 
-  g_return_if_fail (book);
-  g_return_if_fail (trans);
-  g_return_if_fail (accounts);
+    g_return_if_fail (book);
+    g_return_if_fail (trans);
+    g_return_if_fail (accounts);
 
-  xaccTransBeginEdit (trans);
+    xaccTransBeginEdit (trans);
 
-  make_random_changes_to_transaction (book, trans);
+    make_random_changes_to_transaction (book, trans);
 
-  switch (get_random_int_in_range (0, 3))
-  {
+    switch (get_random_int_in_range (0, 3))
+    {
     case 0: /* delete some splits, add some more */
-      if (xaccTransGetVoidStatus (trans))
-        break;
+        if (xaccTransGetVoidStatus (trans))
+            break;
 
-      do
-      {
-        split = xaccTransGetSplit (trans, 0);
+        do
+        {
+            split = xaccTransGetSplit (trans, 0);
 
-        xaccSplitDestroy (split);
-      } while (split);
+            xaccSplitDestroy (split);
+        }
+        while (split);
 
-      add_random_splits (book, trans, accounts);
+        add_random_splits (book, trans, accounts);
 
-      /* fall through */
+        /* fall through */
 
     case 1: /* move the splits around */
-      if (xaccTransGetVoidStatus (trans))
-        break;
+        if (xaccTransGetVoidStatus (trans))
+            break;
 
-      splits = xaccTransGetSplitList (trans);
-      for (node = splits; node; node = node->next)
-      {
-        Split *split = node->data;
-        Account *account;
+        splits = xaccTransGetSplitList (trans);
+        for (node = splits; node; node = node->next)
+        {
+            Split *split = node->data;
+            Account *account;
 
-        account = get_random_list_element (accounts);
+            account = get_random_list_element (accounts);
 
-        xaccAccountInsertSplit (account, split);
-      }
-      break;
+            xaccAccountInsertSplit (account, split);
+        }
+        break;
 
     case 2: /* destroy the transaction */
-      xaccTransDestroy (trans);
-      xaccTransCommitEdit (trans);
-      return;
+        xaccTransDestroy (trans);
+        xaccTransCommitEdit (trans);
+        return;
 
     default: /* do nothing */
-      break;
-  }
+        break;
+    }
 
-  if (xaccTransGetVoidStatus (trans))
-  {
-    xaccTransCommitEdit (trans);
-    return;
-  }
+    if (xaccTransGetVoidStatus (trans))
+    {
+        xaccTransCommitEdit (trans);
+        return;
+    }
 
-  /* mess with the splits */
-  splits = xaccTransGetSplitList (trans);
-  for (node = splits; node; node = node->next)
-  {
-    Split *split = node->data;
+    /* mess with the splits */
+    splits = xaccTransGetSplitList (trans);
+    for (node = splits; node; node = node->next)
+    {
+        Split *split = node->data;
 
+        if (get_random_boolean ())
+            make_random_changes_to_split (split);
+    }
+
     if (get_random_boolean ())
-      make_random_changes_to_split (split);
-  }
-
-  if (get_random_boolean ())
-    xaccTransCommitEdit (trans);
-  else
-    xaccTransRollbackEdit (trans);
+        xaccTransCommitEdit (trans);
+    else
+        xaccTransRollbackEdit (trans);
 }
 
 static int
 add_trans_helper (Transaction *trans, gpointer data)
 {
-  TransInfo *ti;
-  GList **list = data;
+    TransInfo *ti;
+    GList **list = data;
 
-  ti = g_new (TransInfo, 1);
+    ti = g_new (TransInfo, 1);
 
-  ti->guid = *xaccTransGetGUID (trans);
+    ti->guid = *xaccTransGetGUID (trans);
 
-  *list = g_list_prepend (*list, ti);
-  return 0;
+    *list = g_list_prepend (*list, ti);
+    return 0;
 }
 
 void
 make_random_changes_to_level (QofBook *book, Account *parent)
 {
-  Account *new_account;
-  Account *account;
-  GList *accounts;
-  GList *transes;
-  GList *splits;
-  GList *node;
+    Account *new_account;
+    Account *account;
+    GList *accounts;
+    GList *transes;
+    GList *splits;
+    GList *node;
 
-  g_return_if_fail (parent && book);
+    g_return_if_fail (parent && book);
 
-  accounts = gnc_account_get_descendants (parent);
+    accounts = gnc_account_get_descendants (parent);
 
-  /* Add a new account */
-  new_account = get_random_account (book);
+    /* Add a new account */
+    new_account = get_random_account (book);
 
-  if (get_random_boolean () || !accounts)
-    gnc_account_append_child (parent, new_account);
-  else
-  {
-    account = get_random_list_element (accounts);
+    if (get_random_boolean () || !accounts)
+        gnc_account_append_child (parent, new_account);
+    else
+    {
+        account = get_random_list_element (accounts);
 
-    gnc_account_append_child (account, new_account);
-  }
+        gnc_account_append_child (account, new_account);
+    }
 
-  g_list_free (accounts);
-  accounts = gnc_account_get_descendants (parent);
+    g_list_free (accounts);
+    accounts = gnc_account_get_descendants (parent);
 
-  /* Add some new transactions */
-  add_random_transactions_to_book (book, get_random_int_in_range (1, 6));
+    /* Add some new transactions */
+    add_random_transactions_to_book (book, get_random_int_in_range (1, 6));
 
-  /* Mess with the accounts */
-  for (node = accounts; node; node = node->next)
-  {
-    Account *account = node->data;
+    /* Mess with the accounts */
+    for (node = accounts; node; node = node->next)
+    {
+        Account *account = node->data;
 
-    if (get_random_boolean ())
-      make_random_changes_to_account (book, account);
-  }
+        if (get_random_boolean ())
+            make_random_changes_to_account (book, account);
+    }
 
-  /* Mess with the transactions & splits */
-  transes = NULL;
-  xaccAccountTreeForEachTransaction (parent, add_trans_helper, &transes);
+    /* Mess with the transactions & splits */
+    transes = NULL;
+    xaccAccountTreeForEachTransaction (parent, add_trans_helper, &transes);
 
-  for (node = transes; node; node = node->next)
-  {
-    TransInfo *ti = node->data;
-    Transaction *trans = xaccTransLookup (&ti->guid, book);
+    for (node = transes; node; node = node->next)
+    {
+        TransInfo *ti = node->data;
+        Transaction *trans = xaccTransLookup (&ti->guid, book);
 
-    if (!trans)
-      continue;
+        if (!trans)
+            continue;
 
-    make_random_changes_to_transaction_and_splits (book, trans, accounts);
-  }
+        make_random_changes_to_transaction_and_splits (book, trans, accounts);
+    }
 
-  for (node = transes; node; node = node->next)
-  {
-    TransInfo *ti = node->data;
+    for (node = transes; node; node = node->next)
+    {
+        TransInfo *ti = node->data;
 
-    g_free (ti);
-  }
-  g_list_free (transes);
-  transes = NULL;
+        g_free (ti);
+    }
+    g_list_free (transes);
+    transes = NULL;
 
-  /* delete an account */
-  account = get_random_list_element (accounts);
+    /* delete an account */
+    account = get_random_list_element (accounts);
 
-  splits = xaccAccountGetSplitList (account);
-  splits = g_list_copy (splits);
+    splits = xaccAccountGetSplitList (account);
+    splits = g_list_copy (splits);
 
-  for (node = splits; node; node = node->next)
-  {
-    Split *split = node->data;
-
-    do
+    for (node = splits; node; node = node->next)
     {
-      new_account = get_random_list_element (accounts);
-    } while (new_account == account);
+        Split *split = node->data;
 
-    xaccAccountInsertSplit (new_account, split);
-  }
+        do
+        {
+            new_account = get_random_list_element (accounts);
+        }
+        while (new_account == account);
 
-  xaccAccountBeginEdit (account);
-  xaccAccountDestroy (account);
+        xaccAccountInsertSplit (new_account, split);
+    }
 
-  g_list_free (splits);
-  g_list_free (accounts);
+    xaccAccountBeginEdit (account);
+    xaccAccountDestroy (account);
 
-  accounts = gnc_account_get_descendants (parent);
+    g_list_free (splits);
+    g_list_free (accounts);
 
-  /* move some accounts around */
-  if (accounts && (g_list_length (accounts) > 1))
-  {
-    int i = get_random_int_in_range (1, 4);
+    accounts = gnc_account_get_descendants (parent);
 
-    while (i--)
+    /* move some accounts around */
+    if (accounts && (g_list_length (accounts) > 1))
     {
-      Account *a1, *a2;
+        int i = get_random_int_in_range (1, 4);
 
-      a1 = get_random_list_element (accounts);
+        while (i--)
+        {
+            Account *a1, *a2;
 
-      if (get_random_boolean ())
-        a2 = get_random_list_element (accounts);
-      else
-        a2 = NULL;
+            a1 = get_random_list_element (accounts);
 
-      if (!a2)
-      {
-        gnc_account_append_child (parent, a1);
-        continue;
-      }
+            if (get_random_boolean ())
+                a2 = get_random_list_element (accounts);
+            else
+                a2 = NULL;
 
-      if (a1 == a2 ||
-          xaccAccountHasAncestor (a1, a2) ||
-          xaccAccountHasAncestor (a2, a1))
-      {
-        i++;
-        continue;
-      }
+            if (!a2)
+            {
+                gnc_account_append_child (parent, a1);
+                continue;
+            }
 
-      gnc_account_append_child (a2, a1);
+            if (a1 == a2 ||
+                    xaccAccountHasAncestor (a1, a2) ||
+                    xaccAccountHasAncestor (a2, a1))
+            {
+                i++;
+                continue;
+            }
+
+            gnc_account_append_child (a2, a1);
+        }
     }
-  }
 
-  g_list_free (accounts);
+    g_list_free (accounts);
 }
 
 Account*
@@ -1208,7 +1224,7 @@
     qof_instance_set_slots(QOF_INSTANCE(ret), get_random_kvp_frame());
 
     root = gnc_book_get_root_account (book);
-    if (!root) 
+    if (!root)
     {
         root = xaccMallocAccount (book);
         gnc_book_set_root_account (book, root);
@@ -1245,10 +1261,10 @@
 
 static void
 set_split_random_string(Split *spl,
-                       void(*func)(Split *act, const gchar*str))
+                        void(*func)(Split *act, const gchar*str))
 {
     gchar *tmp_str = get_random_string();
-    if(tmp_str)
+    if (tmp_str)
     {
         (func)(spl, tmp_str);
         g_free(tmp_str);
@@ -1290,31 +1306,38 @@
     xaccSplitSetParent(ret, trn);
     xaccSplitSetAccount(ret, acct);
 
-    do {
+    do
+    {
         val = get_random_gnc_numeric ();
         if (val.num == 0)
             fprintf(stderr, "get_random_split: Created split with zero value: %p\n", ret);
 
-        if (!do_bork()) 
+        if (!do_bork())
             val.denom = scu;
-    } while (gnc_numeric_check(val) != GNC_ERROR_OK);
+    }
+    while (gnc_numeric_check(val) != GNC_ERROR_OK);
     xaccSplitSetValue(ret, val);
 
     /* If the currencies are the same, the split amount should equal
      * the split value (unless we bork it on purpose) */
-    if (gnc_commodity_equal (xaccTransGetCurrency(trn), 
+    if (gnc_commodity_equal (xaccTransGetCurrency(trn),
                              xaccAccountGetCommodity(acct)) &&
-        (!do_bork())) {
+            (!do_bork()))
+    {
         amt = val;
-    } else {
+    }
+    else
+    {
         denom = gnc_commodity_get_fraction(xaccAccountGetCommodity(
                                                xaccSplitGetAccount(ret)));
-        do {
+        do
+        {
             rate = gnc_numeric_abs(get_random_gnc_numeric());
-            amt = gnc_numeric_mul(val, rate, 
+            amt = gnc_numeric_mul(val, rate,
                                   GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE);
             amt = gnc_numeric_convert(amt, denom, GNC_HOW_RND_ROUND);
-        } while (gnc_numeric_check(amt) != GNC_ERROR_OK);
+        }
+        while (gnc_numeric_check(amt) != GNC_ERROR_OK);
     }
     xaccSplitSetAmount(ret, amt);
 
@@ -1325,7 +1348,7 @@
         g_assert(!gnc_numeric_negative_p(amt)); /* non-negative amt */
     else
         g_assert(!gnc_numeric_positive_p(amt)); /* non-positive amt */
-    
+
     xaccSplitSetSlots_nc(ret, get_random_kvp_frame());
     xaccTransCommitEdit(trn);
 
@@ -1335,31 +1358,31 @@
 void
 make_random_changes_to_split (Split *split)
 {
-  Transaction *trans;
-  Timespec *ts;
+    Transaction *trans;
+    Timespec *ts;
 
-  g_return_if_fail (split);
+    g_return_if_fail (split);
 
-  trans = xaccSplitGetParent (split);
+    trans = xaccSplitGetParent (split);
 
-  xaccTransBeginEdit (trans);
+    xaccTransBeginEdit (trans);
 
-  set_split_random_string (split, xaccSplitSetMemo);
-  set_split_random_string (split, xaccSplitSetAction);
+    set_split_random_string (split, xaccSplitSetMemo);
+    set_split_random_string (split, xaccSplitSetAction);
 
-  xaccSplitSetReconcile (split, possible_chars[get_random_int_in_range(0, 3)]);
+    xaccSplitSetReconcile (split, possible_chars[get_random_int_in_range(0, 3)]);
 
-  ts = get_random_timespec();
-  xaccSplitSetDateReconciledTS (split, ts);
-  g_free(ts);
+    ts = get_random_timespec();
+    xaccSplitSetDateReconciledTS (split, ts);
+    g_free(ts);
 
-  xaccSplitSetSlots_nc (split, get_random_kvp_frame());
+    xaccSplitSetSlots_nc (split, get_random_kvp_frame());
 
-  /* Don't change share values/prices here, since that would
-   * throw transactions out of balance. Do that in the corresponding
-   * change transaction function. */
+    /* Don't change share values/prices here, since that would
+     * throw transactions out of balance. Do that in the corresponding
+     * change transaction function. */
 
-  xaccTransCommitEdit (trans);
+    xaccTransCommitEdit (trans);
 }
 
 static void
@@ -1367,9 +1390,12 @@
                        void(*func)(Transaction *act, const gchar*str))
 {
     gchar *tmp_str = get_random_string();
-    if(!trn || !(&trn->inst)) { return; }
-    if(tmp_str)
+    if (!trn || !(&trn->inst))
     {
+        return;
+    }
+    if (tmp_str)
+    {
         xaccTransBeginEdit(trn);
         (func)(trn, tmp_str);
         g_free(tmp_str);
@@ -1383,14 +1409,14 @@
     const gchar *list[])
 {
     const gchar *tmp_str = get_random_string_in_array(list);
-    if(tmp_str)
+    if (tmp_str)
         (func)(trn, tmp_str);
 }
 
 
 static void
 trn_add_ran_timespec(Transaction *trn, void (*func)(Transaction*,
-                                                    const Timespec*))
+                     const Timespec*))
 {
     Timespec *to_set;
 
@@ -1399,7 +1425,7 @@
     g_free(to_set);
 }
 
-    
+
 Transaction *
 get_random_transaction_with_currency(QofBook *book,
                                      gnc_commodity *currency,
@@ -1411,16 +1437,17 @@
     gchar *numstr;
 
     numstr = g_new0(gchar, 10);
-    if (!account_list) 
+    if (!account_list)
     {
-      account_list = gnc_account_get_descendants (gnc_book_get_root_account (book));
+        account_list = gnc_account_get_descendants (gnc_book_get_root_account (book));
     }
 
     /* Gotta have at least two different accounts */
-    if (1 >= g_list_length (account_list)) {
-      failure_args("engine-stuff", __FILE__, __LINE__,
-              "get_random_transaction_with_currency: account_list too short");
-      return NULL;
+    if (1 >= g_list_length (account_list))
+    {
+        failure_args("engine-stuff", __FILE__, __LINE__,
+                     "get_random_transaction_with_currency: account_list too short");
+        return NULL;
     }
 
     trans = xaccMallocTransaction(book);
@@ -1446,9 +1473,9 @@
 
     if (get_random_int_in_range (1, 10) == 1)
     {
-      char *reason = get_random_string ();
-      xaccTransVoid (trans, reason);
-      g_free (reason);
+        char *reason = get_random_string ();
+        xaccTransVoid (trans, reason);
+        g_free (reason);
     }
 
     xaccTransCommitEdit(trans);
@@ -1465,509 +1492,520 @@
 Transaction*
 get_random_transaction (QofBook *book)
 {
-	Transaction *ret;
+    Transaction *ret;
 
-	g_return_val_if_fail(book, NULL);
-	ret = get_random_transaction_with_currency (book, NULL, NULL);
-    if(!ret)
+    g_return_val_if_fail(book, NULL);
+    ret = get_random_transaction_with_currency (book, NULL, NULL);
+    if (!ret)
     {
         failure_args("engine-stuff", __FILE__, __LINE__,
                      "get_random_transaction failed");
         return NULL;
     }
-	return ret;
+    return ret;
 }
 
 void
 make_random_changes_to_transaction (QofBook *book, Transaction *trans)
 {
-  g_return_if_fail (trans && book);
+    g_return_if_fail (trans && book);
 
-  if (xaccTransGetVoidStatus (trans)) {
-    if (get_random_int_in_range (1, 2) == 1)
-      xaccTransUnvoid (trans);
-    return;
-  }
+    if (xaccTransGetVoidStatus (trans))
+    {
+        if (get_random_int_in_range (1, 2) == 1)
+            xaccTransUnvoid (trans);
+        return;
+    }
 
-  xaccTransBeginEdit (trans);
+    xaccTransBeginEdit (trans);
 
-  xaccTransSetCurrency (trans, get_random_commodity (book));
+    xaccTransSetCurrency (trans, get_random_commodity (book));
 
-  set_tran_random_string (trans, xaccTransSetNum);
+    set_tran_random_string (trans, xaccTransSetNum);
 
-  trn_add_ran_timespec (trans, xaccTransSetDatePostedTS);
-  trn_add_ran_timespec (trans, xaccTransSetDateEnteredTS);
+    trn_add_ran_timespec (trans, xaccTransSetDatePostedTS);
+    trn_add_ran_timespec (trans, xaccTransSetDateEnteredTS);
 
-  set_tran_random_string (trans, xaccTransSetDescription);
+    set_tran_random_string (trans, xaccTransSetDescription);
 
-  xaccTransSetSlots_nc (trans, get_random_kvp_frame());
+    xaccTransSetSlots_nc (trans, get_random_kvp_frame());
 
-  /* Do split manipulations in higher-level functions */
+    /* Do split manipulations in higher-level functions */
 
-  xaccTransCommitEdit (trans);
+    xaccTransCommitEdit (trans);
 }
 
 
 static GList *
 get_random_guids(int max)
 {
-  GList *guids = NULL;
-  int num_guids;
+    GList *guids = NULL;
+    int num_guids;
 
-  if (max < 1) return NULL;
+    if (max < 1) return NULL;
 
-  num_guids = get_random_int_in_range (1, max);
+    num_guids = get_random_int_in_range (1, max);
 
-  while (num_guids-- > 0)
-    guids = g_list_prepend (guids, get_random_guid ());
+    while (num_guids-- > 0)
+        guids = g_list_prepend (guids, get_random_guid ());
 
-  return guids;
+    return guids;
 }
 
 static void
 free_random_guids(GList *guids)
 {
-  GList *node;
+    GList *node;
 
-  for (node = guids; node; node = node->next)
-    g_free (node->data);
+    for (node = guids; node; node = node->next)
+        g_free (node->data);
 
-  g_list_free (guids);
+    g_list_free (guids);
 }
 
 static QofQueryOp
 get_random_queryop(void)
 {
-  int op_num = get_random_int_in_range(1,11);
-  QofQueryOp op = QOF_QUERY_AND;
-  /* = get_random_int_in_range (1, QOF_QUERY_XOR); */
+    int op_num = get_random_int_in_range(1, 11);
+    QofQueryOp op = QOF_QUERY_AND;
+    /* = get_random_int_in_range (1, QOF_QUERY_XOR); */
 
-  /* Let's make it MUCH more likely to get AND and OR */
-  switch(op_num) {
-  case 1:  case 2:  case 3:  case 4:
-    op = QOF_QUERY_AND;
-    break;
-  case 5:  case 6:  case 7:  case 8:
-    op = QOF_QUERY_OR;
-    break;
-  case 9:
-    op = QOF_QUERY_NAND;
-    break;
-  case 10:
-    op = QOF_QUERY_NOR;
-    break;
-  case 11:
-    op = QOF_QUERY_XOR;
-    break;
-  default:
-    g_assert_not_reached();
-  };
-  if (gnc_engine_debug_random) printf ("op = %d (int was %d), ", op, op_num);
-  return op;
+    /* Let's make it MUCH more likely to get AND and OR */
+    switch (op_num)
+    {
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+        op = QOF_QUERY_AND;
+        break;
+    case 5:
+    case 6:
+    case 7:
+    case 8:
+        op = QOF_QUERY_OR;
+        break;
+    case 9:
+        op = QOF_QUERY_NAND;
+        break;
+    case 10:
+        op = QOF_QUERY_NOR;
+        break;
+    case 11:
+        op = QOF_QUERY_XOR;
+        break;
+    default:
+        g_assert_not_reached();
+    };
+    if (gnc_engine_debug_random) printf ("op = %d (int was %d), ", op, op_num);
+    return op;
 }
 
 static GSList *
 get_random_kvp_path (void)
 {
-  GSList *path;
-  gint len;
+    GSList *path;
+    gint len;
 
-  path = NULL;
-  len = get_random_int_in_range (1, kvp_max_depth);
+    path = NULL;
+    len = get_random_int_in_range (1, kvp_max_depth);
 
-  while (len--)
-    path = g_slist_prepend (path, get_random_string ());
+    while (len--)
+        path = g_slist_prepend (path, get_random_string ());
 
-  return g_slist_reverse (path);
+    return g_slist_reverse (path);
 }
 
 static void
 free_random_kvp_path (GSList *path)
 {
-  GSList *node;
+    GSList *node;
 
-  for (node = path; node; node = node->next)
-    g_free (node->data);
+    for (node = path; node; node = node->next)
+        g_free (node->data);
 
-  g_slist_free (path);
+    g_slist_free (path);
 }
 
 static QofIdType
 get_random_id_type (void)
 {
-  switch (get_random_int_in_range (1,3)) {
-  case 1:
-    return GNC_ID_SPLIT;
-  case 2:
-    return GNC_ID_TRANS;
-  case 3:
-    return GNC_ID_ACCOUNT;
-  default:
-    return get_random_string ();
-  }
+    switch (get_random_int_in_range (1, 3))
+    {
+    case 1:
+        return GNC_ID_SPLIT;
+    case 2:
+        return GNC_ID_TRANS;
+    case 3:
+        return GNC_ID_ACCOUNT;
+    default:
+        return get_random_string ();
+    }
 }
 
-typedef enum {
-  BY_STANDARD = 1,
-  BY_DATE,
-  BY_DATE_ENTERED,
-  BY_DATE_RECONCILED,
-  BY_NUM,
-  BY_AMOUNT,
-  BY_MEMO,
-  BY_DESC,
-  BY_NONE
+typedef enum
+{
+    BY_STANDARD = 1,
+    BY_DATE,
+    BY_DATE_ENTERED,
+    BY_DATE_RECONCILED,
+    BY_NUM,
+    BY_AMOUNT,
+    BY_MEMO,
+    BY_DESC,
+    BY_NONE
 } sort_type_t;
 
 static void
 set_query_sort (Query *q, sort_type_t sort_code)
 {
-  GSList *p1 = NULL, *p2 = NULL, *p3 = NULL, *standard;
+    GSList *p1 = NULL, *p2 = NULL, *p3 = NULL, *standard;
 
-  standard = g_slist_prepend (NULL, QUERY_DEFAULT_SORT);
+    standard = g_slist_prepend (NULL, QUERY_DEFAULT_SORT);
 
-  switch (sort_code)
-  {
+    switch (sort_code)
+    {
     case BY_STANDARD:
-      p1 = standard;
-      break;
+        p1 = standard;
+        break;
     case BY_DATE:
-      p1 = g_slist_prepend (p1, TRANS_DATE_POSTED);
-      p1 = g_slist_prepend (p1, SPLIT_TRANS);
-      p2 = standard;
-      break;
+        p1 = g_slist_prepend (p1, TRANS_DATE_POSTED);
+        p1 = g_slist_prepend (p1, SPLIT_TRANS);
+        p2 = standard;
+        break;
     case BY_DATE_ENTERED:
-      p1 = g_slist_prepend (p1, TRANS_DATE_ENTERED);
-      p1 = g_slist_prepend (p1, SPLIT_TRANS);
-      p2 = standard;
-      break;
+        p1 = g_slist_prepend (p1, TRANS_DATE_ENTERED);
+        p1 = g_slist_prepend (p1, SPLIT_TRANS);
+        p2 = standard;
+        break;
     case BY_DATE_RECONCILED:
-      p1 = g_slist_prepend (p1, SPLIT_RECONCILE);
-      p2 = g_slist_prepend (p2, SPLIT_DATE_RECONCILED);
-      p3 = standard;
-      break;
+        p1 = g_slist_prepend (p1, SPLIT_RECONCILE);
+        p2 = g_slist_prepend (p2, SPLIT_DATE_RECONCILED);
+        p3 = standard;
+        break;
     case BY_NUM:
-      p1 = g_slist_prepend (p1, TRANS_NUM);
-      p1 = g_slist_prepend (p1, SPLIT_TRANS);
-      p2 = standard;
-      break;
+        p1 = g_slist_prepend (p1, TRANS_NUM);
+        p1 = g_slist_prepend (p1, SPLIT_TRANS);
+        p2 = standard;
+        break;
     case BY_AMOUNT:
-      p1 = g_slist_prepend (p1, SPLIT_VALUE);
-      p2 = standard;
-      break;
+        p1 = g_slist_prepend (p1, SPLIT_VALUE);
+        p2 = standard;
+        break;
     case BY_MEMO:
-      p1 = g_slist_prepend (p1, SPLIT_MEMO);
-      p2 = standard;
-      break;
+        p1 = g_slist_prepend (p1, SPLIT_MEMO);
+        p2 = standard;
+        break;
     case BY_DESC:
-      p1 = g_slist_prepend (p1, TRANS_DESCRIPTION);
-      p1 = g_slist_prepend (p1, SPLIT_TRANS);
-      p2 = standard;
-      break;
+        p1 = g_slist_prepend (p1, TRANS_DESCRIPTION);
+        p1 = g_slist_prepend (p1, SPLIT_TRANS);
+        p2 = standard;
+        break;
     case BY_NONE:
-      g_slist_free (standard);
-      break;
+        g_slist_free (standard);
+        break;
     default:
-      g_slist_free (standard);
-      g_return_if_fail (FALSE);
-  }
+        g_slist_free (standard);
+        g_return_if_fail (FALSE);
+    }
 
-  qof_query_set_sort_order (q, p1, p2, p3);
+    qof_query_set_sort_order (q, p1, p2, p3);
 }
 
 Query *
 get_random_query(void)
 {
-  Query *q;
-  int num_terms;
+    Query *q;
+    int num_terms;
 
-  num_terms = get_random_int_in_range (1, 3);
-  if (gnc_engine_debug_random) printf("num_terms = %d", num_terms);
+    num_terms = get_random_int_in_range (1, 3);
+    if (gnc_engine_debug_random) printf("num_terms = %d", num_terms);
 
-  q = xaccMallocQuery ();
+    q = xaccMallocQuery ();
 
-  while (num_terms-- > 0)
-  {
-    gint pr_type;
-    KvpValue *value;
-    Timespec *start;
-    Timespec *end;
-    GList *guids;
-    GSList *path;
-    char *string;
-    GUID *guid;
+    while (num_terms-- > 0)
+    {
+        gint pr_type;
+        KvpValue *value;
+        Timespec *start;
+        Timespec *end;
+        GList *guids;
+        GSList *path;
+        char *string;
+        GUID *guid;
 
-    pr_type = get_random_int_in_range (1, 20);
-    if (gnc_engine_debug_random) printf("\n pr_type = %d ", pr_type);
+        pr_type = get_random_int_in_range (1, 20);
+        if (gnc_engine_debug_random) printf("\n pr_type = %d ", pr_type);
 
-    switch (pr_type)
-    {
-      case 1: /*PR_ACCOUNT */
-        guids = get_random_guids (10);
-        xaccQueryAddAccountGUIDMatch
-          (q,
-           guids,
-           get_random_int_in_range (1, QOF_GUID_MATCH_NONE),
-           get_random_queryop ());
-        free_random_guids (guids);
-        break;
+        switch (pr_type)
+        {
+        case 1: /*PR_ACCOUNT */
+            guids = get_random_guids (10);
+            xaccQueryAddAccountGUIDMatch
+            (q,
+             guids,
+             get_random_int_in_range (1, QOF_GUID_MATCH_NONE),
+             get_random_queryop ());
+            free_random_guids (guids);
+            break;
 
-      case 2: /*PR_ACTION */
-        string = get_random_string ();
-        xaccQueryAddActionMatch (q,
-                                 string,
-                                 get_random_boolean (),
-                                 get_random_boolean (),
-                                 get_random_queryop ());
-        g_free (string);
-        break;
+        case 2: /*PR_ACTION */
+            string = get_random_string ();
+            xaccQueryAddActionMatch (q,
+                                     string,
+                                     get_random_boolean (),
+                                     get_random_boolean (),
+                                     get_random_queryop ());
+            g_free (string);
+            break;
 
-      case 3: /* PR_BALANCE */
-        xaccQueryAddBalanceMatch
-          (q,
-           get_random_boolean (),
-           get_random_queryop ());
-        break;
+        case 3: /* PR_BALANCE */
+            xaccQueryAddBalanceMatch
+            (q,
+             get_random_boolean (),
+             get_random_queryop ());
+            break;
 
-      case 4: /* PR_CLEARED */
-        xaccQueryAddClearedMatch
-          (q,
-           get_random_int_in_range (1,
-                                    CLEARED_NO |
-                                    CLEARED_CLEARED |
-                                    CLEARED_RECONCILED |
-                                    CLEARED_FROZEN |
-                                    CLEARED_VOIDED),
-           get_random_queryop ());
-        break;
+        case 4: /* PR_CLEARED */
+            xaccQueryAddClearedMatch
+            (q,
+             get_random_int_in_range (1,
+                                      CLEARED_NO |
+                                      CLEARED_CLEARED |
+                                      CLEARED_RECONCILED |
+                                      CLEARED_FROZEN |
+                                      CLEARED_VOIDED),
+             get_random_queryop ());
+            break;
 
-      case 5: /* PR_DATE */
-        start = get_random_timespec ();
-        end = get_random_timespec ();
-        xaccQueryAddDateMatchTS (q, 
-                                 get_random_boolean (),
-                                 *start,
-                                 get_random_boolean (),
-                                 *end,
-                                 get_random_queryop ());
-        g_free (start);
-        g_free (end);
-        break;
+        case 5: /* PR_DATE */
+            start = get_random_timespec ();
+            end = get_random_timespec ();
+            xaccQueryAddDateMatchTS (q,
+                                     get_random_boolean (),
+                                     *start,
+                                     get_random_boolean (),
+                                     *end,
+                                     get_random_queryop ());
+            g_free (start);
+            g_free (end);
+            break;
 
-      case 6: /* PR_DESC */
-        string = get_random_string ();
-        xaccQueryAddDescriptionMatch (q,
-                                      string,
-                                      get_random_boolean (),
-                                      get_random_boolean (),
-                                      get_random_queryop ());
-        g_free (string);
-        break;
+        case 6: /* PR_DESC */
+            string = get_random_string ();
+            xaccQueryAddDescriptionMatch (q,
+                                          string,
+                                          get_random_boolean (),
+                                          get_random_boolean (),
+                                          get_random_queryop ());
+            g_free (string);
+            break;
 
-      case 7: /* PR_GUID */
-        guid = get_random_guid ();
-        xaccQueryAddGUIDMatch (q,
-                               guid,
-                               get_random_id_type (),
-                               get_random_queryop ());
-        g_free (guid);
-        break;
+        case 7: /* PR_GUID */
+            guid = get_random_guid ();
+            xaccQueryAddGUIDMatch (q,
+                                   guid,
+                                   get_random_id_type (),
+                                   get_random_queryop ());
+            g_free (guid);
+            break;
 
-      case 8: /* PR_KVP */
-        path = get_random_kvp_path ();
-        do
-        {
-          value = get_random_kvp_value_depth (-2, kvp_max_depth);
-        } while (!value);
-        xaccQueryAddKVPMatch (q,
-                              path,
-                              value,
-                              get_random_int_in_range (1, QOF_COMPARE_NEQ),
-                              get_random_id_type (),
-                              get_random_queryop ());
-        kvp_value_delete (value);
-        free_random_kvp_path (path);
-        break;
+        case 8: /* PR_KVP */
+            path = get_random_kvp_path ();
+            do
+            {
+                value = get_random_kvp_value_depth (-2, kvp_max_depth);
+            }
+            while (!value);
+            xaccQueryAddKVPMatch (q,
+                                  path,
+                                  value,
+                                  get_random_int_in_range (1, QOF_COMPARE_NEQ),
+                                  get_random_id_type (),
+                                  get_random_queryop ());
+            kvp_value_delete (value);
+            free_random_kvp_path (path);
+            break;
 
-      case 9: /* PR_MEMO */
-        string = get_random_string ();
-        xaccQueryAddMemoMatch (q,
-                               string,
-                               get_random_boolean (),
-                               get_random_boolean (),
-                               get_random_queryop ());
-        g_free (string);
-        break;
+        case 9: /* PR_MEMO */
+            string = get_random_string ();
+            xaccQueryAddMemoMatch (q,
+                                   string,
+                                   get_random_boolean (),
+                                   get_random_boolean (),
+                                   get_random_queryop ());
+            g_free (string);
+            break;
 
-      case 10: /* PR_NUM */
-        string = get_random_string ();
-        xaccQueryAddNumberMatch (q,
-                               string,
-                               get_random_boolean (),
-                               get_random_boolean (),
-                               get_random_queryop ());
-        g_free (string);
-        break;
+        case 10: /* PR_NUM */
+            string = get_random_string ();
+            xaccQueryAddNumberMatch (q,
+                                     string,
+                                     get_random_boolean (),
+                                     get_random_boolean (),
+                                     get_random_queryop ());
+            g_free (string);
+            break;
 
-      case 11: /*  PR_PRICE */
-        xaccQueryAddSharePriceMatch
-          (q,
-           get_random_gnc_numeric (), 
-           get_random_int_in_range (1, QOF_COMPARE_NEQ),
-           get_random_queryop ());
-        break;
+        case 11: /*  PR_PRICE */
+            xaccQueryAddSharePriceMatch
+            (q,
+             get_random_gnc_numeric (),
+             get_random_int_in_range (1, QOF_COMPARE_NEQ),
+             get_random_queryop ());
+            break;
 
-      case 12: /* PR_SHRS */
-        xaccQueryAddSharesMatch
-          (q,
-           get_random_gnc_numeric (), 
-           get_random_int_in_range (1, QOF_COMPARE_NEQ),
-           get_random_queryop ());
-        break;
+        case 12: /* PR_SHRS */
+            xaccQueryAddSharesMatch
+            (q,
+             get_random_gnc_numeric (),
+             get_random_int_in_range (1, QOF_COMPARE_NEQ),
+             get_random_queryop ());
+            break;
 
-      case 13: /* PR_VALUE */
-        xaccQueryAddValueMatch
-          (q,
-           get_random_gnc_numeric (),
-           get_random_int_in_range (1, QOF_NUMERIC_MATCH_ANY),
-           get_random_int_in_range (1, QOF_COMPARE_NEQ),
-           get_random_queryop ());
-        break;
+        case 13: /* PR_VALUE */
+            xaccQueryAddValueMatch
+            (q,
+             get_random_gnc_numeric (),
+             get_random_int_in_range (1, QOF_NUMERIC_MATCH_ANY),
+             get_random_int_in_range (1, QOF_COMPARE_NEQ),
+             get_random_queryop ());
+            break;
 
-      default:
-	if (gnc_engine_debug_random) printf("ignored..");
-        num_terms++;
-        break;
+        default:
+            if (gnc_engine_debug_random) printf("ignored..");
+            num_terms++;
+            break;
+        }
     }
-  }
 
-  if (gnc_engine_debug_random) printf ("\n");
-  set_query_sort (q, get_random_int_in_range (1, BY_NONE));
+    if (gnc_engine_debug_random) printf ("\n");
+    set_query_sort (q, get_random_int_in_range (1, BY_NONE));
 
-  xaccQuerySetSortIncreasing (q,
-                              get_random_boolean (),
-                              get_random_boolean (),
-                              get_random_boolean ());
+    xaccQuerySetSortIncreasing (q,
+                                get_random_boolean (),
+                                get_random_boolean (),
+                                get_random_boolean ());
 
-  xaccQuerySetMaxSplits (q, get_random_int_in_range (-50000, 50000));
+    xaccQuerySetMaxSplits (q, get_random_int_in_range (-50000, 50000));
 
-  return q;
+    return q;
 }
 
 QofBook *
 get_random_book (void)
 {
-  QofBook *book;
+    QofBook *book;
 
-  book = qof_book_new ();
+    book = qof_book_new ();
 
-  get_random_account_tree (book);
-  get_random_pricedb (book);
+    get_random_account_tree (book);
+    get_random_pricedb (book);
 
-  return book;
+    return book;
 }
 
 QofSession *
 get_random_session (void)
 {
-  QofSession *session;
-  QofBook *book;
+    QofSession *session;
+    QofBook *book;
 
-  session = qof_session_new ();
+    session = qof_session_new ();
 
-  book = qof_session_get_book (session);
+    book = qof_session_get_book (session);
 
-  get_random_account_tree (book);
-  get_random_pricedb (book);
+    get_random_account_tree (book);
+    get_random_pricedb (book);
 
-  return session;
+    return session;
 }
 
 void
 add_random_transactions_to_book (QofBook *book, gint num_transactions)
 {
-  gnc_commodity_table *table;
-  GList *accounts;
+    gnc_commodity_table *table;
+    GList *accounts;
 
-  if (num_transactions <= 0) return;
+    if (num_transactions <= 0) return;
 
-  g_return_if_fail (book);
+    g_return_if_fail (book);
 
-  accounts = gnc_account_get_descendants (gnc_book_get_root_account (book));
-  g_return_if_fail (accounts);
+    accounts = gnc_account_get_descendants (gnc_book_get_root_account (book));
+    g_return_if_fail (accounts);
 
-  table = gnc_commodity_table_get_table (book);
+    table = gnc_commodity_table_get_table (book);
 
-  while (num_transactions--)
-  {
-    gnc_commodity *com;
-    Transaction *trans;
+    while (num_transactions--)
+    {
+        gnc_commodity *com;
+        Transaction *trans;
 
-    com = get_random_commodity_from_table (table);
-    trans = get_random_transaction_with_currency (book, com, accounts);
-  }
-  g_list_free (accounts);
+        com = get_random_commodity_from_table (table);
+        trans = get_random_transaction_with_currency (book, com, accounts);
+    }
+    g_list_free (accounts);
 }
 
 void
 make_random_changes_to_book (QofBook *book)
 {
-  g_return_if_fail (book);
+    g_return_if_fail (book);
 
-  make_random_changes_to_level (book, gnc_book_get_root_account (book));
-  make_random_changes_to_pricedb (book, gnc_pricedb_get_db (book));
+    make_random_changes_to_level (book, gnc_book_get_root_account (book));
+    make_random_changes_to_pricedb (book, gnc_pricedb_get_db (book));
 
 #if 0
-  make_random_changes_to_commodity_table (gnc_commodity_table_get_table (book));
+    make_random_changes_to_commodity_table (gnc_commodity_table_get_table (book));
 #endif
 }
 
 void
 make_random_changes_to_session (QofSession *session)
 {
-  g_return_if_fail (session);
+    g_return_if_fail (session);
 
-  make_random_changes_to_book (qof_session_get_book (session));
+    make_random_changes_to_book (qof_session_get_book (session));
 }
 
 typedef struct
 {
-  QofIdType where;
-  GSList *path;
-  Query *q;
+    QofIdType where;
+    GSList *path;
+    Query *q;
 } KVPQueryData;
 
 static void
 add_kvp_value_query (const char *key, KvpValue *value, gpointer data)
 {
-  KVPQueryData *kqd = data;
-  GSList *node;
+    KVPQueryData *kqd = data;
+    GSList *node;
 
-  kqd->path = g_slist_append (kqd->path, (gpointer) key);
+    kqd->path = g_slist_append (kqd->path, (gpointer) key);
 
-  if (kvp_value_get_type (value) == KVP_TYPE_FRAME)
-    kvp_frame_for_each_slot (kvp_value_get_frame (value),
-                             add_kvp_value_query, data);
-  else
-    xaccQueryAddKVPMatch (kqd->q, kqd->path, value,
-                          QOF_COMPARE_EQUAL, kqd->where,
-                          QOF_QUERY_AND);
+    if (kvp_value_get_type (value) == KVP_TYPE_FRAME)
+        kvp_frame_for_each_slot (kvp_value_get_frame (value),
+                                 add_kvp_value_query, data);
+    else
+        xaccQueryAddKVPMatch (kqd->q, kqd->path, value,
+                              QOF_COMPARE_EQUAL, kqd->where,
+                              QOF_QUERY_AND);
 
-  node = g_slist_last (kqd->path);
-  kqd->path = g_slist_remove_link (kqd->path, node);
-  g_slist_free_1 (node);
+    node = g_slist_last (kqd->path);
+    kqd->path = g_slist_remove_link (kqd->path, node);
+    g_slist_free_1 (node);
 }
 
 static void
 add_kvp_query (Query *q, KvpFrame *frame, QofIdType where)
 {
-  KVPQueryData kqd;
+    KVPQueryData kqd;
 
-  kqd.where = where;
-  kqd.path = NULL;
-  kqd.q = q;
+    kqd.where = where;
+    kqd.path = NULL;
+    kqd.q = q;
 
-  kvp_frame_for_each_slot (frame, add_kvp_value_query, &kqd);
+    kvp_frame_for_each_slot (frame, add_kvp_value_query, &kqd);
 }
 
 static gboolean include_price = TRUE;
@@ -1975,229 +2013,235 @@
 void
 trans_query_include_price (gboolean include_price_in)
 {
-  include_price = include_price_in;
+    include_price = include_price_in;
 }
 
 TestQueryTypes
 get_random_query_type (void)
 {
-  switch (get_random_int_in_range (0, 4))
-  {
-    case 0: return SIMPLE_QT;
-    case 1: return SPLIT_KVP_QT;
-    case 2: return TRANS_KVP_QT;
-    case 3: return ACCOUNT_KVP_QT;
-    case 4: return GUID_QT;
-    default: return SIMPLE_QT;
-  }
+    switch (get_random_int_in_range (0, 4))
+    {
+    case 0:
+        return SIMPLE_QT;
+    case 1:
+        return SPLIT_KVP_QT;
+    case 2:
+        return TRANS_KVP_QT;
+    case 3:
+        return ACCOUNT_KVP_QT;
+    case 4:
+        return GUID_QT;
+    default:
+        return SIMPLE_QT;
+    }
 }
 
 Query *
 make_trans_query (Transaction *trans, TestQueryTypes query_types)
 {
-  Account *a;
-  gnc_numeric n;
-  Query *q;
-  Split *s;
+    Account *a;
+    gnc_numeric n;
+    Query *q;
+    Split *s;
 
-  if (query_types == RANDOM_QT)
-    query_types = get_random_query_type ();
+    if (query_types == RANDOM_QT)
+        query_types = get_random_query_type ();
 
-  q = xaccMallocQuery ();
+    q = xaccMallocQuery ();
 
-  s = xaccTransGetSplit (trans, 0);
-  a = xaccSplitGetAccount (s);
+    s = xaccTransGetSplit (trans, 0);
+    a = xaccSplitGetAccount (s);
 
-  if (query_types & SIMPLE_QT)
-  {
-    xaccQueryAddSingleAccountMatch (q, xaccSplitGetAccount (s), QOF_QUERY_AND);
-
-    if (xaccTransGetDescription(trans) && *xaccTransGetDescription(trans) != '\0')
+    if (query_types & SIMPLE_QT)
     {
-      xaccQueryAddDescriptionMatch (q, xaccTransGetDescription (trans),
-                                    TRUE, FALSE, QOF_QUERY_AND);
-    }
+        xaccQueryAddSingleAccountMatch (q, xaccSplitGetAccount (s), QOF_QUERY_AND);
 
-    if (xaccTransGetNum(trans) && *xaccTransGetNum(trans) != '\0')
-    {
-      xaccQueryAddNumberMatch (q, xaccTransGetNum (trans),
-                               TRUE, FALSE, QOF_QUERY_AND);
-    }
-     
-    if (xaccSplitGetAction(s) && *xaccSplitGetAction(s) != '\0')
-    {
-      xaccQueryAddActionMatch (q, xaccSplitGetAction (s),
-                               TRUE, FALSE, QOF_QUERY_AND);
-    }
+        if (xaccTransGetDescription(trans) && *xaccTransGetDescription(trans) != '\0')
+        {
+            xaccQueryAddDescriptionMatch (q, xaccTransGetDescription (trans),
+                                          TRUE, FALSE, QOF_QUERY_AND);
+        }
 
-    n = xaccSplitGetValue (s);
-    xaccQueryAddValueMatch (q, n, QOF_NUMERIC_MATCH_ANY,
-                              QOF_COMPARE_EQUAL, QOF_QUERY_AND);
+        if (xaccTransGetNum(trans) && *xaccTransGetNum(trans) != '\0')
+        {
+            xaccQueryAddNumberMatch (q, xaccTransGetNum (trans),
+                                     TRUE, FALSE, QOF_QUERY_AND);
+        }
 
-    n = xaccSplitGetAmount (s);
-    xaccQueryAddSharesMatch (q, n, QOF_COMPARE_EQUAL, QOF_QUERY_AND);
+        if (xaccSplitGetAction(s) && *xaccSplitGetAction(s) != '\0')
+        {
+            xaccQueryAddActionMatch (q, xaccSplitGetAction (s),
+                                     TRUE, FALSE, QOF_QUERY_AND);
+        }
 
-    if (include_price)
-    {
-      n = xaccSplitGetSharePrice (s);
-      xaccQueryAddSharePriceMatch (q, n, QOF_COMPARE_EQUAL, QOF_QUERY_AND);
-    }
+        n = xaccSplitGetValue (s);
+        xaccQueryAddValueMatch (q, n, QOF_NUMERIC_MATCH_ANY,
+                                QOF_COMPARE_EQUAL, QOF_QUERY_AND);
 
-    {
-      Timespec ts;
+        n = xaccSplitGetAmount (s);
+        xaccQueryAddSharesMatch (q, n, QOF_COMPARE_EQUAL, QOF_QUERY_AND);
 
-      xaccTransGetDatePostedTS (trans, &ts);
-      xaccQueryAddDateMatchTS (q, TRUE, ts, TRUE, ts, QOF_QUERY_AND);
-    }
+        if (include_price)
+        {
+            n = xaccSplitGetSharePrice (s);
+            xaccQueryAddSharePriceMatch (q, n, QOF_COMPARE_EQUAL, QOF_QUERY_AND);
+        }
 
-    if (xaccSplitGetMemo(s) && *xaccSplitGetMemo(s) != '\0')
-    {
-      xaccQueryAddMemoMatch (q, xaccSplitGetMemo (s), TRUE, FALSE, QOF_QUERY_AND);
+        {
+            Timespec ts;
+
+            xaccTransGetDatePostedTS (trans, &ts);
+            xaccQueryAddDateMatchTS (q, TRUE, ts, TRUE, ts, QOF_QUERY_AND);
+        }
+
+        if (xaccSplitGetMemo(s) && *xaccSplitGetMemo(s) != '\0')
+        {
+            xaccQueryAddMemoMatch (q, xaccSplitGetMemo (s), TRUE, FALSE, QOF_QUERY_AND);
+        }
+
+        {
+            cleared_match_t how;
+
+            switch (xaccSplitGetReconcile (s))
+            {
+            case NREC:
+                how = CLEARED_NO;
+                break;
+            case CREC:
+                how = CLEARED_CLEARED;
+                break;
+            case YREC:
+                how = CLEARED_RECONCILED;
+                break;
+            case FREC:
+                how = CLEARED_FROZEN;
+                break;
+            case VREC:
+                how = CLEARED_VOIDED;
+                break;
+            default:
+                failure ("bad reconcile flag");
+                xaccFreeQuery (q);
+                return NULL;
+            }
+
+            xaccQueryAddClearedMatch (q, how, QOF_QUERY_AND);
+        }
     }
 
+    if (query_types & ACCOUNT_QT)
     {
-      cleared_match_t how;
+        GList * list;
+        GList * node;
 
-      switch (xaccSplitGetReconcile (s))
-      {
-        case NREC:
-          how = CLEARED_NO;
-          break;
-        case CREC:
-          how = CLEARED_CLEARED;
-          break;
-        case YREC:
-          how = CLEARED_RECONCILED;
-          break;
-        case FREC:
-          how = CLEARED_FROZEN;
-          break;
-        case VREC:
-          how = CLEARED_VOIDED;
-          break;
-        default:
-          failure ("bad reconcile flag");
-          xaccFreeQuery (q);
-          return NULL;
-      }
+        /* GUID_MATCH_ALL */
+        list = NULL;
+        for (node = xaccTransGetSplitList (trans); node; node = node->next)
+        {
+            Split * split = node->data;
+            list = g_list_prepend (list, xaccSplitGetAccount (split));
+        }
+        xaccQueryAddAccountMatch (q, list, QOF_GUID_MATCH_ALL, QOF_QUERY_AND);
+        g_list_free (list);
 
-      xaccQueryAddClearedMatch (q, how, QOF_QUERY_AND);
-    }
-  }
+        /* GUID_MATCH_NONE */
+        list = NULL;
+        list = g_list_prepend (list, get_random_guid ());
+        list = g_list_prepend (list, get_random_guid ());
+        list = g_list_prepend (list, get_random_guid ());
+        xaccQueryAddAccountGUIDMatch (q, list, QOF_GUID_MATCH_NONE, QOF_QUERY_AND);
 
-  if (query_types & ACCOUNT_QT)
-  {
-    GList * list;
-    GList * node;
+        /* GUID_MATCH_ANY */
+        {
+            GUID * guid = get_random_guid ();
+            *guid = *xaccAccountGetGUID (a);
+            list = g_list_prepend (list, guid);
+        }
+        xaccQueryAddAccountGUIDMatch (q, list, QOF_GUID_MATCH_ANY, QOF_QUERY_AND);
 
-    /* GUID_MATCH_ALL */
-    list = NULL;
-    for (node = xaccTransGetSplitList (trans); node; node = node->next)
-    {
-      Split * split = node->data;
-      list = g_list_prepend (list, xaccSplitGetAccount (split));
+        for (node = list; node; node = node->next)
+            g_free (node->data);
+        g_list_free (list);
     }
-    xaccQueryAddAccountMatch (q, list, QOF_GUID_MATCH_ALL, QOF_QUERY_AND);
-    g_list_free (list);
 
-    /* GUID_MATCH_NONE */
-    list = NULL;
-    list = g_list_prepend (list, get_random_guid ());
-    list = g_list_prepend (list, get_random_guid ());
-    list = g_list_prepend (list, get_random_guid ());
-    xaccQueryAddAccountGUIDMatch (q, list, QOF_GUID_MATCH_NONE, QOF_QUERY_AND);
-
-    /* GUID_MATCH_ANY */
+    if (query_types & GUID_QT)
     {
-      GUID * guid = get_random_guid ();
-      *guid = *xaccAccountGetGUID (a);
-      list = g_list_prepend (list, guid);
-    }
-    xaccQueryAddAccountGUIDMatch (q, list, QOF_GUID_MATCH_ANY, QOF_QUERY_AND);
+        xaccQueryAddGUIDMatch (q, xaccSplitGetGUID (s),
+                               GNC_ID_SPLIT, QOF_QUERY_AND);
 
-    for (node = list; node; node = node->next)
-      g_free (node->data);
-    g_list_free (list);
-  }
+        xaccQueryAddGUIDMatch (q, xaccTransGetGUID (trans),
+                               GNC_ID_TRANS, QOF_QUERY_AND);
 
-  if (query_types & GUID_QT)
-  {
-    xaccQueryAddGUIDMatch (q, xaccSplitGetGUID (s),
-                           GNC_ID_SPLIT, QOF_QUERY_AND);
+        xaccQueryAddGUIDMatch (q, xaccAccountGetGUID (a),
+                               GNC_ID_ACCOUNT, QOF_QUERY_AND);
+    }
 
-    xaccQueryAddGUIDMatch (q, xaccTransGetGUID (trans),
-                           GNC_ID_TRANS, QOF_QUERY_AND);
+    if (query_types & SPLIT_KVP_QT)
+        add_kvp_query (q, xaccSplitGetSlots (s), GNC_ID_SPLIT);
 
-    xaccQueryAddGUIDMatch (q, xaccAccountGetGUID (a),
-                           GNC_ID_ACCOUNT, QOF_QUERY_AND);
-  }
+    if (query_types & TRANS_KVP_QT)
+        add_kvp_query (q, xaccTransGetSlots (trans), GNC_ID_TRANS);
 
-  if (query_types & SPLIT_KVP_QT)
-    add_kvp_query (q, xaccSplitGetSlots (s), GNC_ID_SPLIT);
+    if (query_types & ACCOUNT_KVP_QT)
+        add_kvp_query (q, xaccAccountGetSlots (a), GNC_ID_ACCOUNT);
 
-  if (query_types & TRANS_KVP_QT)
-    add_kvp_query (q, xaccTransGetSlots (trans), GNC_ID_TRANS);
-
-  if (query_types & ACCOUNT_KVP_QT)
-    add_kvp_query (q, xaccAccountGetSlots (a), GNC_ID_ACCOUNT);
-
-  return q;
+    return q;
 }
 
 static Recurrence*
 daily_freq(GDate* start, int multiplier)
 {
-     Recurrence *r = g_new0(Recurrence, 1);
-     recurrenceSet(r, multiplier, PERIOD_DAY, start, WEEKEND_ADJ_NONE);
-     return r;
+    Recurrence *r = g_new0(Recurrence, 1);
+    recurrenceSet(r, multiplier, PERIOD_DAY, start, WEEKEND_ADJ_NONE);
+    return r;
 }
 
 static Recurrence*
 once_freq(GDate *when)
 {
-     Recurrence *r = g_new0(Recurrence, 1);
-     recurrenceSet(r, 1, PERIOD_ONCE, when, WEEKEND_ADJ_NONE);
-     return r;
+    Recurrence *r = g_new0(Recurrence, 1);
+    recurrenceSet(r, 1, PERIOD_ONCE, when, WEEKEND_ADJ_NONE);
+    return r;
 }
 
 static SchedXaction*
 add_sx(gchar *name, GDate *start, GDate *end, GDate *last_occur, Recurrence *r)
 {
-     QofBook *book = qof_session_get_book(gnc_get_current_session());
-     SchedXaction *sx = xaccSchedXactionMalloc(book);
-     xaccSchedXactionSetName(sx, name);
-     xaccSchedXactionSetStartDate(sx, start);
-     if (end != NULL)
-          xaccSchedXactionSetEndDate(sx, end);
-     if (last_occur != NULL)
-          xaccSchedXactionSetLastOccurDate(sx, last_occur);
-     {
-         GList *recurrences = NULL;
-         recurrences = g_list_append(recurrences, r);
-         gnc_sx_set_schedule(sx, recurrences);
-     }
+    QofBook *book = qof_session_get_book(gnc_get_current_session());
+    SchedXaction *sx = xaccSchedXactionMalloc(book);
+    xaccSchedXactionSetName(sx, name);
+    xaccSchedXactionSetStartDate(sx, start);
+    if (end != NULL)
+        xaccSchedXactionSetEndDate(sx, end);
+    if (last_occur != NULL)
+        xaccSchedXactionSetLastOccurDate(sx, last_occur);
+    {
+        GList *recurrences = NULL;
+        recurrences = g_list_append(recurrences, r);
+        gnc_sx_set_schedule(sx, recurrences);
+    }
 
-     gnc_sxes_add_sx(gnc_book_get_schedxactions(book), sx);
+    gnc_sxes_add_sx(gnc_book_get_schedxactions(book), sx);
 
-     return sx;
+    return sx;
 }
 
 SchedXaction*
 add_daily_sx(gchar *name, GDate *start, GDate *end, GDate *last_occur)
 {
-     return add_sx(name, start, end, last_occur, daily_freq(start, 1));
+    return add_sx(name, start, end, last_occur, daily_freq(start, 1));
 }
 
 SchedXaction*
 add_once_sx(gchar *name, GDate *when)
 {
-     return add_sx(name, when, NULL, NULL, once_freq(when));
+    return add_sx(name, when, NULL, NULL, once_freq(when));
 }
 
 void
 remove_sx(SchedXaction *sx)
 {
-     QofBook *book = qof_session_get_book(gnc_get_current_session());
-     SchedXactions *sxes = gnc_book_get_schedxactions(book);
-     gnc_sxes_del_sx(sxes, sx);
+    QofBook *book = qof_session_get_book(gnc_get_current_session());
+    SchedXactions *sxes = gnc_book_get_schedxactions(book);
+    gnc_sxes_del_sx(sxes, sx);
 }

Modified: gnucash/trunk/src/engine/test-core/test-engine-stuff.h
===================================================================
--- gnucash/trunk/src/engine/test-core/test-engine-stuff.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/engine/test-core/test-engine-stuff.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -47,21 +47,21 @@
 Split* get_random_split(QofBook *book, Account *account, Transaction *trn);
 Transaction* get_random_transaction(QofBook *book);
 Transaction* get_random_transaction_with_currency(QofBook *book,
-                                                  gnc_commodity *currency,
-                                                  GList *account_list);
+        gnc_commodity *currency,
+        GList *account_list);
 gnc_commodity* get_random_commodity(QofBook *book);
 const char *get_random_commodity_namespace(void);
 
 typedef enum
 {
-  RANDOM_QT      = 0,
-  SIMPLE_QT      = 1 << 0,
-  ACCOUNT_QT     = 1 << 1,
-  SPLIT_KVP_QT   = 1 << 2,
-  TRANS_KVP_QT   = 1 << 3,
-  ACCOUNT_KVP_QT = 1 << 4,
-  GUID_QT        = 1 << 5,
-  ALL_QT         = (1 << 8) - 1
+    RANDOM_QT      = 0,
+    SIMPLE_QT      = 1 << 0,
+    ACCOUNT_QT     = 1 << 1,
+    SPLIT_KVP_QT   = 1 << 2,
+    TRANS_KVP_QT   = 1 << 3,
+    ACCOUNT_KVP_QT = 1 << 4,
+    GUID_QT        = 1 << 5,
+    ALL_QT         = (1 << 8) - 1
 } TestQueryTypes;
 
 Query * get_random_query(void);
@@ -80,10 +80,10 @@
 void make_random_changes_to_pricedb (QofBook *book, GNCPriceDB *pdb);
 void make_random_changes_to_split (Split *split);
 void make_random_changes_to_transaction (QofBook *book,
-                                         Transaction *trans);
+        Transaction *trans);
 void make_random_changes_to_transaction_and_splits (QofBook *book,
-                                                    Transaction *trans,
-                                                    GList *accounts);
+        Transaction *trans,
+        GList *accounts);
 void make_random_changes_to_account (QofBook *book, Account *account);
 void make_random_changes_to_level (QofBook *book, Account *parent);
 void make_random_changes_to_book (QofBook *book);

Modified: gnucash/trunk/src/gnome-search/dialog-search.c
===================================================================
--- gnucash/trunk/src/gnome-search/dialog-search.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/dialog-search.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -49,83 +49,87 @@
 #define DIALOG_SEARCH_CM_CLASS "dialog-search"
 #define KEY_ACTIVE_ONLY "search_for_active_only"
 
-typedef enum {
-  GNC_SEARCH_MATCH_ALL = 0,
-  GNC_SEARCH_MATCH_ANY = 1
+typedef enum
+{
+    GNC_SEARCH_MATCH_ALL = 0,
+    GNC_SEARCH_MATCH_ANY = 1
 } GNCSearchType;
 
-enum search_cols {
-  SEARCH_COL_NAME = 0,
-  SEARCH_COL_POINTER,
-  NUM_SEARCH_COLS
+enum search_cols
+{
+    SEARCH_COL_NAME = 0,
+    SEARCH_COL_POINTER,
+    NUM_SEARCH_COLS
 };
 
-struct _GNCSearchWindow {
-  GtkWidget *	dialog;
-  GtkWidget *	grouping_combo;
-  GtkWidget *	match_all_label;
-  GtkWidget *	criteria_table;
-  GtkWidget *	result_hbox;
+struct _GNCSearchWindow
+{
+    GtkWidget *	dialog;
+    GtkWidget *	grouping_combo;
+    GtkWidget *	match_all_label;
+    GtkWidget *	criteria_table;
+    GtkWidget *	result_hbox;
 
-  /* The "results" sub-window widgets */
-  GtkWidget *	result_list;
-  gpointer	selected_item;
+    /* The "results" sub-window widgets */
+    GtkWidget *	result_list;
+    gpointer	selected_item;
 
-  /* The search_type radio-buttons */
-  GtkWidget *	new_rb;
-  GtkWidget *	narrow_rb;
-  GtkWidget *	add_rb;
-  GtkWidget *	del_rb;
+    /* The search_type radio-buttons */
+    GtkWidget *	new_rb;
+    GtkWidget *	narrow_rb;
+    GtkWidget *	add_rb;
+    GtkWidget *	del_rb;
 
-  GtkWidget *	active_only_check;
+    GtkWidget *	active_only_check;
 
-  /* The Select button */
-  GtkWidget *	select_button;
+    /* The Select button */
+    GtkWidget *	select_button;
 
-  /* The close/cancel buttons */
-  GtkWidget *	close_button;
-  GtkWidget *	cancel_button;
+    /* The close/cancel buttons */
+    GtkWidget *	close_button;
+    GtkWidget *	cancel_button;
 
-  /* Callbacks */
-  GNCSearchResultCB result_cb;
-  GNCSearchNewItemCB new_item_cb;
-  GNCSearchCallbackButton *buttons;
-  GNCSearchFree	free_cb;
-  gpointer		user_data;
+    /* Callbacks */
+    GNCSearchResultCB result_cb;
+    GNCSearchNewItemCB new_item_cb;
+    GNCSearchCallbackButton *buttons;
+    GNCSearchFree	free_cb;
+    gpointer		user_data;
 
-  GNCSearchSelectedCB	selected_cb;
-  gpointer		select_arg;
-  gboolean		allow_clear;
+    GNCSearchSelectedCB	selected_cb;
+    gpointer		select_arg;
+    gboolean		allow_clear;
 
-  /* What we're searching for, and how */
-  const gchar *  type_label;
-  GNCIdTypeConst search_for;
-  GNCSearchType	grouping;	/* Match Any, Match All */
-  const QofParam * get_guid;	/* Function to GetGUID from the object */
-  int		search_type;	/* New, Narrow, Add, Delete */
+    /* What we're searching for, and how */
+    const gchar *  type_label;
+    GNCIdTypeConst search_for;
+    GNCSearchType	grouping;	/* Match Any, Match All */
+    const QofParam * get_guid;	/* Function to GetGUID from the object */
+    int		search_type;	/* New, Narrow, Add, Delete */
 
-  /* Our query status */
-  QueryNew *	q;
-  QueryNew *	start_q;	/* The query to start from, if any */
+    /* Our query status */
+    QueryNew *	q;
+    QueryNew *	start_q;	/* The query to start from, if any */
 
-  /* The list of criteria */
-  GNCSearchParam * last_param;
-  GList *	params_list;	/* List of GNCSearchParams */
-  GList *	display_list;	/* List of GNCSearchParams for Display */
-  gint		num_cols;	/* Number of Display Columns */
-  GList *	crit_list;	/* list of crit_data */
+    /* The list of criteria */
+    GNCSearchParam * last_param;
+    GList *	params_list;	/* List of GNCSearchParams */
+    GList *	display_list;	/* List of GNCSearchParams for Display */
+    gint		num_cols;	/* Number of Display Columns */
+    GList *	crit_list;	/* list of crit_data */
 
-  gint		component_id;
-  const gchar * gconf_section;
+    gint		component_id;
+    const gchar * gconf_section;
 };
 
-struct _crit_data {
-  GNCSearchParam *	param;
-  GNCSearchCoreType *	element;
-  GtkWidget *		elemwidget;
-  GtkWidget *		container;
-  GtkWidget *		button;
-  GtkDialog *		dialog;
+struct _crit_data
+{
+    GNCSearchParam *	param;
+    GNCSearchCoreType *	element;
+    GtkWidget *		elemwidget;
+    GtkWidget *		container;
+    GtkWidget *		button;
+    GtkDialog *		dialog;
 };
 
 static void search_clear_criteria (GNCSearchWindow *sw);
@@ -133,907 +137,939 @@
 
 static void
 gnc_search_callback_button_execute (GNCSearchCallbackButton *cb,
-				    GNCSearchWindow *sw)
+                                    GNCSearchWindow *sw)
 {
-  if (cb->cb_fcn)
-    (cb->cb_fcn)(&(sw->selected_item), sw->user_data);
+    if (cb->cb_fcn)
+        (cb->cb_fcn)(&(sw->selected_item), sw->user_data);
 }
 
 static void
 gnc_search_dialog_result_clicked (GtkButton *button, GNCSearchWindow *sw)
 {
-  GNCSearchCallbackButton *cb;
+    GNCSearchCallbackButton *cb;
 
-  cb = g_object_get_data (G_OBJECT (button), "data");
-  gnc_search_callback_button_execute (cb, sw);
+    cb = g_object_get_data (G_OBJECT (button), "data");
+    gnc_search_callback_button_execute (cb, sw);
 }
 
 static void
 gnc_search_dialog_select_cb (GtkButton *button, GNCSearchWindow *sw)
 {
-  g_return_if_fail (sw->selected_cb);
+    g_return_if_fail (sw->selected_cb);
 
-  if (sw->selected_item == NULL && sw->allow_clear == FALSE) {
-    char *msg = _("You must select an item from the list");
-    gnc_error_dialog (sw->dialog, "%s", msg);
-    return;
-  }
+    if (sw->selected_item == NULL && sw->allow_clear == FALSE)
+    {
+        char *msg = _("You must select an item from the list");
+        gnc_error_dialog (sw->dialog, "%s", msg);
+        return;
+    }
 
-  (sw->selected_cb)(sw->selected_item, sw->select_arg);
-  gnc_search_dialog_destroy (sw);
+    (sw->selected_cb)(sw->selected_item, sw->select_arg);
+    gnc_search_dialog_destroy (sw);
 }
 
 #if 0
 static void
 gnc_search_dialog_line_toggled (GNCQueryList *list, gpointer item,
-				gpointer user_data)
+                                gpointer user_data)
 {
-  GNCSearchWindow *sw = user_data;
-  if (sw->selected_item == item)
-    sw->selected_item = NULL;
-  else
-    sw->selected_item = item;
+    GNCSearchWindow *sw = user_data;
+    if (sw->selected_item == item)
+        sw->selected_item = NULL;
+    else
+        sw->selected_item = item;
 }
 
 static void
 gnc_search_dialog_double_click_entry (GNCQueryList *list, gpointer item,
-				      gpointer user_data)
+                                      gpointer user_data)
 {
-  GNCSearchWindow *sw = user_data;
+    GNCSearchWindow *sw = user_data;
 
-  /* Force the selected item */
-  sw->selected_item = item;
+    /* Force the selected item */
+    sw->selected_item = item;
 
-  /* If we double-click an item, then either "select" it, or run it
-   * through the first button (which should be view/edit
-   */
-  if (sw->selected_cb)
-    /* Select the time */
-    gnc_search_dialog_select_cb (NULL, sw);
-  else if (sw->buttons)
-    /* Call the first button (usually view/edit) */
-    gnc_search_callback_button_execute (sw->buttons, sw);
+    /* If we double-click an item, then either "select" it, or run it
+     * through the first button (which should be view/edit
+     */
+    if (sw->selected_cb)
+        /* Select the time */
+        gnc_search_dialog_select_cb (NULL, sw);
+    else if (sw->buttons)
+        /* Call the first button (usually view/edit) */
+        gnc_search_callback_button_execute (sw->buttons, sw);
 }
 #endif
 
 static void
 gnc_search_dialog_select_row_cb (GtkCList *clist, gint row, gint column,
-				 GdkEventButton *event, gpointer user_data)
+                                 GdkEventButton *event, gpointer user_data)
 {
-  GNCSearchWindow *sw = user_data;
-  sw->selected_item = gtk_clist_get_row_data (clist, row);
+    GNCSearchWindow *sw = user_data;
+    sw->selected_item = gtk_clist_get_row_data (clist, row);
 
-  /* If we double-click an item, then either "select" it, or run it
-   * through the first button (which should be view/edit
-   */
-  if (event && event->type == GDK_2BUTTON_PRESS) {
-    if (sw->selected_cb)
-      /* Select the time */
-      gnc_search_dialog_select_cb (NULL, sw);
-    else if (sw->buttons)
-      /* Call the first button (usually view/edit) */
-      gnc_search_callback_button_execute (sw->buttons, sw);
+    /* If we double-click an item, then either "select" it, or run it
+     * through the first button (which should be view/edit
+     */
+    if (event && event->type == GDK_2BUTTON_PRESS)
+    {
+        if (sw->selected_cb)
+            /* Select the time */
+            gnc_search_dialog_select_cb (NULL, sw);
+        else if (sw->buttons)
+            /* Call the first button (usually view/edit) */
+            gnc_search_callback_button_execute (sw->buttons, sw);
 
-    /* If we get here, then nothing to do for a double-click */
-  }
+        /* If we get here, then nothing to do for a double-click */
+    }
 }
 
 static void
 gnc_search_dialog_unselect_row_cb (GtkCList *clist, gint row, gint column,
-				   GdkEventButton *event, gpointer user_data)
+                                   GdkEventButton *event, gpointer user_data)
 {
-  GNCSearchWindow *sw = user_data;
-  gpointer item = gtk_clist_get_row_data (clist, row);
+    GNCSearchWindow *sw = user_data;
+    gpointer item = gtk_clist_get_row_data (clist, row);
 
-  if (sw->selected_item == item)
-    sw->selected_item = NULL;
+    if (sw->selected_item == item)
+        sw->selected_item = NULL;
 }
 
 static void
 gnc_search_dialog_init_result_list (GNCSearchWindow *sw)
 {
-  sw->result_list = gnc_query_list_new(sw->display_list, sw->q);
+    sw->result_list = gnc_query_list_new(sw->display_list, sw->q);
 
-  /* Setup the list callbacks */
-  g_signal_connect (G_OBJECT (sw->result_list), "select-row",
-		    G_CALLBACK (gnc_search_dialog_select_row_cb), sw);
-  g_signal_connect (G_OBJECT (sw->result_list), "unselect-row",
-		    G_CALLBACK (gnc_search_dialog_unselect_row_cb), sw);
+    /* Setup the list callbacks */
+    g_signal_connect (G_OBJECT (sw->result_list), "select-row",
+                      G_CALLBACK (gnc_search_dialog_select_row_cb), sw);
+    g_signal_connect (G_OBJECT (sw->result_list), "unselect-row",
+                      G_CALLBACK (gnc_search_dialog_unselect_row_cb), sw);
 }
 
 static void
 gnc_search_dialog_display_results (GNCSearchWindow *sw)
 {
-  gdouble max_count;
+    gdouble max_count;
 
-  /* Check if this is the first time this is called for this window.
-   * If so, then build the results sub-window, the scrolled listbox,
-   * and the active buttons.
-   */
-  if (sw->result_list == NULL) {
-    GtkWidget *scroller, *button_box, *button;
+    /* Check if this is the first time this is called for this window.
+     * If so, then build the results sub-window, the scrolled listbox,
+     * and the active buttons.
+     */
+    if (sw->result_list == NULL)
+    {
+        GtkWidget *scroller, *button_box, *button;
 
-    /* Create the list */
-    gnc_search_dialog_init_result_list (sw);
+        /* Create the list */
+        gnc_search_dialog_init_result_list (sw);
 
-    /* Create the scroller and add the list to the scroller */
-    scroller = gtk_scrolled_window_new (NULL, NULL);
-    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroller),
-				    GTK_POLICY_AUTOMATIC,
-				    GTK_POLICY_AUTOMATIC);
-    gtk_widget_set_size_request(GTK_WIDGET(scroller), 300, 100);
-    gtk_container_add (GTK_CONTAINER (scroller), sw->result_list);
+        /* Create the scroller and add the list to the scroller */
+        scroller = gtk_scrolled_window_new (NULL, NULL);
+        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroller),
+                                        GTK_POLICY_AUTOMATIC,
+                                        GTK_POLICY_AUTOMATIC);
+        gtk_widget_set_size_request(GTK_WIDGET(scroller), 300, 100);
+        gtk_container_add (GTK_CONTAINER (scroller), sw->result_list);
 
-    /* Create the button_box */
-    button_box = gtk_vbox_new (FALSE, 3);
+        /* Create the button_box */
+        button_box = gtk_vbox_new (FALSE, 3);
 
-    /* ... and add all the buttons */
-    if (sw->buttons) {
-      int i;
+        /* ... and add all the buttons */
+        if (sw->buttons)
+        {
+            int i;
 
-      button = gtk_button_new_with_label (_("Select"));
-      g_signal_connect (G_OBJECT (button), "clicked",
-			G_CALLBACK (gnc_search_dialog_select_cb), sw);
-      gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 3);
-      sw->select_button = button;
-			  
-      for (i = 0; sw->buttons[i].label; i++) {
-	button = gtk_button_new_with_label (_(sw->buttons[i].label));
-	g_object_set_data (G_OBJECT (button), "data", &(sw->buttons[i]));
-	g_signal_connect (G_OBJECT (button), "clicked",
-			  G_CALLBACK (gnc_search_dialog_result_clicked), sw);
-	gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 3);
-      }
-    }
+            button = gtk_button_new_with_label (_("Select"));
+            g_signal_connect (G_OBJECT (button), "clicked",
+                              G_CALLBACK (gnc_search_dialog_select_cb), sw);
+            gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 3);
+            sw->select_button = button;
 
-    /* Add the scrolled-list and button-box to the results_box */
-    gtk_box_pack_end (GTK_BOX (sw->result_hbox), button_box, FALSE, FALSE, 3);
-    gtk_box_pack_end (GTK_BOX (sw->result_hbox), scroller, TRUE, TRUE, 3);
+            for (i = 0; sw->buttons[i].label; i++)
+            {
+                button = gtk_button_new_with_label (_(sw->buttons[i].label));
+                g_object_set_data (G_OBJECT (button), "data", &(sw->buttons[i]));
+                g_signal_connect (G_OBJECT (button), "clicked",
+                                  G_CALLBACK (gnc_search_dialog_result_clicked), sw);
+                gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 3);
+            }
+        }
 
-    /* And show the results */
-    gtk_widget_show_all (sw->result_hbox);
+        /* Add the scrolled-list and button-box to the results_box */
+        gtk_box_pack_end (GTK_BOX (sw->result_hbox), button_box, FALSE, FALSE, 3);
+        gtk_box_pack_end (GTK_BOX (sw->result_hbox), scroller, TRUE, TRUE, 3);
 
-    /* But maybe hide the select button */
-    if (!sw->selected_cb)
-      gtk_widget_hide (sw->select_button);
-  }
+        /* And show the results */
+        gtk_widget_show_all (sw->result_hbox);
 
-  /* Update the query in the list */
-  gnc_query_list_reset_query (GNC_QUERY_LIST(sw->result_list), sw->q);
+        /* But maybe hide the select button */
+        if (!sw->selected_cb)
+            gtk_widget_hide (sw->select_button);
+    }
 
-  /* set 'new search' if fewer than max_count items is returned. */
-  max_count = gnc_gconf_get_float("dialogs/search", "new_search_limit", NULL);
-  if (gnc_query_list_get_num_entries(GNC_QUERY_LIST(sw->result_list)) < max_count)
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->new_rb), TRUE);
+    /* Update the query in the list */
+    gnc_query_list_reset_query (GNC_QUERY_LIST(sw->result_list), sw->q);
+
+    /* set 'new search' if fewer than max_count items is returned. */
+    max_count = gnc_gconf_get_float("dialogs/search", "new_search_limit", NULL);
+    if (gnc_query_list_get_num_entries(GNC_QUERY_LIST(sw->result_list)) < max_count)
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->new_rb), TRUE);
 }
 
 static void
 match_combo_changed (GtkComboBox *combo_box, GNCSearchWindow *sw)
 {
-  sw->grouping = gtk_combo_box_get_active(combo_box);
+    sw->grouping = gtk_combo_box_get_active(combo_box);
 }
 
 static void
 search_type_cb (GtkToggleButton *button, GNCSearchWindow *sw)
 {
-  GSList * buttongroup = gtk_radio_button_get_group (GTK_RADIO_BUTTON(button));
+    GSList * buttongroup = gtk_radio_button_get_group (GTK_RADIO_BUTTON(button));
 
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
-    sw->search_type =
-      g_slist_length (buttongroup) - g_slist_index (buttongroup, button) - 1;
-  }
+    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
+    {
+        sw->search_type =
+            g_slist_length (buttongroup) - g_slist_index (buttongroup, button) - 1;
+    }
 }
 
 static void
 search_active_only_cb (GtkToggleButton *button, GNCSearchWindow *sw)
 {
 
-  gnc_gconf_set_bool(sw->gconf_section, KEY_ACTIVE_ONLY,
-		     gtk_toggle_button_get_active (button), NULL);
+    gnc_gconf_set_bool(sw->gconf_section, KEY_ACTIVE_ONLY,
+                       gtk_toggle_button_get_active (button), NULL);
 }
 
 static void
 search_update_query (GNCSearchWindow *sw)
 {
-  static GSList *active_params = NULL;
-  QueryNew *q, *q2, *new_q;
-  GList *node;
-  QueryOp op;
-  QueryPredData_t pdata;
+    static GSList *active_params = NULL;
+    QueryNew *q, *q2, *new_q;
+    GList *node;
+    QueryOp op;
+    QueryPredData_t pdata;
 
-  if (sw->grouping == GNC_SEARCH_MATCH_ANY)
-    op = QUERY_OR;
-  else
-    op = QUERY_AND;
+    if (sw->grouping == GNC_SEARCH_MATCH_ANY)
+        op = QUERY_OR;
+    else
+        op = QUERY_AND;
 
-  if (active_params == NULL)
-    active_params = g_slist_prepend (NULL, QUERY_PARAM_ACTIVE);
+    if (active_params == NULL)
+        active_params = g_slist_prepend (NULL, QUERY_PARAM_ACTIVE);
 
-  /* Make sure we supply a book! */
-  if (sw->start_q == NULL) {
-    sw->start_q = gncQueryCreateFor (sw->search_for);
-    gncQuerySetBook (sw->start_q, gnc_get_current_book ());
-  } else {
-    /* We've got a query -- purge it of any "active" parameters */
-    gncQueryPurgeTerms (sw->start_q, active_params);
-  }
+    /* Make sure we supply a book! */
+    if (sw->start_q == NULL)
+    {
+        sw->start_q = gncQueryCreateFor (sw->search_for);
+        gncQuerySetBook (sw->start_q, gnc_get_current_book ());
+    }
+    else
+    {
+        /* We've got a query -- purge it of any "active" parameters */
+        gncQueryPurgeTerms (sw->start_q, active_params);
+    }
 
-  /* Now create a new query to work from */
-  q = gncQueryCreateFor (sw->search_for);
+    /* Now create a new query to work from */
+    q = gncQueryCreateFor (sw->search_for);
 
-  /* Walk the list of criteria */
-  for (node = sw->crit_list; node; node = node->next) {
-    struct _crit_data *data = node->data;
+    /* Walk the list of criteria */
+    for (node = sw->crit_list; node; node = node->next)
+    {
+        struct _crit_data *data = node->data;
 
-    pdata = gnc_search_core_type_get_predicate (data->element);
-    if (pdata)
-      gncQueryAddTerm (q, gnc_search_param_get_param_path (data->param),
-		       pdata, op);
-  }
+        pdata = gnc_search_core_type_get_predicate (data->element);
+        if (pdata)
+            gncQueryAddTerm (q, gnc_search_param_get_param_path (data->param),
+                             pdata, op);
+    }
 
-  /* Now combine this query with the existing query, depending on
-   * what we want to do...  We can assume that cases 1, 2, and 3
-   * already have sw->q being valid!
-   */
+    /* Now combine this query with the existing query, depending on
+     * what we want to do...  We can assume that cases 1, 2, and 3
+     * already have sw->q being valid!
+     */
 
-  switch (sw->search_type) {
-  case 0:			/* New */
-    new_q = gncQueryMerge (sw->start_q, q, QUERY_AND);
-    gncQueryDestroy (q);
-    break;
-  case 1:			/* Refine */
-    new_q = gncQueryMerge (sw->q, q, QUERY_AND);
-    gncQueryDestroy (q);
-    break;
-  case 2:			/* Add */
-    new_q = gncQueryMerge (sw->q, q, QUERY_OR);
-    gncQueryDestroy (q);
-    break;
-  case 3:			/* Delete */
-    q2 = gncQueryInvert (q);
-    new_q = gncQueryMerge (sw->q, q2, QUERY_AND);
-    gncQueryDestroy (q2);
-    gncQueryDestroy (q);
-    break;
-  default:
-    g_warning ("bad search type: %d", sw->search_type);
-    new_q = q;
-    break;
-  }
+    switch (sw->search_type)
+    {
+    case 0:			/* New */
+        new_q = gncQueryMerge (sw->start_q, q, QUERY_AND);
+        gncQueryDestroy (q);
+        break;
+    case 1:			/* Refine */
+        new_q = gncQueryMerge (sw->q, q, QUERY_AND);
+        gncQueryDestroy (q);
+        break;
+    case 2:			/* Add */
+        new_q = gncQueryMerge (sw->q, q, QUERY_OR);
+        gncQueryDestroy (q);
+        break;
+    case 3:			/* Delete */
+        q2 = gncQueryInvert (q);
+        new_q = gncQueryMerge (sw->q, q2, QUERY_AND);
+        gncQueryDestroy (q2);
+        gncQueryDestroy (q);
+        break;
+    default:
+        g_warning ("bad search type: %d", sw->search_type);
+        new_q = q;
+        break;
+    }
 
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sw->active_only_check))) {
-    gncQueryAddBooleanMatch (new_q, active_params, TRUE, QUERY_AND);
-    active_params = NULL;
-  }
+    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sw->active_only_check)))
+    {
+        gncQueryAddBooleanMatch (new_q, active_params, TRUE, QUERY_AND);
+        active_params = NULL;
+    }
 
-  /* Destroy the old query */
-  if (sw->q)
-    gncQueryDestroy (sw->q);
+    /* Destroy the old query */
+    if (sw->q)
+        gncQueryDestroy (sw->q);
 
-  /* And save the new one */
-  sw->q = new_q;
+    /* And save the new one */
+    sw->q = new_q;
 }
 
 static void
 gnc_search_dialog_show_close_cancel (GNCSearchWindow *sw)
 {
-  if (sw->selected_cb) {
-    gtk_widget_show (sw->cancel_button);
-    gtk_widget_hide (sw->close_button);
-  } else {
-    gtk_widget_hide (sw->cancel_button);
-    gtk_widget_show (sw->close_button);
-  }
+    if (sw->selected_cb)
+    {
+        gtk_widget_show (sw->cancel_button);
+        gtk_widget_hide (sw->close_button);
+    }
+    else
+    {
+        gtk_widget_hide (sw->cancel_button);
+        gtk_widget_show (sw->close_button);
+    }
 }
 
 static void
 gnc_search_dialog_reset_widgets (GNCSearchWindow *sw)
 {
-  gboolean sens = (sw->q != NULL);
+    gboolean sens = (sw->q != NULL);
 
-  gtk_widget_set_sensitive(GTK_WIDGET(sw->narrow_rb), sens);
-  gtk_widget_set_sensitive(GTK_WIDGET(sw->add_rb), sens);
-  gtk_widget_set_sensitive(GTK_WIDGET(sw->del_rb), sens);
+    gtk_widget_set_sensitive(GTK_WIDGET(sw->narrow_rb), sens);
+    gtk_widget_set_sensitive(GTK_WIDGET(sw->add_rb), sens);
+    gtk_widget_set_sensitive(GTK_WIDGET(sw->del_rb), sens);
 
-  if (sw->q) {
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->new_rb), FALSE);
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->narrow_rb), TRUE);
-  }
+    if (sw->q)
+    {
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->new_rb), FALSE);
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->narrow_rb), TRUE);
+    }
 
-  if (sw->crit_list) {
-    gtk_widget_set_sensitive(sw->grouping_combo, TRUE);
-    gtk_widget_hide(sw->match_all_label);
-  } else {
-    gtk_widget_set_sensitive(sw->grouping_combo, FALSE);
-    gtk_widget_show(sw->match_all_label);
-  }
+    if (sw->crit_list)
+    {
+        gtk_widget_set_sensitive(sw->grouping_combo, TRUE);
+        gtk_widget_hide(sw->match_all_label);
+    }
+    else
+    {
+        gtk_widget_set_sensitive(sw->grouping_combo, FALSE);
+        gtk_widget_show(sw->match_all_label);
+    }
 }
 
 static gboolean
 gnc_search_dialog_crit_ok (GNCSearchWindow *sw)
 {
-  struct _crit_data *data;
-  GList *l;
-  gboolean ret;
+    struct _crit_data *data;
+    GList *l;
+    gboolean ret;
 
-  if (!sw->crit_list)
-    return TRUE;
+    if (!sw->crit_list)
+        return TRUE;
 
-  l = g_list_last (sw->crit_list);
-  data = l->data;
-  ret = gnc_search_core_type_validate (data->element);
+    l = g_list_last (sw->crit_list);
+    data = l->data;
+    ret = gnc_search_core_type_validate (data->element);
 
-  if (ret)
-    sw->last_param = data->param;
+    if (ret)
+        sw->last_param = data->param;
 
-  return ret;
+    return ret;
 }
 
 static void
 search_find_cb (GtkButton *button, GNCSearchWindow *sw)
 {
-  if (!gnc_search_dialog_crit_ok (sw))
-    return;
+    if (!gnc_search_dialog_crit_ok (sw))
+        return;
 
-  search_update_query (sw);
-  search_clear_criteria (sw);
-  gnc_search_dialog_reset_widgets (sw);
+    search_update_query (sw);
+    search_clear_criteria (sw);
+    gnc_search_dialog_reset_widgets (sw);
 
-  if (sw->result_cb)
-    (sw->result_cb)(sw->q, sw->user_data, &(sw->selected_item));
-  else
-    gnc_search_dialog_display_results (sw);
+    if (sw->result_cb)
+        (sw->result_cb)(sw->q, sw->user_data, &(sw->selected_item));
+    else
+        gnc_search_dialog_display_results (sw);
 }
 
 static void
 search_new_item_cb (GtkButton *button, GNCSearchWindow *sw)
 {
-  gpointer res;
+    gpointer res;
 
-  g_return_if_fail (sw->new_item_cb);
+    g_return_if_fail (sw->new_item_cb);
 
-  res = (sw->new_item_cb)(sw->user_data);
+    res = (sw->new_item_cb)(sw->user_data);
 
-  if (res) 
-  {
-    const GUID *guid = (const GUID *) ((sw->get_guid->param_getfcn)(res, sw->get_guid));
-    QueryOp op = QUERY_OR;
+    if (res)
+    {
+        const GUID *guid = (const GUID *) ((sw->get_guid->param_getfcn)(res, sw->get_guid));
+        QueryOp op = QUERY_OR;
 
-    if (!sw->q) {
-      if (!sw->start_q) {
-        sw->start_q = gncQueryCreateFor (sw->search_for);
-        gncQuerySetBook (sw->start_q, gnc_get_current_book ());
-      }
-      sw->q = gncQueryCopy (sw->start_q);
-      op = QUERY_AND;
-    }
+        if (!sw->q)
+        {
+            if (!sw->start_q)
+            {
+                sw->start_q = gncQueryCreateFor (sw->search_for);
+                gncQuerySetBook (sw->start_q, gnc_get_current_book ());
+            }
+            sw->q = gncQueryCopy (sw->start_q);
+            op = QUERY_AND;
+        }
 
-    gncQueryAddGUIDMatch (sw->q, g_slist_prepend (NULL, QUERY_PARAM_GUID),
-			  guid, op);
+        gncQueryAddGUIDMatch (sw->q, g_slist_prepend (NULL, QUERY_PARAM_GUID),
+                              guid, op);
 
-    /* Watch this entity so we'll refresh once it's actually changed */
-    gnc_gui_component_watch_entity (sw->component_id, guid, QOF_EVENT_MODIFY);
-  }
+        /* Watch this entity so we'll refresh once it's actually changed */
+        gnc_gui_component_watch_entity (sw->component_id, guid, QOF_EVENT_MODIFY);
+    }
 }
 
 static void
 search_cancel_cb (GtkButton *button, GNCSearchWindow *sw)
 {
-  /* Don't select anything */
-  sw->selected_item = NULL;
-  gnc_search_dialog_destroy (sw);
+    /* Don't select anything */
+    sw->selected_item = NULL;
+    gnc_search_dialog_destroy (sw);
 }
 
 static void
 search_help_cb (GtkButton *button, GNCSearchWindow *sw)
 {
-  gnc_gnome_help (HF_HELP, HL_FIND_TRANSACTIONS);
+    gnc_gnome_help (HF_HELP, HL_FIND_TRANSACTIONS);
 }
 
 static void
 remove_element (GtkWidget *button, GNCSearchWindow *sw)
 {
-  GtkWidget *element;
-  struct _elem_data *data;
+    GtkWidget *element;
+    struct _elem_data *data;
 
-  if (!sw->crit_list)
-    return;
+    if (!sw->crit_list)
+        return;
 
-  element = g_object_get_data (G_OBJECT (button), "element");
-  data = g_object_get_data (G_OBJECT (element), "data");
+    element = g_object_get_data (G_OBJECT (button), "element");
+    data = g_object_get_data (G_OBJECT (element), "data");
 
-  /* remove the element from the list */
-  sw->crit_list = g_list_remove (sw->crit_list, data);
+    /* remove the element from the list */
+    sw->crit_list = g_list_remove (sw->crit_list, data);
 
-  /* and from the display */
-  gtk_container_remove (GTK_CONTAINER (sw->criteria_table), element);
-  gtk_container_remove (GTK_CONTAINER (sw->criteria_table), button);
+    /* and from the display */
+    gtk_container_remove (GTK_CONTAINER (sw->criteria_table), element);
+    gtk_container_remove (GTK_CONTAINER (sw->criteria_table), button);
 
-  /* disable match-type menu when there is no criterion */
-  if (!sw->crit_list) {
-    gtk_widget_set_sensitive(sw->grouping_combo, FALSE);
-    gtk_widget_show(sw->match_all_label);
-  }
+    /* disable match-type menu when there is no criterion */
+    if (!sw->crit_list)
+    {
+        gtk_widget_set_sensitive(sw->grouping_combo, FALSE);
+        gtk_widget_show(sw->match_all_label);
+    }
 }
 
 static void
 attach_element (GtkWidget *element, GNCSearchWindow *sw, int row)
 {
-  GtkWidget *remove;
-  struct _crit_data *data;
+    GtkWidget *remove;
+    struct _crit_data *data;
 
-  data = g_object_get_data (G_OBJECT (element), "data");
+    data = g_object_get_data (G_OBJECT (element), "data");
 
-  gtk_table_attach (GTK_TABLE (sw->criteria_table), element, 0, 1, row, row+1,
-		    GTK_EXPAND | GTK_FILL, 0, 0, 0);
+    gtk_table_attach (GTK_TABLE (sw->criteria_table), element, 0, 1, row, row + 1,
+                      GTK_EXPAND | GTK_FILL, 0, 0, 0);
 
-  
-  remove = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
-  g_object_set_data (G_OBJECT (remove), "element", element);
-  g_signal_connect (G_OBJECT (remove), "clicked", G_CALLBACK (remove_element), sw);
-  gtk_table_attach (GTK_TABLE (sw->criteria_table), remove, 1, 2, row, row+1,
-		    0, 0, 0, 0);
-  gtk_widget_show (remove);
-  data->button = remove;	/* Save the button for later */
+
+    remove = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
+    g_object_set_data (G_OBJECT (remove), "element", element);
+    g_signal_connect (G_OBJECT (remove), "clicked", G_CALLBACK (remove_element), sw);
+    gtk_table_attach (GTK_TABLE (sw->criteria_table), remove, 1, 2, row, row + 1,
+                      0, 0, 0, 0);
+    gtk_widget_show (remove);
+    data->button = remove;	/* Save the button for later */
 }
 
 static void
 combo_box_changed (GtkComboBox *combo_box, struct _crit_data *data)
 {
-  GNCSearchParam *param;
-  GNCSearchCoreType *newelem;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    GNCSearchParam *param;
+    GNCSearchCoreType *newelem;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  if (!gtk_combo_box_get_active_iter(combo_box, &iter))
-    return;
-  model = gtk_combo_box_get_model(combo_box);
-  gtk_tree_model_get(model, &iter, SEARCH_COL_POINTER, &param, -1);
+    if (!gtk_combo_box_get_active_iter(combo_box, &iter))
+        return;
+    model = gtk_combo_box_get_model(combo_box);
+    gtk_tree_model_get(model, &iter, SEARCH_COL_POINTER, &param, -1);
 
-  if (gnc_search_param_type_match (param, data->param)) {
-    /* The param type is the same, just save the new param */
+    if (gnc_search_param_type_match (param, data->param))
+    {
+        /* The param type is the same, just save the new param */
+        data->param = param;
+        return;
+    }
     data->param = param;
-    return;
-  }
-  data->param = param;
 
-  /* OK, let's do a widget shuffle, throw away the old widget/element,
-   * and create another one here.  No need to change the crit_list --
-   * the pointer to data stays the same.
-   */
-  if (data->elemwidget)
-    gtk_container_remove (GTK_CONTAINER (data->container), data->elemwidget);
-  g_object_unref (G_OBJECT (data->element));
+    /* OK, let's do a widget shuffle, throw away the old widget/element,
+     * and create another one here.  No need to change the crit_list --
+     * the pointer to data stays the same.
+     */
+    if (data->elemwidget)
+        gtk_container_remove (GTK_CONTAINER (data->container), data->elemwidget);
+    g_object_unref (G_OBJECT (data->element));
 
-  newelem = gnc_search_core_type_new_type_name
-    (gnc_search_param_get_param_type (param));
-  data->element = newelem;
-  data->elemwidget = gnc_search_core_type_get_widget (newelem);
-  if (data->elemwidget) {
-    gtk_box_pack_start (GTK_BOX (data->container), data->elemwidget,
-			FALSE, FALSE, 0);
-  }
+    newelem = gnc_search_core_type_new_type_name
+              (gnc_search_param_get_param_type (param));
+    data->element = newelem;
+    data->elemwidget = gnc_search_core_type_get_widget (newelem);
+    if (data->elemwidget)
+    {
+        gtk_box_pack_start (GTK_BOX (data->container), data->elemwidget,
+                            FALSE, FALSE, 0);
+    }
 
-  /* Make sure it's visible */
-  gtk_widget_show_all (data->container);
+    /* Make sure it's visible */
+    gtk_widget_show_all (data->container);
 
-  /* Make sure we widen up if necessary */
-  gtk_widget_queue_resize (GTK_WIDGET (data->dialog));
+    /* Make sure we widen up if necessary */
+    gtk_widget_queue_resize (GTK_WIDGET (data->dialog));
 
-  /* And grab focus */
-  gnc_search_core_type_grab_focus (newelem);
-  gnc_search_core_type_editable_enters (newelem);
+    /* And grab focus */
+    gnc_search_core_type_grab_focus (newelem);
+    gnc_search_core_type_editable_enters (newelem);
 }
 
 static void
 search_clear_criteria (GNCSearchWindow *sw)
 {
-  GList *node;
+    GList *node;
 
-  for (node = sw->crit_list; node; ) {
-    GList *tmp = node->next;
-    struct _crit_data *data = node->data;
-    g_object_ref (data->button);
-    remove_element (data->button, sw);
-    node = tmp;
-  }
+    for (node = sw->crit_list; node; )
+    {
+        GList *tmp = node->next;
+        struct _crit_data *data = node->data;
+        g_object_ref (data->button);
+        remove_element (data->button, sw);
+        node = tmp;
+    }
 }
 
 static GtkWidget *
 get_element_widget (GNCSearchWindow *sw, GNCSearchCoreType *element)
 {
-  GtkWidget *combo_box, *hbox, *p;
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GtkCellRenderer *cell;
-  GList *l;
-  struct _crit_data *data;
-  int index = 0, current = 0;
+    GtkWidget *combo_box, *hbox, *p;
+    GtkListStore *store;
+    GtkTreeIter iter;
+    GtkCellRenderer *cell;
+    GList *l;
+    struct _crit_data *data;
+    int index = 0, current = 0;
 
-  data = g_new0 (struct _crit_data, 1);
-  data->element = element;
-  data->dialog = GTK_DIALOG (sw->dialog);
+    data = g_new0 (struct _crit_data, 1);
+    data->element = element;
+    data->dialog = GTK_DIALOG (sw->dialog);
 
-  hbox = gtk_hbox_new (FALSE, 0);
-  /* only set to automaticaly clean up the memory */
-  g_object_set_data_full (G_OBJECT (hbox), "data", data, g_free);
+    hbox = gtk_hbox_new (FALSE, 0);
+    /* only set to automaticaly clean up the memory */
+    g_object_set_data_full (G_OBJECT (hbox), "data", data, g_free);
 
-  p = gnc_search_core_type_get_widget (element);
-  data->elemwidget = p;
-  data->container = hbox;
-  data->param = sw->last_param;
+    p = gnc_search_core_type_get_widget (element);
+    data->elemwidget = p;
+    data->container = hbox;
+    data->param = sw->last_param;
 
-  store = gtk_list_store_new(NUM_SEARCH_COLS, G_TYPE_STRING, G_TYPE_POINTER);
-  combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    store = gtk_list_store_new(NUM_SEARCH_COLS, G_TYPE_STRING, G_TYPE_POINTER);
+    combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-  cell = gtk_cell_renderer_text_new ();
-  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell, TRUE);
-  gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), cell,
-                                  "text", SEARCH_COL_NAME,
-                                  NULL);
+    cell = gtk_cell_renderer_text_new ();
+    gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell, TRUE);
+    gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), cell,
+                                    "text", SEARCH_COL_NAME,
+                                    NULL);
 
-  for (l = sw->params_list; l; l = l->next) {
-    GNCSearchParam *param = l->data;
+    for (l = sw->params_list; l; l = l->next)
+    {
+        GNCSearchParam *param = l->data;
 
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-		       SEARCH_COL_NAME, _(param->title),
-		       SEARCH_COL_POINTER, param,
-		       -1);
+        gtk_list_store_append(store, &iter);
+        gtk_list_store_set(store, &iter,
+                           SEARCH_COL_NAME, _(param->title),
+                           SEARCH_COL_POINTER, param,
+                           -1);
 
-    if (param == sw->last_param) /* is this the right parameter to start? */
-      current = index;
+        if (param == sw->last_param) /* is this the right parameter to start? */
+            current = index;
 
-    index++;
-  }
+        index++;
+    }
 
-  gtk_combo_box_set_active (GTK_COMBO_BOX(combo_box), current);
-  g_signal_connect (combo_box, "changed", G_CALLBACK (combo_box_changed), data);
+    gtk_combo_box_set_active (GTK_COMBO_BOX(combo_box), current);
+    g_signal_connect (combo_box, "changed", G_CALLBACK (combo_box_changed), data);
 
-  gtk_box_pack_start (GTK_BOX (hbox), combo_box, FALSE, FALSE, 0);
-  if (p)
-    gtk_box_pack_start (GTK_BOX (hbox), p, FALSE, FALSE, 0);
-  gtk_widget_show_all (hbox);
+    gtk_box_pack_start (GTK_BOX (hbox), combo_box, FALSE, FALSE, 0);
+    if (p)
+        gtk_box_pack_start (GTK_BOX (hbox), p, FALSE, FALSE, 0);
+    gtk_widget_show_all (hbox);
 
-  return hbox;
+    return hbox;
 }
 
 static void
 gnc_search_dialog_add_criterion (GNCSearchWindow *sw)
 {
-  GNCSearchCoreType *new;
+    GNCSearchCoreType *new;
 
-  /* First, make sure that the last criterion is ok */
-  if (sw->crit_list) {
-    if (!gnc_search_dialog_crit_ok (sw))
-      return;
-  } else {
-    sw->last_param = sw->params_list->data;
+    /* First, make sure that the last criterion is ok */
+    if (sw->crit_list)
+    {
+        if (!gnc_search_dialog_crit_ok (sw))
+            return;
+    }
+    else
+    {
+        sw->last_param = sw->params_list->data;
 
-    /* no match-all situation anymore */
-    gtk_widget_set_sensitive(sw->grouping_combo, TRUE);
-    gtk_widget_hide(sw->match_all_label);
-  }
+        /* no match-all situation anymore */
+        gtk_widget_set_sensitive(sw->grouping_combo, TRUE);
+        gtk_widget_hide(sw->match_all_label);
+    }
 
-  /* create a new criterion element */
+    /* create a new criterion element */
 
-  new = gnc_search_core_type_new_type_name
-    (gnc_search_param_get_param_type (sw->last_param));
+    new = gnc_search_core_type_new_type_name
+          (gnc_search_param_get_param_type (sw->last_param));
 
-  if (new) {
-    struct _crit_data *data;
-    GtkWidget *w;
-    int rows;
+    if (new)
+    {
+        struct _crit_data *data;
+        GtkWidget *w;
+        int rows;
 
-    w = get_element_widget (sw, new);
-    data = g_object_get_data (G_OBJECT (w), "data");
-    sw->crit_list = g_list_append (sw->crit_list, data);
+        w = get_element_widget (sw, new);
+        data = g_object_get_data (G_OBJECT (w), "data");
+        sw->crit_list = g_list_append (sw->crit_list, data);
 
-    rows = GTK_TABLE (sw->criteria_table)->nrows;
-    gtk_table_resize (GTK_TABLE (sw->criteria_table), rows+1, 2);
-    attach_element (w, sw, rows);
+        rows = GTK_TABLE (sw->criteria_table)->nrows;
+        gtk_table_resize (GTK_TABLE (sw->criteria_table), rows + 1, 2);
+        attach_element (w, sw, rows);
 
-    gnc_search_core_type_grab_focus (new);
-    gnc_search_core_type_editable_enters (new);
-  }
+        gnc_search_core_type_grab_focus (new);
+        gnc_search_core_type_editable_enters (new);
+    }
 }
 
 static void
 add_criterion (GtkWidget *button, GNCSearchWindow *sw)
 {
-  gnc_search_dialog_add_criterion (sw);
+    gnc_search_dialog_add_criterion (sw);
 }
 
 static int
 gnc_search_dialog_close_cb (GtkDialog *dialog, GNCSearchWindow *sw)
 {
-  g_return_val_if_fail (sw, TRUE);
+    g_return_val_if_fail (sw, TRUE);
 
-  gnc_unregister_gui_component (sw->component_id);
+    gnc_unregister_gui_component (sw->component_id);
 
-  /* XXX: Clear the params_list? */
-  g_list_free (sw->crit_list);
+    /* XXX: Clear the params_list? */
+    g_list_free (sw->crit_list);
 
-  /* Destroy the queries */
-  if (sw->q) gncQueryDestroy (sw->q);
-  if (sw->start_q) gncQueryDestroy (sw->start_q);
+    /* Destroy the queries */
+    if (sw->q) gncQueryDestroy (sw->q);
+    if (sw->start_q) gncQueryDestroy (sw->start_q);
 
-  /* Destroy the user_data */
-  if (sw->free_cb)
-    (sw->free_cb)(sw->user_data);
+    /* Destroy the user_data */
+    if (sw->free_cb)
+        (sw->free_cb)(sw->user_data);
 
-  /* Destroy and exit */
-  g_free (sw);
-  return FALSE;
+    /* Destroy and exit */
+    g_free (sw);
+    return FALSE;
 }
 
 static void
 refresh_handler (GHashTable *changes, gpointer data)
 {
-  GNCSearchWindow * sw = data;
+    GNCSearchWindow * sw = data;
 
-  g_return_if_fail (sw);
-  gnc_search_dialog_display_results (sw);
+    g_return_if_fail (sw);
+    gnc_search_dialog_display_results (sw);
 }
 
 static void
 close_handler (gpointer data)
 {
-  GNCSearchWindow * sw = data;
+    GNCSearchWindow * sw = data;
 
-  g_return_if_fail (sw);
-  gtk_widget_destroy (sw->dialog);
-  /* DRH: should sw be freed here? */
+    g_return_if_fail (sw);
+    gtk_widget_destroy (sw->dialog);
+    /* DRH: should sw be freed here? */
 }
 
 static void
 gnc_search_dialog_init_widgets (GNCSearchWindow *sw, const gchar *title)
 {
-  GladeXML *xml;
-  GtkWidget *label, *add, *box;
-  GtkComboBox *combo_box;
-  GtkWidget *new_item_button;
-  const char * type_label;
-  gboolean active;
+    GladeXML *xml;
+    GtkWidget *label, *add, *box;
+    GtkComboBox *combo_box;
+    GtkWidget *new_item_button;
+    const char * type_label;
+    gboolean active;
 
-  xml = gnc_glade_xml_new ("search.glade", "Search Dialog");
+    xml = gnc_glade_xml_new ("search.glade", "Search Dialog");
 
-  /* Grab the dialog, save the dialog info */
-  sw->dialog = glade_xml_get_widget (xml, "Search Dialog");
-  gtk_window_set_title(GTK_WINDOW(sw->dialog), title);
-  g_object_set_data (G_OBJECT (sw->dialog), "dialog-info", sw);
+    /* Grab the dialog, save the dialog info */
+    sw->dialog = glade_xml_get_widget (xml, "Search Dialog");
+    gtk_window_set_title(GTK_WINDOW(sw->dialog), title);
+    g_object_set_data (G_OBJECT (sw->dialog), "dialog-info", sw);
 
-  /* grab the result hbox */
-  sw->result_hbox = glade_xml_get_widget (xml, "result_hbox");
+    /* grab the result hbox */
+    sw->result_hbox = glade_xml_get_widget (xml, "result_hbox");
 
-  /* Grab the search-table widget */
-  sw->criteria_table = glade_xml_get_widget (xml, "criteria_table");
+    /* Grab the search-table widget */
+    sw->criteria_table = glade_xml_get_widget (xml, "criteria_table");
 
-  /* Set the type label */
-  label = glade_xml_get_widget (xml, "type_label");
-  if (sw->type_label)
-    type_label = sw->type_label;
-  else
-    type_label = _(gncObjectGetTypeLabel (sw->search_for));
-  gtk_label_set_text (GTK_LABEL (label), type_label);
+    /* Set the type label */
+    label = glade_xml_get_widget (xml, "type_label");
+    if (sw->type_label)
+        type_label = sw->type_label;
+    else
+        type_label = _(gncObjectGetTypeLabel (sw->search_for));
+    gtk_label_set_text (GTK_LABEL (label), type_label);
 
-  /* Set the 'add criterion' button */
-  add = gtk_button_new_from_stock (GTK_STOCK_ADD);
- 
-  g_signal_connect (G_OBJECT (add), "clicked", G_CALLBACK (add_criterion), sw);
-  box = glade_xml_get_widget (xml, "add_button_box");
-  gtk_box_pack_start (GTK_BOX (box), add, FALSE, FALSE, 3);
-  gtk_widget_show (add);
-  
-  /* Set the match-type menu */
-  sw->grouping_combo = gtk_combo_box_new_text();
-  combo_box = GTK_COMBO_BOX(sw->grouping_combo);
-  gtk_combo_box_append_text(combo_box, _("all criteria are met"));
-  gtk_combo_box_append_text(combo_box, _("any criteria are met"));
-  gtk_combo_box_set_active(combo_box, sw->grouping);
-  g_signal_connect(combo_box, "changed", G_CALLBACK (match_combo_changed), sw);
+    /* Set the 'add criterion' button */
+    add = gtk_button_new_from_stock (GTK_STOCK_ADD);
 
-  box = glade_xml_get_widget (xml, "type_menu_box");
-  gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET(combo_box), FALSE, FALSE, 3);
-  gtk_widget_show(GTK_WIDGET(combo_box));
+    g_signal_connect (G_OBJECT (add), "clicked", G_CALLBACK (add_criterion), sw);
+    box = glade_xml_get_widget (xml, "add_button_box");
+    gtk_box_pack_start (GTK_BOX (box), add, FALSE, FALSE, 3);
+    gtk_widget_show (add);
 
-  /* Grab the 'all items match' label */
-  sw->match_all_label = glade_xml_get_widget (xml, "match_all_label");
+    /* Set the match-type menu */
+    sw->grouping_combo = gtk_combo_box_new_text();
+    combo_box = GTK_COMBO_BOX(sw->grouping_combo);
+    gtk_combo_box_append_text(combo_box, _("all criteria are met"));
+    gtk_combo_box_append_text(combo_box, _("any criteria are met"));
+    gtk_combo_box_set_active(combo_box, sw->grouping);
+    g_signal_connect(combo_box, "changed", G_CALLBACK (match_combo_changed), sw);
 
-  /* if there's no original query, make the narrow, add, delete 
-   * buttons inaccessible */
-  sw->new_rb = glade_xml_get_widget (xml, "new_search_radiobutton");
-  sw->narrow_rb = glade_xml_get_widget (xml, "narrow_search_radiobutton");
-  sw->add_rb = glade_xml_get_widget (xml, "add_search_radiobutton");
-  sw->del_rb = glade_xml_get_widget (xml, "delete_search_radiobutton");
+    box = glade_xml_get_widget (xml, "type_menu_box");
+    gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET(combo_box), FALSE, FALSE, 3);
+    gtk_widget_show(GTK_WIDGET(combo_box));
 
-  active = gnc_gconf_get_bool(sw->gconf_section, KEY_ACTIVE_ONLY, NULL);
-  sw->active_only_check = glade_xml_get_widget (xml, "active_only_check");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sw->active_only_check),
-				active);
+    /* Grab the 'all items match' label */
+    sw->match_all_label = glade_xml_get_widget (xml, "match_all_label");
 
-  /* Figure out if we this object-type has an "active" parameter, and
-   * if not, then set the active-check button insensitive
-   */
-  if (gncQueryObjectGetParameter (sw->search_for, QUERY_PARAM_ACTIVE) == NULL)
-    gtk_widget_set_sensitive (sw->active_only_check, FALSE);
+    /* if there's no original query, make the narrow, add, delete
+     * buttons inaccessible */
+    sw->new_rb = glade_xml_get_widget (xml, "new_search_radiobutton");
+    sw->narrow_rb = glade_xml_get_widget (xml, "narrow_search_radiobutton");
+    sw->add_rb = glade_xml_get_widget (xml, "add_search_radiobutton");
+    sw->del_rb = glade_xml_get_widget (xml, "delete_search_radiobutton");
 
-  /* Deal with the cancel button */
-  sw->cancel_button = glade_xml_get_widget (xml, "cancel_button");
-  sw->close_button = glade_xml_get_widget (xml, "close_button");
+    active = gnc_gconf_get_bool(sw->gconf_section, KEY_ACTIVE_ONLY, NULL);
+    sw->active_only_check = glade_xml_get_widget (xml, "active_only_check");
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sw->active_only_check),
+                                  active);
 
-  /* Deal with the new_item button */
-  new_item_button = glade_xml_get_widget (xml, "new_item_button");
-  {
-    char *desc =
-      /* Translators: %s is either "item" or the name of some other
-       * item, e.g. "Customer" or "Invoice". */
-      g_strdup_printf (_("New %s"), type_label ? type_label : _("item"));
-    gtk_button_set_label (GTK_BUTTON(new_item_button), desc);
-    g_free (desc);
-  }
-  /* add the first criterion */
-  gnc_search_dialog_add_criterion (sw);
+    /* Figure out if we this object-type has an "active" parameter, and
+     * if not, then set the active-check button insensitive
+     */
+    if (gncQueryObjectGetParameter (sw->search_for, QUERY_PARAM_ACTIVE) == NULL)
+        gtk_widget_set_sensitive (sw->active_only_check, FALSE);
 
-  /* Hide the 'new' button if there is no new_item_cb */
-  if (!sw->new_item_cb)
-    gtk_widget_hide (new_item_button);
+    /* Deal with the cancel button */
+    sw->cancel_button = glade_xml_get_widget (xml, "cancel_button");
+    sw->close_button = glade_xml_get_widget (xml, "close_button");
 
-  /* Connect XML signals */
+    /* Deal with the new_item button */
+    new_item_button = glade_xml_get_widget (xml, "new_item_button");
+    {
+        char *desc =
+            /* Translators: %s is either "item" or the name of some other
+             * item, e.g. "Customer" or "Invoice". */
+            g_strdup_printf (_("New %s"), type_label ? type_label : _("item"));
+        gtk_button_set_label (GTK_BUTTON(new_item_button), desc);
+        g_free (desc);
+    }
+    /* add the first criterion */
+    gnc_search_dialog_add_criterion (sw);
 
-  glade_xml_signal_connect_data (xml, "gnc_ui_search_type_cb",
-				 G_CALLBACK (search_type_cb), sw);
-  
-  glade_xml_signal_connect_data (xml, "gnc_ui_search_active_cb",
-				 G_CALLBACK (search_active_only_cb), sw);
+    /* Hide the 'new' button if there is no new_item_cb */
+    if (!sw->new_item_cb)
+        gtk_widget_hide (new_item_button);
 
-  glade_xml_signal_connect_data (xml, "gnc_ui_search_new_cb",
-				 G_CALLBACK (search_new_item_cb), sw);
-  
-  glade_xml_signal_connect_data (xml, "gnc_ui_search_find_cb",
-				 G_CALLBACK (search_find_cb), sw);
-  
-  glade_xml_signal_connect_data (xml, "gnc_ui_search_cancel_cb",
-				 G_CALLBACK (search_cancel_cb), sw);
+    /* Connect XML signals */
 
-  glade_xml_signal_connect_data (xml, "gnc_ui_search_close_cb",
-				 G_CALLBACK (search_cancel_cb), sw);
-  
-  glade_xml_signal_connect_data (xml, "gnc_ui_search_help_cb",
-				 G_CALLBACK (search_help_cb), sw);
+    glade_xml_signal_connect_data (xml, "gnc_ui_search_type_cb",
+                                   G_CALLBACK (search_type_cb), sw);
 
-  /* Register ourselves */
-  sw->component_id = gnc_register_gui_component (DIALOG_SEARCH_CM_CLASS,
-						 refresh_handler,
-						 close_handler, sw);
+    glade_xml_signal_connect_data (xml, "gnc_ui_search_active_cb",
+                                   G_CALLBACK (search_active_only_cb), sw);
 
-  /* And setup the close callback */
-  g_signal_connect (G_OBJECT (sw->dialog), "destroy",
-		    G_CALLBACK (gnc_search_dialog_close_cb), sw);
+    glade_xml_signal_connect_data (xml, "gnc_ui_search_new_cb",
+                                   G_CALLBACK (search_new_item_cb), sw);
 
-  gnc_search_dialog_reset_widgets (sw);
-  gnc_search_dialog_show_close_cancel (sw);
+    glade_xml_signal_connect_data (xml, "gnc_ui_search_find_cb",
+                                   G_CALLBACK (search_find_cb), sw);
+
+    glade_xml_signal_connect_data (xml, "gnc_ui_search_cancel_cb",
+                                   G_CALLBACK (search_cancel_cb), sw);
+
+    glade_xml_signal_connect_data (xml, "gnc_ui_search_close_cb",
+                                   G_CALLBACK (search_cancel_cb), sw);
+
+    glade_xml_signal_connect_data (xml, "gnc_ui_search_help_cb",
+                                   G_CALLBACK (search_help_cb), sw);
+
+    /* Register ourselves */
+    sw->component_id = gnc_register_gui_component (DIALOG_SEARCH_CM_CLASS,
+                       refresh_handler,
+                       close_handler, sw);
+
+    /* And setup the close callback */
+    g_signal_connect (G_OBJECT (sw->dialog), "destroy",
+                      G_CALLBACK (gnc_search_dialog_close_cb), sw);
+
+    gnc_search_dialog_reset_widgets (sw);
+    gnc_search_dialog_show_close_cancel (sw);
 }
 
 void
 gnc_search_dialog_destroy (GNCSearchWindow *sw)
 {
-  if (!sw) return;
-  if (sw->gconf_section)
-    gnc_save_window_size(sw->gconf_section, GTK_WINDOW(sw->dialog));
-  gnc_close_gui_component (sw->component_id);
+    if (!sw) return;
+    if (sw->gconf_section)
+        gnc_save_window_size(sw->gconf_section, GTK_WINDOW(sw->dialog));
+    gnc_close_gui_component (sw->component_id);
 }
 
 void
 gnc_search_dialog_raise (GNCSearchWindow *sw)
 {
-  if (!sw) return;
-  gtk_window_present (GTK_WINDOW(sw->dialog));
+    if (!sw) return;
+    gtk_window_present (GTK_WINDOW(sw->dialog));
 }
 
 GNCSearchWindow *
 gnc_search_dialog_create (GNCIdTypeConst obj_type, const gchar *title,
-			  GList *param_list,
-			  GList *display_list,
-			  QueryNew *start_query, QueryNew *show_start_query,
-			  GNCSearchCallbackButton *callbacks,
-			  GNCSearchResultCB result_callback,
-			  GNCSearchNewItemCB new_item_cb,
-			  gpointer user_data, GNCSearchFree free_cb,
-			  const gchar *gconf_section,
-			  const gchar *type_label)
+                          GList *param_list,
+                          GList *display_list,
+                          QueryNew *start_query, QueryNew *show_start_query,
+                          GNCSearchCallbackButton *callbacks,
+                          GNCSearchResultCB result_callback,
+                          GNCSearchNewItemCB new_item_cb,
+                          gpointer user_data, GNCSearchFree free_cb,
+                          const gchar *gconf_section,
+                          const gchar *type_label)
 {
-  GNCSearchWindow *sw = g_new0 (GNCSearchWindow, 1);
+    GNCSearchWindow *sw = g_new0 (GNCSearchWindow, 1);
 
-  g_return_val_if_fail (obj_type, NULL);
-  g_return_val_if_fail (*obj_type != '\0', NULL);
-  g_return_val_if_fail (param_list, NULL);
+    g_return_val_if_fail (obj_type, NULL);
+    g_return_val_if_fail (*obj_type != '\0', NULL);
+    g_return_val_if_fail (param_list, NULL);
 
-  /* Make sure the caller supplies callbacks xor result_callback */
-  g_return_val_if_fail ((callbacks && !result_callback) ||
-			(!callbacks && result_callback), NULL);
+    /* Make sure the caller supplies callbacks xor result_callback */
+    g_return_val_if_fail ((callbacks && !result_callback) ||
+                          (!callbacks && result_callback), NULL);
 
-  if (callbacks)
-    g_return_val_if_fail (display_list, NULL);
+    if (callbacks)
+        g_return_val_if_fail (display_list, NULL);
 
-  sw->search_for = obj_type;
-  sw->params_list = param_list;
-  sw->display_list = display_list;
-  sw->buttons = callbacks;
-  sw->result_cb = result_callback;
-  sw->new_item_cb = new_item_cb;
-  sw->user_data = user_data;
-  sw->free_cb = free_cb;
-  sw->gconf_section = gconf_section;
-  sw->type_label = type_label;
+    sw->search_for = obj_type;
+    sw->params_list = param_list;
+    sw->display_list = display_list;
+    sw->buttons = callbacks;
+    sw->result_cb = result_callback;
+    sw->new_item_cb = new_item_cb;
+    sw->user_data = user_data;
+    sw->free_cb = free_cb;
+    sw->gconf_section = gconf_section;
+    sw->type_label = type_label;
 
-  /* Grab the get_guid function */
-  sw->get_guid = qof_class_get_parameter (sw->search_for, QOF_PARAM_GUID);
-  if (start_query)
-    sw->start_q = gncQueryCopy (start_query);
-  sw->q = show_start_query;
+    /* Grab the get_guid function */
+    sw->get_guid = qof_class_get_parameter (sw->search_for, QOF_PARAM_GUID);
+    if (start_query)
+        sw->start_q = gncQueryCopy (start_query);
+    sw->q = show_start_query;
 
-  gnc_search_dialog_init_widgets (sw, title);
-  if (sw->gconf_section)
-    gnc_restore_window_size(sw->gconf_section, GTK_WINDOW(sw->dialog));
-  gtk_widget_show(sw->dialog);
+    gnc_search_dialog_init_widgets (sw, title);
+    if (sw->gconf_section)
+        gnc_restore_window_size(sw->gconf_section, GTK_WINDOW(sw->dialog));
+    gtk_widget_show(sw->dialog);
 
-  /* Maybe display the original query results? */
-  if (callbacks && show_start_query) {
-    gnc_search_dialog_reset_widgets (sw);
-    gnc_search_dialog_display_results (sw);
-  }
+    /* Maybe display the original query results? */
+    if (callbacks && show_start_query)
+    {
+        gnc_search_dialog_reset_widgets (sw);
+        gnc_search_dialog_display_results (sw);
+    }
 
-  return sw;
+    return sw;
 }
 
 /* Register an on-close signal with the Search Dialog */
 guint gnc_search_dialog_connect_on_close (GNCSearchWindow *sw,
-					  GCallback func,
-					  gpointer user_data)
+        GCallback func,
+        gpointer user_data)
 {
-  g_return_val_if_fail (sw, 0);
-  g_return_val_if_fail (func, 0);
-  g_return_val_if_fail (user_data, 0);
+    g_return_val_if_fail (sw, 0);
+    g_return_val_if_fail (func, 0);
+    g_return_val_if_fail (user_data, 0);
 
-  return g_signal_connect (G_OBJECT (sw->dialog), "destroy",
-			   func, user_data);
+    return g_signal_connect (G_OBJECT (sw->dialog), "destroy",
+                             func, user_data);
 
 }
 
 /* Un-register the signal handlers with the Search Dialog */
 void gnc_search_dialog_disconnect (GNCSearchWindow *sw, gpointer user_data)
 {
-  g_return_if_fail (sw);
-  g_return_if_fail (user_data);
+    g_return_if_fail (sw);
+    g_return_if_fail (user_data);
 
-  g_signal_handlers_disconnect_matched (sw->dialog, G_SIGNAL_MATCH_DATA,
-					0, 0, NULL, NULL, user_data);  
+    g_signal_handlers_disconnect_matched (sw->dialog, G_SIGNAL_MATCH_DATA,
+                                          0, 0, NULL, NULL, user_data);
 }
 
 /* Clear all callbacks with this Search Window */
 void gnc_search_dialog_set_select_cb (GNCSearchWindow *sw,
-				      GNCSearchSelectedCB selected_cb,
-				      gpointer user_data,
-				      gboolean allow_clear)
+                                      GNCSearchSelectedCB selected_cb,
+                                      gpointer user_data,
+                                      gboolean allow_clear)
 {
-  g_return_if_fail (sw);
+    g_return_if_fail (sw);
 
-  sw->selected_cb = selected_cb;
-  sw->select_arg = user_data;
-  sw->allow_clear = allow_clear;
+    sw->selected_cb = selected_cb;
+    sw->select_arg = user_data;
+    sw->allow_clear = allow_clear;
 
-  /* Show or hide the select button */
-  if (sw->select_button) {
-    if (selected_cb)
-      gtk_widget_show (sw->select_button);
-    else
-      gtk_widget_hide (sw->select_button);
-  }
+    /* Show or hide the select button */
+    if (sw->select_button)
+    {
+        if (selected_cb)
+            gtk_widget_show (sw->select_button);
+        else
+            gtk_widget_hide (sw->select_button);
+    }
 
-  /* Show the proper close/cancel button */
-  gnc_search_dialog_show_close_cancel (sw);
+    /* Show the proper close/cancel button */
+    gnc_search_dialog_show_close_cancel (sw);
 }
 
 /* TEST CODE BELOW HERE */
@@ -1041,77 +1077,78 @@
 static GList *
 get_params_list (GNCIdTypeConst type)
 {
-  GList *list = NULL;
+    GList *list = NULL;
 
-  list = gnc_search_param_prepend (list, "Txn: All Accounts",
-				   ACCOUNT_MATCH_ALL_TYPE,
-				   type, SPLIT_TRANS, TRANS_SPLITLIST,
-				   SPLIT_ACCOUNT_GUID, NULL);
-  list = gnc_search_param_prepend (list, "Split Account", GNC_ID_ACCOUNT,
-				   type, SPLIT_ACCOUNT, QUERY_PARAM_GUID,
-				   NULL);
-  list = gnc_search_param_prepend (list, "Split->Txn->Void?", NULL, type,
-				   SPLIT_TRANS, TRANS_VOID_STATUS, NULL);
-  list = gnc_search_param_prepend (list, "Split Int64", NULL, type,
-				   "d-share-int64", NULL);
-  list = gnc_search_param_prepend (list, "Split Amount (double)", NULL, type,
-				   "d-share-amount", NULL);
-  list = gnc_search_param_prepend (list, "Split Value (debcred)", NULL, type,
-				   SPLIT_VALUE, NULL);
-  list = gnc_search_param_prepend (list, "Split Amount (numeric)", NULL, type,
-				   SPLIT_AMOUNT, NULL);
-  list = gnc_search_param_prepend (list, "Date Reconciled (date)", NULL, type,
-				   SPLIT_DATE_RECONCILED, NULL);
-  list = gnc_search_param_prepend (list, "Split Memo (string)", NULL, type,
-				   SPLIT_MEMO, NULL);
+    list = gnc_search_param_prepend (list, "Txn: All Accounts",
+                                     ACCOUNT_MATCH_ALL_TYPE,
+                                     type, SPLIT_TRANS, TRANS_SPLITLIST,
+                                     SPLIT_ACCOUNT_GUID, NULL);
+    list = gnc_search_param_prepend (list, "Split Account", GNC_ID_ACCOUNT,
+                                     type, SPLIT_ACCOUNT, QUERY_PARAM_GUID,
+                                     NULL);
+    list = gnc_search_param_prepend (list, "Split->Txn->Void?", NULL, type,
+                                     SPLIT_TRANS, TRANS_VOID_STATUS, NULL);
+    list = gnc_search_param_prepend (list, "Split Int64", NULL, type,
+                                     "d-share-int64", NULL);
+    list = gnc_search_param_prepend (list, "Split Amount (double)", NULL, type,
+                                     "d-share-amount", NULL);
+    list = gnc_search_param_prepend (list, "Split Value (debcred)", NULL, type,
+                                     SPLIT_VALUE, NULL);
+    list = gnc_search_param_prepend (list, "Split Amount (numeric)", NULL, type,
+                                     SPLIT_AMOUNT, NULL);
+    list = gnc_search_param_prepend (list, "Date Reconciled (date)", NULL, type,
+                                     SPLIT_DATE_RECONCILED, NULL);
+    list = gnc_search_param_prepend (list, "Split Memo (string)", NULL, type,
+                                     SPLIT_MEMO, NULL);
 
-  return list;
+    return list;
 }
 
 static GList *
 get_display_list (GNCIdTypeConst type)
 {
-  GList *list = NULL;
+    GList *list = NULL;
 
-  list = gnc_search_param_prepend (list, "Amount", NULL, type, SPLIT_AMOUNT,
-				   NULL);
-  list = gnc_search_param_prepend (list, "Memo", NULL, type, SPLIT_MEMO, NULL);
-  list = gnc_search_param_prepend (list, "Date", NULL, type, SPLIT_TRANS,
-				   TRANS_DATE_POSTED, NULL);
+    list = gnc_search_param_prepend (list, "Amount", NULL, type, SPLIT_AMOUNT,
+                                     NULL);
+    list = gnc_search_param_prepend (list, "Memo", NULL, type, SPLIT_MEMO, NULL);
+    list = gnc_search_param_prepend (list, "Date", NULL, type, SPLIT_TRANS,
+                                     TRANS_DATE_POSTED, NULL);
 
-  return list;
+    return list;
 }
 
 static void
 do_nothing (gpointer *a, gpointer b)
 {
-  return;
+    return;
 }
 
 void
 gnc_search_dialog_test (void)
 {
-  GNCSearchWindow *sw;
-  static GList *params = NULL;
-  static GList *display = NULL;
-  static GNCSearchCallbackButton buttons[] = {
-    /* Don't mark these as translatable since these are only test strings! */ 
-    { ("View Split"), do_nothing },
-    { ("New Split"), do_nothing },
-    { ("Do Something"), do_nothing },
-    { ("Do Nothing"), do_nothing },
-    { ("Who Cares?"), do_nothing },
-    { NULL }
-  };
+    GNCSearchWindow *sw;
+    static GList *params = NULL;
+    static GList *display = NULL;
+    static GNCSearchCallbackButton buttons[] =
+    {
+        /* Don't mark these as translatable since these are only test strings! */
+        { ("View Split"), do_nothing },
+        { ("New Split"), do_nothing },
+        { ("Do Something"), do_nothing },
+        { ("Do Nothing"), do_nothing },
+        { ("Who Cares?"), do_nothing },
+        { NULL }
+    };
 
-  if (params == NULL)
-    params = get_params_list (GNC_ID_SPLIT);
+    if (params == NULL)
+        params = get_params_list (GNC_ID_SPLIT);
 
-  if (display == NULL)
-    display = get_display_list (GNC_ID_SPLIT);
+    if (display == NULL)
+        display = get_display_list (GNC_ID_SPLIT);
 
-  sw = gnc_search_dialog_create (GNC_ID_SPLIT, _("Find Transaction"),
-				 params, display,
-				 NULL, NULL, buttons, NULL, NULL, NULL, NULL,
-				 NULL, NULL);
+    sw = gnc_search_dialog_create (GNC_ID_SPLIT, _("Find Transaction"),
+                                   params, display,
+                                   NULL, NULL, buttons, NULL, NULL, NULL, NULL,
+                                   NULL, NULL);
 }

Modified: gnucash/trunk/src/gnome-search/dialog-search.h
===================================================================
--- gnucash/trunk/src/gnome-search/dialog-search.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/dialog-search.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -29,7 +29,7 @@
 
 typedef struct _GNCSearchWindow GNCSearchWindow;
 
-/* The two types of callbacks.  
+/* The two types of callbacks.
  *
  * In the first callback, (used in the callback button list) the obj_p
  * argument will be a pointer to the selected item (if one is
@@ -43,7 +43,7 @@
  */
 typedef void (*GNCSearchCallback) (gpointer *obj_p, gpointer user_data);
 typedef void (*GNCSearchResultCB) (QueryNew *query, gpointer user_data,
-				   gpointer *result);
+                                   gpointer *result);
 
 /*
  * This callback will create a new item and return a handle to the
@@ -61,11 +61,12 @@
  * returns.
  */
 typedef void (*GNCSearchSelectedCB) (gpointer selected_object,
-				     gpointer user_data);
+                                     gpointer user_data);
 
-typedef struct {
-  const char *		label;
-  GNCSearchCallback	cb_fcn;
+typedef struct
+{
+    const char *		label;
+    GNCSearchCallback	cb_fcn;
 } GNCSearchCallbackButton;
 
 /* Caller MUST supply _EITHER_ a result_callback or a list of callback
@@ -75,7 +76,7 @@
  * but will NOT be destroyed..  They should be a GList of
  * GNCSearchParam objects.  The display_list defines which paramters
  * of the found transactions are printed, and how.
- * 
+ *
  * The start_query is the property of the caller and will only be copied.
  * The show_start_query, if it exists, will become the property of the
  * dialog and will be automatically destroyed.
@@ -90,23 +91,23 @@
  */
 GNCSearchWindow *
 gnc_search_dialog_create (GNCIdTypeConst obj_type, const gchar *title,
-			  GList *param_list,
-			  GList *display_list,
-			  QueryNew *start_query, QueryNew *show_start_query,
-			  GNCSearchCallbackButton *callbacks,
-			  GNCSearchResultCB result_callback,
-			  GNCSearchNewItemCB new_item_cb,
-			  gpointer user_data, GNCSearchFree free_user_data,
-			  const gchar *gconf_section,
-			  const gchar *type_label);
+                          GList *param_list,
+                          GList *display_list,
+                          QueryNew *start_query, QueryNew *show_start_query,
+                          GNCSearchCallbackButton *callbacks,
+                          GNCSearchResultCB result_callback,
+                          GNCSearchNewItemCB new_item_cb,
+                          gpointer user_data, GNCSearchFree free_user_data,
+                          const gchar *gconf_section,
+                          const gchar *type_label);
 
 void gnc_search_dialog_destroy (GNCSearchWindow *sw);
 void gnc_search_dialog_raise (GNCSearchWindow *sw);
 
 /* Register an on-close signal with the Search Dialog */
 guint gnc_search_dialog_connect_on_close (GNCSearchWindow *sw,
-					  GCallback func,
-					  gpointer user_data);
+        GCallback func,
+        gpointer user_data);
 
 /* Un-register the signal handlers with the Search Dialog */
 void gnc_search_dialog_disconnect (GNCSearchWindow *sw, gpointer user_data);
@@ -119,9 +120,9 @@
  * with "NULL".
  */
 void gnc_search_dialog_set_select_cb (GNCSearchWindow *sw,
-				      GNCSearchSelectedCB selected_cb,
-				      gpointer user_data,
-				      gboolean allow_clear);
+                                      GNCSearchSelectedCB selected_cb,
+                                      gpointer user_data,
+                                      gboolean allow_clear);
 
 /* Test the dialog */
 void gnc_search_dialog_test (void);

Modified: gnucash/trunk/src/gnome-search/gnc-general-search.c
===================================================================
--- gnucash/trunk/src/gnome-search/gnc-general-search.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/gnc-general-search.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -47,15 +47,16 @@
 /* Signal codes */
 enum
 {
-	SELECTION_CHANGED,
-	LAST_SIGNAL
+    SELECTION_CHANGED,
+    LAST_SIGNAL
 };
 
 /* Columns used in GtkEntryCompletion's model */
-enum {
-  GSL_COLUMN_TEXT,
-  GSL_COLUMN_QOFOBJECT,
-  GSL_N_COLUMNS
+enum
+{
+    GSL_COLUMN_TEXT,
+    GSL_COLUMN_QOFOBJECT,
+    GSL_N_COLUMNS
 };
 
 static void gnc_general_search_init         (GNCGeneralSearch      *gsl);
@@ -64,14 +65,15 @@
 
 typedef struct _GNCGeneralSearchPrivate GNCGeneralSearchPrivate;
 
-struct _GNCGeneralSearchPrivate {
-	GUID			guid;
-	GNCIdTypeConst		type;
-	GNCSearchCB		search_cb;
-	gpointer		user_data;
-	GNCSearchWindow *	sw;
-	const QofParam * get_guid;
-	gint			component_id;
+struct _GNCGeneralSearchPrivate
+{
+    GUID			guid;
+    GNCIdTypeConst		type;
+    GNCSearchCB		search_cb;
+    gpointer		user_data;
+    GNCSearchWindow *	sw;
+    const QofParam * get_guid;
+    gint			component_id;
 };
 
 #define _PRIVATE(o) \
@@ -89,176 +91,183 @@
 GType
 gnc_general_search_get_type (void)
 {
-	static GType general_search_type = 0;
+    static GType general_search_type = 0;
 
-	if (!general_search_type){
-		static const GTypeInfo our_info = {
-			sizeof (GNCGeneralSearchClass),    /* class_size */
-			NULL,   			   /* base_init */
-			NULL,				   /* base_finalize */
-			(GClassInitFunc) gnc_general_search_class_init,
-			NULL,				   /* class_finalize */
-			NULL,				   /* class_data */
-			sizeof (GNCGeneralSearch),	   /* */
-			0,				   /* n_preallocs */
-			(GInstanceInitFunc) gnc_general_search_init,
-		};
+    if (!general_search_type)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GNCGeneralSearchClass),    /* class_size */
+            NULL,   			   /* base_init */
+            NULL,				   /* base_finalize */
+            (GClassInitFunc) gnc_general_search_class_init,
+            NULL,				   /* class_finalize */
+            NULL,				   /* class_data */
+            sizeof (GNCGeneralSearch),	   /* */
+            0,				   /* n_preallocs */
+            (GInstanceInitFunc) gnc_general_search_init,
+        };
 
-		general_search_type = g_type_register_static (GTK_TYPE_HBOX,
-							      "GNCGeneralSearch",
-							      &our_info, 0);
-	}
+        general_search_type = g_type_register_static (GTK_TYPE_HBOX,
+                              "GNCGeneralSearch",
+                              &our_info, 0);
+    }
 
-	return general_search_type;
+    return general_search_type;
 }
 
 static void
 gnc_general_search_class_init (GNCGeneralSearchClass *klass)
 {
-	GtkObjectClass *object_class = (GtkObjectClass *) klass;
+    GtkObjectClass *object_class = (GtkObjectClass *) klass;
 
-	object_class = (GtkObjectClass*) klass;
+    object_class = (GtkObjectClass*) klass;
 
-	parent_class = gtk_type_class (gtk_hbox_get_type ());
+    parent_class = gtk_type_class (gtk_hbox_get_type ());
 
-	general_search_signals[SELECTION_CHANGED] =
-		g_signal_new("changed",
-			     G_TYPE_FROM_CLASS(object_class),
-			     G_SIGNAL_RUN_FIRST,
-			     G_STRUCT_OFFSET(GNCGeneralSearchClass, changed),
-			     NULL, NULL,
-			     g_cclosure_marshal_VOID__VOID,
-			     G_TYPE_NONE, 0);
+    general_search_signals[SELECTION_CHANGED] =
+        g_signal_new("changed",
+                     G_TYPE_FROM_CLASS(object_class),
+                     G_SIGNAL_RUN_FIRST,
+                     G_STRUCT_OFFSET(GNCGeneralSearchClass, changed),
+                     NULL, NULL,
+                     g_cclosure_marshal_VOID__VOID,
+                     G_TYPE_NONE, 0);
 
-	object_class->destroy = gnc_general_search_destroy;
+    object_class->destroy = gnc_general_search_destroy;
 
-	klass->changed = NULL;
+    klass->changed = NULL;
 
-	g_type_class_add_private(klass, sizeof(GNCGeneralSearchPrivate));
+    g_type_class_add_private(klass, sizeof(GNCGeneralSearchPrivate));
 }
 
 static void
 gnc_general_search_init (GNCGeneralSearch *gsl)
 {
-	gsl->selected_item = NULL;
+    gsl->selected_item = NULL;
 }
 
 static void
 gnc_general_search_destroy (GtkObject *object)
 {
-	GNCGeneralSearch *gsl;
-	GNCGeneralSearchPrivate *priv;
+    GNCGeneralSearch *gsl;
+    GNCGeneralSearchPrivate *priv;
 
-	g_return_if_fail (object != NULL);
-	g_return_if_fail (GNC_IS_GENERAL_SEARCH (object));
+    g_return_if_fail (object != NULL);
+    g_return_if_fail (GNC_IS_GENERAL_SEARCH (object));
 
-	gsl = GNC_GENERAL_SEARCH (object);
+    gsl = GNC_GENERAL_SEARCH (object);
 
-	gsl->entry = NULL;
-	gsl->button = NULL;
+    gsl->entry = NULL;
+    gsl->button = NULL;
 
-	priv = _PRIVATE(gsl);
-	/* Clear the callbacks */
-	if (priv->sw) {
-		gnc_search_dialog_set_select_cb (priv->sw, NULL, NULL, FALSE);
-		gnc_search_dialog_disconnect (priv->sw, gsl);
-		priv->sw = NULL;
-	}
-	if (priv->component_id) {
-		/* Unregister ourselves */
-		gnc_unregister_gui_component (priv->component_id);
-		priv->component_id = 0;
-	}
+    priv = _PRIVATE(gsl);
+    /* Clear the callbacks */
+    if (priv->sw)
+    {
+        gnc_search_dialog_set_select_cb (priv->sw, NULL, NULL, FALSE);
+        gnc_search_dialog_disconnect (priv->sw, gsl);
+        priv->sw = NULL;
+    }
+    if (priv->component_id)
+    {
+        /* Unregister ourselves */
+        gnc_unregister_gui_component (priv->component_id);
+        priv->component_id = 0;
+    }
 
-	if (GTK_OBJECT_CLASS (parent_class)->destroy)
-		GTK_OBJECT_CLASS (parent_class)->destroy (object);
+    if (GTK_OBJECT_CLASS (parent_class)->destroy)
+        GTK_OBJECT_CLASS (parent_class)->destroy (object);
 }
 
 /* The "selection" contents have changed.  Change the text. */
 static void
 reset_selection_text (GNCGeneralSearch *gsl)
 {
-	GNCGeneralSearchPrivate *priv;
-	const char *text;
+    GNCGeneralSearchPrivate *priv;
+    const char *text;
 
-	priv = _PRIVATE(gsl);
-	if (gsl->selected_item == NULL)
-		text = "";
-	else
-		text = gncObjectPrintable (priv->type, gsl->selected_item);
+    priv = _PRIVATE(gsl);
+    if (gsl->selected_item == NULL)
+        text = "";
+    else
+        text = gncObjectPrintable (priv->type, gsl->selected_item);
 
-	gtk_entry_set_text(GTK_ENTRY(gsl->entry), text);
+    gtk_entry_set_text(GTK_ENTRY(gsl->entry), text);
 }
 
 /* We've got a refresh event */
 static void
 refresh_handler (GHashTable *changes, gpointer data)
 {
-	GNCGeneralSearch *gsl = data;
-	GNCGeneralSearchPrivate *priv;
-	const EventInfo *info;
+    GNCGeneralSearch *gsl = data;
+    GNCGeneralSearchPrivate *priv;
+    const EventInfo *info;
 
-	priv = _PRIVATE(gsl);
-	if (changes) {
-		info = gnc_gui_get_entity_events (changes, &priv->guid);
-		if (info) {
-			if (info->event_mask & QOF_EVENT_DESTROY)
-				gsl->selected_item = NULL;
-			reset_selection_text (gsl);
-		}
-	}
+    priv = _PRIVATE(gsl);
+    if (changes)
+    {
+        info = gnc_gui_get_entity_events (changes, &priv->guid);
+        if (info)
+        {
+            if (info->event_mask & QOF_EVENT_DESTROY)
+                gsl->selected_item = NULL;
+            reset_selection_text (gsl);
+        }
+    }
 }
 
 /* The user has selected from the search dialog */
 static void
 new_item_selected_cb (gpointer item, gpointer user_data)
 {
-	GNCGeneralSearch *gsl = user_data;
-	gnc_general_search_set_selected (gsl, item);
+    GNCGeneralSearch *gsl = user_data;
+    gnc_general_search_set_selected (gsl, item);
 }
 
 /* The search dialog has closed; let's forget about her */
 static int
 on_close_cb (GtkDialog *dialog, gpointer user_data)
 {
-	GNCGeneralSearch *gsl = user_data;
-	GNCGeneralSearchPrivate *priv;
+    GNCGeneralSearch *gsl = user_data;
+    GNCGeneralSearchPrivate *priv;
 
-	priv = _PRIVATE(gsl);
-	priv->sw = NULL;
-	return FALSE;
+    priv = _PRIVATE(gsl);
+    priv->sw = NULL;
+    return FALSE;
 }
 
 /* The user clicked on the button.  Pop up the selection window */
 static void
 search_cb(GtkButton * button, gpointer user_data)
 {
-	GNCGeneralSearch *gsl = user_data;
-	GNCGeneralSearchPrivate *priv;
-	GNCSearchWindow *sw;
+    GNCGeneralSearch *gsl = user_data;
+    GNCGeneralSearchPrivate *priv;
+    GNCSearchWindow *sw;
 
-	priv = _PRIVATE(gsl);
-	if (priv->sw) {
-		gnc_search_dialog_raise (priv->sw);
-		return;
-	}
+    priv = _PRIVATE(gsl);
+    if (priv->sw)
+    {
+        gnc_search_dialog_raise (priv->sw);
+        return;
+    }
 
-	sw = (priv->search_cb)(gsl->selected_item, priv->user_data);
+    sw = (priv->search_cb)(gsl->selected_item, priv->user_data);
 
-	/* NULL means nothing to 'select' */
-	if (sw == NULL)
-		return;
+    /* NULL means nothing to 'select' */
+    if (sw == NULL)
+        return;
 
-	/* Ok, save this search window and setup callbacks */
-	priv->sw = sw;
+    /* Ok, save this search window and setup callbacks */
+    priv->sw = sw;
 
-	/* Catch when the search dialog closes */
-	gnc_search_dialog_connect_on_close (sw, G_CALLBACK (on_close_cb),
-					    gsl);
+    /* Catch when the search dialog closes */
+    gnc_search_dialog_connect_on_close (sw, G_CALLBACK (on_close_cb),
+                                        gsl);
 
-	/* Catch the selection */
-	gnc_search_dialog_set_select_cb (sw, new_item_selected_cb,
-					 gsl, gsl->allow_clear);
+    /* Catch the selection */
+    gnc_search_dialog_set_select_cb (sw, new_item_selected_cb,
+                                     gsl, gsl->allow_clear);
 
 }
 
@@ -280,15 +289,15 @@
  *   @param cbe A pointer to a currency entry widget. */
 static gboolean
 gnc_gsl_match_selected_cb (GtkEntryCompletion *completion,
-			   GtkTreeModel       *comp_model,
-			   GtkTreeIter        *comp_iter,
-			   GNCGeneralSearch   *gsl)
+                           GtkTreeModel       *comp_model,
+                           GtkTreeIter        *comp_iter,
+                           GNCGeneralSearch   *gsl)
 {
-	QofObject * qofobject;
+    QofObject * qofobject;
 
-	gtk_tree_model_get(comp_model, comp_iter, GSL_COLUMN_QOFOBJECT, &qofobject, -1);
-	gnc_general_search_set_selected (gsl, qofobject);
-	return FALSE;
+    gtk_tree_model_get(comp_model, comp_iter, GSL_COLUMN_QOFOBJECT, &qofobject, -1);
+    gnc_general_search_set_selected (gsl, qofobject);
+    return FALSE;
 }
 
 /**  The focus left the general search edit widget, so reset the widget to
@@ -305,141 +314,142 @@
  *   @param gsl A pointer to a general search widget. */
 static gboolean
 gnc_gsl_focus_out_cb (GtkEntry         *entry,
-		      GdkEventFocus    *event,
-		      GNCGeneralSearch *gsl)
+                      GdkEventFocus    *event,
+                      GNCGeneralSearch *gsl)
 {
-	const gchar	*text;
-	GtkEntryCompletion *completion;
-	GtkTreeModel *model;
-	GtkTreeIter iter;
-	gchar *lc_text, *tree_string, *lc_tree_string;
-	gboolean match, valid_iter;
-	QofObject *qofobject;
-	gpointer selected_item=NULL;
+    const gchar	*text;
+    GtkEntryCompletion *completion;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    gchar *lc_text, *tree_string, *lc_tree_string;
+    gboolean match, valid_iter;
+    QofObject *qofobject;
+    gpointer selected_item = NULL;
 
-	/* Attempt to match the current text to a qofobject. */
-	completion = gtk_entry_get_completion(entry);
-	model = gtk_entry_completion_get_model(completion);
+    /* Attempt to match the current text to a qofobject. */
+    completion = gtk_entry_get_completion(entry);
+    model = gtk_entry_completion_get_model(completion);
 
-	/* Return if completion tree is empty */
-	valid_iter = gtk_tree_model_get_iter_first(model, &iter);
-	if (!valid_iter)
-		return FALSE;
+    /* Return if completion tree is empty */
+    valid_iter = gtk_tree_model_get_iter_first(model, &iter);
+    if (!valid_iter)
+        return FALSE;
 
-	text = gtk_entry_get_text(entry);
-	lc_text = g_utf8_strdown(text, -1);
+    text = gtk_entry_get_text(entry);
+    lc_text = g_utf8_strdown(text, -1);
 
-	/* The last, valid selected entry can match the entered text
-	 * No need to search further in that case */
-	if (gsl->selected_item)
-	{
-		GNCGeneralSearchPrivate *	priv;
+    /* The last, valid selected entry can match the entered text
+     * No need to search further in that case */
+    if (gsl->selected_item)
+    {
+        GNCGeneralSearchPrivate *	priv;
 
-		priv=_PRIVATE(gsl);
-		tree_string = g_strdup(qof_object_printable(priv->type, gsl->selected_item));
-		lc_tree_string = g_utf8_strdown(tree_string, -1);
-		match = g_utf8_collate(lc_text, lc_tree_string) == 0;
-		g_free(tree_string);
-		g_free(lc_tree_string);
-		if (match)
-			selected_item = gsl->selected_item;
-	}
+        priv = _PRIVATE(gsl);
+        tree_string = g_strdup(qof_object_printable(priv->type, gsl->selected_item));
+        lc_tree_string = g_utf8_strdown(tree_string, -1);
+        match = g_utf8_collate(lc_text, lc_tree_string) == 0;
+        g_free(tree_string);
+        g_free(lc_tree_string);
+        if (match)
+            selected_item = gsl->selected_item;
+    }
 
-	/* Otherwise, find a match in the completion list */
-	while (valid_iter && !selected_item)
-	{
-		gtk_tree_model_get(model, &iter, GSL_COLUMN_TEXT, &tree_string, -1);
-		lc_tree_string = g_utf8_strdown(tree_string, -1);
-		match = g_utf8_collate(lc_text, lc_tree_string) == 0;
-		g_free(tree_string);
-		g_free(lc_tree_string);
-		if (match)
-		{
-			gtk_tree_model_get(model, &iter, GSL_COLUMN_QOFOBJECT, &qofobject, -1);
-			selected_item = qofobject;
-		} else
-			valid_iter = gtk_tree_model_iter_next(model, &iter);
-	}
+    /* Otherwise, find a match in the completion list */
+    while (valid_iter && !selected_item)
+    {
+        gtk_tree_model_get(model, &iter, GSL_COLUMN_TEXT, &tree_string, -1);
+        lc_tree_string = g_utf8_strdown(tree_string, -1);
+        match = g_utf8_collate(lc_text, lc_tree_string) == 0;
+        g_free(tree_string);
+        g_free(lc_tree_string);
+        if (match)
+        {
+            gtk_tree_model_get(model, &iter, GSL_COLUMN_QOFOBJECT, &qofobject, -1);
+            selected_item = qofobject;
+        }
+        else
+            valid_iter = gtk_tree_model_iter_next(model, &iter);
+    }
 
-	g_free(lc_text);
-	gnc_general_search_set_selected (gsl, selected_item);
-	return FALSE;
+    g_free(lc_text);
+    gnc_general_search_set_selected (gsl, selected_item);
+    return FALSE;
 }
 
 static void
 create_children (GNCGeneralSearch *gsl,
-		 const char       *label,
-		 gboolean          text_editable,
-		 GNCIdTypeConst    type,
-		 QofBook          *book)
+                 const char       *label,
+                 gboolean          text_editable,
+                 GNCIdTypeConst    type,
+                 QofBook          *book)
 {
-	GtkListStore *	list_store;
-	QueryNew *	q;
-	GtkTreeIter iter;
-	GList * list, * it;
-	GtkEntryCompletion *completion;
+    GtkListStore *	list_store;
+    QueryNew *	q;
+    GtkTreeIter iter;
+    GList * list, * it;
+    GtkEntryCompletion *completion;
 
-	/* Add a text entry box */
-	gsl->entry = gtk_entry_new ();
-	if (!text_editable)
-		gtk_editable_set_editable (GTK_EDITABLE (gsl->entry), FALSE);
-	gtk_box_pack_start (GTK_BOX (gsl), gsl->entry, TRUE, TRUE, 0);
+    /* Add a text entry box */
+    gsl->entry = gtk_entry_new ();
+    if (!text_editable)
+        gtk_editable_set_editable (GTK_EDITABLE (gsl->entry), FALSE);
+    gtk_box_pack_start (GTK_BOX (gsl), gsl->entry, TRUE, TRUE, 0);
 
 
-	/* Setup a GtkEntryCompletion auxiliary widget for our Entry box
-	 * This requires an internal table ("model") with the possible
-	 * auto-completion text entries */
+    /* Setup a GtkEntryCompletion auxiliary widget for our Entry box
+     * This requires an internal table ("model") with the possible
+     * auto-completion text entries */
 
-	/* Query for the requested object type */
-	q = qof_query_create_for (type);
-	qof_query_add_boolean_match(q, g_slist_prepend
-			(NULL, QOF_PARAM_ACTIVE), TRUE, QOF_QUERY_AND);
-	qof_query_set_book (q, book);
-	list = qof_query_run(q);
+    /* Query for the requested object type */
+    q = qof_query_create_for (type);
+    qof_query_add_boolean_match(q, g_slist_prepend
+                                (NULL, QOF_PARAM_ACTIVE), TRUE, QOF_QUERY_AND);
+    qof_query_set_book (q, book);
+    list = qof_query_run(q);
 
-	/* Setup the internal model */
-	list_store = gtk_list_store_new (GSL_N_COLUMNS, G_TYPE_STRING, G_TYPE_OBJECT);
-	for (it = list; it != NULL ; it = it->next)
-	{
-		char * name;
+    /* Setup the internal model */
+    list_store = gtk_list_store_new (GSL_N_COLUMNS, G_TYPE_STRING, G_TYPE_OBJECT);
+    for (it = list; it != NULL ; it = it->next)
+    {
+        char * name;
 
-		name = g_strdup(qof_object_printable(type, it->data));
-		/* Add a new row to the model */
-		if (name)
-		{
-		gtk_list_store_append (list_store, &iter);
-		gtk_list_store_set (list_store, &iter,
-				GSL_COLUMN_TEXT, name,
-				GSL_COLUMN_QOFOBJECT, G_OBJECT(it->data),
-				-1);
-			g_free(name);
-		}
+        name = g_strdup(qof_object_printable(type, it->data));
+        /* Add a new row to the model */
+        if (name)
+        {
+            gtk_list_store_append (list_store, &iter);
+            gtk_list_store_set (list_store, &iter,
+                                GSL_COLUMN_TEXT, name,
+                                GSL_COLUMN_QOFOBJECT, G_OBJECT(it->data),
+                                -1);
+            g_free(name);
+        }
 
-	}
+    }
 
-	gncQueryDestroy(q);
+    gncQueryDestroy(q);
 
-	/* Add the GtkEntryCompletion widget */
-	completion = gtk_entry_completion_new();
-	gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(list_store));
-	gtk_entry_completion_set_text_column(completion, 0);
-	gtk_entry_completion_set_inline_completion(completion, TRUE);
-	gtk_entry_set_completion(GTK_ENTRY(gsl->entry), completion);
+    /* Add the GtkEntryCompletion widget */
+    completion = gtk_entry_completion_new();
+    gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(list_store));
+    gtk_entry_completion_set_text_column(completion, 0);
+    gtk_entry_completion_set_inline_completion(completion, TRUE);
+    gtk_entry_set_completion(GTK_ENTRY(gsl->entry), completion);
 
-	g_signal_connect (G_OBJECT (completion), "match_selected",
-			  G_CALLBACK (gnc_gsl_match_selected_cb), gsl);
-	g_signal_connect (G_OBJECT (gsl->entry), "focus-out-event",
-			  G_CALLBACK (gnc_gsl_focus_out_cb), gsl);
+    g_signal_connect (G_OBJECT (completion), "match_selected",
+                      G_CALLBACK (gnc_gsl_match_selected_cb), gsl);
+    g_signal_connect (G_OBJECT (gsl->entry), "focus-out-event",
+                      G_CALLBACK (gnc_gsl_focus_out_cb), gsl);
 
-	g_object_unref(completion);
-	gtk_widget_show (gsl->entry);
+    g_object_unref(completion);
+    gtk_widget_show (gsl->entry);
 
-	/* Add the search button */
-	gsl->button = gtk_button_new_with_label (label);
-	gtk_box_pack_start (GTK_BOX (gsl), gsl->button, FALSE, FALSE, 0);
-	g_signal_connect (G_OBJECT (gsl->button), "clicked",
-			  G_CALLBACK (search_cb), gsl);
-	gtk_widget_show (gsl->button);
+    /* Add the search button */
+    gsl->button = gtk_button_new_with_label (label);
+    gtk_box_pack_start (GTK_BOX (gsl), gsl->button, FALSE, FALSE, 0);
+    g_signal_connect (G_OBJECT (gsl->button), "clicked",
+                      G_CALLBACK (search_cb), gsl);
+    gtk_widget_show (gsl->button);
 }
 
 /**
@@ -465,35 +475,35 @@
  */
 GtkWidget *
 gnc_general_search_new (GNCIdTypeConst type,
-			const char    *label,
-			gboolean       text_editable,
-			GNCSearchCB    search_cb,
-			gpointer       user_data,
-			QofBook       *book)
+                        const char    *label,
+                        gboolean       text_editable,
+                        GNCSearchCB    search_cb,
+                        gpointer       user_data,
+                        QofBook       *book)
 {
-	GNCGeneralSearch *gsl;
-	GNCGeneralSearchPrivate *priv;
-	const QofParam *get_guid;
+    GNCGeneralSearch *gsl;
+    GNCGeneralSearchPrivate *priv;
+    const QofParam *get_guid;
 
-	g_return_val_if_fail (type && label && search_cb, NULL);
+    g_return_val_if_fail (type && label && search_cb, NULL);
 
-	get_guid = qof_class_get_parameter (type, QOF_PARAM_GUID);
-	g_return_val_if_fail (get_guid, NULL);
+    get_guid = qof_class_get_parameter (type, QOF_PARAM_GUID);
+    g_return_val_if_fail (get_guid, NULL);
 
-	gsl = g_object_new (GNC_TYPE_GENERAL_SEARCH, NULL);
+    gsl = g_object_new (GNC_TYPE_GENERAL_SEARCH, NULL);
 
-	create_children (gsl, label, text_editable, type, book);
+    create_children (gsl, label, text_editable, type, book);
 
-	priv = _PRIVATE(gsl);
-	priv->type = type;
-	priv->search_cb = search_cb;
-	priv->user_data = user_data;
-	priv->get_guid = get_guid;
-	priv->component_id =
-		gnc_register_gui_component (GNCGENERALSEARCH_CLASS,
-					    refresh_handler, NULL, gsl);
+    priv = _PRIVATE(gsl);
+    priv->type = type;
+    priv->search_cb = search_cb;
+    priv->user_data = user_data;
+    priv->get_guid = get_guid;
+    priv->component_id =
+        gnc_register_gui_component (GNCGENERALSEARCH_CLASS,
+                                    refresh_handler, NULL, gsl);
 
-	return GTK_WIDGET (gsl);
+    return GTK_WIDGET (gsl);
 }
 
 /**
@@ -508,30 +518,33 @@
 void
 gnc_general_search_set_selected (GNCGeneralSearch *gsl, gpointer selection)
 {
-	GNCGeneralSearchPrivate *priv;
+    GNCGeneralSearchPrivate *priv;
 
-	g_return_if_fail(gsl != NULL);
-	g_return_if_fail(GNC_IS_GENERAL_SEARCH(gsl));
+    g_return_if_fail(gsl != NULL);
+    g_return_if_fail(GNC_IS_GENERAL_SEARCH(gsl));
 
-	priv = _PRIVATE(gsl);
-	if (selection != gsl->selected_item) {
-		gsl->selected_item = selection;
-		g_signal_emit(gsl,
-			      general_search_signals[SELECTION_CHANGED], 0);
-	}
-	reset_selection_text (gsl);
+    priv = _PRIVATE(gsl);
+    if (selection != gsl->selected_item)
+    {
+        gsl->selected_item = selection;
+        g_signal_emit(gsl,
+                      general_search_signals[SELECTION_CHANGED], 0);
+    }
+    reset_selection_text (gsl);
 
-	gnc_gui_component_clear_watches (priv->component_id);
+    gnc_gui_component_clear_watches (priv->component_id);
 
-	if (selection) {
-		const QofParam *get_guid = priv->get_guid;
-		priv->guid = * ((GUID *)(get_guid->param_getfcn
-					      (gsl->selected_item, get_guid)));
-		gnc_gui_component_watch_entity
-			(priv->component_id, &(priv->guid),
-			 QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
-	} else
-		priv->guid = *xaccGUIDNULL ();
+    if (selection)
+    {
+        const QofParam *get_guid = priv->get_guid;
+        priv->guid = * ((GUID *)(get_guid->param_getfcn
+                                 (gsl->selected_item, get_guid)));
+        gnc_gui_component_watch_entity
+        (priv->component_id, &(priv->guid),
+         QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
+    }
+    else
+        priv->guid = *xaccGUIDNULL ();
 }
 
 /**
@@ -543,17 +556,17 @@
 gpointer
 gnc_general_search_get_selected (GNCGeneralSearch *gsl)
 {
-	g_return_val_if_fail(gsl != NULL, NULL);
-	g_return_val_if_fail(GNC_IS_GENERAL_SEARCH(gsl), NULL);
+    g_return_val_if_fail(gsl != NULL, NULL);
+    g_return_val_if_fail(GNC_IS_GENERAL_SEARCH(gsl), NULL);
 
-	return gsl->selected_item;
+    return gsl->selected_item;
 }
 
 void
 gnc_general_search_allow_clear (GNCGeneralSearch *gsl, gboolean allow_clear)
 {
-	g_return_if_fail (GNC_IS_GENERAL_SEARCH (gsl));
-	gsl->allow_clear = allow_clear;
+    g_return_if_fail (GNC_IS_GENERAL_SEARCH (gsl));
+    gsl->allow_clear = allow_clear;
 }
 
 /*

Modified: gnucash/trunk/src/gnome-search/gnc-general-search.h
===================================================================
--- gnucash/trunk/src/gnome-search/gnc-general-search.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/gnc-general-search.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -54,35 +54,37 @@
  */
 typedef GNCSearchWindow *(*GNCSearchCB) (gpointer start, gpointer user_data);
 
-typedef struct {
-  GtkHBox hbox;
+typedef struct
+{
+    GtkHBox hbox;
 
-  GtkWidget *	entry;  /* display of selection name */
-  GtkWidget *	button; /* button for popping up search window */
+    GtkWidget *	entry;  /* display of selection name */
+    GtkWidget *	button; /* button for popping up search window */
 
-  gpointer	selected_item;
+    gpointer	selected_item;
 
-  gboolean		allow_clear;
+    gboolean		allow_clear;
 } GNCGeneralSearch;
 
-typedef struct {
-  GtkHBoxClass parent_class;
+typedef struct
+{
+    GtkHBoxClass parent_class;
 
-  void 		(*changed) (GNCGeneralSearch *edit);
+    void 		(*changed) (GNCGeneralSearch *edit);
 } GNCGeneralSearchClass;
 
 
 GtkWidget *gnc_general_search_new            (GNCIdTypeConst type,
-					      const char *label,
-					      gboolean text_editable,
-					      GNCSearchCB search_cb,
-					      gpointer user_data,
-					      QofBook *book);
+        const char *label,
+        gboolean text_editable,
+        GNCSearchCB search_cb,
+        gpointer user_data,
+        QofBook *book);
 
 void	   gnc_general_search_allow_clear    (GNCGeneralSearch *gsl,
-					      gboolean allow_clear);
+        gboolean allow_clear);
 void       gnc_general_search_set_selected   (GNCGeneralSearch *gsl,
-					      gpointer searched);
+        gpointer searched);
 gpointer   gnc_general_search_get_selected   (GNCGeneralSearch *gsl);
 
 GType      gnc_general_search_get_type       (void);

Modified: gnucash/trunk/src/gnome-search/gncmod-gnome-search.c
===================================================================
--- gnucash/trunk/src/gnome-search/gncmod-gnome-search.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/gncmod-gnome-search.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -49,44 +49,48 @@
 char *
 libgncmod_gnome_search_gnc_module_path(void)
 {
-  return g_strdup("gnucash/gnome-search");
+    return g_strdup("gnucash/gnome-search");
 }
 
 char *
 libgncmod_gnome_search_gnc_module_description(void)
 {
-  return g_strdup("The GnuCash Gnome Search UI");
+    return g_strdup("The GnuCash Gnome Search UI");
 }
 
 int
 libgncmod_gnome_search_gnc_module_init(int refcount)
 {
-  /* load the engine (we depend on it) */
-  if(!gnc_module_load("gnucash/engine", 0)) {
-    return FALSE;
-  }
+    /* load the engine (we depend on it) */
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
 
-  if (!gnc_module_load("gnucash/gnome-utils", 0)) {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
 
-  if(refcount == 0)
-  {
-    /* initialize known types */
-    gnc_search_core_initialize ();
-  }
+    if (refcount == 0)
+    {
+        /* initialize known types */
+        gnc_search_core_initialize ();
+    }
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_gnome_search_gnc_module_end(int refcount) {
-  /* XXX Unload the other modules */
+libgncmod_gnome_search_gnc_module_end(int refcount)
+{
+    /* XXX Unload the other modules */
 
-  if (refcount == 0) {
-    /* Shutdown */
-    gnc_search_core_finalize ();
-  }
+    if (refcount == 0)
+    {
+        /* Shutdown */
+        gnc_search_core_finalize ();
+    }
 
-  return TRUE;
+    return TRUE;
 }

Modified: gnucash/trunk/src/gnome-search/search-account.c
===================================================================
--- gnucash/trunk/src/gnome-search/search-account.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-account.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -48,9 +48,10 @@
 
 typedef struct _GNCSearchAccountPrivate GNCSearchAccountPrivate;
 
-struct _GNCSearchAccountPrivate {
-  gboolean	match_all;
-  GList *	selected_accounts;
+struct _GNCSearchAccountPrivate
+{
+    gboolean	match_all;
+    GList *	selected_accounts;
 };
 
 #define _PRIVATE(o) \
@@ -62,285 +63,293 @@
 GType
 gnc_search_account_get_type (void)
 {
-  static GType type = 0;
-	
-  if (!type) {
-    GTypeInfo type_info = {
-      sizeof(GNCSearchAccountClass),    /* class_size */
-      NULL,   				/* base_init */
-      NULL,				/* base_finalize */
-      (GClassInitFunc)gnc_search_account_class_init,
-      NULL,				/* class_finalize */
-      NULL,				/* class_data */
-      sizeof(GNCSearchAccount),		/* */
-      0,				/* n_preallocs */
-      (GInstanceInitFunc)gnc_search_account_init,
-    };
-		
-    type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
-				   "GNCSearchAccount",
-				   &type_info, 0);
-  }
-	
-  return type;
+    static GType type = 0;
+
+    if (!type)
+    {
+        GTypeInfo type_info =
+        {
+            sizeof(GNCSearchAccountClass),    /* class_size */
+            NULL,   				/* base_init */
+            NULL,				/* base_finalize */
+            (GClassInitFunc)gnc_search_account_class_init,
+            NULL,				/* class_finalize */
+            NULL,				/* class_data */
+            sizeof(GNCSearchAccount),		/* */
+            0,				/* n_preallocs */
+            (GInstanceInitFunc)gnc_search_account_init,
+        };
+
+        type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
+                                       "GNCSearchAccount",
+                                       &type_info, 0);
+    }
+
+    return type;
 }
 
 static void
 gnc_search_account_class_init (GNCSearchAccountClass *class)
 {
-  GObjectClass *object_class;
-  GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
+    GObjectClass *object_class;
+    GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
 
-  object_class = G_OBJECT_CLASS (class);
-  parent_class = g_type_class_peek_parent (class);
+    object_class = G_OBJECT_CLASS (class);
+    parent_class = g_type_class_peek_parent (class);
 
-  object_class->finalize = gnc_search_account_finalize;
+    object_class->finalize = gnc_search_account_finalize;
 
-  /* override methods */
-  gnc_search_core_type->validate = gncs_validate;
-  gnc_search_core_type->get_widget = gncs_get_widget;
-  gnc_search_core_type->get_predicate = gncs_get_predicate;
-  gnc_search_core_type->clone = gncs_clone;
+    /* override methods */
+    gnc_search_core_type->validate = gncs_validate;
+    gnc_search_core_type->get_widget = gncs_get_widget;
+    gnc_search_core_type->get_predicate = gncs_get_predicate;
+    gnc_search_core_type->clone = gncs_clone;
 
-  g_type_class_add_private(class, sizeof(GNCSearchAccountPrivate));
+    g_type_class_add_private(class, sizeof(GNCSearchAccountPrivate));
 }
 
 static void
 gnc_search_account_init (GNCSearchAccount *o)
 {
-  o->how = GUID_MATCH_ANY;
+    o->how = GUID_MATCH_ANY;
 }
 
 static void
 gnc_search_account_finalize (GObject *obj)
 {
-  GNCSearchAccount *o = (GNCSearchAccount *)obj;
-  g_assert (IS_GNCSEARCH_ACCOUNT (o));
+    GNCSearchAccount *o = (GNCSearchAccount *)obj;
+    g_assert (IS_GNCSEARCH_ACCOUNT (o));
 
-  G_OBJECT_CLASS (parent_class)->finalize(obj);
+    G_OBJECT_CLASS (parent_class)->finalize(obj);
 }
 
 /**
  * gnc_search_account_new:
  *
  * Create a new GNCSearchAccount object.
- * 
+ *
  * Return value: A new #GNCSearchAccount object.
  **/
 GNCSearchAccount *
 gnc_search_account_new (void)
 {
-  GNCSearchAccount *o = g_object_new(GNC_TYPE_SEARCH_ACCOUNT, NULL);
-  return o;
+    GNCSearchAccount *o = g_object_new(GNC_TYPE_SEARCH_ACCOUNT, NULL);
+    return o;
 }
 
 /**
  * gnc_search_account_matchall_new:
  *
  * Create a new GNCSearchAccount object.
- * 
+ *
  * Return value: A new #GNCSearchAccount object.
  **/
 GNCSearchAccount *
 gnc_search_account_matchall_new (void)
 {
-  GNCSearchAccount *o;
-  GNCSearchAccountPrivate *priv;
+    GNCSearchAccount *o;
+    GNCSearchAccountPrivate *priv;
 
-  o = g_object_new(GNC_TYPE_SEARCH_ACCOUNT, NULL);
-  priv = _PRIVATE(o);
-  priv->match_all = TRUE;
-  o->how = GUID_MATCH_ALL;
-  return o;
+    o = g_object_new(GNC_TYPE_SEARCH_ACCOUNT, NULL);
+    priv = _PRIVATE(o);
+    priv->match_all = TRUE;
+    o->how = GUID_MATCH_ALL;
+    return o;
 }
 
 static gboolean
 gncs_validate (GNCSearchCoreType *fe)
 {
-  GNCSearchAccount *fi = (GNCSearchAccount *)fe;
-  GNCSearchAccountPrivate *priv;
-  gboolean valid = TRUE;
+    GNCSearchAccount *fi = (GNCSearchAccount *)fe;
+    GNCSearchAccountPrivate *priv;
+    gboolean valid = TRUE;
 
-  g_return_val_if_fail (fi, FALSE);
-  g_return_val_if_fail (IS_GNCSEARCH_ACCOUNT (fi), FALSE);
-	
-  priv = _PRIVATE(fi);
-  if (priv->selected_accounts == NULL && fi->how ) {
-    valid = FALSE;
-    gnc_error_dialog (NULL, "%s", _("You have not selected any accounts"));
-  }
+    g_return_val_if_fail (fi, FALSE);
+    g_return_val_if_fail (IS_GNCSEARCH_ACCOUNT (fi), FALSE);
 
-  /* XXX */
+    priv = _PRIVATE(fi);
+    if (priv->selected_accounts == NULL && fi->how )
+    {
+        valid = FALSE;
+        gnc_error_dialog (NULL, "%s", _("You have not selected any accounts"));
+    }
 
-  return valid;
+    /* XXX */
+
+    return valid;
 }
 
 static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
-  GNCSearchAccount *fi = (GNCSearchAccount *)fe;
-  GNCSearchAccountPrivate *priv;
-  GtkComboBox *combo;
-  int initial = 0;
+    GNCSearchAccount *fi = (GNCSearchAccount *)fe;
+    GNCSearchAccountPrivate *priv;
+    GtkComboBox *combo;
+    int initial = 0;
 
-  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+    combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
 
-  priv = _PRIVATE(fi);
-  if (priv->match_all) {
-    gnc_combo_box_search_add(combo, _("matches all accounts"), GUID_MATCH_ALL);
-    initial = GUID_MATCH_ALL;
-  } else {
-    gnc_combo_box_search_add(combo, _("matches any account"), GUID_MATCH_ANY);
-    gnc_combo_box_search_add(combo, _("matches no accounts"), GUID_MATCH_NONE);
-    initial = GUID_MATCH_ANY;
-  }
+    priv = _PRIVATE(fi);
+    if (priv->match_all)
+    {
+        gnc_combo_box_search_add(combo, _("matches all accounts"), GUID_MATCH_ALL);
+        initial = GUID_MATCH_ALL;
+    }
+    else
+    {
+        gnc_combo_box_search_add(combo, _("matches any account"), GUID_MATCH_ANY);
+        gnc_combo_box_search_add(combo, _("matches no accounts"), GUID_MATCH_NONE);
+        initial = GUID_MATCH_ANY;
+    }
 
-  gnc_combo_box_search_changed(combo, &fi->how);
-  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : initial);
+    gnc_combo_box_search_changed(combo, &fi->how);
+    gnc_combo_box_search_set_active(combo, fi->how ? fi->how : initial);
 
-  return GTK_WIDGET(combo);
+    return GTK_WIDGET(combo);
 }
 
 static char *
 describe_button (GNCSearchAccount *fi)
 {
-  GNCSearchAccountPrivate *priv;
+    GNCSearchAccountPrivate *priv;
 
-  priv = _PRIVATE(fi);
-  if (priv->selected_accounts)
-    return (_("Selected Accounts"));
-  return (_("Choose Accounts"));
+    priv = _PRIVATE(fi);
+    if (priv->selected_accounts)
+        return (_("Selected Accounts"));
+    return (_("Choose Accounts"));
 }
 
 static void
 button_clicked (GtkButton *button, GNCSearchAccount *fi)
 {
-  GNCSearchAccountPrivate *priv;
-  GtkDialog *dialog;
-  GtkWidget *account_tree;
-  GtkWidget *accounts_scroller;
-  GtkWidget *label;
-  char *desc;
-  GtkTreeSelection *selection;
+    GNCSearchAccountPrivate *priv;
+    GtkDialog *dialog;
+    GtkWidget *account_tree;
+    GtkWidget *accounts_scroller;
+    GtkWidget *label;
+    char *desc;
+    GtkTreeSelection *selection;
 
-  /* Create the account tree */
-  account_tree = GTK_WIDGET(gnc_tree_view_account_new (FALSE));
-  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(account_tree), FALSE);
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(account_tree));
-  gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
+    /* Create the account tree */
+    account_tree = GTK_WIDGET(gnc_tree_view_account_new (FALSE));
+    gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(account_tree), FALSE);
+    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(account_tree));
+    gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
 
-  /* Select the currently-selected accounts */
-  priv = _PRIVATE(fi);
-  if (priv->selected_accounts)
-    gnc_tree_view_account_set_selected_accounts (GNC_TREE_VIEW_ACCOUNT(account_tree),
-						 priv->selected_accounts, FALSE);
+    /* Select the currently-selected accounts */
+    priv = _PRIVATE(fi);
+    if (priv->selected_accounts)
+        gnc_tree_view_account_set_selected_accounts (GNC_TREE_VIEW_ACCOUNT(account_tree),
+                priv->selected_accounts, FALSE);
 
-  /* Create the account scroller and put the tree in it */
-  accounts_scroller = gtk_scrolled_window_new (NULL, NULL);
-  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(accounts_scroller),
-				  GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-  gtk_container_add(GTK_CONTAINER(accounts_scroller), account_tree);
-  gtk_widget_set_size_request(GTK_WIDGET(accounts_scroller), 300, 300);
+    /* Create the account scroller and put the tree in it */
+    accounts_scroller = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(accounts_scroller),
+                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    gtk_container_add(GTK_CONTAINER(accounts_scroller), account_tree);
+    gtk_widget_set_size_request(GTK_WIDGET(accounts_scroller), 300, 300);
 
-  /* Create the label */
-  label = gtk_label_new (_("Select Accounts to Match"));
+    /* Create the label */
+    label = gtk_label_new (_("Select Accounts to Match"));
 
-  /* Create the dialog */
-  dialog =
-    GTK_DIALOG(gtk_dialog_new_with_buttons(_("Select the Accounts to Compare"),
-					   NULL,
-					   0,
-					   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-					   GTK_STOCK_OK, GTK_RESPONSE_OK,
-					   NULL));
+    /* Create the dialog */
+    dialog =
+        GTK_DIALOG(gtk_dialog_new_with_buttons(_("Select the Accounts to Compare"),
+                   NULL,
+                   0,
+                   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                   GTK_STOCK_OK, GTK_RESPONSE_OK,
+                   NULL));
 
-  /* Put the dialog together */
-  gtk_box_pack_start ((GtkBox *)dialog->vbox, label,
-		      FALSE, FALSE, 3);
-  gtk_box_pack_start ((GtkBox *)dialog->vbox, accounts_scroller,
-		      TRUE, TRUE, 3);
+    /* Put the dialog together */
+    gtk_box_pack_start ((GtkBox *)dialog->vbox, label,
+                        FALSE, FALSE, 3);
+    gtk_box_pack_start ((GtkBox *)dialog->vbox, accounts_scroller,
+                        TRUE, TRUE, 3);
 
-  gtk_widget_show_all (GTK_WIDGET (dialog));
+    gtk_widget_show_all (GTK_WIDGET (dialog));
 
-  /* Now run the dialog */
-  if (gtk_dialog_run (dialog) == GTK_RESPONSE_OK) {
-    if (priv->selected_accounts)
-      g_list_free (priv->selected_accounts);
+    /* Now run the dialog */
+    if (gtk_dialog_run (dialog) == GTK_RESPONSE_OK)
+    {
+        if (priv->selected_accounts)
+            g_list_free (priv->selected_accounts);
 
-    priv->selected_accounts =
-      gnc_tree_view_account_get_selected_accounts (GNC_TREE_VIEW_ACCOUNT (account_tree));
+        priv->selected_accounts =
+            gnc_tree_view_account_get_selected_accounts (GNC_TREE_VIEW_ACCOUNT (account_tree));
 
-    desc = describe_button (fi);
-    gtk_label_set_text (GTK_LABEL (GTK_BIN (button)->child), desc);
-  }
+        desc = describe_button (fi);
+        gtk_label_set_text (GTK_LABEL (GTK_BIN (button)->child), desc);
+    }
 
-  gtk_widget_destroy (GTK_WIDGET (dialog));
+    gtk_widget_destroy (GTK_WIDGET (dialog));
 }
 
 static GtkWidget *
 gncs_get_widget (GNCSearchCoreType *fe)
 {
-  GtkWidget *button, *label, *menu, *box;
-  GNCSearchAccount *fi = (GNCSearchAccount *)fe;
-  char *desc;
-	
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_ACCOUNT (fi), NULL);
+    GtkWidget *button, *label, *menu, *box;
+    GNCSearchAccount *fi = (GNCSearchAccount *)fe;
+    char *desc;
 
-  box = gtk_hbox_new (FALSE, 3);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_ACCOUNT (fi), NULL);
 
-  /* Build and connect the option menu */
-  menu = make_menu (fe);
-  gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
+    box = gtk_hbox_new (FALSE, 3);
 
-  /* Build and connect the account entry window */
-  desc = describe_button (fi);
-  label = gtk_label_new (desc);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
+    /* Build and connect the option menu */
+    menu = make_menu (fe);
+    gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
 
-  button = gtk_button_new ();
-  gtk_container_add (GTK_CONTAINER (button), label);
-  g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (button_clicked), fe);
-  gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 3);
+    /* Build and connect the account entry window */
+    desc = describe_button (fi);
+    label = gtk_label_new (desc);
+    gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
 
-  /* And return the box */
-  return box;
+    button = gtk_button_new ();
+    gtk_container_add (GTK_CONTAINER (button), label);
+    g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (button_clicked), fe);
+    gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 3);
+
+    /* And return the box */
+    return box;
 }
 
 static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe)
 {
-  GNCSearchAccountPrivate *priv;
-  GNCSearchAccount *fi = (GNCSearchAccount *)fe;
-  GList *l = NULL, *node;
+    GNCSearchAccountPrivate *priv;
+    GNCSearchAccount *fi = (GNCSearchAccount *)fe;
+    GList *l = NULL, *node;
 
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_ACCOUNT (fi), NULL);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_ACCOUNT (fi), NULL);
 
-  priv = _PRIVATE(fi);
-  for (node = priv->selected_accounts; node; node = node->next) {
-    Account *acc = node->data;
-    const GUID *guid = xaccAccountGetGUID (acc);
-    l = g_list_prepend (l, (gpointer)guid);
-  }
-  l = g_list_reverse (l);
+    priv = _PRIVATE(fi);
+    for (node = priv->selected_accounts; node; node = node->next)
+    {
+        Account *acc = node->data;
+        const GUID *guid = xaccAccountGetGUID (acc);
+        l = g_list_prepend (l, (gpointer)guid);
+    }
+    l = g_list_reverse (l);
 
-  return gncQueryGUIDPredicate (fi->how, l);
+    return gncQueryGUIDPredicate (fi->how, l);
 }
 
 static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
 {
-  GNCSearchAccount *se, *fse = (GNCSearchAccount *)fe;
-  GNCSearchAccountPrivate *se_priv, *fse_priv;
+    GNCSearchAccount *se, *fse = (GNCSearchAccount *)fe;
+    GNCSearchAccountPrivate *se_priv, *fse_priv;
 
-  g_return_val_if_fail (fse, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_ACCOUNT (fse), NULL);
-  fse_priv = _PRIVATE(fse);
+    g_return_val_if_fail (fse, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_ACCOUNT (fse), NULL);
+    fse_priv = _PRIVATE(fse);
 
-  se = gnc_search_account_new ();
-  se_priv = _PRIVATE(se);
-  se->how = fse->how;
-  se_priv->match_all = fse_priv->match_all;
-  se_priv->selected_accounts = g_list_copy (fse_priv->selected_accounts);
+    se = gnc_search_account_new ();
+    se_priv = _PRIVATE(se);
+    se->how = fse->how;
+    se_priv->match_all = fse_priv->match_all;
+    se_priv->selected_accounts = g_list_copy (fse_priv->selected_accounts);
 
-  return (GNCSearchCoreType *)se;
+    return (GNCSearchCoreType *)se;
 }

Modified: gnucash/trunk/src/gnome-search/search-account.h
===================================================================
--- gnucash/trunk/src/gnome-search/search-account.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-account.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -32,18 +32,20 @@
 typedef struct _GNCSearchAccount	GNCSearchAccount;
 typedef struct _GNCSearchAccountClass	GNCSearchAccountClass;
 
-struct _GNCSearchAccount {
-  GNCSearchCoreType parent;
+struct _GNCSearchAccount
+{
+    GNCSearchCoreType parent;
 
-  guid_match_t	how;
+    guid_match_t	how;
 };
 
-struct _GNCSearchAccountClass {
-  GNCSearchCoreTypeClass parent_class;
+struct _GNCSearchAccountClass
+{
+    GNCSearchCoreTypeClass parent_class;
 
-  /* virtual methods */
+    /* virtual methods */
 
-  /* signals */
+    /* signals */
 };
 
 GType		gnc_search_account_get_type	(void);

Modified: gnucash/trunk/src/gnome-search/search-boolean.c
===================================================================
--- gnucash/trunk/src/gnome-search/search-boolean.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-boolean.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -45,8 +45,9 @@
 
 typedef struct _GNCSearchBooleanPrivate GNCSearchBooleanPrivate;
 
-struct _GNCSearchBooleanPrivate {
-  gpointer dummy;
+struct _GNCSearchBooleanPrivate
+{
+    gpointer dummy;
 };
 
 #define _PRIVATE(o) \
@@ -57,176 +58,178 @@
 GType
 gnc_search_boolean_get_type (void)
 {
-  static GType type = 0;
-	
-  if (!type) {
-    GTypeInfo type_info = {
-      sizeof(GNCSearchBooleanClass),    /* class_size */
-      NULL,   				/* base_init */
-      NULL,				/* base_finalize */
-      (GClassInitFunc)gnc_search_boolean_class_init,
-      NULL,				/* class_finalize */
-      NULL,				/* class_data */
-      sizeof(GNCSearchBoolean),		/* */
-      0,				/* n_preallocs */
-      (GInstanceInitFunc)gnc_search_boolean_init,
-    };
-		
-    type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
-				   "GNCSearchBoolean",
-				   &type_info, 0);
-  }
-	
-  return type;
+    static GType type = 0;
+
+    if (!type)
+    {
+        GTypeInfo type_info =
+        {
+            sizeof(GNCSearchBooleanClass),    /* class_size */
+            NULL,   				/* base_init */
+            NULL,				/* base_finalize */
+            (GClassInitFunc)gnc_search_boolean_class_init,
+            NULL,				/* class_finalize */
+            NULL,				/* class_data */
+            sizeof(GNCSearchBoolean),		/* */
+            0,				/* n_preallocs */
+            (GInstanceInitFunc)gnc_search_boolean_init,
+        };
+
+        type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
+                                       "GNCSearchBoolean",
+                                       &type_info, 0);
+    }
+
+    return type;
 }
 
 static void
 gnc_search_boolean_class_init (GNCSearchBooleanClass *class)
 {
-  GObjectClass *object_class;
-  GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
+    GObjectClass *object_class;
+    GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
 
-  object_class = G_OBJECT_CLASS (class);
-  parent_class = g_type_class_peek_parent (class);
+    object_class = G_OBJECT_CLASS (class);
+    parent_class = g_type_class_peek_parent (class);
 
-  object_class->finalize = gnc_search_boolean_finalize;
+    object_class->finalize = gnc_search_boolean_finalize;
 
-  /* override methods */
-  gnc_search_core_type->validate = gncs_validate;
-  gnc_search_core_type->get_widget = gncs_get_widget;
-  gnc_search_core_type->get_predicate = gncs_get_predicate;
-  gnc_search_core_type->clone = gncs_clone;
+    /* override methods */
+    gnc_search_core_type->validate = gncs_validate;
+    gnc_search_core_type->get_widget = gncs_get_widget;
+    gnc_search_core_type->get_predicate = gncs_get_predicate;
+    gnc_search_core_type->clone = gncs_clone;
 
-  g_type_class_add_private(class, sizeof(GNCSearchBooleanPrivate));
+    g_type_class_add_private(class, sizeof(GNCSearchBooleanPrivate));
 }
 
 static void
 gnc_search_boolean_init (GNCSearchBoolean *o)
 {
-  o->how = COMPARE_EQUAL;
-  o->value = TRUE;
+    o->how = COMPARE_EQUAL;
+    o->value = TRUE;
 }
 
 static void
 gnc_search_boolean_finalize (GObject *obj)
 {
-  GNCSearchBoolean *o = (GNCSearchBoolean *)obj;
-  g_assert (IS_GNCSEARCH_BOOLEAN (o));
+    GNCSearchBoolean *o = (GNCSearchBoolean *)obj;
+    g_assert (IS_GNCSEARCH_BOOLEAN (o));
 
-  G_OBJECT_CLASS (parent_class)->finalize(obj);
+    G_OBJECT_CLASS (parent_class)->finalize(obj);
 }
 
 /**
  * gnc_search_boolean_new:
  *
  * Create a new GNCSearchBoolean object.
- * 
+ *
  * Return value: A new #GNCSearchBoolean object.
  **/
 GNCSearchBoolean *
 gnc_search_boolean_new (void)
 {
-  GNCSearchBoolean *o = g_object_new(GNC_TYPE_SEARCH_BOOLEAN, NULL);
-  return o;
+    GNCSearchBoolean *o = g_object_new(GNC_TYPE_SEARCH_BOOLEAN, NULL);
+    return o;
 }
 
 void
 gnc_search_boolean_set_value (GNCSearchBoolean *fi, gboolean value)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_BOOLEAN (fi));
-	
-  fi->value = value;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_BOOLEAN (fi));
+
+    fi->value = value;
 }
 
 void
 gnc_search_boolean_set_how (GNCSearchBoolean *fi, query_compare_t how)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_BOOLEAN (fi));
-  fi->how = how;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_BOOLEAN (fi));
+    fi->how = how;
 }
 
 static gboolean
 gncs_validate (GNCSearchCoreType *fe)
 {
-  GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
-  gboolean valid = TRUE;
+    GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
+    gboolean valid = TRUE;
 
-  g_return_val_if_fail (fi, FALSE);
-  g_return_val_if_fail (IS_GNCSEARCH_BOOLEAN (fi), FALSE);
-	
-  /* XXX */
+    g_return_val_if_fail (fi, FALSE);
+    g_return_val_if_fail (IS_GNCSEARCH_BOOLEAN (fi), FALSE);
 
-  return valid;
+    /* XXX */
+
+    return valid;
 }
 
 static void
 toggle_changed (GtkToggleButton *button, GNCSearchBoolean *fe)
 {
-  fe->value = gtk_toggle_button_get_active (button);
+    fe->value = gtk_toggle_button_get_active (button);
 }
 
 static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
-  GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
-  GtkComboBox *combo;
+    GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
+    GtkComboBox *combo;
 
-  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
-  gnc_combo_box_search_add(combo, _("is"), COMPARE_EQUAL);
-  gnc_combo_box_search_add(combo, _("is not"), COMPARE_NEQ);
-  gnc_combo_box_search_changed(combo, &fi->how);
-  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_EQUAL);
+    combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+    gnc_combo_box_search_add(combo, _("is"), COMPARE_EQUAL);
+    gnc_combo_box_search_add(combo, _("is not"), COMPARE_NEQ);
+    gnc_combo_box_search_changed(combo, &fi->how);
+    gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_EQUAL);
 
-  return GTK_WIDGET(combo);
+    return GTK_WIDGET(combo);
 }
 
 static GtkWidget *
 gncs_get_widget (GNCSearchCoreType *fe)
 {
-  GtkWidget *toggle, *menu, *box;
-  GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
-	
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_BOOLEAN (fi), NULL);
+    GtkWidget *toggle, *menu, *box;
+    GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
 
-  box = gtk_hbox_new (FALSE, 3);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_BOOLEAN (fi), NULL);
 
-  /* Build and connect the option menu */
-  menu = make_menu (fe);
-  gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
+    box = gtk_hbox_new (FALSE, 3);
 
-  /* Build and connect the toggle */
-  toggle = gtk_toggle_button_new_with_label (_("set true"));
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), fi->value);
-  g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_changed), fe);
-  gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
+    /* Build and connect the option menu */
+    menu = make_menu (fe);
+    gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
 
-  /* And return the box */
-  return box;
+    /* Build and connect the toggle */
+    toggle = gtk_toggle_button_new_with_label (_("set true"));
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), fi->value);
+    g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_changed), fe);
+    gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
+
+    /* And return the box */
+    return box;
 }
 
 static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe)
 {
-  GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
+    GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
 
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_BOOLEAN (fi), NULL);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_BOOLEAN (fi), NULL);
 
-  return gncQueryBooleanPredicate (fi->how, fi->value);
+    return gncQueryBooleanPredicate (fi->how, fi->value);
 }
 
 static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
 {
-  GNCSearchBoolean *se, *fse = (GNCSearchBoolean *)fe;
+    GNCSearchBoolean *se, *fse = (GNCSearchBoolean *)fe;
 
-  g_return_val_if_fail (fse, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_BOOLEAN (fse), NULL);
+    g_return_val_if_fail (fse, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_BOOLEAN (fse), NULL);
 
-  se = gnc_search_boolean_new ();
-  gnc_search_boolean_set_value (se, fse->value);
-  gnc_search_boolean_set_how (se, fse->how);
+    se = gnc_search_boolean_new ();
+    gnc_search_boolean_set_value (se, fse->value);
+    gnc_search_boolean_set_how (se, fse->how);
 
-  return (GNCSearchCoreType *)se;
+    return (GNCSearchCoreType *)se;
 }

Modified: gnucash/trunk/src/gnome-search/search-boolean.h
===================================================================
--- gnucash/trunk/src/gnome-search/search-boolean.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-boolean.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -32,19 +32,21 @@
 typedef struct _GNCSearchBoolean	GNCSearchBoolean;
 typedef struct _GNCSearchBooleanClass	GNCSearchBooleanClass;
 
-struct _GNCSearchBoolean {
-  GNCSearchCoreType parent;
+struct _GNCSearchBoolean
+{
+    GNCSearchCoreType parent;
 
-  query_compare_t	how;
-  gboolean		value;
+    query_compare_t	how;
+    gboolean		value;
 };
 
-struct _GNCSearchBooleanClass {
-  GNCSearchCoreTypeClass parent_class;
+struct _GNCSearchBooleanClass
+{
+    GNCSearchCoreTypeClass parent_class;
 
-  /* virtual methods */
+    /* virtual methods */
 
-  /* signals */
+    /* signals */
 };
 
 GType		gnc_search_boolean_get_type	(void);

Modified: gnucash/trunk/src/gnome-search/search-core-type.c
===================================================================
--- gnucash/trunk/src/gnome-search/search-core-type.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-core-type.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -50,8 +50,9 @@
 
 typedef struct _GNCSearchCoreTypePrivate GNCSearchCoreTypePrivate;
 
-struct _GNCSearchCoreTypePrivate {
-  gpointer dummy;
+struct _GNCSearchCoreTypePrivate
+{
+    gpointer dummy;
 };
 
 #define _PRIVATE(o) \
@@ -64,43 +65,45 @@
 GType
 gnc_search_core_type_get_type (void)
 {
-  static GType type = 0;
+    static GType type = 0;
 
-  if (type == 0) {
-    GTypeInfo type_info = {
-      sizeof (GNCSearchCoreTypeClass),
-      NULL,
-      NULL,
-      (GClassInitFunc)gnc_search_core_type_class_init,
-      NULL,
-      NULL,
-      sizeof (GNCSearchCoreType),
-      0,
-      (GInstanceInitFunc)gnc_search_core_type_init
-    };
-		
-    type = g_type_register_static (G_TYPE_OBJECT, "GNCSearchCoreType", &type_info, 0);
-  }
-  
-  return type;
+    if (type == 0)
+    {
+        GTypeInfo type_info =
+        {
+            sizeof (GNCSearchCoreTypeClass),
+            NULL,
+            NULL,
+            (GClassInitFunc)gnc_search_core_type_class_init,
+            NULL,
+            NULL,
+            sizeof (GNCSearchCoreType),
+            0,
+            (GInstanceInitFunc)gnc_search_core_type_init
+        };
+
+        type = g_type_register_static (G_TYPE_OBJECT, "GNCSearchCoreType", &type_info, 0);
+    }
+
+    return type;
 }
 
 static void
 gnc_search_core_type_class_init (GNCSearchCoreTypeClass *klass)
 {
-  GObjectClass *object_class;
-	
-  object_class = G_OBJECT_CLASS (klass);
-  parent_class = g_type_class_peek_parent (klass);
+    GObjectClass *object_class;
 
-  object_class->finalize = gnc_search_core_type_finalize;
+    object_class = G_OBJECT_CLASS (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-  /* override methods */
-  klass->validate = validate;
-  klass->grab_focus = grab_focus;
-  klass->editable_enters = editable_enters;
+    object_class->finalize = gnc_search_core_type_finalize;
 
-  g_type_class_add_private(klass, sizeof(GNCSearchCoreTypePrivate));
+    /* override methods */
+    klass->validate = validate;
+    klass->grab_focus = grab_focus;
+    klass->editable_enters = editable_enters;
+
+    g_type_class_add_private(klass, sizeof(GNCSearchCoreTypePrivate));
 }
 
 static void
@@ -111,186 +114,189 @@
 static void
 gnc_search_core_type_finalize (GObject *obj)
 {
-  GNCSearchCoreType *o = (GNCSearchCoreType *)obj;
-  g_assert (GNC_IS_SEARCH_CORE_TYPE (o));
+    GNCSearchCoreType *o = (GNCSearchCoreType *)obj;
+    g_assert (GNC_IS_SEARCH_CORE_TYPE (o));
 
-  G_OBJECT_CLASS (parent_class)->finalize(obj);
+    G_OBJECT_CLASS (parent_class)->finalize(obj);
 }
 
 /**
  * gnc_search_core_type_new:
  *
  * Create a new GNCSearchCoreType object.
- * 
+ *
  * Return value: A new #GNCSearchCoreType object.
  **/
 GNCSearchCoreType *
 gnc_search_core_type_new (void)
 {
-  GNCSearchCoreType *o;
+    GNCSearchCoreType *o;
 
-  o = g_object_new (GNC_TYPE_SEARCH_CORE_TYPE, NULL);
+    o = g_object_new (GNC_TYPE_SEARCH_CORE_TYPE, NULL);
 
-  return o;
+    return o;
 }
 
 void
 gnc_search_core_type_editable_enters (GNCSearchCoreType *fe)
 {
-  GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->editable_enters (fe);
+    GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->editable_enters (fe);
 }
 
 void
 gnc_search_core_type_grab_focus (GNCSearchCoreType *fe)
 {
-  GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->grab_focus (fe);
+    GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->grab_focus (fe);
 }
 
 gboolean
 gnc_search_core_type_validate (GNCSearchCoreType *fe)
 {
-  return GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->validate (fe);
+    return GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->validate (fe);
 }
 
 /**
  * gnc_search_core_type_clone:
  * @fe: search core_type
- * 
+ *
  * Clones the GNCSearchCoreType @fe.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 GNCSearchCoreType *
 gnc_search_core_type_clone (GNCSearchCoreType *fe)
 {
-  return GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->clone(fe);
+    return GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->clone(fe);
 }
 
 /**
  * gnc_search_core_type_get_widget:
  * @fe: search core_type
  * @node: xml node
- * 
+ *
  * Create a widget to represent this core_type.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 GtkWidget *
 gnc_search_core_type_get_widget (GNCSearchCoreType *fe)
 {
-  return GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->get_widget(fe);
+    return GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->get_widget(fe);
 }
 
 /**
  * gnc_search_core_type_get_predicate:
  * @fe: search core_type
- * 
+ *
  * Create a Predicate Data that matches this core_type
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 QueryPredData_t
 gnc_search_core_type_get_predicate (GNCSearchCoreType *fe)
 {
-  return GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->get_predicate(fe);
+    return GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->get_predicate(fe);
 }
 
 /**
  * gnc_search_core_type_new_type_name:
  * @type: search core_type type
- * 
+ *
  * Create a new search core_type based on its type name.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 GNCSearchCoreType *
 gnc_search_core_type_new_type_name (const char *type)
 {
-  GNCSearchCoreNew fcn;
+    GNCSearchCoreNew fcn;
 
-  g_return_val_if_fail (typeTable != NULL, NULL);
+    g_return_val_if_fail (typeTable != NULL, NULL);
 
-  if (type == NULL)
-    return NULL;
+    if (type == NULL)
+        return NULL;
 
-  fcn = g_hash_table_lookup (typeTable, type);
-  if (fcn) {
-    return ((fcn)());
-  } else {
-    g_warning("Unknown search type '%s'", type);
-    return NULL;
-  }
+    fcn = g_hash_table_lookup (typeTable, type);
+    if (fcn)
+    {
+        return ((fcn)());
+    }
+    else
+    {
+        g_warning("Unknown search type '%s'", type);
+        return NULL;
+    }
 }
 
 /* default implementations */
 static gboolean
 validate (GNCSearchCoreType *fe)
 {
-  return TRUE;
+    return TRUE;
 }
 
 static void
 grab_focus (GNCSearchCoreType *fe)
 {
-  return;
+    return;
 }
 
 static void
 editable_enters (GNCSearchCoreType *fe)
 {
-  return;
+    return;
 }
 
 void
 gnc_search_core_register_type (const char *type_name, GNCSearchCoreNew fcn)
 {
-  g_return_if_fail (type_name || *type_name || fcn);
-  g_return_if_fail (typeTable);
+    g_return_if_fail (type_name || *type_name || fcn);
+    g_return_if_fail (typeTable);
 
-  g_hash_table_insert (typeTable, (char *) type_name, (gpointer) fcn);
+    g_hash_table_insert (typeTable, (char *) type_name, (gpointer) fcn);
 }
 
 static void
 init_table (void)
 {
-  gnc_search_core_register_type (QUERYCORE_STRING,
-				 (GNCSearchCoreNew) gnc_search_string_new);
-  gnc_search_core_register_type (QUERYCORE_DATE,
-				 (GNCSearchCoreNew) gnc_search_date_new);
-  gnc_search_core_register_type (QUERYCORE_INT64,
-				 (GNCSearchCoreNew) gnc_search_int64_new);
-  gnc_search_core_register_type (QUERYCORE_DOUBLE,
-				 (GNCSearchCoreNew) gnc_search_double_new);
-  gnc_search_core_register_type (QUERYCORE_NUMERIC,
-				 (GNCSearchCoreNew) gnc_search_numeric_new);
-  gnc_search_core_register_type (QUERYCORE_DEBCRED,
-				 (GNCSearchCoreNew)
-				 gnc_search_numeric_debcred_new);
-  gnc_search_core_register_type (QUERYCORE_BOOLEAN,
-				 (GNCSearchCoreNew) gnc_search_boolean_new);
-  gnc_search_core_register_type (GNC_ID_ACCOUNT,
-				 (GNCSearchCoreNew) gnc_search_account_new);
-  gnc_search_core_register_type (ACCOUNT_MATCH_ALL_TYPE,
-				 (GNCSearchCoreNew)
-				 gnc_search_account_matchall_new);
-  gnc_search_core_register_type (RECONCILED_MATCH_TYPE,
-				 (GNCSearchCoreNew) gnc_search_reconciled_new);
+    gnc_search_core_register_type (QUERYCORE_STRING,
+                                   (GNCSearchCoreNew) gnc_search_string_new);
+    gnc_search_core_register_type (QUERYCORE_DATE,
+                                   (GNCSearchCoreNew) gnc_search_date_new);
+    gnc_search_core_register_type (QUERYCORE_INT64,
+                                   (GNCSearchCoreNew) gnc_search_int64_new);
+    gnc_search_core_register_type (QUERYCORE_DOUBLE,
+                                   (GNCSearchCoreNew) gnc_search_double_new);
+    gnc_search_core_register_type (QUERYCORE_NUMERIC,
+                                   (GNCSearchCoreNew) gnc_search_numeric_new);
+    gnc_search_core_register_type (QUERYCORE_DEBCRED,
+                                   (GNCSearchCoreNew)
+                                   gnc_search_numeric_debcred_new);
+    gnc_search_core_register_type (QUERYCORE_BOOLEAN,
+                                   (GNCSearchCoreNew) gnc_search_boolean_new);
+    gnc_search_core_register_type (GNC_ID_ACCOUNT,
+                                   (GNCSearchCoreNew) gnc_search_account_new);
+    gnc_search_core_register_type (ACCOUNT_MATCH_ALL_TYPE,
+                                   (GNCSearchCoreNew)
+                                   gnc_search_account_matchall_new);
+    gnc_search_core_register_type (RECONCILED_MATCH_TYPE,
+                                   (GNCSearchCoreNew) gnc_search_reconciled_new);
 }
 
 void
 gnc_search_core_initialize (void)
 {
-  g_return_if_fail (typeTable == NULL);
+    g_return_if_fail (typeTable == NULL);
 
-  typeTable = g_hash_table_new (g_str_hash, g_str_equal);
-  init_table ();
+    typeTable = g_hash_table_new (g_str_hash, g_str_equal);
+    init_table ();
 }
 
 void
 gnc_search_core_finalize (void)
 {
-  g_return_if_fail (typeTable != NULL);
+    g_return_if_fail (typeTable != NULL);
 
-  g_hash_table_destroy (typeTable);
-  typeTable = NULL;
+    g_hash_table_destroy (typeTable);
+    typeTable = NULL;
 }

Modified: gnucash/trunk/src/gnome-search/search-core-type.h
===================================================================
--- gnucash/trunk/src/gnome-search/search-core-type.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-core-type.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -31,24 +31,26 @@
 #define GNC_IS_SEARCH_CORE_TYPE(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_SEARCH_CORE_TYPE))
 #define GNC_SEARCH_CORE_TYPE_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreTypeClass))
 
-typedef struct {
-  GtkObject parent;
+typedef struct
+{
+    GtkObject parent;
 
-  GNCSearchParam *	param;
+    GNCSearchParam *	param;
 } GNCSearchCoreType;
 
-typedef struct {
-  GObjectClass parent_class;
+typedef struct
+{
+    GObjectClass parent_class;
 
-  /* virtual methods */
-  void			(*grab_focus) (GNCSearchCoreType *fe);
-  void			(*editable_enters) (GNCSearchCoreType *fe);
-  gboolean		(*validate) (GNCSearchCoreType *fe);
-  GNCSearchCoreType *	(*clone) (GNCSearchCoreType *fe);
-  GtkWidget *		(*get_widget) (GNCSearchCoreType *);
-  QueryPredData_t	(*get_predicate) (GNCSearchCoreType *);
+    /* virtual methods */
+    void			(*grab_focus) (GNCSearchCoreType *fe);
+    void			(*editable_enters) (GNCSearchCoreType *fe);
+    gboolean		(*validate) (GNCSearchCoreType *fe);
+    GNCSearchCoreType *	(*clone) (GNCSearchCoreType *fe);
+    GtkWidget *		(*get_widget) (GNCSearchCoreType *);
+    QueryPredData_t	(*get_predicate) (GNCSearchCoreType *);
 
-  /* signals */
+    /* signals */
 } GNCSearchCoreTypeClass;
 
 /* These are internal functions */
@@ -69,7 +71,7 @@
 /* Register a new type in the Core Type Database */
 typedef GNCSearchCoreType * (*GNCSearchCoreNew) (void);
 void gnc_search_core_register_type (const char *type_name,
-				    GNCSearchCoreNew fcn);
+                                    GNCSearchCoreNew fcn);
 
 
 /* Initialize and Finalize the Core Type Database */

Modified: gnucash/trunk/src/gnome-search/search-core-utils.c
===================================================================
--- gnucash/trunk/src/gnome-search/search-core-utils.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-core-utils.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -34,106 +34,109 @@
 static void
 search_combo_changed (GtkWidget *widget, gint *value)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  g_return_if_fail(GTK_IS_COMBO_BOX(widget));
-  g_return_if_fail(value);
+    g_return_if_fail(GTK_IS_COMBO_BOX(widget));
+    g_return_if_fail(value);
 
-  model = gtk_combo_box_get_model(GTK_COMBO_BOX(widget));
-  if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(widget), &iter))
-    return;
+    model = gtk_combo_box_get_model(GTK_COMBO_BOX(widget));
+    if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(widget), &iter))
+        return;
 
-  gtk_tree_model_get(model, &iter,
-		     GNC_COMBO_SEARCH_COL_VALUE, value,
-		     -1);
+    gtk_tree_model_get(model, &iter,
+                       GNC_COMBO_SEARCH_COL_VALUE, value,
+                       -1);
 }
 
 GtkWidget *
 gnc_combo_box_new_search (void)
 {
-  GtkWidget *combo;
-  GtkListStore *store;
-  GtkCellRenderer *renderer;
+    GtkWidget *combo;
+    GtkListStore *store;
+    GtkCellRenderer *renderer;
 
-  store = gtk_list_store_new(NUM_GNC_COMBO_SEARCH_COLS, G_TYPE_STRING, G_TYPE_UINT);
-  combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    store = gtk_list_store_new(NUM_GNC_COMBO_SEARCH_COLS, G_TYPE_STRING, G_TYPE_UINT);
+    combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-  renderer = gtk_cell_renderer_text_new ();
-  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
-  gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
-				  "text", GNC_COMBO_SEARCH_COL_TEXT,
-				  NULL);
-  return combo;
+    renderer = gtk_cell_renderer_text_new ();
+    gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
+    gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
+                                    "text", GNC_COMBO_SEARCH_COL_TEXT,
+                                    NULL);
+    return combo;
 }
 
 void
 gnc_combo_box_search_add (GtkComboBox *combo, const gchar *text, guint value)
 {
-  GtkListStore *store;
-  GtkTreeIter iter;
+    GtkListStore *store;
+    GtkTreeIter iter;
 
-  g_return_if_fail(GTK_IS_COMBO_BOX(combo));
-  g_return_if_fail(text);
+    g_return_if_fail(GTK_IS_COMBO_BOX(combo));
+    g_return_if_fail(text);
 
-  store = GTK_LIST_STORE(gtk_combo_box_get_model(combo));
-  gtk_list_store_append(store, &iter);
-  gtk_list_store_set(store, &iter,
-		     GNC_COMBO_SEARCH_COL_TEXT, text,
-		     GNC_COMBO_SEARCH_COL_VALUE, value,
-		     -1);
+    store = GTK_LIST_STORE(gtk_combo_box_get_model(combo));
+    gtk_list_store_append(store, &iter);
+    gtk_list_store_set(store, &iter,
+                       GNC_COMBO_SEARCH_COL_TEXT, text,
+                       GNC_COMBO_SEARCH_COL_VALUE, value,
+                       -1);
 }
 
 guint
 gnc_combo_box_search_get_active (GtkComboBox *combo)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  guint value;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    guint value;
 
-  g_return_val_if_fail(GTK_IS_COMBO_BOX(combo), 0);
+    g_return_val_if_fail(GTK_IS_COMBO_BOX(combo), 0);
 
-  model = gtk_combo_box_get_model(combo);
-  if (!gtk_combo_box_get_active_iter(combo, &iter))
-    return 0;
+    model = gtk_combo_box_get_model(combo);
+    if (!gtk_combo_box_get_active_iter(combo, &iter))
+        return 0;
 
-  gtk_tree_model_get(model, &iter,
-		     GNC_COMBO_SEARCH_COL_VALUE, &value,
-		     -1);
-  return value;
+    gtk_tree_model_get(model, &iter,
+                       GNC_COMBO_SEARCH_COL_VALUE, &value,
+                       -1);
+    return value;
 }
 
 void
 gnc_combo_box_search_set_active (GtkComboBox *combo, guint value)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  guint row_value = 0;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    guint row_value = 0;
 
-  g_return_if_fail(GTK_IS_COMBO_BOX(combo));
+    g_return_if_fail(GTK_IS_COMBO_BOX(combo));
 
-  model = gtk_combo_box_get_model(combo);
-  if (!gtk_tree_model_get_iter_first(model, &iter))
-   return;
+    model = gtk_combo_box_get_model(combo);
+    if (!gtk_tree_model_get_iter_first(model, &iter))
+        return;
 
- do {
-   gtk_tree_model_get(model, &iter,
-		      GNC_COMBO_SEARCH_COL_VALUE, &row_value,
-		      -1);
-   if (value == row_value) {
-     gtk_combo_box_set_active_iter(combo, &iter);
-     return;
-   }
- } while (gtk_tree_model_iter_next(model, &iter));
+    do
+    {
+        gtk_tree_model_get(model, &iter,
+                           GNC_COMBO_SEARCH_COL_VALUE, &row_value,
+                           -1);
+        if (value == row_value)
+        {
+            gtk_combo_box_set_active_iter(combo, &iter);
+            return;
+        }
+    }
+    while (gtk_tree_model_iter_next(model, &iter));
 
- /* No match found. Select the first item. */
- gtk_combo_box_set_active(combo, 0);
+    /* No match found. Select the first item. */
+    gtk_combo_box_set_active(combo, 0);
 }
 
 void
 gnc_combo_box_search_changed(GtkComboBox *combo, guint *value)
 {
-  g_signal_connect (combo, "changed",
-		    G_CALLBACK (search_combo_changed), value);
+    g_signal_connect (combo, "changed",
+                      G_CALLBACK (search_combo_changed), value);
 }

Modified: gnucash/trunk/src/gnome-search/search-core-utils.h
===================================================================
--- gnucash/trunk/src/gnome-search/search-core-utils.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-core-utils.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,10 +24,11 @@
 /* Functions for creating the common two column GtkComboBox used by
  * all the search widgets. */
 
-enum gnc_combo_search_cols {
-  GNC_COMBO_SEARCH_COL_TEXT = 0,
-  GNC_COMBO_SEARCH_COL_VALUE,
-  NUM_GNC_COMBO_SEARCH_COLS,
+enum gnc_combo_search_cols
+{
+    GNC_COMBO_SEARCH_COL_TEXT = 0,
+    GNC_COMBO_SEARCH_COL_VALUE,
+    NUM_GNC_COMBO_SEARCH_COLS,
 };
 
 GtkWidget *gnc_combo_box_new_search (void);

Modified: gnucash/trunk/src/gnome-search/search-date.c
===================================================================
--- gnucash/trunk/src/gnome-search/search-date.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-date.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -49,8 +49,9 @@
 
 typedef struct _GNCSearchDatePrivate GNCSearchDatePrivate;
 
-struct _GNCSearchDatePrivate {
-  GtkWidget *entry;
+struct _GNCSearchDatePrivate
+{
+    GtkWidget *entry;
 };
 
 #define _PRIVATE(o) \
@@ -61,227 +62,229 @@
 GType
 gnc_search_date_get_type (void)
 {
-  static GType type = 0;
-	
-  if (!type) {
-    GTypeInfo type_info = {
-      sizeof(GNCSearchDateClass),       /* class_size */
-      NULL,   				/* base_init */
-      NULL,				/* base_finalize */
-      (GClassInitFunc)gnc_search_date_class_init,
-      NULL,				/* class_finalize */
-      NULL,				/* class_data */
-      sizeof(GNCSearchDate),		/* */
-      0,				/* n_preallocs */
-      (GInstanceInitFunc)gnc_search_date_init,
-    };
-		
-    type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
-				   "GNCSearchDate",
-				   &type_info, 0);
-  }
-	
-  return type;
+    static GType type = 0;
+
+    if (!type)
+    {
+        GTypeInfo type_info =
+        {
+            sizeof(GNCSearchDateClass),       /* class_size */
+            NULL,   				/* base_init */
+            NULL,				/* base_finalize */
+            (GClassInitFunc)gnc_search_date_class_init,
+            NULL,				/* class_finalize */
+            NULL,				/* class_data */
+            sizeof(GNCSearchDate),		/* */
+            0,				/* n_preallocs */
+            (GInstanceInitFunc)gnc_search_date_init,
+        };
+
+        type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
+                                       "GNCSearchDate",
+                                       &type_info, 0);
+    }
+
+    return type;
 }
 
 static void
 gnc_search_date_class_init (GNCSearchDateClass *class)
 {
-  GObjectClass *object_class;
-  GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
+    GObjectClass *object_class;
+    GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
 
-  object_class = G_OBJECT_CLASS (class);
-  parent_class = g_type_class_peek_parent (class);
+    object_class = G_OBJECT_CLASS (class);
+    parent_class = g_type_class_peek_parent (class);
 
-  object_class->finalize = gnc_search_date_finalize;
+    object_class->finalize = gnc_search_date_finalize;
 
-  /* override methods */
-  gnc_search_core_type->editable_enters = editable_enters;
-  gnc_search_core_type->grab_focus = grab_focus;
-  gnc_search_core_type->validate = gncs_validate;
-  gnc_search_core_type->get_widget = gncs_get_widget;
-  gnc_search_core_type->get_predicate = gncs_get_predicate;
-  gnc_search_core_type->clone = gncs_clone;
+    /* override methods */
+    gnc_search_core_type->editable_enters = editable_enters;
+    gnc_search_core_type->grab_focus = grab_focus;
+    gnc_search_core_type->validate = gncs_validate;
+    gnc_search_core_type->get_widget = gncs_get_widget;
+    gnc_search_core_type->get_predicate = gncs_get_predicate;
+    gnc_search_core_type->clone = gncs_clone;
 
-  g_type_class_add_private(class, sizeof(GNCSearchDatePrivate));
+    g_type_class_add_private(class, sizeof(GNCSearchDatePrivate));
 }
 
 static void
 gnc_search_date_init (GNCSearchDate *o)
 {
-  o->ts.tv_sec = time(NULL);
-  o->how = COMPARE_LT;
+    o->ts.tv_sec = time(NULL);
+    o->how = COMPARE_LT;
 }
 
 static void
 gnc_search_date_finalize (GObject *obj)
 {
-  GNCSearchDate *o;
-  GNCSearchDatePrivate *priv;
+    GNCSearchDate *o;
+    GNCSearchDatePrivate *priv;
 
-  g_assert (IS_GNCSEARCH_DATE (obj));
+    g_assert (IS_GNCSEARCH_DATE (obj));
 
-  o = GNCSEARCH_DATE(obj);
-  priv = _PRIVATE(o);
-  if (priv->entry)
-    gtk_widget_destroy (priv->entry);
+    o = GNCSEARCH_DATE(obj);
+    priv = _PRIVATE(o);
+    if (priv->entry)
+        gtk_widget_destroy (priv->entry);
 
-  G_OBJECT_CLASS (parent_class)->finalize(obj);
+    G_OBJECT_CLASS (parent_class)->finalize(obj);
 }
 
 /**
  * gnc_search_date_new:
  *
  * Create a new GNCSearchDate object.
- * 
+ *
  * Return value: A new #GNCSearchDate object.
  **/
 GNCSearchDate *
 gnc_search_date_new (void)
 {
-  GNCSearchDate *o = g_object_new(GNC_TYPE_SEARCH_DATE, NULL);
-  return o;
+    GNCSearchDate *o = g_object_new(GNC_TYPE_SEARCH_DATE, NULL);
+    return o;
 }
 
 void
 gnc_search_date_set_date (GNCSearchDate *fi, Timespec ts)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_DATE (fi));
-	
-  fi->ts = ts;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_DATE (fi));
+
+    fi->ts = ts;
 }
 
 void
 gnc_search_date_set_how (GNCSearchDate *fi, query_compare_t how)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_DATE (fi));
-  fi->how = how;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_DATE (fi));
+    fi->how = how;
 }
 
 static gboolean
 gncs_validate (GNCSearchCoreType *fe)
 {
-  GNCSearchDate *fi = (GNCSearchDate *)fe;
-  gboolean valid = TRUE;
+    GNCSearchDate *fi = (GNCSearchDate *)fe;
+    gboolean valid = TRUE;
 
-  g_return_val_if_fail (fi, FALSE);
-  g_return_val_if_fail (IS_GNCSEARCH_DATE (fi), FALSE);
-	
-  /* XXX */
+    g_return_val_if_fail (fi, FALSE);
+    g_return_val_if_fail (IS_GNCSEARCH_DATE (fi), FALSE);
 
-  return valid;
+    /* XXX */
+
+    return valid;
 }
 
 static void
 date_changed (GNCDateEdit *date_edit, GNCSearchDate *fe)
 {
-  fe->ts = gnc_date_edit_get_date_ts (date_edit);
+    fe->ts = gnc_date_edit_get_date_ts (date_edit);
 }
 
 static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
-  GNCSearchDate *fi = (GNCSearchDate *)fe;
-  GtkComboBox *combo;
+    GNCSearchDate *fi = (GNCSearchDate *)fe;
+    GtkComboBox *combo;
 
-  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+    combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
 
-  gnc_combo_box_search_add(combo, _("is before"), COMPARE_LT);
-  gnc_combo_box_search_add(combo, _("is before or on"), COMPARE_LTE);
-  gnc_combo_box_search_add(combo, _("is on"), COMPARE_EQUAL);
-  gnc_combo_box_search_add(combo, _("is not on"), COMPARE_NEQ);
-  gnc_combo_box_search_add(combo, _("is after"), COMPARE_GT);
-  gnc_combo_box_search_add(combo, _("is on or after"), COMPARE_GTE);
-  gnc_combo_box_search_changed(combo, &fi->how);
-  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
+    gnc_combo_box_search_add(combo, _("is before"), COMPARE_LT);
+    gnc_combo_box_search_add(combo, _("is before or on"), COMPARE_LTE);
+    gnc_combo_box_search_add(combo, _("is on"), COMPARE_EQUAL);
+    gnc_combo_box_search_add(combo, _("is not on"), COMPARE_NEQ);
+    gnc_combo_box_search_add(combo, _("is after"), COMPARE_GT);
+    gnc_combo_box_search_add(combo, _("is on or after"), COMPARE_GTE);
+    gnc_combo_box_search_changed(combo, &fi->how);
+    gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
 
-  return GTK_WIDGET(combo);
+    return GTK_WIDGET(combo);
 }
 
 static void
 grab_focus (GNCSearchCoreType *fe)
 {
-  GNCSearchDate *fi = (GNCSearchDate *)fe;
-  GNCSearchDatePrivate *priv;
+    GNCSearchDate *fi = (GNCSearchDate *)fe;
+    GNCSearchDatePrivate *priv;
 
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_DATE (fi));
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_DATE (fi));
 
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    gtk_widget_grab_focus (GNC_DATE_EDIT(priv->entry)->date_entry);
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        gtk_widget_grab_focus (GNC_DATE_EDIT(priv->entry)->date_entry);
 }
 
 static void
 editable_enters (GNCSearchCoreType *fe)
 {
-  GNCSearchDate *fi = (GNCSearchDate *)fe;
-  GNCSearchDatePrivate *priv;
+    GNCSearchDate *fi = (GNCSearchDate *)fe;
+    GNCSearchDatePrivate *priv;
 
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_DATE (fi));
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_DATE (fi));
 
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    gnc_date_activates_default (GNC_DATE_EDIT (priv->entry), TRUE);
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        gnc_date_activates_default (GNC_DATE_EDIT (priv->entry), TRUE);
 }
 
 static GtkWidget *
 gncs_get_widget (GNCSearchCoreType *fe)
 {
-  GtkWidget *entry, *menu, *box;
-  GNCSearchDate *fi = (GNCSearchDate *)fe;
-  GNCSearchDatePrivate *priv;
-	
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_DATE (fi), NULL);
+    GtkWidget *entry, *menu, *box;
+    GNCSearchDate *fi = (GNCSearchDate *)fe;
+    GNCSearchDatePrivate *priv;
 
-  priv = _PRIVATE(fi);
-  box = gtk_hbox_new (FALSE, 3);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_DATE (fi), NULL);
 
-  /* Build and connect the option menu */
-  menu = make_menu (fe);
-  gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
+    priv = _PRIVATE(fi);
+    box = gtk_hbox_new (FALSE, 3);
 
-  /* Build and connect the date entry window */
-  entry = gnc_date_edit_new_ts (fi->ts, FALSE, FALSE);
-  g_signal_connect (G_OBJECT (entry), "date_changed", G_CALLBACK (date_changed), fe);
-  gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3);
-  g_object_ref (entry);
-  priv->entry = entry;
+    /* Build and connect the option menu */
+    menu = make_menu (fe);
+    gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
 
-  /* And return the box */
-  return box;
+    /* Build and connect the date entry window */
+    entry = gnc_date_edit_new_ts (fi->ts, FALSE, FALSE);
+    g_signal_connect (G_OBJECT (entry), "date_changed", G_CALLBACK (date_changed), fe);
+    gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3);
+    g_object_ref (entry);
+    priv->entry = entry;
+
+    /* And return the box */
+    return box;
 }
 
 static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe)
 {
-  GNCSearchDate *fi = (GNCSearchDate *)fe;
-  GNCSearchDatePrivate *priv;
+    GNCSearchDate *fi = (GNCSearchDate *)fe;
+    GNCSearchDatePrivate *priv;
 
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_DATE (fi), NULL);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_DATE (fi), NULL);
 
-  /* Make sure we actually use the currently-entered date */
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    fi->ts = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (priv->entry));
+    /* Make sure we actually use the currently-entered date */
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        fi->ts = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (priv->entry));
 
-  return gncQueryDatePredicate (fi->how, DATE_MATCH_NORMAL, fi->ts);
+    return gncQueryDatePredicate (fi->how, DATE_MATCH_NORMAL, fi->ts);
 }
 
 static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
 {
-  GNCSearchDate *se, *fse = (GNCSearchDate *)fe;
+    GNCSearchDate *se, *fse = (GNCSearchDate *)fe;
 
-  g_return_val_if_fail (fse, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_DATE (fse), NULL);
+    g_return_val_if_fail (fse, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_DATE (fse), NULL);
 
-  se = gnc_search_date_new ();
-  gnc_search_date_set_date (se, fse->ts);
-  gnc_search_date_set_how (se, fse->how);
+    se = gnc_search_date_new ();
+    gnc_search_date_set_date (se, fse->ts);
+    gnc_search_date_set_how (se, fse->how);
 
-  return (GNCSearchCoreType *)se;
+    return (GNCSearchCoreType *)se;
 }

Modified: gnucash/trunk/src/gnome-search/search-date.h
===================================================================
--- gnucash/trunk/src/gnome-search/search-date.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-date.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -33,19 +33,21 @@
 typedef struct _GNCSearchDate	GNCSearchDate;
 typedef struct _GNCSearchDateClass	GNCSearchDateClass;
 
-struct _GNCSearchDate {
-  GNCSearchCoreType parent;
+struct _GNCSearchDate
+{
+    GNCSearchCoreType parent;
 
-  query_compare_t	how;
-  Timespec		ts;
+    query_compare_t	how;
+    Timespec		ts;
 };
 
-struct _GNCSearchDateClass {
-  GNCSearchCoreTypeClass parent_class;
+struct _GNCSearchDateClass
+{
+    GNCSearchCoreTypeClass parent_class;
 
-  /* virtual methods */
+    /* virtual methods */
 
-  /* signals */
+    /* signals */
 };
 
 GType		gnc_search_date_get_type	(void);

Modified: gnucash/trunk/src/gnome-search/search-double.c
===================================================================
--- gnucash/trunk/src/gnome-search/search-double.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-double.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -48,9 +48,10 @@
 
 typedef struct _GNCSearchDoublePrivate GNCSearchDoublePrivate;
 
-struct _GNCSearchDoublePrivate {
-  GtkWidget * entry;
-  GNCAmountEdit *gae;
+struct _GNCSearchDoublePrivate
+{
+    GtkWidget * entry;
+    GNCAmountEdit *gae;
 };
 
 #define _PRIVATE(o) \
@@ -61,220 +62,222 @@
 GType
 gnc_search_double_get_type (void)
 {
-  static GType type = 0;
-	
-  if (!type) {
-    GTypeInfo type_info = {
-      sizeof(GNCSearchDoubleClass),     /* class_size */
-      NULL,   			        /* base_init */
-      NULL,				/* base_finalize */
-      (GClassInitFunc)gnc_search_double_class_init,
-      NULL,				/* class_finalize */
-      NULL,				/* class_data */
-      sizeof(GNCSearchDouble),		/* */
-      0,				/* n_preallocs */
-      (GInstanceInitFunc)gnc_search_double_init,
-    };
-		
-    type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
-				   "GNCSearchDouble",
-				   &type_info, 0);
-  }
-	
-  return type;
+    static GType type = 0;
+
+    if (!type)
+    {
+        GTypeInfo type_info =
+        {
+            sizeof(GNCSearchDoubleClass),     /* class_size */
+            NULL,   			        /* base_init */
+            NULL,				/* base_finalize */
+            (GClassInitFunc)gnc_search_double_class_init,
+            NULL,				/* class_finalize */
+            NULL,				/* class_data */
+            sizeof(GNCSearchDouble),		/* */
+            0,				/* n_preallocs */
+            (GInstanceInitFunc)gnc_search_double_init,
+        };
+
+        type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
+                                       "GNCSearchDouble",
+                                       &type_info, 0);
+    }
+
+    return type;
 }
 
 static void
 gnc_search_double_class_init (GNCSearchDoubleClass *class)
 {
-  GObjectClass *object_class;
-  GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
+    GObjectClass *object_class;
+    GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
 
-  object_class = G_OBJECT_CLASS (class);
-  parent_class = g_type_class_peek_parent (class);
+    object_class = G_OBJECT_CLASS (class);
+    parent_class = g_type_class_peek_parent (class);
 
-  object_class->finalize = gnc_search_double_finalize;
+    object_class->finalize = gnc_search_double_finalize;
 
-  /* override methods */
-  gnc_search_core_type->editable_enters = editable_enters;
-  gnc_search_core_type->grab_focus = grab_focus;
-  gnc_search_core_type->validate = gncs_validate;
-  gnc_search_core_type->get_widget = gncs_get_widget;
-  gnc_search_core_type->get_predicate = gncs_get_predicate;
-  gnc_search_core_type->clone = gncs_clone;
+    /* override methods */
+    gnc_search_core_type->editable_enters = editable_enters;
+    gnc_search_core_type->grab_focus = grab_focus;
+    gnc_search_core_type->validate = gncs_validate;
+    gnc_search_core_type->get_widget = gncs_get_widget;
+    gnc_search_core_type->get_predicate = gncs_get_predicate;
+    gnc_search_core_type->clone = gncs_clone;
 
-  g_type_class_add_private(class, sizeof(GNCSearchDoublePrivate));
+    g_type_class_add_private(class, sizeof(GNCSearchDoublePrivate));
 }
 
 static void
 gnc_search_double_init (GNCSearchDouble *o)
 {
-  o->how = COMPARE_EQUAL;
+    o->how = COMPARE_EQUAL;
 }
 
 static void
 gnc_search_double_finalize (GObject *obj)
 {
-  GNCSearchDouble *o = (GNCSearchDouble *)obj;
-  g_assert (IS_GNCSEARCH_DOUBLE (o));
+    GNCSearchDouble *o = (GNCSearchDouble *)obj;
+    g_assert (IS_GNCSEARCH_DOUBLE (o));
 
-  G_OBJECT_CLASS (parent_class)->finalize(obj);
+    G_OBJECT_CLASS (parent_class)->finalize(obj);
 }
 
 /**
  * gnc_search_double_new:
  *
  * Create a new GNCSearchDouble object.
- * 
+ *
  * Return value: A new #GNCSearchDouble object.
  **/
 GNCSearchDouble *
 gnc_search_double_new (void)
 {
-  GNCSearchDouble *o = g_object_new(GNC_TYPE_SEARCH_DOUBLE, NULL);
-  return o;
+    GNCSearchDouble *o = g_object_new(GNC_TYPE_SEARCH_DOUBLE, NULL);
+    return o;
 }
 
 void
 gnc_search_double_set_value (GNCSearchDouble *fi, double value)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_DOUBLE (fi));
-	
-  fi->value = value;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_DOUBLE (fi));
+
+    fi->value = value;
 }
 
 void
 gnc_search_double_set_how (GNCSearchDouble *fi, query_compare_t how)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_DOUBLE (fi));
-  fi->how = how;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_DOUBLE (fi));
+    fi->how = how;
 }
 
 static gboolean
 gncs_validate (GNCSearchCoreType *fe)
 {
-  GNCSearchDouble *fi = (GNCSearchDouble *)fe;
-  gboolean valid = TRUE;
+    GNCSearchDouble *fi = (GNCSearchDouble *)fe;
+    gboolean valid = TRUE;
 
-  g_return_val_if_fail (fi, FALSE);
-  g_return_val_if_fail (IS_GNCSEARCH_DOUBLE (fi), FALSE);
-	
-  /* XXX */
+    g_return_val_if_fail (fi, FALSE);
+    g_return_val_if_fail (IS_GNCSEARCH_DOUBLE (fi), FALSE);
 
-  return valid;
+    /* XXX */
+
+    return valid;
 }
 
 static void
 entry_changed (GNCAmountEdit *entry, GNCSearchDouble *fe)
 {
-  fe->value = gnc_amount_edit_get_damount (entry);
+    fe->value = gnc_amount_edit_get_damount (entry);
 }
 
 static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
-  GNCSearchDouble *fi = (GNCSearchDouble *)fe;
-  GtkComboBox *combo;
+    GNCSearchDouble *fi = (GNCSearchDouble *)fe;
+    GtkComboBox *combo;
 
-  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+    combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
 
-  gnc_combo_box_search_add(combo, _("is less than"), COMPARE_LT);
-  gnc_combo_box_search_add(combo, _("is less than or equal to"), COMPARE_LTE);
-  gnc_combo_box_search_add(combo, _("equals"), COMPARE_EQUAL);
-  gnc_combo_box_search_add(combo, _("does not equal"), COMPARE_NEQ);
-  gnc_combo_box_search_add(combo, _("is greater than"), COMPARE_GT);
-  gnc_combo_box_search_add(combo, _("is greater than or equal to"), COMPARE_GTE);
-  gnc_combo_box_search_changed(combo, &fi->how);
-  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
+    gnc_combo_box_search_add(combo, _("is less than"), COMPARE_LT);
+    gnc_combo_box_search_add(combo, _("is less than or equal to"), COMPARE_LTE);
+    gnc_combo_box_search_add(combo, _("equals"), COMPARE_EQUAL);
+    gnc_combo_box_search_add(combo, _("does not equal"), COMPARE_NEQ);
+    gnc_combo_box_search_add(combo, _("is greater than"), COMPARE_GT);
+    gnc_combo_box_search_add(combo, _("is greater than or equal to"), COMPARE_GTE);
+    gnc_combo_box_search_changed(combo, &fi->how);
+    gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
 
-  return GTK_WIDGET(combo);
+    return GTK_WIDGET(combo);
 }
 
 static void
 grab_focus (GNCSearchCoreType *fe)
 {
-  GNCSearchDouble *fi = (GNCSearchDouble *)fe;
-  GNCSearchDoublePrivate *priv ;
+    GNCSearchDouble *fi = (GNCSearchDouble *)fe;
+    GNCSearchDoublePrivate *priv ;
 
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_DOUBLE (fi));
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_DOUBLE (fi));
 
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    gtk_widget_grab_focus (priv->entry);
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        gtk_widget_grab_focus (priv->entry);
 }
 
 static void
 editable_enters (GNCSearchCoreType *fe)
 {
-  GNCSearchDouble *fi = (GNCSearchDouble *)fe;
-  GNCSearchDoublePrivate *priv ;
+    GNCSearchDouble *fi = (GNCSearchDouble *)fe;
+    GNCSearchDoublePrivate *priv ;
 
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_DOUBLE (fi));
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_DOUBLE (fi));
 
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    gtk_entry_set_activates_default(GTK_ENTRY (priv->entry), TRUE);
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        gtk_entry_set_activates_default(GTK_ENTRY (priv->entry), TRUE);
 }
 
 static GtkWidget *
 gncs_get_widget (GNCSearchCoreType *fe)
 {
-  GtkWidget *entry, *menu, *box;
-  GNCSearchDouble *fi = (GNCSearchDouble *)fe;
-  GNCSearchDoublePrivate *priv ;
-	
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_DOUBLE (fi), NULL);
+    GtkWidget *entry, *menu, *box;
+    GNCSearchDouble *fi = (GNCSearchDouble *)fe;
+    GNCSearchDoublePrivate *priv ;
 
-  priv = _PRIVATE(fi);
-  box = gtk_hbox_new (FALSE, 3);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_DOUBLE (fi), NULL);
 
-  /* Build and connect the option menu */
-  menu = make_menu (fe);
-  gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
+    priv = _PRIVATE(fi);
+    box = gtk_hbox_new (FALSE, 3);
 
-  /* Build and connect the entry window */
-  entry = gnc_amount_edit_new ();
-  if (fi->value)
-    gnc_amount_edit_set_damount (GNC_AMOUNT_EDIT (entry), fi->value);
-  g_signal_connect (G_OBJECT (entry), "amount_changed", G_CALLBACK (entry_changed), fe);
-  gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3);
-  priv->entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (entry));
-  priv->gae = GNC_AMOUNT_EDIT (entry);
+    /* Build and connect the option menu */
+    menu = make_menu (fe);
+    gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
 
-  /* And return the box */
-  return box;
+    /* Build and connect the entry window */
+    entry = gnc_amount_edit_new ();
+    if (fi->value)
+        gnc_amount_edit_set_damount (GNC_AMOUNT_EDIT (entry), fi->value);
+    g_signal_connect (G_OBJECT (entry), "amount_changed", G_CALLBACK (entry_changed), fe);
+    gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3);
+    priv->entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (entry));
+    priv->gae = GNC_AMOUNT_EDIT (entry);
+
+    /* And return the box */
+    return box;
 }
 
 static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe)
 {
-  GNCSearchDouble *fi = (GNCSearchDouble *)fe;
-  GNCSearchDoublePrivate *priv ;
+    GNCSearchDouble *fi = (GNCSearchDouble *)fe;
+    GNCSearchDoublePrivate *priv ;
 
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_DOUBLE (fi), NULL);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_DOUBLE (fi), NULL);
 
-  /* force the computation of the entry, because we may not get the signal */
-  priv = _PRIVATE(fi);
-  entry_changed (priv->gae, fi);
+    /* force the computation of the entry, because we may not get the signal */
+    priv = _PRIVATE(fi);
+    entry_changed (priv->gae, fi);
 
-  return gncQueryDoublePredicate (fi->how, fi->value);
+    return gncQueryDoublePredicate (fi->how, fi->value);
 }
 
 static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
 {
-  GNCSearchDouble *se, *fse = (GNCSearchDouble *)fe;
+    GNCSearchDouble *se, *fse = (GNCSearchDouble *)fe;
 
-  g_return_val_if_fail (fse, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_DOUBLE (fse), NULL);
+    g_return_val_if_fail (fse, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_DOUBLE (fse), NULL);
 
-  se = gnc_search_double_new ();
-  gnc_search_double_set_value (se, fse->value);
-  gnc_search_double_set_how (se, fse->how);
+    se = gnc_search_double_new ();
+    gnc_search_double_set_value (se, fse->value);
+    gnc_search_double_set_how (se, fse->how);
 
-  return (GNCSearchCoreType *)se;
+    return (GNCSearchCoreType *)se;
 }

Modified: gnucash/trunk/src/gnome-search/search-double.h
===================================================================
--- gnucash/trunk/src/gnome-search/search-double.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-double.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -32,19 +32,21 @@
 typedef struct _GNCSearchDouble	GNCSearchDouble;
 typedef struct _GNCSearchDoubleClass	GNCSearchDoubleClass;
 
-struct _GNCSearchDouble {
-  GNCSearchCoreType parent;
+struct _GNCSearchDouble
+{
+    GNCSearchCoreType parent;
 
-  query_compare_t	how;
-  double		value;
+    query_compare_t	how;
+    double		value;
 };
 
-struct _GNCSearchDoubleClass {
-  GNCSearchCoreTypeClass parent_class;
+struct _GNCSearchDoubleClass
+{
+    GNCSearchCoreTypeClass parent_class;
 
-  /* virtual methods */
+    /* virtual methods */
 
-  /* signals */
+    /* signals */
 };
 
 GType		gnc_search_double_get_type	(void);

Modified: gnucash/trunk/src/gnome-search/search-int64.c
===================================================================
--- gnucash/trunk/src/gnome-search/search-int64.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-int64.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -49,9 +49,10 @@
 
 typedef struct _GNCSearchInt64Private GNCSearchInt64Private;
 
-struct _GNCSearchInt64Private {
-  GtkWidget *entry;
-  GNCAmountEdit *gae;
+struct _GNCSearchInt64Private
+{
+    GtkWidget *entry;
+    GNCAmountEdit *gae;
 };
 
 #define _PRIVATE(o) \
@@ -62,225 +63,228 @@
 GType
 gnc_search_int64_get_type (void)
 {
-  static GType type = 0;
-	
-  if (!type) {
-    GTypeInfo type_info = {
-      sizeof(GNCSearchInt64Class),      /* class_size */
-      NULL,   				/* base_init */
-      NULL,				/* base_finalize */
-      (GClassInitFunc)gnc_search_int64_class_init,
-      NULL,				/* class_finalize */
-      NULL,				/* class_data */
-      sizeof(GNCSearchInt64),		/* */
-      0,				/* n_preallocs */
-      (GInstanceInitFunc)gnc_search_int64_init,
-    };
-		
-    type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
-				   "GNCSearchInt64",
-				   &type_info, 0);
-  }
-	
-  return type;
+    static GType type = 0;
+
+    if (!type)
+    {
+        GTypeInfo type_info =
+        {
+            sizeof(GNCSearchInt64Class),      /* class_size */
+            NULL,   				/* base_init */
+            NULL,				/* base_finalize */
+            (GClassInitFunc)gnc_search_int64_class_init,
+            NULL,				/* class_finalize */
+            NULL,				/* class_data */
+            sizeof(GNCSearchInt64),		/* */
+            0,				/* n_preallocs */
+            (GInstanceInitFunc)gnc_search_int64_init,
+        };
+
+        type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
+                                       "GNCSearchInt64",
+                                       &type_info, 0);
+    }
+
+    return type;
 }
 
 static void
 gnc_search_int64_class_init (GNCSearchInt64Class *class)
 {
-  GObjectClass *object_class;
-  GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
+    GObjectClass *object_class;
+    GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
 
-  object_class = G_OBJECT_CLASS (class);
-  parent_class = g_type_class_peek_parent (class);
+    object_class = G_OBJECT_CLASS (class);
+    parent_class = g_type_class_peek_parent (class);
 
-  object_class->finalize = gnc_search_int64_finalize;
+    object_class->finalize = gnc_search_int64_finalize;
 
-  /* override methods */
-  gnc_search_core_type->editable_enters = editable_enters;
-  gnc_search_core_type->grab_focus = grab_focus;
-  gnc_search_core_type->validate = gncs_validate;
-  gnc_search_core_type->get_widget = gncs_get_widget;
-  gnc_search_core_type->get_predicate = gncs_get_predicate;
-  gnc_search_core_type->clone = gncs_clone;
+    /* override methods */
+    gnc_search_core_type->editable_enters = editable_enters;
+    gnc_search_core_type->grab_focus = grab_focus;
+    gnc_search_core_type->validate = gncs_validate;
+    gnc_search_core_type->get_widget = gncs_get_widget;
+    gnc_search_core_type->get_predicate = gncs_get_predicate;
+    gnc_search_core_type->clone = gncs_clone;
 
-  g_type_class_add_private(class, sizeof(GNCSearchInt64Private));
+    g_type_class_add_private(class, sizeof(GNCSearchInt64Private));
 }
 
 static void
 gnc_search_int64_init (GNCSearchInt64 *o)
 {
-  o->how = COMPARE_EQUAL;
+    o->how = COMPARE_EQUAL;
 }
 
 static void
 gnc_search_int64_finalize (GObject *obj)
 {
-  GNCSearchInt64 *o = (GNCSearchInt64 *)obj;
-  g_assert (IS_GNCSEARCH_INT64 (o));
+    GNCSearchInt64 *o = (GNCSearchInt64 *)obj;
+    g_assert (IS_GNCSEARCH_INT64 (o));
 
-  G_OBJECT_CLASS (parent_class)->finalize(obj);
+    G_OBJECT_CLASS (parent_class)->finalize(obj);
 }
 
 /**
  * gnc_search_int64_new:
  *
  * Create a new GNCSearchInt64 object.
- * 
+ *
  * Return value: A new #GNCSearchInt64 object.
  **/
 GNCSearchInt64 *
 gnc_search_int64_new (void)
 {
-  GNCSearchInt64 *o = g_object_new(GNC_TYPE_SEARCH_INT64, NULL);
-  return o;
+    GNCSearchInt64 *o = g_object_new(GNC_TYPE_SEARCH_INT64, NULL);
+    return o;
 }
 
 void
 gnc_search_int64_set_value (GNCSearchInt64 *fi, gint64 value)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_INT64 (fi));
-	
-  fi->value = value;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_INT64 (fi));
+
+    fi->value = value;
 }
 
 void
 gnc_search_int64_set_how (GNCSearchInt64 *fi, query_compare_t how)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_INT64 (fi));
-  fi->how = how;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_INT64 (fi));
+    fi->how = how;
 }
 
 static gboolean
 gncs_validate (GNCSearchCoreType *fe)
 {
-  GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
-  gboolean valid = TRUE;
+    GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
+    gboolean valid = TRUE;
 
-  g_return_val_if_fail (fi, FALSE);
-  g_return_val_if_fail (IS_GNCSEARCH_INT64 (fi), FALSE);
-	
-  /* XXX */
+    g_return_val_if_fail (fi, FALSE);
+    g_return_val_if_fail (IS_GNCSEARCH_INT64 (fi), FALSE);
 
-  return valid;
+    /* XXX */
+
+    return valid;
 }
 
 static void
 entry_changed (GNCAmountEdit *entry, GNCSearchInt64 *fe)
 {
-  gnc_numeric value = gnc_amount_edit_get_amount (entry);
-  g_assert (value.denom == 1);
-  fe->value = value.num;
+    gnc_numeric value = gnc_amount_edit_get_amount (entry);
+    g_assert (value.denom == 1);
+    fe->value = value.num;
 }
 
 static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
-  GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
-  GtkComboBox *combo;
+    GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
+    GtkComboBox *combo;
 
-  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
-  gnc_combo_box_search_add(combo, _("is less than"), COMPARE_LT);
-  gnc_combo_box_search_add(combo, _("is less than or equal to"), COMPARE_LTE);
-  gnc_combo_box_search_add(combo, _("equals"), COMPARE_EQUAL);
-  gnc_combo_box_search_add(combo, _("does not equal"), COMPARE_NEQ);
-  gnc_combo_box_search_add(combo, _("is greater than"), COMPARE_GT);
-  gnc_combo_box_search_add(combo, _("is greater than or equal to"), COMPARE_GTE);
-  gnc_combo_box_search_changed(combo, &fi->how);
-  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
+    combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+    gnc_combo_box_search_add(combo, _("is less than"), COMPARE_LT);
+    gnc_combo_box_search_add(combo, _("is less than or equal to"), COMPARE_LTE);
+    gnc_combo_box_search_add(combo, _("equals"), COMPARE_EQUAL);
+    gnc_combo_box_search_add(combo, _("does not equal"), COMPARE_NEQ);
+    gnc_combo_box_search_add(combo, _("is greater than"), COMPARE_GT);
+    gnc_combo_box_search_add(combo, _("is greater than or equal to"), COMPARE_GTE);
+    gnc_combo_box_search_changed(combo, &fi->how);
+    gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
 
-  return GTK_WIDGET(combo);
+    return GTK_WIDGET(combo);
 }
 
 static void
 grab_focus (GNCSearchCoreType *fe)
 {
-  GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
-  GNCSearchInt64Private *priv;
+    GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
+    GNCSearchInt64Private *priv;
 
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_INT64 (fi));
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_INT64 (fi));
 
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    gtk_widget_grab_focus (priv->entry);
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        gtk_widget_grab_focus (priv->entry);
 }
 
 static void
 editable_enters (GNCSearchCoreType *fe)
 {
-  GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
-  GNCSearchInt64Private *priv;
+    GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
+    GNCSearchInt64Private *priv;
 
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_INT64 (fi));
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_INT64 (fi));
 
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    gtk_entry_set_activates_default(GTK_ENTRY (priv->entry), TRUE);
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        gtk_entry_set_activates_default(GTK_ENTRY (priv->entry), TRUE);
 }
 
 static GtkWidget *
 gncs_get_widget (GNCSearchCoreType *fe)
 {
-  GtkWidget *entry, *menu, *box;
-  GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
-  GNCSearchInt64Private *priv;
-	
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_INT64 (fi), NULL);
+    GtkWidget *entry, *menu, *box;
+    GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
+    GNCSearchInt64Private *priv;
 
-  priv = _PRIVATE(fi);
-  box = gtk_hbox_new (FALSE, 3);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_INT64 (fi), NULL);
 
-  /* Build and connect the option menu */
-  menu = make_menu (fe);
-  gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
+    priv = _PRIVATE(fi);
+    box = gtk_hbox_new (FALSE, 3);
 
-  /* Build and connect the entry window */
-  entry = gnc_amount_edit_new ();
-  gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (entry),
-				  gnc_integral_print_info ());
-  if (fi->value) {
-    gnc_numeric value = gnc_numeric_create (fi->value, 1);
-    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (entry), value);
-  }
-  g_signal_connect (G_OBJECT (entry), "amount_changed", G_CALLBACK (entry_changed), fe);
-  gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3);
-  priv->entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (entry));
-  priv->gae = GNC_AMOUNT_EDIT (entry);
+    /* Build and connect the option menu */
+    menu = make_menu (fe);
+    gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
 
-  /* And return the box */
-  return box;
+    /* Build and connect the entry window */
+    entry = gnc_amount_edit_new ();
+    gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (entry),
+                                    gnc_integral_print_info ());
+    if (fi->value)
+    {
+        gnc_numeric value = gnc_numeric_create (fi->value, 1);
+        gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (entry), value);
+    }
+    g_signal_connect (G_OBJECT (entry), "amount_changed", G_CALLBACK (entry_changed), fe);
+    gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3);
+    priv->entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (entry));
+    priv->gae = GNC_AMOUNT_EDIT (entry);
+
+    /* And return the box */
+    return box;
 }
 
 static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe)
 {
-  GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
-  GNCSearchInt64Private *priv;
+    GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
+    GNCSearchInt64Private *priv;
 
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_INT64 (fi), NULL);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_INT64 (fi), NULL);
 
-  /* force the computation of the entry, because we may not get the signal */
-  priv = _PRIVATE(fi);
-  entry_changed (priv->gae, fi);
+    /* force the computation of the entry, because we may not get the signal */
+    priv = _PRIVATE(fi);
+    entry_changed (priv->gae, fi);
 
-  return gncQueryInt64Predicate (fi->how, fi->value);
+    return gncQueryInt64Predicate (fi->how, fi->value);
 }
 
 static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
 {
-  GNCSearchInt64 *se, *fse = (GNCSearchInt64 *)fe;
+    GNCSearchInt64 *se, *fse = (GNCSearchInt64 *)fe;
 
-  g_return_val_if_fail (fse, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_INT64 (fse), NULL);
+    g_return_val_if_fail (fse, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_INT64 (fse), NULL);
 
-  se = gnc_search_int64_new ();
-  gnc_search_int64_set_value (se, fse->value);
-  gnc_search_int64_set_how (se, fse->how);
+    se = gnc_search_int64_new ();
+    gnc_search_int64_set_value (se, fse->value);
+    gnc_search_int64_set_how (se, fse->how);
 
-  return (GNCSearchCoreType *)se;
+    return (GNCSearchCoreType *)se;
 }

Modified: gnucash/trunk/src/gnome-search/search-int64.h
===================================================================
--- gnucash/trunk/src/gnome-search/search-int64.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-int64.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -32,19 +32,21 @@
 typedef struct _GNCSearchInt64	GNCSearchInt64;
 typedef struct _GNCSearchInt64Class	GNCSearchInt64Class;
 
-struct _GNCSearchInt64 {
-  GNCSearchCoreType parent;
+struct _GNCSearchInt64
+{
+    GNCSearchCoreType parent;
 
-  query_compare_t	how;
-  gint64		value;
+    query_compare_t	how;
+    gint64		value;
 };
 
-struct _GNCSearchInt64Class {
-  GNCSearchCoreTypeClass parent_class;
+struct _GNCSearchInt64Class
+{
+    GNCSearchCoreTypeClass parent_class;
 
-  /* virtual methods */
+    /* virtual methods */
 
-  /* signals */
+    /* signals */
 };
 
 GType		gnc_search_int64_get_type	(void);

Modified: gnucash/trunk/src/gnome-search/search-numeric.c
===================================================================
--- gnucash/trunk/src/gnome-search/search-numeric.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-numeric.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -48,10 +48,11 @@
 
 typedef struct _GNCSearchNumericPrivate GNCSearchNumericPrivate;
 
-struct _GNCSearchNumericPrivate {
-  gboolean	is_debcred;
-  GtkWidget * 	entry;
-  GNCAmountEdit *gae;
+struct _GNCSearchNumericPrivate
+{
+    gboolean	is_debcred;
+    GtkWidget * 	entry;
+    GNCAmountEdit *gae;
 };
 
 #define _PRIVATE(o) \
@@ -62,291 +63,294 @@
 GType
 gnc_search_numeric_get_type (void)
 {
-  static GType type = 0;
-	
-  if (!type) {
-    GTypeInfo type_info = {
-      sizeof(GNCSearchNumericClass),    /* class_size */
-      NULL,   				/* base_init */
-      NULL,				/* base_finalize */
-      (GClassInitFunc)gnc_search_numeric_class_init,
-      NULL,				/* class_finalize */
-      NULL,				/* class_data */
-      sizeof(GNCSearchNumeric),		/* */
-      0,				/* n_preallocs */
-      (GInstanceInitFunc)gnc_search_numeric_init,
-    };
-		
-    type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
-				   "GNCSearchNumeric",
-				   &type_info, 0);
-  }
-	
-  return type;
+    static GType type = 0;
+
+    if (!type)
+    {
+        GTypeInfo type_info =
+        {
+            sizeof(GNCSearchNumericClass),    /* class_size */
+            NULL,   				/* base_init */
+            NULL,				/* base_finalize */
+            (GClassInitFunc)gnc_search_numeric_class_init,
+            NULL,				/* class_finalize */
+            NULL,				/* class_data */
+            sizeof(GNCSearchNumeric),		/* */
+            0,				/* n_preallocs */
+            (GInstanceInitFunc)gnc_search_numeric_init,
+        };
+
+        type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
+                                       "GNCSearchNumeric",
+                                       &type_info, 0);
+    }
+
+    return type;
 }
 
 static void
 gnc_search_numeric_class_init (GNCSearchNumericClass *class)
 {
-  GObjectClass *object_class;
-  GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
+    GObjectClass *object_class;
+    GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
 
-  object_class = G_OBJECT_CLASS (class);
-  parent_class = g_type_class_peek_parent (class);
+    object_class = G_OBJECT_CLASS (class);
+    parent_class = g_type_class_peek_parent (class);
 
-  object_class->finalize = gnc_search_numeric_finalize;
+    object_class->finalize = gnc_search_numeric_finalize;
 
-  /* override methods */
-  gnc_search_core_type->editable_enters = editable_enters;
-  gnc_search_core_type->grab_focus = grab_focus;
-  gnc_search_core_type->validate = gncs_validate;
-  gnc_search_core_type->get_widget = gncs_get_widget;
-  gnc_search_core_type->get_predicate = gncs_get_predicate;
-  gnc_search_core_type->clone = gncs_clone;
+    /* override methods */
+    gnc_search_core_type->editable_enters = editable_enters;
+    gnc_search_core_type->grab_focus = grab_focus;
+    gnc_search_core_type->validate = gncs_validate;
+    gnc_search_core_type->get_widget = gncs_get_widget;
+    gnc_search_core_type->get_predicate = gncs_get_predicate;
+    gnc_search_core_type->clone = gncs_clone;
 
-  g_type_class_add_private(class, sizeof(GNCSearchNumericPrivate));
+    g_type_class_add_private(class, sizeof(GNCSearchNumericPrivate));
 }
 
 static void
 gnc_search_numeric_init (GNCSearchNumeric *o)
 {
-  o->value = gnc_numeric_zero ();
-  o->how = COMPARE_EQUAL;
-  o->option = NUMERIC_MATCH_ANY;
+    o->value = gnc_numeric_zero ();
+    o->how = COMPARE_EQUAL;
+    o->option = NUMERIC_MATCH_ANY;
 }
 
 static void
 gnc_search_numeric_finalize (GObject *obj)
 {
-  GNCSearchNumeric *o = (GNCSearchNumeric *)obj;
-  g_assert (IS_GNCSEARCH_NUMERIC (o));
+    GNCSearchNumeric *o = (GNCSearchNumeric *)obj;
+    g_assert (IS_GNCSEARCH_NUMERIC (o));
 
-  G_OBJECT_CLASS (parent_class)->finalize(obj);
+    G_OBJECT_CLASS (parent_class)->finalize(obj);
 }
 
 /**
  * gnc_search_numeric_new:
  *
  * Create a new GNCSearchNumeric object.
- * 
+ *
  * Return value: A new #GNCSearchNumeric object.
  **/
 GNCSearchNumeric *
 gnc_search_numeric_new (void)
 {
-  GNCSearchNumeric *o = g_object_new(GNC_TYPE_SEARCH_NUMERIC, NULL);
-  return o;
+    GNCSearchNumeric *o = g_object_new(GNC_TYPE_SEARCH_NUMERIC, NULL);
+    return o;
 }
 
 /**
  * gnc_search_numeric_debcred_new:
  *
  * Create a new GNCSearchNumeric object, configured for DebCred.
- * 
+ *
  * Return value: A new #GNCSearchNumeric object.
  **/
 GNCSearchNumeric *
 gnc_search_numeric_debcred_new (void)
 {
-  GNCSearchNumeric *o;
-  GNCSearchNumericPrivate *priv;
+    GNCSearchNumeric *o;
+    GNCSearchNumericPrivate *priv;
 
-  o = g_object_new(GNC_TYPE_SEARCH_NUMERIC, NULL);
-  priv = _PRIVATE(o);
-  priv->is_debcred = TRUE;
-  return o;
+    o = g_object_new(GNC_TYPE_SEARCH_NUMERIC, NULL);
+    priv = _PRIVATE(o);
+    priv->is_debcred = TRUE;
+    return o;
 }
 
 void
 gnc_search_numeric_set_value (GNCSearchNumeric *fi, gnc_numeric value)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
-	
-  fi->value = value;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
+
+    fi->value = value;
 }
 
 void
 gnc_search_numeric_set_how (GNCSearchNumeric *fi, query_compare_t how)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
-  fi->how = how;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
+    fi->how = how;
 }
 
 void
 gnc_search_numeric_set_option (GNCSearchNumeric *fi, numeric_match_t option)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
-  fi->option = option;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
+    fi->option = option;
 }
 
 static gboolean
 gncs_validate (GNCSearchCoreType *fe)
 {
-  GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
-  gboolean valid = TRUE;
+    GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
+    gboolean valid = TRUE;
 
-  g_return_val_if_fail (fi, FALSE);
-  g_return_val_if_fail (IS_GNCSEARCH_NUMERIC (fi), FALSE);
-	
-  /* XXX */
+    g_return_val_if_fail (fi, FALSE);
+    g_return_val_if_fail (IS_GNCSEARCH_NUMERIC (fi), FALSE);
 
-  return valid;
+    /* XXX */
+
+    return valid;
 }
 
 static void
 entry_changed (GNCAmountEdit *entry, GNCSearchNumeric *fe)
 {
-  fe->value = gnc_amount_edit_get_amount (entry);
+    fe->value = gnc_amount_edit_get_amount (entry);
 }
 
 static GtkWidget *
 make_how_menu (GNCSearchCoreType *fe)
 {
-  GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
-  GNCSearchNumericPrivate *priv;
-  GtkComboBox *combo;
+    GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
+    GNCSearchNumericPrivate *priv;
+    GtkComboBox *combo;
 
-  priv = _PRIVATE(fi);
+    priv = _PRIVATE(fi);
 
-  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
-  gnc_combo_box_search_add(combo, (priv->is_debcred ?
-				   _("less than") : _("is less than")),
-			   COMPARE_LT);
-  gnc_combo_box_search_add(combo, (priv->is_debcred ?
-				   _("less than or equal to") :
-				   _("is less than or equal to")),
-			   COMPARE_LTE);
-  gnc_combo_box_search_add(combo, (priv->is_debcred ?
-				   _("equal to") : _("equals")),
-			   COMPARE_EQUAL);
-  gnc_combo_box_search_add(combo, (priv->is_debcred ?
-				   _("not equal to") : _("does not equal")),
-			   COMPARE_NEQ);
-  gnc_combo_box_search_add(combo, (priv->is_debcred ?
-				   _("greater than") : _("is greater than")),
-			   COMPARE_GT);
-  gnc_combo_box_search_add(combo, (priv->is_debcred ?
-				   _("greater than or equal to") :
-				   _("is greater than or equal to")),
-			   COMPARE_GTE);
+    combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+    gnc_combo_box_search_add(combo, (priv->is_debcred ?
+                                     _("less than") : _("is less than")),
+                             COMPARE_LT);
+    gnc_combo_box_search_add(combo, (priv->is_debcred ?
+                                     _("less than or equal to") :
+                                     _("is less than or equal to")),
+                             COMPARE_LTE);
+    gnc_combo_box_search_add(combo, (priv->is_debcred ?
+                                     _("equal to") : _("equals")),
+                             COMPARE_EQUAL);
+    gnc_combo_box_search_add(combo, (priv->is_debcred ?
+                                     _("not equal to") : _("does not equal")),
+                             COMPARE_NEQ);
+    gnc_combo_box_search_add(combo, (priv->is_debcred ?
+                                     _("greater than") : _("is greater than")),
+                             COMPARE_GT);
+    gnc_combo_box_search_add(combo, (priv->is_debcred ?
+                                     _("greater than or equal to") :
+                                     _("is greater than or equal to")),
+                             COMPARE_GTE);
 
-  gnc_combo_box_search_changed(combo, &fi->how);
-  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
+    gnc_combo_box_search_changed(combo, &fi->how);
+    gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
 
-  return GTK_WIDGET(combo);
+    return GTK_WIDGET(combo);
 }
 
 static GtkWidget *
 make_option_menu (GNCSearchCoreType *fe)
 {
-  GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
-  GtkComboBox *combo;
+    GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
+    GtkComboBox *combo;
 
-  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
-  gnc_combo_box_search_add(combo, _("has credits or debits"), NUMERIC_MATCH_ANY);
-  gnc_combo_box_search_add(combo, _("has debits"), NUMERIC_MATCH_DEBIT);
-  gnc_combo_box_search_add(combo, _("has credits"), NUMERIC_MATCH_CREDIT);
-  gnc_combo_box_search_changed(combo, &fi->option);
-  gnc_combo_box_search_set_active(combo, fi->option ? fi->option : NUMERIC_MATCH_ANY);
+    combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+    gnc_combo_box_search_add(combo, _("has credits or debits"), NUMERIC_MATCH_ANY);
+    gnc_combo_box_search_add(combo, _("has debits"), NUMERIC_MATCH_DEBIT);
+    gnc_combo_box_search_add(combo, _("has credits"), NUMERIC_MATCH_CREDIT);
+    gnc_combo_box_search_changed(combo, &fi->option);
+    gnc_combo_box_search_set_active(combo, fi->option ? fi->option : NUMERIC_MATCH_ANY);
 
-  return GTK_WIDGET(combo);
+    return GTK_WIDGET(combo);
 }
 
 static void
 grab_focus (GNCSearchCoreType *fe)
 {
-  GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
-  GNCSearchNumericPrivate *priv;
+    GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
+    GNCSearchNumericPrivate *priv;
 
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
 
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    gtk_widget_grab_focus (priv->entry);
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        gtk_widget_grab_focus (priv->entry);
 }
 
 static void
 editable_enters (GNCSearchCoreType *fe)
 {
-  GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
-  GNCSearchNumericPrivate *priv;
+    GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
+    GNCSearchNumericPrivate *priv;
 
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
 
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    gtk_entry_set_activates_default(GTK_ENTRY (priv->entry), TRUE);
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        gtk_entry_set_activates_default(GTK_ENTRY (priv->entry), TRUE);
 }
 
 static GtkWidget *
 gncs_get_widget (GNCSearchCoreType *fe)
 {
-  GtkWidget *entry, *menu, *box;
-  GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
-  GNCSearchNumericPrivate *priv;
+    GtkWidget *entry, *menu, *box;
+    GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
+    GNCSearchNumericPrivate *priv;
 
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_NUMERIC (fi), NULL);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_NUMERIC (fi), NULL);
 
-  priv = _PRIVATE(fi);
-  box = gtk_hbox_new (FALSE, 3);
+    priv = _PRIVATE(fi);
+    box = gtk_hbox_new (FALSE, 3);
 
-  /* Build and connect the option menu(s) */
-  if (priv->is_debcred) {
-    menu = make_option_menu (fe);
+    /* Build and connect the option menu(s) */
+    if (priv->is_debcred)
+    {
+        menu = make_option_menu (fe);
+        gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
+    }
+
+    menu = make_how_menu (fe);
     gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
-  }
 
-  menu = make_how_menu (fe);
-  gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
+    /* Build and connect the entry window */
+    entry = gnc_amount_edit_new ();
+    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (entry), fi->value);
+    g_signal_connect (G_OBJECT (entry), "amount_changed", G_CALLBACK (entry_changed), fe);
+    gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3);
+    priv->gae = GNC_AMOUNT_EDIT (entry);
+    priv->entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (entry));
 
-  /* Build and connect the entry window */
-  entry = gnc_amount_edit_new ();
-  gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (entry), fi->value);
-  g_signal_connect (G_OBJECT (entry), "amount_changed", G_CALLBACK (entry_changed), fe);
-  gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3);
-  priv->gae = GNC_AMOUNT_EDIT (entry);
-  priv->entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (entry));
-
-  /* And return the box */
-  return box;
+    /* And return the box */
+    return box;
 }
 
 static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe)
 {
-  GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
-  GNCSearchNumericPrivate *priv;
+    GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
+    GNCSearchNumericPrivate *priv;
 
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_NUMERIC (fi), NULL);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_NUMERIC (fi), NULL);
 
-  /* force the computation of the entry, because we may not get the signal */
-  priv = _PRIVATE(fi);
-  entry_changed (priv->gae, fi);
+    /* force the computation of the entry, because we may not get the signal */
+    priv = _PRIVATE(fi);
+    entry_changed (priv->gae, fi);
 
-  return gncQueryNumericPredicate (fi->how, fi->option, fi->value);
+    return gncQueryNumericPredicate (fi->how, fi->option, fi->value);
 }
 
 static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
 {
-  GNCSearchNumeric *se, *fse = (GNCSearchNumeric *)fe;
-  GNCSearchNumericPrivate *se_priv, *fse_priv;
+    GNCSearchNumeric *se, *fse = (GNCSearchNumeric *)fe;
+    GNCSearchNumericPrivate *se_priv, *fse_priv;
 
-  g_return_val_if_fail (fse, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_NUMERIC (fse), NULL);
-  fse_priv = _PRIVATE(fse);
+    g_return_val_if_fail (fse, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_NUMERIC (fse), NULL);
+    fse_priv = _PRIVATE(fse);
 
-  se = gnc_search_numeric_new ();
-  gnc_search_numeric_set_value (se, fse->value);
-  gnc_search_numeric_set_how (se, fse->how);
-  se_priv = _PRIVATE(se);
-  gnc_search_numeric_set_option (se, fse->option);
-  se_priv->is_debcred = fse_priv->is_debcred;
+    se = gnc_search_numeric_new ();
+    gnc_search_numeric_set_value (se, fse->value);
+    gnc_search_numeric_set_how (se, fse->how);
+    se_priv = _PRIVATE(se);
+    gnc_search_numeric_set_option (se, fse->option);
+    se_priv->is_debcred = fse_priv->is_debcred;
 
-  return (GNCSearchCoreType *)se;
+    return (GNCSearchCoreType *)se;
 }

Modified: gnucash/trunk/src/gnome-search/search-numeric.h
===================================================================
--- gnucash/trunk/src/gnome-search/search-numeric.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-numeric.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -33,21 +33,23 @@
 typedef struct _GNCSearchNumeric	GNCSearchNumeric;
 typedef struct _GNCSearchNumericClass	GNCSearchNumericClass;
 
-struct _GNCSearchNumeric {
-  GNCSearchCoreType parent;
-  struct _GNCSearchNumericPrivate *priv;
+struct _GNCSearchNumeric
+{
+    GNCSearchCoreType parent;
+    struct _GNCSearchNumericPrivate *priv;
 
-  query_compare_t	how;
-  gnc_numeric		value;
-  numeric_match_t	option;
+    query_compare_t	how;
+    gnc_numeric		value;
+    numeric_match_t	option;
 };
 
-struct _GNCSearchNumericClass {
-  GNCSearchCoreTypeClass parent_class;
+struct _GNCSearchNumericClass
+{
+    GNCSearchCoreTypeClass parent_class;
 
-  /* virtual methods */
+    /* virtual methods */
 
-  /* signals */
+    /* signals */
 };
 
 GType		gnc_search_numeric_get_type	(void);

Modified: gnucash/trunk/src/gnome-search/search-reconciled.c
===================================================================
--- gnucash/trunk/src/gnome-search/search-reconciled.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-reconciled.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -46,8 +46,9 @@
 
 typedef struct _GNCSearchReconciledPrivate GNCSearchReconciledPrivate;
 
-struct _GNCSearchReconciledPrivate {
-  gpointer dummy;
+struct _GNCSearchReconciledPrivate
+{
+    gpointer dummy;
 };
 
 #define _PRIVATE(o) \
@@ -58,226 +59,228 @@
 GType
 gnc_search_reconciled_get_type (void)
 {
-  static GType type = 0;
-	
-  if (!type) {
-    GTypeInfo type_info = {
-      sizeof(GNCSearchReconciledClass), /* class_size */
-      NULL,   			        /* base_init */
-      NULL,				/* base_finalize */
-      (GClassInitFunc)gnc_search_reconciled_class_init,
-      NULL,				/* class_finalize */
-      NULL,				/* class_data */
-      sizeof(GNCSearchReconciled),	/* */
-      0,				/* n_preallocs */
-      (GInstanceInitFunc)gnc_search_reconciled_init,
-    };
-		
-    type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
-				   "GNCSearchReconciled",
-				   &type_info, 0);
-  }
-	
-  return type;
+    static GType type = 0;
+
+    if (!type)
+    {
+        GTypeInfo type_info =
+        {
+            sizeof(GNCSearchReconciledClass), /* class_size */
+            NULL,   			        /* base_init */
+            NULL,				/* base_finalize */
+            (GClassInitFunc)gnc_search_reconciled_class_init,
+            NULL,				/* class_finalize */
+            NULL,				/* class_data */
+            sizeof(GNCSearchReconciled),	/* */
+            0,				/* n_preallocs */
+            (GInstanceInitFunc)gnc_search_reconciled_init,
+        };
+
+        type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
+                                       "GNCSearchReconciled",
+                                       &type_info, 0);
+    }
+
+    return type;
 }
 
 static void
 gnc_search_reconciled_class_init (GNCSearchReconciledClass *class)
 {
-  GObjectClass *object_class;
-  GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
+    GObjectClass *object_class;
+    GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
 
-  object_class = G_OBJECT_CLASS (class);
-  parent_class = g_type_class_peek_parent (class);
+    object_class = G_OBJECT_CLASS (class);
+    parent_class = g_type_class_peek_parent (class);
 
-  object_class->finalize = gnc_search_reconciled_finalize;
+    object_class->finalize = gnc_search_reconciled_finalize;
 
-  /* override methods */
-  gnc_search_core_type->validate = gncs_validate;
-  gnc_search_core_type->get_widget = gncs_get_widget;
-  gnc_search_core_type->get_predicate = gncs_get_predicate;
-  gnc_search_core_type->clone = gncs_clone;
+    /* override methods */
+    gnc_search_core_type->validate = gncs_validate;
+    gnc_search_core_type->get_widget = gncs_get_widget;
+    gnc_search_core_type->get_predicate = gncs_get_predicate;
+    gnc_search_core_type->clone = gncs_clone;
 
-  g_type_class_add_private(class, sizeof(GNCSearchReconciledPrivate));
+    g_type_class_add_private(class, sizeof(GNCSearchReconciledPrivate));
 }
 
 static void
 gnc_search_reconciled_init (GNCSearchReconciled *o)
 {
-  o->how = COMPARE_EQUAL;
-  o->value = CLEARED_NO;
+    o->how = COMPARE_EQUAL;
+    o->value = CLEARED_NO;
 }
 
 static void
 gnc_search_reconciled_finalize (GObject *obj)
 {
-  GNCSearchReconciled *o = (GNCSearchReconciled *)obj;
-  g_assert (IS_GNCSEARCH_RECONCILED (o));
+    GNCSearchReconciled *o = (GNCSearchReconciled *)obj;
+    g_assert (IS_GNCSEARCH_RECONCILED (o));
 
-  G_OBJECT_CLASS (parent_class)->finalize(obj);
+    G_OBJECT_CLASS (parent_class)->finalize(obj);
 }
 
 /**
  * gnc_search_reconciled_new:
  *
  * Create a new GNCSearchReconciled object.
- * 
+ *
  * Return value: A new #GNCSearchReconciled object.
  **/
 GNCSearchReconciled *
 gnc_search_reconciled_new (void)
 {
-  GNCSearchReconciled *o = g_object_new(GNC_TYPE_SEARCH_RECONCILED, NULL);
-  return o;
+    GNCSearchReconciled *o = g_object_new(GNC_TYPE_SEARCH_RECONCILED, NULL);
+    return o;
 }
 
 void
 gnc_search_reconciled_set_value (GNCSearchReconciled *fi, cleared_match_t value)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_RECONCILED (fi));
-	
-  fi->value = value;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_RECONCILED (fi));
+
+    fi->value = value;
 }
 
 void
 gnc_search_reconciled_set_how (GNCSearchReconciled *fi, char_match_t how)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_RECONCILED (fi));
-  fi->how = how;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_RECONCILED (fi));
+    fi->how = how;
 }
 
 static gboolean
 gncs_validate (GNCSearchCoreType *fe)
 {
-  GNCSearchReconciled *fi = (GNCSearchReconciled *)fe;
-  gboolean valid = TRUE;
+    GNCSearchReconciled *fi = (GNCSearchReconciled *)fe;
+    gboolean valid = TRUE;
 
-  g_return_val_if_fail (fi, FALSE);
-  g_return_val_if_fail (IS_GNCSEARCH_RECONCILED (fi), FALSE);
-	
-  /* XXX */
+    g_return_val_if_fail (fi, FALSE);
+    g_return_val_if_fail (IS_GNCSEARCH_RECONCILED (fi), FALSE);
 
-  return valid;
+    /* XXX */
+
+    return valid;
 }
 
 static void
 toggle_changed (GtkToggleButton *button, GNCSearchReconciled *fe)
 {
-  gboolean is_on = gtk_toggle_button_get_active (button);
-  cleared_match_t value =
-    (cleared_match_t) g_object_get_data (G_OBJECT (button), "button-value");
+    gboolean is_on = gtk_toggle_button_get_active (button);
+    cleared_match_t value =
+        (cleared_match_t) g_object_get_data (G_OBJECT (button), "button-value");
 
-  if (is_on)
-    fe->value |= value;
-  else
-    fe->value &= ~value;
+    if (is_on)
+        fe->value |= value;
+    else
+        fe->value &= ~value;
 }
 
 static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
-  GNCSearchReconciled *fi = (GNCSearchReconciled *)fe;
-  GtkComboBox *combo;
+    GNCSearchReconciled *fi = (GNCSearchReconciled *)fe;
+    GtkComboBox *combo;
 
-  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
-  gnc_combo_box_search_add(combo, _("is"), CHAR_MATCH_ANY);
-  gnc_combo_box_search_add(combo, _("is not"), CHAR_MATCH_NONE);
-  gnc_combo_box_search_changed(combo, &fi->how);
-  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : CHAR_MATCH_ANY);
+    combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+    gnc_combo_box_search_add(combo, _("is"), CHAR_MATCH_ANY);
+    gnc_combo_box_search_add(combo, _("is not"), CHAR_MATCH_NONE);
+    gnc_combo_box_search_changed(combo, &fi->how);
+    gnc_combo_box_search_set_active(combo, fi->how ? fi->how : CHAR_MATCH_ANY);
 
-  return GTK_WIDGET(combo);
+    return GTK_WIDGET(combo);
 }
 
 static GtkWidget *
 make_toggle (GNCSearchReconciled *fi, char *label, char_match_t option)
 {
-  GtkWidget *toggle;
+    GtkWidget *toggle;
 
-  toggle = gtk_toggle_button_new_with_label (label);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), (fi->value & option));
-  g_object_set_data (G_OBJECT (toggle), "button-value", (gpointer) option);
-  g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_changed), fi);
+    toggle = gtk_toggle_button_new_with_label (label);
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), (fi->value & option));
+    g_object_set_data (G_OBJECT (toggle), "button-value", (gpointer) option);
+    g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_changed), fi);
 
-  return toggle;
+    return toggle;
 }
 
 static GtkWidget *
 gncs_get_widget (GNCSearchCoreType *fe)
 {
-  GtkWidget *toggle, *menu, *box;
-  GNCSearchReconciled *fi = (GNCSearchReconciled *)fe;
-	
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_RECONCILED (fi), NULL);
+    GtkWidget *toggle, *menu, *box;
+    GNCSearchReconciled *fi = (GNCSearchReconciled *)fe;
 
-  box = gtk_hbox_new (FALSE, 3);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_RECONCILED (fi), NULL);
 
-  /* Build and connect the option menu */
-  menu = make_menu (fe);
-  gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
+    box = gtk_hbox_new (FALSE, 3);
 
-  /* Build and connect the toggles */
-  toggle = make_toggle (fi, _("Not Cleared"), CLEARED_NO);
-  gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
+    /* Build and connect the option menu */
+    menu = make_menu (fe);
+    gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
 
-  toggle = make_toggle (fi, _("Cleared"), CLEARED_CLEARED);
-  gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
+    /* Build and connect the toggles */
+    toggle = make_toggle (fi, _("Not Cleared"), CLEARED_NO);
+    gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
 
-  toggle = make_toggle (fi, _("Reconciled"), CLEARED_RECONCILED);
-  gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
+    toggle = make_toggle (fi, _("Cleared"), CLEARED_CLEARED);
+    gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
 
-  toggle = make_toggle (fi, _("Frozen"), CLEARED_FROZEN);
-  gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
+    toggle = make_toggle (fi, _("Reconciled"), CLEARED_RECONCILED);
+    gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
 
-  toggle = make_toggle (fi, _("Voided"), CLEARED_VOIDED);
-  gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
+    toggle = make_toggle (fi, _("Frozen"), CLEARED_FROZEN);
+    gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
 
-  /* And return the box */
-  return box;
+    toggle = make_toggle (fi, _("Voided"), CLEARED_VOIDED);
+    gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
+
+    /* And return the box */
+    return box;
 }
 
 static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe)
 {
-  GNCSearchReconciled *fi = (GNCSearchReconciled *)fe;
-  char chars[6];
-  cleared_match_t value;
-  int i;
+    GNCSearchReconciled *fi = (GNCSearchReconciled *)fe;
+    char chars[6];
+    cleared_match_t value;
+    int i;
 
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_RECONCILED (fi), NULL);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_RECONCILED (fi), NULL);
 
-  /* This code should look a lot like xaccQueryAddClearedMatch() */
+    /* This code should look a lot like xaccQueryAddClearedMatch() */
 
-  value = fi->value;
-  i = 0;
+    value = fi->value;
+    i = 0;
 
-  if (value & CLEARED_CLEARED)
-    chars[i++] = CREC;
-  if (value & CLEARED_RECONCILED)
-    chars[i++] = YREC;
-  if (value & CLEARED_FROZEN)
-    chars[i++] = FREC;
-  if (value & CLEARED_NO)
-    chars[i++] = NREC;
-  if (value & CLEARED_VOIDED)
-    chars[i++] = VREC;
-  chars[i] = '\0';
+    if (value & CLEARED_CLEARED)
+        chars[i++] = CREC;
+    if (value & CLEARED_RECONCILED)
+        chars[i++] = YREC;
+    if (value & CLEARED_FROZEN)
+        chars[i++] = FREC;
+    if (value & CLEARED_NO)
+        chars[i++] = NREC;
+    if (value & CLEARED_VOIDED)
+        chars[i++] = VREC;
+    chars[i] = '\0';
 
-  return gncQueryCharPredicate (fi->how, chars);
+    return gncQueryCharPredicate (fi->how, chars);
 }
 
 static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
 {
-  GNCSearchReconciled *se, *fse = (GNCSearchReconciled *)fe;
+    GNCSearchReconciled *se, *fse = (GNCSearchReconciled *)fe;
 
-  g_return_val_if_fail (fse, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_RECONCILED (fse), NULL);
+    g_return_val_if_fail (fse, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_RECONCILED (fse), NULL);
 
-  se = gnc_search_reconciled_new ();
-  gnc_search_reconciled_set_value (se, fse->value);
-  gnc_search_reconciled_set_how (se, fse->how);
+    se = gnc_search_reconciled_new ();
+    gnc_search_reconciled_set_value (se, fse->value);
+    gnc_search_reconciled_set_how (se, fse->how);
 
-  return (GNCSearchCoreType *)se;
+    return (GNCSearchCoreType *)se;
 }

Modified: gnucash/trunk/src/gnome-search/search-reconciled.h
===================================================================
--- gnucash/trunk/src/gnome-search/search-reconciled.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-reconciled.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -32,19 +32,21 @@
 typedef struct _GNCSearchReconciled	GNCSearchReconciled;
 typedef struct _GNCSearchReconciledClass	GNCSearchReconciledClass;
 
-struct _GNCSearchReconciled {
-  GNCSearchCoreType parent;
+struct _GNCSearchReconciled
+{
+    GNCSearchCoreType parent;
 
-  char_match_t		how;
-  cleared_match_t	value;
+    char_match_t		how;
+    cleared_match_t	value;
 };
 
-struct _GNCSearchReconciledClass {
-  GNCSearchCoreTypeClass parent_class;
+struct _GNCSearchReconciledClass
+{
+    GNCSearchCoreTypeClass parent_class;
 
-  /* virtual methods */
+    /* virtual methods */
 
-  /* signals */
+    /* signals */
 };
 
 GType		gnc_search_reconciled_get_type	(void);

Modified: gnucash/trunk/src/gnome-search/search-string.c
===================================================================
--- gnucash/trunk/src/gnome-search/search-string.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-string.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -49,8 +49,9 @@
 
 typedef struct _GNCSearchStringPrivate GNCSearchStringPrivate;
 
-struct _GNCSearchStringPrivate {
-  GtkWidget *entry;
+struct _GNCSearchStringPrivate
+{
+    GtkWidget *entry;
 };
 
 #define _PRIVATE(o) \
@@ -61,318 +62,324 @@
 GType
 gnc_search_string_get_type (void)
 {
-  static GType type = 0;
-	
-  if (!type) {
-    GTypeInfo type_info = {
-      sizeof(GNCSearchStringClass),     /* class_size */
-      NULL,   				/* base_init */
-      NULL,				/* base_finalize */
-      (GClassInitFunc)gnc_search_string_class_init,
-      NULL,				/* class_finalize */
-      NULL,				/* class_data */
-      sizeof(GNCSearchString),		/* */
-      0,				/* n_preallocs */
-      (GInstanceInitFunc)gnc_search_string_init,
-    };
-		
-    type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
-				   "GNCSearchString",
-				   &type_info, 0);
-  }
-	
-  return type;
+    static GType type = 0;
+
+    if (!type)
+    {
+        GTypeInfo type_info =
+        {
+            sizeof(GNCSearchStringClass),     /* class_size */
+            NULL,   				/* base_init */
+            NULL,				/* base_finalize */
+            (GClassInitFunc)gnc_search_string_class_init,
+            NULL,				/* class_finalize */
+            NULL,				/* class_data */
+            sizeof(GNCSearchString),		/* */
+            0,				/* n_preallocs */
+            (GInstanceInitFunc)gnc_search_string_init,
+        };
+
+        type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
+                                       "GNCSearchString",
+                                       &type_info, 0);
+    }
+
+    return type;
 }
 
 static void
 gnc_search_string_class_init (GNCSearchStringClass *class)
 {
-  GObjectClass *object_class;
-  GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
+    GObjectClass *object_class;
+    GNCSearchCoreTypeClass *gnc_search_core_type = (GNCSearchCoreTypeClass *)class;
 
-  object_class = G_OBJECT_CLASS (class);
-  parent_class = g_type_class_peek_parent (class);
+    object_class = G_OBJECT_CLASS (class);
+    parent_class = g_type_class_peek_parent (class);
 
-  object_class->finalize = gnc_search_string_finalize;
+    object_class->finalize = gnc_search_string_finalize;
 
-  /* override methods */
-  gnc_search_core_type->editable_enters = editable_enters;
-  gnc_search_core_type->grab_focus = grab_focus;
-  gnc_search_core_type->validate = gncs_validate;
-  gnc_search_core_type->get_widget = gncs_get_widget;
-  gnc_search_core_type->get_predicate = gncs_get_predicate;
-  gnc_search_core_type->clone = gncs_clone;
+    /* override methods */
+    gnc_search_core_type->editable_enters = editable_enters;
+    gnc_search_core_type->grab_focus = grab_focus;
+    gnc_search_core_type->validate = gncs_validate;
+    gnc_search_core_type->get_widget = gncs_get_widget;
+    gnc_search_core_type->get_predicate = gncs_get_predicate;
+    gnc_search_core_type->clone = gncs_clone;
 
-  g_type_class_add_private(class, sizeof(GNCSearchStringPrivate));
+    g_type_class_add_private(class, sizeof(GNCSearchStringPrivate));
 }
 
 static void
 gnc_search_string_init (GNCSearchString *o)
 {
-  o->value = NULL;
-  o->how = SEARCH_STRING_CONTAINS;
-  o->ign_case = TRUE;
+    o->value = NULL;
+    o->how = SEARCH_STRING_CONTAINS;
+    o->ign_case = TRUE;
 }
 
 static void
 gnc_search_string_finalize (GObject *obj)
 {
-  GNCSearchString *o = (GNCSearchString *)obj;
-  g_assert (IS_GNCSEARCH_STRING (o));
+    GNCSearchString *o = (GNCSearchString *)obj;
+    g_assert (IS_GNCSEARCH_STRING (o));
 
-  g_free (o->value);
-	
-  G_OBJECT_CLASS (parent_class)->finalize(obj);
+    g_free (o->value);
+
+    G_OBJECT_CLASS (parent_class)->finalize(obj);
 }
 
 /**
  * gnc_search_string_new:
  *
  * Create a new GNCSearchString object.
- * 
+ *
  * Return value: A new #GNCSearchString object.
  **/
 GNCSearchString *
 gnc_search_string_new (void)
 {
-  GNCSearchString *o = g_object_new(GNC_TYPE_SEARCH_STRING, NULL);
-  return o;
+    GNCSearchString *o = g_object_new(GNC_TYPE_SEARCH_STRING, NULL);
+    return o;
 }
 
 void
 gnc_search_string_set_value (GNCSearchString *fi, const char *value)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_STRING (fi));
-	
-  if (fi->value)
-    g_free (fi->value);
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_STRING (fi));
 
-  fi->value = g_strdup (value);
+    if (fi->value)
+        g_free (fi->value);
+
+    fi->value = g_strdup (value);
 }
 
 void
 gnc_search_string_set_how (GNCSearchString *fi, GNCSearchString_Type how)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_STRING (fi));
-  fi->how = how;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_STRING (fi));
+    fi->how = how;
 }
 
 void
 gnc_search_string_set_case (GNCSearchString *fi, gboolean ignore_case)
 {
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_STRING (fi));
-  fi->ign_case = ignore_case;
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_STRING (fi));
+    fi->ign_case = ignore_case;
 }
 
 static gboolean
 gncs_validate (GNCSearchCoreType *fe)
 {
-  GNCSearchString *fi = (GNCSearchString *)fe;
-  gboolean valid = TRUE;
+    GNCSearchString *fi = (GNCSearchString *)fe;
+    gboolean valid = TRUE;
 
-  g_return_val_if_fail (fi, FALSE);
-  g_return_val_if_fail (IS_GNCSEARCH_STRING (fi), FALSE);
-	
-  if (!fi->value || *(fi->value) == '\0') {
-    GtkWidget *dialog;
-    dialog = gtk_message_dialog_new (NULL,
-				     GTK_DIALOG_MODAL,
-				     GTK_MESSAGE_ERROR,
-				     GTK_BUTTONS_OK,
-				     "%s",
-				     _("You need to enter some search text."));
-    gtk_dialog_run (GTK_DIALOG (dialog));
-    gtk_widget_destroy(dialog);
-    return FALSE;
-  }
+    g_return_val_if_fail (fi, FALSE);
+    g_return_val_if_fail (IS_GNCSEARCH_STRING (fi), FALSE);
 
-  if (fi->how == SEARCH_STRING_MATCHES_REGEX ||
-      fi->how == SEARCH_STRING_NOT_MATCHES_REGEX) {
-    regex_t regexpat;        /* regex patern */
-    gint regerr;
-    int flags = REG_EXTENDED;
-		
-    if (fi->ign_case)
-      flags |= REG_ICASE;
+    if (!fi->value || *(fi->value) == '\0')
+    {
+        GtkWidget *dialog;
+        dialog = gtk_message_dialog_new (NULL,
+                                         GTK_DIALOG_MODAL,
+                                         GTK_MESSAGE_ERROR,
+                                         GTK_BUTTONS_OK,
+                                         "%s",
+                                         _("You need to enter some search text."));
+        gtk_dialog_run (GTK_DIALOG (dialog));
+        gtk_widget_destroy(dialog);
+        return FALSE;
+    }
 
-    regerr = regcomp (&regexpat, fi->value, flags);
-    if (regerr) {
-      GtkWidget *dialog;
-      gchar *regmsg, *errmsg;
-      size_t reglen;
-			
-      /* regerror gets called twice to get the full error string 
-	 length to do proper posix error reporting */
-      reglen = regerror (regerr, &regexpat, 0, 0);
-      regmsg = g_malloc0 (reglen + 1);
-      regerror (regerr, &regexpat, regmsg, reglen);
-			
-      errmsg = g_strdup_printf (_("Error in regular expression '%s':\n%s"),
-				fi->value, regmsg);
-      g_free (regmsg);
-			
-      dialog = gtk_message_dialog_new (NULL,
-				       GTK_DIALOG_MODAL,
-				       GTK_MESSAGE_ERROR,
-				       GTK_BUTTONS_OK,
-				       "%s", errmsg);
-      gtk_dialog_run (GTK_DIALOG (dialog));
-      gtk_widget_destroy(dialog);
-      g_free (errmsg);
-      valid = FALSE;
+    if (fi->how == SEARCH_STRING_MATCHES_REGEX ||
+            fi->how == SEARCH_STRING_NOT_MATCHES_REGEX)
+    {
+        regex_t regexpat;        /* regex patern */
+        gint regerr;
+        int flags = REG_EXTENDED;
+
+        if (fi->ign_case)
+            flags |= REG_ICASE;
+
+        regerr = regcomp (&regexpat, fi->value, flags);
+        if (regerr)
+        {
+            GtkWidget *dialog;
+            gchar *regmsg, *errmsg;
+            size_t reglen;
+
+            /* regerror gets called twice to get the full error string
+            	 length to do proper posix error reporting */
+            reglen = regerror (regerr, &regexpat, 0, 0);
+            regmsg = g_malloc0 (reglen + 1);
+            regerror (regerr, &regexpat, regmsg, reglen);
+
+            errmsg = g_strdup_printf (_("Error in regular expression '%s':\n%s"),
+                                      fi->value, regmsg);
+            g_free (regmsg);
+
+            dialog = gtk_message_dialog_new (NULL,
+                                             GTK_DIALOG_MODAL,
+                                             GTK_MESSAGE_ERROR,
+                                             GTK_BUTTONS_OK,
+                                             "%s", errmsg);
+            gtk_dialog_run (GTK_DIALOG (dialog));
+            gtk_widget_destroy(dialog);
+            g_free (errmsg);
+            valid = FALSE;
+        }
+
+        regfree (&regexpat);
     }
-		
-    regfree (&regexpat);
-  }
-	
-  return valid;
+
+    return valid;
 }
 
 static void
 toggle_changed (GtkToggleButton *button, GNCSearchString *fe)
 {
-  fe->ign_case = gtk_toggle_button_get_active (button);
+    fe->ign_case = gtk_toggle_button_get_active (button);
 }
 
 static void
 entry_changed (GtkEntry *entry, GNCSearchString *fe)
 {
-  const char *new;
-	
-  new = gtk_entry_get_text(entry);
-  gnc_search_string_set_value (fe, new);
+    const char *new;
+
+    new = gtk_entry_get_text(entry);
+    gnc_search_string_set_value (fe, new);
 }
 
 static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
-  GNCSearchString *fi = (GNCSearchString *)fe;
-  GtkComboBox *combo;
+    GNCSearchString *fi = (GNCSearchString *)fe;
+    GtkComboBox *combo;
 
-  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+    combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
 
-  gnc_combo_box_search_add(combo, _("contains"), SEARCH_STRING_CONTAINS);
-  gnc_combo_box_search_add(combo, _("matches regex"),
-				SEARCH_STRING_MATCHES_REGEX);
-  gnc_combo_box_search_add(combo, _("does not match regex"),
-				SEARCH_STRING_NOT_MATCHES_REGEX);
-  gnc_combo_box_search_changed(combo, &fi->how);
-  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : SEARCH_STRING_CONTAINS);
+    gnc_combo_box_search_add(combo, _("contains"), SEARCH_STRING_CONTAINS);
+    gnc_combo_box_search_add(combo, _("matches regex"),
+                             SEARCH_STRING_MATCHES_REGEX);
+    gnc_combo_box_search_add(combo, _("does not match regex"),
+                             SEARCH_STRING_NOT_MATCHES_REGEX);
+    gnc_combo_box_search_changed(combo, &fi->how);
+    gnc_combo_box_search_set_active(combo, fi->how ? fi->how : SEARCH_STRING_CONTAINS);
 
-  return GTK_WIDGET(combo);
+    return GTK_WIDGET(combo);
 }
 
 static void
 grab_focus (GNCSearchCoreType *fe)
 {
-  GNCSearchString *fi = (GNCSearchString *)fe;
-  GNCSearchStringPrivate *priv;
+    GNCSearchString *fi = (GNCSearchString *)fe;
+    GNCSearchStringPrivate *priv;
 
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_STRING (fi));
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_STRING (fi));
 
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    gtk_widget_grab_focus (priv->entry);
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        gtk_widget_grab_focus (priv->entry);
 }
 
 static void
 editable_enters (GNCSearchCoreType *fe)
 {
-  GNCSearchString *fi = (GNCSearchString *)fe;
-  GNCSearchStringPrivate *priv;
+    GNCSearchString *fi = (GNCSearchString *)fe;
+    GNCSearchStringPrivate *priv;
 
-  g_return_if_fail (fi);
-  g_return_if_fail (IS_GNCSEARCH_STRING (fi));
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_STRING (fi));
 
-  priv = _PRIVATE(fi);
-  if (priv->entry)
-    gtk_entry_set_activates_default(GTK_ENTRY (priv->entry), TRUE);
+    priv = _PRIVATE(fi);
+    if (priv->entry)
+        gtk_entry_set_activates_default(GTK_ENTRY (priv->entry), TRUE);
 }
 
 static GtkWidget *
 gncs_get_widget (GNCSearchCoreType *fe)
 {
-  GtkWidget *entry, *toggle, *menu, *box;
-  GNCSearchString *fi = (GNCSearchString *)fe;
-  GNCSearchStringPrivate *priv;
-	
-  g_return_val_if_fail (fi, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_STRING (fi), NULL);
+    GtkWidget *entry, *toggle, *menu, *box;
+    GNCSearchString *fi = (GNCSearchString *)fe;
+    GNCSearchStringPrivate *priv;
 
-  priv = _PRIVATE(fi);
-  box = gtk_hbox_new (FALSE, 3);
+    g_return_val_if_fail (fi, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_STRING (fi), NULL);
 
-  /* Build and connect the option menu */
-  menu = make_menu (fe);
-  gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
+    priv = _PRIVATE(fi);
+    box = gtk_hbox_new (FALSE, 3);
 
-  /* Build and connect the entry window */
-  entry = gtk_entry_new ();
-  if (fi->value)
-    gtk_entry_set_text (GTK_ENTRY (entry), fi->value);
-  g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (entry_changed), fe);
-  gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3);
-  priv->entry = entry;
+    /* Build and connect the option menu */
+    menu = make_menu (fe);
+    gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
 
-  /* Build and connect the toggle button */
-  toggle = gtk_toggle_button_new_with_label (_("Case Insensitive?"));
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), fi->ign_case);
-  g_signal_connect (G_OBJECT(toggle), "toggled", G_CALLBACK (toggle_changed), fe);
-  gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
+    /* Build and connect the entry window */
+    entry = gtk_entry_new ();
+    if (fi->value)
+        gtk_entry_set_text (GTK_ENTRY (entry), fi->value);
+    g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (entry_changed), fe);
+    gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 3);
+    priv->entry = entry;
 
-  /* And return the box */
-  return box;
+    /* Build and connect the toggle button */
+    toggle = gtk_toggle_button_new_with_label (_("Case Insensitive?"));
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), fi->ign_case);
+    g_signal_connect (G_OBJECT(toggle), "toggled", G_CALLBACK (toggle_changed), fe);
+    gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
+
+    /* And return the box */
+    return box;
 }
 
 static QueryPredData_t gncs_get_predicate (GNCSearchCoreType *fe)
 {
-  GNCSearchString *ss = (GNCSearchString *)fe;
-  query_compare_t how;
-  string_match_t options = STRING_MATCH_NORMAL;
-  gboolean is_regex = FALSE;
+    GNCSearchString *ss = (GNCSearchString *)fe;
+    query_compare_t how;
+    string_match_t options = STRING_MATCH_NORMAL;
+    gboolean is_regex = FALSE;
 
-  g_return_val_if_fail (ss, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_STRING (ss), NULL);
+    g_return_val_if_fail (ss, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_STRING (ss), NULL);
 
-  switch (ss->how) {
-  case SEARCH_STRING_MATCHES_REGEX:
-    is_regex = TRUE;
-    /* FALLTHROUGH */
-  case SEARCH_STRING_CONTAINS:
-    how = COMPARE_EQUAL;
-    break;
-  case SEARCH_STRING_NOT_MATCHES_REGEX:
-    is_regex = TRUE;
-    /* FALLTHROUGH */
-  case SEARCH_STRING_NOT_CONTAINS:
-    how = COMPARE_NEQ;
-    break;
-  default:
-    g_warning ("invalid string choice: %d", ss->how);
-    return NULL;
-  }
+    switch (ss->how)
+    {
+    case SEARCH_STRING_MATCHES_REGEX:
+        is_regex = TRUE;
+        /* FALLTHROUGH */
+    case SEARCH_STRING_CONTAINS:
+        how = COMPARE_EQUAL;
+        break;
+    case SEARCH_STRING_NOT_MATCHES_REGEX:
+        is_regex = TRUE;
+        /* FALLTHROUGH */
+    case SEARCH_STRING_NOT_CONTAINS:
+        how = COMPARE_NEQ;
+        break;
+    default:
+        g_warning ("invalid string choice: %d", ss->how);
+        return NULL;
+    }
 
-  if (ss->ign_case)
-    options = STRING_MATCH_CASEINSENSITIVE;
+    if (ss->ign_case)
+        options = STRING_MATCH_CASEINSENSITIVE;
 
-  return gncQueryStringPredicate (how, ss->value, options, is_regex);
+    return gncQueryStringPredicate (how, ss->value, options, is_regex);
 }
 
 static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
 {
-  GNCSearchString *se, *fse = (GNCSearchString *)fe;
+    GNCSearchString *se, *fse = (GNCSearchString *)fe;
 
-  g_return_val_if_fail (fse, NULL);
-  g_return_val_if_fail (IS_GNCSEARCH_STRING (fse), NULL);
+    g_return_val_if_fail (fse, NULL);
+    g_return_val_if_fail (IS_GNCSEARCH_STRING (fse), NULL);
 
-  se = gnc_search_string_new ();
-  gnc_search_string_set_value (se, fse->value);
-  gnc_search_string_set_how (se, fse->how);
-  gnc_search_string_set_case (se, fse->ign_case);
+    se = gnc_search_string_new ();
+    gnc_search_string_set_value (se, fse->value);
+    gnc_search_string_set_how (se, fse->how);
+    gnc_search_string_set_case (se, fse->ign_case);
 
-  return (GNCSearchCoreType *)se;
+    return (GNCSearchCoreType *)se;
 }

Modified: gnucash/trunk/src/gnome-search/search-string.h
===================================================================
--- gnucash/trunk/src/gnome-search/search-string.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-search/search-string.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -31,27 +31,30 @@
 typedef struct _GNCSearchString	GNCSearchString;
 typedef struct _GNCSearchStringClass	GNCSearchStringClass;
 
-typedef enum _search_string_how {
-  SEARCH_STRING_CONTAINS,
-  SEARCH_STRING_NOT_CONTAINS,
-  SEARCH_STRING_MATCHES_REGEX,
-  SEARCH_STRING_NOT_MATCHES_REGEX
+typedef enum _search_string_how
+{
+    SEARCH_STRING_CONTAINS,
+    SEARCH_STRING_NOT_CONTAINS,
+    SEARCH_STRING_MATCHES_REGEX,
+    SEARCH_STRING_NOT_MATCHES_REGEX
 } GNCSearchString_Type;
 
-struct _GNCSearchString {
-  GNCSearchCoreType parent;
+struct _GNCSearchString
+{
+    GNCSearchCoreType parent;
 
-  GNCSearchString_Type	how;
-  gboolean		ign_case;
-  char *		value;
+    GNCSearchString_Type	how;
+    gboolean		ign_case;
+    char *		value;
 };
 
-struct _GNCSearchStringClass {
-  GNCSearchCoreTypeClass parent_class;
+struct _GNCSearchStringClass
+{
+    GNCSearchCoreTypeClass parent_class;
 
-  /* virtual methods */
+    /* virtual methods */
 
-  /* signals */
+    /* signals */
 };
 
 GType		gnc_search_string_get_type	(void);

Modified: gnucash/trunk/src/gnome-utils/gncmod-gnome-utils.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gncmod-gnome-utils.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/gnome-utils/gncmod-gnome-utils.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -34,61 +34,68 @@
 
 
 char *
-libgncmod_gnome_utils_gnc_module_path(void) {
-  return g_strdup("gnucash/gnome-utils");
+libgncmod_gnome_utils_gnc_module_path(void)
+{
+    return g_strdup("gnucash/gnome-utils");
 }
 
 char *
-libgncmod_gnome_utils_gnc_module_description(void) {
-  return g_strdup("Utilities for using Gnome/Gtk with GnuCash");
+libgncmod_gnome_utils_gnc_module_description(void)
+{
+    return g_strdup("Utilities for using Gnome/Gtk with GnuCash");
 }
 
 static void
 lmod(char * mn)
 {
-  char * form = g_strdup_printf("(use-modules %s)\n", mn);
-  scm_c_eval_string(form);
-  g_free(form);
+    char * form = g_strdup_printf("(use-modules %s)\n", mn);
+    scm_c_eval_string(form);
+    g_free(form);
 }
 
 extern SCM scm_init_sw_gnome_utils_module(void);
 
 int
-libgncmod_gnome_utils_gnc_module_init(int refcount) {
-  /* load the engine (we depend on it) */
-  if(!gnc_module_load("gnucash/engine", 0)) {
-    return FALSE;
-  }
+libgncmod_gnome_utils_gnc_module_init(int refcount)
+{
+    /* load the engine (we depend on it) */
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
 
-  /* load the calculation module (we depend on it) */
-  if(!gnc_module_load("gnucash/calculation", 0)) {
-    return FALSE;
-  }
+    /* load the calculation module (we depend on it) */
+    if (!gnc_module_load("gnucash/calculation", 0))
+    {
+        return FALSE;
+    }
 
-  if(!gnc_module_load("gnucash/app-utils", 0)) {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
 
-  scm_init_sw_gnome_utils_module();
-  lmod("(sw_gnome_utils)");
-  lmod("(gnucash gnome-utils)");
+    scm_init_sw_gnome_utils_module();
+    lmod("(sw_gnome_utils)");
+    lmod("(gnucash gnome-utils)");
 
-  /* Initialize the options-ui database */
-  if (refcount == 0) {
-    gnc_options_ui_initialize ();
+    /* Initialize the options-ui database */
+    if (refcount == 0)
+    {
+        gnc_options_ui_initialize ();
 
-    /* register the druid pieces */
-    gnc_druid_gnome_register();
-    gnc_druid_provider_edge_gnome_register();
-    gnc_druid_provider_file_gnome_register();
-    gnc_druid_provider_multifile_gnome_register();
-  }
+        /* register the druid pieces */
+        gnc_druid_gnome_register();
+        gnc_druid_provider_edge_gnome_register();
+        gnc_druid_provider_file_gnome_register();
+        gnc_druid_provider_multifile_gnome_register();
+    }
 
-  return TRUE;
+    return TRUE;
 }
 
 int
 libgncmod_gnome_utils_gnc_module_end(int refcount)
 {
-  return TRUE;
+    return TRUE;
 }

Modified: gnucash/trunk/src/html/gnc-html-extras.h
===================================================================
--- gnucash/trunk/src/html/gnc-html-extras.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-extras.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -37,10 +37,10 @@
 #define URL_TYPE_REGISTER	"register"   /* for gnucash register popups */
 #define URL_TYPE_ACCTTREE	"accttree"   /* for account tree windows */
 #define URL_TYPE_REPORT	"report"     /* for gnucash report popups */
-#define URL_TYPE_OPTIONS	"options"    /* for editing report options */ 
+#define URL_TYPE_OPTIONS	"options"    /* for editing report options */
 #define URL_TYPE_SCHEME	"scheme"     /* for scheme code evaluation */
 #define URL_TYPE_HELP	"help"       /* for a gnucash help window */
-#define URL_TYPE_XMLDATA	"xmldata"    /* links to gnucash XML data files */ 
+#define URL_TYPE_XMLDATA	"xmldata"    /* links to gnucash XML data files */
 #define URL_TYPE_PRICE	"price"      /* for price editor popups */
 #define URL_TYPE_OTHER	"other"
 #define URL_TYPE_BUDGET "budget"

Modified: gnucash/trunk/src/html/gnc-html-factory.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-factory.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-factory.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -39,9 +39,9 @@
 GncHtml* gnc_html_factory_create_html( void )
 {
 #ifdef WANT_WEBKIT
-	return gnc_html_webkit_new();
+    return gnc_html_webkit_new();
 #else
-	return gnc_html_gtkhtml_new();
+    return gnc_html_gtkhtml_new();
 #endif
 }
 
@@ -49,8 +49,8 @@
 gnc_html_engine_supports_css( void )
 {
 #ifdef WANT_WEBKIT
-	return TRUE;
+    return TRUE;
 #else
-	return FALSE;
+    return FALSE;
 #endif
 }

Modified: gnucash/trunk/src/html/gnc-html-graph-gog-gtkhtml.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-graph-gog-gtkhtml.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-graph-gog-gtkhtml.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -92,95 +92,101 @@
 void
 gnc_html_graph_gog_gtkhtml_init( void )
 {
-	gnc_html_graph_gog_init();
+    gnc_html_graph_gog_init();
 
-	gnc_html_register_object_handler( GNC_CHART_PIE, handle_piechart );
-	gnc_html_register_object_handler( GNC_CHART_BAR, handle_barchart );
-	gnc_html_register_object_handler( GNC_CHART_SCATTER, handle_scatter );
-	gnc_html_register_object_handler( GNC_CHART_LINE, handle_linechart );
+    gnc_html_register_object_handler( GNC_CHART_PIE, handle_piechart );
+    gnc_html_register_object_handler( GNC_CHART_BAR, handle_barchart );
+    gnc_html_register_object_handler( GNC_CHART_SCATTER, handle_scatter );
+    gnc_html_register_object_handler( GNC_CHART_LINE, handle_linechart );
 }
 
-static double * 
+static double *
 read_doubles(const char * string, int nvalues)
 {
-  int    n;
-  gchar *next;
-  double * retval = g_new0(double, nvalues);
+    int    n;
+    gchar *next;
+    double * retval = g_new0(double, nvalues);
 
-  // guile is going to (puts ...) the elements of the double array
-  // together. In non-POSIX locales, that will be in a format that
-  // the locale-specific sscanf will not be able to parse.
-  gnc_push_locale("C");
-  {
-    for (n=0; n<nvalues; n++) {
-      retval[n] = strtod(string, &next);
-      string = next;
-     }
-  }
-  gnc_pop_locale();
+    // guile is going to (puts ...) the elements of the double array
+    // together. In non-POSIX locales, that will be in a format that
+    // the locale-specific sscanf will not be able to parse.
+    gnc_push_locale("C");
+    {
+        for (n = 0; n < nvalues; n++)
+        {
+            retval[n] = strtod(string, &next);
+            string = next;
+        }
+    }
+    gnc_pop_locale();
 
-  return retval;
+    return retval;
 }
 
-static char ** 
+static char **
 read_strings(const char * string, int nvalues)
 {
-  int n;
-  int choffset=0;
-  int accum = 0;
-  char ** retval = g_new0(char *, nvalues);
-  char thischar;
-  const char * inptr = string;
-  int escaped = FALSE;
+    int n;
+    int choffset = 0;
+    int accum = 0;
+    char ** retval = g_new0(char *, nvalues);
+    char thischar;
+    const char * inptr = string;
+    int escaped = FALSE;
 
-  for (n=0; n < nvalues; n++) {
-    retval[n] = g_new0(char, strlen(string+accum)+1);
-    retval[n][0] = 0;
-    choffset = 0;
-    while ((thischar = *inptr) != 0) {
-      if (thischar == '\\') {
-        escaped = TRUE;
-        inptr++;
-      }
-      else if ((thischar != ' ') || escaped) {
-        retval[n][choffset] = thischar;
-        retval[n][choffset+1] = 0;    
-        choffset++;
-        escaped = FALSE;
-        inptr++;
-      }
-      else {
-        /* an unescaped space */
-        escaped = FALSE;
-        inptr++;
-        break;
-      }
+    for (n = 0; n < nvalues; n++)
+    {
+        retval[n] = g_new0(char, strlen(string + accum) + 1);
+        retval[n][0] = 0;
+        choffset = 0;
+        while ((thischar = *inptr) != 0)
+        {
+            if (thischar == '\\')
+            {
+                escaped = TRUE;
+                inptr++;
+            }
+            else if ((thischar != ' ') || escaped)
+            {
+                retval[n][choffset] = thischar;
+                retval[n][choffset+1] = 0;
+                choffset++;
+                escaped = FALSE;
+                inptr++;
+            }
+            else
+            {
+                /* an unescaped space */
+                escaped = FALSE;
+                inptr++;
+                break;
+            }
+        }
+        accum += choffset;
+        /* printf("retval[%d] = '%s'\n", n, retval[n]); */
     }
-    accum += choffset;
-    /* printf("retval[%d] = '%s'\n", n, retval[n]); */
-  }
-  
-  return retval;  
+
+    return retval;
 }
 
 static void
 add_pixbuf_graph_widget( GtkHTMLEmbedded *eb, GdkPixbuf* buf )
 {
-  GtkWidget *widget;
-  gboolean update_status;
-  GogGraph *graph = GOG_GRAPH(g_object_get_data( G_OBJECT(buf), "graph" ));
+    GtkWidget *widget;
+    gboolean update_status;
+    GogGraph *graph = GOG_GRAPH(g_object_get_data( G_OBJECT(buf), "graph" ));
 
-  widget = gtk_image_new_from_pixbuf (buf);
-  gtk_widget_set_size_request (widget, eb->width, eb->height);
-  gtk_widget_show_all (widget);
-  gtk_container_add (GTK_CONTAINER (eb), widget);
+    widget = gtk_image_new_from_pixbuf (buf);
+    gtk_widget_set_size_request (widget, eb->width, eb->height);
+    gtk_widget_show_all (widget);
+    gtk_container_add (GTK_CONTAINER (eb), widget);
 
-  // blindly copied from gnc-html-guppi.c..
-  gtk_widget_set_size_request (GTK_WIDGET (eb), eb->width, eb->height);
+    // blindly copied from gnc-html-guppi.c..
+    gtk_widget_set_size_request (GTK_WIDGET (eb), eb->width, eb->height);
 
-  g_object_set_data_full (G_OBJECT (eb), "graph", graph, g_object_unref);
-  g_signal_connect (G_OBJECT (eb), "draw_print",
-		    G_CALLBACK (draw_print_cb), NULL);
+    g_object_set_data_full (G_OBJECT (eb), "graph", graph, g_object_unref);
+    g_signal_connect (G_OBJECT (eb), "draw_print",
+                      G_CALLBACK (draw_print_cb), NULL);
 }
 
 /*
@@ -197,34 +203,34 @@
 static gboolean
 handle_piechart( GncHtml* html, gpointer eb, gpointer unused )
 {
-  GncHtmlPieChartInfo pieChartInfo;
+    GncHtmlPieChartInfo pieChartInfo;
 
-  // parse data from the text-ized params.
-  {
-    const char *datasizeStr, *dataStr, *labelsStr, *colorStr;
+    // parse data from the text-ized params.
+    {
+        const char *datasizeStr, *dataStr, *labelsStr, *colorStr;
 
-    datasizeStr = gnc_html_get_embedded_param(eb, "datasize");
-    dataStr = gnc_html_get_embedded_param(eb, "data" );
-    labelsStr = gnc_html_get_embedded_param(eb, "labels");
-    colorStr = gnc_html_get_embedded_param(eb, "colors");
-    g_return_val_if_fail( datasizeStr != NULL
-                          && dataStr != NULL
-                          && labelsStr != NULL
-                          && colorStr != NULL, FALSE );
-    pieChartInfo.datasize = atoi( datasizeStr );
-    pieChartInfo.data = read_doubles( dataStr, pieChartInfo.datasize );
-    pieChartInfo.labels = read_strings( labelsStr, pieChartInfo.datasize );
-    pieChartInfo.colors = read_strings( colorStr, pieChartInfo.datasize );
-  }
+        datasizeStr = gnc_html_get_embedded_param(eb, "datasize");
+        dataStr = gnc_html_get_embedded_param(eb, "data" );
+        labelsStr = gnc_html_get_embedded_param(eb, "labels");
+        colorStr = gnc_html_get_embedded_param(eb, "colors");
+        g_return_val_if_fail( datasizeStr != NULL
+                              && dataStr != NULL
+                              && labelsStr != NULL
+                              && colorStr != NULL, FALSE );
+        pieChartInfo.datasize = atoi( datasizeStr );
+        pieChartInfo.data = read_doubles( dataStr, pieChartInfo.datasize );
+        pieChartInfo.labels = read_strings( labelsStr, pieChartInfo.datasize );
+        pieChartInfo.colors = read_strings( colorStr, pieChartInfo.datasize );
+    }
 
-  pieChartInfo.title = (const char *)gnc_html_get_embedded_param(eb, "title"); 
-  pieChartInfo.subtitle = (const char *)gnc_html_get_embedded_param(eb, "subtitle");
-  pieChartInfo.width = ((GtkHTMLEmbedded*)eb)->width;
-  pieChartInfo.height = ((GtkHTMLEmbedded*)eb)->height;
+    pieChartInfo.title = (const char *)gnc_html_get_embedded_param(eb, "title");
+    pieChartInfo.subtitle = (const char *)gnc_html_get_embedded_param(eb, "subtitle");
+    pieChartInfo.width = ((GtkHTMLEmbedded*)eb)->width;
+    pieChartInfo.height = ((GtkHTMLEmbedded*)eb)->height;
 
-  add_pixbuf_graph_widget( eb, gnc_html_graph_gog_create_piechart( &pieChartInfo ) );
+    add_pixbuf_graph_widget( eb, gnc_html_graph_gog_create_piechart( &pieChartInfo ) );
 
-  return TRUE;
+    return TRUE;
 }
 
 /**
@@ -242,54 +248,54 @@
 static gboolean
 handle_barchart( GncHtml* html, gpointer eb, gpointer unused )
 {
-  GncHtmlBarChartInfo barChartInfo;
+    GncHtmlBarChartInfo barChartInfo;
 
-  // parse data from the text-ized params
-  // series => bars [gnc:cols]
-  // series-elements => segments [gnc:rows]
-  {
-    const char *data_rows_str, *data_cols_str, *data_str, *col_labels_str, *row_labels_str;
-    const char *col_colors_str, *rotate_row_labels_str = NULL, *stacked_str = NULL;
+    // parse data from the text-ized params
+    // series => bars [gnc:cols]
+    // series-elements => segments [gnc:rows]
+    {
+        const char *data_rows_str, *data_cols_str, *data_str, *col_labels_str, *row_labels_str;
+        const char *col_colors_str, *rotate_row_labels_str = NULL, *stacked_str = NULL;
 
-    data_rows_str         = gnc_html_get_embedded_param (eb, "data_rows");
-    data_cols_str         = gnc_html_get_embedded_param (eb, "data_cols");
-    data_str              = gnc_html_get_embedded_param (eb, "data" );
-    row_labels_str        = gnc_html_get_embedded_param (eb, "row_labels");
-    col_labels_str        = gnc_html_get_embedded_param (eb, "col_labels");
-    col_colors_str        = gnc_html_get_embedded_param (eb, "col_colors");
-    rotate_row_labels_str = gnc_html_get_embedded_param (eb, "rotate_row_labels");
-    stacked_str           = gnc_html_get_embedded_param (eb, "stacked");
+        data_rows_str         = gnc_html_get_embedded_param (eb, "data_rows");
+        data_cols_str         = gnc_html_get_embedded_param (eb, "data_cols");
+        data_str              = gnc_html_get_embedded_param (eb, "data" );
+        row_labels_str        = gnc_html_get_embedded_param (eb, "row_labels");
+        col_labels_str        = gnc_html_get_embedded_param (eb, "col_labels");
+        col_colors_str        = gnc_html_get_embedded_param (eb, "col_colors");
+        rotate_row_labels_str = gnc_html_get_embedded_param (eb, "rotate_row_labels");
+        stacked_str           = gnc_html_get_embedded_param (eb, "stacked");
 
-    barChartInfo.rotate_row_labels     = (gboolean) atoi (rotate_row_labels_str);
-    barChartInfo.stacked               = (gboolean) atoi (stacked_str);
+        barChartInfo.rotate_row_labels     = (gboolean) atoi (rotate_row_labels_str);
+        barChartInfo.stacked               = (gboolean) atoi (stacked_str);
 
 #if 0 // too strong at the moment.
-    g_return_val_if_fail (data_rows_str != NULL
-                          && data_cols_str != NULL
-                          && data_str != NULL
-                          && col_labels_str != NULL
-                          && row_labels_str != NULL
-                          && col_colors_str != NULL, FALSE );
+        g_return_val_if_fail (data_rows_str != NULL
+                              && data_cols_str != NULL
+                              && data_str != NULL
+                              && col_labels_str != NULL
+                              && row_labels_str != NULL
+                              && col_colors_str != NULL, FALSE );
 #endif // 0
-    barChartInfo.data_rows = atoi (data_rows_str);
-    barChartInfo.data_cols = atoi (data_cols_str);
-    barChartInfo.data = read_doubles (data_str, barChartInfo.data_rows*barChartInfo.data_cols);
-    barChartInfo.row_labels = read_strings (row_labels_str, barChartInfo.data_rows);
-    barChartInfo.col_labels = read_strings (col_labels_str, barChartInfo.data_cols);
-    barChartInfo.col_colors = read_strings (col_colors_str, barChartInfo.data_cols);
-  }
+        barChartInfo.data_rows = atoi (data_rows_str);
+        barChartInfo.data_cols = atoi (data_cols_str);
+        barChartInfo.data = read_doubles (data_str, barChartInfo.data_rows * barChartInfo.data_cols);
+        barChartInfo.row_labels = read_strings (row_labels_str, barChartInfo.data_rows);
+        barChartInfo.col_labels = read_strings (col_labels_str, barChartInfo.data_cols);
+        barChartInfo.col_colors = read_strings (col_colors_str, barChartInfo.data_cols);
+    }
 
-  barChartInfo.title = (const char *)gnc_html_get_embedded_param(eb, "title"); 
-  barChartInfo.subtitle = (const char *)gnc_html_get_embedded_param(eb, "subtitle");
-  barChartInfo.width = ((GtkHTMLEmbedded*)eb)->width;
-  barChartInfo.height = ((GtkHTMLEmbedded*)eb)->height;
-  barChartInfo.x_axis_label = gnc_html_get_embedded_param(eb, "x_axis_label"),
-  barChartInfo.y_axis_label = gnc_html_get_embedded_param(eb, "y_axis_label");
+    barChartInfo.title = (const char *)gnc_html_get_embedded_param(eb, "title");
+    barChartInfo.subtitle = (const char *)gnc_html_get_embedded_param(eb, "subtitle");
+    barChartInfo.width = ((GtkHTMLEmbedded*)eb)->width;
+    barChartInfo.height = ((GtkHTMLEmbedded*)eb)->height;
+    barChartInfo.x_axis_label = gnc_html_get_embedded_param(eb, "x_axis_label"),
+                 barChartInfo.y_axis_label = gnc_html_get_embedded_param(eb, "y_axis_label");
 
-  add_pixbuf_graph_widget( eb, gnc_html_graph_gog_create_barchart( &barChartInfo ) );
+    add_pixbuf_graph_widget( eb, gnc_html_graph_gog_create_barchart( &barChartInfo ) );
 
-  g_debug("barchart rendered.");
-  return TRUE;
+    g_debug("barchart rendered.");
+    return TRUE;
 }
 
 
@@ -311,124 +317,124 @@
 static gboolean
 handle_linechart( GncHtml* html, gpointer eb, gpointer unused )
 {
-  GncHtmlLineChartInfo lineChartInfo;
+    GncHtmlLineChartInfo lineChartInfo;
 
-  // parse data from the text-ized params
-  // series => lines [gnc:cols]
-  // series-elements => segments [gnc:rows]
-  {
-    const char *data_rows_str, *data_cols_str, *data_str, *col_labels_str, *row_labels_str;
-    const char *col_colors_str, *rotate_row_labels_str = NULL, *stacked_str = NULL, *markers_str = NULL;
-    const char *major_grid_str = NULL, *minor_grid_str = NULL;
+    // parse data from the text-ized params
+    // series => lines [gnc:cols]
+    // series-elements => segments [gnc:rows]
+    {
+        const char *data_rows_str, *data_cols_str, *data_str, *col_labels_str, *row_labels_str;
+        const char *col_colors_str, *rotate_row_labels_str = NULL, *stacked_str = NULL, *markers_str = NULL;
+        const char *major_grid_str = NULL, *minor_grid_str = NULL;
 
-    data_rows_str         = gnc_html_get_embedded_param (eb, "data_rows");
-    data_cols_str         = gnc_html_get_embedded_param (eb, "data_cols");
-    data_str              = gnc_html_get_embedded_param (eb, "data" );
-    row_labels_str        = gnc_html_get_embedded_param (eb, "row_labels");
-    col_labels_str        = gnc_html_get_embedded_param (eb, "col_labels");
-    col_colors_str        = gnc_html_get_embedded_param (eb, "col_colors");
-    rotate_row_labels_str = gnc_html_get_embedded_param (eb, "rotate_row_labels");
-    stacked_str           = gnc_html_get_embedded_param (eb, "stacked");
-    markers_str           = gnc_html_get_embedded_param (eb, "markers");
-    major_grid_str        = gnc_html_get_embedded_param (eb, "major_grid");
-    minor_grid_str        = gnc_html_get_embedded_param (eb, "minor_grid");
+        data_rows_str         = gnc_html_get_embedded_param (eb, "data_rows");
+        data_cols_str         = gnc_html_get_embedded_param (eb, "data_cols");
+        data_str              = gnc_html_get_embedded_param (eb, "data" );
+        row_labels_str        = gnc_html_get_embedded_param (eb, "row_labels");
+        col_labels_str        = gnc_html_get_embedded_param (eb, "col_labels");
+        col_colors_str        = gnc_html_get_embedded_param (eb, "col_colors");
+        rotate_row_labels_str = gnc_html_get_embedded_param (eb, "rotate_row_labels");
+        stacked_str           = gnc_html_get_embedded_param (eb, "stacked");
+        markers_str           = gnc_html_get_embedded_param (eb, "markers");
+        major_grid_str        = gnc_html_get_embedded_param (eb, "major_grid");
+        minor_grid_str        = gnc_html_get_embedded_param (eb, "minor_grid");
 
-    lineChartInfo.rotate_row_labels     = (gboolean) atoi (rotate_row_labels_str);
-    lineChartInfo.stacked               = (gboolean) atoi (stacked_str);
-    lineChartInfo.markers               = (gboolean) atoi (markers_str);
-    lineChartInfo.major_grid            = (gboolean) atoi (major_grid_str);
-    lineChartInfo.minor_grid            = (gboolean) atoi (minor_grid_str);
+        lineChartInfo.rotate_row_labels     = (gboolean) atoi (rotate_row_labels_str);
+        lineChartInfo.stacked               = (gboolean) atoi (stacked_str);
+        lineChartInfo.markers               = (gboolean) atoi (markers_str);
+        lineChartInfo.major_grid            = (gboolean) atoi (major_grid_str);
+        lineChartInfo.minor_grid            = (gboolean) atoi (minor_grid_str);
 
-    lineChartInfo.data_rows = atoi (data_rows_str);
-    lineChartInfo.data_cols = atoi (data_cols_str);
-    lineChartInfo.data = read_doubles (data_str, lineChartInfo.data_rows*lineChartInfo.data_cols);
-    lineChartInfo.row_labels = read_strings (row_labels_str, lineChartInfo.data_rows);
-    lineChartInfo.col_labels = read_strings (col_labels_str, lineChartInfo.data_cols);
-    lineChartInfo.col_colors = read_strings (col_colors_str, lineChartInfo.data_cols);
-  }
+        lineChartInfo.data_rows = atoi (data_rows_str);
+        lineChartInfo.data_cols = atoi (data_cols_str);
+        lineChartInfo.data = read_doubles (data_str, lineChartInfo.data_rows * lineChartInfo.data_cols);
+        lineChartInfo.row_labels = read_strings (row_labels_str, lineChartInfo.data_rows);
+        lineChartInfo.col_labels = read_strings (col_labels_str, lineChartInfo.data_cols);
+        lineChartInfo.col_colors = read_strings (col_colors_str, lineChartInfo.data_cols);
+    }
 
-  lineChartInfo.title = (const char *)gnc_html_get_embedded_param(eb, "title"); 
-  lineChartInfo.subtitle = (const char *)gnc_html_get_embedded_param(eb, "subtitle");
-  lineChartInfo.width = ((GtkHTMLEmbedded*)eb)->width;
-  lineChartInfo.height = ((GtkHTMLEmbedded*)eb)->height;
-  lineChartInfo.x_axis_label = gnc_html_get_embedded_param(eb, "x_axis_label"),
-  lineChartInfo.y_axis_label = gnc_html_get_embedded_param(eb, "y_axis_label");
+    lineChartInfo.title = (const char *)gnc_html_get_embedded_param(eb, "title");
+    lineChartInfo.subtitle = (const char *)gnc_html_get_embedded_param(eb, "subtitle");
+    lineChartInfo.width = ((GtkHTMLEmbedded*)eb)->width;
+    lineChartInfo.height = ((GtkHTMLEmbedded*)eb)->height;
+    lineChartInfo.x_axis_label = gnc_html_get_embedded_param(eb, "x_axis_label"),
+                  lineChartInfo.y_axis_label = gnc_html_get_embedded_param(eb, "y_axis_label");
 
-  add_pixbuf_graph_widget( eb, gnc_html_graph_gog_create_linechart( &lineChartInfo ) );
+    add_pixbuf_graph_widget( eb, gnc_html_graph_gog_create_linechart( &lineChartInfo ) );
 
-  g_debug("linechart rendered.");
-  return TRUE;
+    g_debug("linechart rendered.");
+    return TRUE;
 }
 
 
 static gboolean
 handle_scatter( GncHtml* html, gpointer eb, gpointer unused )
 {
-  GncHtmlScatterPlotInfo scatterPlotInfo;
+    GncHtmlScatterPlotInfo scatterPlotInfo;
 
-  {
-    const char *datasizeStr, *xDataStr, *yDataStr;
+    {
+        const char *datasizeStr, *xDataStr, *yDataStr;
 
-    datasizeStr = gnc_html_get_embedded_param( eb, "datasize" );
-    scatterPlotInfo.datasize = atoi( datasizeStr );
+        datasizeStr = gnc_html_get_embedded_param( eb, "datasize" );
+        scatterPlotInfo.datasize = atoi( datasizeStr );
 
-    xDataStr = gnc_html_get_embedded_param( eb, "x_data" );
-    scatterPlotInfo.xData = read_doubles( xDataStr, scatterPlotInfo.datasize );
+        xDataStr = gnc_html_get_embedded_param( eb, "x_data" );
+        scatterPlotInfo.xData = read_doubles( xDataStr, scatterPlotInfo.datasize );
 
-    yDataStr = gnc_html_get_embedded_param( eb, "y_data" );
-    scatterPlotInfo.yData = read_doubles( yDataStr, scatterPlotInfo.datasize );
+        yDataStr = gnc_html_get_embedded_param( eb, "y_data" );
+        scatterPlotInfo.yData = read_doubles( yDataStr, scatterPlotInfo.datasize );
 
-    scatterPlotInfo.marker_str = gnc_html_get_embedded_param(eb, "marker");
-    scatterPlotInfo.color_str = gnc_html_get_embedded_param(eb, "color");
-  }
+        scatterPlotInfo.marker_str = gnc_html_get_embedded_param(eb, "marker");
+        scatterPlotInfo.color_str = gnc_html_get_embedded_param(eb, "color");
+    }
 
-  scatterPlotInfo.title = (const char *)gnc_html_get_embedded_param(eb, "title"); 
-  scatterPlotInfo.subtitle = (const char *)gnc_html_get_embedded_param(eb, "subtitle");
-  scatterPlotInfo.width = ((GtkHTMLEmbedded*)eb)->width;
-  scatterPlotInfo.height = ((GtkHTMLEmbedded*)eb)->height;
-  scatterPlotInfo.x_axis_label = gnc_html_get_embedded_param(eb, "x_axis_label"),
-  scatterPlotInfo.y_axis_label = gnc_html_get_embedded_param(eb, "y_axis_label");
+    scatterPlotInfo.title = (const char *)gnc_html_get_embedded_param(eb, "title");
+    scatterPlotInfo.subtitle = (const char *)gnc_html_get_embedded_param(eb, "subtitle");
+    scatterPlotInfo.width = ((GtkHTMLEmbedded*)eb)->width;
+    scatterPlotInfo.height = ((GtkHTMLEmbedded*)eb)->height;
+    scatterPlotInfo.x_axis_label = gnc_html_get_embedded_param(eb, "x_axis_label"),
+                    scatterPlotInfo.y_axis_label = gnc_html_get_embedded_param(eb, "y_axis_label");
 
-  add_pixbuf_graph_widget( eb, gnc_html_graph_gog_create_scatterplot( &scatterPlotInfo ) );
+    add_pixbuf_graph_widget( eb, gnc_html_graph_gog_create_scatterplot( &scatterPlotInfo ) );
 
-  return TRUE;
+    return TRUE;
 }
 
 #ifdef GTKHTML_USES_GTKPRINT
 static void
 draw_print_cb(GtkHTMLEmbedded *eb, cairo_t *cr, gpointer unused)
 {
-  GogGraph *graph = GOG_GRAPH(g_object_get_data(G_OBJECT(eb), "graph"));
+    GogGraph *graph = GOG_GRAPH(g_object_get_data(G_OBJECT(eb), "graph"));
 #    ifdef HAVE_GOFFICE_0_5
-  GogRenderer *rend = g_object_new(GOG_TYPE_RENDERER, "model", graph, NULL);
+    GogRenderer *rend = g_object_new(GOG_TYPE_RENDERER, "model", graph, NULL);
 #    else
-  GogRendererCairo *rend = g_object_new(GOG_RENDERER_CAIRO_TYPE, "model", graph,
-                                        "cairo", cr, "is-vector", TRUE, NULL);
+    GogRendererCairo *rend = g_object_new(GOG_RENDERER_CAIRO_TYPE, "model", graph,
+                                          "cairo", cr, "is-vector", TRUE, NULL);
 #    endif
 
-  /* assuming pixel size is 0.5, cf. gtkhtml/src/htmlprinter.c */
-  cairo_scale(cr, 0.5, 0.5);
+    /* assuming pixel size is 0.5, cf. gtkhtml/src/htmlprinter.c */
+    cairo_scale(cr, 0.5, 0.5);
 
-  cairo_translate(cr, 0, -eb->height);
+    cairo_translate(cr, 0, -eb->height);
 
 #    ifdef HAVE_GOFFICE_0_5
-  gog_renderer_render_to_cairo(rend, cr, eb->width, eb->height);
+    gog_renderer_render_to_cairo(rend, cr, eb->width, eb->height);
 #    else
-  gog_renderer_cairo_update(rend, eb->width, eb->height, 1.0);
+    gog_renderer_cairo_update(rend, eb->width, eb->height, 1.0);
 #    endif
-  g_object_unref(rend);
+    g_object_unref(rend);
 }
 
 #else /* !GTKHTML_USES_GTKPRINT */
 static void
 draw_print_cb(GtkHTMLEmbedded *eb, GnomePrintContext *context, gpointer unused)
 {
-  GogGraph *graph = GOG_GRAPH (g_object_get_data (G_OBJECT (eb), "graph"));
+    GogGraph *graph = GOG_GRAPH (g_object_get_data (G_OBJECT (eb), "graph"));
 
-  /* assuming pixel size is 0.5, cf. gtkhtml/src/htmlprinter.c */
-  gnome_print_scale (context, 0.5, 0.5);
+    /* assuming pixel size is 0.5, cf. gtkhtml/src/htmlprinter.c */
+    gnome_print_scale (context, 0.5, 0.5);
 
-  gnome_print_translate (context, 0, eb->height);
-  gog_graph_print_to_gnome_print (graph, context, eb->width, eb->height);
+    gnome_print_translate (context, 0, eb->height);
+    gog_graph_print_to_gnome_print (graph, context, eb->width, eb->height);
 }
 #endif /* GTKHTML_USES_GTKPRINT */

Modified: gnucash/trunk/src/html/gnc-html-graph-gog-webkit.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-graph-gog-webkit.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-graph-gog-webkit.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -60,151 +60,161 @@
 void
 gnc_html_graph_gog_webkit_init( void )
 {
-	gnc_html_graph_gog_init();
+    gnc_html_graph_gog_init();
 
-	gnc_html_register_object_handler( GNC_CHART_PIE, handle_piechart );
-	gnc_html_register_object_handler( GNC_CHART_BAR, handle_barchart );
-	gnc_html_register_object_handler( GNC_CHART_SCATTER, handle_scatter );
-	gnc_html_register_object_handler( GNC_CHART_LINE, handle_linechart );
+    gnc_html_register_object_handler( GNC_CHART_PIE, handle_piechart );
+    gnc_html_register_object_handler( GNC_CHART_BAR, handle_barchart );
+    gnc_html_register_object_handler( GNC_CHART_SCATTER, handle_scatter );
+    gnc_html_register_object_handler( GNC_CHART_LINE, handle_linechart );
 }
 
-static double * 
+static double *
 read_doubles(const char * string, int nvalues)
 {
-  int    n;
-  gchar *next;
-  double * retval = g_new0(double, nvalues);
+    int    n;
+    gchar *next;
+    double * retval = g_new0(double, nvalues);
 
-  // guile is going to (puts ...) the elements of the double array
-  // together. In non-POSIX locales, that will be in a format that
-  // the locale-specific sscanf will not be able to parse.
-  gnc_push_locale("C");
-  {
-    for (n=0; n<nvalues; n++) {
-      retval[n] = strtod(string, &next);
-      string = next;
-     }
-  }
-  gnc_pop_locale();
+    // guile is going to (puts ...) the elements of the double array
+    // together. In non-POSIX locales, that will be in a format that
+    // the locale-specific sscanf will not be able to parse.
+    gnc_push_locale("C");
+    {
+        for (n = 0; n < nvalues; n++)
+        {
+            retval[n] = strtod(string, &next);
+            string = next;
+        }
+    }
+    gnc_pop_locale();
 
-  return retval;
+    return retval;
 }
 
-static char ** 
+static char **
 read_strings(const char * string, int nvalues)
 {
-  int n;
-  int choffset=0;
-  int accum = 0;
-  char ** retval = g_new0(char *, nvalues);
-  char thischar;
-  const char * inptr = string;
-  int escaped = FALSE;
+    int n;
+    int choffset = 0;
+    int accum = 0;
+    char ** retval = g_new0(char *, nvalues);
+    char thischar;
+    const char * inptr = string;
+    int escaped = FALSE;
 
-  for (n=0; n < nvalues; n++) {
-    retval[n] = g_new0(char, strlen(string+accum)+1);
-    retval[n][0] = 0;
-    choffset = 0;
-    while ((thischar = *inptr) != 0) {
-      if (thischar == '\\') {
-        escaped = TRUE;
-        inptr++;
-      }
-      else if ((thischar != ' ') || escaped) {
-        retval[n][choffset] = thischar;
-        retval[n][choffset+1] = 0;    
-        choffset++;
-        escaped = FALSE;
-        inptr++;
-      }
-      else {
-        /* an unescaped space */
-        escaped = FALSE;
-        inptr++;
-        break;
-      }
+    for (n = 0; n < nvalues; n++)
+    {
+        retval[n] = g_new0(char, strlen(string + accum) + 1);
+        retval[n][0] = 0;
+        choffset = 0;
+        while ((thischar = *inptr) != 0)
+        {
+            if (thischar == '\\')
+            {
+                escaped = TRUE;
+                inptr++;
+            }
+            else if ((thischar != ' ') || escaped)
+            {
+                retval[n][choffset] = thischar;
+                retval[n][choffset+1] = 0;
+                choffset++;
+                escaped = FALSE;
+                inptr++;
+            }
+            else
+            {
+                /* an unescaped space */
+                escaped = FALSE;
+                inptr++;
+                break;
+            }
+        }
+        accum += choffset;
+        /* printf("retval[%d] = '%s'\n", n, retval[n]); */
     }
-    accum += choffset;
-    /* printf("retval[%d] = '%s'\n", n, retval[n]); */
-  }
-  
-  return retval;  
+
+    return retval;
 }
 
 static int
 get_int_value( gchar** str, const gchar* name )
 {
-	gchar* p;
-	gchar* tag_name;
-	int val = -1;
+    gchar* p;
+    gchar* tag_name;
+    int val = -1;
 
-	tag_name = g_strdup_printf( "%s=", name );
-	p = g_strstr_len( *str, -1, tag_name );
-	if( p != NULL ) {
-		val = atoi( p+strlen( tag_name ) );
-		*str = p+strlen( tag_name );
-	}
-	g_free( tag_name );
+    tag_name = g_strdup_printf( "%s=", name );
+    p = g_strstr_len( *str, -1, tag_name );
+    if ( p != NULL )
+    {
+        val = atoi( p + strlen( tag_name ) );
+        *str = p + strlen( tag_name );
+    }
+    g_free( tag_name );
 
-	return val;
+    return val;
 }
 
 static int
 get_int_param( gchar** str, const gchar* name )
 {
-	gchar* p;
-	gchar* tag_string;
-	int val = -1;
+    gchar* p;
+    gchar* tag_string;
+    int val = -1;
 
-	tag_string = g_strdup_printf( "<param name=\"%s\" value=\"", name );
-	p = g_strstr_len( *str, -1, tag_string );
-	if( p != NULL ) {
-		val = atoi( p+strlen( tag_string ) );
-		*str = p+strlen( tag_string );
-	}
-	g_free( tag_string );
+    tag_string = g_strdup_printf( "<param name=\"%s\" value=\"", name );
+    p = g_strstr_len( *str, -1, tag_string );
+    if ( p != NULL )
+    {
+        val = atoi( p + strlen( tag_string ) );
+        *str = p + strlen( tag_string );
+    }
+    g_free( tag_string );
 
-	return val;
+    return val;
 }
 
 static gchar*
 get_string_param( gchar** str, const gchar* name )
 {
-	gchar* p;
-	gchar* p_end;
-	gchar* tag_string;
-	gchar* val = NULL;
+    gchar* p;
+    gchar* p_end;
+    gchar* tag_string;
+    gchar* val = NULL;
 
-	tag_string = g_strdup_printf( "<param name=\"%s\" value=\"", name );
-	p = g_strstr_len( *str, -1, tag_string );
-	if( p != NULL ) {
-		p += strlen( tag_string );
-		p_end = g_strstr_len( p, -1, "\">\n" );
-		val = g_strndup( p, (p_end-p) );
-		*str = p_end+strlen( "\">\n" );
-	}
-	g_free( tag_string );
+    tag_string = g_strdup_printf( "<param name=\"%s\" value=\"", name );
+    p = g_strstr_len( *str, -1, tag_string );
+    if ( p != NULL )
+    {
+        p += strlen( tag_string );
+        p_end = g_strstr_len( p, -1, "\">\n" );
+        val = g_strndup( p, (p_end - p) );
+        *str = p_end + strlen( "\">\n" );
+    }
+    g_free( tag_string );
 
-	return val;
+    return val;
 }
 
 static gchar*
 convert_pixbuf_to_base64_string( GdkPixbuf* pixbuf )
 {
-	gchar* pixel_buffer;
-	gsize pixel_buffer_size;
-	GError* error = NULL;
-	gchar* base64_buf;
+    gchar* pixel_buffer;
+    gsize pixel_buffer_size;
+    GError* error = NULL;
+    gchar* base64_buf;
 
-    if( !gdk_pixbuf_save_to_buffer( pixbuf, &pixel_buffer, &pixel_buffer_size, "png",
-									&error, NULL ) ) {
-		PERR( "Unable to save pixbuf to buffer: %s\n", error->message );
-		return NULL;
-	}
+    if ( !gdk_pixbuf_save_to_buffer( pixbuf, &pixel_buffer, &pixel_buffer_size, "png",
+                                     &error, NULL ) )
+    {
+        PERR( "Unable to save pixbuf to buffer: %s\n", error->message );
+        return NULL;
+    }
 
-	base64_buf = g_base64_encode( (guchar *)pixel_buffer, pixel_buffer_size );
-	g_free( pixel_buffer );
-	return base64_buf;
+    base64_buf = g_base64_encode( (guchar *)pixel_buffer, pixel_buffer_size );
+    g_free( pixel_buffer );
+    return base64_buf;
 }
 
 /*
@@ -221,49 +231,53 @@
 static gboolean
 handle_piechart( GncHtml* html, gpointer eb, gpointer d )
 {
-	gchar* object_info = (gchar*)eb;
-	gchar** pResult = (gchar**)d;
-	GncHtmlPieChartInfo pieChartInfo;
-	GdkPixbuf* pixbuf;
-	gchar* p;
-	gchar* p_end;
-	gchar* temp_str;
-	gchar* base64_buf;
+    gchar* object_info = (gchar*)eb;
+    gchar** pResult = (gchar**)d;
+    GncHtmlPieChartInfo pieChartInfo;
+    GdkPixbuf* pixbuf;
+    gchar* p;
+    gchar* p_end;
+    gchar* temp_str;
+    gchar* base64_buf;
 
-	pieChartInfo.width = get_int_value( &object_info, "width" );
-	pieChartInfo.height = get_int_value( &object_info, "height" );
-	pieChartInfo.title = get_string_param( &object_info, "title" );
-	pieChartInfo.subtitle = get_string_param( &object_info, "subtitle" );
-	pieChartInfo.datasize = get_int_param( &object_info, "datasize" );
-	temp_str = get_string_param( &object_info, "data" );
-	if( temp_str != NULL ) {
-		pieChartInfo.data = read_doubles( temp_str, pieChartInfo.datasize );
-	}
-	temp_str = get_string_param( &object_info, "colors" );
-	if( temp_str != NULL ) {
-		pieChartInfo.colors = read_strings( temp_str, pieChartInfo.datasize );
-		g_free( temp_str );
-	}
-	temp_str = get_string_param( &object_info, "labels" );
-	if( temp_str != NULL ) {
-		pieChartInfo.labels = read_strings( temp_str, pieChartInfo.datasize );
-		g_free( temp_str );
-	}
+    pieChartInfo.width = get_int_value( &object_info, "width" );
+    pieChartInfo.height = get_int_value( &object_info, "height" );
+    pieChartInfo.title = get_string_param( &object_info, "title" );
+    pieChartInfo.subtitle = get_string_param( &object_info, "subtitle" );
+    pieChartInfo.datasize = get_int_param( &object_info, "datasize" );
+    temp_str = get_string_param( &object_info, "data" );
+    if ( temp_str != NULL )
+    {
+        pieChartInfo.data = read_doubles( temp_str, pieChartInfo.datasize );
+    }
+    temp_str = get_string_param( &object_info, "colors" );
+    if ( temp_str != NULL )
+    {
+        pieChartInfo.colors = read_strings( temp_str, pieChartInfo.datasize );
+        g_free( temp_str );
+    }
+    temp_str = get_string_param( &object_info, "labels" );
+    if ( temp_str != NULL )
+    {
+        pieChartInfo.labels = read_strings( temp_str, pieChartInfo.datasize );
+        g_free( temp_str );
+    }
 
-	pixbuf = gnc_html_graph_gog_create_piechart( &pieChartInfo );
-	if( pieChartInfo.title != NULL ) g_free( (gchar*)pieChartInfo.title );
-	if( pieChartInfo.subtitle != NULL ) g_free( (gchar*)pieChartInfo.subtitle );
+    pixbuf = gnc_html_graph_gog_create_piechart( &pieChartInfo );
+    if ( pieChartInfo.title != NULL ) g_free( (gchar*)pieChartInfo.title );
+    if ( pieChartInfo.subtitle != NULL ) g_free( (gchar*)pieChartInfo.subtitle );
 
-	base64_buf = convert_pixbuf_to_base64_string( pixbuf );
-	if( base64_buf == NULL ) {
-		return FALSE;
-	}
+    base64_buf = convert_pixbuf_to_base64_string( pixbuf );
+    if ( base64_buf == NULL )
+    {
+        return FALSE;
+    }
 
-	*pResult = g_strdup_printf( "<img src=\"data:image/png;base64,%s \" alt=\"Cannot display piechart\"/>", base64_buf );
-	g_free( base64_buf );
+    *pResult = g_strdup_printf( "<img src=\"data:image/png;base64,%s \" alt=\"Cannot display piechart\"/>", base64_buf );
+    g_free( base64_buf );
 
-	g_debug("piechart rendered.");
-	return TRUE;
+    g_debug("piechart rendered.");
+    return TRUE;
 }
 
 /**
@@ -281,60 +295,65 @@
 static gboolean
 handle_barchart( GncHtml* html, gpointer eb, gpointer d )
 {
-	gchar* object_info = (gchar*)eb;
-	gchar** pResult = (gchar**)d;
-	GncHtmlBarChartInfo barChartInfo;
-	GdkPixbuf* pixbuf;
-	gchar* p;
-	gchar* p_end;
-	gchar* temp_str;
-	gchar* base64_buf;
+    gchar* object_info = (gchar*)eb;
+    gchar** pResult = (gchar**)d;
+    GncHtmlBarChartInfo barChartInfo;
+    GdkPixbuf* pixbuf;
+    gchar* p;
+    gchar* p_end;
+    gchar* temp_str;
+    gchar* base64_buf;
 
-	barChartInfo.width = get_int_value( &object_info, "width" );
-	barChartInfo.height = get_int_value( &object_info, "height" );
-	barChartInfo.title = get_string_param( &object_info, "title" );
-	barChartInfo.subtitle = get_string_param( &object_info, "subtitle" );
-	barChartInfo.data_rows = get_int_param( &object_info, "data_rows" );
-	barChartInfo.data_cols = get_int_param( &object_info, "data_cols" );
-	temp_str = get_string_param( &object_info, "data" );
-	if( temp_str != NULL ) {
-		barChartInfo.data = read_doubles( temp_str, barChartInfo.data_rows*barChartInfo.data_cols );
-	}
-	barChartInfo.x_axis_label = get_string_param( &object_info, "x_axis_label" );
-	barChartInfo.y_axis_label = get_string_param( &object_info, "y_axis_label" );
-	temp_str = get_string_param( &object_info, "col_colors" );
-	if( temp_str != NULL ) {
-		barChartInfo.col_colors = read_strings( temp_str, barChartInfo.data_cols );
-		g_free( temp_str );
-	}
-	temp_str = get_string_param( &object_info, "row_labels" );
-	if( temp_str != NULL ) {
-		barChartInfo.row_labels = read_strings( temp_str, barChartInfo.data_rows );
-		g_free( temp_str );
-	}
-	temp_str = get_string_param( &object_info, "col_labels" );
-	if( temp_str != NULL ) {
-		barChartInfo.col_labels = read_strings( temp_str, barChartInfo.data_cols );
-		g_free( temp_str );
-	}
-	barChartInfo.rotate_row_labels = get_int_param( &object_info, "rotate_row_labels" );
-	barChartInfo.stacked = get_int_param( &object_info, "stacked" );
+    barChartInfo.width = get_int_value( &object_info, "width" );
+    barChartInfo.height = get_int_value( &object_info, "height" );
+    barChartInfo.title = get_string_param( &object_info, "title" );
+    barChartInfo.subtitle = get_string_param( &object_info, "subtitle" );
+    barChartInfo.data_rows = get_int_param( &object_info, "data_rows" );
+    barChartInfo.data_cols = get_int_param( &object_info, "data_cols" );
+    temp_str = get_string_param( &object_info, "data" );
+    if ( temp_str != NULL )
+    {
+        barChartInfo.data = read_doubles( temp_str, barChartInfo.data_rows * barChartInfo.data_cols );
+    }
+    barChartInfo.x_axis_label = get_string_param( &object_info, "x_axis_label" );
+    barChartInfo.y_axis_label = get_string_param( &object_info, "y_axis_label" );
+    temp_str = get_string_param( &object_info, "col_colors" );
+    if ( temp_str != NULL )
+    {
+        barChartInfo.col_colors = read_strings( temp_str, barChartInfo.data_cols );
+        g_free( temp_str );
+    }
+    temp_str = get_string_param( &object_info, "row_labels" );
+    if ( temp_str != NULL )
+    {
+        barChartInfo.row_labels = read_strings( temp_str, barChartInfo.data_rows );
+        g_free( temp_str );
+    }
+    temp_str = get_string_param( &object_info, "col_labels" );
+    if ( temp_str != NULL )
+    {
+        barChartInfo.col_labels = read_strings( temp_str, barChartInfo.data_cols );
+        g_free( temp_str );
+    }
+    barChartInfo.rotate_row_labels = get_int_param( &object_info, "rotate_row_labels" );
+    barChartInfo.stacked = get_int_param( &object_info, "stacked" );
 
-	pixbuf = gnc_html_graph_gog_create_barchart( &barChartInfo );
-	if( barChartInfo.title != NULL ) g_free( (gchar*)barChartInfo.title );
-	if( barChartInfo.subtitle != NULL ) g_free( (gchar*)barChartInfo.subtitle );
-	if( barChartInfo.x_axis_label != NULL ) g_free( (gchar*)barChartInfo.x_axis_label );
-	if( barChartInfo.y_axis_label != NULL ) g_free( (gchar*)barChartInfo.y_axis_label );
+    pixbuf = gnc_html_graph_gog_create_barchart( &barChartInfo );
+    if ( barChartInfo.title != NULL ) g_free( (gchar*)barChartInfo.title );
+    if ( barChartInfo.subtitle != NULL ) g_free( (gchar*)barChartInfo.subtitle );
+    if ( barChartInfo.x_axis_label != NULL ) g_free( (gchar*)barChartInfo.x_axis_label );
+    if ( barChartInfo.y_axis_label != NULL ) g_free( (gchar*)barChartInfo.y_axis_label );
 
-	base64_buf = convert_pixbuf_to_base64_string( pixbuf );
-	if( base64_buf == NULL ) {
-		return FALSE;
-	}
+    base64_buf = convert_pixbuf_to_base64_string( pixbuf );
+    if ( base64_buf == NULL )
+    {
+        return FALSE;
+    }
 
-	*pResult = g_strdup_printf( "<img src=\"data:image/png;base64,%s \" alt=\"Cannot display barchart\"/>", base64_buf );
+    *pResult = g_strdup_printf( "<img src=\"data:image/png;base64,%s \" alt=\"Cannot display barchart\"/>", base64_buf );
 
-	g_debug("barchart rendered.");
-	return TRUE;
+    g_debug("barchart rendered.");
+    return TRUE;
 }
 
 
@@ -356,107 +375,115 @@
 static gboolean
 handle_linechart( GncHtml* html, gpointer eb, gpointer d )
 {
-	gchar* object_info = (gchar*)eb;
-	gchar** pResult = (gchar**)d;
-	GncHtmlLineChartInfo lineChartInfo;
-	GdkPixbuf* pixbuf;
-	gchar* p;
-	gchar* p_end;
-	gchar* temp_str;
-	gchar* base64_buf;
+    gchar* object_info = (gchar*)eb;
+    gchar** pResult = (gchar**)d;
+    GncHtmlLineChartInfo lineChartInfo;
+    GdkPixbuf* pixbuf;
+    gchar* p;
+    gchar* p_end;
+    gchar* temp_str;
+    gchar* base64_buf;
 
-	lineChartInfo.width = get_int_value( &object_info, "width" );
-	lineChartInfo.height = get_int_value( &object_info, "height" );
-	lineChartInfo.title = get_string_param( &object_info, "title" );
-	lineChartInfo.subtitle = get_string_param( &object_info, "subtitle" );
-	lineChartInfo.data_rows = get_int_param( &object_info, "data_rows" );
-	lineChartInfo.data_cols = get_int_param( &object_info, "data_cols" );
-	temp_str = get_string_param( &object_info, "data" );
-	if( temp_str != NULL ) {
-		lineChartInfo.data = read_doubles( temp_str, lineChartInfo.data_rows*lineChartInfo.data_cols );
-	}
-	lineChartInfo.x_axis_label = get_string_param( &object_info, "x_axis_label" );
-	lineChartInfo.y_axis_label = get_string_param( &object_info, "y_axis_label" );
-	temp_str = get_string_param( &object_info, "col_colors" );
-	if( temp_str != NULL ) {
-		lineChartInfo.col_colors = read_strings( temp_str, lineChartInfo.data_cols );
-		g_free( temp_str );
-	}
-	temp_str = get_string_param( &object_info, "row_labels" );
-	if( temp_str != NULL ) {
-		lineChartInfo.row_labels = read_strings( temp_str, lineChartInfo.data_rows );
-		g_free( temp_str );
-	}
-	temp_str = get_string_param( &object_info, "col_labels" );
-	if( temp_str != NULL ) {
-		lineChartInfo.col_labels = read_strings( temp_str, lineChartInfo.data_cols );
-		g_free( temp_str );
-	}
-	lineChartInfo.rotate_row_labels = get_int_param( &object_info, "rotate_row_labels" );
-	lineChartInfo.stacked = get_int_param( &object_info, "stacked" );
-	lineChartInfo.markers = get_int_param( &object_info, "markers" );
-	lineChartInfo.major_grid = get_int_param( &object_info, "major_grid" );
-	lineChartInfo.minor_grid = get_int_param( &object_info, "minor_grid" );
+    lineChartInfo.width = get_int_value( &object_info, "width" );
+    lineChartInfo.height = get_int_value( &object_info, "height" );
+    lineChartInfo.title = get_string_param( &object_info, "title" );
+    lineChartInfo.subtitle = get_string_param( &object_info, "subtitle" );
+    lineChartInfo.data_rows = get_int_param( &object_info, "data_rows" );
+    lineChartInfo.data_cols = get_int_param( &object_info, "data_cols" );
+    temp_str = get_string_param( &object_info, "data" );
+    if ( temp_str != NULL )
+    {
+        lineChartInfo.data = read_doubles( temp_str, lineChartInfo.data_rows * lineChartInfo.data_cols );
+    }
+    lineChartInfo.x_axis_label = get_string_param( &object_info, "x_axis_label" );
+    lineChartInfo.y_axis_label = get_string_param( &object_info, "y_axis_label" );
+    temp_str = get_string_param( &object_info, "col_colors" );
+    if ( temp_str != NULL )
+    {
+        lineChartInfo.col_colors = read_strings( temp_str, lineChartInfo.data_cols );
+        g_free( temp_str );
+    }
+    temp_str = get_string_param( &object_info, "row_labels" );
+    if ( temp_str != NULL )
+    {
+        lineChartInfo.row_labels = read_strings( temp_str, lineChartInfo.data_rows );
+        g_free( temp_str );
+    }
+    temp_str = get_string_param( &object_info, "col_labels" );
+    if ( temp_str != NULL )
+    {
+        lineChartInfo.col_labels = read_strings( temp_str, lineChartInfo.data_cols );
+        g_free( temp_str );
+    }
+    lineChartInfo.rotate_row_labels = get_int_param( &object_info, "rotate_row_labels" );
+    lineChartInfo.stacked = get_int_param( &object_info, "stacked" );
+    lineChartInfo.markers = get_int_param( &object_info, "markers" );
+    lineChartInfo.major_grid = get_int_param( &object_info, "major_grid" );
+    lineChartInfo.minor_grid = get_int_param( &object_info, "minor_grid" );
 
-	pixbuf = gnc_html_graph_gog_create_linechart( &lineChartInfo );
-	if( lineChartInfo.title != NULL ) g_free( (gchar*)lineChartInfo.title );
-	if( lineChartInfo.subtitle != NULL ) g_free( (gchar*)lineChartInfo.subtitle );
-	if( lineChartInfo.x_axis_label != NULL ) g_free( (gchar*)lineChartInfo.x_axis_label );
-	if( lineChartInfo.y_axis_label != NULL ) g_free( (gchar*)lineChartInfo.y_axis_label );
+    pixbuf = gnc_html_graph_gog_create_linechart( &lineChartInfo );
+    if ( lineChartInfo.title != NULL ) g_free( (gchar*)lineChartInfo.title );
+    if ( lineChartInfo.subtitle != NULL ) g_free( (gchar*)lineChartInfo.subtitle );
+    if ( lineChartInfo.x_axis_label != NULL ) g_free( (gchar*)lineChartInfo.x_axis_label );
+    if ( lineChartInfo.y_axis_label != NULL ) g_free( (gchar*)lineChartInfo.y_axis_label );
 
-	base64_buf = convert_pixbuf_to_base64_string( pixbuf );
-	if( base64_buf == NULL ) {
-		return FALSE;
-	}
+    base64_buf = convert_pixbuf_to_base64_string( pixbuf );
+    if ( base64_buf == NULL )
+    {
+        return FALSE;
+    }
 
-	*pResult = g_strdup_printf( "<img src=\"data:image/png;base64,%s \" alt=\"Cannot display linechart\"/>", base64_buf );
+    *pResult = g_strdup_printf( "<img src=\"data:image/png;base64,%s \" alt=\"Cannot display linechart\"/>", base64_buf );
 
-	g_debug("linechart rendered.");
-	return TRUE;
+    g_debug("linechart rendered.");
+    return TRUE;
 }
 
 
 static gboolean
 handle_scatter( GncHtml* html, gpointer eb, gpointer d )
 {
-	gchar* object_info = (gchar*)eb;
-	gchar** pResult = (gchar**)d;
-	GncHtmlScatterPlotInfo scatterPlotInfo;
-	GdkPixbuf* pixbuf;
-	gchar* p;
-	gchar* p_end;
-	gchar* temp_str;
-	gchar* base64_buf;
+    gchar* object_info = (gchar*)eb;
+    gchar** pResult = (gchar**)d;
+    GncHtmlScatterPlotInfo scatterPlotInfo;
+    GdkPixbuf* pixbuf;
+    gchar* p;
+    gchar* p_end;
+    gchar* temp_str;
+    gchar* base64_buf;
 
-	scatterPlotInfo.width = get_int_value( &object_info, "width" );
-	scatterPlotInfo.height = get_int_value( &object_info, "height" );
-	scatterPlotInfo.title = get_string_param( &object_info, "title" );
-	scatterPlotInfo.subtitle = get_string_param( &object_info, "subtitle" );
-	scatterPlotInfo.x_axis_label = get_string_param( &object_info, "x_axis_label" );
-	scatterPlotInfo.y_axis_label = get_string_param( &object_info, "y_axis_label" );
-	scatterPlotInfo.marker_str = get_string_param( &object_info, "marker" );
-	scatterPlotInfo.color_str = get_string_param( &object_info, "color" );
-	scatterPlotInfo.datasize = get_int_param( &object_info, "datasize" );
-	temp_str = get_string_param( &object_info, "x_data" );
-	if( temp_str != NULL ) {
-		scatterPlotInfo.xData = read_doubles( temp_str, scatterPlotInfo.datasize );
-	}
-	temp_str = get_string_param( &object_info, "y_data" );
-	if( temp_str != NULL ) {
-		scatterPlotInfo.yData = read_doubles( temp_str, scatterPlotInfo.datasize );
-	}
+    scatterPlotInfo.width = get_int_value( &object_info, "width" );
+    scatterPlotInfo.height = get_int_value( &object_info, "height" );
+    scatterPlotInfo.title = get_string_param( &object_info, "title" );
+    scatterPlotInfo.subtitle = get_string_param( &object_info, "subtitle" );
+    scatterPlotInfo.x_axis_label = get_string_param( &object_info, "x_axis_label" );
+    scatterPlotInfo.y_axis_label = get_string_param( &object_info, "y_axis_label" );
+    scatterPlotInfo.marker_str = get_string_param( &object_info, "marker" );
+    scatterPlotInfo.color_str = get_string_param( &object_info, "color" );
+    scatterPlotInfo.datasize = get_int_param( &object_info, "datasize" );
+    temp_str = get_string_param( &object_info, "x_data" );
+    if ( temp_str != NULL )
+    {
+        scatterPlotInfo.xData = read_doubles( temp_str, scatterPlotInfo.datasize );
+    }
+    temp_str = get_string_param( &object_info, "y_data" );
+    if ( temp_str != NULL )
+    {
+        scatterPlotInfo.yData = read_doubles( temp_str, scatterPlotInfo.datasize );
+    }
 
-	pixbuf = gnc_html_graph_gog_create_scatterplot( &scatterPlotInfo );
-	if( scatterPlotInfo.title != NULL ) g_free( (gchar*)scatterPlotInfo.title );
-	if( scatterPlotInfo.subtitle != NULL ) g_free( (gchar*)scatterPlotInfo.subtitle );
+    pixbuf = gnc_html_graph_gog_create_scatterplot( &scatterPlotInfo );
+    if ( scatterPlotInfo.title != NULL ) g_free( (gchar*)scatterPlotInfo.title );
+    if ( scatterPlotInfo.subtitle != NULL ) g_free( (gchar*)scatterPlotInfo.subtitle );
 
-	base64_buf = convert_pixbuf_to_base64_string( pixbuf );
-	if( base64_buf == NULL ) {
-		return FALSE;
-	}
+    base64_buf = convert_pixbuf_to_base64_string( pixbuf );
+    if ( base64_buf == NULL )
+    {
+        return FALSE;
+    }
 
-	*pResult = g_strdup_printf( "<img src=\"data:image/png;base64,%s \" alt=\"Cannot display scatterplot\"/>", base64_buf );
+    *pResult = g_strdup_printf( "<img src=\"data:image/png;base64,%s \" alt=\"Cannot display scatterplot\"/>", base64_buf );
 
-	g_debug("scatterplot rendered.");
-	return TRUE;
+    g_debug("scatterplot rendered.");
+    return TRUE;
 }

Modified: gnucash/trunk/src/html/gnc-html-graph-gog.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-graph-gog.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-graph-gog.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -92,62 +92,63 @@
 void
 gnc_html_graph_gog_init( void )
 {
-	static gboolean initialized = FALSE;
+    static gboolean initialized = FALSE;
 
-	if( !initialized ) {
-		g_debug( "init gog graphing" );
+    if ( !initialized )
+    {
+        g_debug( "init gog graphing" );
 
-		libgoffice_init();
-  
-		/* Initialize plugins manager */
-		go_plugins_init( NULL, NULL, NULL, NULL, TRUE, GO_TYPE_PLUGIN_LOADER_MODULE );
+        libgoffice_init();
 
-		initialized = TRUE;
-	}
+        /* Initialize plugins manager */
+        go_plugins_init( NULL, NULL, NULL, NULL, TRUE, GO_TYPE_PLUGIN_LOADER_MODULE );
+
+        initialized = TRUE;
+    }
 }
 
 static GdkPixbuf*
 create_graph_pixbuf( GogObject *graph, int width, int height )
 {
 #if defined(HAVE_GOFFICE_0_5)
-	GogRenderer *renderer;
+    GogRenderer *renderer;
 #elif defined(GOFFICE_WITH_CAIRO)
-	GogRendererCairo *cairo_renderer;
+    GogRendererCairo *cairo_renderer;
 #else
-	GogRendererPixbuf *pixbuf_renderer;
+    GogRendererPixbuf *pixbuf_renderer;
 #endif
-	GdkPixbuf *buf;
-	gboolean update_status;
+    GdkPixbuf *buf;
+    gboolean update_status;
 
-	// Note that this shouldn't be necessary as per discussion with Jody...
-	// ... but it is because we don't embed in a control which passes the
-	// update requests back to the graph widget, a-la the foo-canvas that
-	// gnumeric uses.  We probably _should_ do something like that, though.
-	gog_object_update (GOG_OBJECT (graph));
+    // Note that this shouldn't be necessary as per discussion with Jody...
+    // ... but it is because we don't embed in a control which passes the
+    // update requests back to the graph widget, a-la the foo-canvas that
+    // gnumeric uses.  We probably _should_ do something like that, though.
+    gog_object_update (GOG_OBJECT (graph));
 
 #if defined(HAVE_GOFFICE_0_5)
-	renderer = GOG_RENDERER(g_object_new( GOG_TYPE_RENDERER, "model", graph, NULL ));
-	update_status = gog_renderer_update( renderer, width, height );
-	buf = gog_renderer_get_pixbuf( renderer );
-	g_object_set_data_full( G_OBJECT(buf), "renderer", renderer, g_object_unref );
+    renderer = GOG_RENDERER(g_object_new( GOG_TYPE_RENDERER, "model", graph, NULL ));
+    update_status = gog_renderer_update( renderer, width, height );
+    buf = gog_renderer_get_pixbuf( renderer );
+    g_object_set_data_full( G_OBJECT(buf), "renderer", renderer, g_object_unref );
 #elif defined(GOFFICE_WITH_CAIRO)
-	cairo_renderer = GOG_RENDERER_CAIRO(g_object_new( GOG_RENDERER_CAIRO_TYPE,
-													"model", graph,
-													NULL ));
-	update_status = gog_renderer_cairo_update( cairo_renderer, width, height, 1.0 );
-	buf = gog_renderer_cairo_get_pixbuf( cairo_renderer );
-	g_object_set_data_full( G_OBJECT(buf), "renderer", cairo_renderer, g_object_unref );
+    cairo_renderer = GOG_RENDERER_CAIRO(g_object_new( GOG_RENDERER_CAIRO_TYPE,
+                                        "model", graph,
+                                        NULL ));
+    update_status = gog_renderer_cairo_update( cairo_renderer, width, height, 1.0 );
+    buf = gog_renderer_cairo_get_pixbuf( cairo_renderer );
+    g_object_set_data_full( G_OBJECT(buf), "renderer", cairo_renderer, g_object_unref );
 #else
-	pixbuf_renderer = GOG_RENDERER_PIXBUF(g_object_new( GOG_RENDERER_PIXBUF_TYPE,
-														"model", graph,
-														NULL));
-	update_status = gog_renderer_pixbuf_update( pixbuf_renderer, width, height, 1.0 );
-	buf = gog_renderer_pixbuf_get( pixbuf_renderer );
-	g_object_set_data_full( G_OBJECT(buf), "renderer", pixbuf_renderer, g_object_unref );
+    pixbuf_renderer = GOG_RENDERER_PIXBUF(g_object_new( GOG_RENDERER_PIXBUF_TYPE,
+                                          "model", graph,
+                                          NULL));
+    update_status = gog_renderer_pixbuf_update( pixbuf_renderer, width, height, 1.0 );
+    buf = gog_renderer_pixbuf_get( pixbuf_renderer );
+    g_object_set_data_full( G_OBJECT(buf), "renderer", pixbuf_renderer, g_object_unref );
 #endif
 
-	g_object_set_data_full( G_OBJECT(buf), "graph", graph, g_object_unref );
-	return buf;
+    g_object_set_data_full( G_OBJECT(buf), "graph", graph, g_object_unref );
+    return buf;
 }
 
 static gboolean
@@ -156,62 +157,62 @@
                            GogObject **out_chart,
                            GogPlot **out_plot)
 {
-  *out_graph = g_object_new(GOG_TYPE_GRAPH, NULL);
-  *out_chart = gog_object_add_by_name(*out_graph, "Chart", NULL);
-  *out_plot = gog_plot_new_by_name(plot_type_name);
-  if (!*out_plot)
-  {
-    // FIXME - log betterer; should probably use GError?
-    g_warning("gog: unable to load %s plugin", plot_type_name);
-    return FALSE;
-  }
-  gog_object_add_by_name(*out_chart, "Plot", GOG_OBJECT(*out_plot) );
-  return TRUE;
+    *out_graph = g_object_new(GOG_TYPE_GRAPH, NULL);
+    *out_chart = gog_object_add_by_name(*out_graph, "Chart", NULL);
+    *out_plot = gog_plot_new_by_name(plot_type_name);
+    if (!*out_plot)
+    {
+        // FIXME - log betterer; should probably use GError?
+        g_warning("gog: unable to load %s plugin", plot_type_name);
+        return FALSE;
+    }
+    gog_object_add_by_name(*out_chart, "Plot", GOG_OBJECT(*out_plot) );
+    return TRUE;
 }
 
 static void
 set_chart_titles(GogObject *chart, const char *title, const char* sub_title)
 {
-  gchar *my_sub_title, *total_title;
-  GOData *title_scalar;
-  GogObject *tmp;
+    gchar *my_sub_title, *total_title;
+    GOData *title_scalar;
+    GogObject *tmp;
 
-  if (sub_title)
-    my_sub_title = g_strdup_printf("%s(%s)", title ? " " : "", sub_title);
-  else
-    my_sub_title = g_strdup("");
+    if (sub_title)
+        my_sub_title = g_strdup_printf("%s(%s)", title ? " " : "", sub_title);
+    else
+        my_sub_title = g_strdup("");
 
-  total_title = g_strdup_printf("%s%s", title ? title : "", my_sub_title);
+    total_title = g_strdup_printf("%s%s", title ? title : "", my_sub_title);
 
-  tmp = gog_object_add_by_name(chart, "Title", NULL);
-  title_scalar = go_data_scalar_str_new(total_title, TRUE);
-  gog_dataset_set_dim(GOG_DATASET(tmp), 0, title_scalar, NULL);
+    tmp = gog_object_add_by_name(chart, "Title", NULL);
+    title_scalar = go_data_scalar_str_new(total_title, TRUE);
+    gog_dataset_set_dim(GOG_DATASET(tmp), 0, title_scalar, NULL);
 
-  g_free(my_sub_title);
+    g_free(my_sub_title);
 }
 
 static void
 set_chart_axis_labels(GogObject *chart, const char *x_axis_label, const char* y_axis_label)
 {
-  if (x_axis_label != NULL)
-  {
-    GogObject *xaxis, *label;
-    GOData *data;
-    xaxis = gog_object_get_child_by_role(chart, gog_object_find_role_by_name(chart, "X-Axis"));
-    label = gog_object_add_by_name(xaxis, "Label", NULL);
-    data = go_data_scalar_str_new(x_axis_label, FALSE);
-    gog_dataset_set_dim(GOG_DATASET(label), 0, data, NULL);
-  }
+    if (x_axis_label != NULL)
+    {
+        GogObject *xaxis, *label;
+        GOData *data;
+        xaxis = gog_object_get_child_by_role(chart, gog_object_find_role_by_name(chart, "X-Axis"));
+        label = gog_object_add_by_name(xaxis, "Label", NULL);
+        data = go_data_scalar_str_new(x_axis_label, FALSE);
+        gog_dataset_set_dim(GOG_DATASET(label), 0, data, NULL);
+    }
 
-  if (y_axis_label != NULL)
-  {
-    GogObject *yaxis, *label;
-    GOData *data;
-    yaxis = gog_object_get_child_by_role(chart, gog_object_find_role_by_name(chart, "Y-Axis"));
-    label = gog_object_add_by_name(yaxis, "Label", NULL);
-    data = go_data_scalar_str_new(y_axis_label, FALSE);
-    gog_dataset_set_dim(GOG_DATASET(label), 0, data, NULL);
-  }
+    if (y_axis_label != NULL)
+    {
+        GogObject *yaxis, *label;
+        GOData *data;
+        yaxis = gog_object_get_child_by_role(chart, gog_object_find_role_by_name(chart, "Y-Axis"));
+        label = gog_object_add_by_name(yaxis, "Label", NULL);
+        data = go_data_scalar_str_new(y_axis_label, FALSE);
+        gog_dataset_set_dim(GOG_DATASET(label), 0, data, NULL);
+    }
 }
 
 /*
@@ -228,40 +229,41 @@
 GdkPixbuf*
 gnc_html_graph_gog_create_piechart( GncHtmlPieChartInfo* info )
 {
-	GogObject *graph, *chart;
-	GogPlot *plot;
-	GogSeries *series;
-	GOData *labelData, *sliceData;
-	GdkPixbuf* pixbuf;
+    GogObject *graph, *chart;
+    GogPlot *plot;
+    GogSeries *series;
+    GOData *labelData, *sliceData;
+    GdkPixbuf* pixbuf;
 
-	if( !create_basic_plot_elements( "GogPiePlot", &graph, &chart, &plot ) ) {
-		return NULL;
-	}
-	gog_object_add_by_name( chart, "Legend", NULL );
+    if ( !create_basic_plot_elements( "GogPiePlot", &graph, &chart, &plot ) )
+    {
+        return NULL;
+    }
+    gog_object_add_by_name( chart, "Legend", NULL );
 
 #ifdef GO_COLOR_BLACK
-	GOG_STYLED_OBJECT(graph)->style->line.width = 5;
-	GOG_STYLED_OBJECT(graph)->style->line.color = GO_COLOR_BLACK;
+    GOG_STYLED_OBJECT(graph)->style->line.width = 5;
+    GOG_STYLED_OBJECT(graph)->style->line.color = GO_COLOR_BLACK;
 #else
-	GOG_STYLED_OBJECT(graph)->style->outline.width = 5;
-	GOG_STYLED_OBJECT(graph)->style->outline.color = RGBA_BLACK;
+    GOG_STYLED_OBJECT(graph)->style->outline.width = 5;
+    GOG_STYLED_OBJECT(graph)->style->outline.color = RGBA_BLACK;
 #endif
 
-	series = gog_plot_new_series( plot );
-	labelData = go_data_vector_str_new( (gchar const * const *)info->labels, info->datasize, NULL );
-	gog_series_set_dim( series, 0, labelData, NULL );
-	go_data_emit_changed( GO_DATA(labelData) );
+    series = gog_plot_new_series( plot );
+    labelData = go_data_vector_str_new( (gchar const * const *)info->labels, info->datasize, NULL );
+    gog_series_set_dim( series, 0, labelData, NULL );
+    go_data_emit_changed( GO_DATA(labelData) );
 
-	sliceData = go_data_vector_val_new( info->data, info->datasize, NULL );
-	gog_series_set_dim( series, 1, sliceData, NULL );
-	go_data_emit_changed( GO_DATA(sliceData) );
+    sliceData = go_data_vector_val_new( info->data, info->datasize, NULL );
+    gog_series_set_dim( series, 1, sliceData, NULL );
+    go_data_emit_changed( GO_DATA(sliceData) );
 
-	// fixme: colors
-	set_chart_titles( chart, info->title, info->subtitle );
+    // fixme: colors
+    set_chart_titles( chart, info->title, info->subtitle );
 
-	pixbuf = create_graph_pixbuf( graph, info->width, info->height );
+    pixbuf = create_graph_pixbuf( graph, info->width, info->height );
 
-	return pixbuf;
+    return pixbuf;
 }
 
 /**
@@ -279,83 +281,91 @@
 GdkPixbuf*
 gnc_html_graph_gog_create_barchart( GncHtmlBarChartInfo* info )
 {
-	GogObject *graph, *chart;
-	GogPlot *plot;
-	GogSeries *series;
-	GOStyle *style;
-	GOData *label_data, *slice_data;
-	char *bar_type = "normal";
-	int bar_overlap = 0 /*percent*/; // seperate bars; no overlap.
-	GdkPixbuf* pixbuf;
+    GogObject *graph, *chart;
+    GogPlot *plot;
+    GogSeries *series;
+    GOStyle *style;
+    GOData *label_data, *slice_data;
+    char *bar_type = "normal";
+    int bar_overlap = 0 /*percent*/; // seperate bars; no overlap.
+    GdkPixbuf* pixbuf;
 
-	if( !create_basic_plot_elements( "GogBarColPlot", &graph, &chart, &plot ) ) {
-		return FALSE;
-	}
-	gog_object_add_by_name( chart, "Legend", NULL );
+    if ( !create_basic_plot_elements( "GogBarColPlot", &graph, &chart, &plot ) )
+    {
+        return FALSE;
+    }
+    gog_object_add_by_name( chart, "Legend", NULL );
 
-	if( info->stacked ) {
-		// when stacked, we want the bars on _top_ of eachother.
-		bar_type = "stacked";
-		bar_overlap = 100 /*percent*/;
-	}
+    if ( info->stacked )
+    {
+        // when stacked, we want the bars on _top_ of eachother.
+        bar_type = "stacked";
+        bar_overlap = 100 /*percent*/;
+    }
 
-	g_object_set( G_OBJECT(plot),
-					//"vary_style_by_element",	TRUE,
-					"type",                     bar_type,
-					"overlap_percentage",       bar_overlap, 
-					NULL);
-	label_data = go_data_vector_str_new( (gchar const * const *)info->row_labels, info->data_rows, NULL );
-	{
-		// foreach row:
-		//   series = row
-		GdkColor color;
-		int i;
-		for( i = 0; i < info->data_cols; i++ ) {
-			GError *err = NULL;
+    g_object_set( G_OBJECT(plot),
+                  //"vary_style_by_element",	TRUE,
+                  "type",                     bar_type,
+                  "overlap_percentage",       bar_overlap,
+                  NULL);
+    label_data = go_data_vector_str_new( (gchar const * const *)info->row_labels, info->data_rows, NULL );
+    {
+        // foreach row:
+        //   series = row
+        GdkColor color;
+        int i;
+        for ( i = 0; i < info->data_cols; i++ )
+        {
+            GError *err = NULL;
 
-			series = gog_plot_new_series( plot );
-			gog_object_set_name( GOG_OBJECT(series), info->col_labels[i], &err );
-			if( err != NULL ) {
-				g_warning( "error setting name [%s] on series [%d]: [%s]",
-							info->col_labels[i], i, err->message);
-			}
+            series = gog_plot_new_series( plot );
+            gog_object_set_name( GOG_OBJECT(series), info->col_labels[i], &err );
+            if ( err != NULL )
+            {
+                g_warning( "error setting name [%s] on series [%d]: [%s]",
+                           info->col_labels[i], i, err->message);
+            }
 
-			g_object_ref( label_data );
-			gog_series_set_dim( series, 0, label_data, NULL );
-			go_data_emit_changed( GO_DATA(label_data) );
+            g_object_ref( label_data );
+            gog_series_set_dim( series, 0, label_data, NULL );
+            go_data_emit_changed( GO_DATA(label_data) );
 
-			slice_data = go_data_vector_val_new( info->data + (i*info->data_rows), info->data_rows, NULL );
-			gog_series_set_dim( series, 1, slice_data, NULL );
-			go_data_emit_changed( GO_DATA(slice_data) );
+            slice_data = go_data_vector_val_new( info->data + (i * info->data_rows), info->data_rows, NULL );
+            gog_series_set_dim( series, 1, slice_data, NULL );
+            go_data_emit_changed( GO_DATA(slice_data) );
 
-			style = go_styled_object_get_style( GO_STYLED_OBJECT(series) );
-			style->fill.type = GO_STYLE_FILL_PATTERN;
-			if( gdk_color_parse( info->col_colors[i], &color ) ) {
-				style->fill.auto_back = FALSE;
-				go_pattern_set_solid( &style->fill.pattern, GO_COLOR_FROM_GDK(color) );
-			} else {
-				g_warning( "cannot parse color [%s]", info->col_colors[i] );
-			}
-		}
-	}
+            style = go_styled_object_get_style( GO_STYLED_OBJECT(series) );
+            style->fill.type = GO_STYLE_FILL_PATTERN;
+            if ( gdk_color_parse( info->col_colors[i], &color ) )
+            {
+                style->fill.auto_back = FALSE;
+                go_pattern_set_solid( &style->fill.pattern, GO_COLOR_FROM_GDK(color) );
+            }
+            else
+            {
+                g_warning( "cannot parse color [%s]", info->col_colors[i] );
+            }
+        }
+    }
 
-	if( info->rotate_row_labels ) {
-		GogObject *object = gog_object_get_child_by_role(
-									chart, gog_object_find_role_by_name( chart, "X-Axis" ) );
-		style = go_styled_object_get_style( GO_STYLED_OBJECT(object) );
-		go_style_set_text_angle( style, 90.0 );
-	}
+    if ( info->rotate_row_labels )
+    {
+        GogObject *object = gog_object_get_child_by_role(
+                                chart, gog_object_find_role_by_name( chart, "X-Axis" ) );
+        style = go_styled_object_get_style( GO_STYLED_OBJECT(object) );
+        go_style_set_text_angle( style, 90.0 );
+    }
 
-	set_chart_titles( chart, info->title, info->subtitle );
-	set_chart_axis_labels( chart, info->x_axis_label, info->y_axis_label );
+    set_chart_titles( chart, info->title, info->subtitle );
+    set_chart_axis_labels( chart, info->x_axis_label, info->y_axis_label );
 
-	// we need to do this twice for the barchart... :p
-	gog_object_update( GOG_OBJECT(graph) );
+    // we need to do this twice for the barchart... :p
+    gog_object_update( GOG_OBJECT(graph) );
 
-	pixbuf = create_graph_pixbuf( graph, info->width, info->height );
-	g_debug( "barchart rendered." );
+    pixbuf = create_graph_pixbuf( graph, info->width, info->height );
+    g_debug( "barchart rendered." );
 
-	return pixbuf;
+    return pixbuf;
 }
 
 
@@ -377,178 +387,207 @@
 GdkPixbuf*
 gnc_html_graph_gog_create_linechart( GncHtmlLineChartInfo* info )
 {
-	GogObject *graph, *chart;
-	GogPlot *plot;
-	GogSeries *series;
-	GOStyle *style;
-	GOData *label_data, *slice_data;
-	gchar* line_type = "normal";
-	GdkPixbuf* pixbuf;
+    GogObject *graph, *chart;
+    GogPlot *plot;
+    GogSeries *series;
+    GOStyle *style;
+    GOData *label_data, *slice_data;
+    gchar* line_type = "normal";
+    GdkPixbuf* pixbuf;
 
-	if( !create_basic_plot_elements( "GogLinePlot", &graph, &chart, &plot ) ) {
-		return NULL;
-	}
-	gog_object_add_by_name( chart, "Legend", NULL );
+    if ( !create_basic_plot_elements( "GogLinePlot", &graph, &chart, &plot ) )
+    {
+        return NULL;
+    }
+    gog_object_add_by_name( chart, "Legend", NULL );
 
-	if( info->stacked ) {
-		// when stacked, we want the lines on _top_ of eachother.
-		line_type = "stacked";
-	}
+    if ( info->stacked )
+    {
+        // when stacked, we want the lines on _top_ of eachother.
+        line_type = "stacked";
+    }
 
-	g_object_set( G_OBJECT(plot),
-					//"vary_style_by_element",   TRUE,
-					"type",                      line_type,
-					"default-style-has-markers", info->markers,
-					NULL);
-	label_data = go_data_vector_str_new( (gchar const * const *)info->row_labels, info->data_rows, NULL );
-	{
-		// foreach row:
-		//   series = row
-		GdkColor color;
-		int i;
-		for( i = 0; i < info->data_cols; i++ ) {
-			GError *err = NULL;
+    g_object_set( G_OBJECT(plot),
+                  //"vary_style_by_element",   TRUE,
+                  "type",                      line_type,
+                  "default-style-has-markers", info->markers,
+                  NULL);
+    label_data = go_data_vector_str_new( (gchar const * const *)info->row_labels, info->data_rows, NULL );
+    {
+        // foreach row:
+        //   series = row
+        GdkColor color;
+        int i;
+        for ( i = 0; i < info->data_cols; i++ )
+        {
+            GError *err = NULL;
 
-			series = gog_plot_new_series( plot );
-			gog_object_set_name( GOG_OBJECT(series), info->col_labels[i], &err );
-			if( err != NULL ) {
-				g_warning( "error setting name [%s] on series [%d]: [%s]",
-							info->col_labels[i], i, err->message );
-			}
+            series = gog_plot_new_series( plot );
+            gog_object_set_name( GOG_OBJECT(series), info->col_labels[i], &err );
+            if ( err != NULL )
+            {
+                g_warning( "error setting name [%s] on series [%d]: [%s]",
+                           info->col_labels[i], i, err->message );
+            }
 
-			g_object_ref( label_data );
-			gog_series_set_dim( series, 0, label_data, NULL );
-			go_data_emit_changed( GO_DATA(label_data) );
+            g_object_ref( label_data );
+            gog_series_set_dim( series, 0, label_data, NULL );
+            go_data_emit_changed( GO_DATA(label_data) );
 
-			slice_data = go_data_vector_val_new( info->data + (i* info->data_rows),  info->data_rows, NULL );
-			gog_series_set_dim( series, 1, slice_data, NULL );
-			go_data_emit_changed( GO_DATA(slice_data) );
+            slice_data = go_data_vector_val_new( info->data + (i * info->data_rows),  info->data_rows, NULL );
+            gog_series_set_dim( series, 1, slice_data, NULL );
+            go_data_emit_changed( GO_DATA(slice_data) );
 
-			style = go_styled_object_get_style( GO_STYLED_OBJECT(series) );
-			style->fill.type = GO_STYLE_FILL_PATTERN;
-			if( gdk_color_parse( info->col_colors[i], &color ) ) {
-				style->fill.auto_back = FALSE;
-				go_pattern_set_solid( &style->fill.pattern, GO_COLOR_FROM_GDK(color) );
-			} else {
-				g_warning( "cannot parse color [%s]", info->col_colors[i] );
-			}
-		}
-	}
+            style = go_styled_object_get_style( GO_STYLED_OBJECT(series) );
+            style->fill.type = GO_STYLE_FILL_PATTERN;
+            if ( gdk_color_parse( info->col_colors[i], &color ) )
+            {
+                style->fill.auto_back = FALSE;
+                go_pattern_set_solid( &style->fill.pattern, GO_COLOR_FROM_GDK(color) );
+            }
+            else
+            {
+                g_warning( "cannot parse color [%s]", info->col_colors[i] );
+            }
+        }
+    }
 
-	if( info->rotate_row_labels ) {
-		GogObject *object = gog_object_get_child_by_role(
-								chart, gog_object_find_role_by_name( chart, "X-Axis" ) );
-		style = go_styled_object_get_style( GO_STYLED_OBJECT(object) );
-		go_style_set_text_angle( style, 90.0 );
-	}
+    if ( info->rotate_row_labels )
+    {
+        GogObject *object = gog_object_get_child_by_role(
+                                chart, gog_object_find_role_by_name( chart, "X-Axis" ) );
+        style = go_styled_object_get_style( GO_STYLED_OBJECT(object) );
+        go_style_set_text_angle( style, 90.0 );
+    }
 
-	if( info->major_grid ||  info->minor_grid ) {
-		GogObject *object;
-		gog_object_add_by_name( chart,"Grid", NULL );
-		object = gog_object_get_child_by_role( chart,
-										gog_object_find_role_by_name( chart, "Y-Axis" ) );
-		if( info->major_grid ) {
-			gog_object_add_by_name( GOG_OBJECT(object), "MajorGrid", NULL );
-		}
-		if( info->minor_grid ) {
-			gog_object_add_by_name( GOG_OBJECT (object), "MinorGrid", NULL );
-		}
-	}
+    if ( info->major_grid ||  info->minor_grid )
+    {
+        GogObject *object;
+        gog_object_add_by_name( chart, "Grid", NULL );
+        object = gog_object_get_child_by_role( chart,
+                                               gog_object_find_role_by_name( chart, "Y-Axis" ) );
+        if ( info->major_grid )
+        {
+            gog_object_add_by_name( GOG_OBJECT(object), "MajorGrid", NULL );
+        }
+        if ( info->minor_grid )
+        {
+            gog_object_add_by_name( GOG_OBJECT (object), "MinorGrid", NULL );
+        }
+    }
 
-	set_chart_titles( chart, info->title, info->subtitle );
-	set_chart_axis_labels( chart, info->x_axis_label, info->y_axis_label );
+    set_chart_titles( chart, info->title, info->subtitle );
+    set_chart_axis_labels( chart, info->x_axis_label, info->y_axis_label );
 
-	// we need to do this twice for the linechart... :p
-	gog_object_update( GOG_OBJECT(graph) );
+    // we need to do this twice for the linechart... :p
+    gog_object_update( GOG_OBJECT(graph) );
 
-	pixbuf = create_graph_pixbuf( graph, info->width, info->height );
-	g_debug( "linechart rendered." );
+    pixbuf = create_graph_pixbuf( graph, info->width, info->height );
+    g_debug( "linechart rendered." );
 
-	return pixbuf;
+    return pixbuf;
 }
 
 GdkPixbuf*
 gnc_html_graph_gog_create_scatterplot( GncHtmlScatterPlotInfo* info )
 {
-	GogObject *graph, *chart;
-	GogPlot *plot;
-	GogSeries *series;
-	GOData *sliceData;
-	GOStyle *style;
-	gboolean fill = FALSE;
+    GogObject *graph, *chart;
+    GogPlot *plot;
+    GogSeries *series;
+    GOData *sliceData;
+    GOStyle *style;
+    gboolean fill = FALSE;
 
-	if( !create_basic_plot_elements( "GogXYPlot", &graph, &chart, &plot ) ) {
-		return NULL;
-	}
+    if ( !create_basic_plot_elements( "GogXYPlot", &graph, &chart, &plot ) )
+    {
+        return NULL;
+    }
 
-	series = gog_plot_new_series( plot );
-	style = go_styled_object_get_style( GO_STYLED_OBJECT(series) );
+    series = gog_plot_new_series( plot );
+    style = go_styled_object_get_style( GO_STYLED_OBJECT(series) );
 
-	sliceData = go_data_vector_val_new( info->xData, info->datasize, NULL );
-	gog_series_set_dim( series, 0, sliceData, NULL );
-	go_data_emit_changed( GO_DATA(sliceData) );
+    sliceData = go_data_vector_val_new( info->xData, info->datasize, NULL );
+    gog_series_set_dim( series, 0, sliceData, NULL );
+    go_data_emit_changed( GO_DATA(sliceData) );
 
-	sliceData = go_data_vector_val_new( info->yData, info->datasize, NULL );
-	gog_series_set_dim( series, 1, sliceData, NULL );
-	go_data_emit_changed( GO_DATA(sliceData) );
+    sliceData = go_data_vector_val_new( info->yData, info->datasize, NULL );
+    gog_series_set_dim( series, 1, sliceData, NULL );
+    go_data_emit_changed( GO_DATA(sliceData) );
 
-	/* set marker shape */
-	if( info->marker_str != NULL ) {
-		GOMarkerShape shape;
+    /* set marker shape */
+    if ( info->marker_str != NULL )
+    {
+        GOMarkerShape shape;
 
-		if( g_str_has_prefix( info->marker_str, "filled ") ) {
-			fill = TRUE;
-			info->marker_str += 7;
-		}
-		shape = go_marker_shape_from_str( info->marker_str );
-		if( shape != GO_MARKER_NONE ) {
-			style->marker.auto_shape = FALSE;
-			go_marker_set_shape( style->marker.mark, shape );
-		} else {
-			g_warning( "cannot parse marker shape [%s]", info->marker_str );
-		}
-	}
+        if ( g_str_has_prefix( info->marker_str, "filled ") )
+        {
+            fill = TRUE;
+            info->marker_str += 7;
+        }
+        shape = go_marker_shape_from_str( info->marker_str );
+        if ( shape != GO_MARKER_NONE )
+        {
+            style->marker.auto_shape = FALSE;
+            go_marker_set_shape( style->marker.mark, shape );
+        }
+        else
+        {
+            g_warning( "cannot parse marker shape [%s]", info->marker_str );
+        }
+    }
 
-	/* set marker and line colors */
-	if( info->color_str != NULL ) {
-		GdkColor color;
-		if( gdk_color_parse( info->color_str, &color ) ) {
-			style->marker.auto_outline_color = FALSE;
-			go_marker_set_outline_color( style->marker.mark, GO_COLOR_FROM_GDK(color) );
-			style->line.auto_color = FALSE;
-			style->line.color = GO_COLOR_FROM_GDK(color);
-		} else {
-			g_warning( "cannot parse color [%s]", info->color_str );
-		}
-	}
+    /* set marker and line colors */
+    if ( info->color_str != NULL )
+    {
+        GdkColor color;
+        if ( gdk_color_parse( info->color_str, &color ) )
+        {
+            style->marker.auto_outline_color = FALSE;
+            go_marker_set_outline_color( style->marker.mark, GO_COLOR_FROM_GDK(color) );
+            style->line.auto_color = FALSE;
+            style->line.color = GO_COLOR_FROM_GDK(color);
+        }
+        else
+        {
+            g_warning( "cannot parse color [%s]", info->color_str );
+        }
+    }
 
-	/* set marker fill colors */
-	if( fill ) {
-		style->marker.auto_fill_color = style->marker.auto_outline_color;
-		go_marker_set_fill_color( style->marker.mark,
-								go_marker_get_outline_color( style->marker.mark ) );
-	} else {
-		GOStyle *chart_style = go_styled_object_get_style( GO_STYLED_OBJECT(chart) );
+    /* set marker fill colors */
+    if ( fill )
+    {
+        style->marker.auto_fill_color = style->marker.auto_outline_color;
+        go_marker_set_fill_color( style->marker.mark,
+                                  go_marker_get_outline_color( style->marker.mark ) );
+    }
+    else
+    {
+        GOStyle *chart_style = go_styled_object_get_style( GO_STYLED_OBJECT(chart) );
 
-		if( chart_style->fill.type == GO_STYLE_FILL_PATTERN
-				&& chart_style->fill.pattern.pattern == GO_PATTERN_SOLID ) {
-			style->marker.auto_fill_color = FALSE;
-			go_marker_set_fill_color( style->marker.mark, chart_style->fill.pattern.back );
-		} else if( chart_style->fill.type == GO_STYLE_FILL_PATTERN
-				&& chart_style->fill.pattern.pattern == GO_PATTERN_FOREGROUND_SOLID ) {
-			style->marker.auto_fill_color = FALSE;
-			go_marker_set_fill_color( style->marker.mark, chart_style->fill.pattern.fore );
-		} else {
-			g_warning( "fill color of markers can only be set like a solid fill "
-						"pattern of the chart" );
-		}
-	}
+        if ( chart_style->fill.type == GO_STYLE_FILL_PATTERN
+                && chart_style->fill.pattern.pattern == GO_PATTERN_SOLID )
+        {
+            style->marker.auto_fill_color = FALSE;
+            go_marker_set_fill_color( style->marker.mark, chart_style->fill.pattern.back );
+        }
+        else if ( chart_style->fill.type == GO_STYLE_FILL_PATTERN
+                  && chart_style->fill.pattern.pattern == GO_PATTERN_FOREGROUND_SOLID )
+        {
+            style->marker.auto_fill_color = FALSE;
+            go_marker_set_fill_color( style->marker.mark, chart_style->fill.pattern.fore );
+        }
+        else
+        {
+            g_warning( "fill color of markers can only be set like a solid fill "
+                       "pattern of the chart" );
+        }
+    }
 
-	set_chart_titles( chart, info->title, info->subtitle );
-	set_chart_axis_labels( chart, info->x_axis_label, info->y_axis_label );
+    set_chart_titles( chart, info->title, info->subtitle );
+    set_chart_axis_labels( chart, info->x_axis_label, info->y_axis_label );
 
-	// And twice for the scatter, too... :p
-	gog_object_update( GOG_OBJECT(graph) );
+    // And twice for the scatter, too... :p
+    gog_object_update( GOG_OBJECT(graph) );
 
-	return create_graph_pixbuf( graph, info->width, info->height );
+    return create_graph_pixbuf( graph, info->width, info->height );
 }

Modified: gnucash/trunk/src/html/gnc-html-graph-gog.h
===================================================================
--- gnucash/trunk/src/html/gnc-html-graph-gog.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-graph-gog.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -25,66 +25,70 @@
 #ifndef GNC_HTML_GRAPH_GOG_H
 #define GNC_HTML_GRAPH_GOG_H 1
 
-typedef struct {
+typedef struct
+{
     gint width;
-	gint height;
-	const gchar* title;
-	const gchar* subtitle;
-	gint datasize;
-	gdouble* data;
-	gchar** labels;
-	gchar** colors;
+    gint height;
+    const gchar* title;
+    const gchar* subtitle;
+    gint datasize;
+    gdouble* data;
+    gchar** labels;
+    gchar** colors;
 } GncHtmlPieChartInfo;
 
-typedef struct {
+typedef struct
+{
     gint width;
-	gint height;
-	const gchar* title;
-	const gchar* subtitle;
-	gint data_rows;
-	gint data_cols;
-	gdouble* data;
-	gchar** col_labels;
-	gchar** row_labels;
-	gchar** col_colors;
-	const gchar* x_axis_label;
-	const gchar* y_axis_label;
-	gboolean rotate_row_labels;
-	gboolean stacked;
+    gint height;
+    const gchar* title;
+    const gchar* subtitle;
+    gint data_rows;
+    gint data_cols;
+    gdouble* data;
+    gchar** col_labels;
+    gchar** row_labels;
+    gchar** col_colors;
+    const gchar* x_axis_label;
+    const gchar* y_axis_label;
+    gboolean rotate_row_labels;
+    gboolean stacked;
 } GncHtmlBarChartInfo;
 
-typedef struct {
+typedef struct
+{
     gint width;
-	gint height;
-	const gchar* title;
-	const gchar* subtitle;
-	gint data_rows;
-	gint data_cols;
-	gdouble* data;
-	gchar** col_labels;
-	gchar** row_labels;
-	gchar** col_colors;
-	gboolean rotate_row_labels;
-	gboolean stacked;
-	gboolean markers;
-	gboolean major_grid;
-	gboolean minor_grid;
-	const gchar* x_axis_label;
-	const gchar* y_axis_label;
+    gint height;
+    const gchar* title;
+    const gchar* subtitle;
+    gint data_rows;
+    gint data_cols;
+    gdouble* data;
+    gchar** col_labels;
+    gchar** row_labels;
+    gchar** col_colors;
+    gboolean rotate_row_labels;
+    gboolean stacked;
+    gboolean markers;
+    gboolean major_grid;
+    gboolean minor_grid;
+    const gchar* x_axis_label;
+    const gchar* y_axis_label;
 } GncHtmlLineChartInfo;
 
-typedef struct {
+typedef struct
+{
     gint width;
-	gint height;
-	const gchar* title;
-	const gchar* subtitle;
-	const gchar* x_axis_label;
-	const gchar* y_axis_label;
-	gint datasize;
-	gdouble* xData;
-	gdouble* yData;
-	const gchar* marker_str;
-	const gchar* color_str;
+    gint height;
+    const gchar* title;
+    const gchar* subtitle;
+    const gchar* x_axis_label;
+    const gchar* y_axis_label;
+    gint datasize;
+    gdouble* xData;
+    gdouble* yData;
+    const gchar* marker_str;
+    const gchar* color_str;
 } GncHtmlScatterPlotInfo;
 
 void gnc_html_graph_gog_init( void );

Modified: gnucash/trunk/src/html/gnc-html-gtkhtml-p.h
===================================================================
--- gnucash/trunk/src/html/gnc-html-gtkhtml-p.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-gtkhtml-p.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -25,10 +25,11 @@
 
 #include "gnc-html-p.h"
 
-struct _GncHtmlGtkhtmlPrivate {
-	struct _GncHtmlPrivate base;
+struct _GncHtmlGtkhtmlPrivate
+{
+    struct _GncHtmlPrivate base;
 
-	GtkWidget* html;				/* gtkhtml widget itself */
+    GtkWidget* html;				/* gtkhtml widget itself */
 };
 
 #endif

Modified: gnucash/trunk/src/html/gnc-html-gtkhtml.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-gtkhtml.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-gtkhtml.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -89,17 +89,17 @@
 
 static void gtkhtml_pre_3_10_1_bug_workaround( GtkHTMLEmbedded* eb );
 static void gnc_html_url_requested_cb( GtkHTML* html, gchar* url,
-                          GtkHTMLStream* handle, gpointer data );
+                                       GtkHTMLStream* handle, gpointer data );
 static void gnc_html_on_url_cb( GtkHTML* html, const gchar* url, gpointer data );
 static void gnc_html_set_base_cb( GtkHTML* gtkhtml, const gchar* base, gpointer data );
 static void gnc_html_link_clicked_cb( GtkHTML* html, const gchar* url, gpointer data );
 static gboolean gnc_html_object_requested_cb( GtkHTML* html, GtkHTMLEmbedded* eb,
-                             gpointer data );
+        gpointer data );
 static int gnc_html_button_press_cb( GtkWidget* widg, GdkEventButton* event,
-                         gpointer user_data );
+                                     gpointer user_data );
 static void impl_gtkhtml_show_url( GncHtml* self, URLType type,
-                  const gchar* location, const gchar* label,
-                  gboolean new_window_hint );
+                                   const gchar* location, const gchar* label,
+                                   gboolean new_window_hint );
 static void impl_gtkhtml_show_data( GncHtml* self, const gchar* data, int datalen );
 static void impl_gtkhtml_reload( GncHtml* self );
 static void impl_gtkhtml_copy_to_clipboard( GncHtml* self );
@@ -111,100 +111,101 @@
 static void
 gnc_html_gtkhtml_init( GncHtmlGtkhtml* self )
 {
-	GncHtmlGtkhtmlPrivate* priv;
-	GncHtmlGtkhtmlPrivate* new_priv;
+    GncHtmlGtkhtmlPrivate* priv;
+    GncHtmlGtkhtmlPrivate* new_priv;
 
-	new_priv = g_realloc( GNC_HTML(self)->priv, sizeof(GncHtmlGtkhtmlPrivate) );
-	priv = self->priv = new_priv;
+    new_priv = g_realloc( GNC_HTML(self)->priv, sizeof(GncHtmlGtkhtmlPrivate) );
+    priv = self->priv = new_priv;
 
-	priv->html = gtk_html_new();
-	gtk_container_add( GTK_CONTAINER(priv->base.container),
-						GTK_WIDGET(priv->html) );
+    priv->html = gtk_html_new();
+    gtk_container_add( GTK_CONTAINER(priv->base.container),
+                       GTK_WIDGET(priv->html) );
 
 #ifdef HAVE_GTK_2_10
-	g_object_ref_sink( priv->base.container );
+    g_object_ref_sink( priv->base.container );
 #else
-	g_object_ref( priv->base.container );
-	gtk_object_sink( GTK_OBJECT(priv->base.container) );
+    g_object_ref( priv->base.container );
+    gtk_object_sink( GTK_OBJECT(priv->base.container) );
 #endif
 
-	/* signals */
-	g_signal_connect( priv->html, "url_requested",
-					G_CALLBACK(gnc_html_url_requested_cb),
-					self);
+    /* signals */
+    g_signal_connect( priv->html, "url_requested",
+                      G_CALLBACK(gnc_html_url_requested_cb),
+                      self);
 
-	g_signal_connect( priv->html, "on_url",
-				   G_CALLBACK(gnc_html_on_url_cb),
-				   self );
+    g_signal_connect( priv->html, "on_url",
+                      G_CALLBACK(gnc_html_on_url_cb),
+                      self );
 
-	g_signal_connect( priv->html, "set_base",
-		   G_CALLBACK(gnc_html_set_base_cb),
-		   self);
+    g_signal_connect( priv->html, "set_base",
+                      G_CALLBACK(gnc_html_set_base_cb),
+                      self);
 
-	g_signal_connect(priv->html, "link_clicked",
-		   G_CALLBACK(gnc_html_link_clicked_cb),
-		   self);
+    g_signal_connect(priv->html, "link_clicked",
+                     G_CALLBACK(gnc_html_link_clicked_cb),
+                     self);
 
-	g_signal_connect (priv->html, "object_requested",
-		    G_CALLBACK (gnc_html_object_requested_cb),
-		    self);
+    g_signal_connect (priv->html, "object_requested",
+                      G_CALLBACK (gnc_html_object_requested_cb),
+                      self);
 
-	g_signal_connect (priv->html, "button_press_event",
-		    G_CALLBACK (gnc_html_button_press_cb),
-		    self);
+    g_signal_connect (priv->html, "button_press_event",
+                      G_CALLBACK (gnc_html_button_press_cb),
+                      self);
 
-	gtk_html_load_empty(GTK_HTML(priv->html));
+    gtk_html_load_empty(GTK_HTML(priv->html));
 
-	LEAVE("retval %p", self);
+    LEAVE("retval %p", self);
 }
 
 static void
 gnc_html_gtkhtml_class_init( GncHtmlGtkhtmlClass* klass )
 {
-	GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
-	GncHtmlClass* html_class = GNC_HTML_CLASS(klass);
+    GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
+    GncHtmlClass* html_class = GNC_HTML_CLASS(klass);
 
-	gobject_class->dispose = gnc_html_gtkhtml_dispose;
-	gobject_class->finalize = gnc_html_gtkhtml_finalize;
+    gobject_class->dispose = gnc_html_gtkhtml_dispose;
+    gobject_class->finalize = gnc_html_gtkhtml_finalize;
 
-	html_class->show_url = impl_gtkhtml_show_url;
-	html_class->show_data = impl_gtkhtml_show_data;
-	html_class->reload = impl_gtkhtml_reload;
-	html_class->copy_to_clipboard = impl_gtkhtml_copy_to_clipboard;
-	html_class->export_to_file = impl_gtkhtml_export_to_file;
-	html_class->print = impl_gtkhtml_print;
-	html_class->cancel = impl_gtkhtml_cancel;
-	html_class->set_parent = impl_gtkhtml_set_parent;
+    html_class->show_url = impl_gtkhtml_show_url;
+    html_class->show_data = impl_gtkhtml_show_data;
+    html_class->reload = impl_gtkhtml_reload;
+    html_class->copy_to_clipboard = impl_gtkhtml_copy_to_clipboard;
+    html_class->export_to_file = impl_gtkhtml_export_to_file;
+    html_class->print = impl_gtkhtml_print;
+    html_class->cancel = impl_gtkhtml_cancel;
+    html_class->set_parent = impl_gtkhtml_set_parent;
 
-	// Initialize graphing support
-	gnc_html_graph_gog_gtkhtml_init();
+    // Initialize graphing support
+    gnc_html_graph_gog_gtkhtml_init();
 }
 
 static void
 gnc_html_gtkhtml_dispose( GObject* obj )
 {
-	GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(obj);
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(obj);
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
 
-	if( priv->html != NULL ) {
-		g_object_unref( G_OBJECT(priv->html) );
-		priv->html = NULL;
-	}
+    if ( priv->html != NULL )
+    {
+        g_object_unref( G_OBJECT(priv->html) );
+        priv->html = NULL;
+    }
 
-	G_OBJECT_CLASS(gnc_html_gtkhtml_parent_class)->dispose( obj );
+    G_OBJECT_CLASS(gnc_html_gtkhtml_parent_class)->dispose( obj );
 }
 
 static void
 gnc_html_gtkhtml_finalize( GObject* obj )
 {
-	GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(obj);
+    GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(obj);
 
 //	if( self->priv != NULL ) {
 //		g_free( self->priv );
-		self->priv = NULL;
+    self->priv = NULL;
 //	}
 
-	G_OBJECT_CLASS(gnc_html_gtkhtml_parent_class)->finalize( obj );
+    G_OBJECT_CLASS(gnc_html_gtkhtml_parent_class)->finalize( obj );
 }
 
 /*****************************************************************************/
@@ -212,86 +213,106 @@
 static char*
 extract_base_name(URLType type, const gchar* path)
 {
-	gchar       machine_rexp[] = "^(//[^/]*)/*(/.*)?$";
-	gchar       path_rexp[] = "^/*(.*)/+([^/]*)$";
-	regex_t    compiled_m, compiled_p;
-	regmatch_t match[4];
-	gchar       * machine=NULL, * location = NULL, * base=NULL;
-	gchar       * basename=NULL;
+    gchar       machine_rexp[] = "^(//[^/]*)/*(/.*)?$";
+    gchar       path_rexp[] = "^/*(.*)/+([^/]*)$";
+    regex_t    compiled_m, compiled_p;
+    regmatch_t match[4];
+    gchar       * machine = NULL, * location = NULL, * base = NULL;
+    gchar       * basename = NULL;
 
-	DEBUG(" ");
-	if(!path) return NULL;
+    DEBUG(" ");
+    if (!path) return NULL;
 
-	regcomp(&compiled_m, machine_rexp, REG_EXTENDED);
-	regcomp(&compiled_p, path_rexp, REG_EXTENDED);
+    regcomp(&compiled_m, machine_rexp, REG_EXTENDED);
+    regcomp(&compiled_p, path_rexp, REG_EXTENDED);
 
-	if (!safe_strcmp (type, URL_TYPE_HTTP) ||
-			!safe_strcmp (type, URL_TYPE_SECURE) ||
-			!safe_strcmp (type, URL_TYPE_FTP)) {
+    if (!safe_strcmp (type, URL_TYPE_HTTP) ||
+            !safe_strcmp (type, URL_TYPE_SECURE) ||
+            !safe_strcmp (type, URL_TYPE_FTP))
+    {
 
-		/* step 1: split the machine name away from the path
-		 * components */
-		if(!regexec(&compiled_m, path, 4, match, 0)) {
-			/* $1 is the machine name */
-			if(match[1].rm_so != -1) {
-				machine = g_strndup(path+match[1].rm_so,
-                            match[1].rm_eo - match[1].rm_so);
-			}
-			/* $2 is the path */
-			if(match[2].rm_so != -1) {
-				location = g_strndup(path+match[2].rm_so,
-                             match[2].rm_eo - match[2].rm_so);
-			}
-		}
+        /* step 1: split the machine name away from the path
+         * components */
+        if (!regexec(&compiled_m, path, 4, match, 0))
+        {
+            /* $1 is the machine name */
+            if (match[1].rm_so != -1)
+            {
+                machine = g_strndup(path + match[1].rm_so,
+                                    match[1].rm_eo - match[1].rm_so);
+            }
+            /* $2 is the path */
+            if (match[2].rm_so != -1)
+            {
+                location = g_strndup(path + match[2].rm_so,
+                                     match[2].rm_eo - match[2].rm_so);
+            }
+        }
 
-	} else {
-		location = g_strdup(path);
-	}
-	/* step 2: split up the path into prefix and file components */
-	if(location) {
-		if(!regexec(&compiled_p, location, 4, match, 0)) {
-			if(match[1].rm_so != -1) {
-				base = g_strndup(location+match[1].rm_so,
-                         match[1].rm_eo - match[1].rm_so);
-			} else {
-				base = NULL;
-			}
-		}
-	}
+    }
+    else
+    {
+        location = g_strdup(path);
+    }
+    /* step 2: split up the path into prefix and file components */
+    if (location)
+    {
+        if (!regexec(&compiled_p, location, 4, match, 0))
+        {
+            if (match[1].rm_so != -1)
+            {
+                base = g_strndup(location + match[1].rm_so,
+                                 match[1].rm_eo - match[1].rm_so);
+            }
+            else
+            {
+                base = NULL;
+            }
+        }
+    }
 
-	regfree(&compiled_m);
-	regfree(&compiled_p);
+    regfree(&compiled_m);
+    regfree(&compiled_p);
 
-	if(machine) {
-		if(base && (strlen(base) > 0)) {
-			basename = g_strconcat(machine, "/", base, "/", NULL);
-		} else {
-			basename = g_strconcat(machine, "/", NULL);
-		}
-	} else {
-		if(base && (strlen(base) > 0)) {
-			basename = g_strdup(base);
-		} else {
-			basename = NULL;
-		}
-	}
+    if (machine)
+    {
+        if (base && (strlen(base) > 0))
+        {
+            basename = g_strconcat(machine, "/", base, "/", NULL);
+        }
+        else
+        {
+            basename = g_strconcat(machine, "/", NULL);
+        }
+    }
+    else
+    {
+        if (base && (strlen(base) > 0))
+        {
+            basename = g_strdup(base);
+        }
+        else
+        {
+            basename = NULL;
+        }
+    }
 
-	g_free(machine);
-	g_free(base);
-	g_free(location);
-	return basename;
+    g_free(machine);
+    g_free(base);
+    g_free(location);
+    return basename;
 }
 
 static gboolean
 http_allowed()
 {
-	return TRUE;
+    return TRUE;
 }
 
 static gboolean
 https_allowed()
 {
-	return TRUE;
+    return TRUE;
 }
 
 /************************************************************
@@ -301,25 +322,27 @@
 static void
 gnc_html_start_request( GncHtmlGtkhtml* self, gchar * uri, GtkHTMLStream * handle )
 {
-	GList * handles = NULL;
-	gint  need_request = FALSE;
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    GList * handles = NULL;
+    gint  need_request = FALSE;
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
 
-	/* we want to make a list of handles to fill with this URI.
-	 * multiple handles with the same URI will all get filled when the
-	 * request comes in. */
-	DEBUG("requesting %s", uri);
-	handles = g_hash_table_lookup( priv->base.request_info, uri );
-	if( handles == NULL ) {
-		need_request = TRUE;
-	}
+    /* we want to make a list of handles to fill with this URI.
+     * multiple handles with the same URI will all get filled when the
+     * request comes in. */
+    DEBUG("requesting %s", uri);
+    handles = g_hash_table_lookup( priv->base.request_info, uri );
+    if ( handles == NULL )
+    {
+        need_request = TRUE;
+    }
 
-	handles = g_list_append( handles, handle );
-	g_hash_table_insert( priv->base.request_info, uri, handles );
+    handles = g_list_append( handles, handle );
+    g_hash_table_insert( priv->base.request_info, uri, handles );
 
-	if( need_request ) {
-		g_critical("we've not supported network requests for years");
-	}
+    if ( need_request )
+    {
+        g_critical("we've not supported network requests for years");
+    }
 }
 
 /********************************************************************
@@ -330,89 +353,106 @@
 
 static void
 gnc_html_load_to_stream( GncHtmlGtkhtml* self, GtkHTMLStream* handle,
-                        URLType type, const gchar* location,
-                        const gchar* label )
+                         URLType type, const gchar* location,
+                         const gchar* label )
 {
-	gchar* fdata = NULL;
-	int fdata_len = 0;
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    gchar* fdata = NULL;
+    int fdata_len = 0;
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
 
-	DEBUG( "type %s, location %s, label %s", type ? type : "(null)",
-			location ? location : "(null)", label ? label : "(null)");
+    DEBUG( "type %s, location %s, label %s", type ? type : "(null)",
+           location ? location : "(null)", label ? label : "(null)");
 
-	g_return_if_fail( self != NULL );
+    g_return_if_fail( self != NULL );
 
-	if( gnc_html_stream_handlers != NULL ) {
-		GncHTMLStreamCB stream_handler;
+    if ( gnc_html_stream_handlers != NULL )
+    {
+        GncHTMLStreamCB stream_handler;
 
-		stream_handler = g_hash_table_lookup( gnc_html_stream_handlers, type );
-		if( stream_handler ) {
-			gboolean ok = stream_handler( location, &fdata, &fdata_len );
+        stream_handler = g_hash_table_lookup( gnc_html_stream_handlers, type );
+        if ( stream_handler )
+        {
+            gboolean ok = stream_handler( location, &fdata, &fdata_len );
 
-			if( ok ) {
-				fdata = fdata ? fdata : g_strdup( "" );
-				gtk_html_write( GTK_HTML(priv->html), handle, fdata, fdata_len );
-				gtk_html_end( GTK_HTML(priv->html), handle, GTK_HTML_STREAM_OK );
-			} else {
-				fdata = fdata ? fdata :
-							g_strdup_printf( error_404_format,
-							_(error_404_title), _(error_404_body) );
-				gtk_html_write( GTK_HTML(priv->html), handle, fdata, strlen(fdata) );
-				gtk_html_end( GTK_HTML(priv->html), handle, GTK_HTML_STREAM_ERROR );
-			}
+            if ( ok )
+            {
+                fdata = fdata ? fdata : g_strdup( "" );
+                gtk_html_write( GTK_HTML(priv->html), handle, fdata, fdata_len );
+                gtk_html_end( GTK_HTML(priv->html), handle, GTK_HTML_STREAM_OK );
+            }
+            else
+            {
+                fdata = fdata ? fdata :
+                        g_strdup_printf( error_404_format,
+                                         _(error_404_title), _(error_404_body) );
+                gtk_html_write( GTK_HTML(priv->html), handle, fdata, strlen(fdata) );
+                gtk_html_end( GTK_HTML(priv->html), handle, GTK_HTML_STREAM_ERROR );
+            }
 
-			g_free( fdata );
+            g_free( fdata );
 
-			if( label ) {
-				while( gtk_events_pending() ) {
-					gtk_main_iteration();
-				}
-				gtk_html_jump_to_anchor( GTK_HTML(priv->html), label );
-			}
+            if ( label )
+            {
+                while ( gtk_events_pending() )
+                {
+                    gtk_main_iteration();
+                }
+                gtk_html_jump_to_anchor( GTK_HTML(priv->html), label );
+            }
 
-			return;
-		}
-	}
+            return;
+        }
+    }
 
-	do {
-		if( !safe_strcmp( type, URL_TYPE_SECURE ) ||
-			!safe_strcmp( type, URL_TYPE_HTTP ) ) {
+    do
+    {
+        if ( !safe_strcmp( type, URL_TYPE_SECURE ) ||
+                !safe_strcmp( type, URL_TYPE_HTTP ) )
+        {
 
-			if( !safe_strcmp( type, URL_TYPE_SECURE ) ) {
-				if( !https_allowed() ) {
-					gnc_error_dialog( priv->base.parent,"%s",
-                            _("Secure HTTP access is disabled. "
-                              "You can enable it in the Network section of "
-                              "the Preferences dialog."));
-					break;
-				}
-			}
+            if ( !safe_strcmp( type, URL_TYPE_SECURE ) )
+            {
+                if ( !https_allowed() )
+                {
+                    gnc_error_dialog( priv->base.parent, "%s",
+                                      _("Secure HTTP access is disabled. "
+                                        "You can enable it in the Network section of "
+                                        "the Preferences dialog."));
+                    break;
+                }
+            }
 
-			if( !http_allowed() ) {
-				gnc_error_dialog( priv->base.parent,"%s",
-                          _("Network HTTP access is disabled. "
-                            "You can enable it in the Network section of "
-                            "the Preferences dialog."));
-			} else {
-				char *fullurl;
+            if ( !http_allowed() )
+            {
+                gnc_error_dialog( priv->base.parent, "%s",
+                                  _("Network HTTP access is disabled. "
+                                    "You can enable it in the Network section of "
+                                    "the Preferences dialog."));
+            }
+            else
+            {
+                char *fullurl;
 
-				fullurl = gnc_build_url( type, location, label );
-				gnc_html_start_request( self, fullurl, handle );
-			}
+                fullurl = gnc_build_url( type, location, label );
+                gnc_html_start_request( self, fullurl, handle );
+            }
 
-		} else {
-			PWARN( "load_to_stream for inappropriate type\n"
-					"\turl = '%s#%s'\n",
-					location ? location : "(null)",
-					label ? label : "(null)" );
-			fdata = g_strdup_printf( error_404_format,
-								_(error_404_title), _(error_404_body) );
-			gtk_html_write( GTK_HTML(priv->html), handle, fdata, strlen (fdata) );
-			gtk_html_end( GTK_HTML(priv->html), handle, GTK_HTML_STREAM_ERROR );
-			g_free( fdata );
-		}
+        }
+        else
+        {
+            PWARN( "load_to_stream for inappropriate type\n"
+                   "\turl = '%s#%s'\n",
+                   location ? location : "(null)",
+                   label ? label : "(null)" );
+            fdata = g_strdup_printf( error_404_format,
+                                     _(error_404_title), _(error_404_body) );
+            gtk_html_write( GTK_HTML(priv->html), handle, fdata, strlen (fdata) );
+            gtk_html_end( GTK_HTML(priv->html), handle, GTK_HTML_STREAM_ERROR );
+            g_free( fdata );
+        }
 
-	} while( FALSE );
+    }
+    while ( FALSE );
 }
 
 /********************************************************************
@@ -423,16 +463,16 @@
 static void
 gnc_html_link_clicked_cb( GtkHTML* html, const gchar* url, gpointer data )
 {
-	URLType type;
-	gchar* location = NULL;
-	gchar* label = NULL;
-	GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(data);
+    URLType type;
+    gchar* location = NULL;
+    gchar* label = NULL;
+    GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(data);
 
-	DEBUG("Clicked %s", url);
-	type = gnc_html_parse_url( GNC_HTML(self), url, &location, &label );
-	gnc_html_show_url( GNC_HTML(self), type, location, label, 0 );
-	g_free( location );
-	g_free( label );
+    DEBUG("Clicked %s", url);
+    type = gnc_html_parse_url( GNC_HTML(self), url, &location, &label );
+    gnc_html_show_url( GNC_HTML(self), type, location, label, 0 );
+    g_free( location );
+    g_free( label );
 }
 
 
@@ -443,18 +483,18 @@
 
 static void
 gnc_html_url_requested_cb( GtkHTML* html, gchar* url,
-                          GtkHTMLStream* handle, gpointer data )
+                           GtkHTMLStream* handle, gpointer data )
 {
-	URLType type;
-	gchar* location = NULL;
-	gchar* label = NULL;
-	GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(data);
+    URLType type;
+    gchar* location = NULL;
+    gchar* label = NULL;
+    GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(data);
 
-	DEBUG( "requesting %s", url );
-	type = gnc_html_parse_url( GNC_HTML(self), url, &location, &label );
-	gnc_html_load_to_stream( self, handle, type, location, label );
-	g_free( location );
-	g_free( label );
+    DEBUG( "requesting %s", url );
+    type = gnc_html_parse_url( GNC_HTML(self), url, &location, &label );
+    gnc_html_load_to_stream( self, handle, type, location, label );
+    g_free( location );
+    g_free( label );
 }
 
 
@@ -465,21 +505,24 @@
 
 static gboolean
 gnc_html_object_requested_cb( GtkHTML* html, GtkHTMLEmbedded* eb,
-                             gpointer data )
+                              gpointer data )
 {
-	GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(data);
-	GncHTMLObjectCB h;
+    GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(data);
+    GncHTMLObjectCB h;
 
-	DEBUG( " " );
-	if( !eb || !(eb->classid) || !gnc_html_object_handlers ) return FALSE;
+    DEBUG( " " );
+    if ( !eb || !(eb->classid) || !gnc_html_object_handlers ) return FALSE;
 
-	gtkhtml_pre_3_10_1_bug_workaround( eb );
-	h = g_hash_table_lookup( gnc_html_object_handlers, eb->classid );
-	if( h ) {
-		return h( GNC_HTML(self), eb, data );
-	} else {
-		return FALSE;
-	}
+    gtkhtml_pre_3_10_1_bug_workaround( eb );
+    h = g_hash_table_lookup( gnc_html_object_handlers, eb->classid );
+    if ( h )
+    {
+        return h( GNC_HTML(self), eb, data );
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 
 
@@ -490,15 +533,16 @@
 static void
 gnc_html_on_url_cb( GtkHTML* html, const gchar* url, gpointer data )
 {
-	GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(data);
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(data);
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
 
-	DEBUG( "Rollover %s", url ? url : "(null)" );
-	g_free( priv->base.current_link );
-	priv->base.current_link = g_strdup( url );
-	if( priv->base.flyover_cb ) {
-		(priv->base.flyover_cb)( GNC_HTML(self), url, priv->base.flyover_cb_data );
-	}
+    DEBUG( "Rollover %s", url ? url : "(null)" );
+    g_free( priv->base.current_link );
+    priv->base.current_link = g_strdup( url );
+    if ( priv->base.flyover_cb )
+    {
+        (priv->base.flyover_cb)( GNC_HTML(self), url, priv->base.flyover_cb_data );
+    }
 }
 
 
@@ -508,22 +552,22 @@
 
 static void
 gnc_html_set_base_cb( GtkHTML* gtkhtml, const gchar* base,
-                     gpointer data )
+                      gpointer data )
 {
-	GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(data);
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
-	URLType type;
-	gchar* location = NULL;
-	gchar* label = NULL;
+    GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(data);
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    URLType type;
+    gchar* location = NULL;
+    gchar* label = NULL;
 
-	DEBUG( "Setting base location to %s", base );
-	type = gnc_html_parse_url( GNC_HTML(self), base, &location, &label );
+    DEBUG( "Setting base location to %s", base );
+    type = gnc_html_parse_url( GNC_HTML(self), base, &location, &label );
 
-	g_free( priv->base.base_location );
-	g_free( label );
+    g_free( priv->base.base_location );
+    g_free( label );
 
-	priv->base.base_type = type;
-	priv->base.base_location = location;
+    priv->base.base_type = type;
+    priv->base.base_location = location;
 }
 
 
@@ -534,18 +578,21 @@
 
 static int
 gnc_html_button_press_cb( GtkWidget* widg, GdkEventButton* event,
-                         gpointer user_data )
+                          gpointer user_data )
 {
-	GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(user_data);
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(user_data);
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
 
-	DEBUG( "Button Press" );
-	if( priv->base.button_cb != NULL ) {
-		(priv->base.button_cb)( GNC_HTML(self), event, priv->base.button_cb_data );
-		return TRUE;
-	} else {
-		return FALSE;
-	}
+    DEBUG( "Button Press" );
+    if ( priv->base.button_cb != NULL )
+    {
+        (priv->base.button_cb)( GNC_HTML(self), event, priv->base.button_cb_data );
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 
 /********************************************************************
@@ -555,9 +602,9 @@
 
 static void
 gnc_html_open_scm( GncHtmlGtkhtml* self, const gchar * location,
-                  const gchar * label, int newwin )
+                   const gchar * label, int newwin )
 {
-	PINFO("location='%s'", location ? location : "(null)");
+    PINFO("location='%s'", location ? location : "(null)");
 }
 
 
@@ -570,13 +617,13 @@
 static void
 impl_gtkhtml_show_data( GncHtml* self, const char * data, int datalen )
 {
-	GtkHTMLStream * handle;
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    GtkHTMLStream * handle;
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
 
-	DEBUG( "datalen %d, data %20.20s", datalen, data );
-	handle = gtk_html_begin( GTK_HTML(priv->html) );
-	gtk_html_write( GTK_HTML(priv->html), handle, data, datalen );
-	gtk_html_end( GTK_HTML(priv->html), handle, GTK_HTML_STREAM_OK );
+    DEBUG( "datalen %d, data %20.20s", datalen, data );
+    handle = gtk_html_begin( GTK_HTML(priv->html) );
+    gtk_html_write( GTK_HTML(priv->html), handle, data, datalen );
+    gtk_html_end( GTK_HTML(priv->html), handle, GTK_HTML_STREAM_OK );
 }
 
 /********************************************************************
@@ -589,153 +636,186 @@
 
 static void
 impl_gtkhtml_show_url( GncHtml* self, URLType type,
-                  const gchar* location, const gchar* label,
-                  gboolean new_window_hint )
+                       const gchar* location, const gchar* label,
+                       gboolean new_window_hint )
 {
-	GncHTMLUrlCB url_handler;
-	GtkHTMLStream * handle;
-	gboolean new_window;
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    GncHTMLUrlCB url_handler;
+    GtkHTMLStream * handle;
+    gboolean new_window;
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
 
-	DEBUG(" ");
+    DEBUG(" ");
 
-	if( self == NULL ) return;
-	if( location == NULL ) return;
+    if ( self == NULL ) return;
+    if ( location == NULL ) return;
 
-	/* make sure it's OK to show this URL type in this window */
-	if( new_window_hint == 0 ) {
-		if( priv->base.urltype_cb ) {
-			new_window = !((priv->base.urltype_cb)( type ));
-		} else {
-			new_window = FALSE;
-		}
-	} else {
-		new_window = TRUE;
-	}
+    /* make sure it's OK to show this URL type in this window */
+    if ( new_window_hint == 0 )
+    {
+        if ( priv->base.urltype_cb )
+        {
+            new_window = !((priv->base.urltype_cb)( type ));
+        }
+        else
+        {
+            new_window = FALSE;
+        }
+    }
+    else
+    {
+        new_window = TRUE;
+    }
 
-	if( !new_window ) {
-		gnc_html_cancel( GNC_HTML(self) );
-	}
+    if ( !new_window )
+    {
+        gnc_html_cancel( GNC_HTML(self) );
+    }
 
-	if( gnc_html_url_handlers ) {
-		url_handler = g_hash_table_lookup( gnc_html_url_handlers, type );
-	} else {
-		url_handler = NULL;
-	}
+    if ( gnc_html_url_handlers )
+    {
+        url_handler = g_hash_table_lookup( gnc_html_url_handlers, type );
+    }
+    else
+    {
+        url_handler = NULL;
+    }
 
-	if( url_handler ) {
-		GNCURLResult result;
-		gboolean ok;
+    if ( url_handler )
+    {
+        GNCURLResult result;
+        gboolean ok;
 
-		result.load_to_stream = FALSE;
-		result.url_type = type;
-		result.location = NULL;
-		result.label = NULL;
-		result.base_type = URL_TYPE_FILE;
-		result.base_location = NULL;
-		result.error_message = NULL;
+        result.load_to_stream = FALSE;
+        result.url_type = type;
+        result.location = NULL;
+        result.label = NULL;
+        result.base_type = URL_TYPE_FILE;
+        result.base_location = NULL;
+        result.error_message = NULL;
 
-		ok = url_handler( location, label, new_window, &result );
-		if( !ok ) {
-			if( result.error_message ) {
-			  gnc_error_dialog( priv->base.parent, "%s", result.error_message );
-			} else {
-				/* %s is a URL (some location somewhere). */
-				gnc_error_dialog( priv->base.parent, _("There was an error accessing %s."), location );
-			}
+        ok = url_handler( location, label, new_window, &result );
+        if ( !ok )
+        {
+            if ( result.error_message )
+            {
+                gnc_error_dialog( priv->base.parent, "%s", result.error_message );
+            }
+            else
+            {
+                /* %s is a URL (some location somewhere). */
+                gnc_error_dialog( priv->base.parent, _("There was an error accessing %s."), location );
+            }
 
-			if( priv->base.load_cb ) {
-				priv->base.load_cb( GNC_HTML(self), result.url_type,
-								location, label, priv->base.load_cb_data );
-			}
-		} else if( result.load_to_stream ) {
-			gnc_html_history_node *hnode;
-			const char *new_location;
-			const char *new_label;
-			GtkHTMLStream * stream;
+            if ( priv->base.load_cb )
+            {
+                priv->base.load_cb( GNC_HTML(self), result.url_type,
+                                    location, label, priv->base.load_cb_data );
+            }
+        }
+        else if ( result.load_to_stream )
+        {
+            gnc_html_history_node *hnode;
+            const char *new_location;
+            const char *new_label;
+            GtkHTMLStream * stream;
 
-			new_location = result.location ? result.location : location;
-			new_label = result.label ? result.label : label;
-			hnode = gnc_html_history_node_new( result.url_type, new_location, new_label );
+            new_location = result.location ? result.location : location;
+            new_label = result.label ? result.label : label;
+            hnode = gnc_html_history_node_new( result.url_type, new_location, new_label );
 
-			gnc_html_history_append( priv->base.history, hnode );
+            gnc_html_history_append( priv->base.history, hnode );
 
-			g_free( priv->base.base_location );
-			priv->base.base_type = result.base_type;
-			priv->base.base_location =
-					g_strdup( extract_base_name( result.base_type, new_location ) );
-			DEBUG( "resetting base location to %s",
-					priv->base.base_location ? priv->base.base_location : "(null)" );
+            g_free( priv->base.base_location );
+            priv->base.base_type = result.base_type;
+            priv->base.base_location =
+                g_strdup( extract_base_name( result.base_type, new_location ) );
+            DEBUG( "resetting base location to %s",
+                   priv->base.base_location ? priv->base.base_location : "(null)" );
 
-			stream = gtk_html_begin( GTK_HTML(priv->html) );
-			gnc_html_load_to_stream( GNC_HTML_GTKHTML(self), stream, result.url_type,
-									new_location, new_label );
+            stream = gtk_html_begin( GTK_HTML(priv->html) );
+            gnc_html_load_to_stream( GNC_HTML_GTKHTML(self), stream, result.url_type,
+                                     new_location, new_label );
 
-			if( priv->base.load_cb != NULL ) {
-				priv->base.load_cb( GNC_HTML(self), result.url_type,
-								new_location, new_label, priv->base.load_cb_data );
-			}
-		}
+            if ( priv->base.load_cb != NULL )
+            {
+                priv->base.load_cb( GNC_HTML(self), result.url_type,
+                                    new_location, new_label, priv->base.load_cb_data );
+            }
+        }
 
-		g_free( result.location );
-		g_free( result.label );
-		g_free( result.base_location );
-		g_free( result.error_message );
+        g_free( result.location );
+        g_free( result.label );
+        g_free( result.base_location );
+        g_free( result.error_message );
 
-		return;
-	}
+        return;
+    }
 
-	if( safe_strcmp( type, URL_TYPE_SCHEME ) == 0 ) {
-		gnc_html_open_scm( GNC_HTML_GTKHTML(self), location, label, new_window );
+    if ( safe_strcmp( type, URL_TYPE_SCHEME ) == 0 )
+    {
+        gnc_html_open_scm( GNC_HTML_GTKHTML(self), location, label, new_window );
 
-	} else if( safe_strcmp( type, URL_TYPE_JUMP ) == 0 ) {
-		gtk_html_jump_to_anchor( GTK_HTML(priv->html), label );
+    }
+    else if ( safe_strcmp( type, URL_TYPE_JUMP ) == 0 )
+    {
+        gtk_html_jump_to_anchor( GTK_HTML(priv->html), label );
 
-	} else if( safe_strcmp( type, URL_TYPE_SECURE ) == 0 ||
-				safe_strcmp( type, URL_TYPE_HTTP ) == 0 ||
-				safe_strcmp( type, URL_TYPE_FILE ) == 0 ) {
+    }
+    else if ( safe_strcmp( type, URL_TYPE_SECURE ) == 0 ||
+              safe_strcmp( type, URL_TYPE_HTTP ) == 0 ||
+              safe_strcmp( type, URL_TYPE_FILE ) == 0 )
+    {
 
-		do {
-			if( safe_strcmp( type, URL_TYPE_SECURE ) == 0 ) {
-				if( !https_allowed() ) {
-					gnc_error_dialog( priv->base.parent,"%s",
-									_("Secure HTTP access is disabled. "
-									"You can enable it in the Network section of "
-									"the Preferences dialog.") );
-					break;
-				}
-			}
+        do
+        {
+            if ( safe_strcmp( type, URL_TYPE_SECURE ) == 0 )
+            {
+                if ( !https_allowed() )
+                {
+                    gnc_error_dialog( priv->base.parent, "%s",
+                                      _("Secure HTTP access is disabled. "
+                                        "You can enable it in the Network section of "
+                                        "the Preferences dialog.") );
+                    break;
+                }
+            }
 
-			if( safe_strcmp( type, URL_TYPE_HTTP ) == 0 ) {
-				if( !http_allowed() ) {
-					gnc_error_dialog( priv->base.parent,"%s",
-									_("Network HTTP access is disabled. "
-									"You can enable it in the Network section of "
-									"the Preferences dialog.") );
-					break;
-				}
-			}
+            if ( safe_strcmp( type, URL_TYPE_HTTP ) == 0 )
+            {
+                if ( !http_allowed() )
+                {
+                    gnc_error_dialog( priv->base.parent, "%s",
+                                      _("Network HTTP access is disabled. "
+                                        "You can enable it in the Network section of "
+                                        "the Preferences dialog.") );
+                    break;
+                }
+            }
 
-			priv->base.base_type = type;
+            priv->base.base_type = type;
 
-			if( priv->base.base_location != NULL ) g_free( priv->base.base_location );
-			priv->base.base_location = extract_base_name( type, location );
+            if ( priv->base.base_location != NULL ) g_free( priv->base.base_location );
+            priv->base.base_location = extract_base_name( type, location );
 
-			/* FIXME : handle new_window = 1 */
-			gnc_html_history_append( priv->base.history,
-								gnc_html_history_node_new( type, location, label ) );
-			handle = gtk_html_begin( GTK_HTML(priv->html) );
-			gnc_html_load_to_stream( GNC_HTML_GTKHTML(self), handle, type, location, label );
+            /* FIXME : handle new_window = 1 */
+            gnc_html_history_append( priv->base.history,
+                                     gnc_html_history_node_new( type, location, label ) );
+            handle = gtk_html_begin( GTK_HTML(priv->html) );
+            gnc_html_load_to_stream( GNC_HTML_GTKHTML(self), handle, type, location, label );
 
-		} while( FALSE );
+        }
+        while ( FALSE );
 
-	} else {
-		PERR( "URLType %s not supported.", type );
-	}
+    }
+    else
+    {
+        PERR( "URLType %s not supported.", type );
+    }
 
-	if( priv->base.load_cb != NULL ) {
-		(priv->base.load_cb)( GNC_HTML(self), type, location, label, priv->base.load_cb_data );
-	}
+    if ( priv->base.load_cb != NULL )
+    {
+        (priv->base.load_cb)( GNC_HTML(self), type, location, label, priv->base.load_cb_data );
+    }
 }
 
 
@@ -747,14 +827,15 @@
 static void
 impl_gtkhtml_reload( GncHtml* self )
 {
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
-	gnc_html_history_node * n;
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    gnc_html_history_node * n;
 
-	DEBUG(" ");
-	n = gnc_html_history_get_current( priv->base.history );
-	if( n != NULL ) {
-		gnc_html_show_url( self, n->type, n->location, n->label, 0 );
-	}
+    DEBUG(" ");
+    n = gnc_html_history_get_current( priv->base.history );
+    if ( n != NULL )
+    {
+        gnc_html_show_url( self, n->type, n->location, n->label, 0 );
+    }
 }
 
 
@@ -766,10 +847,10 @@
 GncHtml*
 gnc_html_gtkhtml_new( void )
 {
-	GncHtmlGtkhtml* self = g_object_new( GNC_TYPE_HTML_GTKHTML, NULL );
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    GncHtmlGtkhtml* self = g_object_new( GNC_TYPE_HTML_GTKHTML, NULL );
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
 
-	return GNC_HTML(self);
+    return GNC_HTML(self);
 }
 
 /********************************************************************
@@ -780,30 +861,30 @@
 static gboolean
 gtkhtml_cancel_helper(gpointer key, gpointer value, gpointer user_data)
 {
-	g_free(key);
-	g_list_free((GList *)value);
-	return TRUE;
+    g_free(key);
+    g_list_free((GList *)value);
+    return TRUE;
 }
 
 static void
 impl_gtkhtml_cancel( GncHtml* self )
 {
-	GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
-	/* remove our own references to requests */
-	//gnc_http_cancel_requests( priv->http );
+    GncHtmlGtkhtmlPrivate* priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    /* remove our own references to requests */
+    //gnc_http_cancel_requests( priv->http );
 
-	g_hash_table_foreach_remove( priv->base.request_info, gtkhtml_cancel_helper, NULL );
+    g_hash_table_foreach_remove( priv->base.request_info, gtkhtml_cancel_helper, NULL );
 }
 
 static void
 impl_gtkhtml_copy_to_clipboard( GncHtml* self )
 {
-	GncHtmlGtkhtmlPrivate* priv;
+    GncHtmlGtkhtmlPrivate* priv;
 
-	g_return_if_fail( self != NULL );
+    g_return_if_fail( self != NULL );
 
-	priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
-	gtk_html_copy( GTK_HTML(priv->html) );
+    priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    gtk_html_copy( GTK_HTML(priv->html) );
 }
 
 /**************************************************************
@@ -816,34 +897,36 @@
                    size_t len,
                    gpointer user_data )
 {
-	FILE *fh = (FILE *) user_data;
-	size_t written;
+    FILE *fh = (FILE *) user_data;
+    size_t written;
 
-	do {
-		written = fwrite (data, 1, len, fh);
-		len -= written;
-	} while (len > 0);
-	return TRUE;
+    do
+    {
+        written = fwrite (data, 1, len, fh);
+        len -= written;
+    }
+    while (len > 0);
+    return TRUE;
 }
 
 static gboolean
 impl_gtkhtml_export_to_file( GncHtml* self, const char *filepath )
 {
-	FILE *fh;
-	GncHtmlGtkhtmlPrivate* priv;
+    FILE *fh;
+    GncHtmlGtkhtmlPrivate* priv;
 
-	g_return_val_if_fail( self != NULL, FALSE );
-	g_return_val_if_fail( filepath != NULL, FALSE );
+    g_return_val_if_fail( self != NULL, FALSE );
+    g_return_val_if_fail( filepath != NULL, FALSE );
 
-	priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
-	fh = g_fopen( filepath, "w" );
-	if( fh == 0 )
-		return FALSE;
+    priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    fh = g_fopen( filepath, "w" );
+    if ( fh == 0 )
+        return FALSE;
 
-	gtk_html_save( GTK_HTML(priv->html), GINT_TO_POINTER(raw_html_receiver), fh );
-	fclose (fh);
+    gtk_html_save( GTK_HTML(priv->html), GINT_TO_POINTER(raw_html_receiver), fh );
+    fclose (fh);
 
-	return TRUE;
+    return TRUE;
 }
 
 #ifdef GTKHTML_USES_GTKPRINT
@@ -852,9 +935,9 @@
              gint page_nr, gpointer user_data)
 {
     GncHtmlGtkhtml* self = GNC_HTML_GTKHTML(user_data);
-	GncHtmlGtkhtmlPrivate* priv;
+    GncHtmlGtkhtmlPrivate* priv;
 
-	priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
     gtk_html_print_page( GTK_HTML(priv->html), context );
 }
 
@@ -863,9 +946,9 @@
 {
     GtkPrintOperation *print;
     GtkPrintOperationResult res;
-	GncHtmlGtkhtmlPrivate* priv;
+    GncHtmlGtkhtmlPrivate* priv;
 
-	priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
     print = gtk_print_operation_new();
 
     gnc_print_operation_init(print);
@@ -877,9 +960,10 @@
     res = gtk_print_operation_run(print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
                                   GTK_WINDOW(priv->base.parent), NULL);
 
-    if( res == GTK_PRINT_OPERATION_RESULT_APPLY ) {
+    if ( res == GTK_PRINT_OPERATION_RESULT_APPLY )
+    {
         gnc_print_operation_save_print_settings( print );
-	}
+    }
 
     g_object_unref(print);
 }
@@ -888,47 +972,49 @@
 static void
 impl_gtkhtml_print( GncHtml* self )
 {
-	PrintSession *ps;
-	GncHtmlGtkhtmlPrivate* priv;
+    PrintSession *ps;
+    GncHtmlGtkhtmlPrivate* priv;
 
-	priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
-	ps = gnc_print_session_create( FALSE );
-	if( ps == NULL ) {
-		/* user cancelled */
-		return;
-	}
+    priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    ps = gnc_print_session_create( FALSE );
+    if ( ps == NULL )
+    {
+        /* user cancelled */
+        return;
+    }
 
-	gtk_html_print( GTK_HTML(priv->html), ps->context );
-	gnc_print_session_done( ps );
+    gtk_html_print( GTK_HTML(priv->html), ps->context );
+    gnc_print_session_done( ps );
 }
 #endif /* GTKHTML_USES_GTKPRINT */
 
 static void
 impl_gtkhtml_set_parent( GncHtml* self, GtkWindow* parent )
 {
-	GncHtmlGtkhtmlPrivate* priv;
+    GncHtmlGtkhtmlPrivate* priv;
 
-	g_return_if_fail( self != NULL );
+    g_return_if_fail( self != NULL );
 
-	priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
-	priv->base.parent = GTK_WIDGET(parent);
+    priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
+    priv->base.parent = GTK_WIDGET(parent);
 }
 
 const gchar*
 gnc_html_get_embedded_param( gpointer eb, const gchar* param_name )
 {
-	GtkHTMLEmbedded* gtk_eb = (GtkHTMLEmbedded*)eb;
+    GtkHTMLEmbedded* gtk_eb = (GtkHTMLEmbedded*)eb;
 
-	return (const gchar *)g_hash_table_lookup(gtk_eb->params, param_name);
+    return (const gchar *)g_hash_table_lookup(gtk_eb->params, param_name);
 }
 
 static void
 gtkhtml_pre_3_10_1_bug_workaround(GtkHTMLEmbedded *eb)
 {
-	/* HACK ALERT! Compensate for bug in gtkhtml < 3.10.1
-		Gtkhtml set the width parameter twice (=width, =height), so both,
-		width (==height) and height (<1) were incorrect. */
-	if( eb->height < 1 ) {
-		eb->height = eb->width;  /* only squares here :( */
-	}
+    /* HACK ALERT! Compensate for bug in gtkhtml < 3.10.1
+    	Gtkhtml set the width parameter twice (=width, =height), so both,
+    	width (==height) and height (<1) were incorrect. */
+    if ( eb->height < 1 )
+    {
+        eb->height = eb->width;  /* only squares here :( */
+    }
 }

Modified: gnucash/trunk/src/html/gnc-html-gtkhtml.h
===================================================================
--- gnucash/trunk/src/html/gnc-html-gtkhtml.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-gtkhtml.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -39,15 +39,17 @@
 typedef struct _GncHtmlGtkhtmlClass GncHtmlGtkhtmlClass;
 typedef struct _GncHtmlGtkhtmlPrivate GncHtmlGtkhtmlPrivate;
 
-struct _GncHtmlGtkhtml {
-	GncHtml parent_instance;
+struct _GncHtmlGtkhtml
+{
+    GncHtml parent_instance;
 
-	/*< private >*/
-	GncHtmlGtkhtmlPrivate* priv;
+    /*< private >*/
+    GncHtmlGtkhtmlPrivate* priv;
 };
 
-struct _GncHtmlGtkhtmlClass {
-	GncHtmlClass parent_class;
+struct _GncHtmlGtkhtmlClass
+{
+    GncHtmlClass parent_class;
 };
 
 GType gnc_html_gtkhtml_get_type( void );

Modified: gnucash/trunk/src/html/gnc-html-history.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-history.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-history.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
 /********************************************************************
- * gnc-html-history.c -- keep a HTML history                        * 
+ * gnc-html-history.c -- keep a HTML history                        *
  * Copyright (C) 2000 Bill Gribble <grib at billgribble.com>           *
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *
@@ -27,27 +27,29 @@
 
 #include "gnc-html-history.h"
 
-struct _gnc_html_history {
-  GList * nodes;
-  GList * current_node; 
-  GList * last_node;
+struct _gnc_html_history
+{
+    GList * nodes;
+    GList * current_node;
+    GList * last_node;
 
-  /* call this whenever a node is destroyed */
-  gnc_html_history_destroy_cb destroy_cb;
-  gpointer                    destroy_cb_data;
+    /* call this whenever a node is destroyed */
+    gnc_html_history_destroy_cb destroy_cb;
+    gpointer                    destroy_cb_data;
 };
 
 /********************************************************************
  * gnc_html_history_new
  ********************************************************************/
 
-gnc_html_history * 
-gnc_html_history_new(void) {
-  gnc_html_history * hist = g_new0(gnc_html_history, 1);
-  hist->nodes         = NULL;
-  hist->current_node  = NULL;
-  hist->last_node     = NULL;
-  return hist;
+gnc_html_history *
+gnc_html_history_new(void)
+{
+    gnc_html_history * hist = g_new0(gnc_html_history, 1);
+    hist->nodes         = NULL;
+    hist->current_node  = NULL;
+    hist->last_node     = NULL;
+    return hist;
 }
 
 
@@ -57,22 +59,25 @@
  ********************************************************************/
 
 void
-gnc_html_history_destroy(gnc_html_history * hist) {
-  GList * n;
+gnc_html_history_destroy(gnc_html_history * hist)
+{
+    GList * n;
 
-  for(n = hist->nodes; n ; n=n->next) {
-    if(hist->destroy_cb) {
-      (hist->destroy_cb)((gnc_html_history_node *)n->data,
-                         hist->destroy_cb_data);
+    for (n = hist->nodes; n ; n = n->next)
+    {
+        if (hist->destroy_cb)
+        {
+            (hist->destroy_cb)((gnc_html_history_node *)n->data,
+                               hist->destroy_cb_data);
+        }
+        gnc_html_history_node_destroy((gnc_html_history_node *)n->data);
     }
-    gnc_html_history_node_destroy((gnc_html_history_node *)n->data);
-  }
-  g_list_free(hist->nodes);
+    g_list_free(hist->nodes);
 
-  hist->nodes         = NULL;
-  hist->current_node  = NULL;
-  hist->last_node     = NULL;
-  g_free(hist);
+    hist->nodes         = NULL;
+    hist->current_node  = NULL;
+    hist->last_node     = NULL;
+    g_free(hist);
 }
 
 /********************************************************************
@@ -80,85 +85,100 @@
  ********************************************************************/
 
 void
-gnc_html_history_set_node_destroy_cb(gnc_html_history * hist, 
+gnc_html_history_set_node_destroy_cb(gnc_html_history * hist,
                                      gnc_html_history_destroy_cb cb,
-                                     gpointer cb_data) {
-  hist->destroy_cb = cb;
-  hist->destroy_cb_data = cb_data;
+                                     gpointer cb_data)
+{
+    hist->destroy_cb = cb;
+    hist->destroy_cb_data = cb_data;
 }
 
-static int 
-g_strcmp(char * a, char * b) {
-  if(!a && b) {
-    return 1;
-  }
-  else if(a && !b) {
-    return -1;
-  }
-  else if(!a && !b) {
-    return 0;
-  }
-  else {
-    return strcmp(a, b);
-  }
-  
+static int
+g_strcmp(char * a, char * b)
+{
+    if (!a && b)
+    {
+        return 1;
+    }
+    else if (a && !b)
+    {
+        return -1;
+    }
+    else if (!a && !b)
+    {
+        return 0;
+    }
+    else
+    {
+        return strcmp(a, b);
+    }
+
 }
 
 
 /********************************************************************
  * gnc_html_history_append
  ********************************************************************/
-void 
-gnc_html_history_append(gnc_html_history * hist, 
-                        gnc_html_history_node * node) {
-  GList * n;
-  gnc_html_history_node * hn;
-  
-  if(hist->current_node) {
-    hn = hist->current_node->data;    
-    if((hn->type == node->type) &&
-       !g_strcmp(hn->location, node->location) &&
-       !g_strcmp(hn->label, node->label)) {      
-      if(hist->destroy_cb) {
-        (hist->destroy_cb)(hn, hist->destroy_cb_data);
-      }
-      gnc_html_history_node_destroy(node);
-      return;
+void
+gnc_html_history_append(gnc_html_history * hist,
+                        gnc_html_history_node * node)
+{
+    GList * n;
+    gnc_html_history_node * hn;
+
+    if (hist->current_node)
+    {
+        hn = hist->current_node->data;
+        if ((hn->type == node->type) &&
+                !g_strcmp(hn->location, node->location) &&
+                !g_strcmp(hn->label, node->label))
+        {
+            if (hist->destroy_cb)
+            {
+                (hist->destroy_cb)(hn, hist->destroy_cb_data);
+            }
+            gnc_html_history_node_destroy(node);
+            return;
+        }
+
+        /* blow away the history after this point, if there is one */
+        for (n = hist->current_node->next; n; n = n->next)
+        {
+            if (hist->destroy_cb)
+            {
+                (hist->destroy_cb)((gnc_html_history_node *)n->data,
+                                   hist->destroy_cb_data);
+            }
+            gnc_html_history_node_destroy((gnc_html_history_node *)n->data);
+        }
+        g_list_free(hist->current_node->next);
+        hist->current_node->next = NULL;
+        hist->last_node = hist->current_node;
     }
-    
-    /* blow away the history after this point, if there is one */
-    for(n=hist->current_node->next; n; n=n->next) {
-      if(hist->destroy_cb) {
-        (hist->destroy_cb)((gnc_html_history_node *)n->data,
-                           hist->destroy_cb_data);
-      }
-      gnc_html_history_node_destroy((gnc_html_history_node *)n->data); 
-    }
-    g_list_free(hist->current_node->next);
-    hist->current_node->next = NULL;
-    hist->last_node = hist->current_node;
-  }
-  
-  n = g_list_alloc();
-  n->data = (gpointer) node;
-  n->next = NULL;
-  n->prev = NULL;
 
-  if(hist->nodes && hist->last_node) {
-    n->prev               = hist->last_node;  /* back pointer */ 
-    hist->last_node->next = n;                /* add n to the list */ 
-    hist->last_node       = n;                /* n is last */ 
-    hist->current_node    = n;
-  }
-  else {
-    /* this is the first entry in the list */
-    if(hist->nodes) {
-      g_print ("???? hist->nodes non-NULL, but no last_node \n");
+    n = g_list_alloc();
+    n->data = (gpointer) node;
+    n->next = NULL;
+    n->prev = NULL;
+
+    if (hist->nodes && hist->last_node)
+    {
+        n->prev               = hist->last_node;  /* back pointer */
+        hist->last_node->next = n;                /* add n to the list */
+        hist->last_node       = n;                /* n is last */
+        hist->current_node    = n;
     }
-    hist->nodes        = n;
-    hist->last_node    = n;
-    hist->current_node = n;
-  }  
+    else
+    {
+        /* this is the first entry in the list */
+        if (hist->nodes)
+        {
+            g_print ("???? hist->nodes non-NULL, but no last_node \n");
+        }
+        hist->nodes        = n;
+        hist->last_node    = n;
+        hist->current_node = n;
+    }
 }
 
 
@@ -166,11 +186,12 @@
  * gnc_html_history_get_current
  ********************************************************************/
 
-gnc_html_history_node * 
-gnc_html_history_get_current(gnc_html_history * hist) {
-  if(!hist || !(hist->current_node)) return NULL;
+gnc_html_history_node *
+gnc_html_history_get_current(gnc_html_history * hist)
+{
+    if (!hist || !(hist->current_node)) return NULL;
 
-  return hist->current_node->data;
+    return hist->current_node->data;
 }
 
 
@@ -179,16 +200,19 @@
  ********************************************************************/
 
 gnc_html_history_node *
-gnc_html_history_forward(gnc_html_history * hist) {
-  if(!hist || !(hist->current_node)) {
-    return NULL;
-  }
-  
-  if(hist->current_node->next) {
-    hist->current_node = hist->current_node->next;
-  }
+gnc_html_history_forward(gnc_html_history * hist)
+{
+    if (!hist || !(hist->current_node))
+    {
+        return NULL;
+    }
 
-  return hist->current_node->data;
+    if (hist->current_node->next)
+    {
+        hist->current_node = hist->current_node->next;
+    }
+
+    return hist->current_node->data;
 }
 
 
@@ -197,17 +221,20 @@
  ********************************************************************/
 
 gnc_html_history_node *
-gnc_html_history_back(gnc_html_history * hist) {
+gnc_html_history_back(gnc_html_history * hist)
+{
 
-  if(!hist || !(hist->current_node)) {
-    return NULL;
-  }
-  
-  if(hist->current_node->prev) {
-    hist->current_node = hist->current_node->prev;
-  }
-  
-  return hist->current_node->data;
+    if (!hist || !(hist->current_node))
+    {
+        return NULL;
+    }
+
+    if (hist->current_node->prev)
+    {
+        hist->current_node = hist->current_node->prev;
+    }
+
+    return hist->current_node->data;
 }
 
 
@@ -217,13 +244,16 @@
  ********************************************************************/
 
 int
-gnc_html_history_back_p(gnc_html_history * hist) {
-  if(hist && hist->current_node && hist->current_node->prev) {
-    return TRUE;
-  }
-  else {
-    return FALSE;
-  }
+gnc_html_history_back_p(gnc_html_history * hist)
+{
+    if (hist && hist->current_node && hist->current_node->prev)
+    {
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 
 
@@ -233,13 +263,16 @@
  ********************************************************************/
 
 int
-gnc_html_history_forward_p(gnc_html_history * hist) {
-  if(hist && hist->current_node && hist->current_node->next) {
-    return TRUE;
-  }
-  else {
-    return FALSE;
-  }
+gnc_html_history_forward_p(gnc_html_history * hist)
+{
+    if (hist && hist->current_node && hist->current_node->next)
+    {
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 
 
@@ -248,14 +281,15 @@
  ********************************************************************/
 
 gnc_html_history_node *
-gnc_html_history_node_new(URLType type, const gchar * location, 
-                          const gchar * label) {
-  gnc_html_history_node * rv = g_new0(gnc_html_history_node, 1);
-  
-  rv->type      = type;
-  rv->location  = g_strdup(location);
-  rv->label     = g_strdup(label);
-  return rv;
+gnc_html_history_node_new(URLType type, const gchar * location,
+                          const gchar * label)
+{
+    gnc_html_history_node * rv = g_new0(gnc_html_history_node, 1);
+
+    rv->type      = type;
+    rv->location  = g_strdup(location);
+    rv->label     = g_strdup(label);
+    return rv;
 }
 
 
@@ -264,14 +298,15 @@
  ********************************************************************/
 
 void
-gnc_html_history_node_destroy(gnc_html_history_node * node) {
-  
-  /* free the url resources and cached text */
-  g_free(node->location);
-  g_free(node->label);
+gnc_html_history_node_destroy(gnc_html_history_node * node)
+{
 
-  node->location = NULL;
-  node->label    = NULL; 
+    /* free the url resources and cached text */
+    g_free(node->location);
+    g_free(node->label);
 
-  g_free(node);
+    node->location = NULL;
+    node->label    = NULL;
+
+    g_free(node);
 }

Modified: gnucash/trunk/src/html/gnc-html-history.h
===================================================================
--- gnucash/trunk/src/html/gnc-html-history.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-history.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
 /********************************************************************
- * gnc-html-history.h -- keep a HTML history                        * 
+ * gnc-html-history.h -- keep a HTML history                        *
  * Copyright (C) 2000 Bill Gribble <grib at billgribble.com>           *
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *
@@ -28,35 +28,36 @@
 
 #include "gnc-html.h"
 
-struct _gnc_html_history_node {
-  URLType type;
-  gchar   * location;
-  gchar   * label;  
+struct _gnc_html_history_node
+{
+    URLType type;
+    gchar   * location;
+    gchar   * label;
 };
 
 typedef void (* gnc_html_history_destroy_cb)(gnc_html_history_node * n,
-                                             gpointer user_data);
+        gpointer user_data);
 
 gnc_html_history      * gnc_html_history_new(void);
 void                    gnc_html_history_destroy(gnc_html_history * hist);
 
 void                    gnc_html_history_append(gnc_html_history * h,
-                                                gnc_html_history_node * n);
+        gnc_html_history_node * n);
 gnc_html_history_node * gnc_html_history_get_current(gnc_html_history * h);
 gnc_html_history_node * gnc_html_history_forward(gnc_html_history * h);
 gnc_html_history_node * gnc_html_history_back(gnc_html_history * h);
 int                     gnc_html_history_forward_p(gnc_html_history * h);
 int                     gnc_html_history_back_p(gnc_html_history * h);
 void  gnc_html_history_set_node_destroy_cb(gnc_html_history * h,
-                                           gnc_html_history_destroy_cb cb,
-                                           gpointer cb_data);
+        gnc_html_history_destroy_cb cb,
+        gpointer cb_data);
 
 gnc_html_history_node * gnc_html_history_node_new(URLType type,
-                                                  const gchar * location, 
-                                                  const gchar * label);
+        const gchar * location,
+        const gchar * label);
 
-void                    gnc_html_history_node_destroy(gnc_html_history_node * 
-                                                      node);
+void                    gnc_html_history_node_destroy(gnc_html_history_node *
+        node);
 
 
 #endif

Modified: gnucash/trunk/src/html/gnc-html-p.h
===================================================================
--- gnucash/trunk/src/html/gnc-html-p.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-p.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -23,27 +23,28 @@
 #ifndef GNC_HTML_P_H
 #define GNC_HTML_P_H
 
-struct _GncHtmlPrivate {
-	GtkWidget* parent;				/* window this html goes into */
-	GtkWidget* container;			/* parent of the gtkhtml widget */
-	gchar* current_link;			/* link under mouse pointer */
+struct _GncHtmlPrivate
+{
+    GtkWidget* parent;				/* window this html goes into */
+    GtkWidget* container;			/* parent of the gtkhtml widget */
+    gchar* current_link;			/* link under mouse pointer */
 
-	URLType base_type;				/* base of URL (path - filename) */
-	gchar* base_location;
+    URLType base_type;				/* base of URL (path - filename) */
+    gchar* base_location;
 
-	GHashTable* request_info;		/* hash uri to GList of GtkHTMLStream * */
+    GHashTable* request_info;		/* hash uri to GList of GtkHTMLStream * */
 
-	/* callbacks */
-	GncHTMLUrltypeCB urltype_cb;	/* is this type OK for this instance? */
-	GncHTMLLoadCB load_cb;
-	GncHTMLFlyoverCB flyover_cb;
-	GncHTMLButtonCB button_cb;
+    /* callbacks */
+    GncHTMLUrltypeCB urltype_cb;	/* is this type OK for this instance? */
+    GncHTMLLoadCB load_cb;
+    GncHTMLFlyoverCB flyover_cb;
+    GncHTMLButtonCB button_cb;
 
-	gpointer flyover_cb_data;
-	gpointer load_cb_data;
-	gpointer button_cb_data;
+    gpointer flyover_cb_data;
+    gpointer load_cb_data;
+    gpointer button_cb_data;
 
-	gnc_html_history * history;
+    gnc_html_history * history;
 };
 
 #endif

Modified: gnucash/trunk/src/html/gnc-html-webkit-p.h
===================================================================
--- gnucash/trunk/src/html/gnc-html-webkit-p.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-webkit-p.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -25,11 +25,12 @@
 
 #include "gnc-html-p.h"
 
-struct _GncHtmlWebkitPrivate {
-	struct _GncHtmlPrivate base;
+struct _GncHtmlWebkitPrivate
+{
+    struct _GncHtmlPrivate base;
 
-	WebKitWebView* web_view;				/* webkit widget itself */
-	gchar* html_string;						/* html string being displayed */
+    WebKitWebView* web_view;				/* webkit widget itself */
+    gchar* html_string;						/* html string being displayed */
 };
 
 #endif

Modified: gnucash/trunk/src/html/gnc-html-webkit.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-webkit.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-webkit.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -80,24 +80,24 @@
 static char error_404_body[] = N_("The specified URL could not be loaded.");
 
 static WebKitNavigationResponse webkit_navigation_requested_cb(
-								WebKitWebView* web_view,
-								WebKitWebFrame* frame,
-								WebKitNetworkRequest* request,
-								gpointer user_data );
+    WebKitWebView* web_view,
+    WebKitWebFrame* frame,
+    WebKitNetworkRequest* request,
+    gpointer user_data );
 static void webkit_on_url_cb( WebKitWebView* web_view, gchar* title, gchar* url,
-							gpointer data );
+                              gpointer data );
 static gchar* handle_embedded_object( GncHtmlWebkit* self, gchar* html_str );
 #if 0
 static void gnc_html_set_base_cb( GtkHTML* gtkhtml, const gchar* base, gpointer data );
 static void gnc_html_link_clicked_cb( GtkHTML* html, const gchar* url, gpointer data );
 static gboolean gnc_html_object_requested_cb( GtkHTML* html, GtkHTMLEmbedded* eb,
-                             gpointer data );
+        gpointer data );
 #endif
 static int gnc_html_button_press_cb( GtkWidget* widg, GdkEventButton* event,
-                         gpointer user_data );
+                                     gpointer user_data );
 static void impl_webkit_show_url( GncHtml* self, URLType type,
-                  const gchar* location, const gchar* label,
-                  gboolean new_window_hint );
+                                  const gchar* location, const gchar* label,
+                                  gboolean new_window_hint );
 static void impl_webkit_show_data( GncHtml* self, const gchar* data, int datalen );
 static void impl_webkit_reload( GncHtml* self );
 static void impl_webkit_copy_to_clipboard( GncHtml* self );
@@ -109,108 +109,109 @@
 static void
 gnc_html_webkit_init( GncHtmlWebkit* self )
 {
-	GncHtmlWebkitPrivate* priv;
-	GncHtmlWebkitPrivate* new_priv;
+    GncHtmlWebkitPrivate* priv;
+    GncHtmlWebkitPrivate* new_priv;
 
-	new_priv = g_realloc( GNC_HTML(self)->priv, sizeof(GncHtmlWebkitPrivate) );
-	priv = self->priv = new_priv;
-	GNC_HTML(self)->priv = (GncHtmlPrivate*)priv;
+    new_priv = g_realloc( GNC_HTML(self)->priv, sizeof(GncHtmlWebkitPrivate) );
+    priv = self->priv = new_priv;
+    GNC_HTML(self)->priv = (GncHtmlPrivate*)priv;
 
-	priv->html_string = NULL;
-	priv->web_view = WEBKIT_WEB_VIEW(webkit_web_view_new());
+    priv->html_string = NULL;
+    priv->web_view = WEBKIT_WEB_VIEW(webkit_web_view_new());
 
-	gtk_container_add( GTK_CONTAINER(priv->base.container),
-						GTK_WIDGET(priv->web_view) );
+    gtk_container_add( GTK_CONTAINER(priv->base.container),
+                       GTK_WIDGET(priv->web_view) );
 
 #ifdef HAVE_GTK_2_10
-	g_object_ref_sink( priv->base.container );
+    g_object_ref_sink( priv->base.container );
 #else
-	g_object_ref( priv->base.container );
-	gtk_object_sink( GTK_OBJECT(priv->base.container) );
+    g_object_ref( priv->base.container );
+    gtk_object_sink( GTK_OBJECT(priv->base.container) );
 #endif
 
-	/* signals */
-	g_signal_connect( priv->web_view, "navigation-requested",
-					G_CALLBACK(webkit_navigation_requested_cb),
-					self);
+    /* signals */
+    g_signal_connect( priv->web_view, "navigation-requested",
+                      G_CALLBACK(webkit_navigation_requested_cb),
+                      self);
 
-	g_signal_connect( priv->web_view, "hovering-over-link",
-				   G_CALLBACK(webkit_on_url_cb),
-				   self );
+    g_signal_connect( priv->web_view, "hovering-over-link",
+                      G_CALLBACK(webkit_on_url_cb),
+                      self );
 
 #if 0
-	g_signal_connect( priv->html, "set_base",
-		   G_CALLBACK(gnc_html_set_base_cb),
-		   self);
+    g_signal_connect( priv->html, "set_base",
+                      G_CALLBACK(gnc_html_set_base_cb),
+                      self);
 
-	g_signal_connect(priv->html, "link_clicked",
-		   G_CALLBACK(gnc_html_link_clicked_cb),
-		   self);
+    g_signal_connect(priv->html, "link_clicked",
+                     G_CALLBACK(gnc_html_link_clicked_cb),
+                     self);
 
-	g_signal_connect (priv->html, "object_requested",
-		    G_CALLBACK (gnc_html_object_requested_cb),
-		    self);
+    g_signal_connect (priv->html, "object_requested",
+                      G_CALLBACK (gnc_html_object_requested_cb),
+                      self);
 
-	g_signal_connect (priv->html, "button_press_event",
-		    G_CALLBACK (gnc_html_button_press_cb),
-		    self);
+    g_signal_connect (priv->html, "button_press_event",
+                      G_CALLBACK (gnc_html_button_press_cb),
+                      self);
 
-	g_signal_connect (priv->html, "submit",
-		    G_CALLBACK(gnc_html_submit_cb),
-		    self);
+    g_signal_connect (priv->html, "submit",
+                      G_CALLBACK(gnc_html_submit_cb),
+                      self);
 #endif
 
-	LEAVE("retval %p", self);
+    LEAVE("retval %p", self);
 }
 
 static void
 gnc_html_webkit_class_init( GncHtmlWebkitClass* klass )
 {
-	GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
-	GncHtmlClass* html_class = GNC_HTML_CLASS(klass);
+    GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
+    GncHtmlClass* html_class = GNC_HTML_CLASS(klass);
 
-	gobject_class->dispose = gnc_html_webkit_dispose;
-	gobject_class->finalize = gnc_html_webkit_finalize;
+    gobject_class->dispose = gnc_html_webkit_dispose;
+    gobject_class->finalize = gnc_html_webkit_finalize;
 
-	html_class->show_url = impl_webkit_show_url;
-	html_class->show_data = impl_webkit_show_data;
-	html_class->reload = impl_webkit_reload;
-	html_class->copy_to_clipboard = impl_webkit_copy_to_clipboard;
-	html_class->export_to_file = impl_webkit_export_to_file;
-	html_class->print = impl_webkit_print;
-	html_class->cancel = impl_webkit_cancel;
-	html_class->set_parent = impl_webkit_set_parent;
+    html_class->show_url = impl_webkit_show_url;
+    html_class->show_data = impl_webkit_show_data;
+    html_class->reload = impl_webkit_reload;
+    html_class->copy_to_clipboard = impl_webkit_copy_to_clipboard;
+    html_class->export_to_file = impl_webkit_export_to_file;
+    html_class->print = impl_webkit_print;
+    html_class->cancel = impl_webkit_cancel;
+    html_class->set_parent = impl_webkit_set_parent;
 
-	// Initialize graphing support
-	gnc_html_graph_gog_webkit_init();
+    // Initialize graphing support
+    gnc_html_graph_gog_webkit_init();
 }
 
 static void
 gnc_html_webkit_dispose( GObject* obj )
 {
-	GncHtmlWebkit* self = GNC_HTML_WEBKIT(obj);
-	GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    GncHtmlWebkit* self = GNC_HTML_WEBKIT(obj);
+    GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
 
-	if( priv->web_view != NULL ) {
-		gtk_container_remove( GTK_CONTAINER(priv->base.container),
-						GTK_WIDGET(priv->web_view) );
-		priv->web_view = NULL;
-	}
+    if ( priv->web_view != NULL )
+    {
+        gtk_container_remove( GTK_CONTAINER(priv->base.container),
+                              GTK_WIDGET(priv->web_view) );
+        priv->web_view = NULL;
+    }
 
-	G_OBJECT_CLASS(gnc_html_webkit_parent_class)->dispose( obj );
+    G_OBJECT_CLASS(gnc_html_webkit_parent_class)->dispose( obj );
 }
 
 static void
 gnc_html_webkit_finalize( GObject* obj )
 {
-	GncHtmlWebkit* self = GNC_HTML_WEBKIT(obj);
+    GncHtmlWebkit* self = GNC_HTML_WEBKIT(obj);
 
 //	if( self->priv != NULL ) {
 //		g_free( self->priv );
-		self->priv = NULL;
+    self->priv = NULL;
 //	}
 
-	G_OBJECT_CLASS(gnc_html_webkit_parent_class)->finalize( obj );
+    G_OBJECT_CLASS(gnc_html_webkit_parent_class)->finalize( obj );
 }
 
 /*****************************************************************************/
@@ -218,134 +219,159 @@
 static char*
 extract_base_name(URLType type, const gchar* path)
 {
-	gchar       machine_rexp[] = "^(//[^/]*)/*(/.*)?$";
-	gchar       path_rexp[] = "^/*(.*)/+([^/]*)$";
-	regex_t    compiled_m, compiled_p;
-	regmatch_t match[4];
-	gchar       * machine=NULL, * location = NULL, * base=NULL;
-	gchar       * basename=NULL;
+    gchar       machine_rexp[] = "^(//[^/]*)/*(/.*)?$";
+    gchar       path_rexp[] = "^/*(.*)/+([^/]*)$";
+    regex_t    compiled_m, compiled_p;
+    regmatch_t match[4];
+    gchar       * machine = NULL, * location = NULL, * base = NULL;
+    gchar       * basename = NULL;
 
-	DEBUG(" ");
-	if(!path) return NULL;
+    DEBUG(" ");
+    if (!path) return NULL;
 
-	regcomp(&compiled_m, machine_rexp, REG_EXTENDED);
-	regcomp(&compiled_p, path_rexp, REG_EXTENDED);
+    regcomp(&compiled_m, machine_rexp, REG_EXTENDED);
+    regcomp(&compiled_p, path_rexp, REG_EXTENDED);
 
-	if (!safe_strcmp (type, URL_TYPE_HTTP) ||
-			!safe_strcmp (type, URL_TYPE_SECURE) ||
-			!safe_strcmp (type, URL_TYPE_FTP)) {
+    if (!safe_strcmp (type, URL_TYPE_HTTP) ||
+            !safe_strcmp (type, URL_TYPE_SECURE) ||
+            !safe_strcmp (type, URL_TYPE_FTP))
+    {
 
-		/* step 1: split the machine name away from the path
-		 * components */
-		if(!regexec(&compiled_m, path, 4, match, 0)) {
-			/* $1 is the machine name */
-			if(match[1].rm_so != -1) {
-				machine = g_strndup(path+match[1].rm_so,
-                            match[1].rm_eo - match[1].rm_so);
-			}
-			/* $2 is the path */
-			if(match[2].rm_so != -1) {
-				location = g_strndup(path+match[2].rm_so,
-                             match[2].rm_eo - match[2].rm_so);
-			}
-		}
+        /* step 1: split the machine name away from the path
+         * components */
+        if (!regexec(&compiled_m, path, 4, match, 0))
+        {
+            /* $1 is the machine name */
+            if (match[1].rm_so != -1)
+            {
+                machine = g_strndup(path + match[1].rm_so,
+                                    match[1].rm_eo - match[1].rm_so);
+            }
+            /* $2 is the path */
+            if (match[2].rm_so != -1)
+            {
+                location = g_strndup(path + match[2].rm_so,
+                                     match[2].rm_eo - match[2].rm_so);
+            }
+        }
 
-	} else {
-		location = g_strdup(path);
-	}
-	/* step 2: split up the path into prefix and file components */
-	if(location) {
-		if(!regexec(&compiled_p, location, 4, match, 0)) {
-			if(match[1].rm_so != -1) {
-				base = g_strndup(location+match[1].rm_so,
-                         match[1].rm_eo - match[1].rm_so);
-			} else {
-				base = NULL;
-			}
-		}
-	}
+    }
+    else
+    {
+        location = g_strdup(path);
+    }
+    /* step 2: split up the path into prefix and file components */
+    if (location)
+    {
+        if (!regexec(&compiled_p, location, 4, match, 0))
+        {
+            if (match[1].rm_so != -1)
+            {
+                base = g_strndup(location + match[1].rm_so,
+                                 match[1].rm_eo - match[1].rm_so);
+            }
+            else
+            {
+                base = NULL;
+            }
+        }
+    }
 
-	regfree(&compiled_m);
-	regfree(&compiled_p);
+    regfree(&compiled_m);
+    regfree(&compiled_p);
 
-	if(machine) {
-		if(base && (strlen(base) > 0)) {
-			basename = g_strconcat(machine, "/", base, "/", NULL);
-		} else {
-			basename = g_strconcat(machine, "/", NULL);
-		}
-	} else {
-		if(base && (strlen(base) > 0)) {
-			basename = g_strdup(base);
-		} else {
-			basename = NULL;
-		}
-	}
+    if (machine)
+    {
+        if (base && (strlen(base) > 0))
+        {
+            basename = g_strconcat(machine, "/", base, "/", NULL);
+        }
+        else
+        {
+            basename = g_strconcat(machine, "/", NULL);
+        }
+    }
+    else
+    {
+        if (base && (strlen(base) > 0))
+        {
+            basename = g_strdup(base);
+        }
+        else
+        {
+            basename = NULL;
+        }
+    }
 
-	g_free(machine);
-	g_free(base);
-	g_free(location);
-	return basename;
+    g_free(machine);
+    g_free(base);
+    g_free(location);
+    return basename;
 }
 
 static gboolean
 http_allowed()
 {
-	return TRUE;
+    return TRUE;
 }
 
 static gboolean
 https_allowed()
 {
-	return TRUE;
+    return TRUE;
 }
 
 static gchar*
 handle_embedded_object( GncHtmlWebkit* self, gchar* html_str )
 {
-	// Find the <object> tag and get the classid from it.  This will provide the correct
-	// object callback handler.  Pass the <object> entity text to the handler.  What should
-	// come back is embedded image information.
-	gchar* object_tag;
-	gchar* end_object_tag;
-	gchar* object_contents;
-	gchar* html_str_start;
-	gchar* html_str_middle;
-	gchar* html_str_result;
-	gchar* classid;
-	gchar* classid_end;
-	gchar* object_classid;
-	GncHTMLObjectCB h;
+    // Find the <object> tag and get the classid from it.  This will provide the correct
+    // object callback handler.  Pass the <object> entity text to the handler.  What should
+    // come back is embedded image information.
+    gchar* object_tag;
+    gchar* end_object_tag;
+    gchar* object_contents;
+    gchar* html_str_start;
+    gchar* html_str_middle;
+    gchar* html_str_result;
+    gchar* classid;
+    gchar* classid_end;
+    gchar* object_classid;
+    GncHTMLObjectCB h;
 
-	object_tag = g_strstr_len( html_str, -1, "<object classid=" );
-	if( object_tag == NULL ) {
-		//  Hmmm... no object tag
-		return html_str;
-	}
-	classid = object_tag+strlen( "<object classid=" )+1;
-	classid_end = g_strstr_len( classid, -1, "\"" );
-	object_classid = g_strndup( classid, (classid_end-classid) );
-	end_object_tag = g_strstr_len( object_tag, -1, "</object>" );
-	if( end_object_tag == NULL ) {
-		//  Hmmm... no object end tag
-		return html_str;
-	}
-	end_object_tag += strlen( "</object>" );
-	object_contents = g_strndup( object_tag, (end_object_tag-object_tag) );
+    object_tag = g_strstr_len( html_str, -1, "<object classid=" );
+    if ( object_tag == NULL )
+    {
+        //  Hmmm... no object tag
+        return html_str;
+    }
+    classid = object_tag + strlen( "<object classid=" ) + 1;
+    classid_end = g_strstr_len( classid, -1, "\"" );
+    object_classid = g_strndup( classid, (classid_end - classid) );
+    end_object_tag = g_strstr_len( object_tag, -1, "</object>" );
+    if ( end_object_tag == NULL )
+    {
+        //  Hmmm... no object end tag
+        return html_str;
+    }
+    end_object_tag += strlen( "</object>" );
+    object_contents = g_strndup( object_tag, (end_object_tag - object_tag) );
 
-	h = g_hash_table_lookup( gnc_html_object_handlers, object_classid );
-	if( h != NULL ) {
-		(void)h( GNC_HTML(self), object_contents, &html_str_middle );
-	} else {
-		html_str_middle = g_strdup_printf( "No handler found for classid \"%s\"", object_classid );
-	}
+    h = g_hash_table_lookup( gnc_html_object_handlers, object_classid );
+    if ( h != NULL )
+    {
+        (void)h( GNC_HTML(self), object_contents, &html_str_middle );
+    }
+    else
+    {
+        html_str_middle = g_strdup_printf( "No handler found for classid \"%s\"", object_classid );
+    }
 
-	html_str_start = g_strndup( html_str, (object_tag-html_str) );
-	html_str_result = g_strdup_printf( "%s%s%s", html_str_start, html_str_middle, end_object_tag );
-	
-	g_free( html_str_start );
-	g_free( html_str_middle );
-	return html_str_result;
+    html_str_start = g_strndup( html_str, (object_tag - html_str) );
+    html_str_result = g_strdup_printf( "%s%s%s", html_str_start, html_str_middle, end_object_tag );
+
+    g_free( html_str_start );
+    g_free( html_str_middle );
+    return html_str_result;
 }
 
 /********************************************************************
@@ -356,100 +382,119 @@
 
 static void
 load_to_stream( GncHtmlWebkit* self, URLType type,
-				const gchar* location, const gchar* label )
+                const gchar* location, const gchar* label )
 {
-	gchar* fdata = NULL;
-	int fdata_len = 0;
-	GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    gchar* fdata = NULL;
+    int fdata_len = 0;
+    GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
 
-	DEBUG( "type %s, location %s, label %s", type ? type : "(null)",
-			location ? location : "(null)", label ? label : "(null)");
+    DEBUG( "type %s, location %s, label %s", type ? type : "(null)",
+           location ? location : "(null)", label ? label : "(null)");
 
-	g_return_if_fail( self != NULL );
+    g_return_if_fail( self != NULL );
 
-	if( gnc_html_stream_handlers != NULL ) {
-		GncHTMLStreamCB stream_handler;
+    if ( gnc_html_stream_handlers != NULL )
+    {
+        GncHTMLStreamCB stream_handler;
 
-		stream_handler = g_hash_table_lookup( gnc_html_stream_handlers, type );
-		if( stream_handler ) {
-			gboolean ok = stream_handler( location, &fdata, &fdata_len );
+        stream_handler = g_hash_table_lookup( gnc_html_stream_handlers, type );
+        if ( stream_handler )
+        {
+            gboolean ok = stream_handler( location, &fdata, &fdata_len );
 
-			if( ok ) {
-				fdata = fdata ? fdata : g_strdup( "" );
+            if ( ok )
+            {
+                fdata = fdata ? fdata : g_strdup( "" );
 
-				// Until webkitgtk supports download requests, look for "<object classid="
-				// indicating the beginning of an embedded graph.  If found, handle it
-				if( g_strstr_len( fdata, -1, "<object classid=" ) != NULL ) {
-					gchar* new_fdata;
-					new_fdata = handle_embedded_object( self, fdata );
-					g_free( fdata );
-					fdata = new_fdata;
-				}
+                // Until webkitgtk supports download requests, look for "<object classid="
+                // indicating the beginning of an embedded graph.  If found, handle it
+                if ( g_strstr_len( fdata, -1, "<object classid=" ) != NULL )
+                {
+                    gchar* new_fdata;
+                    new_fdata = handle_embedded_object( self, fdata );
+                    g_free( fdata );
+                    fdata = new_fdata;
+                }
 
-				// Save a copy for export purposes
-				if( priv->html_string != NULL ) {
-					g_free( priv->html_string );
-				}
-				priv->html_string = g_strdup( fdata );
-				webkit_web_view_load_html_string( priv->web_view, fdata, "base-uri" );
-			} else {
-				fdata = fdata ? fdata :
-							g_strdup_printf( error_404_format,
-							_(error_404_title), _(error_404_body) );
-				webkit_web_view_load_html_string( priv->web_view, fdata, "base-uri" );
-			}
+                // Save a copy for export purposes
+                if ( priv->html_string != NULL )
+                {
+                    g_free( priv->html_string );
+                }
+                priv->html_string = g_strdup( fdata );
+                webkit_web_view_load_html_string( priv->web_view, fdata, "base-uri" );
+            }
+            else
+            {
+                fdata = fdata ? fdata :
+                        g_strdup_printf( error_404_format,
+                                         _(error_404_title), _(error_404_body) );
+                webkit_web_view_load_html_string( priv->web_view, fdata, "base-uri" );
+            }
 
-			g_free( fdata );
+            g_free( fdata );
 
-			if( label ) {
-				while( gtk_events_pending() ) {
-					gtk_main_iteration();
-				}
+            if ( label )
+            {
+                while ( gtk_events_pending() )
+                {
+                    gtk_main_iteration();
+                }
 //				gtk_html_jump_to_anchor( GTK_HTML(priv->html), label );
-				g_assert( FALSE );
-			}
+                g_assert( FALSE );
+            }
 
-			return;
-		}
-	}
+            return;
+        }
+    }
 
-	do {
-		if( !safe_strcmp( type, URL_TYPE_SECURE ) ||
-			!safe_strcmp( type, URL_TYPE_HTTP ) ) {
+    do
+    {
+        if ( !safe_strcmp( type, URL_TYPE_SECURE ) ||
+                !safe_strcmp( type, URL_TYPE_HTTP ) )
+        {
 
-			if( !safe_strcmp( type, URL_TYPE_SECURE ) ) {
-				if( !https_allowed() ) {
-					gnc_error_dialog( priv->base.parent, "%s",
-                            _("Secure HTTP access is disabled. "
-                              "You can enable it in the Network section of "
-                              "the Preferences dialog."));
-					break;
-				}
-			}
+            if ( !safe_strcmp( type, URL_TYPE_SECURE ) )
+            {
+                if ( !https_allowed() )
+                {
+                    gnc_error_dialog( priv->base.parent, "%s",
+                                      _("Secure HTTP access is disabled. "
+                                        "You can enable it in the Network section of "
+                                        "the Preferences dialog."));
+                    break;
+                }
+            }
 
-			if( !http_allowed() ) {
-				gnc_error_dialog( priv->base.parent,"%s",
-                          _("Network HTTP access is disabled. "
-                            "You can enable it in the Network section of "
-                            "the Preferences dialog."));
-			} else {
-				char *fullurl;
+            if ( !http_allowed() )
+            {
+                gnc_error_dialog( priv->base.parent, "%s",
+                                  _("Network HTTP access is disabled. "
+                                    "You can enable it in the Network section of "
+                                    "the Preferences dialog."));
+            }
+            else
+            {
+                char *fullurl;
 
-				fullurl = gnc_build_url( type, location, label );
-			}
+                fullurl = gnc_build_url( type, location, label );
+            }
 
-		} else {
-			PWARN( "load_to_stream for inappropriate type\n"
-					"\turl = '%s#%s'\n",
-					location ? location : "(null)",
-					label ? label : "(null)" );
-			fdata = g_strdup_printf( error_404_format,
-								_(error_404_title), _(error_404_body) );
-			webkit_web_view_load_html_string( priv->web_view, fdata, "base-uri" );
-			g_free( fdata );
-		}
+        }
+        else
+        {
+            PWARN( "load_to_stream for inappropriate type\n"
+                   "\turl = '%s#%s'\n",
+                   location ? location : "(null)",
+                   label ? label : "(null)" );
+            fdata = g_strdup_printf( error_404_format,
+                                     _(error_404_title), _(error_404_body) );
+            webkit_web_view_load_html_string( priv->web_view, fdata, "base-uri" );
+            g_free( fdata );
+        }
 
-	} while( FALSE );
+    }
+    while ( FALSE );
 }
 
 #if 0
@@ -461,16 +506,16 @@
 static void
 gnc_html_link_clicked_cb( GtkHTML* html, const gchar* url, gpointer data )
 {
-	URLType type;
-	gchar* location = NULL;
-	gchar* label = NULL;
-	GncHtmlWebkit* self = GNC_HTML_WEBKIT(data);
+    URLType type;
+    gchar* location = NULL;
+    gchar* label = NULL;
+    GncHtmlWebkit* self = GNC_HTML_WEBKIT(data);
 
-	DEBUG("Clicked %s", url);
-	type = gnc_html_parse_url( GNC_HTML(self), url, &location, &label );
-	gnc_html_show_url( GNC_HTML(self), type, location, label, 0 );
-	g_free( location );
-	g_free( label );
+    DEBUG("Clicked %s", url);
+    type = gnc_html_parse_url( GNC_HTML(self), url, &location, &label );
+    gnc_html_show_url( GNC_HTML(self), type, location, label, 0 );
+    g_free( location );
+    g_free( label );
 }
 #endif
 
@@ -481,26 +526,27 @@
 
 static WebKitNavigationResponse
 webkit_navigation_requested_cb( WebKitWebView* web_view, WebKitWebFrame* frame,
-								WebKitNetworkRequest* request,
-								gpointer data )
+                                WebKitNetworkRequest* request,
+                                gpointer data )
 {
-	URLType type;
-	gchar* location = NULL;
-	gchar* label = NULL;
-	GncHtmlWebkit* self = GNC_HTML_WEBKIT(data);
-	const gchar* url = webkit_network_request_get_uri( request );
+    URLType type;
+    gchar* location = NULL;
+    gchar* label = NULL;
+    GncHtmlWebkit* self = GNC_HTML_WEBKIT(data);
+    const gchar* url = webkit_network_request_get_uri( request );
 
-	DEBUG( "requesting %s", url );
-    if( strcmp( url, "base-uri" ) == 0 ) {
-	    return WEBKIT_NAVIGATION_RESPONSE_ACCEPT;
-	}
+    DEBUG( "requesting %s", url );
+    if ( strcmp( url, "base-uri" ) == 0 )
+    {
+        return WEBKIT_NAVIGATION_RESPONSE_ACCEPT;
+    }
 
-	type = gnc_html_parse_url( GNC_HTML(self), url, &location, &label );
-	gnc_html_show_url( GNC_HTML(self), type, location, label, 0 );
+    type = gnc_html_parse_url( GNC_HTML(self), url, &location, &label );
+    gnc_html_show_url( GNC_HTML(self), type, location, label, 0 );
 //	load_to_stream( self, type, location, label );
-	g_free( location );
-	g_free( label );
-	return WEBKIT_NAVIGATION_RESPONSE_IGNORE;
+    g_free( location );
+    g_free( label );
+    return WEBKIT_NAVIGATION_RESPONSE_IGNORE;
 }
 
 #if 0
@@ -511,20 +557,23 @@
 
 static gboolean
 gnc_html_object_requested_cb( GtkHTML* html, GtkHTMLEmbedded* eb,
-                             gpointer data )
+                              gpointer data )
 {
-	GncHtmlWebkit* self = GNC_HTML_WEBKIT(data);
-	GncHTMLObjectCB h;
+    GncHtmlWebkit* self = GNC_HTML_WEBKIT(data);
+    GncHTMLObjectCB h;
 
-	DEBUG( " " );
-	if( !eb || !(eb->classid) || !gnc_html_object_handlers ) return FALSE;
+    DEBUG( " " );
+    if ( !eb || !(eb->classid) || !gnc_html_object_handlers ) return FALSE;
 
-	h = g_hash_table_lookup( gnc_html_object_handlers, eb->classid );
-	if( h ) {
-		return h( GNC_HTML(self), eb, data );
-	} else {
-		return FALSE;
-	}
+    h = g_hash_table_lookup( gnc_html_object_handlers, eb->classid );
+    if ( h )
+    {
+        return h( GNC_HTML(self), eb, data );
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 #endif
 
@@ -535,15 +584,16 @@
 static void
 webkit_on_url_cb( WebKitWebView* web_view, gchar* title, gchar* url, gpointer data )
 {
-	GncHtmlWebkit* self = GNC_HTML_WEBKIT(data);
-	GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    GncHtmlWebkit* self = GNC_HTML_WEBKIT(data);
+    GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
 
-	DEBUG( "Rollover %s", url ? url : "(null)" );
-	g_free( priv->base.current_link );
-	priv->base.current_link = g_strdup( url );
-	if( priv->base.flyover_cb ) {
-		(priv->base.flyover_cb)( GNC_HTML(self), url, priv->base.flyover_cb_data );
-	}
+    DEBUG( "Rollover %s", url ? url : "(null)" );
+    g_free( priv->base.current_link );
+    priv->base.current_link = g_strdup( url );
+    if ( priv->base.flyover_cb )
+    {
+        (priv->base.flyover_cb)( GNC_HTML(self), url, priv->base.flyover_cb_data );
+    }
 }
 
 #if 0
@@ -553,22 +603,22 @@
 
 static void
 gnc_html_set_base_cb( GtkHTML* gtkhtml, const gchar* base,
-                     gpointer data )
+                      gpointer data )
 {
-	GncHtmlWebkit* self = GNC_HTML_WEBKIT(data);
-	GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
-	URLType type;
-	gchar* location = NULL;
-	gchar* label = NULL;
+    GncHtmlWebkit* self = GNC_HTML_WEBKIT(data);
+    GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    URLType type;
+    gchar* location = NULL;
+    gchar* label = NULL;
 
-	DEBUG( "Setting base location to %s", base );
-	type = gnc_html_parse_url( GNC_HTML(self), base, &location, &label );
+    DEBUG( "Setting base location to %s", base );
+    type = gnc_html_parse_url( GNC_HTML(self), base, &location, &label );
 
-	g_free( priv->base.base_location );
-	g_free( label );
+    g_free( priv->base.base_location );
+    g_free( label );
 
-	priv->base.base_type = type;
-	priv->base.base_location = location;
+    priv->base.base_type = type;
+    priv->base.base_location = location;
 }
 #endif
 
@@ -579,18 +629,21 @@
 
 static int
 gnc_html_button_press_cb( GtkWidget* widg, GdkEventButton* event,
-                         gpointer user_data )
+                          gpointer user_data )
 {
-	GncHtmlWebkit* self = GNC_HTML_WEBKIT(user_data);
-	GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    GncHtmlWebkit* self = GNC_HTML_WEBKIT(user_data);
+    GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
 
-	DEBUG( "Button Press" );
-	if( priv->base.button_cb != NULL ) {
-		(priv->base.button_cb)( GNC_HTML(self), event, priv->base.button_cb_data );
-		return TRUE;
-	} else {
-		return FALSE;
-	}
+    DEBUG( "Button Press" );
+    if ( priv->base.button_cb != NULL )
+    {
+        (priv->base.button_cb)( GNC_HTML(self), event, priv->base.button_cb_data );
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 
 /********************************************************************
@@ -600,9 +653,9 @@
 
 static void
 gnc_html_open_scm( GncHtmlWebkit* self, const gchar * location,
-                  const gchar * label, int newwin )
+                   const gchar * label, int newwin )
 {
-	PINFO("location='%s'", location ? location : "(null)");
+    PINFO("location='%s'", location ? location : "(null)");
 }
 
 
@@ -615,15 +668,15 @@
 static void
 impl_webkit_show_data( GncHtml* self, const gchar* data, int datalen )
 {
-	GncHtmlWebkitPrivate* priv;
+    GncHtmlWebkitPrivate* priv;
 
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
 
-	DEBUG( "datalen %d, data %20.20s", datalen, data );
+    DEBUG( "datalen %d, data %20.20s", datalen, data );
 
-	priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
-	webkit_web_view_load_html_string( priv->web_view, data, "base-uri" );
+    priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    webkit_web_view_load_html_string( priv->web_view, data, "base-uri" );
 }
 
 /********************************************************************
@@ -636,151 +689,184 @@
 
 static void
 impl_webkit_show_url( GncHtml* self, URLType type,
-                  const gchar* location, const gchar* label,
-                  gboolean new_window_hint )
+                      const gchar* location, const gchar* label,
+                      gboolean new_window_hint )
 {
-	GncHTMLUrlCB url_handler;
-	gboolean new_window;
-	GncHtmlWebkitPrivate* priv;
+    GncHTMLUrlCB url_handler;
+    gboolean new_window;
+    GncHtmlWebkitPrivate* priv;
 
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
-	g_return_if_fail( location != NULL );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
+    g_return_if_fail( location != NULL );
 
-	priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
 
-	/* make sure it's OK to show this URL type in this window */
-	if( new_window_hint == 0 ) {
-		if( priv->base.urltype_cb ) {
-			new_window = !((priv->base.urltype_cb)( type ));
-		} else {
-			new_window = FALSE;
-		}
-	} else {
-		new_window = TRUE;
-	}
+    /* make sure it's OK to show this URL type in this window */
+    if ( new_window_hint == 0 )
+    {
+        if ( priv->base.urltype_cb )
+        {
+            new_window = !((priv->base.urltype_cb)( type ));
+        }
+        else
+        {
+            new_window = FALSE;
+        }
+    }
+    else
+    {
+        new_window = TRUE;
+    }
 
-	if( !new_window ) {
-		gnc_html_cancel( GNC_HTML(self) );
-	}
+    if ( !new_window )
+    {
+        gnc_html_cancel( GNC_HTML(self) );
+    }
 
-	if( gnc_html_url_handlers ) {
-		url_handler = g_hash_table_lookup( gnc_html_url_handlers, type );
-	} else {
-		url_handler = NULL;
-	}
+    if ( gnc_html_url_handlers )
+    {
+        url_handler = g_hash_table_lookup( gnc_html_url_handlers, type );
+    }
+    else
+    {
+        url_handler = NULL;
+    }
 
-	if( url_handler ) {
-		GNCURLResult result;
-		gboolean ok;
+    if ( url_handler )
+    {
+        GNCURLResult result;
+        gboolean ok;
 
-		result.load_to_stream = FALSE;
-		result.url_type = type;
-		result.location = NULL;
-		result.label = NULL;
-		result.base_type = URL_TYPE_FILE;
-		result.base_location = NULL;
-		result.error_message = NULL;
+        result.load_to_stream = FALSE;
+        result.url_type = type;
+        result.location = NULL;
+        result.label = NULL;
+        result.base_type = URL_TYPE_FILE;
+        result.base_location = NULL;
+        result.error_message = NULL;
 
-		ok = url_handler( location, label, new_window, &result );
-		if( !ok ) {
-			if( result.error_message ) {
-			  gnc_error_dialog( priv->base.parent, "%s", result.error_message );
-			} else {
-				/* %s is a URL (some location somewhere). */
-				gnc_error_dialog( priv->base.parent, _("There was an error accessing %s."), location );
-			}
+        ok = url_handler( location, label, new_window, &result );
+        if ( !ok )
+        {
+            if ( result.error_message )
+            {
+                gnc_error_dialog( priv->base.parent, "%s", result.error_message );
+            }
+            else
+            {
+                /* %s is a URL (some location somewhere). */
+                gnc_error_dialog( priv->base.parent, _("There was an error accessing %s."), location );
+            }
 
-			if( priv->base.load_cb ) {
-				priv->base.load_cb( GNC_HTML(self), result.url_type,
-								location, label, priv->base.load_cb_data );
-			}
-		} else if( result.load_to_stream ) {
-			gnc_html_history_node *hnode;
-			const char *new_location;
-			const char *new_label;
+            if ( priv->base.load_cb )
+            {
+                priv->base.load_cb( GNC_HTML(self), result.url_type,
+                                    location, label, priv->base.load_cb_data );
+            }
+        }
+        else if ( result.load_to_stream )
+        {
+            gnc_html_history_node *hnode;
+            const char *new_location;
+            const char *new_label;
 
-			new_location = result.location ? result.location : location;
-			new_label = result.label ? result.label : label;
-			hnode = gnc_html_history_node_new( result.url_type, new_location, new_label );
+            new_location = result.location ? result.location : location;
+            new_label = result.label ? result.label : label;
+            hnode = gnc_html_history_node_new( result.url_type, new_location, new_label );
 
-			gnc_html_history_append( priv->base.history, hnode );
+            gnc_html_history_append( priv->base.history, hnode );
 
-			g_free( priv->base.base_location );
-			priv->base.base_type = result.base_type;
-			priv->base.base_location =
-					g_strdup( extract_base_name( result.base_type, new_location ) );
-			DEBUG( "resetting base location to %s",
-					priv->base.base_location ? priv->base.base_location : "(null)" );
+            g_free( priv->base.base_location );
+            priv->base.base_type = result.base_type;
+            priv->base.base_location =
+                g_strdup( extract_base_name( result.base_type, new_location ) );
+            DEBUG( "resetting base location to %s",
+                   priv->base.base_location ? priv->base.base_location : "(null)" );
 
-			load_to_stream( GNC_HTML_WEBKIT(self), result.url_type,
-									new_location, new_label );
+            load_to_stream( GNC_HTML_WEBKIT(self), result.url_type,
+                            new_location, new_label );
 
-			if( priv->base.load_cb != NULL ) {
-				priv->base.load_cb( GNC_HTML(self), result.url_type,
-								new_location, new_label, priv->base.load_cb_data );
-			}
-		}
+            if ( priv->base.load_cb != NULL )
+            {
+                priv->base.load_cb( GNC_HTML(self), result.url_type,
+                                    new_location, new_label, priv->base.load_cb_data );
+            }
+        }
 
-		g_free( result.location );
-		g_free( result.label );
-		g_free( result.base_location );
-		g_free( result.error_message );
+        g_free( result.location );
+        g_free( result.label );
+        g_free( result.base_location );
+        g_free( result.error_message );
 
-		return;
-	}
+        return;
+    }
 
-	if( safe_strcmp( type, URL_TYPE_SCHEME ) == 0 ) {
-		gnc_html_open_scm( GNC_HTML_WEBKIT(self), location, label, new_window );
+    if ( safe_strcmp( type, URL_TYPE_SCHEME ) == 0 )
+    {
+        gnc_html_open_scm( GNC_HTML_WEBKIT(self), location, label, new_window );
 
-	} else if( safe_strcmp( type, URL_TYPE_JUMP ) == 0 ) {
+    }
+    else if ( safe_strcmp( type, URL_TYPE_JUMP ) == 0 )
+    {
 //		gtk_html_jump_to_anchor( GTK_HTML(priv->html), label );
-		g_assert( FALSE );
+        g_assert( FALSE );
 
-	} else if( safe_strcmp( type, URL_TYPE_SECURE ) == 0 ||
-				safe_strcmp( type, URL_TYPE_HTTP ) == 0 ||
-				safe_strcmp( type, URL_TYPE_FILE ) == 0 ) {
+    }
+    else if ( safe_strcmp( type, URL_TYPE_SECURE ) == 0 ||
+              safe_strcmp( type, URL_TYPE_HTTP ) == 0 ||
+              safe_strcmp( type, URL_TYPE_FILE ) == 0 )
+    {
 
-		do {
-			if( safe_strcmp( type, URL_TYPE_SECURE ) == 0 ) {
-				if( !https_allowed() ) {
-					gnc_error_dialog( priv->base.parent,"%s",
-									_("Secure HTTP access is disabled. "
-									"You can enable it in the Network section of "
-									"the Preferences dialog.") );
-					break;
-				}
-			}
+        do
+        {
+            if ( safe_strcmp( type, URL_TYPE_SECURE ) == 0 )
+            {
+                if ( !https_allowed() )
+                {
+                    gnc_error_dialog( priv->base.parent, "%s",
+                                      _("Secure HTTP access is disabled. "
+                                        "You can enable it in the Network section of "
+                                        "the Preferences dialog.") );
+                    break;
+                }
+            }
 
-			if( safe_strcmp( type, URL_TYPE_HTTP ) == 0 ) {
-				if( !http_allowed() ) {
-					gnc_error_dialog( priv->base.parent,"%s",
-									_("Network HTTP access is disabled. "
-									"You can enable it in the Network section of "
-									"the Preferences dialog.") );
-					break;
-				}
-			}
+            if ( safe_strcmp( type, URL_TYPE_HTTP ) == 0 )
+            {
+                if ( !http_allowed() )
+                {
+                    gnc_error_dialog( priv->base.parent, "%s",
+                                      _("Network HTTP access is disabled. "
+                                        "You can enable it in the Network section of "
+                                        "the Preferences dialog.") );
+                    break;
+                }
+            }
 
-			priv->base.base_type = type;
+            priv->base.base_type = type;
 
-			if( priv->base.base_location != NULL ) g_free( priv->base.base_location );
-			priv->base.base_location = extract_base_name( type, location );
+            if ( priv->base.base_location != NULL ) g_free( priv->base.base_location );
+            priv->base.base_location = extract_base_name( type, location );
 
-			/* FIXME : handle new_window = 1 */
-			gnc_html_history_append( priv->base.history,
-								gnc_html_history_node_new( type, location, label ) );
-			load_to_stream( GNC_HTML_WEBKIT(self), type, location, label );
+            /* FIXME : handle new_window = 1 */
+            gnc_html_history_append( priv->base.history,
+                                     gnc_html_history_node_new( type, location, label ) );
+            load_to_stream( GNC_HTML_WEBKIT(self), type, location, label );
 
-		} while( FALSE );
+        }
+        while ( FALSE );
 
-	} else {
-		PERR( "URLType %s not supported.", type );
-	}
+    }
+    else
+    {
+        PERR( "URLType %s not supported.", type );
+    }
 
-	if( priv->base.load_cb != NULL ) {
-		(priv->base.load_cb)( GNC_HTML(self), type, location, label, priv->base.load_cb_data );
-	}
+    if ( priv->base.load_cb != NULL )
+    {
+        (priv->base.load_cb)( GNC_HTML(self), type, location, label, priv->base.load_cb_data );
+    }
 }
 
 
@@ -792,17 +878,18 @@
 static void
 impl_webkit_reload( GncHtml* self )
 {
-	gnc_html_history_node * n;
-	GncHtmlWebkitPrivate* priv;
+    gnc_html_history_node * n;
+    GncHtmlWebkitPrivate* priv;
 
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
 
-	priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
-	n = gnc_html_history_get_current( priv->base.history );
-	if( n != NULL ) {
-		gnc_html_show_url( self, n->type, n->location, n->label, 0 );
-	}
+    priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    n = gnc_html_history_get_current( priv->base.history );
+    if ( n != NULL )
+    {
+        gnc_html_show_url( self, n->type, n->location, n->label, 0 );
+    }
 }
 
 
@@ -814,10 +901,10 @@
 GncHtml*
 gnc_html_webkit_new( void )
 {
-	GncHtmlWebkit* self = g_object_new( GNC_TYPE_HTML_WEBKIT, NULL );
-	GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    GncHtmlWebkit* self = g_object_new( GNC_TYPE_HTML_WEBKIT, NULL );
+    GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
 
-	return GNC_HTML(self);
+    return GNC_HTML(self);
 }
 
 /********************************************************************
@@ -828,39 +915,40 @@
 static gboolean
 webkit_cancel_helper(gpointer key, gpointer value, gpointer user_data)
 {
-	g_free(key);
-	g_list_free((GList *)value);
-	return TRUE;
+    g_free(key);
+    g_list_free((GList *)value);
+    return TRUE;
 }
 
 static void
 impl_webkit_cancel( GncHtml* self )
 {
-	GncHtmlWebkitPrivate* priv;
+    GncHtmlWebkitPrivate* priv;
 
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
 
-	priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
 
-	/* remove our own references to requests */
-	//gnc_http_cancel_requests( priv->http );
+    /* remove our own references to requests */
+    //gnc_http_cancel_requests( priv->http );
 
-	g_hash_table_foreach_remove( priv->base.request_info, webkit_cancel_helper, NULL );
+    g_hash_table_foreach_remove( priv->base.request_info, webkit_cancel_helper, NULL );
 }
 
 static void
 impl_webkit_copy_to_clipboard( GncHtml* self )
 {
-	GncHtmlWebkitPrivate* priv;
+    GncHtmlWebkitPrivate* priv;
 
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
 
-	priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
-	if( webkit_web_view_can_copy_clipboard( priv->web_view ) ) {
-		webkit_web_view_copy_clipboard( priv->web_view );
-	}
+    priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    if ( webkit_web_view_can_copy_clipboard( priv->web_view ) )
+    {
+        webkit_web_view_copy_clipboard( priv->web_view );
+    }
 }
 
 /**************************************************************
@@ -869,68 +957,74 @@
 static gboolean
 impl_webkit_export_to_file( GncHtml* self, const char *filepath )
 {
-	FILE *fh;
-	GncHtmlWebkitPrivate* priv;
+    FILE *fh;
+    GncHtmlWebkitPrivate* priv;
 
-	g_return_val_if_fail( self != NULL, FALSE );
-	g_return_val_if_fail( GNC_IS_HTML_WEBKIT(self), FALSE );
-	g_return_val_if_fail( filepath != NULL, FALSE );
+    g_return_val_if_fail( self != NULL, FALSE );
+    g_return_val_if_fail( GNC_IS_HTML_WEBKIT(self), FALSE );
+    g_return_val_if_fail( filepath != NULL, FALSE );
 
-	priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
-	if( priv->html_string == NULL ) {
-		return FALSE;
-	}
-	fh = g_fopen( filepath, "w" );
-	if( fh != NULL ) {
-		gint written;
-		gint len = strlen( priv->html_string );
+    priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    if ( priv->html_string == NULL )
+    {
+        return FALSE;
+    }
+    fh = g_fopen( filepath, "w" );
+    if ( fh != NULL )
+    {
+        gint written;
+        gint len = strlen( priv->html_string );
 
-		written = fwrite( priv->html_string, 1, len, fh );
-		fclose (fh);
+        written = fwrite( priv->html_string, 1, len, fh );
+        fclose (fh);
 
-		if( written != len ) {
-			return FALSE;
-		}
+        if ( written != len )
+        {
+            return FALSE;
+        }
 
-		return TRUE;
-	} else {
-		return FALSE;
-	} 
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 
 static void
 impl_webkit_print( GncHtml* self )
 {
-	GncHtmlWebkitPrivate* priv;
+    GncHtmlWebkitPrivate* priv;
 //	static void (*webkit_web_frame_print)( WebKitWebFrame* frame ) = NULL;
-	WebKitWebFrame* frame;
-	extern void webkit_web_frame_print( WebKitWebFrame* frame );
+    WebKitWebFrame* frame;
+    extern void webkit_web_frame_print( WebKitWebFrame * frame );
 
-	/*  HACK ALERT
-	 *
-	 * The api to print isn't exported, but exists and works, so let's dig for it.
-	 */
+    /*  HACK ALERT
+     *
+     * The api to print isn't exported, but exists and works, so let's dig for it.
+     */
 #if 0
-	if( webkit_web_frame_print == NULL ) {
-		void* handle = dlopen( "/usr/lib/libwebkit-1.0.so", RTLD_LAZY );
-		webkit_web_frame_print = dlsym( handle, "webkit_web_frame_print" );
-		dlclose( handle );
-	}
+    if ( webkit_web_frame_print == NULL )
+    {
+        void* handle = dlopen( "/usr/lib/libwebkit-1.0.so", RTLD_LAZY );
+        webkit_web_frame_print = dlsym( handle, "webkit_web_frame_print" );
+        dlclose( handle );
+    }
 #endif
 
-	priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
-	frame = webkit_web_view_get_main_frame( priv->web_view );
-	webkit_web_frame_print( frame );
+    priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    frame = webkit_web_view_get_main_frame( priv->web_view );
+    webkit_web_frame_print( frame );
 }
 
 static void
 impl_webkit_set_parent( GncHtml* self, GtkWindow* parent )
 {
-	GncHtmlWebkitPrivate* priv;
+    GncHtmlWebkitPrivate* priv;
 
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
 
-	priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
-	priv->base.parent = GTK_WIDGET(parent);
+    priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
+    priv->base.parent = GTK_WIDGET(parent);
 }

Modified: gnucash/trunk/src/html/gnc-html-webkit.h
===================================================================
--- gnucash/trunk/src/html/gnc-html-webkit.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html-webkit.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -39,15 +39,17 @@
 typedef struct _GncHtmlWebkitClass GncHtmlWebkitClass;
 typedef struct _GncHtmlWebkitPrivate GncHtmlWebkitPrivate;
 
-struct _GncHtmlWebkit {
-	GncHtml parent_instance;
+struct _GncHtmlWebkit
+{
+    GncHtml parent_instance;
 
-	/*< private >*/
-	GncHtmlWebkitPrivate* priv;
+    /*< private >*/
+    GncHtmlWebkitPrivate* priv;
 };
 
-struct _GncHtmlWebkitClass {
-	GncHtmlClass parent_class;
+struct _GncHtmlWebkitClass
+{
+    GncHtmlClass parent_class;
 };
 
 GType gnc_html_webkit_get_type( void );

Modified: gnucash/trunk/src/html/gnc-html.c
===================================================================
--- gnucash/trunk/src/html/gnc-html.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -66,10 +66,10 @@
 extern GHashTable* gnc_html_object_handlers;
 
 static char error_404_format[] =
-"<html><body><h3>%s</h3><p>%s</body></html>";
+    "<html><body><h3>%s</h3><p>%s</body></html>";
 static char error_404_title[] = N_("Not found");
 static char error_404_body[] =
-N_("The specified URL could not be loaded.");
+    N_("The specified URL could not be loaded.");
 
 G_DEFINE_ABSTRACT_TYPE(GncHtml, gnc_html, GTK_TYPE_BIN)
 
@@ -85,70 +85,74 @@
 static void
 gnc_html_class_init( GncHtmlClass* klass )
 {
-	GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+    GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
 
-	gobject_class->dispose = gnc_html_dispose;
-	gobject_class->finalize = gnc_html_finalize;
+    gobject_class->dispose = gnc_html_dispose;
+    gobject_class->finalize = gnc_html_finalize;
 
-	klass->show_url = NULL;
-	klass->show_data = NULL;
-	klass->reload = NULL;
-	klass->copy_to_clipboard = NULL;
-	klass->export_to_file = NULL;
-	klass->print = NULL;
-	klass->cancel = NULL;
-	klass->parse_url = NULL;
-	klass->set_parent = NULL;
+    klass->show_url = NULL;
+    klass->show_data = NULL;
+    klass->reload = NULL;
+    klass->copy_to_clipboard = NULL;
+    klass->export_to_file = NULL;
+    klass->print = NULL;
+    klass->cancel = NULL;
+    klass->parse_url = NULL;
+    klass->set_parent = NULL;
 }
 
 static void
 gnc_html_init( GncHtml* self )
 {
-	GncHtmlPrivate* priv;
-	priv = self->priv = g_new0( GncHtmlPrivate, 1 );
+    GncHtmlPrivate* priv;
+    priv = self->priv = g_new0( GncHtmlPrivate, 1 );
 
-	priv->container = gtk_scrolled_window_new( NULL, NULL );
-	gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(priv->container),
-									GTK_POLICY_AUTOMATIC,
-									GTK_POLICY_AUTOMATIC );
-	priv->request_info = g_hash_table_new( g_str_hash, g_str_equal );
-	priv->history = gnc_html_history_new();
+    priv->container = gtk_scrolled_window_new( NULL, NULL );
+    gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(priv->container),
+                                    GTK_POLICY_AUTOMATIC,
+                                    GTK_POLICY_AUTOMATIC );
+    priv->request_info = g_hash_table_new( g_str_hash, g_str_equal );
+    priv->history = gnc_html_history_new();
 }
 
 static void
 gnc_html_dispose( GObject* obj )
 {
-	GncHtml* self = GNC_HTML(obj);
-	GncHtmlPrivate* priv = GNC_HTML_GET_PRIVATE(self);
+    GncHtml* self = GNC_HTML(obj);
+    GncHtmlPrivate* priv = GNC_HTML_GET_PRIVATE(self);
 
-	if( priv->container != NULL ) {
-		gtk_widget_destroy( GTK_WIDGET(priv->container) );
-		g_object_unref( G_OBJECT(priv->container) );
-		priv->container = NULL;
-	}
-	if( priv->request_info != NULL ) {
-		g_hash_table_destroy( priv->request_info );
-		priv->request_info = NULL;
-	}
-	if( priv->history != NULL ) {
-		gnc_html_history_destroy( priv->history );
-		priv->history = NULL;
-	}
+    if ( priv->container != NULL )
+    {
+        gtk_widget_destroy( GTK_WIDGET(priv->container) );
+        g_object_unref( G_OBJECT(priv->container) );
+        priv->container = NULL;
+    }
+    if ( priv->request_info != NULL )
+    {
+        g_hash_table_destroy( priv->request_info );
+        priv->request_info = NULL;
+    }
+    if ( priv->history != NULL )
+    {
+        gnc_html_history_destroy( priv->history );
+        priv->history = NULL;
+    }
 
-	G_OBJECT_CLASS(gnc_html_parent_class)->dispose( obj );
+    G_OBJECT_CLASS(gnc_html_parent_class)->dispose( obj );
 }
 
 static void
 gnc_html_finalize( GObject* obj )
 {
-	GncHtml* self = GNC_HTML(obj);
+    GncHtml* self = GNC_HTML(obj);
 
-	if( self->priv != NULL ) {
-		g_free( self->priv );
-		self->priv = NULL;
-	}
+    if ( self->priv != NULL )
+    {
+        g_free( self->priv );
+        self->priv = NULL;
+    }
 
-	G_OBJECT_CLASS(gnc_html_parent_class)->finalize( obj );
+    G_OBJECT_CLASS(gnc_html_parent_class)->finalize( obj );
 }
 
 /***********************************************************************************/
@@ -156,24 +160,26 @@
 static char*
 extract_machine_name( const gchar* path )
 {
-	gchar machine_rexp[] = "^(//[^/]*)/*(.*)?$";
-	regex_t compiled_m;
-	regmatch_t match[4];
-	gchar* machine = NULL;
+    gchar machine_rexp[] = "^(//[^/]*)/*(.*)?$";
+    regex_t compiled_m;
+    regmatch_t match[4];
+    gchar* machine = NULL;
 
-	if( path == NULL ) return NULL;
+    if ( path == NULL ) return NULL;
 
-	regcomp( &compiled_m, machine_rexp, REG_EXTENDED );
+    regcomp( &compiled_m, machine_rexp, REG_EXTENDED );
 
-	/* step 1: split the machine name away from the path
-	 * components */
-	if( !regexec( &compiled_m, path, 4, match, 0 ) ) {
-		/* $1 is the machine name */
-		if( match[1].rm_so != -1 ) {
-			machine = g_strndup( path+match[1].rm_so, match[1].rm_eo - match[1].rm_so );
-		}
-	}
-	return machine;
+    /* step 1: split the machine name away from the path
+     * components */
+    if ( !regexec( &compiled_m, path, 4, match, 0 ) )
+    {
+        /* $1 is the machine name */
+        if ( match[1].rm_so != -1 )
+        {
+            machine = g_strndup( path + match[1].rm_so, match[1].rm_eo - match[1].rm_so );
+        }
+    }
+    return machine;
 }
 
 /********************************************************************
@@ -184,108 +190,138 @@
 
 URLType
 gnc_html_parse_url( GncHtml* self, const gchar* url,
-					gchar** url_location, gchar** url_label )
+                    gchar** url_location, gchar** url_label )
 {
-	gchar uri_rexp[] = "^(([^:][^:]+):)?([^#]+)?(#(.*))?$";
-	regex_t compiled;
-	regmatch_t match[6];
-	gchar* protocol = NULL;
-	gchar* path = NULL;
-	gchar* label = NULL;
-	gboolean found_protocol = FALSE;
-	gboolean found_path = FALSE;
-	gboolean found_label = FALSE;
-	URLType retval;
-	GncHtmlPrivate* priv = GNC_HTML_GET_PRIVATE(self);
+    gchar uri_rexp[] = "^(([^:][^:]+):)?([^#]+)?(#(.*))?$";
+    regex_t compiled;
+    regmatch_t match[6];
+    gchar* protocol = NULL;
+    gchar* path = NULL;
+    gchar* label = NULL;
+    gboolean found_protocol = FALSE;
+    gboolean found_path = FALSE;
+    gboolean found_label = FALSE;
+    URLType retval;
+    GncHtmlPrivate* priv = GNC_HTML_GET_PRIVATE(self);
 
-	g_return_val_if_fail( self != NULL, NULL );
-	g_return_val_if_fail( GNC_IS_HTML(self), NULL );
+    g_return_val_if_fail( self != NULL, NULL );
+    g_return_val_if_fail( GNC_IS_HTML(self), NULL );
 
-	DEBUG( "parsing %s, base_location %s",
-			url ? url : "(null)",
-			self ? (priv->base_location ? priv->base_location
-										: "(null base_location)")
-				: "(null html)");
+    DEBUG( "parsing %s, base_location %s",
+           url ? url : "(null)",
+           self ? (priv->base_location ? priv->base_location
+                   : "(null base_location)")
+               : "(null html)");
 
-	regcomp( &compiled, uri_rexp, REG_EXTENDED );
+    regcomp( &compiled, uri_rexp, REG_EXTENDED );
 
-	if( !regexec( &compiled, url, 6, match, 0 ) ) {
-		if( match[2].rm_so != -1 ) {
-			protocol = g_new0( gchar, match[2].rm_eo - match[2].rm_so + 1 );
-			strncpy( protocol, url + match[2].rm_so, match[2].rm_eo - match[2].rm_so );
-			protocol[match[2].rm_eo - match[2].rm_so] = 0;
-			found_protocol = TRUE;
-		}
-		if( match[3].rm_so != -1 ) {
-			path = g_new0( gchar, match[3].rm_eo - match[3].rm_so + 1 );
-			strncpy( path, url+match[3].rm_so, match[3].rm_eo - match[3].rm_so );
-			path[match[3].rm_eo - match[3].rm_so] = 0;
-			found_path = TRUE;
-		}
-		if( match[5].rm_so != -1 ) {
-			label = g_new0( gchar, match[5].rm_eo - match[5].rm_so + 1 );
-			strncpy( label, url+match[5].rm_so, match[5].rm_eo - match[5].rm_so );
-			label[match[5].rm_eo - match[5].rm_so] = 0;
-			found_label = TRUE;
-		}
-	}
+    if ( !regexec( &compiled, url, 6, match, 0 ) )
+    {
+        if ( match[2].rm_so != -1 )
+        {
+            protocol = g_new0( gchar, match[2].rm_eo - match[2].rm_so + 1 );
+            strncpy( protocol, url + match[2].rm_so, match[2].rm_eo - match[2].rm_so );
+            protocol[match[2].rm_eo - match[2].rm_so] = 0;
+            found_protocol = TRUE;
+        }
+        if ( match[3].rm_so != -1 )
+        {
+            path = g_new0( gchar, match[3].rm_eo - match[3].rm_so + 1 );
+            strncpy( path, url + match[3].rm_so, match[3].rm_eo - match[3].rm_so );
+            path[match[3].rm_eo - match[3].rm_so] = 0;
+            found_path = TRUE;
+        }
+        if ( match[5].rm_so != -1 )
+        {
+            label = g_new0( gchar, match[5].rm_eo - match[5].rm_so + 1 );
+            strncpy( label, url + match[5].rm_so, match[5].rm_eo - match[5].rm_so );
+            label[match[5].rm_eo - match[5].rm_so] = 0;
+            found_label = TRUE;
+        }
+    }
 
-	regfree( &compiled );
+    regfree( &compiled );
 
-	if( found_protocol ) {
-		retval = g_hash_table_lookup( gnc_html_proto_to_type_hash, protocol );
-		if( retval == NULL ) {
-			PWARN( "unhandled URL type for '%s'", url ? url : "(null)" );
-			retval = URL_TYPE_OTHER;
-		}
-	} else if( found_label && !found_path ) {
-		retval = URL_TYPE_JUMP;
-	} else {
-		if( self ) {
-			retval = priv->base_type;
-		} else {
-			retval = URL_TYPE_FILE;
-		}
-	}
+    if ( found_protocol )
+    {
+        retval = g_hash_table_lookup( gnc_html_proto_to_type_hash, protocol );
+        if ( retval == NULL )
+        {
+            PWARN( "unhandled URL type for '%s'", url ? url : "(null)" );
+            retval = URL_TYPE_OTHER;
+        }
+    }
+    else if ( found_label && !found_path )
+    {
+        retval = URL_TYPE_JUMP;
+    }
+    else
+    {
+        if ( self )
+        {
+            retval = priv->base_type;
+        }
+        else
+        {
+            retval = URL_TYPE_FILE;
+        }
+    }
 
-	g_free( protocol );
+    g_free( protocol );
 
-	if( !safe_strcmp( retval, URL_TYPE_FILE ) ) {
-		if( !found_protocol && path && self && priv->base_location ) {
-			if( g_path_is_absolute( path ) ) {
-				*url_location = g_strdup( path );
-			} else {
-				*url_location = g_build_filename( priv->base_location, path, (gchar*)NULL );
-			}
-			g_free( path );
-		} else {
-			*url_location = g_strdup( path );
-			g_free( path );
-		}
+    if ( !safe_strcmp( retval, URL_TYPE_FILE ) )
+    {
+        if ( !found_protocol && path && self && priv->base_location )
+        {
+            if ( g_path_is_absolute( path ) )
+            {
+                *url_location = g_strdup( path );
+            }
+            else
+            {
+                *url_location = g_build_filename( priv->base_location, path, (gchar*)NULL );
+            }
+            g_free( path );
+        }
+        else
+        {
+            *url_location = g_strdup( path );
+            g_free( path );
+        }
 
-	} else if( !safe_strcmp( retval, URL_TYPE_JUMP ) ) {
-		*url_location = NULL;
-		g_free( path );
+    }
+    else if ( !safe_strcmp( retval, URL_TYPE_JUMP ) )
+    {
+        *url_location = NULL;
+        g_free( path );
 
-	} else {
-		/* case URL_TYPE_OTHER: */
+    }
+    else
+    {
+        /* case URL_TYPE_OTHER: */
 
-		if( !found_protocol && path && self && priv->base_location ) {
-			if( g_path_is_absolute( path ) ) {
-				*url_location = g_build_filename( extract_machine_name( priv->base_location ),
-                           path, (gchar*)NULL );
-			} else {
-				*url_location = g_build_filename( priv->base_location, path, (gchar*)NULL );
-			}
-			g_free( path );
-		} else {
-			*url_location = g_strdup( path );
-			g_free( path );
-		}
-	}
+        if ( !found_protocol && path && self && priv->base_location )
+        {
+            if ( g_path_is_absolute( path ) )
+            {
+                *url_location = g_build_filename( extract_machine_name( priv->base_location ),
+                                                  path, (gchar*)NULL );
+            }
+            else
+            {
+                *url_location = g_build_filename( priv->base_location, path, (gchar*)NULL );
+            }
+            g_free( path );
+        }
+        else
+        {
+            *url_location = g_strdup( path );
+            g_free( path );
+        }
+    }
 
-	*url_label = label;
-	return retval;
+    *url_label = label;
+    return retval;
 }
 
 /********************************************************************
@@ -297,14 +333,17 @@
 void
 gnc_html_show_data( GncHtml* self, const gchar* data, int datalen )
 {
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	if( GNC_HTML_GET_CLASS(self)->show_data != NULL ) {
-		GNC_HTML_GET_CLASS(self)->show_data( self, data, datalen );
-	} else {
-		DEBUG( "'show_data' not implemented" );
-	}
+    if ( GNC_HTML_GET_CLASS(self)->show_data != NULL )
+    {
+        GNC_HTML_GET_CLASS(self)->show_data( self, data, datalen );
+    }
+    else
+    {
+        DEBUG( "'show_data' not implemented" );
+    }
 }
 
 
@@ -318,17 +357,20 @@
 
 void
 gnc_html_show_url( GncHtml* self, URLType type,
-                  const gchar* location, const gchar* label,
-                  gboolean new_window_hint )
+                   const gchar* location, const gchar* label,
+                   gboolean new_window_hint )
 {
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	if( GNC_HTML_GET_CLASS(self)->show_url != NULL ) {
-		GNC_HTML_GET_CLASS(self)->show_url( self, type, location, label, new_window_hint );
-	} else {
-		DEBUG( "'show_url' not implemented" );
-	}
+    if ( GNC_HTML_GET_CLASS(self)->show_url != NULL )
+    {
+        GNC_HTML_GET_CLASS(self)->show_url( self, type, location, label, new_window_hint );
+    }
+    else
+    {
+        DEBUG( "'show_url' not implemented" );
+    }
 }
 
 
@@ -340,14 +382,17 @@
 void
 gnc_html_reload( GncHtml* self )
 {
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	if( GNC_HTML_GET_CLASS(self)->reload != NULL ) {
-		GNC_HTML_GET_CLASS(self)->reload( self );
-	} else {
-		DEBUG( "'reload' not implemented" );
-	}
+    if ( GNC_HTML_GET_CLASS(self)->reload != NULL )
+    {
+        GNC_HTML_GET_CLASS(self)->reload( self );
+    }
+    else
+    {
+        DEBUG( "'reload' not implemented" );
+    }
 }
 
 /********************************************************************
@@ -358,14 +403,17 @@
 void
 gnc_html_cancel( GncHtml* self )
 {
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	if( GNC_HTML_GET_CLASS(self)->cancel != NULL ) {
-		GNC_HTML_GET_CLASS(self)->cancel( self );
-	} else {
-		DEBUG( "'cancel' not implemented" );
-	}
+    if ( GNC_HTML_GET_CLASS(self)->cancel != NULL )
+    {
+        GNC_HTML_GET_CLASS(self)->cancel( self );
+    }
+    else
+    {
+        DEBUG( "'cancel' not implemented" );
+    }
 }
 
 
@@ -377,78 +425,82 @@
 void
 gnc_html_destroy( GncHtml* self )
 {
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	if( g_object_is_floating( G_OBJECT(self) ) ) {
-		(void)g_object_ref_sink( G_OBJECT(self) );
-	}
+    if ( g_object_is_floating( G_OBJECT(self) ) )
+    {
+        (void)g_object_ref_sink( G_OBJECT(self) );
+    }
 
-	g_object_unref( G_OBJECT(self) );
+    g_object_unref( G_OBJECT(self) );
 }
 
 void
 gnc_html_set_urltype_cb( GncHtml* self, GncHTMLUrltypeCB urltype_cb )
 {
-	GncHtmlPrivate* priv;
+    GncHtmlPrivate* priv;
 
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	priv = GNC_HTML_GET_PRIVATE(self);
-	priv->urltype_cb = urltype_cb;
+    priv = GNC_HTML_GET_PRIVATE(self);
+    priv->urltype_cb = urltype_cb;
 }
 
 void
 gnc_html_set_load_cb( GncHtml* self, GncHTMLLoadCB load_cb, gpointer data )
 {
-	GncHtmlPrivate* priv;
+    GncHtmlPrivate* priv;
 
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	priv = GNC_HTML_GET_PRIVATE(self);
-	priv->load_cb = load_cb;
-	priv->load_cb_data = data;
+    priv = GNC_HTML_GET_PRIVATE(self);
+    priv->load_cb = load_cb;
+    priv->load_cb_data = data;
 }
 
 void
 gnc_html_set_flyover_cb( GncHtml* self, GncHTMLFlyoverCB flyover_cb, gpointer data )
 {
-	GncHtmlPrivate* priv;
+    GncHtmlPrivate* priv;
 
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	priv = GNC_HTML_GET_PRIVATE(self);
-	priv->flyover_cb = flyover_cb;
-	priv->flyover_cb_data = data;
+    priv = GNC_HTML_GET_PRIVATE(self);
+    priv->flyover_cb = flyover_cb;
+    priv->flyover_cb_data = data;
 }
 
 void
 gnc_html_set_button_cb( GncHtml* self, GncHTMLButtonCB button_cb, gpointer data )
 {
-	GncHtmlPrivate* priv;
+    GncHtmlPrivate* priv;
 
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	priv = GNC_HTML_GET_PRIVATE(self);
-	priv->button_cb = button_cb;
-	priv->button_cb_data = data;
+    priv = GNC_HTML_GET_PRIVATE(self);
+    priv->button_cb = button_cb;
+    priv->button_cb_data = data;
 }
 
 void
 gnc_html_copy_to_clipboard( GncHtml* self )
 {
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	if( GNC_HTML_GET_CLASS(self)->copy_to_clipboard != NULL ) {
-		GNC_HTML_GET_CLASS(self)->copy_to_clipboard( self );
-	} else {
-		DEBUG( "'copy_to_clipboard' not implemented" );
-	}
+    if ( GNC_HTML_GET_CLASS(self)->copy_to_clipboard != NULL )
+    {
+        GNC_HTML_GET_CLASS(self)->copy_to_clipboard( self );
+    }
+    else
+    {
+        DEBUG( "'copy_to_clipboard' not implemented" );
+    }
 }
 
 /**************************************************************
@@ -458,60 +510,69 @@
 gboolean
 gnc_html_export_to_file( GncHtml* self, const gchar* filepath )
 {
-	g_return_val_if_fail( self != NULL, FALSE );
-	g_return_val_if_fail( GNC_IS_HTML(self), FALSE );
+    g_return_val_if_fail( self != NULL, FALSE );
+    g_return_val_if_fail( GNC_IS_HTML(self), FALSE );
 
-	if( GNC_HTML_GET_CLASS(self)->export_to_file != NULL ) {
-		return GNC_HTML_GET_CLASS(self)->export_to_file( self, filepath );
-	} else {
-		DEBUG( "'export_to_file' not implemented" );
-		return FALSE;
-	}
+    if ( GNC_HTML_GET_CLASS(self)->export_to_file != NULL )
+    {
+        return GNC_HTML_GET_CLASS(self)->export_to_file( self, filepath );
+    }
+    else
+    {
+        DEBUG( "'export_to_file' not implemented" );
+        return FALSE;
+    }
 }
 
 void
 gnc_html_print( GncHtml* self )
 {
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	if( GNC_HTML_GET_CLASS(self)->print != NULL ) {
-		GNC_HTML_GET_CLASS(self)->print( self );
-	} else {
-		DEBUG( "'print' not implemented" );
-	}
+    if ( GNC_HTML_GET_CLASS(self)->print != NULL )
+    {
+        GNC_HTML_GET_CLASS(self)->print( self );
+    }
+    else
+    {
+        DEBUG( "'print' not implemented" );
+    }
 }
 
 gnc_html_history *
 gnc_html_get_history( GncHtml* self )
 {
-	g_return_val_if_fail( self != NULL, NULL );
-	g_return_val_if_fail( GNC_IS_HTML(self), NULL );
+    g_return_val_if_fail( self != NULL, NULL );
+    g_return_val_if_fail( GNC_IS_HTML(self), NULL );
 
-	return GNC_HTML_GET_PRIVATE(self)->history;
+    return GNC_HTML_GET_PRIVATE(self)->history;
 }
 
 
 GtkWidget *
 gnc_html_get_widget( GncHtml* self )
 {
-	g_return_val_if_fail( self != NULL, NULL );
-	g_return_val_if_fail( GNC_IS_HTML(self), NULL );
+    g_return_val_if_fail( self != NULL, NULL );
+    g_return_val_if_fail( GNC_IS_HTML(self), NULL );
 
-	return GNC_HTML_GET_PRIVATE(self)->container;
+    return GNC_HTML_GET_PRIVATE(self)->container;
 }
 
 void
 gnc_html_set_parent( GncHtml* self, GtkWindow* parent )
 {
-	g_return_if_fail( self != NULL );
-	g_return_if_fail( GNC_IS_HTML(self) );
+    g_return_if_fail( self != NULL );
+    g_return_if_fail( GNC_IS_HTML(self) );
 
-	if( GNC_HTML_GET_CLASS(self)->set_parent != NULL ) {
-		GNC_HTML_GET_CLASS(self)->set_parent( self, parent );
-	} else {
-		DEBUG( "'set_parent' not implemented" );
-	}
+    if ( GNC_HTML_GET_CLASS(self)->set_parent != NULL )
+    {
+        GNC_HTML_GET_CLASS(self)->set_parent( self, parent );
+    }
+    else
+    {
+        DEBUG( "'set_parent' not implemented" );
+    }
 }
 
 /* Register the URLType if it doesn't already exist.
@@ -520,48 +581,52 @@
 gboolean
 gnc_html_register_urltype( URLType type, const char *protocol )
 {
-  if (!gnc_html_type_to_proto_hash) {
-    gnc_html_type_to_proto_hash = g_hash_table_new (g_str_hash, g_str_equal);
-    gnc_html_proto_to_type_hash = g_hash_table_new (g_str_hash, g_str_equal);
-  }
-  if (!protocol) return FALSE;
-  if (g_hash_table_lookup (gnc_html_type_to_proto_hash, type))
-    return FALSE;
+    if (!gnc_html_type_to_proto_hash)
+    {
+        gnc_html_type_to_proto_hash = g_hash_table_new (g_str_hash, g_str_equal);
+        gnc_html_proto_to_type_hash = g_hash_table_new (g_str_hash, g_str_equal);
+    }
+    if (!protocol) return FALSE;
+    if (g_hash_table_lookup (gnc_html_type_to_proto_hash, type))
+        return FALSE;
 
-  g_hash_table_insert (gnc_html_type_to_proto_hash, type, (gpointer)protocol);
-  if (*protocol)
-    g_hash_table_insert (gnc_html_proto_to_type_hash, (gpointer)protocol, type);
+    g_hash_table_insert (gnc_html_type_to_proto_hash, type, (gpointer)protocol);
+    if (*protocol)
+        g_hash_table_insert (gnc_html_proto_to_type_hash, (gpointer)protocol, type);
 
-  return TRUE;
+    return TRUE;
 }
 
 void
 gnc_html_initialize( void )
 {
-  int i;
-  static struct {
-    URLType	type;
-    char *	protocol;
-  } types[] = {
-    { URL_TYPE_FILE, "file" },
-    { URL_TYPE_JUMP, "" },
-    { URL_TYPE_HTTP, "http" },
-    { URL_TYPE_FTP, "ftp" },
-    { URL_TYPE_SECURE, "https" },
-    { URL_TYPE_REGISTER, "gnc-register" },
-    { URL_TYPE_ACCTTREE, "gnc-acct-tree" },
-    { URL_TYPE_REPORT, "gnc-report" },
-    { URL_TYPE_OPTIONS, "gnc-options" },
-    { URL_TYPE_SCHEME, "gnc-scm" },
-    { URL_TYPE_HELP, "gnc-help" },
-    { URL_TYPE_XMLDATA, "gnc-xml" },
-    { URL_TYPE_PRICE, "gnc-price" },
-    { URL_TYPE_BUDGET, "gnc-budget" },
-    { URL_TYPE_OTHER, "" },
-    { NULL, NULL }};
+    int i;
+    static struct
+    {
+        URLType	type;
+        char *	protocol;
+    } types[] =
+    {
+        { URL_TYPE_FILE, "file" },
+        { URL_TYPE_JUMP, "" },
+        { URL_TYPE_HTTP, "http" },
+        { URL_TYPE_FTP, "ftp" },
+        { URL_TYPE_SECURE, "https" },
+        { URL_TYPE_REGISTER, "gnc-register" },
+        { URL_TYPE_ACCTTREE, "gnc-acct-tree" },
+        { URL_TYPE_REPORT, "gnc-report" },
+        { URL_TYPE_OPTIONS, "gnc-options" },
+        { URL_TYPE_SCHEME, "gnc-scm" },
+        { URL_TYPE_HELP, "gnc-help" },
+        { URL_TYPE_XMLDATA, "gnc-xml" },
+        { URL_TYPE_PRICE, "gnc-price" },
+        { URL_TYPE_BUDGET, "gnc-budget" },
+        { URL_TYPE_OTHER, "" },
+        { NULL, NULL }
+    };
 
-  for (i = 0; types[i].type; i++)
-    gnc_html_register_urltype (types[i].type, types[i].protocol);
+    for (i = 0; types[i].type; i++)
+        gnc_html_register_urltype (types[i].type, types[i].protocol);
 }
 
 /**
@@ -575,22 +640,24 @@
 gchar*
 gnc_build_url( URLType type, const gchar* location, const gchar* label )
 {
-  char * type_name;
+    char * type_name;
 
-  DEBUG(" ");
-  type_name = g_hash_table_lookup (gnc_html_type_to_proto_hash, type);
-  if (!type_name)
-    type_name = "";
+    DEBUG(" ");
+    type_name = g_hash_table_lookup (gnc_html_type_to_proto_hash, type);
+    if (!type_name)
+        type_name = "";
 
-  if(label) {
-    return g_strdup_printf("%s%s%s#%s", type_name, (*type_name ? ":" : ""),
-                           (location ? location : ""),
-                           label ? label : "");
-  }
-  else {
-    return g_strdup_printf("%s%s%s", type_name, (*type_name ? ":" : ""),
-                           (location ? location : ""));
-  }
+    if (label)
+    {
+        return g_strdup_printf("%s%s%s#%s", type_name, (*type_name ? ":" : ""),
+                               (location ? location : ""),
+                               label ? label : "");
+    }
+    else
+    {
+        return g_strdup_printf("%s%s%s", type_name, (*type_name ? ":" : ""),
+                               (location ? location : ""));
+    }
 }
 
 /********************************************************************
@@ -606,85 +673,95 @@
 char *
 gnc_html_encode_string(const char * str)
 {
-  static gchar *safe = "$-._!*(),"; /* RFC 1738 */
-  unsigned pos      = 0;
-  GString *encoded  = g_string_new ("");
-  gchar buffer[5], *ptr;
-  guchar c;
+    static gchar *safe = "$-._!*(),"; /* RFC 1738 */
+    unsigned pos      = 0;
+    GString *encoded  = g_string_new ("");
+    gchar buffer[5], *ptr;
+    guchar c;
 
-  if(!str) return NULL;
+    if (!str) return NULL;
 
-  while(pos < strlen(str)) {
-    c = (unsigned char) str[pos];
+    while (pos < strlen(str))
+    {
+        c = (unsigned char) str[pos];
 
-    if ((( c >= 'A') && ( c <= 'Z')) ||
-        (( c >= 'a') && ( c <= 'z')) ||
-        (( c >= '0') && ( c <= '9')) ||
-        (strchr(safe, c))) {
-      encoded = g_string_append_c (encoded, c);
+        if ((( c >= 'A') && ( c <= 'Z')) ||
+                (( c >= 'a') && ( c <= 'z')) ||
+                (( c >= '0') && ( c <= '9')) ||
+                (strchr(safe, c)))
+        {
+            encoded = g_string_append_c (encoded, c);
+        }
+        else if ( c == ' ' )
+        {
+            encoded = g_string_append_c (encoded, '+');
+        }
+        else if ( c == '\n' )
+        {
+            encoded = g_string_append (encoded, "%0D%0A");
+        }
+        else if ( c != '\r' )
+        {
+            sprintf( buffer, "%%%02X", (int)c );
+            encoded = g_string_append (encoded, buffer);
+        }
+        pos++;
     }
-    else if ( c == ' ' ) {
-      encoded = g_string_append_c (encoded, '+');
-    }
-    else if ( c == '\n' ) {
-      encoded = g_string_append (encoded, "%0D%0A");
-    }
-    else if ( c != '\r' ) {
-      sprintf( buffer, "%%%02X", (int)c );
-      encoded = g_string_append (encoded, buffer);
-    }
-    pos++;
-  }
 
-  ptr = encoded->str;
+    ptr = encoded->str;
 
-  g_string_free (encoded, FALSE);
+    g_string_free (encoded, FALSE);
 
-  return (char *)ptr;
+    return (char *)ptr;
 }
 
 
 char *
 gnc_html_decode_string(const char * str)
 {
-  static gchar * safe = "$-._!*(),"; /* RFC 1738 */
-  GString * decoded  = g_string_new ("");
-  const gchar   * ptr;
-  guchar  c;
-  guint   hexval;
-  ptr = str;
+    static gchar * safe = "$-._!*(),"; /* RFC 1738 */
+    GString * decoded  = g_string_new ("");
+    const gchar   * ptr;
+    guchar  c;
+    guint   hexval;
+    ptr = str;
 
-  if(!str) return NULL;
+    if (!str) return NULL;
 
-  while(*ptr) {
-    c = (unsigned char) *ptr;
-    if ((( c >= 'A') && ( c <= 'Z')) ||
-        (( c >= 'a') && ( c <= 'z')) ||
-        (( c >= '0') && ( c <= '9')) ||
-        (strchr(safe, c))) {
-      decoded = g_string_append_c (decoded, c);
+    while (*ptr)
+    {
+        c = (unsigned char) * ptr;
+        if ((( c >= 'A') && ( c <= 'Z')) ||
+                (( c >= 'a') && ( c <= 'z')) ||
+                (( c >= '0') && ( c <= '9')) ||
+                (strchr(safe, c)))
+        {
+            decoded = g_string_append_c (decoded, c);
+        }
+        else if ( c == '+' )
+        {
+            decoded = g_string_append_c (decoded, ' ');
+        }
+        else if (!strncmp(ptr, "%0D0A", 5))
+        {
+            decoded = g_string_append (decoded, "\n");
+            ptr += 4;
+        }
+        else if (c == '%')
+        {
+            ptr++;
+            if (1 == sscanf(ptr, "%02X", &hexval))
+                decoded = g_string_append_c(decoded, (char)hexval);
+            else
+                decoded = g_string_append_c(decoded, ' ');
+            ptr++;
+        }
+        ptr++;
     }
-    else if ( c == '+' ) {
-      decoded = g_string_append_c (decoded, ' ');
-    }
-    else if (!strncmp(ptr, "%0D0A", 5)) {
-      decoded = g_string_append (decoded, "\n");
-      ptr += 4;
-    }
-    else if(c == '%') {
-      ptr++;
-      if (1 == sscanf(ptr, "%02X", &hexval))
-	decoded = g_string_append_c(decoded, (char)hexval);
-      else
-	decoded = g_string_append_c(decoded, ' ');
-      ptr++;
-    }
-    ptr++;
-  }
-  ptr = decoded->str;
-  g_string_free (decoded, FALSE);
+    ptr = decoded->str;
+    g_string_free (decoded, FALSE);
 
-  return (char *)ptr;
+    return (char *)ptr;
 }
 
 /********************************************************************
@@ -695,118 +772,131 @@
 char *
 gnc_html_unescape_newlines(const gchar * in)
 {
-  const char * ip = in;
-  char    * cstr = NULL;
-  GString * rv = g_string_new("");
+    const char * ip = in;
+    char    * cstr = NULL;
+    GString * rv = g_string_new("");
 
-  for(ip=in; *ip; ip++) {
-    if((*ip == '\\') && (*(ip+1)=='n')) {
-      g_string_append(rv, "\n");
-      ip++;
+    for (ip = in; *ip; ip++)
+    {
+        if ((*ip == '\\') && (*(ip + 1) == 'n'))
+        {
+            g_string_append(rv, "\n");
+            ip++;
+        }
+        else
+        {
+            g_string_append_c(rv, *ip);
+        }
     }
-    else {
-      g_string_append_c(rv, *ip);
-    }
-  }
 
-  g_string_append_c(rv, 0);
-  cstr = rv->str;
-  g_string_free(rv, FALSE);
-  return cstr;
+    g_string_append_c(rv, 0);
+    cstr = rv->str;
+    g_string_free(rv, FALSE);
+    return cstr;
 }
 
 char *
 gnc_html_escape_newlines(const gchar * in)
 {
-  char *out;
-  const char * ip   = in;
-  GString * escaped = g_string_new("");
+    char *out;
+    const char * ip   = in;
+    GString * escaped = g_string_new("");
 
-  for(ip=in; *ip; ip++) {
-    if(*ip == '\012') {
-      g_string_append(escaped, "\\n");
+    for (ip = in; *ip; ip++)
+    {
+        if (*ip == '\012')
+        {
+            g_string_append(escaped, "\\n");
+        }
+        else
+        {
+            g_string_append_c(escaped, *ip);
+        }
     }
-    else {
-      g_string_append_c(escaped, *ip);
-    }
-  }
-  g_string_append_c(escaped, 0);
-  out = escaped->str;
-  g_string_free(escaped, FALSE);
-  return out;
+    g_string_append_c(escaped, 0);
+    out = escaped->str;
+    g_string_free(escaped, FALSE);
+    return out;
 }
 
 void
 gnc_html_register_object_handler( const char * classid,
-                                 GncHTMLObjectCB hand )
+                                  GncHTMLObjectCB hand )
 {
-	g_return_if_fail( classid != NULL );
+    g_return_if_fail( classid != NULL );
 
-	if( gnc_html_object_handlers == NULL ) {
-		gnc_html_object_handlers = g_hash_table_new( g_str_hash, g_str_equal );
-	}
+    if ( gnc_html_object_handlers == NULL )
+    {
+        gnc_html_object_handlers = g_hash_table_new( g_str_hash, g_str_equal );
+    }
 
-	gnc_html_unregister_object_handler( classid );
-	if( hand != NULL ) {
-		g_hash_table_insert( gnc_html_object_handlers, g_strdup( classid ), hand );
-	}
+    gnc_html_unregister_object_handler( classid );
+    if ( hand != NULL )
+    {
+        g_hash_table_insert( gnc_html_object_handlers, g_strdup( classid ), hand );
+    }
 }
 
 void
 gnc_html_unregister_object_handler( const gchar* classid )
 {
-	gchar* keyptr = NULL;
-	gchar* valptr = NULL;
-	gchar** p_keyptr = &keyptr;
-	gchar** p_valptr = &valptr;
+    gchar* keyptr = NULL;
+    gchar* valptr = NULL;
+    gchar** p_keyptr = &keyptr;
+    gchar** p_valptr = &valptr;
 
-	if( g_hash_table_lookup_extended( gnc_html_object_handlers,
-											 classid,
-											(gpointer *)p_keyptr,
-											(gpointer *)p_valptr) ) {
-		g_hash_table_remove( gnc_html_object_handlers, classid );
-		g_free( keyptr );
-	}
+    if ( g_hash_table_lookup_extended( gnc_html_object_handlers,
+                                       classid,
+                                       (gpointer *)p_keyptr,
+                                       (gpointer *)p_valptr) )
+    {
+        g_hash_table_remove( gnc_html_object_handlers, classid );
+        g_free( keyptr );
+    }
 }
 
 void
 gnc_html_register_stream_handler( URLType url_type, GncHTMLStreamCB hand )
 {
-	g_return_if_fail( url_type != NULL && *url_type != '\0' );
+    g_return_if_fail( url_type != NULL && *url_type != '\0' );
 
-	if( gnc_html_stream_handlers == NULL ) {
-		gnc_html_stream_handlers = g_hash_table_new( g_str_hash, g_str_equal );
-	}
+    if ( gnc_html_stream_handlers == NULL )
+    {
+        gnc_html_stream_handlers = g_hash_table_new( g_str_hash, g_str_equal );
+    }
 
-	gnc_html_unregister_stream_handler( url_type );
-	if( hand != NULL ) {
-		g_hash_table_insert( gnc_html_stream_handlers, url_type, hand );
-	}
+    gnc_html_unregister_stream_handler( url_type );
+    if ( hand != NULL )
+    {
+        g_hash_table_insert( gnc_html_stream_handlers, url_type, hand );
+    }
 }
 
 void
 gnc_html_unregister_stream_handler( URLType url_type )
 {
-	g_hash_table_remove( gnc_html_stream_handlers, url_type );
+    g_hash_table_remove( gnc_html_stream_handlers, url_type );
 }
 
 void
 gnc_html_register_url_handler( URLType url_type, GncHTMLUrlCB hand )
 {
-	g_return_if_fail( url_type != NULL && *url_type != '\0' );
+    g_return_if_fail( url_type != NULL && *url_type != '\0' );
 
-	if( gnc_html_url_handlers == NULL ) {
-		gnc_html_url_handlers = g_hash_table_new( g_str_hash, g_str_equal );
-	}
+    if ( gnc_html_url_handlers == NULL )
+    {
+        gnc_html_url_handlers = g_hash_table_new( g_str_hash, g_str_equal );
+    }
 
-	gnc_html_unregister_url_handler( url_type );
-	if( hand != NULL ) {
-		g_hash_table_insert( gnc_html_url_handlers, url_type, hand );
-	}
+    gnc_html_unregister_url_handler( url_type );
+    if ( hand != NULL )
+    {
+        g_hash_table_insert( gnc_html_url_handlers, url_type, hand );
+    }
 }
 
 void
 gnc_html_unregister_url_handler( URLType url_type )
 {
-	g_hash_table_remove( gnc_html_url_handlers, url_type );
+    g_hash_table_remove( gnc_html_url_handlers, url_type );
 }

Modified: gnucash/trunk/src/html/gnc-html.h
===================================================================
--- gnucash/trunk/src/html/gnc-html.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gnc-html.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -52,27 +52,27 @@
  * by the handler and will be freed by gnc_html. */
 typedef struct
 {
-	/* The following members are used if the handler succeeds (returns TRUE). */
+    /* The following members are used if the handler succeeds (returns TRUE). */
 
-	gboolean load_to_stream; /* If TRUE, the url should be loaded from
+    gboolean load_to_stream; /* If TRUE, the url should be loaded from
                             * a stream using the rest of the data in
                             * the struct into the original gnc_html
                             * object. If FALSE, the handler will
                             * perform all needed actions itself. */
 
-	URLType url_type;        /* Defaults to original */
-	gchar* location;         /* If NULL, use original (NULL is default) */
-	gchar* label;            /* If NULL, use original (NULL is default) */
+    URLType url_type;        /* Defaults to original */
+    gchar* location;         /* If NULL, use original (NULL is default) */
+    gchar* label;            /* If NULL, use original (NULL is default) */
 
-	URLType base_type;
-	gchar* base_location;
+    URLType base_type;
+    gchar* base_location;
 
-	/* The following members are used if the handler fails (returns FALSE). */
-	gchar* error_message;
+    /* The following members are used if the handler fails (returns FALSE). */
+    gchar* error_message;
 } GNCURLResult;
 
 typedef gboolean (* GncHTMLObjectCB)(GncHtml* html, gpointer eb,
-                                 gpointer data); 
+                                     gpointer data);
 typedef gboolean (* GncHTMLStreamCB)(const gchar* location, gchar** data, int* datalen);
 typedef gboolean (* GncHTMLUrlCB)(const gchar* location, const gchar* label,
                                   gboolean new_window, GNCURLResult* result);
@@ -115,7 +115,7 @@
 typedef int  (* GncHTMLUrltypeCB)(URLType ut);
 typedef void (* GncHTMLFlyoverCB)(GncHtml* html, const gchar* url,
                                   gpointer data);
-typedef void (* GncHTMLLoadCB)(GncHtml* html, URLType type, 
+typedef void (* GncHTMLLoadCB)(GncHtml* html, URLType type,
                                const gchar* location, const gchar* label,
                                gpointer data);
 typedef int  (* GncHTMLButtonCB)(GncHtml* html, GdkEventButton* event,
@@ -123,31 +123,31 @@
 
 struct _GncHtmlClass
 {
-	GtkBinClass parent_class;
+    GtkBinClass parent_class;
 
-	/* Methods */
-	void (*show_url)( GncHtml* html, 
+    /* Methods */
+    void (*show_url)( GncHtml* html,
                       URLType type,
-                      const gchar* location, 
+                      const gchar* location,
                       const gchar* label,
                       gboolean new_window_hint );
-	void (*show_data)( GncHtml* html, const gchar* data, int datalen );
-	void (*reload)( GncHtml* html );
-	void (*copy_to_clipboard)( GncHtml* html );
-	gboolean (*export_to_file)( GncHtml* html, const gchar* file );
-	void (*print)( GncHtml* html );
-	void (*cancel)( GncHtml* html );
-	URLType (*parse_url)( GncHtml* html, const gchar* url, 
+    void (*show_data)( GncHtml* html, const gchar* data, int datalen );
+    void (*reload)( GncHtml* html );
+    void (*copy_to_clipboard)( GncHtml* html );
+    gboolean (*export_to_file)( GncHtml* html, const gchar* file );
+    void (*print)( GncHtml* html );
+    void (*cancel)( GncHtml* html );
+    URLType (*parse_url)( GncHtml* html, const gchar* url,
                           gchar** url_location, gchar** url_label );
-	void (*set_parent)( GncHtml* html, GtkWindow* parent );
+    void (*set_parent)( GncHtml* html, GtkWindow* parent );
 };
 
 struct _GncHtml
 {
-	GtkBin parent_instance;
+    GtkBin parent_instance;
 
-	/*< private >*/
-	GncHtmlPrivate* priv;
+    /*< private >*/
+    GncHtmlPrivate* priv;
 };
 
 /**
@@ -162,8 +162,8 @@
  *
  * @param html GncHtml object
  */
-void gnc_html_show_url( GncHtml* html, URLType type, const gchar* location, 
-						const gchar* label, gboolean new_window_hint );
+void gnc_html_show_url( GncHtml* html, URLType type, const gchar* location,
+                        const gchar* label, gboolean new_window_hint );
 
 /**
  * Displays an HTML string in a GncHtml object.
@@ -217,8 +217,8 @@
  * @param url_location Pointer where to store address of string containing main URI
  * @param url_label Pointer where to store address of string containing label
  */
-URLType gnc_html_parse_url( GncHtml* html, const gchar* url, 
-							gchar** url_location, gchar** url_label );
+URLType gnc_html_parse_url( GncHtml* html, const gchar* url,
+                            gchar** url_location, gchar** url_label );
 
 /**
  * Returns the history for this html engine

Modified: gnucash/trunk/src/html/gncmod-html.c
===================================================================
--- gnucash/trunk/src/html/gncmod-html.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/html/gncmod-html.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -31,21 +31,21 @@
 char *
 libgncmod_html_gnc_module_path( void )
 {
-	return g_strdup( "gnucash/html" );
+    return g_strdup( "gnucash/html" );
 }
 
 char *
 libgncmod_html_gnc_module_description( void )
 {
-	return g_strdup( "Utilities for using HTML with GnuCash" );
+    return g_strdup( "Utilities for using HTML with GnuCash" );
 }
 
 static void
 lmod( char* mn )
 {
-	char* form = g_strdup_printf( "(use-modules %s)\n", mn );
-	scm_c_eval_string( form );
-	g_free( form );
+    char* form = g_strdup_printf( "(use-modules %s)\n", mn );
+    scm_c_eval_string( form );
+    g_free( form );
 }
 
 extern SCM scm_init_sw_gnc_html_module( void );
@@ -53,30 +53,33 @@
 int
 libgncmod_html_gnc_module_init( int refcount )
 {
-	/* load the engine (we depend on it) */
-	if( !gnc_module_load( "gnucash/engine", 0 ) ) {
-		return FALSE;
-	}
+    /* load the engine (we depend on it) */
+    if ( !gnc_module_load( "gnucash/engine", 0 ) )
+    {
+        return FALSE;
+    }
 
-	/* load the calculation module (we depend on it) */
-	if( !gnc_module_load( "gnucash/calculation", 0 ) ) {
-		return FALSE;
-	}
+    /* load the calculation module (we depend on it) */
+    if ( !gnc_module_load( "gnucash/calculation", 0 ) )
+    {
+        return FALSE;
+    }
 
-	if( !gnc_module_load( "gnucash/app-utils", 0 ) ) {
-		return FALSE;
-	}
+    if ( !gnc_module_load( "gnucash/app-utils", 0 ) )
+    {
+        return FALSE;
+    }
 
-	scm_init_sw_gnc_html_module();
-	gnc_html_initialize();
-	lmod( "(sw_gnc_html)" );
+    scm_init_sw_gnc_html_module();
+    gnc_html_initialize();
+    lmod( "(sw_gnc_html)" );
 //	lmod( "(gnucash gnc_html)" );
 
-	return TRUE;
+    return TRUE;
 }
 
 int
 libgncmod_html_gnc_module_end( int refcount )
 {
-	return TRUE;
+    return TRUE;
 }

Modified: gnucash/trunk/src/import-export/aqbanking/dialog-ab-trans.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/dialog-ab-trans.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/dialog-ab-trans.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -72,13 +72,15 @@
 void dat_sort_templ_cb(GtkButton *button, gpointer user_data);
 void dat_del_templ_cb(GtkButton *button, gpointer user_data);
 
-enum {
+enum
+{
     TEMPLATE_NAME,
     TEMPLATE_POINTER,
     TEMPLATE_NUM_COLUMNS
 };
 
-struct _GncABTransDialog {
+struct _GncABTransDialog
+{
     /* The dialog itself */
     GtkWidget *dialog;
     GtkWidget *parent;
@@ -180,7 +182,8 @@
 
     /* If this is a direct debit, a textkey/ "Textschluessel"/transactionCode
      * different from the default has to be set. */
-    switch (td->trans_type) {
+    switch (td->trans_type)
+    {
     case SINGLE_DEBITNOTE:
         /* AB_Transaction_SetTransactionCode (trans, 05); */
         AB_Transaction_SetTextKey(trans, 05);
@@ -283,7 +286,8 @@
 
     /* Check for what kind of transaction this should be, and change the
      * labels accordingly */
-    switch (trans_type) {
+    switch (trans_type)
+    {
     case SINGLE_TRANSFER:
     case SINGLE_INTERNAL_TRANSFER:
         /* all labels are already set */
@@ -300,7 +304,7 @@
                              * country, you may safely ignore strings
                              * from the import-export/hbci
                              * subdirectory. */
-                            _("Enter an Online Direct Debit Note"));
+                           _("Enter an Online Direct Debit Note"));
 
         gtk_label_set_text(GTK_LABEL(recp_name_heading),
                            _("Debited Account Owner"));
@@ -329,7 +333,7 @@
 
     /* Fill list for choosing a transaction template */
     td->template_list_store = gtk_list_store_new(TEMPLATE_NUM_COLUMNS,
-                                                 G_TYPE_STRING, G_TYPE_POINTER);
+                              G_TYPE_STRING, G_TYPE_POINTER);
     g_list_foreach(templates, fill_templ_helper, td->template_list_store);
     gtk_tree_view_set_model(td->template_gtktreeview,
                             GTK_TREE_MODEL(td->template_list_store));
@@ -339,7 +343,7 @@
     /* Show this list */
     renderer = gtk_cell_renderer_text_new();
     column = gtk_tree_view_column_new_with_attributes(
-        "Template Name", renderer, "text", TEMPLATE_NAME, NULL);
+                 "Template Name", renderer, "text", TEMPLATE_NAME, NULL);
     gtk_tree_view_append_column(td->template_gtktreeview, column);
 
     return td;
@@ -359,20 +363,21 @@
     ENTER(" ");
 
     blzresult = AccountNumberCheck_check(
-        td->blzcheck,
-        AB_Transaction_GetRemoteBankCode(trans),
-        AB_Transaction_GetRemoteAccountNumber(trans));
-    switch (blzresult) {
+                    td->blzcheck,
+                    AB_Transaction_GetRemoteBankCode(trans),
+                    AB_Transaction_GetRemoteAccountNumber(trans));
+    switch (blzresult)
+    {
     case 2:
         gtk_widget_show(parent);
         values_ok = gnc_verify_dialog(
-            parent, TRUE,
-            _("The internal check of the destination account number '%s' "
-              "at the specified bank with bank code '%s' failed. This means "
-              "the account number might contain an error. Should the online "
-              "transfer job be sent with this account number anyway?"),
-            AB_Transaction_GetRemoteAccountNumber(trans),
-            AB_Transaction_GetRemoteBankCode(trans));
+                        parent, TRUE,
+                        _("The internal check of the destination account number '%s' "
+                          "at the specified bank with bank code '%s' failed. This means "
+                          "the account number might contain an error. Should the online "
+                          "transfer job be sent with this account number anyway?"),
+                        AB_Transaction_GetRemoteAccountNumber(trans),
+                        AB_Transaction_GetRemoteBankCode(trans));
         blztext = "Kontonummer wahrscheinlich falsch";
         break;
     case 0:
@@ -407,7 +412,8 @@
 
     /* Check whether the account supports this job */
     job = get_available_empty_job(td->ab_acc, td->trans_type);
-    if (!job) {
+    if (!job)
+    {
         g_warning("gnc_ab_trans_dialog_run_until_ok: Oops, job not available");
         return GTK_RESPONSE_CANCEL;
     }
@@ -415,7 +421,7 @@
     /* Activate as many purpose entries as available for the job */
     joblimits = AB_JobSingleTransfer_GetFieldLimits(job);
     max_purpose_lines = joblimits ?
-        AB_TransactionLimits_GetMaxLinesPurpose(joblimits) : 2;
+                        AB_TransactionLimits_GetMaxLinesPurpose(joblimits) : 2;
     gtk_widget_set_sensitive(td->purpose_cont_entry, max_purpose_lines > 1);
     gtk_widget_set_sensitive(td->purpose_cont2_entry, max_purpose_lines > 2);
     gtk_widget_set_sensitive(td->purpose_cont3_entry, max_purpose_lines > 3);
@@ -424,7 +430,8 @@
     gtk_widget_show(td->dialog);
 
     /* Repeat until entered values make sense */
-    do {
+    do
+    {
         /* Now run the dialog until it gets closed by a button press */
         result = gtk_dialog_run (GTK_DIALOG (td->dialog));
 
@@ -433,7 +440,8 @@
          *  GNC_RESPONSE_LATER == scheduled for later execution (unimplemented)
          *  GTK_RESPONSE_CANCEL == cancel
          *  GTK_RESPONSE_DELETE_EVENT == window destroyed */
-        if (result != GNC_RESPONSE_NOW && result != GNC_RESPONSE_LATER) {
+        if (result != GNC_RESPONSE_NOW && result != GNC_RESPONSE_LATER)
+        {
             gtk_widget_destroy(td->dialog);
             td->dialog = NULL;
             break;
@@ -448,18 +456,22 @@
         values_ok =
             AB_Value_GetValueAsDouble(AB_Transaction_GetValue(td->ab_trans))
             != 0.0;
-        if (!values_ok) {
+        if (!values_ok)
+        {
             gtk_widget_show(td->dialog);
             if (gnc_verify_dialog(
-                    td->dialog, TRUE, "%s",
-                    _("The amount is zero or the amount field could not be "
-                      "interpreted correctly. You might have mixed up decimal "
-                      "point and comma, compared to your locale settings. "
-                      "This does not result in a valid online transfer job. \n"
-                      "\n"
-                      "Do you want to enter the job again?"))) {
+                        td->dialog, TRUE, "%s",
+                        _("The amount is zero or the amount field could not be "
+                          "interpreted correctly. You might have mixed up decimal "
+                          "point and comma, compared to your locale settings. "
+                          "This does not result in a valid online transfer job. \n"
+                          "\n"
+                          "Do you want to enter the job again?")))
+            {
                 continue;
-            } else {
+            }
+            else
+            {
                 AB_Transaction_free(td->ab_trans);
                 td->ab_trans = NULL;
                 result = GTK_RESPONSE_CANCEL;
@@ -471,16 +483,20 @@
         purpose = gnc_ab_get_purpose(td->ab_trans);
         values_ok = *purpose;
         g_free(purpose);
-        if (!values_ok) {
+        if (!values_ok)
+        {
             gtk_widget_show(td->dialog);
             if (gnc_verify_dialog(
-                    td->dialog, TRUE, "%s",
-                    _("You did not enter any transaction purpose. A purpose is "
-                      "required for an online transfer.\n"
-                      "\n"
-                      "Do you want to enter the job again?"))) {
+                        td->dialog, TRUE, "%s",
+                        _("You did not enter any transaction purpose. A purpose is "
+                          "required for an online transfer.\n"
+                          "\n"
+                          "Do you want to enter the job again?")))
+            {
                 continue;
-            } else {
+            }
+            else
+            {
                 AB_Transaction_free(td->ab_trans);
                 td->ab_trans = NULL;
                 result = GTK_RESPONSE_CANCEL;
@@ -492,16 +508,20 @@
         othername = gnc_ab_get_remote_name(td->ab_trans);
         values_ok = othername && *othername;
         g_free(othername);
-        if (!values_ok) {
+        if (!values_ok)
+        {
             gtk_widget_show(td->dialog);
             if (gnc_verify_dialog(
-                    td->dialog, TRUE, "%s",
-                    _("You did not enter a recipient name.  A recipient name is "
-                      "required for an online transfer.\n"
-                      "\n"
-                      "Do you want to enter the job again?"))) {
+                        td->dialog, TRUE, "%s",
+                        _("You did not enter a recipient name.  A recipient name is "
+                          "required for an online transfer.\n"
+                          "\n"
+                          "Do you want to enter the job again?")))
+            {
                 continue;
-            } else {
+            }
+            else
+            {
                 AB_Transaction_free(td->ab_trans);
                 td->ab_trans = NULL;
                 result = GTK_RESPONSE_CANCEL;
@@ -517,7 +537,8 @@
         /* And finally check the account code, if ktoblzcheck is available */
         values_ok = check_ktoblzcheck(td->dialog, td, td->ab_trans);
 
-    } while (!values_ok);
+    }
+    while (!values_ok);
 
     /* Hide the dialog */
     if (td->dialog)
@@ -528,7 +549,8 @@
 
 static gboolean
 clear_templ_helper(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
-                   gpointer user_data) {
+                   gpointer user_data)
+{
     GncABTransTempl *templ;
 
     g_return_val_if_fail(model && iter, TRUE);
@@ -546,7 +568,8 @@
         AB_Transaction_free(td->ab_trans);
     if (td->dialog)
         gtk_widget_destroy(td->dialog);
-    if (td->template_list_store) {
+    if (td->template_list_store)
+    {
         gtk_tree_model_foreach(GTK_TREE_MODEL(td->template_list_store),
                                clear_templ_helper, NULL);
         g_object_unref(td->template_list_store);
@@ -578,7 +601,8 @@
 
     g_return_val_if_fail(td, NULL);
 
-    if (changed) {
+    if (changed)
+    {
         *changed = td->templ_changed;
         if (!*changed)
             return NULL;
@@ -609,7 +633,8 @@
 {
     AB_JOB *job;
 
-    switch (trans_type) {
+    switch (trans_type)
+    {
     case SINGLE_DEBITNOTE:
         job = AB_JobSingleDebitNote_new(ab_acc);
         break;
@@ -621,7 +646,8 @@
         job = AB_JobSingleTransfer_new(ab_acc);
     };
 
-    if (!job || AB_Job_CheckAvailability(job, 0)) {
+    if (!job || AB_Job_CheckAvailability(job, 0))
+    {
         if (job) AB_Job_free(job);
         return NULL;
     }
@@ -644,8 +670,10 @@
     g_return_val_if_fail(ab_acc && ab_trans, NULL);
 
     job = get_available_empty_job(ab_acc, trans_type);
-    if (job) {
-        switch (trans_type) {
+    if (job)
+    {
+        switch (trans_type)
+        {
         case SINGLE_DEBITNOTE:
             AB_JobSingleDebitNote_SetTransaction(job, ab_trans);
             break;
@@ -681,7 +709,8 @@
 
     ENTER("td=%p", td);
     if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(td->template_list_store), &iter,
-                                 path)) {
+                                 path))
+    {
         LEAVE("Could not get iter");
         return;
     }
@@ -713,16 +742,18 @@
 
     /* Check for differences to avoid overwriting entered text */
     if ((*old_name && strcmp(old_name, new_name))
-        || (*old_account && strcmp(old_account, new_account))
-        || (*old_bankcode && strcmp(old_bankcode, new_bankcode))
-        || (*old_purpose && strcmp(old_purpose, new_purpose))
-        || (*old_purpose_cont && strcmp(old_purpose_cont, new_purpose_cont))
-        || (*old_amount_text && !gnc_numeric_equal(old_amount, new_amount))) {
+            || (*old_account && strcmp(old_account, new_account))
+            || (*old_bankcode && strcmp(old_bankcode, new_bankcode))
+            || (*old_purpose && strcmp(old_purpose, new_purpose))
+            || (*old_purpose_cont && strcmp(old_purpose_cont, new_purpose_cont))
+            || (*old_amount_text && !gnc_numeric_equal(old_amount, new_amount)))
+    {
         if (!gnc_verify_dialog(
-                td->parent, FALSE,
-                _("Do you really want to overwrite your changes with the "
-                  "contents of the template \"%s\"?"),
-                gnc_ab_trans_templ_get_name(templ))) {
+                    td->parent, FALSE,
+                    _("Do you really want to overwrite your changes with the "
+                      "contents of the template \"%s\"?"),
+                    gnc_ab_trans_templ_get_name(templ)))
+        {
 
             LEAVE("aborted");
             return;
@@ -752,7 +783,8 @@
     ENTER("td=%p, input=%s", td, input);
     record = AccountNumberCheck_findBank(td->blzcheck, input);
 
-    if (record) {
+    if (record)
+    {
         const char *bankname = AccountNumberCheck_Record_bankName(record);
         GError *error = NULL;
         const char *ktoblzcheck_encoding =
@@ -771,7 +803,8 @@
                                          ktoblzcheck_encoding, NULL, NULL,
                                          &error);
 
-        if (error) {
+        if (error)
+        {
             g_critical("Error converting bankname \"%s\" to UTF-8", bankname);
             g_error_free (error);
             /* Conversion was erroneous, so don't use the string */
@@ -781,14 +814,17 @@
                            *utf8_bankname ? utf8_bankname : _("(unknown)"));
         DEBUG("Found: %s", utf8_bankname);
         g_free(utf8_bankname);
-    } else {
+    }
+    else
+    {
         gtk_label_set_text(GTK_LABEL(td->recp_bankname_label), _("(unknown)"));
     }
     LEAVE(" ");
 #endif
 }
 
-struct _FindTemplData {
+struct _FindTemplData
+{
     const gchar *name;
     const GncABTransTempl *pointer;
 };
@@ -807,12 +843,15 @@
                        TEMPLATE_NAME, &name,
                        TEMPLATE_POINTER, &templ,
                        -1);
-    if (data->name) {
+    if (data->name)
+    {
         /* Search for the template by name */
         g_return_val_if_fail(!data->pointer, TRUE);
         match = strcmp(name, data->name) == 0;
         if (match) data->pointer = templ;
-    } else {
+    }
+    else
+    {
         /* Search for the template by template pointer */
         g_return_val_if_fail(!data->name, TRUE);
         match = templ == data->pointer;
@@ -849,7 +888,8 @@
     gtk_entry_set_text(GTK_ENTRY(entry),
                        gtk_entry_get_text(GTK_ENTRY(td->recp_name_entry)));
 
-    do {
+    do
+    {
         retval = gtk_dialog_run(GTK_DIALOG(dialog));
         if (retval != GTK_RESPONSE_OK)
             break;
@@ -862,7 +902,8 @@
         data.pointer = NULL;
         gtk_tree_model_foreach(GTK_TREE_MODEL(td->template_list_store),
                                find_templ_helper, &data);
-        if (data.pointer) {
+        if (data.pointer)
+        {
             gnc_error_dialog(dialog, "%s",
                              _("A template with the given name already exists.  "
                                "Please enter another name."));
@@ -871,20 +912,23 @@
 
         /* Create a new template */
         templ = gnc_ab_trans_templ_new_full(
-            name,
-            gtk_entry_get_text(GTK_ENTRY(td->recp_name_entry)),
-            gtk_entry_get_text(GTK_ENTRY(td->recp_account_entry)),
-            gtk_entry_get_text(GTK_ENTRY(td->recp_bankcode_entry)),
-            gnc_amount_edit_get_amount(GNC_AMOUNT_EDIT(td->amount_edit)),
-            gtk_entry_get_text(GTK_ENTRY(td->purpose_entry)),
-            gtk_entry_get_text (GTK_ENTRY(td->purpose_cont_entry)));
+                    name,
+                    gtk_entry_get_text(GTK_ENTRY(td->recp_name_entry)),
+                    gtk_entry_get_text(GTK_ENTRY(td->recp_account_entry)),
+                    gtk_entry_get_text(GTK_ENTRY(td->recp_bankcode_entry)),
+                    gnc_amount_edit_get_amount(GNC_AMOUNT_EDIT(td->amount_edit)),
+                    gtk_entry_get_text(GTK_ENTRY(td->purpose_entry)),
+                    gtk_entry_get_text (GTK_ENTRY(td->purpose_cont_entry)));
 
         /* Insert it, either after the selected one or at the end */
         selection = gtk_tree_view_get_selection(td->template_gtktreeview);
-        if (gtk_tree_selection_get_selected(selection, NULL, &cur_iter)) {
+        if (gtk_tree_selection_get_selected(selection, NULL, &cur_iter))
+        {
             gtk_list_store_insert_after(td->template_list_store,
                                         &new_iter, &cur_iter);
-        } else {
+        }
+        else
+        {
             gtk_list_store_append(td->template_list_store, &new_iter);
         }
         gtk_list_store_set(td->template_list_store, &new_iter,
@@ -894,7 +938,8 @@
         td->templ_changed = TRUE;
         DEBUG("Added template with name %s", name);
         break;
-    } while (TRUE);
+    }
+    while (TRUE);
 
     gtk_widget_destroy(dialog);
 
@@ -918,8 +963,10 @@
         return;
 
     prev_path = gtk_tree_model_get_path(model, &iter);
-    if (gtk_tree_path_prev(prev_path)) {
-        if (gtk_tree_model_get_iter(model, &prev_iter, prev_path)) {
+    if (gtk_tree_path_prev(prev_path))
+    {
+        if (gtk_tree_model_get_iter(model, &prev_iter, prev_path))
+        {
             gtk_list_store_move_before(GTK_LIST_STORE(model), &iter, &prev_iter);
             td->templ_changed = TRUE;
         }
@@ -943,7 +990,8 @@
         return;
 
     next_iter = iter;
-    if (gtk_tree_model_iter_next(model, &next_iter)) {
+    if (gtk_tree_model_iter_next(model, &next_iter))
+    {
         gtk_list_store_move_after(GTK_LIST_STORE(model), &iter, &next_iter);
         td->templ_changed = TRUE;
     }
@@ -981,16 +1029,18 @@
 
     ENTER("td=%p", td);
     selection = gtk_tree_view_get_selection(td->template_gtktreeview);
-    if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
+    if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+    {
         LEAVE("None selected");
         return;
     }
 
     gtk_tree_model_get(model, &iter, TEMPLATE_NAME, &name, -1);
     if (gnc_verify_dialog(
-            td->parent, FALSE,
-            _("Do you really want to delete the template with the name \"%s\"?"),
-            name)) {
+                td->parent, FALSE,
+                _("Do you really want to delete the template with the name \"%s\"?"),
+                name))
+    {
         gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
         td->templ_changed = TRUE;
         DEBUG("Deleted template with name %s", name);

Modified: gnucash/trunk/src/import-export/aqbanking/dialog-ab-trans.h
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/dialog-ab-trans.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/dialog-ab-trans.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -48,7 +48,8 @@
 typedef struct _GncABTransDialog GncABTransDialog;
 
 typedef enum _GncABTransType GncABTransType;
-enum _GncABTransType {
+enum _GncABTransType
+{
     SINGLE_TRANSFER = 0,
     SINGLE_DEBITNOTE,
     SINGLE_INTERNAL_TRANSFER
@@ -67,9 +68,9 @@
  * @return FIXME
  */
 GncABTransDialog *gnc_ab_trans_dialog_new(GtkWidget *parent, AB_ACCOUNT *ab_acc,
-                                          gint commodity_scu,
-                                          GncABTransType trans_type,
-                                          GList *templates);
+        gint commodity_scu,
+        GncABTransType trans_type,
+        GList *templates);
 
 /**
  * FIXME

Modified: gnucash/trunk/src/import-export/aqbanking/dialog-daterange.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/dialog-daterange.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/dialog-daterange.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -42,10 +42,10 @@
 
 struct _DaterangeInfo
 {
-  GtkWidget *enter_from_button;
-  GtkWidget *enter_to_button;
-  GtkWidget *from_dateedit;
-  GtkWidget *to_dateedit;
+    GtkWidget *enter_from_button;
+    GtkWidget *enter_to_button;
+    GtkWidget *from_dateedit;
+    GtkWidget *to_dateedit;
 };
 
 gboolean
@@ -93,10 +93,13 @@
                       info.to_dateedit);
     gtk_widget_show(info.to_dateedit);
 
-    if (*last_retv_date) {
+    if (*last_retv_date)
+    {
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(last_retrieval_button),
                                      TRUE);
-    } else {
+    }
+    else
+    {
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(first_button), TRUE);
         gtk_widget_set_sensitive(last_retrieval_button, FALSE);
     }
@@ -114,17 +117,18 @@
     result = gtk_dialog_run(GTK_DIALOG(dialog));
     gtk_widget_hide(dialog);
 
-    if (result == GTK_RESPONSE_OK) {
+    if (result == GTK_RESPONSE_OK)
+    {
         *from_date = gnc_date_edit_get_date_ts(
-            GNC_DATE_EDIT(info.from_dateedit));
+                         GNC_DATE_EDIT(info.from_dateedit));
         *last_retv_date = gtk_toggle_button_get_active(
-            GTK_TOGGLE_BUTTON(last_retrieval_button));
+                              GTK_TOGGLE_BUTTON(last_retrieval_button));
         *first_possible_date = gtk_toggle_button_get_active(
-            GTK_TOGGLE_BUTTON(first_button));
+                                   GTK_TOGGLE_BUTTON(first_button));
         *to_date = gnc_date_edit_get_date_ts(
-            GNC_DATE_EDIT(info.to_dateedit));
+                       GNC_DATE_EDIT(info.to_dateedit));
         *to_now = gtk_toggle_button_get_active(
-            GTK_TOGGLE_BUTTON(now_button));
+                      GTK_TOGGLE_BUTTON(now_button));
     }
 
     gtk_widget_destroy(dialog);

Modified: gnucash/trunk/src/import-export/aqbanking/druid-ab-initial.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/druid-ab-initial.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/druid-ab-initial.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -86,7 +86,8 @@
 static void save_kvp_acc_cb(gpointer key, gpointer value, gpointer user_data);
 static void cm_close_handler(gpointer user_data);
 
-struct _ABInitialInfo {
+struct _ABInitialInfo
+{
     GtkWidget *window;
     GtkWidget *druid;
 
@@ -104,23 +105,27 @@
     GHashTable *gnc_hash;
 };
 
-struct _DeferredInfo {
+struct _DeferredInfo
+{
     ABInitialInfo *initial_info;
     gchar *wizard_path;
     gboolean qt_probably_unavailable;
 };
 
-struct _AccCbData {
+struct _AccCbData
+{
     AB_BANKING *api;
     GHashTable *hash;
 };
 
-struct _RevLookupData {
+struct _RevLookupData
+{
     Account *gnc_acc;
     AB_ACCOUNT *ab_acc;
 };
 
-enum account_list_cols {
+enum account_list_cols
+{
     ACCOUNT_LIST_COL_INDEX = 0,
     ACCOUNT_LIST_COL_AB_NAME,
     ACCOUNT_LIST_COL_AB_ACCT,
@@ -132,10 +137,13 @@
 gboolean
 dai_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
 {
-    if (event->keyval == GDK_Escape) {
+    if (event->keyval == GDK_Escape)
+    {
         gtk_widget_destroy(widget);
         return TRUE;
-    } else {
+    }
+    else
+    {
         return FALSE;
     }
 }
@@ -155,7 +163,8 @@
 
     gnc_unregister_gui_component_by_data(DRUID_AB_INITIAL_CM_CLASS, info);
 
-    if (info->deferred_info) {
+    if (info->deferred_info)
+    {
         g_message("Online Banking druid is being closed but the wizard is still "
                   "running.  Inoring.");
 
@@ -163,7 +172,8 @@
         info->deferred_info->initial_info = NULL;
     }
 
-    if (info->gnc_hash) {
+    if (info->gnc_hash)
+    {
 #ifdef AQBANKING_VERSION_4_PLUS
         AB_Banking_OnlineFini(info->api, 0);
 #else
@@ -173,7 +183,8 @@
         info->gnc_hash = NULL;
     }
 
-    if (info->api) {
+    if (info->api)
+    {
         gnc_AB_BANKING_delete(info->api);
         info->api = NULL;
     }
@@ -212,7 +223,8 @@
 
     ENTER("user_data: %p", user_data);
 
-    if (info->deferred_info) {
+    if (info->deferred_info)
+    {
         LEAVE("Wizard is still running");
         return;
     }
@@ -231,7 +243,8 @@
     wizard_exists = *GWEN_Buffer_GetStart(buf) != 0;
     wizard_path = GWEN_Buffer_GetStart(buf);
 
-    if (wizard_exists) {
+    if (wizard_exists)
+    {
         /* Really check whether the file exists */
         gint fd = g_open(wizard_path, O_RDONLY, 0);
         if (fd == -1)
@@ -244,10 +257,13 @@
     {
         const char *check_file = "qtdemo.exe";
         gchar *found_program = g_find_program_in_path(check_file);
-        if (found_program) {
+        if (found_program)
+        {
             g_debug("Yes, we found the Qt demo program in %s\n", found_program);
             g_free(found_program);
-        } else {
+        }
+        else
+        {
             g_warning("Ouch, no Qt demo program was found. Qt not installed?\n");
             qt_probably_unavailable = TRUE;
         }
@@ -256,7 +272,8 @@
 
     druid_disable_next_button(info);
 
-    if (wizard_exists) {
+    if (wizard_exists)
+    {
         /* Call the qt wizard. See the note above about why this
          * approach is chosen. */
 
@@ -276,11 +293,14 @@
                 "Error on starting AqBanking setup wizard: Code %d: %s",
                 error->code, error->message ? error->message : "(null)");
 
-        if (!spawned) {
+        if (!spawned)
+        {
             g_critical("Could not start AqBanking setup wizard: %s",
                        error->message ? error->message : "(null)");
             g_error_free (error);
-        } else {
+        }
+        else
+        {
             /* Keep a reference to info that can survive info */
             info->deferred_info = g_new0(DeferredInfo, 1);
             info->deferred_info->initial_info = info;
@@ -290,17 +310,19 @@
 
             g_child_watch_add (pid, child_exit_cb, info->deferred_info);
         }
-    } else {
+    }
+    else
+    {
         g_warning("on_aqhbci_button: Oops, no aqhbci setup wizard found.");
         gnc_error_dialog
-            (info->window,
-             _("The external program \"AqBanking Setup Wizard\" has not "
-               "been found. \n\n"
-               "The %s package should include the "
-               "program \"qt3-wizard\".  Please check your installation to "
-               "ensure this program is present.  On some distributions this "
-               "may require installing additional packages."),
-             QT3_WIZARD_PACKAGE);
+        (info->window,
+         _("The external program \"AqBanking Setup Wizard\" has not "
+           "been found. \n\n"
+           "The %s package should include the "
+           "program \"qt3-wizard\".  Please check your installation to "
+           "ensure this program is present.  On some distributions this "
+           "may require installing additional packages."),
+         QT3_WIZARD_PACKAGE);
         druid_disable_next_button(info);
     }
 
@@ -439,44 +461,51 @@
 
     g_spawn_close_pid(pid);
 
-    if (!info) {
+    if (!info)
+    {
         g_message("Online Banking wizard exited, but the druid has been "
                   "destroyed already");
         goto cleanup_child_exit_cb;
     }
 
-    if (exit_status == 0) {
+    if (exit_status == 0)
+    {
         druid_enable_next_button(info);
-    } else {
-        if (deferred_info->qt_probably_unavailable) {
+    }
+    else
+    {
+        if (deferred_info->qt_probably_unavailable)
+        {
             g_warning("on_aqhbci_button: Oops, aqhbci wizard return nonzero "
                       "value: %d. The called program was \"%s\".\n",
                       exit_status, deferred_info->wizard_path);
             gnc_error_dialog
-                (info->window, "%s",
-                 _("The external program \"AqBanking Setup Wizard\" failed "
-                   "to run successfully because the "
-                   "additional software \"Qt\" was not found.  "
-                   "Please install the \"Qt/Windows Open Source Edition\" "
-                   "from Trolltech by downloading it from www.trolltech.com"
-                   "\n\n"
-                   "If you have installed Qt already, you will have to adapt "
-                   "the PATH variable of your system appropriately.  "
-                   "Contact the GnuCash developers if you need further "
-                   "assistance on how to install Qt correctly."
-                   "\n\n"
-                   "Online Banking cannot be setup without Qt.  Press \"Close\" "
-                   "now, then \"Cancel\" to cancel the Online Banking setup."));
-        } else {
+            (info->window, "%s",
+             _("The external program \"AqBanking Setup Wizard\" failed "
+               "to run successfully because the "
+               "additional software \"Qt\" was not found.  "
+               "Please install the \"Qt/Windows Open Source Edition\" "
+               "from Trolltech by downloading it from www.trolltech.com"
+               "\n\n"
+               "If you have installed Qt already, you will have to adapt "
+               "the PATH variable of your system appropriately.  "
+               "Contact the GnuCash developers if you need further "
+               "assistance on how to install Qt correctly."
+               "\n\n"
+               "Online Banking cannot be setup without Qt.  Press \"Close\" "
+               "now, then \"Cancel\" to cancel the Online Banking setup."));
+        }
+        else
+        {
             g_warning("on_aqhbci_button: Oops, aqhbci wizard return nonzero "
                       "value: %d. The called program was \"%s\".\n",
                       exit_status, deferred_info->wizard_path);
             gnc_error_dialog
-                (info->window, "%s",
-                 _("The external program \"AqBanking Setup Wizard\" failed "
-                   "to run successfully.  Online Banking can only be setup "
-                   "if this wizard has run successfully.  "
-                   "Please try running the \"AqBanking Setup Wizard\" again."));
+            (info->window, "%s",
+             _("The external program \"AqBanking Setup Wizard\" failed "
+               "to run successfully.  Online Banking can only be setup "
+               "if this wizard has run successfully.  "
+               "Please try running the \"AqBanking Setup Wizard\" again."));
         }
         druid_disable_next_button(info);
     }
@@ -585,7 +614,8 @@
 
     g_return_val_if_fail(data, TRUE);
 
-    if (value == data->gnc_acc) {
+    if (value == data->gnc_acc)
+    {
         data->ab_acc = (AB_ACCOUNT*) key;
         return TRUE;
     }
@@ -604,7 +634,8 @@
 
     gtk_tree_model_get(model, iter, ACCOUNT_LIST_COL_AB_ACCT, &ab_acc, -1);
 
-    if (ab_acc == data->ab_acc) {
+    if (ab_acc == data->ab_acc)
+    {
         gtk_list_store_set(store, iter, ACCOUNT_LIST_COL_GNC_NAME, "",
                            ACCOUNT_LIST_COL_CHECKED, TRUE, -1);
         return TRUE;
@@ -636,16 +667,18 @@
     gtk_tree_selection_unselect_iter(selection, &iter);
     g_signal_handlers_unblock_by_func(selection, account_list_changed_cb, info);
 
-    if (ab_acc) {
+    if (ab_acc)
+    {
         old_value = g_hash_table_lookup(info->gnc_hash, ab_acc);
 
         longname = ab_account_longname(ab_acc);
         currency = AB_Account_GetCurrency(ab_acc);
-        if (currency && *currency) {
+        if (currency && *currency)
+        {
             commodity = gnc_commodity_table_lookup(
-                gnc_commodity_table_get_table(gnc_get_current_book()),
-                GNC_COMMODITY_NS_CURRENCY,
-                currency);
+                            gnc_commodity_table_get_table(gnc_get_current_book()),
+                            GNC_COMMODITY_NS_CURRENCY,
+                            currency);
         }
 
         gnc_acc = gnc_import_select_account(info->window, NULL, TRUE,
@@ -653,8 +686,10 @@
                                             old_value, &ok_pressed);
         g_free(longname);
 
-        if (ok_pressed && old_value != gnc_acc) {
-            if (gnc_acc) {
+        if (ok_pressed && old_value != gnc_acc)
+        {
+            if (gnc_acc)
+            {
                 RevLookupData data;
 
                 /* Lookup and clear other mappings to gnc_acc */
@@ -662,7 +697,8 @@
                 data.ab_acc = NULL;
                 g_hash_table_find(info->gnc_hash, (GHRFunc) find_gnc_acc_cb,
                                   &data);
-                if (data.ab_acc) {
+                if (data.ab_acc)
+                {
                     g_hash_table_remove(info->gnc_hash, data.ab_acc);
                     gtk_tree_model_foreach(
                         GTK_TREE_MODEL(info->account_store),
@@ -679,7 +715,9 @@
                                    -1);
                 g_free(gnc_name);
 
-            } else {
+            }
+            else
+            {
                 g_hash_table_remove(info->gnc_hash, ab_acc);
                 gtk_list_store_set(info->account_store, &iter,
                                    ACCOUNT_LIST_COL_GNC_NAME, "",
@@ -719,15 +757,15 @@
     ab_accountid = AB_Account_GetAccountNumber(ab_acc);
     gnc_accountid = gnc_ab_get_account_accountid(gnc_acc);
     if (ab_accountid
-        && (!gnc_accountid
-            || (strcmp(ab_accountid, gnc_accountid) != 0)))
+            && (!gnc_accountid
+                || (strcmp(ab_accountid, gnc_accountid) != 0)))
         gnc_ab_set_account_accountid(gnc_acc, ab_accountid);
 
     ab_bankcode = AB_Account_GetBankCode(ab_acc);
     gnc_bankcode = gnc_ab_get_account_bankcode(gnc_acc);
     if (ab_bankcode
-        && (!gnc_bankcode
-            || (strcmp(gnc_bankcode, ab_bankcode) != 0)))
+            && (!gnc_bankcode
+                || (strcmp(gnc_bankcode, ab_bankcode) != 0)))
         gnc_ab_set_account_bankcode(gnc_acc, ab_bankcode);
 }
 
@@ -768,27 +806,27 @@
     info->account_view =
         GTK_TREE_VIEW(glade_xml_get_widget(xml, "account_page_view"));
     info->account_store = gtk_list_store_new(NUM_ACCOUNT_LIST_COLS,
-                                             G_TYPE_INT, G_TYPE_STRING,
-                                             G_TYPE_POINTER, G_TYPE_STRING,
-                                             G_TYPE_BOOLEAN);
+                          G_TYPE_INT, G_TYPE_STRING,
+                          G_TYPE_POINTER, G_TYPE_STRING,
+                          G_TYPE_BOOLEAN);
     gtk_tree_view_set_model(info->account_view,
                             GTK_TREE_MODEL(info->account_store));
     g_object_unref(info->account_store);
 
     column = gtk_tree_view_column_new_with_attributes(
-        _("Online Banking Account Name"), gtk_cell_renderer_text_new(),
-        "text", ACCOUNT_LIST_COL_AB_NAME, (gchar*) NULL);
+                 _("Online Banking Account Name"), gtk_cell_renderer_text_new(),
+                 "text", ACCOUNT_LIST_COL_AB_NAME, (gchar*) NULL);
     gtk_tree_view_append_column(info->account_view, column);
 
     column = gtk_tree_view_column_new_with_attributes(
-        _("GnuCash Account Name"), gtk_cell_renderer_text_new(),
-        "text", ACCOUNT_LIST_COL_GNC_NAME, (gchar*) NULL);
+                 _("GnuCash Account Name"), gtk_cell_renderer_text_new(),
+                 "text", ACCOUNT_LIST_COL_GNC_NAME, (gchar*) NULL);
     gtk_tree_view_column_set_expand(column, TRUE);
     gtk_tree_view_append_column(info->account_view, column);
 
     column = gtk_tree_view_column_new_with_attributes(
-        _("New?"), gtk_cell_renderer_toggle_new(),
-        "active", ACCOUNT_LIST_COL_CHECKED, (gchar*) NULL);
+                 _("New?"), gtk_cell_renderer_toggle_new(),
+                 "active", ACCOUNT_LIST_COL_CHECKED, (gchar*) NULL);
     gtk_tree_view_append_column(info->account_view, column);
 
     selection = gtk_tree_view_get_selection(info->account_view);
@@ -796,7 +834,7 @@
                      G_CALLBACK(account_list_changed_cb), info);
 
     component_id = gnc_register_gui_component(DRUID_AB_INITIAL_CM_CLASS,
-                                              NULL, cm_close_handler, info);
+                   NULL, cm_close_handler, info);
     gnc_gui_component_set_session(component_id, gnc_get_current_session());
 
     gtk_widget_show(info->window);

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-ab-getbalance.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-ab-getbalance.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-ab-getbalance.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -58,15 +58,17 @@
 
     /* Get the API */
     api = gnc_AB_BANKING_new();
-    if (!api) {
+    if (!api)
+    {
         g_warning("gnc_ab_gettrans: Couldn't get AqBanking API");
         return;
     }
     if (AB_Banking_OnlineInit(api
 #ifdef AQBANKING_VERSION_4_PLUS
-			      , 0
+                              , 0
 #endif
-			      ) != 0) {
+                             ) != 0)
+    {
         g_warning("gnc_ab_gettrans: Couldn't initialize AqBanking API");
         goto cleanup;
     }
@@ -74,14 +76,16 @@
 
     /* Get the AqBanking Account */
     ab_acc = gnc_ab_get_ab_account(api, gnc_acc);
-    if (!ab_acc) {
+    if (!ab_acc)
+    {
         g_warning("gnc_ab_getbalance: No AqBanking account found");
         goto cleanup;
     }
 
     /* Get a GetBalance job and enqueue it */
     job = AB_JobGetBalance_new(ab_acc);
-    if (!job || AB_Job_CheckAvailability(job, 0)) {
+    if (!job || AB_Job_CheckAvailability(job, 0))
+    {
         g_warning("gnc_ab_getbalance: JobGetBalance not available for this "
                   "account");
         goto cleanup;
@@ -91,7 +95,8 @@
 
     /* Get a GUI object */
     gui = gnc_GWEN_Gui_get(parent);
-    if (!gui) {
+    if (!gui)
+    {
         g_warning("gnc_ab_getbalance: Couldn't initialize Gwenhywfar GUI");
         goto cleanup;
     }
@@ -100,7 +105,8 @@
     context = AB_ImExporterContext_new();
 
     /* Execute the job */
-    if (AB_Banking_ExecuteJobs(api, job_list, context, 0)) {
+    if (AB_Banking_ExecuteJobs(api, job_list, context, 0))
+    {
         g_warning("gnc_ab_getbalance: Error on executing job");
         goto cleanup;
     }
@@ -121,9 +127,9 @@
         AB_Job_free(job);
     if (online)
 #ifdef AQBANKING_VERSION_4_PLUS
-	AB_Banking_OnlineFini(api, 0);
+        AB_Banking_OnlineFini(api, 0);
 #else
-	AB_Banking_OnlineFini(api);
+        AB_Banking_OnlineFini(api);
 #endif
     gnc_AB_BANKING_fini(api);
 }

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-ab-gettrans.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-ab-gettrans.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-ab-gettrans.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -59,7 +59,8 @@
 
     /* Get time of last retrieval */
     last_timespec = gnc_ab_get_account_trans_retrieval(gnc_acc);
-    if (last_timespec.tv_sec == 0) {
+    if (last_timespec.tv_sec == 0)
+    {
         use_last_date = FALSE;
         timespecFromTime_t(&last_timespec, now);
     }
@@ -73,9 +74,12 @@
         return FALSE;
 
     /* Now calculate from date */
-    if (use_earliest_date) {
+    if (use_earliest_date)
+    {
         *from_date = NULL;
-    } else {
+    }
+    else
+    {
         if (use_last_date)
             last_timespec = gnc_ab_get_account_trans_retrieval(gnc_acc);
         *from_date = GWEN_Time_fromSeconds(timespecToTime_t(last_timespec));
@@ -107,15 +111,17 @@
 
     /* Get the API */
     api = gnc_AB_BANKING_new();
-    if (!api) {
+    if (!api)
+    {
         g_warning("gnc_ab_gettrans: Couldn't get AqBanking API");
         return;
     }
     if (AB_Banking_OnlineInit(api
 #ifdef AQBANKING_VERSION_4_PLUS
-			      , 0
+                              , 0
 #endif
-			      ) != 0) {
+                             ) != 0)
+    {
         g_warning("gnc_ab_gettrans: Couldn't initialize AqBanking API");
         goto cleanup;
     }
@@ -123,13 +129,15 @@
 
     /* Get the AqBanking Account */
     ab_acc = gnc_ab_get_ab_account(api, gnc_acc);
-    if (!ab_acc) {
+    if (!ab_acc)
+    {
         g_warning("gnc_ab_gettrans: No AqBanking account found");
         goto cleanup;
     }
 
     /* Get the start and end dates for the GetTransactions job.  */
-    if (!gettrans_dates(parent, gnc_acc, &from_date, &to_date)) {
+    if (!gettrans_dates(parent, gnc_acc, &from_date, &to_date))
+    {
         g_debug("gnc_ab_gettrans: gettrans_dates aborted");
         goto cleanup;
     }
@@ -138,7 +146,8 @@
 
     /* Get a GetTransactions job and enqueue it */
     job = AB_JobGetTransactions_new(ab_acc);
-    if (!job || AB_Job_CheckAvailability(job, 0)) {
+    if (!job || AB_Job_CheckAvailability(job, 0))
+    {
         g_warning("gnc_ab_gettrans: JobGetTransactions not available for this "
                   "account");
         goto cleanup;
@@ -150,7 +159,8 @@
 
     /* Get a GUI object */
     gui = gnc_GWEN_Gui_get(parent);
-    if (!gui) {
+    if (!gui)
+    {
         g_warning("gnc_ab_gettrans: Couldn't initialize Gwenhywfar GUI");
         goto cleanup;
     }
@@ -159,7 +169,8 @@
     context = AB_ImExporterContext_new();
 
     /* Execute the job */
-    if (AB_Banking_ExecuteJobs(api, job_list, context, 0)) {
+    if (AB_Banking_ExecuteJobs(api, job_list, context, 0))
+    {
         g_warning("gnc_ab_gettrans: Error on executing job");
         goto cleanup;
     }
@@ -167,16 +178,17 @@
     /* Import the results */
     ieci = gnc_ab_import_context(context, AWAIT_TRANSACTIONS, FALSE, NULL,
                                  parent);
-    if (!(gnc_ab_ieci_get_found(ieci) & FOUND_TRANSACTIONS)) {
+    if (!(gnc_ab_ieci_get_found(ieci) & FOUND_TRANSACTIONS))
+    {
         /* No transaction found */
         GtkWidget *dialog = gtk_message_dialog_new(
-            GTK_WINDOW(parent),
-            GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-            GTK_MESSAGE_INFO,
-            GTK_BUTTONS_OK,
-            "%s",
-            _("The Online Banking import returned no transactions "
-              "for the selected time period."));
+                                GTK_WINDOW(parent),
+                                GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                GTK_MESSAGE_INFO,
+                                GTK_BUTTONS_OK,
+                                "%s",
+                                _("The Online Banking import returned no transactions "
+                                  "for the selected time period."));
         gtk_dialog_run(GTK_DIALOG(dialog));
         gtk_widget_destroy(dialog);
     }
@@ -201,9 +213,9 @@
         GWEN_Time_free(from_date);
     if (online)
 #ifdef AQBANKING_VERSION_4_PLUS
-	AB_Banking_OnlineFini(api, 0);
+        AB_Banking_OnlineFini(api, 0);
 #else
-	AB_Banking_OnlineFini(api);
+        AB_Banking_OnlineFini(api);
 #endif
     gnc_AB_BANKING_fini(api);
 }

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-ab-kvp.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-ab-kvp.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-ab-kvp.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -156,7 +156,8 @@
 {
     kvp_frame *toplevel = xaccAccountGetSlots(a);
     kvp_frame *result = kvp_frame_get_frame(toplevel, AB_KEY);
-    if (!result && create) {
+    if (!result && create)
+    {
         result = kvp_frame_new();
         kvp_frame_add_frame_nc(toplevel, AB_KEY, result);
     }
@@ -168,7 +169,8 @@
 {
     kvp_frame *toplevel = qof_book_get_slots(b);
     kvp_frame *result = kvp_frame_get_frame(toplevel, AB_KEY);
-    if (!result && create) {
+    if (!result && create)
+    {
         result = kvp_frame_new();
         kvp_frame_add_frame_nc(toplevel, AB_KEY, result);
     }

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-ab-trans-templ.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-ab-trans-templ.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-ab-trans-templ.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -45,21 +45,21 @@
 
 struct _GncABTransTempl
 {
-  /* Name of this Template */
-  gchar *name;
-  gchar *name_key; /* Collation key */
+    /* Name of this Template */
+    gchar *name;
+    gchar *name_key; /* Collation key */
 
-  /* Recipient */
-  gchar *recp_name;
-  gchar *recp_account;
-  gchar *recp_bankcode;
+    /* Recipient */
+    gchar *recp_name;
+    gchar *recp_account;
+    gchar *recp_bankcode;
 
-  /* Amount */
-  gnc_numeric amount;
+    /* Amount */
+    gnc_numeric amount;
 
-  /* Purpose, description */
-  gchar *purpose;
-  gchar *purpose_cont;
+    /* Purpose, description */
+    gchar *purpose;
+    gchar *purpose_cont;
 };
 
 
@@ -95,13 +95,13 @@
     g_return_val_if_fail(k, NULL);
 
     return gnc_ab_trans_templ_new_full(
-        kvp_value_get_string(kvp_frame_get_slot(k, TT_NAME)),
-        kvp_value_get_string(kvp_frame_get_slot(k, TT_RNAME)),
-        kvp_value_get_string(kvp_frame_get_slot(k, TT_RACC)),
-        kvp_value_get_string(kvp_frame_get_slot(k, TT_RBCODE)),
-        kvp_value_get_numeric(kvp_frame_get_slot(k, TT_AMOUNT)),
-        kvp_value_get_string(kvp_frame_get_slot(k, TT_PURPOS)),
-        kvp_value_get_string(kvp_frame_get_slot(k, TT_PURPOSCT)));
+               kvp_value_get_string(kvp_frame_get_slot(k, TT_NAME)),
+               kvp_value_get_string(kvp_frame_get_slot(k, TT_RNAME)),
+               kvp_value_get_string(kvp_frame_get_slot(k, TT_RACC)),
+               kvp_value_get_string(kvp_frame_get_slot(k, TT_RBCODE)),
+               kvp_value_get_numeric(kvp_frame_get_slot(k, TT_AMOUNT)),
+               kvp_value_get_string(kvp_frame_get_slot(k, TT_PURPOS)),
+               kvp_value_get_string(kvp_frame_get_slot(k, TT_PURPOSCT)));
 }
 
 GList *
@@ -110,7 +110,8 @@
     GList *res = NULL;
     GList *iter;
 
-    for (iter = v; iter; iter = iter->next) {
+    for (iter = v; iter; iter = iter->next)
+    {
         kvp_frame *frame = kvp_value_get_frame((kvp_value*) iter->data);
         res = g_list_prepend(res, gnc_ab_trans_templ_new_from_kvp(frame));
     }
@@ -167,7 +168,8 @@
     GList *res = NULL;
     GList *iter;
 
-    for (iter = k; iter; iter = iter->next) {
+    for (iter = k; iter; iter = iter->next)
+    {
         GncABTransTempl *t = (GncABTransTempl*) iter->data;
         kvp_value *value = kvp_value_new_frame_nc(gnc_ab_trans_templ_to_kvp(t));
         res = g_list_prepend(res, value);

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-ab-trans-templ.h
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-ab-trans-templ.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-ab-trans-templ.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -180,7 +180,7 @@
  * @param recp_account Account Number of the recipient
  */
 void gnc_ab_trans_templ_set_recp_account(GncABTransTempl *t,
-                                         const gchar *recp_account);
+        const gchar *recp_account);
 
 /**
  * Replace the Bank Code of the recipient stored in a template.
@@ -189,7 +189,7 @@
  * @param recp_bankcode Bank Code of the recipient
  */
 void gnc_ab_trans_templ_set_recp_bankcode(GncABTransTempl *t,
-                                          const gchar *recp_bankcode);
+        const gchar *recp_bankcode);
 
 /**
  * Replace the amount stored in a template.
@@ -214,7 +214,7 @@
  * @param purpose_cont Second purpose line
  */
 void gnc_ab_trans_templ_set_purpose_cont(GncABTransTempl *t,
-                                         const gchar *purpose_cont);
+        const gchar *purpose_cont);
 
 G_END_DECLS
 

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-ab-transfer.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-ab-transfer.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-ab-transfer.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -57,10 +57,11 @@
 {
     g_return_if_fail(gnc_acc);
     if (dont_ask || gnc_verify_dialog(
-            parent, FALSE, "%s",
-            _("You have changed the list of online transfer templates, "
-              "but you cancelled the transfer dialog. "
-              "Do you nevertheless want to store the changes?"))) {
+                parent, FALSE, "%s",
+                _("You have changed the list of online transfer templates, "
+                  "but you cancelled the transfer dialog. "
+                  "Do you nevertheless want to store the changes?")))
+    {
         GList *kvp_list = gnc_ab_trans_templ_list_to_kvp_list(templates);
         gnc_ab_set_book_template_list(gnc_account_get_book(gnc_acc), kvp_list);
     }
@@ -93,15 +94,17 @@
 
     /* Get the API */
     api = gnc_AB_BANKING_new();
-    if (!api) {
+    if (!api)
+    {
         g_warning("gnc_ab_maketrans: Couldn't get AqBanking API");
         return;
     }
     if (AB_Banking_OnlineInit(api
 #ifdef AQBANKING_VERSION_4_PLUS
-			      , 0
+                              , 0
 #endif
-			      ) != 0) {
+                             ) != 0)
+    {
         g_warning("gnc_ab_maketrans: Couldn't initialize AqBanking API");
         goto cleanup;
     }
@@ -109,14 +112,15 @@
 
     /* Get the AqBanking Account */
     ab_acc = gnc_ab_get_ab_account(api, gnc_acc);
-    if (!ab_acc) {
+    if (!ab_acc)
+    {
         g_warning("gnc_ab_gettrans: No AqBanking account found");
         goto cleanup;
     }
 
     /* Get list of template transactions */
     templates = gnc_ab_trans_templ_list_new_from_kvp_list(
-        gnc_ab_get_book_template_list(gnc_account_get_book(gnc_acc)));
+                    gnc_ab_get_book_template_list(gnc_account_get_book(gnc_acc)));
 
     /* Create new ABTransDialog */
     td = gnc_ab_trans_dialog_new(parent, ab_acc,
@@ -125,7 +129,8 @@
     templates = NULL;
 
     /* Repeat until AqBanking action was successful or user pressed cancel */
-    do {
+    do
+    {
         GncGWENGui *gui = NULL;
         gint result;
         gboolean changed;
@@ -143,7 +148,8 @@
 
         /* Get a GUI object */
         gui = gnc_GWEN_Gui_get(parent);
-        if (!gui) {
+        if (!gui)
+        {
             g_warning("gnc_ab_maketrans: Couldn't initialize Gwenhywfar GUI");
             aborted = TRUE;
             goto repeat;
@@ -152,7 +158,8 @@
         /* Let the user enter the values */
         result = gnc_ab_trans_dialog_run_until_ok(td);
 
-        if (result != GNC_RESPONSE_NOW && result != GNC_RESPONSE_LATER) {
+        if (result != GNC_RESPONSE_NOW && result != GNC_RESPONSE_LATER)
+        {
             aborted = TRUE;
             goto repeat;
         }
@@ -168,18 +175,19 @@
         /* Get a job and enqueue it */
         ab_trans = gnc_ab_trans_dialog_get_ab_trans(td);
         job = gnc_ab_trans_dialog_get_job(td);
-        if (!job || AB_Job_CheckAvailability(job, 0)) {
+        if (!job || AB_Job_CheckAvailability(job, 0))
+        {
             if (!gnc_verify_dialog(
-                    parent, FALSE, "%s",
-                    _("The backend found an error during the preparation "
-                      "of the job. It is not possible to execute this job. \n"
-                      "\n"
-                      "Most probable the bank does not support your chosen "
-                      "job or your Online Banking account does not have the permission "
-                      "to execute this job. More error messages might be "
-                      "visible on your console log.\n"
-                      "\n"
-                      "Do you want to enter the job again?")))
+                        parent, FALSE, "%s",
+                        _("The backend found an error during the preparation "
+                          "of the job. It is not possible to execute this job. \n"
+                          "\n"
+                          "Most probable the bank does not support your chosen "
+                          "job or your Online Banking account does not have the permission "
+                          "to execute this job. More error messages might be "
+                          "visible on your console log.\n"
+                          "\n"
+                          "Do you want to enter the job again?")))
                 aborted = TRUE;
             goto repeat;
         }
@@ -189,7 +197,8 @@
         /* Setup a Transfer Dialog for the GnuCash transaction */
         xfer_dialog = gnc_xfer_dialog(gnc_ab_trans_dialog_get_parent(td),
                                       gnc_acc);
-        switch (trans_type) {
+        switch (trans_type)
+        {
         case SINGLE_DEBITNOTE:
             gnc_xfer_dialog_set_title(
                 xfer_dialog, _("Online Banking Direct Debit Note"));
@@ -208,9 +217,9 @@
         }
 
         amount = double_to_gnc_numeric(
-            AB_Value_GetValueAsDouble(AB_Transaction_GetValue(ab_trans)),
-            xaccAccountGetCommoditySCU(gnc_acc),
-            GNC_RND_ROUND);
+                     AB_Value_GetValueAsDouble(AB_Transaction_GetValue(ab_trans)),
+                     xaccAccountGetCommoditySCU(gnc_acc),
+                     GNC_RND_ROUND);
         gnc_xfer_dialog_set_amount(xfer_dialog, amount);
 
         description = gnc_ab_description_to_gnc(ab_trans);
@@ -227,17 +236,20 @@
         successful = gnc_xfer_dialog_run_until_done(xfer_dialog);
 
         /* On cancel, go back to the AB transaction dialog */
-        if (!successful || !gnc_trans) {
+        if (!successful || !gnc_trans)
+        {
             successful = FALSE;
             goto repeat;
         }
 
-        if (result == GNC_RESPONSE_NOW) {
+        if (result == GNC_RESPONSE_NOW)
+        {
             /* Create a context to store possible results */
             context = AB_ImExporterContext_new();
 
             gui = gnc_GWEN_Gui_get(parent);
-            if (!gui) {
+            if (!gui)
+            {
                 g_warning("gnc_ab_maketrans: Couldn't initialize Gwenhywfar GUI");
                 aborted = TRUE;
                 goto repeat;
@@ -253,30 +265,36 @@
              */
             job_status = AB_Job_GetStatus(job);
             if (job_status != AB_Job_StatusFinished
-                && job_status != AB_Job_StatusPending) {
+                    && job_status != AB_Job_StatusPending)
+            {
                 successful = FALSE;
                 if (!gnc_verify_dialog(
-                        parent, FALSE, "%s",
-                        _("An error occurred while executing the job.  Please check "
-                          "the log window for the exact error message.\n"
-                          "\n"
-                          "Do you want to enter the job again?"))) {
+                            parent, FALSE, "%s",
+                            _("An error occurred while executing the job.  Please check "
+                              "the log window for the exact error message.\n"
+                              "\n"
+                              "Do you want to enter the job again?")))
+                {
                     aborted = TRUE;
                 }
-            } else {
+            }
+            else
+            {
                 successful = TRUE;
             }
 
-            if (successful) {
+            if (successful)
+            {
                 /* Import the results, awaiting nothing */
                 ieci = gnc_ab_import_context(context, 0, FALSE, NULL, parent);
             }
         }
         /* Simply ignore any other case */
 
-    repeat:
+repeat:
         /* Clean up */
-        if (gnc_trans && !successful) {
+        if (gnc_trans && !successful)
+        {
             xaccTransBeginEdit(gnc_trans);
             xaccTransDestroy(gnc_trans);
             xaccTransCommitEdit(gnc_trans);
@@ -286,29 +304,33 @@
             g_free(ieci);
         if (context)
             AB_ImExporterContext_free(context);
-        if (job_list) {
+        if (job_list)
+        {
             AB_Job_List2_free(job_list);
             job_list = NULL;
         }
-        if (job) {
+        if (job)
+        {
             AB_Job_free(job);
             job = NULL;
         }
-        if (gui) {
+        if (gui)
+        {
             gnc_GWEN_Gui_release(gui);
             gui = NULL;
         }
 
-    } while (!successful && !aborted);
+    }
+    while (!successful && !aborted);
 
 cleanup:
     if (td)
         gnc_ab_trans_dialog_free(td);
     if (online)
 #ifdef AQBANKING_VERSION_4_PLUS
-	AB_Banking_OnlineFini(api, 0);
+        AB_Banking_OnlineFini(api, 0);
 #else
-	AB_Banking_OnlineFini(api);
+        AB_Banking_OnlineFini(api);
 #endif
     gnc_AB_BANKING_fini(api);
 }

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -64,7 +64,8 @@
 static AB_IMEXPORTER_ACCOUNTINFO *bal_accountinfo_cb(
     AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data);
 
-struct _GncABImExContextImport {
+struct _GncABImExContextImport
+{
     guint awaiting;
     gboolean txn_found;
     Account *gnc_acc;
@@ -85,15 +86,18 @@
     GWEN_Init();
 
     /* Initialize gwen logging */
-    if (gnc_gconf_get_bool(GCONF_SECTION_AQBANKING, KEY_VERBOSE_DEBUG, NULL)) {
-      GWEN_Logger_SetLevel(NULL, GWEN_LoggerLevel_Info);
-      GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevel_Info);
-      GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Debug);
-    } else {
-      GWEN_Logger_SetLevel(NULL, GWEN_LoggerLevel_Error);
-      GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevel_Error);
-      GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Warning);
+    if (gnc_gconf_get_bool(GCONF_SECTION_AQBANKING, KEY_VERBOSE_DEBUG, NULL))
+    {
+        GWEN_Logger_SetLevel(NULL, GWEN_LoggerLevel_Info);
+        GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevel_Info);
+        GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Debug);
     }
+    else
+    {
+        GWEN_Logger_SetLevel(NULL, GWEN_LoggerLevel_Error);
+        GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevel_Error);
+        GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Warning);
+    }
     gnc_GWEN_Gui_log_init();
 }
 
@@ -115,7 +119,8 @@
 {
     AB_BANKING *api;
 
-    if (gnc_AB_BANKING) {
+    if (gnc_AB_BANKING)
+    {
         /* API cached. */
         api = gnc_AB_BANKING;
 
@@ -123,7 +128,9 @@
         if (gnc_AB_BANKING_refcount == 0)
             g_return_val_if_fail(AB_Banking_Init(api) == 0, NULL);
 
-    } else {
+    }
+    else
+    {
         api = AB_Banking_new("gnucash", NULL, 0);
         g_return_val_if_fail(api, NULL);
 
@@ -146,8 +153,10 @@
     if (!api)
         api = gnc_AB_BANKING;
 
-    if (api) {
-        if (api == gnc_AB_BANKING) {
+    if (api)
+    {
+        if (api == gnc_AB_BANKING)
+        {
             gnc_AB_BANKING = NULL;
             if (gnc_AB_BANKING_refcount > 0)
                 AB_Banking_Fini(api);
@@ -161,10 +170,13 @@
 gint
 gnc_AB_BANKING_fini(AB_BANKING *api)
 {
-    if (api == gnc_AB_BANKING) {
+    if (api == gnc_AB_BANKING)
+    {
         if (--gnc_AB_BANKING_refcount == 0)
             return AB_Banking_Fini(api);
-    } else {
+    }
+    else
+    {
         return AB_Banking_Fini(api);
     }
     return 0;
@@ -182,20 +194,24 @@
     accountid = gnc_ab_get_account_accountid(gnc_acc);
     account_uid = gnc_ab_get_account_uid (gnc_acc);
 
-    if (account_uid > 0) {
+    if (account_uid > 0)
+    {
         ab_account = AB_Banking_GetAccount(api, account_uid);
 
-        if (!ab_account && bankcode && *bankcode && accountid && *accountid) {
+        if (!ab_account && bankcode && *bankcode && accountid && *accountid)
+        {
             g_message("gnc_ab_get_ab_account: No AB_ACCOUNT found for UID %d, "
                       "trying bank code\n", account_uid);
             ab_account = AB_Banking_GetAccountByCodeAndNumber(api, bankcode,
-                                                              accountid);
+                         accountid);
         }
         return ab_account;
 
-    } else if (bankcode && *bankcode && accountid && *accountid) {
+    }
+    else if (bankcode && *bankcode && accountid && *accountid)
+    {
         ab_account = AB_Banking_GetAccountByCodeAndNumber(api, bankcode,
-                                                          accountid);
+                     accountid);
         return ab_account;
     }
 
@@ -230,12 +246,15 @@
     g_strstrip(tmp);
     gnc_utf8_strip_invalid(tmp);
 
-    if (*acc) {
+    if (*acc)
+    {
         gchar *join = g_strjoin(" ", *acc, tmp, (gchar*) NULL);
         g_free(*acc);
         g_free(tmp);
         *acc = join;
-    } else {
+    }
+    else
+    {
         *acc = tmp;
     }
     return NULL;
@@ -254,7 +273,8 @@
         GWEN_StringList_ForEach(ab_remote_name, join_ab_strings_cb,
                                 &gnc_other_name);
 
-    if (!gnc_other_name || !*gnc_other_name) {
+    if (!gnc_other_name || !*gnc_other_name)
+    {
         g_free(gnc_other_name);
         gnc_other_name = NULL;
     }
@@ -284,21 +304,30 @@
 gchar *
 gnc_ab_description_to_gnc(const AB_TRANSACTION *ab_trans)
 {
-  /* Description */
+    /* Description */
     gchar *description = gnc_ab_get_purpose(ab_trans);
     gchar *other_name = gnc_ab_get_remote_name(ab_trans);
     gchar *retval;
 
-    if (other_name) {
-        if (description && *description) {
+    if (other_name)
+    {
+        if (description && *description)
+        {
             retval = g_strdup_printf("%s; %s", description, other_name);
-        } else {
+        }
+        else
+        {
             retval = g_strdup(other_name);
         }
-    } else {
-        if (description && *description) {
+    }
+    else
+    {
+        if (description && *description)
+        {
             retval = g_strdup(description);
-        } else {
+        }
+        else
+        {
             retval = g_strdup(_("Unspecified"));
         }
     }
@@ -329,11 +358,14 @@
     gnc_utf8_strip_invalid(ab_other_accountid);
     gnc_utf8_strip_invalid(ab_other_bankcode);
 
-    if (ab_other_accountid && *ab_other_accountid) {
+    if (ab_other_accountid && *ab_other_accountid)
+    {
         retval = g_strdup_printf("%s %s %s %s",
                                  _("Account"), ab_other_accountid,
                                  _("Bank"), ab_other_bankcode);
-    } else {
+    }
+    else
+    {
         retval = g_strdup("");
     }
     g_free(ab_other_accountid);
@@ -364,7 +396,8 @@
 
     /* Date / Time */
     valuta_date = AB_Transaction_GetValutaDate(ab_trans);
-    if (!valuta_date) {
+    if (!valuta_date)
+    {
         const GWEN_TIME *normal_date = AB_Transaction_GetDate(ab_trans);
         if (normal_date)
             valuta_date = normal_date;
@@ -383,7 +416,7 @@
     /* Number.  We use the "customer reference", if there is one. */
     custref = AB_Transaction_GetCustomerReference(ab_trans);
     if (custref && *custref
-        && g_ascii_strncasecmp(custref, "NONREF", 6) != 0)
+            && g_ascii_strncasecmp(custref, "NONREF", 6) != 0)
         xaccTransSetNum(gnc_trans, custref);
 
     /* Description */
@@ -406,26 +439,26 @@
         gnc_import_set_split_online_id(split, fitid);
 
     {
-    /* Amount into the split */
-    const AB_VALUE *ab_value = AB_Transaction_GetValue(ab_trans);
-    double d_value = ab_value ? AB_Value_GetValueAsDouble (ab_value) : 0.0;
-    AB_TRANSACTION_TYPE ab_type = AB_Transaction_GetType (ab_trans);
-    gnc_numeric gnc_amount;
+        /* Amount into the split */
+        const AB_VALUE *ab_value = AB_Transaction_GetValue(ab_trans);
+        double d_value = ab_value ? AB_Value_GetValueAsDouble (ab_value) : 0.0;
+        AB_TRANSACTION_TYPE ab_type = AB_Transaction_GetType (ab_trans);
+        gnc_numeric gnc_amount;
 
-    /*printf("Transaction with value %f has type %d\n", d_value, ab_type);*/
-    /* If the value is positive, but the transaction type says the
-       money is transferred away from our account (Transfer instead of
-       DebitNote), we switch the value to negative. */
-    if (d_value > 0.0 && ab_type == AB_Transaction_TypeTransfer)
-      d_value = -d_value;
+        /*printf("Transaction with value %f has type %d\n", d_value, ab_type);*/
+        /* If the value is positive, but the transaction type says the
+           money is transferred away from our account (Transfer instead of
+           DebitNote), we switch the value to negative. */
+        if (d_value > 0.0 && ab_type == AB_Transaction_TypeTransfer)
+            d_value = -d_value;
 
-    gnc_amount = double_to_gnc_numeric(
-	d_value,
-        xaccAccountGetCommoditySCU(gnc_acc),
-        GNC_RND_ROUND);
-    if (!ab_value)
-        g_warning("transaction_cb: Oops, value was NULL.  Using 0");
-    xaccSplitSetBaseValue(split, gnc_amount, xaccAccountGetCommodity(gnc_acc));
+        gnc_amount = double_to_gnc_numeric(
+                         d_value,
+                         xaccAccountGetCommoditySCU(gnc_acc),
+                         GNC_RND_ROUND);
+        if (!ab_value)
+            g_warning("transaction_cb: Oops, value was NULL.  Using 0");
+        xaccSplitSetBaseValue(split, gnc_amount, xaccAccountGetCommodity(gnc_acc));
     }
 
     /* Memo in the Split. */
@@ -458,9 +491,10 @@
                             accountnumber ? accountnumber : "",
                             (gchar*)NULL);
     gnc_acc = gnc_import_select_account(
-        NULL, online_id, 1, AB_ImExporterAccountInfo_GetAccountName(acc_info),
-        NULL, ACCT_TYPE_NONE, NULL, NULL);
-    if (!gnc_acc) {
+                  NULL, online_id, 1, AB_ImExporterAccountInfo_GetAccountName(acc_info),
+                  NULL, ACCT_TYPE_NONE, NULL, NULL);
+    if (!gnc_acc)
+    {
         g_warning("gnc_ab_accinfo_to_gnc_acc: Could not determine source account"
                   " for online_id %s", online_id);
     }
@@ -483,7 +517,8 @@
     /* Instead of xaccTransCommitEdit(gnc_trans)  */
     gnc_gen_trans_list_add_trans(data->generic_importer, gnc_trans);
 
-    if (data->execute_txns && data->ab_acc) {
+    if (data->execute_txns && data->ab_acc)
+    {
         AB_TRANSACTION *ab_trans = AB_Transaction_dup(element);
         AB_JOB *job;
 
@@ -498,19 +533,21 @@
         job = gnc_ab_get_trans_job(data->ab_acc, ab_trans, SINGLE_DEBITNOTE);
 
         /* Check whether we really got a job */
-        if (!job) {
+        if (!job)
+        {
             /* Oops, no job, probably not supported by bank */
             if (gnc_verify_dialog(
-                    NULL, FALSE, "%s",
-                    _("The backend found an error during the preparation "
-                      "of the job. It is not possible to execute this job. \n"
-                      "\n"
-                      "Most probable the bank does not support your chosen "
-                      "job or your Online Banking account does not have the permission "
-                      "to execute this job. More error messages might be "
-                      "visible on your console log.\n"
-                      "\n"
-                      "Do you want to enter the job again?"))) {
+                        NULL, FALSE, "%s",
+                        _("The backend found an error during the preparation "
+                          "of the job. It is not possible to execute this job. \n"
+                          "\n"
+                          "Most probable the bank does not support your chosen "
+                          "job or your Online Banking account does not have the permission "
+                          "to execute this job. More error messages might be "
+                          "visible on your console log.\n"
+                          "\n"
+                          "Do you want to enter the job again?")))
+            {
                 gnc_error_dialog(NULL, "Sorry, not implemented yet.");
             }
             /* else */
@@ -541,14 +578,18 @@
     else
         data->awaiting |= FOUND_TRANSACTIONS;
 
-    if (!(data->awaiting & AWAIT_TRANSACTIONS)) {
+    if (!(data->awaiting & AWAIT_TRANSACTIONS))
+    {
         if (gnc_verify_dialog(data->parent, TRUE, "%s",
                               _("The bank has sent transaction information "
                                 "in its response."
                                 "\n"
-                                "Do you want to import it?"))) {
+                                "Do you want to import it?")))
+        {
             data->awaiting |= AWAIT_TRANSACTIONS;
-        } else {
+        }
+        else
+        {
             data->awaiting |= IGNORE_TRANSACTIONS;
             return NULL;
         }
@@ -559,27 +600,31 @@
     if (!gnc_acc) return NULL;
     data->gnc_acc = gnc_acc;
 
-    if (data->execute_txns) {
+    if (data->execute_txns)
+    {
         /* Retrieve the aqbanking account that belongs to this gnucash
          * account */
         data->ab_acc = gnc_ab_get_ab_account(data->api, gnc_acc);
-        if (!data->ab_acc) {
+        if (!data->ab_acc)
+        {
             gnc_error_dialog(NULL, "%s",
                              _("No Online Banking account found for this "
                                "gnucash account. These transactions will "
                                "not be executed by Online Banking."));
         }
-    } else {
+    }
+    else
+    {
         data->ab_acc = NULL;
     }
 
     if (!data->generic_importer)
         data->generic_importer = gnc_gen_trans_list_new(data->parent, NULL,
-                                                        TRUE, 14);
+                                 TRUE, 14);
 
     /* Iterate through all transactions */
     AB_ImExporterAccountInfo_TransactionsForEach(element, txn_transaction_cb,
-                                                 data);
+            data);
 
     return NULL;
 }
@@ -613,9 +658,11 @@
 
     /* Lookup the most recent ACCOUNT_STATUS available */
     item = AB_ImExporterAccountInfo_GetFirstAccountStatus(element);
-    while (item) {
+    while (item)
+    {
         const GWEN_TIME *item_time = AB_AccountStatus_GetTime(item);
-        if (!best || GWEN_Time_Diff(best_time, item_time) < 0.0) {
+        if (!best || GWEN_Time_Diff(best_time, item_time) < 0.0)
+        {
             best = item;
             best_time = item_time;
         }
@@ -623,7 +670,8 @@
     }
 
     booked_bal = AB_AccountStatus_GetBookedBalance(best);
-    if (!(data->awaiting & AWAIT_BALANCES)) {
+    if (!(data->awaiting & AWAIT_BALANCES))
+    {
         /* Ignore zero balances if we don't await a balance */
         if (!booked_bal || AB_Value_IsZero(AB_Balance_GetValue(booked_bal)))
             return NULL;
@@ -633,9 +681,12 @@
                               _("The bank has sent balance information "
                                 "in its response."
                                 "\n"
-                                "Do you want to import it?"))) {
+                                "Do you want to import it?")))
+        {
             data->awaiting |= AWAIT_BALANCES;
-        } else {
+        }
+        else
+        {
             data->awaiting |= IGNORE_BALANCES;
             return NULL;
         }
@@ -647,23 +698,32 @@
     data->gnc_acc = gnc_acc;
 
     /* Lookup booked balance and time */
-    if (booked_bal) {
+    if (booked_bal)
+    {
         const GWEN_TIME *ti = AB_Balance_GetTime(booked_bal);
-        if (ti) {
+        if (ti)
+        {
             booked_tt =  GWEN_Time_toTime_t(ti);
-        } else {
+        }
+        else
+        {
             /* No time found? Use today because the HBCI query asked for today's
              * balance. */
             booked_tt = gnc_timet_get_day_start(time(NULL));
         }
         booked_val = AB_Balance_GetValue(booked_bal);
-        if (booked_val) {
+        if (booked_val)
+        {
             booked_value = AB_Value_GetValueAsDouble(booked_val);
-        } else {
+        }
+        else
+        {
             g_warning("bal_accountinfo_cb: booked_val == NULL.  Assuming 0");
             booked_value = 0.0;
         }
-    } else {
+    }
+    else
+    {
         g_warning("bal_accountinfo_cb: booked_bal == NULL.  Assuming 0");
         booked_tt = 0;
         booked_value = 0.0;
@@ -671,15 +731,19 @@
 
     /* Lookup noted balance */
     noted_bal = AB_AccountStatus_GetNotedBalance(best);
-    if (noted_bal) {
+    if (noted_bal)
+    {
         noted_val = AB_Balance_GetValue(noted_bal);
         if (noted_val)
             noted_value = AB_Value_GetValueAsDouble(noted_val);
-        else {
+        else
+        {
             g_warning("bal_accountinfo_cb: noted_val == NULL.  Assuming 0");
             noted_value = 0.0;
         }
-    } else {
+    }
+    else
+    {
         g_warning("bal_accountinfo_cb: noted_bal == NULL.  Assuming 0");
         noted_value = 0.0;
     }
@@ -687,38 +751,41 @@
     value = double_to_gnc_numeric(booked_value,
                                   xaccAccountGetCommoditySCU(gnc_acc),
                                   GNC_RND_ROUND);
-    if (noted_value == 0.0 && booked_value == 0.0) {
+    if (noted_value == 0.0 && booked_value == 0.0)
+    {
         dialog = gtk_message_dialog_new(
-            GTK_WINDOW(data->parent),
-            GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-            GTK_MESSAGE_INFO,
-            GTK_BUTTONS_OK,
-            "%s",
-            /* Translators: Strings from this file are needed only in
-             * countries that have one of aqbanking's Online Banking
-             * techniques available. This is 'OFX DirectConnect'
-             * (U.S. and others), 'HBCI' (in Germany), or 'YellowNet'
-             * (Switzerland). If none of these techniques are available
-             * in your country, you may safely ignore strings from the
-             * import-export/hbci subdirectory. */
-            _("The downloaded Online Banking Balance was zero.\n\n"
-              "Either this is the correct balance, or your bank does not "
-              "support Balance download in this Online Banking version. "
-              "In the latter case you should choose a different "
-              "Online Banking version number in the Online Banking "
-              "(AqBanking or HBCI) Setup. After that, try again to "
-              "download the Online Banking Balance."));
+                     GTK_WINDOW(data->parent),
+                     GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                     GTK_MESSAGE_INFO,
+                     GTK_BUTTONS_OK,
+                     "%s",
+                     /* Translators: Strings from this file are needed only in
+                      * countries that have one of aqbanking's Online Banking
+                      * techniques available. This is 'OFX DirectConnect'
+                      * (U.S. and others), 'HBCI' (in Germany), or 'YellowNet'
+                      * (Switzerland). If none of these techniques are available
+                      * in your country, you may safely ignore strings from the
+                      * import-export/hbci subdirectory. */
+                     _("The downloaded Online Banking Balance was zero.\n\n"
+                       "Either this is the correct balance, or your bank does not "
+                       "support Balance download in this Online Banking version. "
+                       "In the latter case you should choose a different "
+                       "Online Banking version number in the Online Banking "
+                       "(AqBanking or HBCI) Setup. After that, try again to "
+                       "download the Online Banking Balance."));
         gtk_dialog_run(GTK_DIALOG(dialog));
         gtk_widget_destroy(dialog);
 
-    } else {
+    }
+    else
+    {
         gnc_numeric reconc_balance = xaccAccountGetReconciledBalance(gnc_acc);
 
         gchar *booked_str = gnc_AB_VALUE_to_readable_string(booked_val);
         gchar *message1 = g_strdup_printf(
-            _("Result of Online Banking job: \n"
-              "Account booked balance is %s"),
-            booked_str);
+                              _("Result of Online Banking job: \n"
+                                "Account booked balance is %s"),
+                              booked_str);
         gchar *message2 =
             (noted_value == 0.0) ?
             g_strdup("") :
@@ -726,24 +793,27 @@
                               "has a noted balance of %s\n"),
                             gnc_AB_VALUE_to_readable_string(noted_val));
 
-        if (gnc_numeric_equal(value, reconc_balance)) {
+        if (gnc_numeric_equal(value, reconc_balance))
+        {
             const gchar *message3 =
                 _("The booked balance is identical to the current "
                   "reconciled balance of the account.");
             dialog = gtk_message_dialog_new(
-                GTK_WINDOW(data->parent),
-                GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-                GTK_MESSAGE_INFO,
-                GTK_BUTTONS_OK,
-                "%s\n%s\n%s",
-                message1, message2, message3);
+                         GTK_WINDOW(data->parent),
+                         GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                         GTK_MESSAGE_INFO,
+                         GTK_BUTTONS_OK,
+                         "%s\n%s\n%s",
+                         message1, message2, message3);
             gtk_dialog_run(GTK_DIALOG(dialog));
             gtk_widget_destroy(GTK_WIDGET(dialog));
 
-        } else {
+        }
+        else
+        {
             const char *message3 = _("Reconcile account now?");
 
-            show_recn_window = gnc_verify_dialog(data->parent,TRUE, "%s\n%s\n%s",
+            show_recn_window = gnc_verify_dialog(data->parent, TRUE, "%s\n%s\n%s",
                                                  message1, message2, message3);
         }
         g_free(booked_str);

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-file-aqb-import.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-file-aqb-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-file-aqb-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -89,22 +89,25 @@
     g_free(default_dir);
 
     dtaus_fd = g_open(selected_filename, O_RDONLY, 0);
-    if (dtaus_fd == -1) {
-      DEBUG("Could not open file %s", selected_filename);
-      goto cleanup;
+    if (dtaus_fd == -1)
+    {
+        DEBUG("Could not open file %s", selected_filename);
+        goto cleanup;
     }
 
     /* Get the API */
     api = gnc_AB_BANKING_new();
-    if (!api) {
+    if (!api)
+    {
         g_warning("gnc_file_aqbanking_import: Couldn't get AqBanking API");
         goto cleanup;
     }
     if (AB_Banking_OnlineInit(api
 #ifdef AQBANKING_VERSION_4_PLUS
-			      , 0
+                              , 0
 #endif
-			      ) != 0) {
+                             ) != 0)
+    {
         g_warning("gnc_file_aqbanking_import: "
                   "Couldn't initialize AqBanking API");
         goto cleanup;
@@ -113,14 +116,16 @@
 
     /* Get a GUI object */
     gui = gnc_GWEN_Gui_get(NULL);
-    if (!gui) {
+    if (!gui)
+    {
         g_warning("gnc_ab_getbalance: Couldn't initialize Gwenhywfar GUI");
         goto cleanup;
     }
 
     /* Get import module */
     importer = AB_Banking_GetImExporter(api, aqbanking_importername);
-    if (!importer) {
+    if (!importer)
+    {
         g_warning("Import module %s not found", aqbanking_importername);
         gnc_error_dialog(NULL, "%s",
                          _("Import module for DTAUS import not found."));
@@ -132,21 +137,24 @@
 
     /* Select profile */
     db_profile = GWEN_DB_GetFirstGroup(db_profiles);
-    while (db_profile) {
+    while (db_profile)
+    {
         const gchar *name;
 
         name = GWEN_DB_GetCharValue(db_profile, "name", 0, 0);
         g_return_if_fail(name);
-        if (g_ascii_strcasecmp(name, aqbanking_profilename)==0)
+        if (g_ascii_strcasecmp(name, aqbanking_profilename) == 0)
             break;
         db_profile = GWEN_DB_GetNextGroup(db_profile);
     }
-    if (!db_profile) {
+    if (!db_profile)
+    {
         g_warning("Profile \"%s\" for importer \"%s\" not found",
                   aqbanking_profilename, aqbanking_importername);
         /* For debugging: Print those available names that have been found */
         db_profile = GWEN_DB_GetFirstGroup(db_profiles);
-        while (db_profile) {
+        while (db_profile)
+        {
             const char *name = GWEN_DB_GetCharValue(db_profile, "name", 0, 0);
             g_warning("Only found profile \"%s\"\n", name ? name : "(null)");
             db_profile = GWEN_DB_GetNextGroup(db_profile);
@@ -160,13 +168,15 @@
     /* Wrap file in buffered gwen io */
     io = GWEN_Io_LayerFile_new(dtaus_fd, -1);
     dtaus_fd = -1;
-    if (GWEN_Io_Manager_RegisterLayer(io)) {
-	g_warning("gnc_file_aqbanking_import: Failed to wrap file");
-	goto cleanup;
+    if (GWEN_Io_Manager_RegisterLayer(io))
+    {
+        g_warning("gnc_file_aqbanking_import: Failed to wrap file");
+        goto cleanup;
     }
 
     /* Run the import */
-    if (AB_ImExporter_Import(importer, context, io, db_profile, 0)) {
+    if (AB_ImExporter_Import(importer, context, io, db_profile, 0))
+    {
         g_warning("gnc_file_aqbanking_import: Error on import");
         goto cleanup;
     }
@@ -183,8 +193,10 @@
     /* Extract the list of jobs */
     job_list = gnc_ab_ieci_get_job_list(ieci);
 
-    if (execute_transactions) {
-        if (gnc_ab_ieci_run_matcher(ieci)) {
+    if (execute_transactions)
+    {
+        if (gnc_ab_ieci_run_matcher(ieci))
+        {
             /* FIXME */
             /* gnc_hbci_multijob_execute(NULL, api, job_list, gui); */
         }

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-gwen-gui.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-gwen-gui.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-gwen-gui.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -56,7 +56,8 @@
 static GWEN_GUI *log_gwen_gui = NULL;
 
 /* A mapping from gwenhywfar log levels to glib ones */
-static GLogLevelFlags log_levels[] = {
+static GLogLevelFlags log_levels[] =
+{
     G_LOG_LEVEL_ERROR,     /* GWEN_LoggerLevel_Emergency */
     G_LOG_LEVEL_ERROR,     /* GWEN_LoggerLevel_Alert */
     G_LOG_LEVEL_CRITICAL,  /* GWEN_LoggerLevel_Critical */
@@ -107,7 +108,7 @@
                       const gchar *text, gchar **input, gint min_len,
                       gint max_len);
 static gint messagebox_cb(GWEN_GUI *gwen_gui, guint32 flags, const gchar *title,
-                          const gchar *text, const gchar *b1,const gchar *b2,
+                          const gchar *text, const gchar *b1, const gchar *b2,
                           const gchar *b3, guint32 guiid);
 static gint inputbox_cb(GWEN_GUI *gwen_gui, guint32 flags, const gchar *title,
                         const gchar *text, gchar *buffer, gint min_len,
@@ -139,15 +140,17 @@
 void ggg_abort_clicked_cb(GtkButton *button, gpointer user_data);
 void ggg_close_clicked_cb(GtkButton *button, gpointer user_data);
 
-enum _GuiState {
-  INIT,
-  RUNNING,
-  FINISHED,
-  ABORTED,
-  HIDDEN
+enum _GuiState
+{
+    INIT,
+    RUNNING,
+    FINISHED,
+    ABORTED,
+    HIDDEN
 };
 
-struct _GncGWENGui {
+struct _GncGWENGui
+{
     GWEN_GUI *gwen_gui;
     GtkWidget *parent;
     GtkWidget *dialog;
@@ -196,7 +199,8 @@
     GWEN_LOGGER_LEVEL min_loglevel;
 };
 
-struct _Progress {
+struct _Progress
+{
     GncGWENGui *gui;
 
     /* Title of the process */
@@ -209,7 +213,8 @@
 void
 gnc_GWEN_Gui_log_init(void)
 {
-    if (!log_gwen_gui) {
+    if (!log_gwen_gui)
+    {
         log_gwen_gui = GWEN_Gui_new();
 
         /* Always use our own logging */
@@ -228,8 +233,10 @@
 
     ENTER("parent=%p", parent);
 
-    if (full_gui) {
-        if (full_gui->state == INIT || full_gui->state == RUNNING) {
+    if (full_gui)
+    {
+        if (full_gui->state == INIT || full_gui->state == RUNNING)
+        {
             LEAVE("full_gui in use, state=%d", full_gui->state);
             return NULL;
         }
@@ -271,7 +278,8 @@
 
     ENTER(" ");
 
-    if (log_gwen_gui) {
+    if (log_gwen_gui)
+    {
         GWEN_Gui_free(log_gwen_gui);
         log_gwen_gui = NULL;
     }
@@ -335,7 +343,8 @@
 
     ENTER("gui=%p", gui);
 
-    if (!gui->gwen_gui) {
+    if (!gui->gwen_gui)
+    {
         LEAVE("already unregistered");
         return;
     }
@@ -383,7 +392,7 @@
         gnc_gconf_get_bool(GCONF_SECTION_AQBANKING, KEY_CLOSE_ON_FINISH, NULL));
 
     component_id = gnc_register_gui_component(GWEN_GUI_CM_CLASS, NULL,
-                                              cm_close_handler, gui);
+                   cm_close_handler, gui);
     gnc_gui_component_set_session(component_id, gnc_get_current_session());
 
     reset_dialog(gui);
@@ -396,12 +405,15 @@
 {
     g_return_if_fail(gui);
 
-    if (enabled && !gui->passwords) {
+    if (enabled && !gui->passwords)
+    {
         /* Remember passwords in memory, mapping tokens to passwords */
         gui->passwords = g_hash_table_new_full(
-            g_str_hash, g_str_equal, (GDestroyNotify) g_free,
-            (GDestroyNotify) erase_password);
-    } else if (!enabled && gui->passwords) {
+                             g_str_hash, g_str_equal, (GDestroyNotify) g_free,
+                             (GDestroyNotify) erase_password);
+    }
+    else if (!enabled && gui->passwords)
+    {
         /* Erase and free remembered passwords from memory */
         g_hash_table_destroy(gui->passwords);
         gui->passwords = NULL;
@@ -424,7 +436,8 @@
     g_list_free(gui->progresses);
     gui->progresses = NULL;
 
-    if (gui->other_entries_box) {
+    if (gui->other_entries_box)
+    {
         gtk_table_resize(GTK_TABLE(gui->entries_table),
                          OTHER_ENTRIES_ROW_OFFSET, 2);
         gtk_widget_destroy(gui->other_entries_box);
@@ -434,7 +447,7 @@
         g_hash_table_destroy(gui->showbox_hash);
     gui->showbox_last = NULL;
     gui->showbox_hash = g_hash_table_new_full(
-        NULL, NULL, NULL, (GDestroyNotify) gtk_widget_destroy);
+                            NULL, NULL, NULL, (GDestroyNotify) gtk_widget_destroy);
 
     if (gui->parent)
         gtk_window_set_transient_for(GTK_WINDOW(gui->dialog),
@@ -451,7 +464,7 @@
 
     if (!gui->accepted_certs)
         gui->accepted_certs = g_hash_table_new_full(
-            g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL);
+                                  g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL);
     if (!gui->permanently_accepted_certs)
         gui->permanently_accepted_certs = gnc_ab_get_permanent_certs();
 
@@ -522,7 +535,8 @@
     gtk_widget_show(gui->dialog);
 
     /* Clear the log window */
-    if (clear_log) {
+    if (clear_log)
+    {
         gtk_text_buffer_set_text(
             gtk_text_view_get_buffer(GTK_TEXT_VIEW(gui->log_text)), "", 0);
     }
@@ -586,23 +600,29 @@
 
     ENTER("gui=%p, progress=%p", gui, progress);
 
-    for (item = g_list_last(gui->progresses); item; item = item->prev) {
+    for (item = g_list_last(gui->progresses); item; item = item->prev)
+    {
         current = (Progress*) item->data;
 
         if (!current->source
-            && current != progress)
+                && current != progress)
             /* Already showed */
             continue;
 
         /* Show it */
-        if (!item->next) {
+        if (!item->next)
+        {
             /* Top-level progress */
             show_dialog(gui, TRUE);
             gtk_entry_set_text(GTK_ENTRY(gui->top_entry), current->title);
-        } else if (!item->next->next) {
+        }
+        else if (!item->next->next)
+        {
             /* Second-level progress */
             gtk_entry_set_text(GTK_ENTRY(gui->second_entry), current->title);
-        } else {
+        }
+        else
+        {
             /* Other progress */
             GtkWidget *entry = gtk_entry_new();
             GtkWidget *box = gui->other_entries_box;
@@ -613,7 +633,8 @@
                 gui->other_entries_box = box = gtk_vbox_new(TRUE, 6);
             gtk_box_pack_start_defaults(GTK_BOX(box), entry);
             gtk_widget_show(entry);
-            if (new_box) {
+            if (new_box)
+            {
                 gtk_table_resize(GTK_TABLE(gui->entries_table),
                                  OTHER_ENTRIES_ROW_OFFSET + 1, 2);
                 gtk_table_attach_defaults(
@@ -623,7 +644,8 @@
             }
         }
 
-        if (current->source) {
+        if (current->source)
+        {
             /* Stop delayed call */
             g_source_remove(current->source);
             current->source = 0;
@@ -649,10 +671,12 @@
 
     ENTER("gui=%p, progress=%p", gui, progress);
 
-    for (item = gui->progresses; item; item = item->next) {
+    for (item = gui->progresses; item; item = item->next)
+    {
         current = (Progress*) item->data;
 
-        if (current->source) {
+        if (current->source)
+        {
             /* Not yet showed */
             g_source_remove(current->source);
             current->source = 0;
@@ -663,13 +687,18 @@
         }
 
         /* Hide it */
-        if (!item->next) {
+        if (!item->next)
+        {
             /* Top-level progress */
             gtk_entry_set_text(GTK_ENTRY(gui->second_entry), "");
-        } else if (!item->next->next) {
+        }
+        else if (!item->next->next)
+        {
             /* Second-level progress */
             gtk_entry_set_text(GTK_ENTRY(gui->second_entry), "");
-        } else {
+        }
+        else
+        {
             /* Other progress */
             GtkWidget *box = gui->other_entries_box;
             GList *entries;
@@ -677,10 +706,13 @@
             g_return_if_fail(box);
             entries = gtk_container_get_children(GTK_CONTAINER(box));
             g_return_if_fail(entries);
-            if (entries->next) {
+            if (entries->next)
+            {
                 /* Another progress is still to be showed */
                 gtk_widget_destroy(GTK_WIDGET(g_list_last(entries)->data));
-            } else {
+            }
+            else
+            {
                 /* Last other progress to be hided */
                 gtk_table_resize(GTK_TABLE(gui->entries_table),
                                  OTHER_ENTRIES_ROW_OFFSET, 2);
@@ -760,12 +792,14 @@
         return NULL;
 
     p = text;
-    while (strchr(p, '<')) {
+    while (strchr(p, '<'))
+    {
         q = p + 1;
         if (*q && toupper(*q++) == 'H'
-            && *q && toupper(*q++) == 'T'
-            && *q && toupper(*q++) == 'M'
-            && *q && toupper(*q) == 'L') {
+                && *q && toupper(*q++) == 'T'
+                && *q && toupper(*q++) == 'M'
+                && *q && toupper(*q) == 'L')
+        {
             *p = '\0';
             return text;
         }
@@ -806,9 +840,12 @@
     confirm_entry = glade_xml_get_widget(xml, "confirm_entry");
     confirm_label = glade_xml_get_widget(xml, "confirm_label");
     remember_pin_checkbutton = glade_xml_get_widget(xml, "remember_pin");
-    if (is_tan) {
+    if (is_tan)
+    {
         gtk_widget_hide(remember_pin_checkbutton);
-    } else {
+    }
+    else
+    {
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remember_pin_checkbutton),
                                      gui->cache_passwords);
     }
@@ -819,24 +856,29 @@
     if (title)
         gtk_window_set_title(GTK_WINDOW(dialog), title);
 
-    if (text) {
+    if (text)
+    {
         gchar *raw_text = strip_html(g_strdup(text));
         gtk_label_set_text(GTK_LABEL(heading_label), raw_text);
         g_free(raw_text);
     }
 
-    if (*input) {
+    if (*input)
+    {
         gtk_entry_set_text(GTK_ENTRY(input_entry), *input);
         erase_password(*input);
         *input = NULL;
     }
 
-    if (confirm) {
+    if (confirm)
+    {
         gtk_entry_set_activates_default(GTK_ENTRY(input_entry), FALSE);
         gtk_entry_set_activates_default(GTK_ENTRY(confirm_entry), TRUE);
         gtk_entry_set_max_length(GTK_ENTRY(input_entry), max_len);
         gtk_entry_set_max_length(GTK_ENTRY(confirm_entry), max_len);
-    } else {
+    }
+    else
+    {
         gtk_entry_set_activates_default(GTK_ENTRY(input_entry), TRUE);
         gtk_entry_set_max_length(GTK_ENTRY(input_entry), max_len);
         gtk_widget_hide(confirm_entry);
@@ -845,27 +887,30 @@
     gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
 
     /* Ask the user until he enters a valid input or cancels */
-    while (TRUE) {
+    while (TRUE)
+    {
         gboolean remember_pin;
 
         if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK)
             break;
 
-        if (!is_tan) {
+        if (!is_tan)
+        {
             /* Enable or disable the password cache */
             remember_pin = gtk_toggle_button_get_active(
-                GTK_TOGGLE_BUTTON(remember_pin_checkbutton));
+                               GTK_TOGGLE_BUTTON(remember_pin_checkbutton));
             enable_password_cache(gui, remember_pin);
             gnc_gconf_set_bool(GCONF_SECTION_AQBANKING, KEY_REMEMBER_PIN,
                                remember_pin, NULL);
         }
 
         internal_input = gtk_entry_get_text(GTK_ENTRY(input_entry));
-        if (strlen(internal_input) < min_len) {
+        if (strlen(internal_input) < min_len)
+        {
             gboolean retval;
             gchar *msg = g_strdup_printf(
-                _("The PIN needs to be at least %d characters \n"
-                  "long. Do you want to try again?"), min_len);
+                             _("The PIN needs to be at least %d characters \n"
+                               "long. Do you want to try again?"), min_len);
             retval = gnc_verify_dialog(gui->parent, TRUE, "%s", msg);
             g_free(msg);
             if (!retval)
@@ -873,13 +918,15 @@
             continue;
         }
 
-        if (!confirm) {
+        if (!confirm)
+        {
             *input = g_strdup(internal_input);
             break;
         }
 
         internal_confirmed = gtk_entry_get_text(GTK_ENTRY(confirm_entry));
-        if (strcmp(internal_input, internal_confirmed) == 0) {
+        if (strcmp(internal_input, internal_confirmed) == 0)
+        {
             *input = g_strdup(internal_input);
             break;
         }
@@ -893,7 +940,7 @@
 
 static gint
 messagebox_cb(GWEN_GUI *gwen_gui, guint32 flags, const gchar *title,
-              const gchar *text, const gchar *b1,const gchar *b2,
+              const gchar *text, const gchar *b1, const gchar *b2,
               const gchar *b3, guint32 guiid)
 {
     GncGWENGui *gui = GETDATA_GUI(gwen_gui);
@@ -908,9 +955,9 @@
           b3 ? b3 : "(null)");
 
     dialog = gtk_dialog_new_with_buttons(
-        title, gui->parent ? GTK_WINDOW(gui->parent) : NULL,
-        GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-        b1, 1, b2, 2, b3, 3, (gchar*) NULL);
+                 title, gui->parent ? GTK_WINDOW(gui->parent) : NULL,
+                 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                 b1, 1, b2, 2, b3, 3, (gchar*) NULL);
 
     raw_text = strip_html(g_strdup(text));
     label = gtk_label_new(raw_text);
@@ -926,7 +973,8 @@
     result = gtk_dialog_run(GTK_DIALOG(dialog));
     gtk_widget_destroy(dialog);
 
-    if (result<1 || result>3) {
+    if (result < 1 || result > 3)
+    {
         g_warning("messagebox_cb: Bad result %d", result);
         result = 0;
     }
@@ -949,7 +997,8 @@
 
     get_input(gui, flags, title, text, &input, min_len, max_len);
 
-    if (input) {
+    if (input)
+    {
         /* Copy the input to the result buffer */
         strncpy(buffer, input, max_len);
         buffer[max_len-1] = '\0';
@@ -972,8 +1021,8 @@
     ENTER("gui=%p, flags=%d, title=%s", gui, flags, title ? title : "(null)");
 
     dialog = gtk_message_dialog_new(
-        gui->parent ? GTK_WINDOW(gui->parent) : NULL, 0, GTK_MESSAGE_INFO,
-        GTK_BUTTONS_OK, "%s", text);
+                 gui->parent ? GTK_WINDOW(gui->parent) : NULL, 0, GTK_MESSAGE_INFO,
+                 GTK_BUTTONS_OK, "%s", text);
 
     if (title)
         gtk_window_set_title(GTK_WINDOW(dialog), title);
@@ -1004,22 +1053,31 @@
 
     ENTER("gui=%p, id=%d", gui, id);
 
-    if (id == 0) {
-        if (gui->showbox_last) {
+    if (id == 0)
+    {
+        if (gui->showbox_last)
+        {
             g_hash_table_remove(gui->showbox_hash,
                                 GUINT_TO_POINTER(gui->showbox_id));
             gui->showbox_last = NULL;
-        } else {
+        }
+        else
+        {
             g_warning("hidebox_cb: Last showed message box already destroyed");
         }
-    } else {
+    }
+    else
+    {
         gpointer p_var;
         p_var = g_hash_table_lookup(gui->showbox_hash, GUINT_TO_POINTER(id));
-        if (p_var) {
+        if (p_var)
+        {
             g_hash_table_remove(gui->showbox_hash, GUINT_TO_POINTER(id));
             if (p_var == gui->showbox_last)
                 gui->showbox_last = NULL;
-        } else {
+        }
+        else
+        {
             g_warning("hidebox_cb: Message box %d could not been found", id);
         }
     }
@@ -1039,14 +1097,18 @@
     ENTER("gui=%p, flags=%d, title=%s, total=%" G_GUINT64_FORMAT, gui,
           progressFlags, title ? title : "(null)", (guint64)total);
 
-    if (!gui->progresses) {
+    if (!gui->progresses)
+    {
         /* Top-level progress */
-        if (progressFlags & GWEN_GUI_PROGRESS_SHOW_PROGRESS) {
+        if (progressFlags & GWEN_GUI_PROGRESS_SHOW_PROGRESS)
+        {
             gtk_widget_set_sensitive(gui->top_progress, TRUE);
             gtk_progress_bar_set_fraction(
                 GTK_PROGRESS_BAR(gui->top_progress), 0.0);
             gui->max_actions = total;
-        } else {
+        }
+        else
+        {
             gtk_widget_set_sensitive(gui->top_progress, FALSE);
             gui->max_actions = -1;
         }
@@ -1059,12 +1121,15 @@
     progress->title = title ? g_strdup(title) : "";
     gui->progresses = g_list_prepend(gui->progresses, progress);
 
-    if (progressFlags & GWEN_GUI_PROGRESS_DELAY) {
+    if (progressFlags & GWEN_GUI_PROGRESS_DELAY)
+    {
         /* Show progress later */
         progress->source = g_timeout_add(GWEN_GUI_DELAY_SECS * 1000,
                                          (GSourceFunc) show_progress_cb,
                                          progress);
-    } else {
+    }
+    else
+    {
         /* Show it now */
         progress->source = 0;
         show_progress(gui, progress);
@@ -1084,8 +1149,9 @@
     ENTER("gui=%p, progress=%" G_GUINT64_FORMAT, gui, (guint64)progress);
 
     if (id == 1                                  /* top-level progress */
-        && gui->max_actions > 0                  /* progressbar active */
-        && progress != GWEN_GUI_PROGRESS_NONE) { /* progressbar update needed */
+            && gui->max_actions > 0                  /* progressbar active */
+            && progress != GWEN_GUI_PROGRESS_NONE)   /* progressbar update needed */
+    {
         if (progress == GWEN_GUI_PROGRESS_ONE)
             gui->current_action++;
         else
@@ -1140,7 +1206,8 @@
 
     ENTER("gui=%p, id=%d", gui, id);
 
-    if (gui->state != RUNNING) {
+    if (gui->state != RUNNING)
+    {
         /* Ignore finishes of progresses we do not track */
         LEAVE("not running anymore");
         return 0;
@@ -1154,7 +1221,8 @@
     gui->progresses = g_list_delete_link(gui->progresses, gui->progresses);
     free_progress(progress, NULL);
 
-    if (!gui->progresses) {
+    if (!gui->progresses)
+    {
         /* top-level progress finished */
         set_finished(gui);
     }
@@ -1177,14 +1245,19 @@
     ENTER("gui=%p, flags=%d, token=%s", gui, flags, token ? token : "(null");
 
     /* Check remembered passwords, excluding TANs */
-    if (!is_tan && gui->cache_passwords && gui->passwords && token) {
-        if (flags & GWEN_GUI_INPUT_FLAGS_RETRY) {
+    if (!is_tan && gui->cache_passwords && gui->passwords && token)
+    {
+        if (flags & GWEN_GUI_INPUT_FLAGS_RETRY)
+        {
             /* If remembered, remove password from memory */
             g_hash_table_remove(gui->passwords, token);
-        } else {
+        }
+        else
+        {
             gpointer p_var;
             if (g_hash_table_lookup_extended(gui->passwords, token, NULL,
-                                             &p_var)) {
+                                             &p_var))
+            {
                 /* Copy the password to the result buffer */
                 password = p_var;
                 strncpy(buffer, password, max_len);
@@ -1198,17 +1271,22 @@
 
     get_input(gui, flags, title, text, &password, min_len, max_len);
 
-    if (password) {
+    if (password)
+    {
         /* Copy the password to the result buffer */
         strncpy(buffer, password, max_len);
         buffer[max_len-1] = '\0';
 
-        if (!is_tan && token) {
-            if (gui->cache_passwords && gui->passwords) {
+        if (!is_tan && token)
+        {
+            if (gui->cache_passwords && gui->passwords)
+            {
                 /* Remember password */
                 DEBUG("Remember password, token=%s", token);
                 g_hash_table_insert(gui->passwords, g_strdup(token), password);
-            } else {
+            }
+            else
+            {
                 /* Remove the password from memory */
                 DEBUG("Forget password, token=%s", token);
                 erase_password(password);
@@ -1230,7 +1308,8 @@
 
     ENTER("gui=%p, token=%s, status=%d", gui, token ? token : "(null)", status);
 
-    if (gui->passwords && status != GWEN_Gui_PasswordStatus_Ok) {
+    if (gui->passwords && status != GWEN_Gui_PasswordStatus_Ok)
+    {
         /* If remembered, remove password from memory */
         g_hash_table_remove(gui->passwords, token);
     }
@@ -1274,31 +1353,37 @@
     md5_finish_ctx(&md5_context, cert_hash);
 
     /* Did we get the permanently accepted certs from AqBanking? */
-    if (gui->permanently_accepted_certs) {
+    if (gui->permanently_accepted_certs)
+    {
         /* Generate a hex string of the cert_hash for usage by AqBanking cert store */
         cert_hash_hex = g_new0(gchar, 33);
         for (i = 0; i < 16; i++)
-            g_snprintf(cert_hash_hex+2*i, 3, "%02X", (unsigned char)cert_hash[i]);
-    
-        retval=GWEN_DB_GetIntValue(gui->permanently_accepted_certs, cert_hash_hex, 0, -1);
+            g_snprintf(cert_hash_hex + 2 * i, 3, "%02X", (unsigned char)cert_hash[i]);
+
+        retval = GWEN_DB_GetIntValue(gui->permanently_accepted_certs, cert_hash_hex, 0, -1);
         g_free(cert_hash_hex);
-        if (retval == 0) {
+        if (retval == 0)
+        {
             /* Certificate is marked as accepted in AqBanking's cert store */
             LEAVE("Certificate accepted by AqBanking's permanent cert store");
             return 0;
         }
-    } else {
+    }
+    else
+    {
         g_warning("Can't check permanently accepted certs from invalid AqBanking cert store.");
     }
 
-    if (g_hash_table_lookup(gui->accepted_certs, cert_hash)) {
+    if (g_hash_table_lookup(gui->accepted_certs, cert_hash))
+    {
         /* Certificate has been accepted by Gnucash before */
         LEAVE("Automatically accepting certificate");
         return 0;
     }
 
     retval = gui->builtin_checkcert(gwen_gui, cert, io, guiid);
-    if (retval == 0) {
+    if (retval == 0)
+    {
         /* Certificate has been accepted */
         g_hash_table_insert(gui->accepted_certs, g_strdup(cert_hash), cert_hash);
     }
@@ -1308,14 +1393,16 @@
 }
 
 gboolean
-ggg_delete_event_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data){
+ggg_delete_event_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data)
+{
     GncGWENGui *gui = user_data;
 
     g_return_val_if_fail(gui, FALSE);
 
     ENTER("gui=%p, state=%d", gui, gui->state);
 
-    if (gui->state == RUNNING) {
+    if (gui->state == RUNNING)
+    {
         const char *still_running_msg =
             _("The Online Banking job is still running; are you "
               "sure you want to cancel?");

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -77,55 +77,77 @@
 #define PLUGIN_ACTIONS_NAME "gnc-plugin-aqbanking-actions"
 #define PLUGIN_UI_FILENAME  "gnc-plugin-aqbanking-ui.xml"
 
-static GtkActionEntry gnc_plugin_actions [] = {
+static GtkActionEntry gnc_plugin_actions [] =
+{
     /* Menus */
     { "OnlineActionsAction", NULL, N_("_Online Actions"), NULL, NULL, NULL },
 
     /* Menu Items */
-    { "ABSetupAction", NULL, N_("_Online Banking Setup..."), NULL,
-      N_("Initial setup of Online Banking access (HBCI, or OFX DirectConnect, using AqBanking)"),
-      G_CALLBACK(gnc_plugin_ab_cmd_setup) },
-    { "ABGetBalanceAction", NULL, N_("Get _Balance"), NULL,
-      N_("Get the account balance online through Online Banking"),
-      G_CALLBACK(gnc_plugin_ab_cmd_get_balance) },
-    { "ABGetTransAction", NULL, N_("Get _Transactions..."), NULL,
-      N_("Get the transactions online through Online Banking"),
-      G_CALLBACK(gnc_plugin_ab_cmd_get_transactions) },
-    { "ABIssueTransAction", NULL, N_("_Issue Transaction..."), NULL,
-      N_("Issue a new transaction online through Online Banking"),
-      G_CALLBACK(gnc_plugin_ab_cmd_issue_transaction) },
-    { "ABIssueIntTransAction", NULL, N_("I_nternal Transaction..."), NULL,
-      N_("Issue a new bank-internal transaction online through Online Banking"),
-      G_CALLBACK(gnc_plugin_ab_cmd_issue_inttransaction) },
-    { "ABIssueDirectDebitAction", NULL, N_("_Direct Debit..."), NULL,
-      N_("Issue a new direct debit note online through Online Banking"),
-      G_CALLBACK(gnc_plugin_ab_cmd_issue_direct_debit) },
+    {
+        "ABSetupAction", NULL, N_("_Online Banking Setup..."), NULL,
+        N_("Initial setup of Online Banking access (HBCI, or OFX DirectConnect, using AqBanking)"),
+        G_CALLBACK(gnc_plugin_ab_cmd_setup)
+    },
+    {
+        "ABGetBalanceAction", NULL, N_("Get _Balance"), NULL,
+        N_("Get the account balance online through Online Banking"),
+        G_CALLBACK(gnc_plugin_ab_cmd_get_balance)
+    },
+    {
+        "ABGetTransAction", NULL, N_("Get _Transactions..."), NULL,
+        N_("Get the transactions online through Online Banking"),
+        G_CALLBACK(gnc_plugin_ab_cmd_get_transactions)
+    },
+    {
+        "ABIssueTransAction", NULL, N_("_Issue Transaction..."), NULL,
+        N_("Issue a new transaction online through Online Banking"),
+        G_CALLBACK(gnc_plugin_ab_cmd_issue_transaction)
+    },
+    {
+        "ABIssueIntTransAction", NULL, N_("I_nternal Transaction..."), NULL,
+        N_("Issue a new bank-internal transaction online through Online Banking"),
+        G_CALLBACK(gnc_plugin_ab_cmd_issue_inttransaction)
+    },
+    {
+        "ABIssueDirectDebitAction", NULL, N_("_Direct Debit..."), NULL,
+        N_("Issue a new direct debit note online through Online Banking"),
+        G_CALLBACK(gnc_plugin_ab_cmd_issue_direct_debit)
+    },
 
     /* File -> Import menu item */
-    { "Mt940ImportAction", GTK_STOCK_CONVERT, N_("Import _MT940"), NULL,
-      N_("Import a MT940 file into GnuCash"),
-      G_CALLBACK(gnc_plugin_ab_cmd_mt940_import) },
-    { "Mt942ImportAction", GTK_STOCK_CONVERT, N_("Import MT94_2"), NULL,
-      N_("Import a MT942 file into GnuCash"),
-      G_CALLBACK(gnc_plugin_ab_cmd_mt942_import) },
-    { "DtausImportAction", GTK_STOCK_CONVERT, N_("Import _DTAUS"), NULL,
-      N_("Import a DTAUS file into GnuCash"),
-      G_CALLBACK(gnc_plugin_ab_cmd_dtaus_import) },
-/* #ifdef CSV_IMPORT_FUNCTIONAL */
-/*     { "CsvImportAction", GTK_STOCK_CONVERT, N_("Import _CSV"), NULL, */
-/*       N_("Import a CSV file into GnuCash"), */
-/*       G_CALLBACK(gnc_plugin_ab_cmd_csv_import) }, */
-/*     { "CsvImportSendAction", GTK_STOCK_CONVERT, N_("Import CSV and s_end..."), NULL, */
-/*       N_("Import a CSV file into GnuCash and send the transfers online through Online Banking"), */
-/*       G_CALLBACK(gnc_plugin_ab_cmd_csv_importsend) }, */
-/* #endif */
-    { "DtausImportSendAction", GTK_STOCK_CONVERT, N_("Import DTAUS and _send..."), NULL,
-      N_("Import a DTAUS file into GnuCash and send the transfers online through Online Banking"),
-      G_CALLBACK(gnc_plugin_ab_cmd_dtaus_importsend) },
+    {
+        "Mt940ImportAction", GTK_STOCK_CONVERT, N_("Import _MT940"), NULL,
+        N_("Import a MT940 file into GnuCash"),
+        G_CALLBACK(gnc_plugin_ab_cmd_mt940_import)
+    },
+    {
+        "Mt942ImportAction", GTK_STOCK_CONVERT, N_("Import MT94_2"), NULL,
+        N_("Import a MT942 file into GnuCash"),
+        G_CALLBACK(gnc_plugin_ab_cmd_mt942_import)
+    },
+    {
+        "DtausImportAction", GTK_STOCK_CONVERT, N_("Import _DTAUS"), NULL,
+        N_("Import a DTAUS file into GnuCash"),
+        G_CALLBACK(gnc_plugin_ab_cmd_dtaus_import)
+    },
+    /* #ifdef CSV_IMPORT_FUNCTIONAL */
+    /*     { "CsvImportAction", GTK_STOCK_CONVERT, N_("Import _CSV"), NULL, */
+    /*       N_("Import a CSV file into GnuCash"), */
+    /*       G_CALLBACK(gnc_plugin_ab_cmd_csv_import) }, */
+    /*     { "CsvImportSendAction", GTK_STOCK_CONVERT, N_("Import CSV and s_end..."), NULL, */
+    /*       N_("Import a CSV file into GnuCash and send the transfers online through Online Banking"), */
+    /*       G_CALLBACK(gnc_plugin_ab_cmd_csv_importsend) }, */
+    /* #endif */
+    {
+        "DtausImportSendAction", GTK_STOCK_CONVERT, N_("Import DTAUS and _send..."), NULL,
+        N_("Import a DTAUS file into GnuCash and send the transfers online through Online Banking"),
+        G_CALLBACK(gnc_plugin_ab_cmd_dtaus_importsend)
+    },
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
 
-static const gchar *need_account_actions[] = {
+static const gchar *need_account_actions[] =
+{
     "ABGetBalanceAction",
     "ABGetTransAction",
     "ABIssueTransAction",
@@ -209,18 +231,21 @@
     const gchar *page_name;
 
     ENTER("main window %p, page %p", window, page);
-    if (!GNC_IS_PLUGIN_PAGE(page)) {
+    if (!GNC_IS_PLUGIN_PAGE(page))
+    {
         LEAVE("no plugin_page");
         return;
     }
 
     page_name = gnc_plugin_page_get_plugin_name(page);
-    if (!page_name) {
+    if (!page_name)
+    {
         LEAVE("no page_name of plugin_page");
         return;
     }
 
-    if (strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0) {
+    if (strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
+    {
         DEBUG("account tree page, adding signal");
         g_signal_connect(page, "account_selected",
                          G_CALLBACK(gnc_plugin_ab_account_selected), NULL);
@@ -283,31 +308,39 @@
     const gchar    *account_name;
 
     ENTER("main window %p", window);
-    if (!GNC_IS_MAIN_WINDOW(window)) {
+    if (!GNC_IS_MAIN_WINDOW(window))
+    {
         LEAVE("no main_window");
         return NULL;
     }
 
     page = gnc_main_window_get_current_page(window);
-    if (!GNC_IS_PLUGIN_PAGE(page)) {
+    if (!GNC_IS_PLUGIN_PAGE(page))
+    {
         LEAVE("no plugin_page");
         return NULL;
     }
     page_name = gnc_plugin_page_get_plugin_name(page);
-    if (!page_name) {
+    if (!page_name)
+    {
         LEAVE("no page_name of plugin_page");
         return NULL;
     }
 
-    if (strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER_NAME) == 0) {
+    if (strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER_NAME) == 0)
+    {
         DEBUG("register page");
         account = gnc_plugin_page_register_get_account(
-            GNC_PLUGIN_PAGE_REGISTER(page));
-    } else if (strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0) {
+                      GNC_PLUGIN_PAGE_REGISTER(page));
+    }
+    else if (strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
+    {
         DEBUG("account tree page");
         account = gnc_plugin_page_account_tree_get_current_account(
-            GNC_PLUGIN_PAGE_ACCOUNT_TREE(page));
-    } else {
+                      GNC_PLUGIN_PAGE_ACCOUNT_TREE(page));
+    }
+    else
+    {
         account = NULL;
     }
     account_name = account ? xaccAccountGetName(account) : NULL;
@@ -334,7 +367,8 @@
 
     ENTER("action %p, main window data %p", action, data);
     account = main_window_to_account(data->window);
-    if (account == NULL) {
+    if (account == NULL)
+    {
         g_message("No AqBanking account selected");
         LEAVE("no account");
         return;
@@ -353,7 +387,8 @@
 
     ENTER("action %p, main window data %p", action, data);
     account = main_window_to_account(data->window);
-    if (account == NULL) {
+    if (account == NULL)
+    {
         g_message("No AqBanking account selected");
         LEAVE("no account");
         return;
@@ -372,7 +407,8 @@
 
     ENTER("action %p, main window data %p", action, data);
     account = main_window_to_account(data->window);
-    if (account == NULL) {
+    if (account == NULL)
+    {
         g_message("No AqBanking account selected");
         LEAVE("no account");
         return;
@@ -391,7 +427,8 @@
 
     ENTER("action %p, main window data %p", action, data);
     account = main_window_to_account(data->window);
-    if (account == NULL) {
+    if (account == NULL)
+    {
         g_message("No AqBanking account selected");
         LEAVE("no account");
         return;
@@ -411,7 +448,8 @@
 
     ENTER("action %p, main window data %p", action, data);
     account = main_window_to_account(data->window);
-    if (account == NULL) {
+    if (account == NULL)
+    {
         g_message("No AqBanking account selected");
         LEAVE("no account");
         return;

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.h
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -50,11 +50,13 @@
 #define GNC_PLUGIN_AQBANKING_NAME "gnc-plugin-aqbanking"
 
 /* typedefs & structures */
-typedef struct {
+typedef struct
+{
     GncPlugin gnc_plugin;
 } GncPluginAqBanking;
 
-typedef struct {
+typedef struct
+{
     GncPluginClass gnc_plugin;
 } GncPluginAqBankingClass;
 

Modified: gnucash/trunk/src/import-export/aqbanking/gncmod-aqbanking.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gncmod-aqbanking.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/aqbanking/gncmod-aqbanking.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -53,7 +53,8 @@
 }
 
 gchar *
-libgncmod_aqbanking_gnc_module_description(void) {
+libgncmod_aqbanking_gnc_module_description(void)
+{
     return g_strdup("Support for Online Banking protocols");
 }
 
@@ -61,10 +62,11 @@
 libgncmod_aqbanking_gnc_module_init(gint refcount)
 {
     /* Load modules we depend on */
-    if(!gnc_module_load("gnucash/engine", 0)
-       || !gnc_module_load("gnucash/app-utils", 0)
-       || !gnc_module_load("gnucash/gnome-utils", 0)
-       || !gnc_module_load("gnucash/import-export", 0)) {
+    if (!gnc_module_load("gnucash/engine", 0)
+            || !gnc_module_load("gnucash/app-utils", 0)
+            || !gnc_module_load("gnucash/gnome-utils", 0)
+            || !gnc_module_load("gnucash/import-export", 0))
+    {
         return FALSE;
     }
 
@@ -81,7 +83,8 @@
 }
 
 gint
-libgncmod_aqbanking_gnc_module_end(gint refcount) {
+libgncmod_aqbanking_gnc_module_end(gint refcount)
+{
     /* Delete the shared AB_BANKING object */
     gnc_AB_BANKING_delete(NULL);
 

Modified: gnucash/trunk/src/import-export/binary-import/druid-commodity.c
===================================================================
--- gnucash/trunk/src/import-export/binary-import/druid-commodity.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/binary-import/druid-commodity.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -42,62 +42,64 @@
 /* This static indicates the debugging module that this .o belongs to.  */
 static QofLogModule log_module = GNC_MOD_GUI;
 
-struct _commoditydruid {
-  GtkWidget  * window; 
-  GtkWidget  * druid;
+struct _commoditydruid
+{
+    GtkWidget  * window;
+    GtkWidget  * druid;
 
-  GtkWidget  * intro_page;  
-  GtkWidget  * finish_page;
-  
-  GHashTable * new_map;
-  GHashTable * old_map;
-  GList      * pages;
-  
-  int        is_modal;
+    GtkWidget  * intro_page;
+    GtkWidget  * finish_page;
+
+    GHashTable * new_map;
+    GHashTable * old_map;
+    GList      * pages;
+
+    int        is_modal;
 };
 
-struct _commoditydruidpage {
-  GtkWidget * page;
-  char      * old_name;
-  GtkWidget * new_type_combo;
-  GtkWidget * new_name_entry;
-  GtkWidget * new_mnemonic_entry;
-};  
+struct _commoditydruidpage
+{
+    GtkWidget * page;
+    char      * old_name;
+    GtkWidget * new_type_combo;
+    GtkWidget * new_name_entry;
+    GtkWidget * new_mnemonic_entry;
+};
 
 typedef struct _commoditydruidpage CommodityDruidPage;
 static CommodityDruidPage * make_commodity_druid_page(gnc_commodity * comm);
- 
+
 static GdkColor std_bg_color = { 0, 39835, 49087, 40092 };
 static GdkColor std_logo_bg_color = { 0, 65535, 65535, 65535 };
 static GdkColor std_title_color =  { 0, 65535, 65535, 65535 };
 
-static int gnc_ui_commodity_druid_comm_check_cb(GnomeDruidPage * page, 
-                                                gpointer druid, 
-                                                gpointer user_data);
+static int gnc_ui_commodity_druid_comm_check_cb(GnomeDruidPage * page,
+        gpointer druid,
+        gpointer user_data);
 
 static gboolean gnc_ui_commodity_druid_cancel_cb(GnomeDruidPage * page,
-                                                 gpointer druid,
-                                                 gpointer user_data);
+        gpointer druid,
+        gpointer user_data);
 
 static void gnc_ui_commodity_druid_finish_cb(GnomeDruidPage * page,
-                                             gpointer druid,
-                                             gpointer user_data);
+        gpointer druid,
+        gpointer user_data);
 
 
 void
 gnc_import_legacy_commodities(const char * filename)
 {
-  CommodityDruid * d;
+    CommodityDruid * d;
 
-  if (!gnc_commodity_table_has_namespace (gnc_get_current_commodities (),
-                                          GNC_COMMODITY_NS_LEGACY))
-    return;
+    if (!gnc_commodity_table_has_namespace (gnc_get_current_commodities (),
+                                            GNC_COMMODITY_NS_LEGACY))
+        return;
 
-  d = gnc_ui_commodity_druid_create(filename);
-  d->is_modal = TRUE;
+    d = gnc_ui_commodity_druid_create(filename);
+    d->is_modal = TRUE;
 
-  gtk_window_set_modal(GTK_WINDOW(d->window), TRUE);
-  gtk_main();  
+    gtk_window_set_modal(GTK_WINDOW(d->window), TRUE);
+    gtk_main();
 }
 
 
@@ -106,15 +108,15 @@
                  GdkEvent  *event,
                  gpointer  user_data)
 {
-  CommodityDruid *cd = user_data;
+    CommodityDruid *cd = user_data;
 
-  /* unload the current file (can't have out-of-date commodities) */
-  gnc_file_quit ();
+    /* unload the current file (can't have out-of-date commodities) */
+    gnc_file_quit ();
 
-  gnc_ui_commodity_druid_destroy (cd);
+    gnc_ui_commodity_druid_destroy (cd);
 
-  /* Don't delete the window, we'll handle things ourselves. */
-  return TRUE;
+    /* Don't delete the window, we'll handle things ourselves. */
+    return TRUE;
 }
 
 
@@ -123,212 +125,214 @@
  ********************************************************************/
 
 CommodityDruid *
-gnc_ui_commodity_druid_create(const char * filename) 
+gnc_ui_commodity_druid_create(const char * filename)
 {
 
-  CommodityDruid * d = g_new0(CommodityDruid, 1);
-  GtkObject      * dobj;
-  GList          * orphans, * l;
-  gnc_commodity  * lost;
-  gnc_commodity  * found;
-  CommodityDruidPage * new_page;
-  GnomeDruidPage * back_page;
-  GladeXML       * xml;
-  QofBook        * book = gnc_get_current_book ();
+    CommodityDruid * d = g_new0(CommodityDruid, 1);
+    GtkObject      * dobj;
+    GList          * orphans, * l;
+    gnc_commodity  * lost;
+    gnc_commodity  * found;
+    CommodityDruidPage * new_page;
+    GnomeDruidPage * back_page;
+    GladeXML       * xml;
+    QofBook        * book = gnc_get_current_book ();
 
-  xml = gnc_glade_xml_new ("binary-import.glade",
-                           "New Commodity Format Druid");
+    xml = gnc_glade_xml_new ("binary-import.glade",
+                             "New Commodity Format Druid");
 
-  d->window = glade_xml_get_widget (xml, "New Commodity Format Druid");
-  dobj = GTK_OBJECT(d->window);
+    d->window = glade_xml_get_widget (xml, "New Commodity Format Druid");
+    dobj = GTK_OBJECT(d->window);
 
-  g_signal_connect (dobj, "delete_event",
-		    G_CALLBACK (window_delete_cb), d);
+    g_signal_connect (dobj, "delete_event",
+                      G_CALLBACK (window_delete_cb), d);
 
-  d->druid           = glade_xml_get_widget (xml, "commodity_druid");
-  d->intro_page      = glade_xml_get_widget (xml, "start_page");
-  d->finish_page     = glade_xml_get_widget (xml, "finish_page");
-  back_page = GNOME_DRUID_PAGE(d->intro_page);
+    d->druid           = glade_xml_get_widget (xml, "commodity_druid");
+    d->intro_page      = glade_xml_get_widget (xml, "start_page");
+    d->finish_page     = glade_xml_get_widget (xml, "finish_page");
+    back_page = GNOME_DRUID_PAGE(d->intro_page);
 
-  d->is_modal = FALSE;
+    d->is_modal = FALSE;
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_commodity_druid_cancel_cb",
      G_CALLBACK (gnc_ui_commodity_druid_cancel_cb), d);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_commodity_druid_finish_cb",
      G_CALLBACK (gnc_ui_commodity_druid_finish_cb), d);
 
-  d->new_map = g_hash_table_new(g_str_hash, g_str_equal);
-  d->old_map = g_hash_table_new(g_str_hash, g_str_equal);
-  orphans = 
-    gnc_commodity_table_get_commodities(gnc_get_current_commodities(),
-                                        GNC_COMMODITY_NS_LEGACY);
+    d->new_map = g_hash_table_new(g_str_hash, g_str_equal);
+    d->old_map = g_hash_table_new(g_str_hash, g_str_equal);
+    orphans =
+        gnc_commodity_table_get_commodities(gnc_get_current_commodities(),
+                                            GNC_COMMODITY_NS_LEGACY);
 
-  /* make a new list with the (saved) old mnemonic and the 
-   * new currency. */
-  for(l=orphans; l; l=l->next) {
-    lost = (gnc_commodity *)l->data;
-    
-    /* if the mnemonic is an ISO-4217 currency, use that as 
-     * the default */
-    found = gnc_commodity_table_lookup(gnc_get_current_commodities(),
-                                       GNC_COMMODITY_NS_CURRENCY,
-                                       gnc_commodity_get_mnemonic(lost));
+    /* make a new list with the (saved) old mnemonic and the
+     * new currency. */
+    for (l = orphans; l; l = l->next)
+    {
+        lost = (gnc_commodity *)l->data;
 
-    /* otherwise, guess that it's a NASDAQ security. */
-    if(!found) {
-      found = gnc_commodity_new(book, gnc_commodity_get_mnemonic(lost),
-                                GNC_COMMODITY_NS_NASDAQ,
-                                gnc_commodity_get_mnemonic(lost),
-                                NULL, 100000);
-    }
+        /* if the mnemonic is an ISO-4217 currency, use that as
+         * the default */
+        found = gnc_commodity_table_lookup(gnc_get_current_commodities(),
+                                           GNC_COMMODITY_NS_CURRENCY,
+                                           gnc_commodity_get_mnemonic(lost));
 
-    g_hash_table_insert(d->new_map, (gpointer)gnc_commodity_get_mnemonic(lost),
-                        (gpointer)found);
-    g_hash_table_insert(d->old_map, (gpointer)gnc_commodity_get_mnemonic(lost),
-                        (gpointer)lost);
-    
-    /* create a new page in the wizard for the commodity */
-    new_page = make_commodity_druid_page(found);
+        /* otherwise, guess that it's a NASDAQ security. */
+        if (!found)
+        {
+            found = gnc_commodity_new(book, gnc_commodity_get_mnemonic(lost),
+                                      GNC_COMMODITY_NS_NASDAQ,
+                                      gnc_commodity_get_mnemonic(lost),
+                                      NULL, 100000);
+        }
 
-    /* set up next/back signal handlers */
-    g_signal_connect(new_page->page, "next",
-		     G_CALLBACK(gnc_ui_commodity_druid_comm_check_cb),
-		     d);
-    
-    g_signal_connect(new_page->page, "cancel",
-		     G_CALLBACK(gnc_ui_commodity_druid_cancel_cb),
-		     d);
+        g_hash_table_insert(d->new_map, (gpointer)gnc_commodity_get_mnemonic(lost),
+                            (gpointer)found);
+        g_hash_table_insert(d->old_map, (gpointer)gnc_commodity_get_mnemonic(lost),
+                            (gpointer)lost);
 
-    d->pages = g_list_append(d->pages, new_page);
+        /* create a new page in the wizard for the commodity */
+        new_page = make_commodity_druid_page(found);
 
-    gnome_druid_insert_page(GNOME_DRUID(d->druid),
-                            back_page, 
-                            GNOME_DRUID_PAGE(new_page->page));
-    back_page = GNOME_DRUID_PAGE(new_page->page);
-  }
+        /* set up next/back signal handlers */
+        g_signal_connect(new_page->page, "next",
+                         G_CALLBACK(gnc_ui_commodity_druid_comm_check_cb),
+                         d);
 
-  gnc_druid_set_colors (GNOME_DRUID (d->druid));
+        g_signal_connect(new_page->page, "cancel",
+                         G_CALLBACK(gnc_ui_commodity_druid_cancel_cb),
+                         d);
 
-  gtk_widget_show_all(d->window);
+        d->pages = g_list_append(d->pages, new_page);
 
-  g_list_free(orphans);
+        gnome_druid_insert_page(GNOME_DRUID(d->druid),
+                                back_page,
+                                GNOME_DRUID_PAGE(new_page->page));
+        back_page = GNOME_DRUID_PAGE(new_page->page);
+    }
 
-  return d;
+    gnc_druid_set_colors (GNOME_DRUID (d->druid));
+
+    gtk_widget_show_all(d->window);
+
+    g_list_free(orphans);
+
+    return d;
 }
 
 
 /********************************************************************
- * make_commodity_druid_page : build a single commodity xlator 
- * page.  This really should be done in glade, but I can't figure out 
- * how to make it work. 
+ * make_commodity_druid_page : build a single commodity xlator
+ * page.  This really should be done in glade, but I can't figure out
+ * how to make it work.
  ********************************************************************/
 
 
 static CommodityDruidPage *
-make_commodity_druid_page(gnc_commodity * comm) 
+make_commodity_druid_page(gnc_commodity * comm)
 {
-  CommodityDruidPage * retval = g_new0(CommodityDruidPage, 1);
-  GtkWidget * alignment;
-  GtkWidget * top_vbox;
-  GtkWidget * info_label;
-  GtkWidget * next_label;
-  GtkWidget * temp;
-  char      * title = NULL;
-  GnomeDruidPageStandard * page;
+    CommodityDruidPage * retval = g_new0(CommodityDruidPage, 1);
+    GtkWidget * alignment;
+    GtkWidget * top_vbox;
+    GtkWidget * info_label;
+    GtkWidget * next_label;
+    GtkWidget * temp;
+    char      * title = NULL;
+    GnomeDruidPageStandard * page;
 
-  /* make the page widget */
-  retval->page = gnome_druid_page_standard_new_with_vals("", NULL, NULL);
-  g_object_set_data(G_OBJECT(retval->page), "page_struct", retval);
+    /* make the page widget */
+    retval->page = gnome_druid_page_standard_new_with_vals("", NULL, NULL);
+    g_object_set_data(G_OBJECT(retval->page), "page_struct", retval);
 
-  page = GNOME_DRUID_PAGE_STANDARD(retval->page);
+    page = GNOME_DRUID_PAGE_STANDARD(retval->page);
 
-  /* save the old commodity name */
-  retval->old_name = g_strdup(gnc_commodity_get_mnemonic(comm));
-  title = g_strdup_printf("Enter information about \"%s\"",
-                          retval->old_name ? retval->old_name : "");
+    /* save the old commodity name */
+    retval->old_name = g_strdup(gnc_commodity_get_mnemonic(comm));
+    title = g_strdup_printf("Enter information about \"%s\"",
+                            retval->old_name ? retval->old_name : "");
 
-  gnome_druid_page_standard_set_background(page, & std_bg_color);  
-  gnome_druid_page_standard_set_logo_background(page, & std_logo_bg_color);
-  gnome_druid_page_standard_set_title_foreground(page, & std_title_color);
-  gnome_druid_page_standard_set_title(page, title);
-  g_free(title);
+    gnome_druid_page_standard_set_background(page, & std_bg_color);
+    gnome_druid_page_standard_set_logo_background(page, & std_logo_bg_color);
+    gnome_druid_page_standard_set_title_foreground(page, & std_title_color);
+    gnome_druid_page_standard_set_title(page, title);
+    g_free(title);
 
-  alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
-  gtk_box_pack_start(GTK_BOX(page->vbox), alignment, FALSE, FALSE, 0);
+    alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+    gtk_box_pack_start(GTK_BOX(page->vbox), alignment, FALSE, FALSE, 0);
 
-  top_vbox = gtk_vbox_new(FALSE, 3);
-  gtk_container_add(GTK_CONTAINER(alignment), top_vbox);
+    top_vbox = gtk_vbox_new(FALSE, 3);
+    gtk_container_add(GTK_CONTAINER(alignment), top_vbox);
 
-  info_label = 
-    gtk_label_new(_("Pick the type of the currency or security. For "
-                    "national currencies, use \"CURRENCY\". "
-                    "Enter a new type in the box if the ones in the "
-                    "pick list are inappropriate."));
+    info_label =
+        gtk_label_new(_("Pick the type of the currency or security. For "
+                        "national currencies, use \"CURRENCY\". "
+                        "Enter a new type in the box if the ones in the "
+                        "pick list are inappropriate."));
 
-  gtk_label_set_justify (GTK_LABEL(info_label), GTK_JUSTIFY_LEFT);
-  gtk_box_pack_start(GTK_BOX(top_vbox), info_label, TRUE, TRUE, 0);
+    gtk_label_set_justify (GTK_LABEL(info_label), GTK_JUSTIFY_LEFT);
+    gtk_box_pack_start(GTK_BOX(top_vbox), info_label, TRUE, TRUE, 0);
 
-  temp = gtk_hbox_new(FALSE, 0);
-  gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 0);
+    temp = gtk_hbox_new(FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 0);
 
-  retval->new_type_combo = gtk_combo_new(); 
-  gtk_box_pack_start(GTK_BOX(temp), retval->new_type_combo, TRUE, TRUE, 0);
+    retval->new_type_combo = gtk_combo_new();
+    gtk_box_pack_start(GTK_BOX(temp), retval->new_type_combo, TRUE, TRUE, 0);
 
-  gnc_ui_update_namespace_picker(retval->new_type_combo, 
-                                 gnc_commodity_get_namespace(comm),
-                                 DIAG_COMM_ALL);
+    gnc_ui_update_namespace_picker(retval->new_type_combo,
+                                   gnc_commodity_get_namespace(comm),
+                                   DIAG_COMM_ALL);
 
-  temp = gtk_hbox_new(FALSE, 0);
-  gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 5);
+    temp = gtk_hbox_new(FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 5);
 
-  info_label = 
-    gtk_label_new(_("Enter a descriptive name for the currency or stock, "
-                    "such as \"US Dollar\" or \"Red Hat Stock\""));
+    info_label =
+        gtk_label_new(_("Enter a descriptive name for the currency or stock, "
+                        "such as \"US Dollar\" or \"Red Hat Stock\""));
 
-  gtk_label_set_justify (GTK_LABEL(info_label), GTK_JUSTIFY_LEFT);
-  gtk_box_pack_start(GTK_BOX(top_vbox), info_label, TRUE, TRUE, 0);
+    gtk_label_set_justify (GTK_LABEL(info_label), GTK_JUSTIFY_LEFT);
+    gtk_box_pack_start(GTK_BOX(top_vbox), info_label, TRUE, TRUE, 0);
 
-  temp = gtk_hbox_new(FALSE, 0);
-  gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 0);
+    temp = gtk_hbox_new(FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 0);
 
-  retval->new_name_entry = gtk_entry_new();
-  gtk_box_pack_start(GTK_BOX(temp), retval->new_name_entry,
-                     TRUE, TRUE, 0);
-  gtk_entry_set_text(GTK_ENTRY(retval->new_name_entry),
-                     gnc_commodity_get_fullname(comm));
+    retval->new_name_entry = gtk_entry_new();
+    gtk_box_pack_start(GTK_BOX(temp), retval->new_name_entry,
+                       TRUE, TRUE, 0);
+    gtk_entry_set_text(GTK_ENTRY(retval->new_name_entry),
+                       gnc_commodity_get_fullname(comm));
 
-  temp = gtk_hbox_new(FALSE, 0);
-  gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 5);
+    temp = gtk_hbox_new(FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 5);
 
-  info_label = 
-    gtk_label_new(_("Enter the ticker symbol (such as \"RHAT\"), "
-                    "national currency symbol (such as \"USD\"), or "
-                    "other unique abbreviation for the name."));
+    info_label =
+        gtk_label_new(_("Enter the ticker symbol (such as \"RHAT\"), "
+                        "national currency symbol (such as \"USD\"), or "
+                        "other unique abbreviation for the name."));
 
-  gtk_label_set_justify (GTK_LABEL(info_label), GTK_JUSTIFY_LEFT);
-  gtk_box_pack_start(GTK_BOX(top_vbox), info_label, TRUE, TRUE, 0);
+    gtk_label_set_justify (GTK_LABEL(info_label), GTK_JUSTIFY_LEFT);
+    gtk_box_pack_start(GTK_BOX(top_vbox), info_label, TRUE, TRUE, 0);
 
-  temp = gtk_hbox_new(FALSE, 0);
-  gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 0);
+    temp = gtk_hbox_new(FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 0);
 
-  retval->new_mnemonic_entry = gtk_entry_new();
-  gtk_box_pack_start(GTK_BOX(temp), retval->new_mnemonic_entry,
-                     TRUE, TRUE, 0);
-  gtk_entry_set_text(GTK_ENTRY(retval->new_mnemonic_entry),
-                     gnc_commodity_get_mnemonic(comm));
+    retval->new_mnemonic_entry = gtk_entry_new();
+    gtk_box_pack_start(GTK_BOX(temp), retval->new_mnemonic_entry,
+                       TRUE, TRUE, 0);
+    gtk_entry_set_text(GTK_ENTRY(retval->new_mnemonic_entry),
+                       gnc_commodity_get_mnemonic(comm));
 
-  temp = gtk_hbox_new(FALSE, 0);
-  gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 5);
+    temp = gtk_hbox_new(FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 5);
 
-  next_label = gtk_label_new(_("Click \"Next\" to accept the information "
-                               "and move to the next currency or stock."));
-  gtk_label_set_justify (GTK_LABEL(next_label), GTK_JUSTIFY_LEFT);
-  gtk_box_pack_start(GTK_BOX(top_vbox), next_label, TRUE, TRUE, 0);
+    next_label = gtk_label_new(_("Click \"Next\" to accept the information "
+                                 "and move to the next currency or stock."));
+    gtk_label_set_justify (GTK_LABEL(next_label), GTK_JUSTIFY_LEFT);
+    gtk_box_pack_start(GTK_BOX(top_vbox), next_label, TRUE, TRUE, 0);
 
-  return retval;
+    return retval;
 }
 
 
@@ -337,32 +341,34 @@
  ********************************************************************/
 
 void
-gnc_ui_commodity_druid_destroy(CommodityDruid * cd) 
-{  
-  GList * p;
-  CommodityDruidPage * cdp;
+gnc_ui_commodity_druid_destroy(CommodityDruid * cd)
+{
+    GList * p;
+    CommodityDruidPage * cdp;
 
-  /* remove the old commodities no matter how we exit */
-  gnc_commodity_table_delete_namespace(gnc_get_current_commodities(),
-                                       GNC_COMMODITY_NS_LEGACY);
+    /* remove the old commodities no matter how we exit */
+    gnc_commodity_table_delete_namespace(gnc_get_current_commodities(),
+                                         GNC_COMMODITY_NS_LEGACY);
 
-  for(p=cd->pages; p; p=p->next) {
-    cdp = (CommodityDruidPage *)p->data;
-    g_free(cdp->old_name);
-    g_free(cdp);
-  }
+    for (p = cd->pages; p; p = p->next)
+    {
+        cdp = (CommodityDruidPage *)p->data;
+        g_free(cdp->old_name);
+        g_free(cdp);
+    }
 
-  g_list_free(cd->pages);
-  g_hash_table_destroy(cd->new_map);
-  g_hash_table_destroy(cd->old_map);
+    g_list_free(cd->pages);
+    g_hash_table_destroy(cd->new_map);
+    g_hash_table_destroy(cd->old_map);
 
-  gtk_widget_destroy(GTK_WIDGET(cd->window));
+    gtk_widget_destroy(GTK_WIDGET(cd->window));
 
-  if(cd->is_modal) {
-    gtk_main_quit();
-  }
+    if (cd->is_modal)
+    {
+        gtk_main_quit();
+    }
 
-  g_free (cd);
+    g_free (cd);
 }
 
 
@@ -372,141 +378,142 @@
 
 static gboolean
 gnc_ui_commodity_druid_cancel_cb(GnomeDruidPage * page, gpointer druid,
-                                 gpointer user_data) 
+                                 gpointer user_data)
 {
-  CommodityDruid * cd = user_data;
+    CommodityDruid * cd = user_data;
 
-  /* destroy the dialog */
-  gnc_ui_commodity_druid_destroy(cd);
+    /* destroy the dialog */
+    gnc_ui_commodity_druid_destroy(cd);
 
-  /* unload the current file (can't have out-of-date commodities) */
-  gnc_file_quit ();
-  gnc_file_new ();
+    /* unload the current file (can't have out-of-date commodities) */
+    gnc_file_quit ();
+    gnc_file_new ();
 
-  return TRUE;
+    return TRUE;
 }
 
 
 static gboolean
 gnc_ui_commodity_druid_comm_check_cb(GnomeDruidPage * page, gpointer druid,
-                                     gpointer user_data) 
+                                     gpointer user_data)
 {
-  CommodityDruid * cd = user_data;
-  CommodityDruidPage * dpage = g_object_get_data(G_OBJECT(page), "page_struct");
-  gchar * new_type;
-  const gchar * new_name;
-  const gchar * new_mnemonic;
-  gnc_commodity * new_comm;
+    CommodityDruid * cd = user_data;
+    CommodityDruidPage * dpage = g_object_get_data(G_OBJECT(page), "page_struct");
+    gchar * new_type;
+    const gchar * new_name;
+    const gchar * new_mnemonic;
+    gnc_commodity * new_comm;
 
-  new_type     = gnc_ui_namespace_picker_ns (dpage->new_type_combo);
-  new_name     = gtk_entry_get_text(GTK_ENTRY(dpage->new_name_entry));
-  new_mnemonic = gtk_entry_get_text(GTK_ENTRY(dpage->new_mnemonic_entry));
-  if((strlen(new_type) == 0) ||
-     (strlen(new_name) == 0) ||
-     (strlen(new_mnemonic) == 0)) {
-    gnc_warning_dialog(cd->window,
-		       _("You must put values for the type, name, "
-			 "and abbreviation of the currency/stock."));
+    new_type     = gnc_ui_namespace_picker_ns (dpage->new_type_combo);
+    new_name     = gtk_entry_get_text(GTK_ENTRY(dpage->new_name_entry));
+    new_mnemonic = gtk_entry_get_text(GTK_ENTRY(dpage->new_mnemonic_entry));
+    if ((strlen(new_type) == 0) ||
+            (strlen(new_name) == 0) ||
+            (strlen(new_mnemonic) == 0))
+    {
+        gnc_warning_dialog(cd->window,
+                           _("You must put values for the type, name, "
+                             "and abbreviation of the currency/stock."));
 
-    g_free(new_type);
-    return TRUE;
-  }
+        g_free(new_type);
+        return TRUE;
+    }
 
-  if (gnc_commodity_namespace_is_iso (new_type) &&
-      !gnc_commodity_table_lookup (gnc_get_current_commodities (),
-                                   new_type, new_mnemonic))
-  {
-    gnc_warning_dialog(cd->window,
-		       _("You must enter an existing national "
-			 "currency or enter a different type."));
-    g_free(new_type);
-    return TRUE;
-  }
-  new_comm = g_hash_table_lookup(cd->new_map, dpage->old_name);
-  g_assert(new_comm);
+    if (gnc_commodity_namespace_is_iso (new_type) &&
+            !gnc_commodity_table_lookup (gnc_get_current_commodities (),
+                                         new_type, new_mnemonic))
+    {
+        gnc_warning_dialog(cd->window,
+                           _("You must enter an existing national "
+                             "currency or enter a different type."));
+        g_free(new_type);
+        return TRUE;
+    }
+    new_comm = g_hash_table_lookup(cd->new_map, dpage->old_name);
+    g_assert(new_comm);
 
-  /* fill in the commodity structure info */
-  gnc_commodity_set_fullname(new_comm, new_name);
-  gnc_commodity_set_namespace(new_comm, new_type);
-  gnc_commodity_set_mnemonic(new_comm, new_mnemonic);
+    /* fill in the commodity structure info */
+    gnc_commodity_set_fullname(new_comm, new_name);
+    gnc_commodity_set_namespace(new_comm, new_type);
+    gnc_commodity_set_mnemonic(new_comm, new_mnemonic);
 
-  g_free(new_type);
-  return FALSE;
+    g_free(new_type);
+    return FALSE;
 }
 
-static void 
-finish_helper(gpointer key, gpointer value, gpointer data) 
+static void
+finish_helper(gpointer key, gpointer value, gpointer data)
 {
-  CommodityDruid * cd = data;
-  gnc_commodity  * comm = value; 
-  gnc_commodity  * old_comm = g_hash_table_lookup(cd->old_map, key);
-  GList          * accts;
-  GList          * node;
-  QofBook        * book = gnc_get_current_book ();
+    CommodityDruid * cd = data;
+    gnc_commodity  * comm = value;
+    gnc_commodity  * old_comm = g_hash_table_lookup(cd->old_map, key);
+    GList          * accts;
+    GList          * node;
+    QofBook        * book = gnc_get_current_book ();
 
-  if(!book) 
-  {
-    PERR("finish_helper - no current book.");
-    return;
-  }
+    if (!book)
+    {
+        PERR("finish_helper - no current book.");
+        return;
+    }
 
-  /* key is the old mnemonic, value is a pointer to the gnc_commodity 
-   * structure. */
-  comm = gnc_commodity_table_insert(gnc_get_current_commodities(), comm);
+    /* key is the old mnemonic, value is a pointer to the gnc_commodity
+     * structure. */
+    comm = gnc_commodity_table_insert(gnc_get_current_commodities(), comm);
 
-  /* s/old commodity/new commodity/g  in the pricedb */
-  gnc_pricedb_substitute_commodity(gnc_book_get_pricedb(book),
-				   old_comm,
-				   comm);
+    /* s/old commodity/new commodity/g  in the pricedb */
+    gnc_pricedb_substitute_commodity(gnc_book_get_pricedb(book),
+                                     old_comm,
+                                     comm);
 
-  /* now replace all the accounts using old_comm with new_comm */
-  accts = gnc_account_get_descendants(gnc_get_current_root_account ());
+    /* now replace all the accounts using old_comm with new_comm */
+    accts = gnc_account_get_descendants(gnc_get_current_root_account ());
 
-  for(node = accts; node; node = node->next)
-  {
-    Account *account = node->data;
+    for (node = accts; node; node = node->next)
+    {
+        Account *account = node->data;
 
-    xaccAccountBeginEdit(account);
+        xaccAccountBeginEdit(account);
 
-    if (gnc_commodity_equiv (DxaccAccountGetCurrency(account),
-                             old_comm))
-      DxaccAccountSetCurrency (account, comm);
+        if (gnc_commodity_equiv (DxaccAccountGetCurrency(account),
+                                 old_comm))
+            DxaccAccountSetCurrency (account, comm);
 
-    if (gnc_commodity_equiv (xaccAccountGetCommodity(account), old_comm))
-      xaccAccountSetCommodity(account, comm);
+        if (gnc_commodity_equiv (xaccAccountGetCommodity(account), old_comm))
+            xaccAccountSetCommodity(account, comm);
 
-    xaccAccountCommitEdit(account);    
-  }
+        xaccAccountCommitEdit(account);
+    }
 
-  g_list_free (accts);
+    g_list_free (accts);
 }
 
 
 static void
 gnc_ui_commodity_druid_finish_cb(GnomeDruidPage * page, gpointer druid,
-                                 gpointer user_data) 
+                                 gpointer user_data)
 {
-  CommodityDruid * cd = user_data;
+    CommodityDruid * cd = user_data;
 
-  /* add the new commodities to the engine's namespace map and 
-   * replace the account commodity pointers */
-  g_hash_table_foreach(cd->new_map, &finish_helper, (gpointer)cd);
+    /* add the new commodities to the engine's namespace map and
+     * replace the account commodity pointers */
+    g_hash_table_foreach(cd->new_map, &finish_helper, (gpointer)cd);
 
-  /* Fix account and transaction commodities */
-  xaccAccountTreeScrubCommodities (gnc_get_current_root_account ());
+    /* Fix account and transaction commodities */
+    xaccAccountTreeScrubCommodities (gnc_get_current_root_account ());
 
-  /* Fix split amount/value */
-  xaccAccountTreeScrubSplits (gnc_get_current_root_account ());
+    /* Fix split amount/value */
+    xaccAccountTreeScrubSplits (gnc_get_current_root_account ());
 
-  /* destroy the dialog */
-  gnc_ui_commodity_druid_destroy(cd);
+    /* destroy the dialog */
+    gnc_ui_commodity_druid_destroy(cd);
 }
 
 
 void gnc_import_commodities(QofSession *session, gpointer unused)
 {
-  const gchar *book_url;
+    const gchar *book_url;
 
-  book_url = qof_session_get_url(session);
-  gnc_import_legacy_commodities(book_url);
+    book_url = qof_session_get_url(session);
+    gnc_import_legacy_commodities(book_url);
 }

Modified: gnucash/trunk/src/import-export/binary-import/gncmod-binary-import.c
===================================================================
--- gnucash/trunk/src/import-export/binary-import/gncmod-binary-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/binary-import/gncmod-binary-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -26,39 +26,47 @@
 
 
 char *
-libgncmod_binary_import_gnc_module_path(void) {
-  return g_strdup("gnucash/import-export/binary-import");
+libgncmod_binary_import_gnc_module_path(void)
+{
+    return g_strdup("gnucash/import-export/binary-import");
 }
 
 char *
-libgncmod_binary_import_gnc_module_description(void) {
-  return g_strdup("Utilities importing GnuCash binary files");
+libgncmod_binary_import_gnc_module_description(void)
+{
+    return g_strdup("Utilities importing GnuCash binary files");
 }
 
 int
-libgncmod_binary_import_gnc_module_init(int refcount) {
-  /* load the engine (we depend on it) */
-  if(!gnc_module_load("gnucash/engine", 0)) {
-    return FALSE;
-  }
+libgncmod_binary_import_gnc_module_init(int refcount)
+{
+    /* load the engine (we depend on it) */
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
 
-  /* load the calculation module (we depend on it) */
-  if(!gnc_module_load("gnucash/app-utils", 0)) {
-    return FALSE;
-  }
+    /* load the calculation module (we depend on it) */
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
 
-  /* load the calculation module (we depend on it) */
-  if(!gnc_module_load("gnucash/gnome-utils", 0)) {
-    return FALSE;
-  }
+    /* load the calculation module (we depend on it) */
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
 
-  if (refcount == 0) {
-    gnc_hook_add_dangler(HOOK_BOOK_OPENED, (GFunc)gnc_import_commodities, NULL);
-  }
-  return TRUE;
+    if (refcount == 0)
+    {
+        gnc_hook_add_dangler(HOOK_BOOK_OPENED, (GFunc)gnc_import_commodities, NULL);
+    }
+    return TRUE;
 }
 
 int
-libgncmod_binary_import_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_binary_import_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/import-export/binary-import/test/test-link-module.c
===================================================================
--- gnucash/trunk/src/import-export/binary-import/test/test-link-module.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/binary-import/test/test-link-module.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,6 +1,7 @@
 #include <stdlib.h>
 
 int
-main(int argc, char ** argv) {
-  exit(0);
+main(int argc, char ** argv)
+{
+    exit(0);
 }

Modified: gnucash/trunk/src/import-export/csv/gnc-csv-gnumeric-popup.c
===================================================================
--- gnucash/trunk/src/import-export/csv/gnc-csv-gnumeric-popup.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/csv/gnc-csv-gnumeric-popup.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -54,105 +54,111 @@
 static void
 popup_item_activate (GtkWidget *item, gpointer *user_data)
 {
-	GnumericPopupMenuElement const *elem =
-		g_object_get_data (G_OBJECT (item), "descriptor");
-	GnumericPopupMenuHandler handler =
-		g_object_get_data (G_OBJECT (item), "handler");
+    GnumericPopupMenuElement const *elem =
+        g_object_get_data (G_OBJECT (item), "descriptor");
+    GnumericPopupMenuHandler handler =
+        g_object_get_data (G_OBJECT (item), "handler");
 
-	g_return_if_fail (elem != NULL);
-	g_return_if_fail (handler != NULL);
+    g_return_if_fail (elem != NULL);
+    g_return_if_fail (handler != NULL);
 
-	if (handler (elem, user_data))
-		gtk_widget_destroy (gtk_widget_get_toplevel (item));
+    if (handler (elem, user_data))
+        gtk_widget_destroy (gtk_widget_get_toplevel (item));
 }
 
 static void
 gnumeric_create_popup_menu_list (GSList *elements,
-				 GnumericPopupMenuHandler handler,
-				 gpointer user_data,
-				 int display_filter,
-				 int sensitive_filter,
-				 GdkEventButton *event)
+                                 GnumericPopupMenuHandler handler,
+                                 gpointer user_data,
+                                 int display_filter,
+                                 int sensitive_filter,
+                                 GdkEventButton *event)
 {
-	GtkWidget *menu, *item;
-	char const *trans;
+    GtkWidget *menu, *item;
+    char const *trans;
 
-	menu = gtk_menu_new ();
+    menu = gtk_menu_new ();
 
-	for (; elements != NULL ; elements = elements->next) {
-		GnumericPopupMenuElement const *element = elements->data;
-		char const * const name = element->name;
-		char const * const pix_name = element->pixmap;
+    for (; elements != NULL ; elements = elements->next)
+    {
+        GnumericPopupMenuElement const *element = elements->data;
+        char const * const name = element->name;
+        char const * const pix_name = element->pixmap;
 
-		item = NULL;
+        item = NULL;
 
-		if (element->display_filter != 0 &&
-		    !(element->display_filter & display_filter))
-			continue;
+        if (element->display_filter != 0 &&
+                !(element->display_filter & display_filter))
+            continue;
 
-		if (name != NULL && *name != '\0') {
-			trans = _(name);
-			item = gtk_image_menu_item_new_with_mnemonic (trans);
-			if (element->sensitive_filter != 0 &&
-			    (element->sensitive_filter & sensitive_filter))
-				gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
-			if (pix_name != NULL) {
-				GtkWidget *image = gtk_image_new_from_stock (pix_name,
-                                        GTK_ICON_SIZE_MENU);
-				gtk_widget_show (image);
-				gtk_image_menu_item_set_image (
-					GTK_IMAGE_MENU_ITEM (item),
-					image);
-			}
-		} else {
-			/* separator */
-			item = gtk_menu_item_new ();
-			gtk_widget_set_sensitive (item, FALSE);
-		}
+        if (name != NULL && *name != '\0')
+        {
+            trans = _(name);
+            item = gtk_image_menu_item_new_with_mnemonic (trans);
+            if (element->sensitive_filter != 0 &&
+                    (element->sensitive_filter & sensitive_filter))
+                gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
+            if (pix_name != NULL)
+            {
+                GtkWidget *image = gtk_image_new_from_stock (pix_name,
+                                   GTK_ICON_SIZE_MENU);
+                gtk_widget_show (image);
+                gtk_image_menu_item_set_image (
+                    GTK_IMAGE_MENU_ITEM (item),
+                    image);
+            }
+        }
+        else
+        {
+            /* separator */
+            item = gtk_menu_item_new ();
+            gtk_widget_set_sensitive (item, FALSE);
+        }
 
-		if (element->index != 0) {
-			g_signal_connect (G_OBJECT (item),
-				"activate",
-				G_CALLBACK (&popup_item_activate), user_data);
-			g_object_set_data (
-				G_OBJECT (item), "descriptor", (gpointer)(element));
-			g_object_set_data (
-				G_OBJECT (item), "handler", (gpointer)handler);
-		}
+        if (element->index != 0)
+        {
+            g_signal_connect (G_OBJECT (item),
+                              "activate",
+                              G_CALLBACK (&popup_item_activate), user_data);
+            g_object_set_data (
+                G_OBJECT (item), "descriptor", (gpointer)(element));
+            g_object_set_data (
+                G_OBJECT (item), "handler", (gpointer)handler);
+        }
 
-		gtk_widget_show (item);
-		gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-	}
+        gtk_widget_show (item);
+        gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+    }
 
-	gnumeric_popup_menu (GTK_MENU (menu), event);
+    gnumeric_popup_menu (GTK_MENU (menu), event);
 }
 
 void
 gnumeric_create_popup_menu (GnumericPopupMenuElement const *elements,
-			    GnumericPopupMenuHandler handler,
-			    gpointer user_data,
-			    int display_filter, int sensitive_filter,
-			    GdkEventButton *event)
+                            GnumericPopupMenuHandler handler,
+                            gpointer user_data,
+                            int display_filter, int sensitive_filter,
+                            GdkEventButton *event)
 {
-	int i;
-	GSList *tmp = NULL;
+    int i;
+    GSList *tmp = NULL;
 
-	for (i = 0; elements [i].name != NULL; i++)
-		tmp = g_slist_prepend (tmp, (gpointer)(elements + i));
+    for (i = 0; elements [i].name != NULL; i++)
+        tmp = g_slist_prepend (tmp, (gpointer)(elements + i));
 
-	tmp = g_slist_reverse (tmp);
-	gnumeric_create_popup_menu_list (tmp, handler, user_data,
-		display_filter, sensitive_filter, event);
-	g_slist_free (tmp);
+    tmp = g_slist_reverse (tmp);
+    gnumeric_create_popup_menu_list (tmp, handler, user_data,
+                                     display_filter, sensitive_filter, event);
+    g_slist_free (tmp);
 }
 
 static void
 kill_popup_menu (GtkWidget *widget, GtkMenu *menu)
 {
-	g_return_if_fail (menu != NULL);
-	g_return_if_fail (GTK_IS_MENU (menu));
+    g_return_if_fail (menu != NULL);
+    g_return_if_fail (GTK_IS_MENU (menu));
 
-	g_object_unref (G_OBJECT (menu));
+    g_object_unref (G_OBJECT (menu));
 }
 
 /**
@@ -166,29 +172,29 @@
 void
 gnumeric_popup_menu (GtkMenu *menu, GdkEventButton *event)
 {
-	g_return_if_fail (menu != NULL);
-	g_return_if_fail (GTK_IS_MENU (menu));
+    g_return_if_fail (menu != NULL);
+    g_return_if_fail (GTK_IS_MENU (menu));
 
 #if GLIB_CHECK_VERSION(2,10,0) && GTK_CHECK_VERSION(2,8,14)
-	g_object_ref_sink (menu);
+    g_object_ref_sink (menu);
 #else
-	g_object_ref (menu);
-	gtk_object_sink (GTK_OBJECT (menu));
+    g_object_ref (menu);
+    gtk_object_sink (GTK_OBJECT (menu));
 #endif
 
-	if (event)
-		gtk_menu_set_screen (menu,
-				     gdk_drawable_get_screen (event->window));
+    if (event)
+        gtk_menu_set_screen (menu,
+                             gdk_drawable_get_screen (event->window));
 
-	g_signal_connect (G_OBJECT (menu),
-		"hide",
-		G_CALLBACK (kill_popup_menu), menu);
+    g_signal_connect (G_OBJECT (menu),
+                      "hide",
+                      G_CALLBACK (kill_popup_menu), menu);
 
-	/* Do NOT pass the button used to create the menu.
-	 * instead pass 0.  Otherwise bringing up a menu with
-	 * the right button will disable clicking on the menu with the left.
-	 */
-	gtk_menu_popup (menu, NULL, NULL, NULL, NULL, 0, 
-			(event != NULL) ? event->time 
-			: gtk_get_current_event_time());
+    /* Do NOT pass the button used to create the menu.
+     * instead pass 0.  Otherwise bringing up a menu with
+     * the right button will disable clicking on the menu with the left.
+     */
+    gtk_menu_popup (menu, NULL, NULL, NULL, NULL, 0,
+                    (event != NULL) ? event->time
+                    : gtk_get_current_event_time());
 }

Modified: gnucash/trunk/src/import-export/csv/gnc-csv-gnumeric-popup.h
===================================================================
--- gnucash/trunk/src/import-export/csv/gnc-csv-gnumeric-popup.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/csv/gnc-csv-gnumeric-popup.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -52,27 +52,28 @@
 
 #include <gtk/gtk.h>
 
-typedef struct {
-	char const *name;
-	char const *pixmap;
-	int display_filter;
-	int sensitive_filter;
+typedef struct
+{
+    char const *name;
+    char const *pixmap;
+    int display_filter;
+    int sensitive_filter;
 
-	int index;
+    int index;
 } GnumericPopupMenuElement;
 
 typedef gboolean (*GnumericPopupMenuHandler) (GnumericPopupMenuElement const *e,
-					      gpointer user_data);
+        gpointer user_data);
 
 /* Use this on menus that are popped up */
 void gnumeric_popup_menu (GtkMenu *menu, GdkEventButton *event);
 
 void gnumeric_create_popup_menu (GnumericPopupMenuElement const *elements,
-				 GnumericPopupMenuHandler handler,
-				 gpointer user_data,
-				 int display_filter,
-				 int sensitive_filter,
-				 GdkEventButton *event);
+                                 GnumericPopupMenuHandler handler,
+                                 gpointer user_data,
+                                 int display_filter,
+                                 int sensitive_filter,
+                                 GdkEventButton *event);
 
 
 #endif

Modified: gnucash/trunk/src/import-export/csv/gnc-csv-import.c
===================================================================
--- gnucash/trunk/src/import-export/csv/gnc-csv-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/csv/gnc-csv-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -49,38 +49,39 @@
  * different types of checkbuttons that the user can click to
  * configure separators in a delimited file. */
 enum SEP_BUTTON_TYPES {SEP_SPACE, SEP_TAB, SEP_COMMA, SEP_COLON, SEP_SEMICOLON, SEP_HYPHEN,
-                       SEP_NUM_OF_TYPES};
+                       SEP_NUM_OF_TYPES
+                      };
 
 /** Data for the preview dialog. This struct contains all of the data
  * relevant to the preview dialog that lets the user configure an
  * import. */
 typedef struct
 {
-  GncCsvParseData* parse_data; /**< The actual data we are previewing */
-  GtkDialog* dialog;
-  GOCharmapSel* encselector; /**< The widget for selecting the encoding */
-  GtkComboBox* date_format_combo; /**< The widget for selecting the date format */
-  GladeXML* xml; /**< The Glade file that contains the dialog. */
-  GtkTreeView* treeview; /**< The treeview containing the data */
-  GtkTreeView* ctreeview; /**< The treeview containing the column types */
-  GtkCheckButton* sep_buttons[SEP_NUM_OF_TYPES]; /**< Checkbuttons for common separators */
-  GtkCheckButton* custom_cbutton; /**< The checkbutton for a custom separator */
-  GtkEntry* custom_entry; /**< The entry for custom separators */
-  gboolean encoding_selected_called; /**< Before encoding_selected is first called, this is FALSE.
+    GncCsvParseData* parse_data; /**< The actual data we are previewing */
+    GtkDialog* dialog;
+    GOCharmapSel* encselector; /**< The widget for selecting the encoding */
+    GtkComboBox* date_format_combo; /**< The widget for selecting the date format */
+    GladeXML* xml; /**< The Glade file that contains the dialog. */
+    GtkTreeView* treeview; /**< The treeview containing the data */
+    GtkTreeView* ctreeview; /**< The treeview containing the column types */
+    GtkCheckButton* sep_buttons[SEP_NUM_OF_TYPES]; /**< Checkbuttons for common separators */
+    GtkCheckButton* custom_cbutton; /**< The checkbutton for a custom separator */
+    GtkEntry* custom_entry; /**< The entry for custom separators */
+    gboolean encoding_selected_called; /**< Before encoding_selected is first called, this is FALSE.
                                       * (See description of encoding_selected.) */
-  gboolean not_empty; /**< FALSE initially, true after the first type gnc_csv_preview_update is called. */
-  gboolean previewing_errors; /**< TRUE if the dialog is displaying
+    gboolean not_empty; /**< FALSE initially, true after the first type gnc_csv_preview_update is called. */
+    gboolean previewing_errors; /**< TRUE if the dialog is displaying
                                * error lines, instead of all the file
                                * data. */
-  int code_encoding_calls; /**< Normally this is 0. If the computer
+    int code_encoding_calls; /**< Normally this is 0. If the computer
                             * changes encselector, this is set to
                             * 2. encoding_selected is called twice,
                             * each time decrementing this by 1. */
-  gboolean approved; /**< This is FALSE until the user clicks "OK". */
-  GtkWidget** treeview_buttons; /**< This array contains the header buttons in treeview */
-  int longest_line; /**< The length of the longest row */
-  int fixed_context_col; /**< The number of the column whose the user has clicked */
-  int fixed_context_dx; /**< The horizontal coordinate of the pixel in the header of the column
+    gboolean approved; /**< This is FALSE until the user clicks "OK". */
+    GtkWidget** treeview_buttons; /**< This array contains the header buttons in treeview */
+    int longest_line; /**< The length of the longest row */
+    int fixed_context_col; /**< The number of the column whose the user has clicked */
+    int fixed_context_dx; /**< The horizontal coordinate of the pixel in the header of the column
                          * the user has clicked */
 } GncCsvPreview;
 
@@ -95,56 +96,56 @@
  */
 static void sep_button_clicked(GtkWidget* widget, GncCsvPreview* preview)
 {
-  int i;
-  char* stock_separator_characters[] = {" ", "\t", ",", ":", ";", "-"};
-  GSList* checked_separators = NULL;
-  GError* error;
+    int i;
+    char* stock_separator_characters[] = {" ", "\t", ",", ":", ";", "-"};
+    GSList* checked_separators = NULL;
+    GError* error;
 
-  /* Add the corresponding characters to checked_separators for each
-   * button that is checked. */
-  for(i = 0; i < SEP_NUM_OF_TYPES; i++)
-  {
-    if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(preview->sep_buttons[i])))
-      checked_separators = g_slist_append(checked_separators, stock_separator_characters[i]);
-  }
+    /* Add the corresponding characters to checked_separators for each
+     * button that is checked. */
+    for (i = 0; i < SEP_NUM_OF_TYPES; i++)
+    {
+        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(preview->sep_buttons[i])))
+            checked_separators = g_slist_append(checked_separators, stock_separator_characters[i]);
+    }
 
-  /* Add the custom separator if the user checked its button. */
-  if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(preview->custom_cbutton)))
-  {
-    char* custom_sep = (char*)gtk_entry_get_text(preview->custom_entry);
-    if(custom_sep[0] != '\0') /* Don't add a blank separator (bad things will happen!). */
-      checked_separators = g_slist_append(checked_separators, custom_sep);
-  }
+    /* Add the custom separator if the user checked its button. */
+    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(preview->custom_cbutton)))
+    {
+        char* custom_sep = (char*)gtk_entry_get_text(preview->custom_entry);
+        if (custom_sep[0] != '\0') /* Don't add a blank separator (bad things will happen!). */
+            checked_separators = g_slist_append(checked_separators, custom_sep);
+    }
 
-  /* Set the parse options using the checked_separators list. */
-  stf_parse_options_csv_set_separators(preview->parse_data->options, NULL, checked_separators);
-  g_slist_free(checked_separators);
+    /* Set the parse options using the checked_separators list. */
+    stf_parse_options_csv_set_separators(preview->parse_data->options, NULL, checked_separators);
+    g_slist_free(checked_separators);
 
-  /* Parse the data using the new options. We don't want to reguess
-   * the column types because we want to leave the user's
-   * configurations in tact. */
-  if(gnc_csv_parse(preview->parse_data, FALSE, &error))
-  {
-    /* Warn the user there was a problem and try to undo what caused
-     * the error. (This will cause a reparsing and ideally a usable
-     * configuration.) */
-    gnc_error_dialog(NULL, "Error in parsing");
-    /* If the user changed the custom separator, erase that custom separator. */
-    if(widget == GTK_WIDGET(preview->custom_entry))
+    /* Parse the data using the new options. We don't want to reguess
+     * the column types because we want to leave the user's
+     * configurations in tact. */
+    if (gnc_csv_parse(preview->parse_data, FALSE, &error))
     {
-      gtk_entry_set_text(GTK_ENTRY(widget), "");
+        /* Warn the user there was a problem and try to undo what caused
+         * the error. (This will cause a reparsing and ideally a usable
+         * configuration.) */
+        gnc_error_dialog(NULL, "Error in parsing");
+        /* If the user changed the custom separator, erase that custom separator. */
+        if (widget == GTK_WIDGET(preview->custom_entry))
+        {
+            gtk_entry_set_text(GTK_ENTRY(widget), "");
+        }
+        /* If the user checked a checkbutton, toggle that checkbutton back. */
+        else
+        {
+            gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
+                                         !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
+        }
+        return;
     }
-    /* If the user checked a checkbutton, toggle that checkbutton back. */
-    else
-    {
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
-                                   !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
-    }
-    return;
-  }
 
-  /* If we parsed successfully, redisplay the data. */
-  gnc_csv_preview_update(preview);
+    /* If we parsed successfully, redisplay the data. */
+    gnc_csv_preview_update(preview);
 }
 
 /** Event handler for clicking one of the format type radio
@@ -154,27 +155,27 @@
  */
 static void separated_or_fixed_selected(GtkToggleButton* csv_button, GncCsvPreview* preview)
 {
-  GError* error = NULL;
-  /* Set the parsing type correctly. */
-  if(gtk_toggle_button_get_active(csv_button)) /* If we're in CSV mode ... */
-  {
-    stf_parse_options_set_type(preview->parse_data->options, PARSE_TYPE_CSV);
-  }
-  else /* If we're in fixed-width mode ... */
-  {
-    stf_parse_options_set_type(preview->parse_data->options, PARSE_TYPE_FIXED);
-  }
+    GError* error = NULL;
+    /* Set the parsing type correctly. */
+    if (gtk_toggle_button_get_active(csv_button)) /* If we're in CSV mode ... */
+    {
+        stf_parse_options_set_type(preview->parse_data->options, PARSE_TYPE_CSV);
+    }
+    else /* If we're in fixed-width mode ... */
+    {
+        stf_parse_options_set_type(preview->parse_data->options, PARSE_TYPE_FIXED);
+    }
 
-  /* Reparse the data. */
-  if(gnc_csv_parse(preview->parse_data, FALSE, &error))
-  {
-    /* Show an error dialog explaining the problem. */
-    gnc_error_dialog(NULL, "%s", error->message);
-    return;
-  }
+    /* Reparse the data. */
+    if (gnc_csv_parse(preview->parse_data, FALSE, &error))
+    {
+        /* Show an error dialog explaining the problem. */
+        gnc_error_dialog(NULL, "%s", error->message);
+        return;
+    }
 
-  /* Show the new data. */
-  gnc_csv_preview_update(preview);
+    /* Show the new data. */
+    gnc_csv_preview_update(preview);
 }
 
 /** Event handler for a new encoding. This is called when the user
@@ -187,40 +188,40 @@
 static void encoding_selected(GOCharmapSel* selector, const char* encoding,
                               GncCsvPreview* preview)
 {
-  /* This gets called twice everytime a new encoding is selected. The
-   * second call actually passes the correct data; thus, we only do
-   * something the second time this is called. */
+    /* This gets called twice everytime a new encoding is selected. The
+     * second call actually passes the correct data; thus, we only do
+     * something the second time this is called. */
 
-  /* Prevent code-caused calls of this function from having an impact. */
-  if(preview->code_encoding_calls > 0)
-  {
-    preview->code_encoding_calls--;
-    return;
-  }
+    /* Prevent code-caused calls of this function from having an impact. */
+    if (preview->code_encoding_calls > 0)
+    {
+        preview->code_encoding_calls--;
+        return;
+    }
 
-  /* If this is the second time the function is called ... */
-  if(preview->encoding_selected_called)
-  {
-    const char* previous_encoding = preview->parse_data->encoding;
-    GError* error = NULL;
-    /* Try converting the new encoding and reparsing. */
-    if(gnc_csv_convert_encoding(preview->parse_data, encoding, &error) ||
-       gnc_csv_parse(preview->parse_data, FALSE, &error))
+    /* If this is the second time the function is called ... */
+    if (preview->encoding_selected_called)
     {
-      /* If it fails, change back to the old encoding. */
-      gnc_error_dialog(NULL, "%s", _("Invalid encoding selected"));
-      preview->encoding_selected_called = FALSE;
-      go_charmap_sel_set_encoding(selector, previous_encoding);
-      return;
+        const char* previous_encoding = preview->parse_data->encoding;
+        GError* error = NULL;
+        /* Try converting the new encoding and reparsing. */
+        if (gnc_csv_convert_encoding(preview->parse_data, encoding, &error) ||
+                gnc_csv_parse(preview->parse_data, FALSE, &error))
+        {
+            /* If it fails, change back to the old encoding. */
+            gnc_error_dialog(NULL, "%s", _("Invalid encoding selected"));
+            preview->encoding_selected_called = FALSE;
+            go_charmap_sel_set_encoding(selector, previous_encoding);
+            return;
+        }
+
+        gnc_csv_preview_update(preview);
+        preview->encoding_selected_called = FALSE;
     }
-
-    gnc_csv_preview_update(preview);
-    preview->encoding_selected_called = FALSE;
-  }
-  else /* If this is the first call of the function ... */
-  {
-    preview->encoding_selected_called = TRUE; /* ... set the flag and wait for the next call. */
-  }
+    else /* If this is the first call of the function ... */
+    {
+        preview->encoding_selected_called = TRUE; /* ... set the flag and wait for the next call. */
+    }
 }
 
 /** Event handler for selecting a new date format.
@@ -229,7 +230,7 @@
  */
 static void date_format_selected(GtkComboBox* format_selector, GncCsvPreview* preview)
 {
-  preview->parse_data->date_format = gtk_combo_box_get_active(format_selector);
+    preview->parse_data->date_format = gtk_combo_box_get_active(format_selector);
 }
 
 /** Event handler for the "OK" button. When "OK" is clicked, this
@@ -240,44 +241,44 @@
  */
 static void ok_button_clicked(GtkWidget* widget, GncCsvPreview* preview)
 {
-  /* Shorten the column_types identifier. */
-  GArray* column_types = preview->parse_data->column_types;
-  int i, ncols = column_types->len; /* ncols is the number of columns in the data. */
-  /* store contains the actual strings appearing in the column types treeview. */
-  GtkTreeModel* store = gtk_tree_view_get_model(preview->ctreeview);
-  GtkTreeIter iter;
-  /* Get an iterator for the first (and only) row. */
-  gtk_tree_model_get_iter_first(store, &iter);
+    /* Shorten the column_types identifier. */
+    GArray* column_types = preview->parse_data->column_types;
+    int i, ncols = column_types->len; /* ncols is the number of columns in the data. */
+    /* store contains the actual strings appearing in the column types treeview. */
+    GtkTreeModel* store = gtk_tree_view_get_model(preview->ctreeview);
+    GtkTreeIter iter;
+    /* Get an iterator for the first (and only) row. */
+    gtk_tree_model_get_iter_first(store, &iter);
 
-  /* Go through each of the columns. */
-  for(i = 0; i < ncols; i++)
-  {
-    int type; /* The column type contained in this column. */
-    gchar* contents = NULL; /* The column type string in this column. */
-    /* Get the type string first. (store is arranged so that every two
-     * columns is a pair of the model used for the combobox and the
-     * string that appears, so that store looks like:
-     * model 0, string 0, model 1, string 1, ..., model ncols, string ncols. */
-    gtk_tree_model_get(store, &iter, 2*i+1, &contents, -1);
+    /* Go through each of the columns. */
+    for (i = 0; i < ncols; i++)
+    {
+        int type; /* The column type contained in this column. */
+        gchar* contents = NULL; /* The column type string in this column. */
+        /* Get the type string first. (store is arranged so that every two
+         * columns is a pair of the model used for the combobox and the
+         * string that appears, so that store looks like:
+         * model 0, string 0, model 1, string 1, ..., model ncols, string ncols. */
+        gtk_tree_model_get(store, &iter, 2 * i + 1, &contents, -1);
 
-    /* Go through each column type until ... */
-    for(type = 0; type < GNC_CSV_NUM_COL_TYPES; type++)
-    {
-      /* ... we find one that matches with what's in the column. */
-      if(!safe_strcmp(contents, _(gnc_csv_column_type_strs[type])))
-      {
-        /* Set the column_types array appropriately and quit. */
-        column_types->data[i] = type;
-        break;
-      }
+        /* Go through each column type until ... */
+        for (type = 0; type < GNC_CSV_NUM_COL_TYPES; type++)
+        {
+            /* ... we find one that matches with what's in the column. */
+            if (!safe_strcmp(contents, _(gnc_csv_column_type_strs[type])))
+            {
+                /* Set the column_types array appropriately and quit. */
+                column_types->data[i] = type;
+                break;
+            }
+        }
+        /* Free the type string created by gtk_tree_model_get() */
+        g_free(contents);
     }
-    /* Free the type string created by gtk_tree_model_get() */
-    g_free(contents);
-  }
 
-  /* Close the dialog. */
-  gtk_widget_hide((GtkWidget*)(preview->dialog));
-  preview->approved = TRUE; /* The user has wants to do the import. */
+    /* Close the dialog. */
+    gtk_widget_hide((GtkWidget*)(preview->dialog));
+    preview->approved = TRUE; /* The user has wants to do the import. */
 }
 
 /** Event handler for the "Cancel" button. When the user clicks
@@ -287,7 +288,7 @@
  */
 static void cancel_button_clicked(GtkWidget* widget, GncCsvPreview* preview)
 {
-  gtk_widget_hide((GtkWidget*)(preview->dialog));
+    gtk_widget_hide((GtkWidget*)(preview->dialog));
 }
 
 /** Event handler for the data treeview being resized. When the data
@@ -299,25 +300,25 @@
  */
 static void treeview_resized(GtkWidget* widget, GtkAllocation* allocation, GncCsvPreview* preview)
 {
-  /* ncols is the number of columns in the data. */
-  int i, ncols = preview->parse_data->column_types->len;
+    /* ncols is the number of columns in the data. */
+    int i, ncols = preview->parse_data->column_types->len;
 
-  /* Go through each column except for the last. (We don't want to set
-   * the width of the last column because the user won't be able to
-   * shrink the dialog back if it's expanded.) */
-  for(i = 0; i < ncols - 1; i++)
-  {
-    gint col_width; /* The width of the column in preview->treeview. */
-    GtkTreeViewColumn* ccol; /* The corresponding column in preview->ctreeview. */
+    /* Go through each column except for the last. (We don't want to set
+     * the width of the last column because the user won't be able to
+     * shrink the dialog back if it's expanded.) */
+    for (i = 0; i < ncols - 1; i++)
+    {
+        gint col_width; /* The width of the column in preview->treeview. */
+        GtkTreeViewColumn* ccol; /* The corresponding column in preview->ctreeview. */
 
-    /* Get the width. */
-    col_width = gtk_tree_view_column_get_width(gtk_tree_view_get_column(preview->treeview, i));
+        /* Get the width. */
+        col_width = gtk_tree_view_column_get_width(gtk_tree_view_get_column(preview->treeview, i));
 
-    /* Set ccol's width the same. */
-    ccol = gtk_tree_view_get_column(preview->ctreeview, i);
-    gtk_tree_view_column_set_min_width(ccol, col_width);
-    gtk_tree_view_column_set_max_width(ccol, col_width);
-  }
+        /* Set ccol's width the same. */
+        ccol = gtk_tree_view_get_column(preview->ctreeview, i);
+        gtk_tree_view_column_set_min_width(ccol, col_width);
+        gtk_tree_view_column_set_max_width(ccol, col_width);
+    }
 }
 
 /** Event handler for the user selecting a new column type. When the
@@ -332,55 +333,55 @@
 static void column_type_edited(GtkCellRenderer* renderer, gchar* path,
                                gchar* new_text, GncCsvPreview* preview)
 {
-  /* ncols is the number of columns in the data. */
-  int i, ncols = preview->parse_data->column_types->len;
-  /* store has the actual strings that appear in preview->ctreeview. */
-  GtkTreeModel* store = gtk_tree_view_get_model(preview->ctreeview);
-  GtkTreeIter iter;
-  /* Get an iterator for the first (and only) row. */
-  gtk_tree_model_get_iter_first(store, &iter);
+    /* ncols is the number of columns in the data. */
+    int i, ncols = preview->parse_data->column_types->len;
+    /* store has the actual strings that appear in preview->ctreeview. */
+    GtkTreeModel* store = gtk_tree_view_get_model(preview->ctreeview);
+    GtkTreeIter iter;
+    /* Get an iterator for the first (and only) row. */
+    gtk_tree_model_get_iter_first(store, &iter);
 
-  /* Go through each column. */
-  for(i = 0; i < ncols; i++)
-  {
-    /* We need all this stuff so that we can find out whether or not
-     * this was the column that was edited. */
-    GtkCellRenderer* col_renderer; /* The renderer for this column. */
-    /* The column in the treeview we are looking at */
-    GtkTreeViewColumn* col = gtk_tree_view_get_column(preview->ctreeview, i);
-    /* The list of renderers for col */
-    GList* rend_list = gtk_tree_view_column_get_cell_renderers(col);
-    /* rend_list has only one entry, which we put in col_renderer. */
-    col_renderer = rend_list->data;
-    g_list_free(rend_list);
+    /* Go through each column. */
+    for (i = 0; i < ncols; i++)
+    {
+        /* We need all this stuff so that we can find out whether or not
+         * this was the column that was edited. */
+        GtkCellRenderer* col_renderer; /* The renderer for this column. */
+        /* The column in the treeview we are looking at */
+        GtkTreeViewColumn* col = gtk_tree_view_get_column(preview->ctreeview, i);
+        /* The list of renderers for col */
+        GList* rend_list = gtk_tree_view_column_get_cell_renderers(col);
+        /* rend_list has only one entry, which we put in col_renderer. */
+        col_renderer = rend_list->data;
+        g_list_free(rend_list);
 
-    /* If this is not the column that was edited ... */
-    if(col_renderer != renderer)
-    {
-      /* The string that appears in the column */
-      gchar* contents = NULL;
-      /* Get the type string. (store is arranged so that every two
-       * columns is a pair of the model used for the combobox and the
-       * string that appears, so that store looks like:
-       * model 0, string 0, model 1, string 1, ..., model ncols, string ncols. */
-      gtk_tree_model_get(store, &iter, 2*i+1, &contents, -1);
-      /* If this column has the same string that the user selected ... */
-      if(!safe_strcmp(contents, new_text))
-      {
-        /* ... set this column to the "None" type. (We can't allow duplicate types.) */
-        gtk_list_store_set(GTK_LIST_STORE(store), &iter, 2*i+1,
-                           _(gnc_csv_column_type_strs[GNC_CSV_NONE]), -1);
-      }
-      g_free(contents);
+        /* If this is not the column that was edited ... */
+        if (col_renderer != renderer)
+        {
+            /* The string that appears in the column */
+            gchar* contents = NULL;
+            /* Get the type string. (store is arranged so that every two
+             * columns is a pair of the model used for the combobox and the
+             * string that appears, so that store looks like:
+             * model 0, string 0, model 1, string 1, ..., model ncols, string ncols. */
+            gtk_tree_model_get(store, &iter, 2 * i + 1, &contents, -1);
+            /* If this column has the same string that the user selected ... */
+            if (!safe_strcmp(contents, new_text))
+            {
+                /* ... set this column to the "None" type. (We can't allow duplicate types.) */
+                gtk_list_store_set(GTK_LIST_STORE(store), &iter, 2 * i + 1,
+                                   _(gnc_csv_column_type_strs[GNC_CSV_NONE]), -1);
+            }
+            g_free(contents);
+        }
+        else /* If this is the column that was edited ... */
+        {
+            /* Set the text for this column to what the user selected. (See
+             * comment above "Get the type string. ..." for why we set
+             * column 2*i+1 in store.) */
+            gtk_list_store_set(GTK_LIST_STORE(store), &iter, 2 * i + 1, new_text, -1);
+        }
     }
-    else /* If this is the column that was edited ... */
-    {
-      /* Set the text for this column to what the user selected. (See
-       * comment above "Get the type string. ..." for why we set
-       * column 2*i+1 in store.) */
-      gtk_list_store_set(GTK_LIST_STORE(store), &iter, 2*i+1, new_text, -1);
-    }
-  }
 }
 
 /** Constructor for GncCsvPreview.
@@ -388,109 +389,110 @@
  */
 static GncCsvPreview* gnc_csv_preview_new()
 {
-  int i;
-  GncCsvPreview* preview = g_new(GncCsvPreview, 1);
-  GtkWidget *ok_button, *cancel_button, *csv_button;
-  GtkContainer* date_format_container;
-  /* The names in the glade file for the sep buttons. */
-  char* sep_button_names[] = {"space_cbutton",
-                              "tab_cbutton",
-                              "comma_cbutton",
-                              "colon_cbutton",
-                              "semicolon_cbutton",
-                              "hyphen_cbutton"};
-  /* The table containing preview->encselector and the separator configuration widgets */
-  GtkTable* enctable;
-  PangoContext* context; /* Used to set a monotype font on preview->treeview */
+    int i;
+    GncCsvPreview* preview = g_new(GncCsvPreview, 1);
+    GtkWidget *ok_button, *cancel_button, *csv_button;
+    GtkContainer* date_format_container;
+    /* The names in the glade file for the sep buttons. */
+    char* sep_button_names[] = {"space_cbutton",
+                                "tab_cbutton",
+                                "comma_cbutton",
+                                "colon_cbutton",
+                                "semicolon_cbutton",
+                                "hyphen_cbutton"
+                               };
+    /* The table containing preview->encselector and the separator configuration widgets */
+    GtkTable* enctable;
+    PangoContext* context; /* Used to set a monotype font on preview->treeview */
 
-  preview->encselector = GO_CHARMAP_SEL(go_charmap_sel_new(GO_CHARMAP_SEL_TO_UTF8));
-  /* Connect the selector to the encoding_selected event handler. */
-  g_signal_connect(G_OBJECT(preview->encselector), "charmap_changed",
-                   G_CALLBACK(encoding_selected), (gpointer)preview);
+    preview->encselector = GO_CHARMAP_SEL(go_charmap_sel_new(GO_CHARMAP_SEL_TO_UTF8));
+    /* Connect the selector to the encoding_selected event handler. */
+    g_signal_connect(G_OBJECT(preview->encselector), "charmap_changed",
+                     G_CALLBACK(encoding_selected), (gpointer)preview);
 
-  /* Load the Glade file. */
-  preview->xml = gnc_glade_xml_new("gnc-csv-preview-dialog.glade", "dialog");
-  /* Load the dialog. */
-  preview->dialog = GTK_DIALOG(glade_xml_get_widget(preview->xml, "dialog"));
+    /* Load the Glade file. */
+    preview->xml = gnc_glade_xml_new("gnc-csv-preview-dialog.glade", "dialog");
+    /* Load the dialog. */
+    preview->dialog = GTK_DIALOG(glade_xml_get_widget(preview->xml, "dialog"));
 
-  /* Load the separator buttons from the glade file into the
-   * preview->sep_buttons array. */
-  for(i = 0; i < SEP_NUM_OF_TYPES; i++)
-  {
-    preview->sep_buttons[i]
-      = (GtkCheckButton*)glade_xml_get_widget(preview->xml, sep_button_names[i]);
-    /* Connect them to the sep_button_clicked event handler. */
-    g_signal_connect(G_OBJECT(preview->sep_buttons[i]), "toggled",
-                     G_CALLBACK(sep_button_clicked), (gpointer)preview);
-  }
+    /* Load the separator buttons from the glade file into the
+     * preview->sep_buttons array. */
+    for (i = 0; i < SEP_NUM_OF_TYPES; i++)
+    {
+        preview->sep_buttons[i]
+        = (GtkCheckButton*)glade_xml_get_widget(preview->xml, sep_button_names[i]);
+        /* Connect them to the sep_button_clicked event handler. */
+        g_signal_connect(G_OBJECT(preview->sep_buttons[i]), "toggled",
+                         G_CALLBACK(sep_button_clicked), (gpointer)preview);
+    }
 
-  /* Load and connect the custom separator checkbutton in the same way
-   * as the other separator buttons. */
-  preview->custom_cbutton
+    /* Load and connect the custom separator checkbutton in the same way
+     * as the other separator buttons. */
+    preview->custom_cbutton
     = (GtkCheckButton*)glade_xml_get_widget(preview->xml, "custom_cbutton");
-  g_signal_connect(G_OBJECT(preview->custom_cbutton), "clicked",
-                   G_CALLBACK(sep_button_clicked), (gpointer)preview);
+    g_signal_connect(G_OBJECT(preview->custom_cbutton), "clicked",
+                     G_CALLBACK(sep_button_clicked), (gpointer)preview);
 
-  /* Load the entry for the custom separator entry. Connect it to the
-   * sep_button_clicked event handler as well. */
-  preview->custom_entry = (GtkEntry*)glade_xml_get_widget(preview->xml, "custom_entry");
-  g_signal_connect(G_OBJECT(preview->custom_entry), "changed",
-                   G_CALLBACK(sep_button_clicked), (gpointer)preview);
+    /* Load the entry for the custom separator entry. Connect it to the
+     * sep_button_clicked event handler as well. */
+    preview->custom_entry = (GtkEntry*)glade_xml_get_widget(preview->xml, "custom_entry");
+    g_signal_connect(G_OBJECT(preview->custom_entry), "changed",
+                     G_CALLBACK(sep_button_clicked), (gpointer)preview);
 
-  /* Get the table from the Glade file. */
-  enctable = GTK_TABLE(glade_xml_get_widget(preview->xml, "enctable"));
-  /* Put the selector in at the top. */
-  gtk_table_attach_defaults(enctable, GTK_WIDGET(preview->encselector), 1, 2, 0, 1);
-  /* Show the table in all its glory. */
-  gtk_widget_show_all(GTK_WIDGET(enctable));
+    /* Get the table from the Glade file. */
+    enctable = GTK_TABLE(glade_xml_get_widget(preview->xml, "enctable"));
+    /* Put the selector in at the top. */
+    gtk_table_attach_defaults(enctable, GTK_WIDGET(preview->encselector), 1, 2, 0, 1);
+    /* Show the table in all its glory. */
+    gtk_widget_show_all(GTK_WIDGET(enctable));
 
-  /* Add in the date format combo box and hook it up to an event handler. */
-  preview->date_format_combo = GTK_COMBO_BOX(gtk_combo_box_new_text());
-  for(i = 0; i < num_date_formats; i++)
-  {
-    gtk_combo_box_append_text(preview->date_format_combo, _(date_format_user[i]));
-  }
-  gtk_combo_box_set_active(preview->date_format_combo, 0);
-  g_signal_connect(G_OBJECT(preview->date_format_combo), "changed",
-                   G_CALLBACK(date_format_selected), (gpointer)preview);
+    /* Add in the date format combo box and hook it up to an event handler. */
+    preview->date_format_combo = GTK_COMBO_BOX(gtk_combo_box_new_text());
+    for (i = 0; i < num_date_formats; i++)
+    {
+        gtk_combo_box_append_text(preview->date_format_combo, _(date_format_user[i]));
+    }
+    gtk_combo_box_set_active(preview->date_format_combo, 0);
+    g_signal_connect(G_OBJECT(preview->date_format_combo), "changed",
+                     G_CALLBACK(date_format_selected), (gpointer)preview);
 
-  /* Add it to the dialog. */
-  date_format_container = GTK_CONTAINER(glade_xml_get_widget(preview->xml,
-                                                             "date_format_container"));
-  gtk_container_add(date_format_container, GTK_WIDGET(preview->date_format_combo));
-  gtk_widget_show_all(GTK_WIDGET(date_format_container));
+    /* Add it to the dialog. */
+    date_format_container = GTK_CONTAINER(glade_xml_get_widget(preview->xml,
+                                          "date_format_container"));
+    gtk_container_add(date_format_container, GTK_WIDGET(preview->date_format_combo));
+    gtk_widget_show_all(GTK_WIDGET(date_format_container));
 
-  /* Connect the "OK" and "Cancel" buttons to their event handlers. */
-  ok_button = glade_xml_get_widget(preview->xml, "ok_button");
-  g_signal_connect(G_OBJECT(ok_button), "clicked",
-                   G_CALLBACK(ok_button_clicked), (gpointer)preview);
+    /* Connect the "OK" and "Cancel" buttons to their event handlers. */
+    ok_button = glade_xml_get_widget(preview->xml, "ok_button");
+    g_signal_connect(G_OBJECT(ok_button), "clicked",
+                     G_CALLBACK(ok_button_clicked), (gpointer)preview);
 
-  cancel_button = glade_xml_get_widget(preview->xml, "cancel_button");
-  g_signal_connect(G_OBJECT(cancel_button), "clicked",
-                   G_CALLBACK(cancel_button_clicked), (gpointer)preview);
+    cancel_button = glade_xml_get_widget(preview->xml, "cancel_button");
+    g_signal_connect(G_OBJECT(cancel_button), "clicked",
+                     G_CALLBACK(cancel_button_clicked), (gpointer)preview);
 
-  /* Connect the CSV/Fixed-Width radio button event handler. */
-  csv_button = glade_xml_get_widget(preview->xml, "csv_button");
-  g_signal_connect(csv_button, "toggled",
-                   G_CALLBACK(separated_or_fixed_selected), (gpointer)preview);                   
+    /* Connect the CSV/Fixed-Width radio button event handler. */
+    csv_button = glade_xml_get_widget(preview->xml, "csv_button");
+    g_signal_connect(csv_button, "toggled",
+                     G_CALLBACK(separated_or_fixed_selected), (gpointer)preview);
 
-  /* Load the data treeview and connect it to its resizing event handler. */
-  preview->treeview = (GtkTreeView*)(glade_xml_get_widget(preview->xml, "treeview"));
-  g_signal_connect(G_OBJECT(preview->treeview), "size-allocate",
-                   G_CALLBACK(treeview_resized), (gpointer)preview);
-  context = gtk_widget_create_pango_context(GTK_WIDGET(preview->treeview));
+    /* Load the data treeview and connect it to its resizing event handler. */
+    preview->treeview = (GtkTreeView*)(glade_xml_get_widget(preview->xml, "treeview"));
+    g_signal_connect(G_OBJECT(preview->treeview), "size-allocate",
+                     G_CALLBACK(treeview_resized), (gpointer)preview);
+    context = gtk_widget_create_pango_context(GTK_WIDGET(preview->treeview));
 
-  /* Load the column type treeview. */
-  preview->ctreeview = (GtkTreeView*)(glade_xml_get_widget(preview->xml, "ctreeview"));
+    /* Load the column type treeview. */
+    preview->ctreeview = (GtkTreeView*)(glade_xml_get_widget(preview->xml, "ctreeview"));
 
-  /* This is TRUE only after encoding_selected is called, so we must
-   * set it initially to FALSE. */
-  preview->encoding_selected_called = FALSE;
+    /* This is TRUE only after encoding_selected is called, so we must
+     * set it initially to FALSE. */
+    preview->encoding_selected_called = FALSE;
 
-  /* It is empty at first. */
-  preview->not_empty = FALSE;
+    /* It is empty at first. */
+    preview->not_empty = FALSE;
 
-  return preview;
+    return preview;
 }
 
 /** Destructor for GncCsvPreview. This does not free
@@ -499,8 +501,8 @@
  */
 static void gnc_csv_preview_free(GncCsvPreview* preview)
 {
-  g_object_unref(preview->xml);
-  g_free(preview);
+    g_object_unref(preview->xml);
+    g_free(preview);
 }
 
 /** Returns the cell renderer from a column in the preview's treeview.
@@ -510,10 +512,10 @@
  */
 static GtkCellRenderer* gnc_csv_preview_get_cell_renderer(GncCsvPreview* preview, int col)
 {
-  GList* renderers = gtk_tree_view_column_get_cell_renderers(gtk_tree_view_get_column(preview->treeview, col));
-  GtkCellRenderer* cell = GTK_CELL_RENDERER(renderers->data);
-  g_list_free(renderers);
-  return cell;
+    GList* renderers = gtk_tree_view_column_get_cell_renderers(gtk_tree_view_get_column(preview->treeview, col));
+    GtkCellRenderer* cell = GTK_CELL_RENDERER(renderers->data);
+    g_list_free(renderers);
+    return cell;
 }
 
 /* The following is code copied from Gnumeric 1.7.8 licensed under the
@@ -542,222 +544,239 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-enum {
-	CONTEXT_STF_IMPORT_MERGE_LEFT = 1,
-	CONTEXT_STF_IMPORT_MERGE_RIGHT = 2,
-	CONTEXT_STF_IMPORT_SPLIT = 3,
-	CONTEXT_STF_IMPORT_WIDEN = 4,
-	CONTEXT_STF_IMPORT_NARROW = 5
+enum
+{
+    CONTEXT_STF_IMPORT_MERGE_LEFT = 1,
+    CONTEXT_STF_IMPORT_MERGE_RIGHT = 2,
+    CONTEXT_STF_IMPORT_SPLIT = 3,
+    CONTEXT_STF_IMPORT_WIDEN = 4,
+    CONTEXT_STF_IMPORT_NARROW = 5
 };
 
-static GnumericPopupMenuElement const popup_elements[] = {
-	{ N_("Merge with column on _left"), GTK_STOCK_REMOVE,
-	  0, 1 << CONTEXT_STF_IMPORT_MERGE_LEFT, CONTEXT_STF_IMPORT_MERGE_LEFT },
-	{ N_("Merge with column on _right"), GTK_STOCK_REMOVE,
-	  0, 1 << CONTEXT_STF_IMPORT_MERGE_RIGHT, CONTEXT_STF_IMPORT_MERGE_RIGHT },
-	{ "", NULL, 0, 0, 0 },
-	{ N_("_Split this column"), NULL,
-	  0, 1 << CONTEXT_STF_IMPORT_SPLIT, CONTEXT_STF_IMPORT_SPLIT },
-	{ "", NULL, 0, 0, 0 },
-	{ N_("_Widen this column"), GTK_STOCK_GO_FORWARD,
-	  0, 1 << CONTEXT_STF_IMPORT_WIDEN, CONTEXT_STF_IMPORT_WIDEN },
-	{ N_("_Narrow this column"), GTK_STOCK_GO_BACK,
-	  0, 1 << CONTEXT_STF_IMPORT_NARROW, CONTEXT_STF_IMPORT_NARROW },
-	{ NULL, NULL, 0, 0, 0 },
+static GnumericPopupMenuElement const popup_elements[] =
+{
+    {
+        N_("Merge with column on _left"), GTK_STOCK_REMOVE,
+        0, 1 << CONTEXT_STF_IMPORT_MERGE_LEFT, CONTEXT_STF_IMPORT_MERGE_LEFT
+    },
+    {
+        N_("Merge with column on _right"), GTK_STOCK_REMOVE,
+        0, 1 << CONTEXT_STF_IMPORT_MERGE_RIGHT, CONTEXT_STF_IMPORT_MERGE_RIGHT
+    },
+    { "", NULL, 0, 0, 0 },
+    {
+        N_("_Split this column"), NULL,
+        0, 1 << CONTEXT_STF_IMPORT_SPLIT, CONTEXT_STF_IMPORT_SPLIT
+    },
+    { "", NULL, 0, 0, 0 },
+    {
+        N_("_Widen this column"), GTK_STOCK_GO_FORWARD,
+        0, 1 << CONTEXT_STF_IMPORT_WIDEN, CONTEXT_STF_IMPORT_WIDEN
+    },
+    {
+        N_("_Narrow this column"), GTK_STOCK_GO_BACK,
+        0, 1 << CONTEXT_STF_IMPORT_NARROW, CONTEXT_STF_IMPORT_NARROW
+    },
+    { NULL, NULL, 0, 0, 0 },
 };
 
 static gboolean
 make_new_column (GncCsvPreview *preview, int col, int dx, gboolean test_only)
 {
-	PangoLayout *layout;
-	PangoFontDescription *font_desc;
-	int charindex, width;
-	GtkCellRenderer *cell =	gnc_csv_preview_get_cell_renderer(preview, col);
-	int colstart, colend;
-        GError* error = NULL;
+    PangoLayout *layout;
+    PangoFontDescription *font_desc;
+    int charindex, width;
+    GtkCellRenderer *cell =	gnc_csv_preview_get_cell_renderer(preview, col);
+    int colstart, colend;
+    GError* error = NULL;
 
-	colstart = (col == 0)
-		? 0
-		: stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col - 1);
-	colend = stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col);
+    colstart = (col == 0)
+               ? 0
+               : stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col - 1);
+    colend = stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col);
 
-	g_object_get (G_OBJECT (cell), "font_desc", &font_desc, NULL);
-	layout = gtk_widget_create_pango_layout (GTK_WIDGET (preview->treeview), "x");
-	pango_layout_set_font_description (layout, font_desc);
-	pango_layout_get_pixel_size (layout, &width, NULL);
-	if (width < 1) width = 1;
-	charindex = colstart + (dx + width / 2) / width;
-	g_object_unref (layout);
-	pango_font_description_free (font_desc);
+    g_object_get (G_OBJECT (cell), "font_desc", &font_desc, NULL);
+    layout = gtk_widget_create_pango_layout (GTK_WIDGET (preview->treeview), "x");
+    pango_layout_set_font_description (layout, font_desc);
+    pango_layout_get_pixel_size (layout, &width, NULL);
+    if (width < 1) width = 1;
+    charindex = colstart + (dx + width / 2) / width;
+    g_object_unref (layout);
+    pango_font_description_free (font_desc);
 
-	if (charindex <= colstart || (colend != -1 && charindex >= colend))
-		return FALSE;
+    if (charindex <= colstart || (colend != -1 && charindex >= colend))
+        return FALSE;
 
-	if (!test_only) {
-		stf_parse_options_fixed_splitpositions_add (preview->parse_data->options, charindex);
-                if(gnc_csv_parse(preview->parse_data, FALSE, &error))
-                {
-                  gnc_error_dialog(NULL, "%s", error->message);
-                  return FALSE;
-                }
-		gnc_csv_preview_update (preview);
-	}
+    if (!test_only)
+    {
+        stf_parse_options_fixed_splitpositions_add (preview->parse_data->options, charindex);
+        if (gnc_csv_parse(preview->parse_data, FALSE, &error))
+        {
+            gnc_error_dialog(NULL, "%s", error->message);
+            return FALSE;
+        }
+        gnc_csv_preview_update (preview);
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 
 static gboolean
 widen_column (GncCsvPreview *preview, int col, gboolean test_only)
 {
-	int colcount = stf_parse_options_fixed_splitpositions_count (preview->parse_data->options);
-	int nextstart, nextnextstart;
-        GError* error = NULL;
+    int colcount = stf_parse_options_fixed_splitpositions_count (preview->parse_data->options);
+    int nextstart, nextnextstart;
+    GError* error = NULL;
 
-	if (col >= colcount - 1)
-		return FALSE;
+    if (col >= colcount - 1)
+        return FALSE;
 
-	nextstart = stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col);
+    nextstart = stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col);
 
-	nextnextstart = (col == colcount - 2)
-		? preview->longest_line
-		: stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col + 1);
+    nextnextstart = (col == colcount - 2)
+                    ? preview->longest_line
+                    : stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col + 1);
 
-	if (nextstart + 1 >= nextnextstart)
-		return FALSE;
+    if (nextstart + 1 >= nextnextstart)
+        return FALSE;
 
-	if (!test_only) {
-		stf_parse_options_fixed_splitpositions_remove (preview->parse_data->options, nextstart);
-		stf_parse_options_fixed_splitpositions_add (preview->parse_data->options, nextstart + 1);
-                if(gnc_csv_parse(preview->parse_data, FALSE, &error))
-                {
-                  gnc_error_dialog(NULL, "%s", error->message);
-                  return FALSE;
-                }
-		gnc_csv_preview_update (preview);
-	}
-	return TRUE;
+    if (!test_only)
+    {
+        stf_parse_options_fixed_splitpositions_remove (preview->parse_data->options, nextstart);
+        stf_parse_options_fixed_splitpositions_add (preview->parse_data->options, nextstart + 1);
+        if (gnc_csv_parse(preview->parse_data, FALSE, &error))
+        {
+            gnc_error_dialog(NULL, "%s", error->message);
+            return FALSE;
+        }
+        gnc_csv_preview_update (preview);
+    }
+    return TRUE;
 }
 
 static gboolean
 narrow_column (GncCsvPreview *preview, int col, gboolean test_only)
 {
-	int colcount = stf_parse_options_fixed_splitpositions_count (preview->parse_data->options);
-	int thisstart, nextstart;
-        GError* error = NULL;
+    int colcount = stf_parse_options_fixed_splitpositions_count (preview->parse_data->options);
+    int thisstart, nextstart;
+    GError* error = NULL;
 
-	if (col >= colcount - 1)
-		return FALSE;
+    if (col >= colcount - 1)
+        return FALSE;
 
-	thisstart = (col == 0)
-		? 0
-		: stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col - 1);
-	nextstart = stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col);
+    thisstart = (col == 0)
+                ? 0
+                : stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col - 1);
+    nextstart = stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col);
 
-	if (nextstart - 1 <= thisstart)
-		return FALSE;
+    if (nextstart - 1 <= thisstart)
+        return FALSE;
 
-	if (!test_only) {
-		stf_parse_options_fixed_splitpositions_remove (preview->parse_data->options, nextstart);
-		stf_parse_options_fixed_splitpositions_add (preview->parse_data->options, nextstart - 1);
-                if(gnc_csv_parse(preview->parse_data, FALSE, &error))
-                {
-                  gnc_error_dialog(NULL, "%s", error->message);
-                  return FALSE;
-                }
-		gnc_csv_preview_update (preview);
-	}
-	return TRUE;
+    if (!test_only)
+    {
+        stf_parse_options_fixed_splitpositions_remove (preview->parse_data->options, nextstart);
+        stf_parse_options_fixed_splitpositions_add (preview->parse_data->options, nextstart - 1);
+        if (gnc_csv_parse(preview->parse_data, FALSE, &error))
+        {
+            gnc_error_dialog(NULL, "%s", error->message);
+            return FALSE;
+        }
+        gnc_csv_preview_update (preview);
+    }
+    return TRUE;
 }
 
 static gboolean
 delete_column (GncCsvPreview *preview, int col, gboolean test_only)
 {
-        GError* error = NULL;
-	int colcount = stf_parse_options_fixed_splitpositions_count (preview->parse_data->options);
-	if (col < 0 || col >= colcount - 1)
-		return FALSE;
+    GError* error = NULL;
+    int colcount = stf_parse_options_fixed_splitpositions_count (preview->parse_data->options);
+    if (col < 0 || col >= colcount - 1)
+        return FALSE;
 
-	if (!test_only) {
-		int nextstart = stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col);
-		stf_parse_options_fixed_splitpositions_remove (preview->parse_data->options, nextstart);
-                if(gnc_csv_parse(preview->parse_data, FALSE, &error))
-                {
-                  gnc_error_dialog(NULL, "%s", error->message);
-                  return FALSE;
-                }
-		gnc_csv_preview_update (preview);
-	}
-	return TRUE;
+    if (!test_only)
+    {
+        int nextstart = stf_parse_options_fixed_splitpositions_nth (preview->parse_data->options, col);
+        stf_parse_options_fixed_splitpositions_remove (preview->parse_data->options, nextstart);
+        if (gnc_csv_parse(preview->parse_data, FALSE, &error))
+        {
+            gnc_error_dialog(NULL, "%s", error->message);
+            return FALSE;
+        }
+        gnc_csv_preview_update (preview);
+    }
+    return TRUE;
 }
 
 static void
 select_column (GncCsvPreview *preview, int col)
 {
-        GError* error = NULL;
-	int colcount = stf_parse_options_fixed_splitpositions_count (preview->parse_data->options);
-	GtkTreeViewColumn *column;
+    GError* error = NULL;
+    int colcount = stf_parse_options_fixed_splitpositions_count (preview->parse_data->options);
+    GtkTreeViewColumn *column;
 
-	if (col < 0 || col >= colcount)
-		return;
+    if (col < 0 || col >= colcount)
+        return;
 
-	column = gtk_tree_view_get_column (preview->treeview, col);
-	gtk_widget_grab_focus (column->button);
+    column = gtk_tree_view_get_column (preview->treeview, col);
+    gtk_widget_grab_focus (column->button);
 }
 
 static gboolean
 fixed_context_menu_handler (GnumericPopupMenuElement const *element,
-			    gpointer user_data)
+                            gpointer user_data)
 {
-	GncCsvPreview *preview = user_data;
-	int col = preview->fixed_context_col;
+    GncCsvPreview *preview = user_data;
+    int col = preview->fixed_context_col;
 
-	switch (element->index) {
-	case CONTEXT_STF_IMPORT_MERGE_LEFT:
-		delete_column (preview, col - 1, FALSE);
-		break;
-	case CONTEXT_STF_IMPORT_MERGE_RIGHT:
-		delete_column (preview, col, FALSE);
-		break;
-	case CONTEXT_STF_IMPORT_SPLIT:
-		make_new_column (preview, col, preview->fixed_context_dx, FALSE);
-		break;
-	case CONTEXT_STF_IMPORT_WIDEN:
-		widen_column (preview, col, FALSE);
-		break;
-	case CONTEXT_STF_IMPORT_NARROW:
-		narrow_column (preview, col, FALSE);
-		break;
-	default:
-		; /* Nothing */
-	}
-	return TRUE;
+    switch (element->index)
+    {
+    case CONTEXT_STF_IMPORT_MERGE_LEFT:
+        delete_column (preview, col - 1, FALSE);
+        break;
+    case CONTEXT_STF_IMPORT_MERGE_RIGHT:
+        delete_column (preview, col, FALSE);
+        break;
+    case CONTEXT_STF_IMPORT_SPLIT:
+        make_new_column (preview, col, preview->fixed_context_dx, FALSE);
+        break;
+    case CONTEXT_STF_IMPORT_WIDEN:
+        widen_column (preview, col, FALSE);
+        break;
+    case CONTEXT_STF_IMPORT_NARROW:
+        narrow_column (preview, col, FALSE);
+        break;
+    default:
+        ; /* Nothing */
+    }
+    return TRUE;
 }
 
 static void
 fixed_context_menu (GncCsvPreview *preview, GdkEventButton *event,
-		    int col, int dx)
+                    int col, int dx)
 {
-	int sensitivity_filter = 0;
+    int sensitivity_filter = 0;
 
-	preview->fixed_context_col = col;
-	preview->fixed_context_dx = dx;
+    preview->fixed_context_col = col;
+    preview->fixed_context_dx = dx;
 
-	if (!delete_column (preview, col - 1, TRUE))
-		sensitivity_filter |= (1 << CONTEXT_STF_IMPORT_MERGE_LEFT);
-	if (!delete_column (preview, col, TRUE))
-		sensitivity_filter |= (1 << CONTEXT_STF_IMPORT_MERGE_RIGHT);
-	if (!make_new_column (preview, col, dx, TRUE))
-		sensitivity_filter |= (1 << CONTEXT_STF_IMPORT_SPLIT);
-	if (!widen_column (preview, col, TRUE))
-		sensitivity_filter |= (1 << CONTEXT_STF_IMPORT_WIDEN);
-	if (!narrow_column (preview, col, TRUE))
-		sensitivity_filter |= (1 << CONTEXT_STF_IMPORT_NARROW);
+    if (!delete_column (preview, col - 1, TRUE))
+        sensitivity_filter |= (1 << CONTEXT_STF_IMPORT_MERGE_LEFT);
+    if (!delete_column (preview, col, TRUE))
+        sensitivity_filter |= (1 << CONTEXT_STF_IMPORT_MERGE_RIGHT);
+    if (!make_new_column (preview, col, dx, TRUE))
+        sensitivity_filter |= (1 << CONTEXT_STF_IMPORT_SPLIT);
+    if (!widen_column (preview, col, TRUE))
+        sensitivity_filter |= (1 << CONTEXT_STF_IMPORT_WIDEN);
+    if (!narrow_column (preview, col, TRUE))
+        sensitivity_filter |= (1 << CONTEXT_STF_IMPORT_NARROW);
 
-	select_column (preview, col);
-	gnumeric_create_popup_menu (popup_elements, &fixed_context_menu_handler,
-				    preview, 0,
-				    sensitivity_filter, event);
+    select_column (preview, col);
+    gnumeric_create_popup_menu (popup_elements, &fixed_context_menu_handler,
+                                preview, 0,
+                                sensitivity_filter, event);
 }
 
 /* ---- End of Gnumeric Code ---- */
@@ -772,36 +791,36 @@
 static void header_button_press_handler(GtkWidget* button, GdkEventButton* event,
                                         GncCsvPreview* preview)
 {
-  /* col is the number of the column that was clicked, and offset is
-     to correct for the indentation of button. */
-  int i, col = 0, offset = GTK_BIN(button)->child->allocation.x - button->allocation.x,
-    ncols = preview->parse_data->column_types->len;
-  /* Find the column that was clicked. */
-  for(i = 0; i < ncols; i++)
-  {
-    if(preview->treeview_buttons[i] == button)
+    /* col is the number of the column that was clicked, and offset is
+       to correct for the indentation of button. */
+    int i, col = 0, offset = GTK_BIN(button)->child->allocation.x - button->allocation.x,
+           ncols = preview->parse_data->column_types->len;
+    /* Find the column that was clicked. */
+    for (i = 0; i < ncols; i++)
     {
-      col = i;
-      break;
+        if (preview->treeview_buttons[i] == button)
+        {
+            col = i;
+            break;
+        }
     }
-  }
 
-  /* Don't let the user affect the last column if it has error messages. */
-  if(preview->parse_data->orig_max_row < ncols && ncols - col == 1)
-  {
-    return;
-  }
+    /* Don't let the user affect the last column if it has error messages. */
+    if (preview->parse_data->orig_max_row < ncols && ncols - col == 1)
+    {
+        return;
+    }
 
-  /* Double clicks can split columns. */
-  if(event->type == GDK_2BUTTON_PRESS && event->button == 1)
-  {
-    make_new_column(preview, col, (int)event->x - offset, FALSE);
-  }
-  /* Right clicking brings up a context menu. */
-  else if(event->type == GDK_BUTTON_PRESS && event->button == 3)
-  {
-    fixed_context_menu(preview, event, col, (int)event->x - offset);
-  }
+    /* Double clicks can split columns. */
+    if (event->type == GDK_2BUTTON_PRESS && event->button == 1)
+    {
+        make_new_column(preview, col, (int)event->x - offset, FALSE);
+    }
+    /* Right clicking brings up a context menu. */
+    else if (event->type == GDK_BUTTON_PRESS && event->button == 3)
+    {
+        fixed_context_menu(preview, event, col, (int)event->x - offset);
+    }
 }
 
 /* Loads the preview's data into its data treeview. notEmpty is TRUE
@@ -812,183 +831,183 @@
  */
 static void gnc_csv_preview_update(GncCsvPreview* preview)
 {
-  /* store has the data from the file being imported. cstores is an
-   * array of stores that hold the combo box entries for each
-   * column. ctstore contains both pointers to models in cstore and
-   * the actual text that appears in preview->ctreeview. */
-  GtkListStore *store, **cstores, *ctstore;
-  GtkTreeIter iter;
-  /* ncols is the number of columns in the file data. */
-  int i, j, ncols = preview->parse_data->column_types->len,
-    max_str_len = preview->parse_data->file_str.end - preview->parse_data->file_str.begin;
+    /* store has the data from the file being imported. cstores is an
+     * array of stores that hold the combo box entries for each
+     * column. ctstore contains both pointers to models in cstore and
+     * the actual text that appears in preview->ctreeview. */
+    GtkListStore *store, **cstores, *ctstore;
+    GtkTreeIter iter;
+    /* ncols is the number of columns in the file data. */
+    int i, j, ncols = preview->parse_data->column_types->len,
+              max_str_len = preview->parse_data->file_str.end - preview->parse_data->file_str.begin;
 
-  /* store contains only strings. */
-  GType* types = g_new(GType, 2 * ncols);
-  for(i = 0; i < ncols; i++)
-    types[i] = G_TYPE_STRING;
-  store = gtk_list_store_newv(ncols, types);
+    /* store contains only strings. */
+    GType* types = g_new(GType, 2 * ncols);
+    for (i = 0; i < ncols; i++)
+        types[i] = G_TYPE_STRING;
+    store = gtk_list_store_newv(ncols, types);
 
-  /* ctstore is arranged as follows:
-   * model 0, text 0, model 1, text 1, ..., model ncols, text ncols. */
-  for(i = 0; i < 2*ncols; i += 2)
-  {
-    types[i] = GTK_TYPE_TREE_MODEL;
-    types[i+1] = G_TYPE_STRING;
-  }
-  ctstore = gtk_list_store_newv(2*ncols, types);
+    /* ctstore is arranged as follows:
+     * model 0, text 0, model 1, text 1, ..., model ncols, text ncols. */
+    for (i = 0; i < 2 * ncols; i += 2)
+    {
+        types[i] = GTK_TYPE_TREE_MODEL;
+        types[i+1] = G_TYPE_STRING;
+    }
+    ctstore = gtk_list_store_newv(2 * ncols, types);
 
-  g_free(types);
+    g_free(types);
 
-  /* Each element in cstores is a single column model. */
-  cstores = g_new(GtkListStore*, ncols);
-  for(i = 0; i < ncols; i++)
-  {
-    cstores[i] = gtk_list_store_new(1, G_TYPE_STRING);
-    /* Add all of the possible entries to the combo box. */
-    for(j = 0; j < GNC_CSV_NUM_COL_TYPES; j++)
+    /* Each element in cstores is a single column model. */
+    cstores = g_new(GtkListStore*, ncols);
+    for (i = 0; i < ncols; i++)
     {
-      gtk_list_store_append(cstores[i], &iter);
-      gtk_list_store_set(cstores[i], &iter, 0, _(gnc_csv_column_type_strs[j]), -1);
+        cstores[i] = gtk_list_store_new(1, G_TYPE_STRING);
+        /* Add all of the possible entries to the combo box. */
+        for (j = 0; j < GNC_CSV_NUM_COL_TYPES; j++)
+        {
+            gtk_list_store_append(cstores[i], &iter);
+            gtk_list_store_set(cstores[i], &iter, 0, _(gnc_csv_column_type_strs[j]), -1);
+        }
     }
-  }
 
-  if(preview->not_empty)
-  {
-    GList *children, *children_begin;
-    GList *tv_columns, *tv_columns_begin, *ctv_columns, *ctv_columns_begin;
-    tv_columns = tv_columns_begin = gtk_tree_view_get_columns(preview->treeview);
-    ctv_columns = ctv_columns_begin = gtk_tree_view_get_columns(preview->ctreeview);
-    /* Clear out exisiting columns in preview->treeview. */
-    while(tv_columns != NULL)
+    if (preview->not_empty)
     {
-      gtk_tree_view_remove_column(preview->treeview, GTK_TREE_VIEW_COLUMN(tv_columns->data));
-      tv_columns = g_list_next(tv_columns);
+        GList *children, *children_begin;
+        GList *tv_columns, *tv_columns_begin, *ctv_columns, *ctv_columns_begin;
+        tv_columns = tv_columns_begin = gtk_tree_view_get_columns(preview->treeview);
+        ctv_columns = ctv_columns_begin = gtk_tree_view_get_columns(preview->ctreeview);
+        /* Clear out exisiting columns in preview->treeview. */
+        while (tv_columns != NULL)
+        {
+            gtk_tree_view_remove_column(preview->treeview, GTK_TREE_VIEW_COLUMN(tv_columns->data));
+            tv_columns = g_list_next(tv_columns);
+        }
+        /* Do the same in preview->ctreeview. */
+        while (ctv_columns != NULL)
+        {
+            gtk_tree_view_remove_column(preview->ctreeview, GTK_TREE_VIEW_COLUMN(ctv_columns->data));
+            ctv_columns = g_list_next(ctv_columns);
+        }
+        g_list_free(tv_columns_begin);
+        g_list_free(ctv_columns_begin);
+        g_free(preview->treeview_buttons);
     }
-    /* Do the same in preview->ctreeview. */
-    while(ctv_columns != NULL)
+
+    /* Fill the data treeview with data from the file. */
+    /* Also, update the longest line value within the following loop (whichever is executed). */
+    preview->longest_line = 0;
+    if (preview->previewing_errors) /* If we are showing only errors ... */
     {
-      gtk_tree_view_remove_column(preview->ctreeview, GTK_TREE_VIEW_COLUMN(ctv_columns->data));
-      ctv_columns = g_list_next(ctv_columns);
-    }
-    g_list_free(tv_columns_begin);
-    g_list_free(ctv_columns_begin);
-    g_free(preview->treeview_buttons);
-  }
-  
-  /* Fill the data treeview with data from the file. */
-  /* Also, update the longest line value within the following loop (whichever is executed). */
-  preview->longest_line = 0;
-  if(preview->previewing_errors) /* If we are showing only errors ... */
-  {
-    /* ... only pick rows that are in preview->error_lines. */
-    GList* error_lines = preview->parse_data->error_lines;
-    while(error_lines != NULL)
-    {
-      int this_line_length = 0;
-      i = GPOINTER_TO_INT(error_lines->data);
-      gtk_list_store_append(store, &iter);
-      for(j = 0; j < ((GPtrArray*)(preview->parse_data->orig_lines->pdata[i]))->len; j++)
-      {
-        /* Add this cell's length to the row's length and set the value of the list store. */
-        gchar* cell_string = (gchar*)((GPtrArray*)(preview->parse_data->orig_lines->pdata[i]))->pdata[j];
-        this_line_length += g_utf8_strlen(cell_string, max_str_len);
-        gtk_list_store_set(store, &iter, j, cell_string, -1);
-      }
+        /* ... only pick rows that are in preview->error_lines. */
+        GList* error_lines = preview->parse_data->error_lines;
+        while (error_lines != NULL)
+        {
+            int this_line_length = 0;
+            i = GPOINTER_TO_INT(error_lines->data);
+            gtk_list_store_append(store, &iter);
+            for (j = 0; j < ((GPtrArray*)(preview->parse_data->orig_lines->pdata[i]))->len; j++)
+            {
+                /* Add this cell's length to the row's length and set the value of the list store. */
+                gchar* cell_string = (gchar*)((GPtrArray*)(preview->parse_data->orig_lines->pdata[i]))->pdata[j];
+                this_line_length += g_utf8_strlen(cell_string, max_str_len);
+                gtk_list_store_set(store, &iter, j, cell_string, -1);
+            }
 
-      if(this_line_length > preview->longest_line)
-        preview->longest_line = this_line_length;
+            if (this_line_length > preview->longest_line)
+                preview->longest_line = this_line_length;
 
-      error_lines = g_list_next(error_lines);
+            error_lines = g_list_next(error_lines);
+        }
     }
-  }
-  else /* Otherwise, put in all of the data. */
-  {
-    for(i = 0; i < preview->parse_data->orig_lines->len; i++)
+    else /* Otherwise, put in all of the data. */
     {
-      int this_line_length = 0;
-      gtk_list_store_append(store, &iter);
-      for(j = 0; j < ((GPtrArray*)(preview->parse_data->orig_lines->pdata[i]))->len; j++)
-      {
-        /* Add this cell's length to the row's length and set the value of the list store. */
-        gchar* cell_string = (gchar*)((GPtrArray*)(preview->parse_data->orig_lines->pdata[i]))->pdata[j];
-        this_line_length += g_utf8_strlen(cell_string, max_str_len);
-        gtk_list_store_set(store, &iter, j, cell_string, -1);
-      }
+        for (i = 0; i < preview->parse_data->orig_lines->len; i++)
+        {
+            int this_line_length = 0;
+            gtk_list_store_append(store, &iter);
+            for (j = 0; j < ((GPtrArray*)(preview->parse_data->orig_lines->pdata[i]))->len; j++)
+            {
+                /* Add this cell's length to the row's length and set the value of the list store. */
+                gchar* cell_string = (gchar*)((GPtrArray*)(preview->parse_data->orig_lines->pdata[i]))->pdata[j];
+                this_line_length += g_utf8_strlen(cell_string, max_str_len);
+                gtk_list_store_set(store, &iter, j, cell_string, -1);
+            }
 
-      if(this_line_length > preview->longest_line)
-        preview->longest_line = this_line_length;
+            if (this_line_length > preview->longest_line)
+                preview->longest_line = this_line_length;
+        }
     }
-  }
 
-  /* Set all the column types to what's in the parse data. */
-  gtk_list_store_append(ctstore, &iter);
-  for(i = 0; i < ncols; i++)
-  {
-    gtk_list_store_set(ctstore, &iter, 2*i, cstores[i], 2*i+1,
-                       _(gnc_csv_column_type_strs[(int)(preview->parse_data->column_types->data[i])]),
-                       -1);
-  }
+    /* Set all the column types to what's in the parse data. */
+    gtk_list_store_append(ctstore, &iter);
+    for (i = 0; i < ncols; i++)
+    {
+        gtk_list_store_set(ctstore, &iter, 2 * i, cstores[i], 2 * i + 1,
+                           _(gnc_csv_column_type_strs[(int)(preview->parse_data->column_types->data[i])]),
+                           -1);
+    }
 
-  preview->treeview_buttons = g_new(GtkWidget*, ncols);
-  /* Insert columns into the data and column type treeviews. */
-  for(i = 0; i < ncols; i++)
-  {
-    GtkTreeViewColumn* col; /* The column we add to preview->treeview. */
-    /* Create renderers for the data treeview (renderer) and the
-     * column type treeview (crenderer). */
-    GtkCellRenderer* renderer = gtk_cell_renderer_text_new(),
-      *crenderer = gtk_cell_renderer_combo_new();
-    /* We want a monospace font for the data in case of fixed-width data. */
-    g_object_set(G_OBJECT(renderer), "family", "monospace", NULL);
-    /* We are using cstores for the combo box entries, and we don't
-     * want the user to be able to manually enter their own column
-     * types. */
-    g_object_set(G_OBJECT(crenderer), "model", cstores[i], "text-column", 0,
-                 "editable", TRUE, "has-entry", FALSE, NULL);
-    g_signal_connect(G_OBJECT(crenderer), "edited",
-                     G_CALLBACK(column_type_edited), (gpointer)preview);
+    preview->treeview_buttons = g_new(GtkWidget*, ncols);
+    /* Insert columns into the data and column type treeviews. */
+    for (i = 0; i < ncols; i++)
+    {
+        GtkTreeViewColumn* col; /* The column we add to preview->treeview. */
+        /* Create renderers for the data treeview (renderer) and the
+         * column type treeview (crenderer). */
+        GtkCellRenderer* renderer = gtk_cell_renderer_text_new(),
+                         *crenderer = gtk_cell_renderer_combo_new();
+        /* We want a monospace font for the data in case of fixed-width data. */
+        g_object_set(G_OBJECT(renderer), "family", "monospace", NULL);
+        /* We are using cstores for the combo box entries, and we don't
+         * want the user to be able to manually enter their own column
+         * types. */
+        g_object_set(G_OBJECT(crenderer), "model", cstores[i], "text-column", 0,
+                     "editable", TRUE, "has-entry", FALSE, NULL);
+        g_signal_connect(G_OBJECT(crenderer), "edited",
+                         G_CALLBACK(column_type_edited), (gpointer)preview);
 
-    /* Add a single column for the treeview. */
-    col = gtk_tree_view_column_new_with_attributes("", renderer, "text", i, NULL);
-    gtk_tree_view_insert_column(preview->treeview, col, -1);
-    /* Use the alternating model and text entries from ctstore in
-     * preview->ctreeview. */
-    gtk_tree_view_insert_column_with_attributes(preview->ctreeview,
-                                                -1, "", crenderer, "model", 2*i,
-                                                "text", 2*i+1, NULL);
+        /* Add a single column for the treeview. */
+        col = gtk_tree_view_column_new_with_attributes("", renderer, "text", i, NULL);
+        gtk_tree_view_insert_column(preview->treeview, col, -1);
+        /* Use the alternating model and text entries from ctstore in
+         * preview->ctreeview. */
+        gtk_tree_view_insert_column_with_attributes(preview->ctreeview,
+                -1, "", crenderer, "model", 2 * i,
+                "text", 2 * i + 1, NULL);
 
-    /* We need to allow clicking on the column headers for fixed-width
-     * column splitting and merging. */
-    g_object_set(G_OBJECT(col), "clickable", TRUE, NULL);
-    g_signal_connect(G_OBJECT(col->button), "button_press_event",
-                     G_CALLBACK(header_button_press_handler), (gpointer)preview);
-    preview->treeview_buttons[i] = col->button;
-  }
+        /* We need to allow clicking on the column headers for fixed-width
+         * column splitting and merging. */
+        g_object_set(G_OBJECT(col), "clickable", TRUE, NULL);
+        g_signal_connect(G_OBJECT(col->button), "button_press_event",
+                         G_CALLBACK(header_button_press_handler), (gpointer)preview);
+        preview->treeview_buttons[i] = col->button;
+    }
 
-  /* Set the treeviews to use the models. */
-  gtk_tree_view_set_model(preview->treeview, GTK_TREE_MODEL(store));
-  gtk_tree_view_set_model(preview->ctreeview, GTK_TREE_MODEL(ctstore));
+    /* Set the treeviews to use the models. */
+    gtk_tree_view_set_model(preview->treeview, GTK_TREE_MODEL(store));
+    gtk_tree_view_set_model(preview->ctreeview, GTK_TREE_MODEL(ctstore));
 
-  /* Free the memory for the stores. */
-  g_object_unref(GTK_TREE_MODEL(store));
-  g_object_unref(GTK_TREE_MODEL(ctstore));
-  for(i = 0; i < ncols; i++)
-    g_object_unref(GTK_TREE_MODEL(cstores[i]));
+    /* Free the memory for the stores. */
+    g_object_unref(GTK_TREE_MODEL(store));
+    g_object_unref(GTK_TREE_MODEL(ctstore));
+    for (i = 0; i < ncols; i++)
+        g_object_unref(GTK_TREE_MODEL(cstores[i]));
 
-  /* Make the things actually appear. */
-  gtk_widget_show_all(GTK_WIDGET(preview->treeview));
-  gtk_widget_show_all(GTK_WIDGET(preview->ctreeview));
+    /* Make the things actually appear. */
+    gtk_widget_show_all(GTK_WIDGET(preview->treeview));
+    gtk_widget_show_all(GTK_WIDGET(preview->ctreeview));
 
-  /* Set the encoding selector to the right encoding. */
-  preview->code_encoding_calls = 2;
-  go_charmap_sel_set_encoding(preview->encselector, preview->parse_data->encoding);
+    /* Set the encoding selector to the right encoding. */
+    preview->code_encoding_calls = 2;
+    go_charmap_sel_set_encoding(preview->encselector, preview->parse_data->encoding);
 
-  /* Set the date format to what's in the combo box (since we don't
-   * necessarily know if this will always be the same). */
-  preview->parse_data->date_format = gtk_combo_box_get_active(preview->date_format_combo);
+    /* Set the date format to what's in the combo box (since we don't
+     * necessarily know if this will always be the same). */
+    preview->parse_data->date_format = gtk_combo_box_get_active(preview->date_format_combo);
 
-  /* It's now been filled with some stuff. */
-  preview->not_empty = TRUE;
+    /* It's now been filled with some stuff. */
+    preview->not_empty = TRUE;
 }
 
 /** A function that lets the user preview a file's data. This function
@@ -1001,22 +1020,22 @@
  */
 static int gnc_csv_preview(GncCsvPreview* preview, GncCsvParseData* parse_data)
 {
-  /* Set the preview's parse_data to the one we're getting passed. */
-  preview->parse_data = parse_data;
-  preview->previewing_errors = FALSE; /* We're looking at all the data. */
-  preview->approved = FALSE; /* This is FALSE until the user clicks "OK". */
+    /* Set the preview's parse_data to the one we're getting passed. */
+    preview->parse_data = parse_data;
+    preview->previewing_errors = FALSE; /* We're looking at all the data. */
+    preview->approved = FALSE; /* This is FALSE until the user clicks "OK". */
 
-  /* Load the data into the treeview. (This is the first time we've
-   * called gnc_csv_preview_update on this preview, so we use
-   * FALSE.) */
-  gnc_csv_preview_update(preview);
-  /* Wait until the user clicks "OK" or "Cancel". */
-  gtk_dialog_run(GTK_DIALOG(preview->dialog));
+    /* Load the data into the treeview. (This is the first time we've
+     * called gnc_csv_preview_update on this preview, so we use
+     * FALSE.) */
+    gnc_csv_preview_update(preview);
+    /* Wait until the user clicks "OK" or "Cancel". */
+    gtk_dialog_run(GTK_DIALOG(preview->dialog));
 
-  if(preview->approved)
-    return 0;
-  else
-    return 1;
+    if (preview->approved)
+        return 0;
+    else
+        return 1;
 }
 
 /** A function that lets the user preview rows with errors. This
@@ -1029,148 +1048,148 @@
 /* TODO Let the user manually edit cells' data? */
 static int gnc_csv_preview_errors(GncCsvPreview* preview)
 {
-  GtkLabel* instructions_label = GTK_LABEL(glade_xml_get_widget(preview->xml, "instructions_label"));
-  GtkImage* instructions_image = GTK_IMAGE(glade_xml_get_widget(preview->xml, "instructions_image"));
-  gchar* name;
-  GtkIconSize size;
-  GtkTreeViewColumn* last_col;
+    GtkLabel* instructions_label = GTK_LABEL(glade_xml_get_widget(preview->xml, "instructions_label"));
+    GtkImage* instructions_image = GTK_IMAGE(glade_xml_get_widget(preview->xml, "instructions_image"));
+    gchar* name;
+    GtkIconSize size;
+    GtkTreeViewColumn* last_col;
 
-  gtk_image_get_stock(instructions_image, &name, &size);
-  gtk_image_set_from_stock(instructions_image, GTK_STOCK_DIALOG_ERROR, size);
-  gtk_label_set_text(instructions_label,
-                     _("The rows displayed below had errors. You can attempt to correct these errors by changing the configuration."));
-  gtk_widget_show(GTK_WIDGET(instructions_image));
-  gtk_widget_show(GTK_WIDGET(instructions_label));
+    gtk_image_get_stock(instructions_image, &name, &size);
+    gtk_image_set_from_stock(instructions_image, GTK_STOCK_DIALOG_ERROR, size);
+    gtk_label_set_text(instructions_label,
+                       _("The rows displayed below had errors. You can attempt to correct these errors by changing the configuration."));
+    gtk_widget_show(GTK_WIDGET(instructions_image));
+    gtk_widget_show(GTK_WIDGET(instructions_label));
 
-  preview->previewing_errors = TRUE;
-  preview->approved = FALSE; /* This is FALSE until the user clicks "OK". */
+    preview->previewing_errors = TRUE;
+    preview->approved = FALSE; /* This is FALSE until the user clicks "OK". */
 
-  /* Wait until the user clicks "OK" or "Cancel". */
-  gnc_csv_preview_update(preview);
+    /* Wait until the user clicks "OK" or "Cancel". */
+    gnc_csv_preview_update(preview);
 
-  /* Set the last column to have the header "Errors" so that the user
-   * doesn't find the extra column confusing. */
-  last_col = gtk_tree_view_get_column(preview->treeview,
-                                      preview->parse_data->column_types->len - 1);
-  gtk_tree_view_column_set_title(last_col, _("Errors"));
+    /* Set the last column to have the header "Errors" so that the user
+     * doesn't find the extra column confusing. */
+    last_col = gtk_tree_view_get_column(preview->treeview,
+                                        preview->parse_data->column_types->len - 1);
+    gtk_tree_view_column_set_title(last_col, _("Errors"));
 
-  gtk_dialog_run(GTK_DIALOG(preview->dialog));
-  
-  if(preview->approved)
-    return 0;
-  else
-    return 1;
+    gtk_dialog_run(GTK_DIALOG(preview->dialog));
+
+    if (preview->approved)
+        return 0;
+    else
+        return 1;
 }
 
 /** Lets the user import a CSV/Fixed-Width file. */
 void gnc_file_csv_import(void)
 {
-  /* The name of the file the user selected. */
-  char* selected_filename;
-   /* The default directory for the user to select files. */
-  char* default_dir= gnc_get_default_directory(GCONF_SECTION);
-  /* The generic GUI for importing transactions. */
-  GNCImportMainMatcher* gnc_csv_importer_gui = NULL;
+    /* The name of the file the user selected. */
+    char* selected_filename;
+    /* The default directory for the user to select files. */
+    char* default_dir = gnc_get_default_directory(GCONF_SECTION);
+    /* The generic GUI for importing transactions. */
+    GNCImportMainMatcher* gnc_csv_importer_gui = NULL;
 
-  /* Let the user select a file. */
-  selected_filename = gnc_file_dialog(_("Select an CSV/Fixed-Width file to import"),
-				      NULL, default_dir, GNC_FILE_DIALOG_IMPORT);
-  g_free(default_dir); /* We don't need default_dir anymore. */
+    /* Let the user select a file. */
+    selected_filename = gnc_file_dialog(_("Select an CSV/Fixed-Width file to import"),
+                                        NULL, default_dir, GNC_FILE_DIALOG_IMPORT);
+    g_free(default_dir); /* We don't need default_dir anymore. */
 
-  /* If the user actually selected a file ... */
-  if(selected_filename!=NULL)
-  {
-    int i, user_canceled = 0;
-    Account* account; /* The account the user will select */
-    GError* error = NULL;
-    GList* transactions; /* A list of the transactions we create */
-    GncCsvParseData* parse_data;
-    GncCsvPreview* preview;
-    
-    /* Remember the directory of the selected file as the default. */
-    default_dir = g_path_get_dirname(selected_filename);
-    gnc_set_default_directory(GCONF_SECTION, default_dir);
-    g_free(default_dir);
-
-    /* Load the file into parse_data. */
-    parse_data = gnc_csv_new_parse_data();
-    if(gnc_csv_load_file(parse_data, selected_filename, &error))
+    /* If the user actually selected a file ... */
+    if (selected_filename != NULL)
     {
-      /* If we couldn't load the file ... */
-      gnc_error_dialog(NULL, "%s", error->message);
-      if(error->code == GNC_CSV_FILE_OPEN_ERR)
-      {
-        gnc_csv_parse_data_free(parse_data);
-        g_free(selected_filename);
-        return;
-      }
-      /* If we couldn't guess the encoding, we are content with just
-       * displaying an error message and move on with a blank
-       * display. */
-    }
-    /* Parse the data. */
-    if(gnc_csv_parse(parse_data, TRUE, &error))
-    {
-      /* If we couldn't parse the data ... */
-      gnc_error_dialog(NULL, "%s", error->message);
-    }
+        int i, user_canceled = 0;
+        Account* account; /* The account the user will select */
+        GError* error = NULL;
+        GList* transactions; /* A list of the transactions we create */
+        GncCsvParseData* parse_data;
+        GncCsvPreview* preview;
 
-    /* Preview the data. */
-    preview = gnc_csv_preview_new();
-    if(gnc_csv_preview(preview, parse_data))
-    {
-      /* If the user clicked "Cancel", free everything and quit. */
-      gnc_csv_preview_free(preview);
-      gnc_csv_parse_data_free(parse_data);
-      g_free(selected_filename);
-      return;
-    }
+        /* Remember the directory of the selected file as the default. */
+        default_dir = g_path_get_dirname(selected_filename);
+        gnc_set_default_directory(GCONF_SECTION, default_dir);
+        g_free(default_dir);
 
-    /* Let the user select an account to put the transactions in. */
-    account = gnc_import_select_account(NULL, NULL, 1, NULL, NULL, 0, NULL, NULL);
-    if(account == NULL) /* Quit if the user canceled. */
-    {
-      gnc_csv_preview_free(preview);
-      gnc_csv_parse_data_free(parse_data);
-      g_free(selected_filename);
-      return;
-    }
+        /* Load the file into parse_data. */
+        parse_data = gnc_csv_new_parse_data();
+        if (gnc_csv_load_file(parse_data, selected_filename, &error))
+        {
+            /* If we couldn't load the file ... */
+            gnc_error_dialog(NULL, "%s", error->message);
+            if (error->code == GNC_CSV_FILE_OPEN_ERR)
+            {
+                gnc_csv_parse_data_free(parse_data);
+                g_free(selected_filename);
+                return;
+            }
+            /* If we couldn't guess the encoding, we are content with just
+             * displaying an error message and move on with a blank
+             * display. */
+        }
+        /* Parse the data. */
+        if (gnc_csv_parse(parse_data, TRUE, &error))
+        {
+            /* If we couldn't parse the data ... */
+            gnc_error_dialog(NULL, "%s", error->message);
+        }
 
-    /* Create transactions from the parsed data. */
-    gnc_csv_parse_to_trans(parse_data, account, FALSE);
+        /* Preview the data. */
+        preview = gnc_csv_preview_new();
+        if (gnc_csv_preview(preview, parse_data))
+        {
+            /* If the user clicked "Cancel", free everything and quit. */
+            gnc_csv_preview_free(preview);
+            gnc_csv_parse_data_free(parse_data);
+            g_free(selected_filename);
+            return;
+        }
 
-    /* If there are errors, let the user try and eliminate them by
-     * previewing them. Repeat until either there are no errors or the
-     * user gives up. */
-    while(!((parse_data->error_lines == NULL) || user_canceled))
-    {
-      user_canceled = gnc_csv_preview_errors(preview);
-      gnc_csv_parse_to_trans(parse_data, account, TRUE);
-    }
+        /* Let the user select an account to put the transactions in. */
+        account = gnc_import_select_account(NULL, NULL, 1, NULL, NULL, 0, NULL, NULL);
+        if (account == NULL) /* Quit if the user canceled. */
+        {
+            gnc_csv_preview_free(preview);
+            gnc_csv_parse_data_free(parse_data);
+            g_free(selected_filename);
+            return;
+        }
 
-    /* Create the genereic transaction importer GUI. */
-    gnc_csv_importer_gui = gnc_gen_trans_list_new(NULL, NULL, FALSE, 42);
+        /* Create transactions from the parsed data. */
+        gnc_csv_parse_to_trans(parse_data, account, FALSE);
 
-    /* Get the list of the transactions that were created. */
-    transactions = parse_data->transactions;
-    /* Copy all of the transactions to the importer GUI. */
-    while(transactions != NULL)
-    {
-      GncCsvTransLine* trans_line = transactions->data;
-      gnc_gen_trans_list_add_trans(gnc_csv_importer_gui,
-                                   trans_line->trans);
-      transactions = g_list_next(transactions);
+        /* If there are errors, let the user try and eliminate them by
+         * previewing them. Repeat until either there are no errors or the
+         * user gives up. */
+        while (!((parse_data->error_lines == NULL) || user_canceled))
+        {
+            user_canceled = gnc_csv_preview_errors(preview);
+            gnc_csv_parse_to_trans(parse_data, account, TRUE);
+        }
+
+        /* Create the genereic transaction importer GUI. */
+        gnc_csv_importer_gui = gnc_gen_trans_list_new(NULL, NULL, FALSE, 42);
+
+        /* Get the list of the transactions that were created. */
+        transactions = parse_data->transactions;
+        /* Copy all of the transactions to the importer GUI. */
+        while (transactions != NULL)
+        {
+            GncCsvTransLine* trans_line = transactions->data;
+            gnc_gen_trans_list_add_trans(gnc_csv_importer_gui,
+                                         trans_line->trans);
+            transactions = g_list_next(transactions);
+        }
+        /* Let the user load those transactions into the account, so long
+         * as there is at least one transaction to be loaded. */
+        if (parse_data->transactions != NULL)
+            gnc_gen_trans_list_run(gnc_csv_importer_gui);
+        else
+            gnc_gen_trans_list_delete(gnc_csv_importer_gui);
+
+        /* Free the memory we allocated. */
+        gnc_csv_preview_free(preview);
+        gnc_csv_parse_data_free(parse_data);
+        g_free(selected_filename);
     }
-    /* Let the user load those transactions into the account, so long
-     * as there is at least one transaction to be loaded. */
-    if(parse_data->transactions != NULL)
-      gnc_gen_trans_list_run(gnc_csv_importer_gui);
-    else
-      gnc_gen_trans_list_delete(gnc_csv_importer_gui);
-
-    /* Free the memory we allocated. */
-    gnc_csv_preview_free(preview);
-    gnc_csv_parse_data_free(parse_data);
-    g_free(selected_filename);
-  }
 }

Modified: gnucash/trunk/src/import-export/csv/gnc-csv-import.h
===================================================================
--- gnucash/trunk/src/import-export/csv/gnc-csv-import.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/csv/gnc-csv-import.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -16,12 +16,12 @@
  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 \********************************************************************/
- /** @file
-     @brief CSV import GUI
-     *
-     gnc-csv-import.h
-     @author Copyright (c) 2007 Benny Sperisen <lasindi at gmail.com>
- */
+/** @file
+    @brief CSV import GUI
+    *
+    gnc-csv-import.h
+    @author Copyright (c) 2007 Benny Sperisen <lasindi at gmail.com>
+*/
 #ifndef CSV_IMPORT_H
 #define CSV_IMPORT_H
 

Modified: gnucash/trunk/src/import-export/csv/gnc-csv-model.c
===================================================================
--- gnucash/trunk/src/import-export/csv/gnc-csv-model.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/csv/gnc-csv-model.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -34,26 +34,28 @@
                                    N_("d-m-y"),
                                    N_("m-d-y"),
                                    N_("d-m"),
-                                   N_("m-d")};
+                                   N_("m-d")
+                                  };
 
 /* This array contains all of the different strings for different column types. */
 gchar* gnc_csv_column_type_strs[GNC_CSV_NUM_COL_TYPES] = {N_("None"),
-                                                          N_("Date"),
-                                                          N_("Description"),
-                                                          N_("Balance"),
-                                                          N_("Deposit"),
-                                                          N_("Withdrawal"),
-                                                          N_("Num")};
+        N_("Date"),
+        N_("Description"),
+        N_("Balance"),
+        N_("Deposit"),
+        N_("Withdrawal"),
+        N_("Num")
+                                                         };
 
-/** A set of sensible defaults for parsing CSV files. 
+/** A set of sensible defaults for parsing CSV files.
  * @return StfParseOptions_t* for parsing a file with comma separators
  */
 static StfParseOptions_t* default_parse_options(void)
 {
-  StfParseOptions_t* options = stf_parse_options_new();
-  stf_parse_options_set_type(options, PARSE_TYPE_CSV);
-  stf_parse_options_csv_set_separators(options, ",", NULL);
-  return options;
+    StfParseOptions_t* options = stf_parse_options_new();
+    stf_parse_options_set_type(options, PARSE_TYPE_CSV);
+    stf_parse_options_csv_set_separators(options, ",", NULL);
+    return options;
 }
 
 /** Parses a string into a date, given a format. The format must
@@ -65,136 +67,136 @@
  */
 static time_t parse_date_with_year(const char* date_str, int format)
 {
-  time_t rawtime; /* The integer time */
-  struct tm retvalue, test_retvalue; /* The time in a broken-down structure */
-  
-  int i, j, mem_length, orig_year = -1, orig_month = -1, orig_day = -1;
+    time_t rawtime; /* The integer time */
+    struct tm retvalue, test_retvalue; /* The time in a broken-down structure */
 
-  /* Buffer for containing individual parts (e.g. year, month, day) of a date */
-  char date_segment[5];
+    int i, j, mem_length, orig_year = -1, orig_month = -1, orig_day = -1;
 
-  /* The compiled regular expression */
-  regex_t preg = {0};
+    /* Buffer for containing individual parts (e.g. year, month, day) of a date */
+    char date_segment[5];
 
-  /* An array containing indices specifying the matched substrings in date_str */
-  regmatch_t pmatch[4] = { {0}, {0}, {0}, {0} };
+    /* The compiled regular expression */
+    regex_t preg = {0};
 
-  /* The regular expression for parsing dates */
-  const char* regex = "^ *([0-9]+) *[-/.'] *([0-9]+) *[-/.'] *([0-9]+).*$|^ *([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]).*$";
+    /* An array containing indices specifying the matched substrings in date_str */
+    regmatch_t pmatch[4] = { {0}, {0}, {0}, {0} };
 
-  /* We get our matches using the regular expression. */
-  regcomp(&preg, regex, REG_EXTENDED);
-  regexec(&preg, date_str, 4, pmatch, 0);
-  regfree(&preg);
+    /* The regular expression for parsing dates */
+    const char* regex = "^ *([0-9]+) *[-/.'] *([0-9]+) *[-/.'] *([0-9]+).*$|^ *([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]).*$";
 
-  /* If there wasn't a match, there was an error. */
-  if(pmatch[0].rm_eo == 0)
-    return -1;
+    /* We get our matches using the regular expression. */
+    regcomp(&preg, regex, REG_EXTENDED);
+    regexec(&preg, date_str, 4, pmatch, 0);
+    regfree(&preg);
 
-  /* If this is a string without separators ... */
-  if(pmatch[1].rm_so == -1)
-  {
-    /* ... we will fill in the indices based on the user's selection. */
-    int k = 0; /* k traverses date_str by keeping track of where separators "should" be. */
-    j = 1; /* j traverses pmatch. */
-    for(i = 0; date_format_user[format][i]; i++)
+    /* If there wasn't a match, there was an error. */
+    if (pmatch[0].rm_eo == 0)
+        return -1;
+
+    /* If this is a string without separators ... */
+    if (pmatch[1].rm_so == -1)
     {
-      char segment_type = date_format_user[format][i];
-      /* Only do something if this is a meaningful character */
-      if(segment_type == 'y' || segment_type == 'm' || segment_type == 'd')
-      {
-        pmatch[j].rm_so = k;
-        switch(segment_type)
+        /* ... we will fill in the indices based on the user's selection. */
+        int k = 0; /* k traverses date_str by keeping track of where separators "should" be. */
+        j = 1; /* j traverses pmatch. */
+        for (i = 0; date_format_user[format][i]; i++)
         {
-        case 'm':
-        case 'd':
-          k += 2;
-          break;
+            char segment_type = date_format_user[format][i];
+            /* Only do something if this is a meaningful character */
+            if (segment_type == 'y' || segment_type == 'm' || segment_type == 'd')
+            {
+                pmatch[j].rm_so = k;
+                switch (segment_type)
+                {
+                case 'm':
+                case 'd':
+                    k += 2;
+                    break;
 
-        case 'y':
-          k += 4;
-          break;
+                case 'y':
+                    k += 4;
+                    break;
+                }
+
+                pmatch[j].rm_eo = k;
+                j++;
+            }
         }
+    }
 
-        pmatch[j].rm_eo = k;
-        j++;
-      }
-    }    
-  }
+    /* Put some sane values in retvalue by using the current time for
+     * the non-year-month-day parts of the date. */
+    time(&rawtime);
+    localtime_r(&rawtime, &retvalue);
 
-  /* Put some sane values in retvalue by using the current time for
-   * the non-year-month-day parts of the date. */
-  time(&rawtime);
-  localtime_r(&rawtime, &retvalue);
-
-  /* j traverses pmatch (index 0 contains the entire string, so we
-   * start at index 1 for the first meaningful match). */
-  j = 1;
-  /* Go through the date format and interpret the matches in order of
-   * the sections in the date format. */
-  for(i = 0; date_format_user[format][i]; i++)
-  {
-    char segment_type = date_format_user[format][i];
-    /* Only do something if this is a meaningful character */
-    if(segment_type == 'y' || segment_type == 'm' || segment_type == 'd')
+    /* j traverses pmatch (index 0 contains the entire string, so we
+     * start at index 1 for the first meaningful match). */
+    j = 1;
+    /* Go through the date format and interpret the matches in order of
+     * the sections in the date format. */
+    for (i = 0; date_format_user[format][i]; i++)
     {
-      /* Copy the matching substring into date_segment so that we can
-       * convert it into an integer. */
-      mem_length = pmatch[j].rm_eo - pmatch[j].rm_so;
-      memcpy(date_segment, date_str + pmatch[j].rm_so, mem_length);
-      date_segment[mem_length] = '\0';
+        char segment_type = date_format_user[format][i];
+        /* Only do something if this is a meaningful character */
+        if (segment_type == 'y' || segment_type == 'm' || segment_type == 'd')
+        {
+            /* Copy the matching substring into date_segment so that we can
+             * convert it into an integer. */
+            mem_length = pmatch[j].rm_eo - pmatch[j].rm_so;
+            memcpy(date_segment, date_str + pmatch[j].rm_so, mem_length);
+            date_segment[mem_length] = '\0';
 
-      /* Set the appropriate member of retvalue. Save the original
-       * values so that we can check if the change when we use mktime
-       * below. */
-      switch(segment_type)
-      {
-      case 'y':
-        retvalue.tm_year = atoi(date_segment);
+            /* Set the appropriate member of retvalue. Save the original
+             * values so that we can check if the change when we use mktime
+             * below. */
+            switch (segment_type)
+            {
+            case 'y':
+                retvalue.tm_year = atoi(date_segment);
 
-        /* Handle two-digit years. */
-        if(retvalue.tm_year < 100)
-        {
-          /* We allow two-digit years in the range 1969 - 2068. */
-          if(retvalue.tm_year < 69)
-            retvalue.tm_year += 100;
+                /* Handle two-digit years. */
+                if (retvalue.tm_year < 100)
+                {
+                    /* We allow two-digit years in the range 1969 - 2068. */
+                    if (retvalue.tm_year < 69)
+                        retvalue.tm_year += 100;
+                }
+                else
+                    retvalue.tm_year -= 1900;
+                orig_year = retvalue.tm_year;
+                break;
+
+            case 'm':
+                orig_month = retvalue.tm_mon = atoi(date_segment) - 1;
+                break;
+
+            case 'd':
+                orig_day = retvalue.tm_mday = atoi(date_segment);
+                break;
+            }
+            j++;
         }
-        else
-          retvalue.tm_year -= 1900;
-        orig_year = retvalue.tm_year;
-        break;
-        
-      case 'm':
-        orig_month = retvalue.tm_mon = atoi(date_segment) - 1;
-        break;
-        
-      case 'd':
-        orig_day = retvalue.tm_mday = atoi(date_segment);
-        break;
-      }
-      j++;
     }
-  }
-  /* Convert back to an integer. If mktime leaves retvalue unchanged,
-   * everything is okay; otherwise, an error has occurred. */
-  /* We have to use a "test" date value to account for changes in
-   * daylight savings time, which can cause a date change with mktime
-   * near midnight, causing the code to incorrectly think a date is
-   * incorrect. */
-  test_retvalue = retvalue;
-  mktime(&test_retvalue);
-  retvalue.tm_isdst = test_retvalue.tm_isdst;
-  rawtime = mktime(&retvalue);
-  if(retvalue.tm_mday == orig_day &&
-     retvalue.tm_mon == orig_month &&
-     retvalue.tm_year == orig_year)
-  {
-    return rawtime;
-  }
-  else
-  {
-    return -1;
-  }
+    /* Convert back to an integer. If mktime leaves retvalue unchanged,
+     * everything is okay; otherwise, an error has occurred. */
+    /* We have to use a "test" date value to account for changes in
+     * daylight savings time, which can cause a date change with mktime
+     * near midnight, causing the code to incorrectly think a date is
+     * incorrect. */
+    test_retvalue = retvalue;
+    mktime(&test_retvalue);
+    retvalue.tm_isdst = test_retvalue.tm_isdst;
+    rawtime = mktime(&retvalue);
+    if (retvalue.tm_mday == orig_day &&
+    retvalue.tm_mon == orig_month &&
+    retvalue.tm_year == orig_year)
+    {
+        return rawtime;
+    }
+    else
+    {
+        return -1;
+    }
 }
 
 /** Parses a string into a date, given a format. The format cannot
@@ -206,93 +208,93 @@
  */
 static time_t parse_date_without_year(const char* date_str, int format)
 {
-  time_t rawtime; /* The integer time */
-  struct tm retvalue, test_retvalue; /* The time in a broken-down structure */
-  
-  int i, j, mem_length, orig_year = -1, orig_month = -1, orig_day = -1;
+    time_t rawtime; /* The integer time */
+    struct tm retvalue, test_retvalue; /* The time in a broken-down structure */
 
-  /* Buffer for containing individual parts (e.g. year, month, day) of a date */
-  gchar* date_segment;
+    int i, j, mem_length, orig_year = -1, orig_month = -1, orig_day = -1;
 
-  /* The compiled regular expression */
-  regex_t preg = {0};
+    /* Buffer for containing individual parts (e.g. year, month, day) of a date */
+    gchar* date_segment;
 
-  /* An array containing indices specifying the matched substrings in date_str */
-  regmatch_t pmatch[3] = { {0}, {0}, {0} };
+    /* The compiled regular expression */
+    regex_t preg = {0};
 
-  /* The regular expression for parsing dates */
-  const char* regex = "^ *([0-9]+) *[-/.'] *([0-9]+).*$";
+    /* An array containing indices specifying the matched substrings in date_str */
+    regmatch_t pmatch[3] = { {0}, {0}, {0} };
 
-  /* We get our matches using the regular expression. */
-  regcomp(&preg, regex, REG_EXTENDED);
-  regexec(&preg, date_str, 3, pmatch, 0);
-  regfree(&preg);
+    /* The regular expression for parsing dates */
+    const char* regex = "^ *([0-9]+) *[-/.'] *([0-9]+).*$";
 
-  /* If there wasn't a match, there was an error. */
-  if(pmatch[0].rm_eo == 0)
-    return -1;
+    /* We get our matches using the regular expression. */
+    regcomp(&preg, regex, REG_EXTENDED);
+    regexec(&preg, date_str, 3, pmatch, 0);
+    regfree(&preg);
 
-  /* Put some sane values in retvalue by using the current time for
-   * the non-year-month-day parts of the date. */
-  time(&rawtime);
-  localtime_r(&rawtime, &retvalue);
-  orig_year = retvalue.tm_year;
+    /* If there wasn't a match, there was an error. */
+    if (pmatch[0].rm_eo == 0)
+        return -1;
 
-  /* j traverses pmatch (index 0 contains the entire string, so we
-   * start at index 1 for the first meaningful match). */
-  j = 1;
-  /* Go through the date format and interpret the matches in order of
-   * the sections in the date format. */
-  for(i = 0; date_format_user[format][i]; i++)
-  {
-    char segment_type = date_format_user[format][i];
-    /* Only do something if this is a meaningful character */
-    if(segment_type == 'm' || segment_type == 'd')
+    /* Put some sane values in retvalue by using the current time for
+     * the non-year-month-day parts of the date. */
+    time(&rawtime);
+    localtime_r(&rawtime, &retvalue);
+    orig_year = retvalue.tm_year;
+
+    /* j traverses pmatch (index 0 contains the entire string, so we
+     * start at index 1 for the first meaningful match). */
+    j = 1;
+    /* Go through the date format and interpret the matches in order of
+     * the sections in the date format. */
+    for (i = 0; date_format_user[format][i]; i++)
     {
-      /* Copy the matching substring into date_segment so that we can
-       * convert it into an integer. */
-      mem_length = pmatch[j].rm_eo - pmatch[j].rm_so;
-      date_segment = g_new(gchar, mem_length);
-      memcpy(date_segment, date_str + pmatch[j].rm_so, mem_length);
-      date_segment[mem_length] = '\0';
+        char segment_type = date_format_user[format][i];
+        /* Only do something if this is a meaningful character */
+        if (segment_type == 'm' || segment_type == 'd')
+        {
+            /* Copy the matching substring into date_segment so that we can
+             * convert it into an integer. */
+            mem_length = pmatch[j].rm_eo - pmatch[j].rm_so;
+            date_segment = g_new(gchar, mem_length);
+            memcpy(date_segment, date_str + pmatch[j].rm_so, mem_length);
+            date_segment[mem_length] = '\0';
 
-      /* Set the appropriate member of retvalue. Save the original
-       * values so that we can check if the change when we use mktime
-       * below. */
-      switch(segment_type)
-      {
-      case 'm':
-        orig_month = retvalue.tm_mon = atoi(date_segment) - 1;
-        break;
-        
-      case 'd':
-        orig_day = retvalue.tm_mday = atoi(date_segment);
-        break;
-      }
-      g_free(date_segment);
-      j++;
+            /* Set the appropriate member of retvalue. Save the original
+             * values so that we can check if the change when we use mktime
+             * below. */
+            switch (segment_type)
+            {
+            case 'm':
+                orig_month = retvalue.tm_mon = atoi(date_segment) - 1;
+                break;
+
+            case 'd':
+                orig_day = retvalue.tm_mday = atoi(date_segment);
+                break;
+            }
+            g_free(date_segment);
+            j++;
+        }
     }
-  }
-  /* Convert back to an integer. If mktime leaves retvalue unchanged,
-   * everything is okay; otherwise, an error has occurred. */
-  /* We have to use a "test" date value to account for changes in
-   * daylight savings time, which can cause a date change with mktime
-   * near midnight, causing the code to incorrectly think a date is
-   * incorrect. */
-  test_retvalue = retvalue;
-  mktime(&test_retvalue);
-  retvalue.tm_isdst = test_retvalue.tm_isdst;
-  rawtime = mktime(&retvalue);
-  if(retvalue.tm_mday == orig_day &&
-     retvalue.tm_mon == orig_month &&
-     retvalue.tm_year == orig_year)
-  {
-    return rawtime;
-  }
-  else
-  {
-    return -1;
-  }
+    /* Convert back to an integer. If mktime leaves retvalue unchanged,
+     * everything is okay; otherwise, an error has occurred. */
+    /* We have to use a "test" date value to account for changes in
+     * daylight savings time, which can cause a date change with mktime
+     * near midnight, causing the code to incorrectly think a date is
+     * incorrect. */
+    test_retvalue = retvalue;
+    mktime(&test_retvalue);
+    retvalue.tm_isdst = test_retvalue.tm_isdst;
+    rawtime = mktime(&retvalue);
+    if (retvalue.tm_mday == orig_day &&
+    retvalue.tm_mon == orig_month &&
+    retvalue.tm_year == orig_year)
+    {
+        return rawtime;
+    }
+    else
+    {
+        return -1;
+    }
 }
 
 /** Parses a string into a date, given a format. This function
@@ -305,10 +307,10 @@
  */
 static time_t parse_date(const char* date_str, int format)
 {
-  if(strchr(date_format_user[format], 'y'))
-    return parse_date_with_year(date_str, format);
-  else
-    return parse_date_without_year(date_str, format);
+    if (strchr(date_format_user[format], 'y'))
+        return parse_date_with_year(date_str, format);
+    else
+        return parse_date_without_year(date_str, format);
 }
 
 /** Constructor for GncCsvParseData.
@@ -316,21 +318,21 @@
  */
 GncCsvParseData* gnc_csv_new_parse_data(void)
 {
-  GncCsvParseData* parse_data = g_new(GncCsvParseData, 1);
-  parse_data->encoding = "UTF-8";
-  /* All of the data pointers are initially NULL. This is so that, if
-   * gnc_csv_parse_data_free is called before all of the data is
-   * initialized, only the data that needs to be freed is freed. */
-  parse_data->raw_str.begin = parse_data->raw_str.end
+    GncCsvParseData* parse_data = g_new(GncCsvParseData, 1);
+    parse_data->encoding = "UTF-8";
+    /* All of the data pointers are initially NULL. This is so that, if
+     * gnc_csv_parse_data_free is called before all of the data is
+     * initialized, only the data that needs to be freed is freed. */
+    parse_data->raw_str.begin = parse_data->raw_str.end
     = parse_data->file_str.begin = parse_data->file_str.end = NULL;
-  parse_data->orig_lines = NULL;
-  parse_data->orig_row_lengths = NULL;
-  parse_data->column_types = NULL;
-  parse_data->error_lines = parse_data->transactions = NULL;
-  parse_data->options = default_parse_options();
-  parse_data->date_format = -1;
-  parse_data->chunk = g_string_chunk_new(100 * 1024);
-  return parse_data;
+    parse_data->orig_lines = NULL;
+    parse_data->orig_row_lengths = NULL;
+    parse_data->column_types = NULL;
+    parse_data->error_lines = parse_data->transactions = NULL;
+    parse_data->options = default_parse_options();
+    parse_data->date_format = -1;
+    parse_data->chunk = g_string_chunk_new(100 * 1024);
+    return parse_data;
 }
 
 /** Destructor for GncCsvParseData.
@@ -338,44 +340,45 @@
  */
 void gnc_csv_parse_data_free(GncCsvParseData* parse_data)
 {
-  /* All non-NULL pointers have been initialized and must be freed. */
+    /* All non-NULL pointers have been initialized and must be freed. */
 
-  if(parse_data->raw_mapping != NULL)
-    g_mapped_file_free(parse_data->raw_mapping);
+    if (parse_data->raw_mapping != NULL)
+        g_mapped_file_free(parse_data->raw_mapping);
 
-  if(parse_data->file_str.begin != NULL)
-    g_free(parse_data->file_str.begin);
+    if (parse_data->file_str.begin != NULL)
+        g_free(parse_data->file_str.begin);
 
-  if(parse_data->orig_lines != NULL)
-    stf_parse_general_free(parse_data->orig_lines);
+    if (parse_data->orig_lines != NULL)
+        stf_parse_general_free(parse_data->orig_lines);
 
-  if(parse_data->orig_row_lengths != NULL)
-    g_array_free(parse_data->orig_row_lengths, FALSE);
+    if (parse_data->orig_row_lengths != NULL)
+        g_array_free(parse_data->orig_row_lengths, FALSE);
 
-  if(parse_data->options != NULL)
-    stf_parse_options_free(parse_data->options);
+    if (parse_data->options != NULL)
+        stf_parse_options_free(parse_data->options);
 
-  if(parse_data->column_types != NULL)
-    g_array_free(parse_data->column_types, TRUE);
+    if (parse_data->column_types != NULL)
+        g_array_free(parse_data->column_types, TRUE);
 
-  if(parse_data->error_lines != NULL)
-    g_list_free(parse_data->error_lines);
+    if (parse_data->error_lines != NULL)
+        g_list_free(parse_data->error_lines);
 
-  if(parse_data->transactions != NULL)
-  {
-    GList* transactions = parse_data->transactions;
-    /* We have to free the GncCsvTransLine's that are at each node in
-     * the list before freeing the entire list. */
-    do
+    if (parse_data->transactions != NULL)
     {
-      g_free(transactions->data);
-      transactions = g_list_next(transactions);
-    } while(transactions != NULL);
-    g_list_free(parse_data->transactions);
-  }
+        GList* transactions = parse_data->transactions;
+        /* We have to free the GncCsvTransLine's that are at each node in
+         * the list before freeing the entire list. */
+        do
+        {
+            g_free(transactions->data);
+            transactions = g_list_next(transactions);
+        }
+        while (transactions != NULL);
+        g_list_free(parse_data->transactions);
+    }
 
-  g_free(parse_data->chunk);
-  g_free(parse_data);
+    g_free(parse_data->chunk);
+    g_free(parse_data);
 }
 
 /** Converts raw file data using a new encoding. This function must be
@@ -387,31 +390,31 @@
  * @return 0 on success, 1 on failure
  */
 int gnc_csv_convert_encoding(GncCsvParseData* parse_data, const char* encoding,
-                             GError** error)
+GError** error)
 {
-  gsize bytes_read, bytes_written;
+    gsize bytes_read, bytes_written;
 
-  /* If parse_data->file_str has already been initialized it must be
-   * freed first. (This should always be the case, since
-   * gnc_csv_load_file should always be called before this
-   * function.) */
-  if(parse_data->file_str.begin != NULL)
-    g_free(parse_data->file_str.begin);
+    /* If parse_data->file_str has already been initialized it must be
+     * freed first. (This should always be the case, since
+     * gnc_csv_load_file should always be called before this
+     * function.) */
+    if (parse_data->file_str.begin != NULL)
+        g_free(parse_data->file_str.begin);
 
-  /* Do the actual translation to UTF-8. */
-  parse_data->file_str.begin = g_convert(parse_data->raw_str.begin,
-                                         parse_data->raw_str.end - parse_data->raw_str.begin,
-                                         "UTF-8", encoding, &bytes_read, &bytes_written,
-                                         error);
-  /* Handle errors that occur. */
-  if(parse_data->file_str.begin == NULL)
-    return 1;
+    /* Do the actual translation to UTF-8. */
+    parse_data->file_str.begin = g_convert(parse_data->raw_str.begin,
+    parse_data->raw_str.end - parse_data->raw_str.begin,
+    "UTF-8", encoding, &bytes_read, &bytes_written,
+    error);
+    /* Handle errors that occur. */
+    if (parse_data->file_str.begin == NULL)
+        return 1;
 
-  /* On success, save the ending pointer of the translated data and
-   * the encoding type and return 0. */
-  parse_data->file_str.end = parse_data->file_str.begin + bytes_written;
-  parse_data->encoding = (gchar*)encoding;
-  return 0;
+    /* On success, save the ending pointer of the translated data and
+     * the encoding type and return 0. */
+    parse_data->file_str.end = parse_data->file_str.begin + bytes_written;
+    parse_data->encoding = (gchar*)encoding;
+    return 0;
 }
 
 /** Loads a file into a GncCsvParseData. This is the first function
@@ -427,45 +430,45 @@
  * @return 0 on success, 1 on failure
  */
 int gnc_csv_load_file(GncCsvParseData* parse_data, const char* filename,
-                      GError** error)
+GError** error)
 {
-  const char* guess_enc;
+    const char* guess_enc;
 
-  /* Get the raw data first and handle an error if one occurs. */
-  parse_data->raw_mapping = g_mapped_file_new(filename, FALSE, error);
-  if(parse_data->raw_mapping == NULL)
-  {
-    /* TODO Handle file opening errors more specifically,
-     * e.g. inexistent file versus no read permission. */
-    parse_data->raw_str.begin = NULL;
-    g_set_error(error, 0, GNC_CSV_FILE_OPEN_ERR, "%s", _("File opening failed."));
-    return 1;
-  }
+    /* Get the raw data first and handle an error if one occurs. */
+    parse_data->raw_mapping = g_mapped_file_new(filename, FALSE, error);
+    if (parse_data->raw_mapping == NULL)
+    {
+        /* TODO Handle file opening errors more specifically,
+         * e.g. inexistent file versus no read permission. */
+        parse_data->raw_str.begin = NULL;
+        g_set_error(error, 0, GNC_CSV_FILE_OPEN_ERR, "%s", _("File opening failed."));
+        return 1;
+    }
 
-  /* Copy the mapping's contents into parse-data->raw_str. */
-  parse_data->raw_str.begin = g_mapped_file_get_contents(parse_data->raw_mapping);
-  parse_data->raw_str.end = parse_data->raw_str.begin + g_mapped_file_get_length(parse_data->raw_mapping);
+    /* Copy the mapping's contents into parse-data->raw_str. */
+    parse_data->raw_str.begin = g_mapped_file_get_contents(parse_data->raw_mapping);
+    parse_data->raw_str.end = parse_data->raw_str.begin + g_mapped_file_get_length(parse_data->raw_mapping);
 
-  /* Make a guess at the encoding of the data. */
-  guess_enc = go_guess_encoding((const char*)(parse_data->raw_str.begin),
-                                (size_t)(parse_data->raw_str.end - parse_data->raw_str.begin),
-                                "UTF-8", NULL);
-  if(guess_enc == NULL)
-  {
-    g_set_error(error, 0, GNC_CSV_ENCODING_ERR, "%s", _("Unknown encoding."));
-    return 1;
-  }
+    /* Make a guess at the encoding of the data. */
+    guess_enc = go_guess_encoding((const char*)(parse_data->raw_str.begin),
+    (size_t)(parse_data->raw_str.end - parse_data->raw_str.begin),
+    "UTF-8", NULL);
+    if (guess_enc == NULL)
+    {
+        g_set_error(error, 0, GNC_CSV_ENCODING_ERR, "%s", _("Unknown encoding."));
+        return 1;
+    }
 
-  /* Convert using the guessed encoding into parse_data->file_str and
-   * handle any errors that occur. */
-  gnc_csv_convert_encoding(parse_data, guess_enc, error);
-  if(parse_data->file_str.begin == NULL)
-  {
-    g_set_error(error, 0, GNC_CSV_ENCODING_ERR, "%s", _("Unknown encoding."));
-    return 1;
-  }
-  else
-    return 0;
+    /* Convert using the guessed encoding into parse_data->file_str and
+     * handle any errors that occur. */
+    gnc_csv_convert_encoding(parse_data, guess_enc, error);
+    if (parse_data->file_str.begin == NULL)
+    {
+        g_set_error(error, 0, GNC_CSV_ENCODING_ERR, "%s", _("Unknown encoding."));
+        return 1;
+    }
+    else
+        return 0;
 }
 
 /** Parses a file into cells. This requires having an encoding that
@@ -482,108 +485,108 @@
  */
 int gnc_csv_parse(GncCsvParseData* parse_data, gboolean guessColTypes, GError** error)
 {
-  /* max_cols is the number of columns in the row with the most columns. */
-  int i, max_cols = 0;
+    /* max_cols is the number of columns in the row with the most columns. */
+    int i, max_cols = 0;
 
-  if(parse_data->orig_lines != NULL)
-  {
-    stf_parse_general_free(parse_data->orig_lines);
-  }
+    if (parse_data->orig_lines != NULL)
+    {
+        stf_parse_general_free(parse_data->orig_lines);
+    }
 
-  /* If everything is fine ... */
-  if(parse_data->file_str.begin != NULL)
-  {
-    /* Do the actual parsing. */
-    parse_data->orig_lines = stf_parse_general(parse_data->options, parse_data->chunk,
-                                               parse_data->file_str.begin,
-                                               parse_data->file_str.end);
-  }
-  /* If we couldn't get the encoding right, we just want an empty array. */
-  else
-  {
-    parse_data->orig_lines = g_ptr_array_new();
-  }
+    /* If everything is fine ... */
+    if (parse_data->file_str.begin != NULL)
+    {
+        /* Do the actual parsing. */
+        parse_data->orig_lines = stf_parse_general(parse_data->options, parse_data->chunk,
+        parse_data->file_str.begin,
+        parse_data->file_str.end);
+    }
+    /* If we couldn't get the encoding right, we just want an empty array. */
+    else
+    {
+        parse_data->orig_lines = g_ptr_array_new();
+    }
 
-  /* Record the original row lengths of parse_data->orig_lines. */
-  if(parse_data->orig_row_lengths != NULL)
-    g_array_free(parse_data->orig_row_lengths, FALSE);
+    /* Record the original row lengths of parse_data->orig_lines. */
+    if (parse_data->orig_row_lengths != NULL)
+        g_array_free(parse_data->orig_row_lengths, FALSE);
 
-  parse_data->orig_row_lengths =
+    parse_data->orig_row_lengths =
     g_array_sized_new(FALSE, FALSE, sizeof(int), parse_data->orig_lines->len);
-  g_array_set_size(parse_data->orig_row_lengths, parse_data->orig_lines->len);
-  parse_data->orig_max_row = 0;
-  for(i = 0; i < parse_data->orig_lines->len; i++)
-  {
-    int length = ((GPtrArray*)parse_data->orig_lines->pdata[i])->len;
-    parse_data->orig_row_lengths->data[i] = length;
-    if(length > parse_data->orig_max_row)
-      parse_data->orig_max_row = length;
-  }
+    g_array_set_size(parse_data->orig_row_lengths, parse_data->orig_lines->len);
+    parse_data->orig_max_row = 0;
+    for (i = 0; i < parse_data->orig_lines->len; i++)
+    {
+        int length = ((GPtrArray*)parse_data->orig_lines->pdata[i])->len;
+        parse_data->orig_row_lengths->data[i] = length;
+        if (length > parse_data->orig_max_row)
+            parse_data->orig_max_row = length;
+    }
 
-  /* If it failed, generate an error. */
-  if(parse_data->orig_lines == NULL)
-  {
-    g_set_error(error, 0, 0, "Parsing failed.");
-    return 1;
-  }
+    /* If it failed, generate an error. */
+    if (parse_data->orig_lines == NULL)
+    {
+        g_set_error(error, 0, 0, "Parsing failed.");
+        return 1;
+    }
 
-  /* Now that we have data, let's set max_cols. */
-  for(i = 0; i < parse_data->orig_lines->len; i++)
-  {
-    if(max_cols < ((GPtrArray*)(parse_data->orig_lines->pdata[i]))->len)
-      max_cols = ((GPtrArray*)(parse_data->orig_lines->pdata[i]))->len;
-  }
+    /* Now that we have data, let's set max_cols. */
+    for (i = 0; i < parse_data->orig_lines->len; i++)
+    {
+        if (max_cols < ((GPtrArray*)(parse_data->orig_lines->pdata[i]))->len)
+            max_cols = ((GPtrArray*)(parse_data->orig_lines->pdata[i]))->len;
+    }
 
-  if(guessColTypes)
-  {
-    /* Free parse_data->column_types if it's already been created. */
-    if(parse_data->column_types != NULL)
-      g_array_free(parse_data->column_types, TRUE);
+    if (guessColTypes)
+    {
+        /* Free parse_data->column_types if it's already been created. */
+        if (parse_data->column_types != NULL)
+            g_array_free(parse_data->column_types, TRUE);
 
-    /* Create parse_data->column_types and fill it with guesses based
-     * on the contents of each column. */
-    parse_data->column_types = g_array_sized_new(FALSE, FALSE, sizeof(int),
-                                                 max_cols);
-    g_array_set_size(parse_data->column_types, max_cols);
-    /* TODO Make it actually guess. */
-    for(i = 0; i < parse_data->column_types->len; i++)
-    {
-      parse_data->column_types->data[i] = GNC_CSV_NONE;
+        /* Create parse_data->column_types and fill it with guesses based
+         * on the contents of each column. */
+        parse_data->column_types = g_array_sized_new(FALSE, FALSE, sizeof(int),
+        max_cols);
+        g_array_set_size(parse_data->column_types, max_cols);
+        /* TODO Make it actually guess. */
+        for (i = 0; i < parse_data->column_types->len; i++)
+        {
+            parse_data->column_types->data[i] = GNC_CSV_NONE;
+        }
     }
-  }
-  else
-  {
-    /* If we don't need to guess column types, we will simply set any
-     * new columns that are created that didn't exist before to "None"
-     * since we don't want gibberish to appear. Note:
-     * parse_data->column_types should have already been
-     * initialized, so we don't check for it being NULL. */
-    int i = parse_data->column_types->len;
-    g_array_set_size(parse_data->column_types, max_cols);
-    for(; i < parse_data->column_types->len; i++)
+    else
     {
-      parse_data->column_types->data[i] = GNC_CSV_NONE;
+        /* If we don't need to guess column types, we will simply set any
+         * new columns that are created that didn't exist before to "None"
+         * since we don't want gibberish to appear. Note:
+         * parse_data->column_types should have already been
+         * initialized, so we don't check for it being NULL. */
+        int i = parse_data->column_types->len;
+        g_array_set_size(parse_data->column_types, max_cols);
+        for (; i < parse_data->column_types->len; i++)
+        {
+            parse_data->column_types->data[i] = GNC_CSV_NONE;
+        }
     }
-  }
 
-  return 0;
+    return 0;
 }
 
 /** A struct containing TransProperties that all describe a single transaction. */
 typedef struct
 {
-  int date_format; /**< The format for parsing dates */
-  Account* account; /**< The account the transaction belongs to */
-  GList* properties; /**< List of TransProperties */
+    int date_format; /**< The format for parsing dates */
+    Account* account; /**< The account the transaction belongs to */
+    GList* properties; /**< List of TransProperties */
 } TransPropertyList;
 
 /** A struct encapsulating a property of a transaction. */
 typedef struct
 {
-  int type; /**< A value from the GncCsvColumnType enum except
+    int type; /**< A value from the GncCsvColumnType enum except
              * GNC_CSV_NONE and GNC_CSV_NUM_COL_TYPES */
-  void* value; /**< Pointer to the data that will be used to configure a transaction */
-  TransPropertyList* list; /**< The list the property belongs to */
+    void* value; /**< Pointer to the data that will be used to configure a transaction */
+    TransPropertyList* list; /**< The list the property belongs to */
 } TransProperty;
 
 /** Constructor for TransProperty.
@@ -591,11 +594,11 @@
  */
 static TransProperty* trans_property_new(int type, TransPropertyList* list)
 {
-  TransProperty* prop = g_new(TransProperty, 1);
-  prop->type = type;
-  prop->list = list;
-  prop->value = NULL;
-  return prop;
+    TransProperty* prop = g_new(TransProperty, 1);
+    prop->type = type;
+    prop->list = list;
+    prop->value = NULL;
+    return prop;
 }
 
 /** Destructor for TransProperty.
@@ -603,20 +606,20 @@
  */
 static void trans_property_free(TransProperty* prop)
 {
-  switch(prop->type)
-  {
-    /* The types for "Date" and "Balance" (time_t and gnc_numeric,
-     * respectively) are typically not pointed to, we have to free
-     * them, unlike types like char* ("Description"). */
-  case GNC_CSV_DATE:
-  case GNC_CSV_BALANCE:
-  case GNC_CSV_DEPOSIT:
-  case GNC_CSV_WITHDRAWAL:
-    if(prop->value != NULL)
-      g_free(prop->value);
-    break;
-  }
-  g_free(prop);
+    switch (prop->type)
+    {
+        /* The types for "Date" and "Balance" (time_t and gnc_numeric,
+         * respectively) are typically not pointed to, we have to free
+         * them, unlike types like char* ("Description"). */
+    case GNC_CSV_DATE:
+    case GNC_CSV_BALANCE:
+    case GNC_CSV_DEPOSIT:
+    case GNC_CSV_WITHDRAWAL:
+        if (prop->value != NULL)
+            g_free(prop->value);
+        break;
+    }
+    g_free(prop);
 }
 
 /** Sets the value of the property by parsing str. Note: this should
@@ -628,69 +631,69 @@
  */
 static gboolean trans_property_set(TransProperty* prop, char* str)
 {
-  char *endptr, *possible_currency_symbol, *str_dupe;
-  double value;
-  switch(prop->type)
-  {
-  case GNC_CSV_DATE:
-    prop->value = g_new(time_t, 1);
-    *((time_t*)(prop->value)) = parse_date(str, prop->list->date_format);
-    return *((time_t*)(prop->value)) != -1;
+    char *endptr, *possible_currency_symbol, *str_dupe;
+    double value;
+    switch (prop->type)
+    {
+    case GNC_CSV_DATE:
+        prop->value = g_new(time_t, 1);
+        *((time_t*)(prop->value)) = parse_date(str, prop->list->date_format);
+        return *((time_t*)(prop->value)) != -1;
 
-  case GNC_CSV_DESCRIPTION:
-  case GNC_CSV_NUM:
-    prop->value = g_strdup(str);
-    return TRUE;
+    case GNC_CSV_DESCRIPTION:
+    case GNC_CSV_NUM:
+        prop->value = g_strdup(str);
+        return TRUE;
 
-  case GNC_CSV_BALANCE:
-  case GNC_CSV_DEPOSIT:
-  case GNC_CSV_WITHDRAWAL:
-    str_dupe = g_strdup(str); /* First, we make a copy so we can't mess up real data. */
+    case GNC_CSV_BALANCE:
+    case GNC_CSV_DEPOSIT:
+    case GNC_CSV_WITHDRAWAL:
+        str_dupe = g_strdup(str); /* First, we make a copy so we can't mess up real data. */
 
-    /* Go through str_dupe looking for currency symbols. */
-    for(possible_currency_symbol = str_dupe; *possible_currency_symbol;
+        /* Go through str_dupe looking for currency symbols. */
+        for (possible_currency_symbol = str_dupe; *possible_currency_symbol;
         possible_currency_symbol = g_utf8_next_char(possible_currency_symbol))
-    {
-      if(g_unichar_type(g_utf8_get_char(possible_currency_symbol)) == G_UNICODE_CURRENCY_SYMBOL)
-      {
-        /* If we find a currency symbol, save the position just ahead
-         * of the currency symbol (next_symbol), and find the null
-         * terminator of the string (last_symbol). */
-        char *next_symbol = g_utf8_next_char(possible_currency_symbol), *last_symbol = next_symbol;
-        while(*last_symbol)
-          last_symbol = g_utf8_next_char(last_symbol);
+        {
+            if (g_unichar_type(g_utf8_get_char(possible_currency_symbol)) == G_UNICODE_CURRENCY_SYMBOL)
+            {
+                /* If we find a currency symbol, save the position just ahead
+                 * of the currency symbol (next_symbol), and find the null
+                 * terminator of the string (last_symbol). */
+                char *next_symbol = g_utf8_next_char(possible_currency_symbol), *last_symbol = next_symbol;
+                while (*last_symbol)
+                    last_symbol = g_utf8_next_char(last_symbol);
 
-        /* Move all of the string (including the null byte, which is
-         * why we have +1 in the size parameter) following the
-         * currency symbol back one character, thereby overwriting the
-         * currency symbol. */
-        memmove(possible_currency_symbol, next_symbol, last_symbol - next_symbol + 1);
-        break;
-      }
-    }
+                /* Move all of the string (including the null byte, which is
+                 * why we have +1 in the size parameter) following the
+                 * currency symbol back one character, thereby overwriting the
+                 * currency symbol. */
+                memmove(possible_currency_symbol, next_symbol, last_symbol - next_symbol + 1);
+                break;
+            }
+        }
 
-    /* Translate the string (now clean of currency symbols) into a number. */
-    value = strtod(str_dupe, &endptr);
+        /* Translate the string (now clean of currency symbols) into a number. */
+        value = strtod(str_dupe, &endptr);
 
-    /* If this isn't a valid numeric string, this is an error. */
-    if(endptr != str_dupe + strlen(str_dupe))
-    {
-      g_free(str_dupe);
-      return FALSE;
-    }
+        /* If this isn't a valid numeric string, this is an error. */
+        if (endptr != str_dupe + strlen(str_dupe))
+        {
+            g_free(str_dupe);
+            return FALSE;
+        }
 
-    g_free(str_dupe);
+        g_free(str_dupe);
 
-    if(abs(value) > 0.00001)
-    {
-      prop->value = g_new(gnc_numeric, 1);
-      *((gnc_numeric*)(prop->value)) =
-        double_to_gnc_numeric(value, xaccAccountGetCommoditySCU(prop->list->account),
-                              GNC_RND_ROUND);
+        if (abs(value) > 0.00001)
+        {
+            prop->value = g_new(gnc_numeric, 1);
+            *((gnc_numeric*)(prop->value)) =
+            double_to_gnc_numeric(value, xaccAccountGetCommoditySCU(prop->list->account),
+            GNC_RND_ROUND);
+        }
+        return TRUE;
     }
-    return TRUE;
-  }
-  return FALSE; /* We should never actually get here. */
+    return FALSE; /* We should never actually get here. */
 }
 
 /** Constructor for TransPropertyList.
@@ -700,11 +703,11 @@
  */
 static TransPropertyList* trans_property_list_new(Account* account, int date_format)
 {
-  TransPropertyList* list = g_new(TransPropertyList, 1);
-  list->account = account;
-  list->date_format = date_format;
-  list->properties = NULL;
-  return list;
+    TransPropertyList* list = g_new(TransPropertyList, 1);
+    list->account = account;
+    list->date_format = date_format;
+    list->properties = NULL;
+    return list;
 }
 
 /** Destructor for TransPropertyList.
@@ -712,15 +715,15 @@
  */
 static void trans_property_list_free(TransPropertyList* list)
 {
-  /* Free all of the properties in this list before freeeing the list itself. */
-  GList* properties_begin = list->properties;
-  while(list->properties != NULL)
-  {
-    trans_property_free((TransProperty*)(list->properties->data));
-    list->properties = g_list_next(list->properties);
-  }
-  g_list_free(properties_begin);
-  g_free(list);
+    /* Free all of the properties in this list before freeeing the list itself. */
+    GList* properties_begin = list->properties;
+    while (list->properties != NULL)
+    {
+        trans_property_free((TransProperty*)(list->properties->data));
+        list->properties = g_list_next(list->properties);
+    }
+    g_list_free(properties_begin);
+    g_free(list);
 }
 
 /** Adds a property to the list it's linked with.
@@ -730,7 +733,7 @@
  */
 static void trans_property_list_add(TransProperty* property)
 {
-  property->list->properties = g_list_append(property->list->properties, property);
+    property->list->properties = g_list_append(property->list->properties, property);
 }
 
 /** Adds a split to a transaction.
@@ -740,14 +743,14 @@
  * @param amount The amount of the split
  */
 static void trans_add_split(Transaction* trans, Account* account, QofBook* book,
-                            gnc_numeric amount)
+gnc_numeric amount)
 {
-  Split* split = xaccMallocSplit(book);
-  xaccSplitSetAccount(split, account);
-  xaccSplitSetParent(split, trans);
-  xaccSplitSetAmount(split, amount);
-  xaccSplitSetValue(split, amount);
-  xaccSplitSetAction(split, "Deposit");
+    Split* split = xaccMallocSplit(book);
+    xaccSplitSetAccount(split, account);
+    xaccSplitSetParent(split, trans);
+    xaccSplitSetAmount(split, amount);
+    xaccSplitSetValue(split, amount);
+    xaccSplitSetAction(split, "Deposit");
 }
 
 /** Tests a TransPropertyList for having enough essential properties.
@@ -759,85 +762,87 @@
  */
 static gboolean trans_property_list_verify_essentials(TransPropertyList* list, gchar** error)
 {
-  int i;
-  /* possible_errors lists the ways in which a list can fail this test. */
-  enum PossibleErrorTypes {NO_DATE, NO_AMOUNT, NUM_OF_POSSIBLE_ERRORS};
-  gchar* possible_errors[NUM_OF_POSSIBLE_ERRORS] = {N_("No date column."),
-                                                    N_("No balance, deposit, or withdrawal column.")};
-  int possible_error_lengths[NUM_OF_POSSIBLE_ERRORS] = {0};
-  GList *properties_begin = list->properties, *errors_list = NULL;
+    int i;
+    /* possible_errors lists the ways in which a list can fail this test. */
+    enum PossibleErrorTypes {NO_DATE, NO_AMOUNT, NUM_OF_POSSIBLE_ERRORS};
+    gchar* possible_errors[NUM_OF_POSSIBLE_ERRORS] = {
+        N_("No date column."),
+        N_("No balance, deposit, or withdrawal column.")
+    };
+    int possible_error_lengths[NUM_OF_POSSIBLE_ERRORS] = {0};
+    GList *properties_begin = list->properties, *errors_list = NULL;
 
-  /* Go through each of the properties and erase possible errors. */
-  while(list->properties)
-  {
-    switch(((TransProperty*)(list->properties->data))->type)
+    /* Go through each of the properties and erase possible errors. */
+    while (list->properties)
     {
-    case GNC_CSV_DATE:
-      possible_errors[NO_DATE] = NULL;
-      break;
+        switch (((TransProperty*)(list->properties->data))->type)
+        {
+        case GNC_CSV_DATE:
+            possible_errors[NO_DATE] = NULL;
+            break;
 
-    case GNC_CSV_BALANCE:
-    case GNC_CSV_DEPOSIT:
-    case GNC_CSV_WITHDRAWAL:
-      possible_errors[NO_AMOUNT] = NULL;
-      break;
+        case GNC_CSV_BALANCE:
+        case GNC_CSV_DEPOSIT:
+        case GNC_CSV_WITHDRAWAL:
+            possible_errors[NO_AMOUNT] = NULL;
+            break;
+        }
+        list->properties = g_list_next(list->properties);
     }
-    list->properties = g_list_next(list->properties);
-  }
-  list->properties = properties_begin;
+    list->properties = properties_begin;
 
-  /* Accumulate a list of the actual errors. */
-  for(i = 0; i < NUM_OF_POSSIBLE_ERRORS; i++)
-  {
-    if(possible_errors[i] != NULL)
+    /* Accumulate a list of the actual errors. */
+    for (i = 0; i < NUM_OF_POSSIBLE_ERRORS; i++)
     {
-      errors_list = g_list_append(errors_list, GINT_TO_POINTER(i));
-      /* Since we added an error, we want to also store its length for
-       * when we construct the full error string. */
-      possible_error_lengths[i] = strlen(_(possible_errors[i]));
+        if (possible_errors[i] != NULL)
+        {
+            errors_list = g_list_append(errors_list, GINT_TO_POINTER(i));
+            /* Since we added an error, we want to also store its length for
+             * when we construct the full error string. */
+            possible_error_lengths[i] = strlen(_(possible_errors[i]));
+        }
     }
-  }
 
-  /* If there are no errors, we can quit now. */
-  if(errors_list == NULL)
-    return TRUE;
-  else
-  {
-    /* full_error_size is the full length of the error message. */
-    int full_error_size = 0, string_length = 0;
-    GList* errors_list_begin = errors_list;
-    gchar *error_message, *error_message_begin;
-
-    /* Find the value for full_error_size. */
-    while(errors_list)
+    /* If there are no errors, we can quit now. */
+    if (errors_list == NULL)
+        return TRUE;
+    else
     {
-      /* We add an extra 1 to account for spaces in between messages. */
-      full_error_size += possible_error_lengths[GPOINTER_TO_INT(errors_list->data)] + 1;
-      errors_list = g_list_next(errors_list);
-    }
-    errors_list = errors_list_begin;
+        /* full_error_size is the full length of the error message. */
+        int full_error_size = 0, string_length = 0;
+        GList* errors_list_begin = errors_list;
+        gchar *error_message, *error_message_begin;
 
-    /* Append the error messages one after another. */
-    error_message = error_message_begin = g_new(gchar, full_error_size);
-    while(errors_list)
-    {
-      i = GPOINTER_TO_INT(errors_list->data);
-      string_length = possible_error_lengths[i];
-      
-      /* Copy the error message and put a space after it. */
-      strncpy(error_message, _(possible_errors[i]), string_length);
-      error_message += string_length;
-      *error_message = ' ';
-      error_message++;
-      
-      errors_list = g_list_next(errors_list);
+        /* Find the value for full_error_size. */
+        while (errors_list)
+        {
+            /* We add an extra 1 to account for spaces in between messages. */
+            full_error_size += possible_error_lengths[GPOINTER_TO_INT(errors_list->data)] + 1;
+            errors_list = g_list_next(errors_list);
+        }
+        errors_list = errors_list_begin;
+
+        /* Append the error messages one after another. */
+        error_message = error_message_begin = g_new(gchar, full_error_size);
+        while (errors_list)
+        {
+            i = GPOINTER_TO_INT(errors_list->data);
+            string_length = possible_error_lengths[i];
+
+            /* Copy the error message and put a space after it. */
+            strncpy(error_message, _(possible_errors[i]), string_length);
+            error_message += string_length;
+            *error_message = ' ';
+            error_message++;
+
+            errors_list = g_list_next(errors_list);
+        }
+        *error_message = '\0'; /* Replace the last space with the null byte. */
+        g_list_free(errors_list_begin);
+
+        *error = error_message_begin;
+        return FALSE;
     }
-    *error_message = '\0'; /* Replace the last space with the null byte. */
-    g_list_free(errors_list_begin);
-
-    *error = error_message_begin;
-    return FALSE;
-  }
 }
 
 /** Create a Transaction from a TransPropertyList.
@@ -847,98 +852,98 @@
  */
 static GncCsvTransLine* trans_property_list_to_trans(TransPropertyList* list, gchar** error)
 {
-  GncCsvTransLine* trans_line = g_new(GncCsvTransLine, 1);
-  GList* properties_begin = list->properties;
-  QofBook* book = gnc_account_get_book(list->account);
-  gnc_commodity* currency = xaccAccountGetCommodity(list->account);
-  gnc_numeric amount = double_to_gnc_numeric(0.0, xaccAccountGetCommoditySCU(list->account),
-                                             GNC_RND_ROUND);
+    GncCsvTransLine* trans_line = g_new(GncCsvTransLine, 1);
+    GList* properties_begin = list->properties;
+    QofBook* book = gnc_account_get_book(list->account);
+    gnc_commodity* currency = xaccAccountGetCommodity(list->account);
+    gnc_numeric amount = double_to_gnc_numeric(0.0, xaccAccountGetCommoditySCU(list->account),
+    GNC_RND_ROUND);
 
-  /* This flag is set to TRUE if we can use the "Deposit" or "Withdrawal" column. */
-  gboolean amount_set = FALSE;
+    /* This flag is set to TRUE if we can use the "Deposit" or "Withdrawal" column. */
+    gboolean amount_set = FALSE;
 
-  /* The balance is 0 by default. */
-  trans_line->balance_set = FALSE;
-  trans_line->balance = amount;
+    /* The balance is 0 by default. */
+    trans_line->balance_set = FALSE;
+    trans_line->balance = amount;
 
-  /* We make the line_no -1 just to mark that it hasn't been set. We
-   * may get rid of line_no soon anyway, so it's not particularly
-   * important. */
-  trans_line->line_no = -1;
+    /* We make the line_no -1 just to mark that it hasn't been set. We
+     * may get rid of line_no soon anyway, so it's not particularly
+     * important. */
+    trans_line->line_no = -1;
 
-  /* Make sure this is a transaction with all the columns we need. */
-  if(!trans_property_list_verify_essentials(list, error))
-  {
-    g_free(trans_line);
-    return NULL;
-  }
+    /* Make sure this is a transaction with all the columns we need. */
+    if (!trans_property_list_verify_essentials(list, error))
+    {
+        g_free(trans_line);
+        return NULL;
+    }
 
-  trans_line->trans = xaccMallocTransaction(book);
-  xaccTransBeginEdit(trans_line->trans);
-  xaccTransSetCurrency(trans_line->trans, currency);
+    trans_line->trans = xaccMallocTransaction(book);
+    xaccTransBeginEdit(trans_line->trans);
+    xaccTransSetCurrency(trans_line->trans, currency);
 
-  /* Go through each of the properties and edit the transaction accordingly. */
-  list->properties = properties_begin;
-  while(list->properties != NULL)
-  {
-    TransProperty* prop = (TransProperty*)(list->properties->data);
-    switch(prop->type)
+    /* Go through each of the properties and edit the transaction accordingly. */
+    list->properties = properties_begin;
+    while (list->properties != NULL)
     {
-    case GNC_CSV_DATE:
-      xaccTransSetDatePostedSecs(trans_line->trans, *((time_t*)(prop->value)));
-      break;
+        TransProperty* prop = (TransProperty*)(list->properties->data);
+        switch (prop->type)
+        {
+        case GNC_CSV_DATE:
+            xaccTransSetDatePostedSecs(trans_line->trans, *((time_t*)(prop->value)));
+            break;
 
-    case GNC_CSV_DESCRIPTION:
-      xaccTransSetDescription(trans_line->trans, (char*)(prop->value));
-      break;
+        case GNC_CSV_DESCRIPTION:
+            xaccTransSetDescription(trans_line->trans, (char*)(prop->value));
+            break;
 
-    case GNC_CSV_NUM:
-      xaccTransSetNum(trans_line->trans, (char*)(prop->value));
-      break;
+        case GNC_CSV_NUM:
+            xaccTransSetNum(trans_line->trans, (char*)(prop->value));
+            break;
 
-    case GNC_CSV_DEPOSIT: /* Add deposits to the existing amount. */
-      if(prop->value != NULL)
-      {
-        amount = gnc_numeric_add(*((gnc_numeric*)(prop->value)),
-                                 amount,
-                                 xaccAccountGetCommoditySCU(list->account),
-                                 GNC_RND_ROUND);
-        amount_set = TRUE;
-        /* We will use the "Deposit" and "Withdrawal" columns in preference to "Balance". */
-        trans_line->balance_set = FALSE;
-      }
-      break;
+        case GNC_CSV_DEPOSIT: /* Add deposits to the existing amount. */
+            if (prop->value != NULL)
+            {
+                amount = gnc_numeric_add(*((gnc_numeric*)(prop->value)),
+                amount,
+                xaccAccountGetCommoditySCU(list->account),
+                GNC_RND_ROUND);
+                amount_set = TRUE;
+                /* We will use the "Deposit" and "Withdrawal" columns in preference to "Balance". */
+                trans_line->balance_set = FALSE;
+            }
+            break;
 
-    case GNC_CSV_WITHDRAWAL: /* Withdrawals are just negative deposits. */
-      if(prop->value != NULL)
-      {
-        amount = gnc_numeric_add(gnc_numeric_neg(*((gnc_numeric*)(prop->value))),
-                                 amount,
-                                 xaccAccountGetCommoditySCU(list->account),
-                                 GNC_RND_ROUND);
-        amount_set = TRUE;
-        /* We will use the "Deposit" and "Withdrawal" columns in preference to "Balance". */
-        trans_line->balance_set = FALSE;
-      }
-      break;
+        case GNC_CSV_WITHDRAWAL: /* Withdrawals are just negative deposits. */
+            if (prop->value != NULL)
+            {
+                amount = gnc_numeric_add(gnc_numeric_neg(*((gnc_numeric*)(prop->value))),
+                amount,
+                xaccAccountGetCommoditySCU(list->account),
+                GNC_RND_ROUND);
+                amount_set = TRUE;
+                /* We will use the "Deposit" and "Withdrawal" columns in preference to "Balance". */
+                trans_line->balance_set = FALSE;
+            }
+            break;
 
-    case GNC_CSV_BALANCE: /* The balance gets stored in a separate field in trans_line. */
-      /* We will use the "Deposit" and "Withdrawal" columns in preference to "Balance". */
-      if(!amount_set && prop->value != NULL)
-      {
-        /* This gets put into the actual transaction at the end of gnc_csv_parse_to_trans. */
-        trans_line->balance = *((gnc_numeric*)(prop->value));
-        trans_line->balance_set = TRUE;
-      }
-      break;
+        case GNC_CSV_BALANCE: /* The balance gets stored in a separate field in trans_line. */
+            /* We will use the "Deposit" and "Withdrawal" columns in preference to "Balance". */
+            if (!amount_set && prop->value != NULL)
+            {
+                /* This gets put into the actual transaction at the end of gnc_csv_parse_to_trans. */
+                trans_line->balance = *((gnc_numeric*)(prop->value));
+                trans_line->balance_set = TRUE;
+            }
+            break;
+        }
+        list->properties = g_list_next(list->properties);
     }
-    list->properties = g_list_next(list->properties);
-  }
 
-  /* Add a split with the cumulative amount value. */
-  trans_add_split(trans_line->trans, list->account, book, amount);
+    /* Add a split with the cumulative amount value. */
+    trans_add_split(trans_line->trans, list->account, book, amount);
 
-  return trans_line;
+    return trans_line;
 }
 
 /** Creates a list of transactions from parsed data. Transactions that
@@ -952,257 +957,257 @@
  * @return 0 on success, 1 on failure
  */
 int gnc_csv_parse_to_trans(GncCsvParseData* parse_data, Account* account,
-                           gboolean redo_errors)
+gboolean redo_errors)
 {
-  gboolean hasBalanceColumn;
-  int i, j, max_cols = 0;
-  GArray* column_types = parse_data->column_types;
-  GList *error_lines = NULL, *begin_error_lines = NULL;
+    gboolean hasBalanceColumn;
+    int i, j, max_cols = 0;
+    GArray* column_types = parse_data->column_types;
+    GList *error_lines = NULL, *begin_error_lines = NULL;
 
-  /* last_transaction points to the last element in
-   * parse_data->transactions, or NULL if it's empty. */
-  GList* last_transaction = NULL;
+    /* last_transaction points to the last element in
+     * parse_data->transactions, or NULL if it's empty. */
+    GList* last_transaction = NULL;
 
-  /* Free parse_data->error_lines and parse_data->transactions if they
-   * already exist. */
-  if(redo_errors) /* If we're redoing errors, we save freeing until the end. */
-  {
-    begin_error_lines = error_lines = parse_data->error_lines;
-  }
-  else
-  {
-    if(parse_data->error_lines != NULL)
+    /* Free parse_data->error_lines and parse_data->transactions if they
+     * already exist. */
+    if (redo_errors) /* If we're redoing errors, we save freeing until the end. */
     {
-      g_list_free(parse_data->error_lines);
+        begin_error_lines = error_lines = parse_data->error_lines;
     }
-    if(parse_data->transactions != NULL)
-    {
-      g_list_free(parse_data->transactions);
-    }
-  }
-  parse_data->error_lines = NULL;
-
-  if(redo_errors) /* If we're looking only at error data ... */
-  {
-    if(parse_data->transactions == NULL)
-    {
-      last_transaction = NULL;
-    }
     else
     {
-      /* Move last_transaction to the end. */
-      last_transaction = parse_data->transactions;
-      while(g_list_next(last_transaction) != NULL)
-      {
-        last_transaction = g_list_next(last_transaction);
-      }
+        if (parse_data->error_lines != NULL)
+        {
+            g_list_free(parse_data->error_lines);
+        }
+        if (parse_data->transactions != NULL)
+        {
+            g_list_free(parse_data->transactions);
+        }
     }
-    /* ... we use only the lines in error_lines. */
-    if(error_lines == NULL)
-      i = parse_data->orig_lines->len; /* Don't go into the for loop. */
-    else
-      i = GPOINTER_TO_INT(error_lines->data);
-  }
-  else /* Otherwise, we look at all the data. */
-  {
-    /* The following while-loop effectively behaves like the following for-loop:
-     * for(i = 0; i < parse_data->orig_lines->len; i++). */
-    i = 0;
-    last_transaction = NULL;
-  }
-  while(i < parse_data->orig_lines->len)
-  {
-    GPtrArray* line = parse_data->orig_lines->pdata[i];
-    /* This flag is TRUE if there are any errors in this row. */
-    gboolean errors = FALSE;
-    gchar* error_message = NULL;
-    TransPropertyList* list = trans_property_list_new(account, parse_data->date_format);
-    GncCsvTransLine* trans_line = NULL;
+    parse_data->error_lines = NULL;
 
-    for(j = 0; j < line->len; j++)
+    if (redo_errors) /* If we're looking only at error data ... */
     {
-      /* We do nothing in "None" columns. */
-      if(column_types->data[j] != GNC_CSV_NONE)
-      {
-        /* Affect the transaction appropriately. */
-        TransProperty* property = trans_property_new(column_types->data[j], list);
-        gboolean succeeded = trans_property_set(property, line->pdata[j]);
-        /* TODO Maybe move error handling to within TransPropertyList functions? */
-        if(succeeded)
+        if (parse_data->transactions == NULL)
         {
-          trans_property_list_add(property);
+            last_transaction = NULL;
         }
         else
         {
-          errors = TRUE;
-          error_message = g_strdup_printf(_("%s column could not be understood."),
-                                          _(gnc_csv_column_type_strs[property->type]));
-          trans_property_free(property);
-          break;
+            /* Move last_transaction to the end. */
+            last_transaction = parse_data->transactions;
+            while (g_list_next(last_transaction) != NULL)
+            {
+                last_transaction = g_list_next(last_transaction);
+            }
         }
-      }
+        /* ... we use only the lines in error_lines. */
+        if (error_lines == NULL)
+            i = parse_data->orig_lines->len; /* Don't go into the for loop. */
+        else
+            i = GPOINTER_TO_INT(error_lines->data);
     }
-
-    /* If we had success, add the transaction to parse_data->transaction. */
-    if(!errors)
+    else /* Otherwise, we look at all the data. */
     {
-      trans_line = trans_property_list_to_trans(list, &error_message);
-      errors = trans_line == NULL;
+        /* The following while-loop effectively behaves like the following for-loop:
+         * for(i = 0; i < parse_data->orig_lines->len; i++). */
+        i = 0;
+        last_transaction = NULL;
     }
+    while (i < parse_data->orig_lines->len)
+    {
+        GPtrArray* line = parse_data->orig_lines->pdata[i];
+        /* This flag is TRUE if there are any errors in this row. */
+        gboolean errors = FALSE;
+        gchar* error_message = NULL;
+        TransPropertyList* list = trans_property_list_new(account, parse_data->date_format);
+        GncCsvTransLine* trans_line = NULL;
 
-    trans_property_list_free(list);
+        for (j = 0; j < line->len; j++)
+        {
+            /* We do nothing in "None" columns. */
+            if (column_types->data[j] != GNC_CSV_NONE)
+            {
+                /* Affect the transaction appropriately. */
+                TransProperty* property = trans_property_new(column_types->data[j], list);
+                gboolean succeeded = trans_property_set(property, line->pdata[j]);
+                /* TODO Maybe move error handling to within TransPropertyList functions? */
+                if (succeeded)
+                {
+                    trans_property_list_add(property);
+                }
+                else
+                {
+                    errors = TRUE;
+                    error_message = g_strdup_printf(_("%s column could not be understood."),
+                    _(gnc_csv_column_type_strs[property->type]));
+                    trans_property_free(property);
+                    break;
+                }
+            }
+        }
 
-    /* If there were errors, add this line to parse_data->error_lines. */
-    if(errors)
-    {
-      parse_data->error_lines = g_list_append(parse_data->error_lines,
-                                              GINT_TO_POINTER(i));
-      /* If there's already an error message, we need to replace it. */
-      if(line->len > (int)(parse_data->orig_row_lengths->data[i]))
-      {
-        g_free(line->pdata[line->len - 1]);
-        line->pdata[line->len - 1] = error_message;
-      }
-      else
-      {
-        /* Put the error message at the end of the line. */
-        g_ptr_array_add(line, error_message);
-      }
-    }
-    else
-    {
-      /* If all went well, add this transaction to the list. */
-      trans_line->line_no = i;
+        /* If we had success, add the transaction to parse_data->transaction. */
+        if (!errors)
+        {
+            trans_line = trans_property_list_to_trans(list, &error_message);
+            errors = trans_line == NULL;
+        }
 
-      /* We keep the transactions sorted by date. We start at the end
-       * of the list and go backward, simply because the file itself
-       * is probably also sorted by date (but we need to handle the
-       * exception anyway). */
+        trans_property_list_free(list);
 
-      /* If we can just put it at the end, do so and increment last_transaction. */
-      if(last_transaction == NULL ||
-         xaccTransGetDate(((GncCsvTransLine*)(last_transaction->data))->trans) <= xaccTransGetDate(trans_line->trans))
-      {
-        parse_data->transactions = g_list_append(parse_data->transactions, trans_line);
-        /* If this is the first transaction, we need to get last_transaction on track. */
-        if(last_transaction == NULL)
-          last_transaction = parse_data->transactions;
-        else /* Otherwise, we can just continue. */
-          last_transaction = g_list_next(last_transaction);
-      }
-      /* Otherwise, search backward for the correct spot. */
-      else
-      {
-        GList* insertion_spot = last_transaction;
-        while(insertion_spot != NULL &&
-              xaccTransGetDate(((GncCsvTransLine*)(insertion_spot->data))->trans) > xaccTransGetDate(trans_line->trans))
+        /* If there were errors, add this line to parse_data->error_lines. */
+        if (errors)
         {
-          insertion_spot = g_list_previous(insertion_spot);
+            parse_data->error_lines = g_list_append(parse_data->error_lines,
+            GINT_TO_POINTER(i));
+            /* If there's already an error message, we need to replace it. */
+            if (line->len > (int)(parse_data->orig_row_lengths->data[i]))
+            {
+                g_free(line->pdata[line->len - 1]);
+                line->pdata[line->len - 1] = error_message;
+            }
+            else
+            {
+                /* Put the error message at the end of the line. */
+                g_ptr_array_add(line, error_message);
+            }
         }
-        /* Move insertion_spot one location forward since we have to
-         * use the g_list_insert_before function. */
-        if(insertion_spot == NULL) /* We need to handle the case of inserting at the beginning of the list. */
-          insertion_spot = parse_data->transactions;
         else
-          insertion_spot = g_list_next(insertion_spot);
-        
-        parse_data->transactions = g_list_insert_before(parse_data->transactions, insertion_spot, trans_line);
-      }
+        {
+            /* If all went well, add this transaction to the list. */
+            trans_line->line_no = i;
+
+            /* We keep the transactions sorted by date. We start at the end
+             * of the list and go backward, simply because the file itself
+             * is probably also sorted by date (but we need to handle the
+             * exception anyway). */
+
+            /* If we can just put it at the end, do so and increment last_transaction. */
+            if (last_transaction == NULL ||
+            xaccTransGetDate(((GncCsvTransLine*)(last_transaction->data))->trans) <= xaccTransGetDate(trans_line->trans))
+            {
+                parse_data->transactions = g_list_append(parse_data->transactions, trans_line);
+                /* If this is the first transaction, we need to get last_transaction on track. */
+                if (last_transaction == NULL)
+                    last_transaction = parse_data->transactions;
+                else /* Otherwise, we can just continue. */
+                    last_transaction = g_list_next(last_transaction);
+            }
+            /* Otherwise, search backward for the correct spot. */
+            else
+            {
+                GList* insertion_spot = last_transaction;
+                while (insertion_spot != NULL &&
+                xaccTransGetDate(((GncCsvTransLine*)(insertion_spot->data))->trans) > xaccTransGetDate(trans_line->trans))
+                {
+                    insertion_spot = g_list_previous(insertion_spot);
+                }
+                /* Move insertion_spot one location forward since we have to
+                 * use the g_list_insert_before function. */
+                if (insertion_spot == NULL) /* We need to handle the case of inserting at the beginning of the list. */
+                    insertion_spot = parse_data->transactions;
+                else
+                    insertion_spot = g_list_next(insertion_spot);
+
+                parse_data->transactions = g_list_insert_before(parse_data->transactions, insertion_spot, trans_line);
+            }
+        }
+
+        /* Increment to the next row. */
+        if (redo_errors)
+        {
+            /* Move to the next error line in the list. */
+            error_lines = g_list_next(error_lines);
+            if (error_lines == NULL)
+                i = parse_data->orig_lines->len; /* Don't continue the for loop. */
+            else
+                i = GPOINTER_TO_INT(error_lines->data);
+        }
+        else
+        {
+            i++;
+        }
     }
 
-    /* Increment to the next row. */
-    if(redo_errors)
+    /* If we have a balance column, set the appropriate amounts on the transactions. */
+    hasBalanceColumn = FALSE;
+    for (i = 0; i < parse_data->column_types->len; i++)
     {
-      /* Move to the next error line in the list. */
-      error_lines = g_list_next(error_lines);
-      if(error_lines == NULL)
-        i = parse_data->orig_lines->len; /* Don't continue the for loop. */
-      else
-        i = GPOINTER_TO_INT(error_lines->data);
+        if (parse_data->column_types->data[i] == GNC_CSV_BALANCE)
+        {
+            hasBalanceColumn = TRUE;
+            break;
+        }
     }
-    else
-    {
-      i++;
-    }
-  }
 
-  /* If we have a balance column, set the appropriate amounts on the transactions. */
-  hasBalanceColumn = FALSE;
-  for(i = 0; i < parse_data->column_types->len; i++)
-  {
-    if(parse_data->column_types->data[i] == GNC_CSV_BALANCE)
+    if (hasBalanceColumn)
     {
-      hasBalanceColumn = TRUE;
-      break;
-    }
-  }
+        GList* transactions = parse_data->transactions;
 
-  if(hasBalanceColumn)
-  {
-    GList* transactions = parse_data->transactions;
+        /* balance_offset is how much the balance currently in the account
+         * differs from what it will be after the transactions are
+         * imported. This will be sum of all the previous transactions for
+         * any given transaction. */
+        gnc_numeric balance_offset = double_to_gnc_numeric(0.0,
+        xaccAccountGetCommoditySCU(account),
+        GNC_RND_ROUND);
+        while (transactions != NULL)
+        {
+            GncCsvTransLine* trans_line = (GncCsvTransLine*)transactions->data;
+            if (trans_line->balance_set)
+            {
+                time_t date = xaccTransGetDate(trans_line->trans);
+                /* Find what the balance should be by adding the offset to the actual balance. */
+                gnc_numeric existing_balance = gnc_numeric_add(balance_offset,
+                xaccAccountGetBalanceAsOfDate(account, date),
+                xaccAccountGetCommoditySCU(account),
+                GNC_RND_ROUND);
 
-    /* balance_offset is how much the balance currently in the account
-     * differs from what it will be after the transactions are
-     * imported. This will be sum of all the previous transactions for
-     * any given transaction. */
-    gnc_numeric balance_offset = double_to_gnc_numeric(0.0,
-                                                       xaccAccountGetCommoditySCU(account),
-                                                       GNC_RND_ROUND);
-    while(transactions != NULL)
-    {
-      GncCsvTransLine* trans_line = (GncCsvTransLine*)transactions->data;
-      if(trans_line->balance_set)
-      {
-        time_t date = xaccTransGetDate(trans_line->trans);
-        /* Find what the balance should be by adding the offset to the actual balance. */
-        gnc_numeric existing_balance = gnc_numeric_add(balance_offset,
-                                                       xaccAccountGetBalanceAsOfDate(account, date),
-                                                       xaccAccountGetCommoditySCU(account),
-                                                       GNC_RND_ROUND);
+                /* The amount of the transaction is the difference between the new and existing balance. */
+                gnc_numeric amount = gnc_numeric_sub(trans_line->balance,
+                existing_balance,
+                xaccAccountGetCommoditySCU(account),
+                GNC_RND_ROUND);
 
-        /* The amount of the transaction is the difference between the new and existing balance. */
-        gnc_numeric amount = gnc_numeric_sub(trans_line->balance,
-                                             existing_balance,
-                                             xaccAccountGetCommoditySCU(account),
-                                             GNC_RND_ROUND);
+                SplitList* splits = xaccTransGetSplitList(trans_line->trans);
+                while (splits)
+                {
+                    SplitList* next_splits = g_list_next(splits);
+                    xaccSplitDestroy((Split*)splits->data);
+                    splits = next_splits;
+                }
 
-        SplitList* splits = xaccTransGetSplitList(trans_line->trans);
-        while(splits)
-        {
-          SplitList* next_splits = g_list_next(splits);
-          xaccSplitDestroy((Split*)splits->data);
-          splits = next_splits;
+                trans_add_split(trans_line->trans, account, gnc_account_get_book(account), amount);
+
+                /* This new transaction needs to be added to the balance offset. */
+                balance_offset = gnc_numeric_add(balance_offset,
+                amount,
+                xaccAccountGetCommoditySCU(account),
+                GNC_RND_ROUND);
+            }
+            transactions = g_list_next(transactions);
         }
+    }
 
-        trans_add_split(trans_line->trans, account, gnc_account_get_book(account), amount);
-        
-        /* This new transaction needs to be added to the balance offset. */
-        balance_offset = gnc_numeric_add(balance_offset,
-                                         amount,
-                                         xaccAccountGetCommoditySCU(account),
-                                         GNC_RND_ROUND);
-      }
-      transactions = g_list_next(transactions);
+    if (redo_errors) /* Now that we're at the end, we do the freeing. */
+    {
+        g_list_free(begin_error_lines);
     }
-  }
 
-  if(redo_errors) /* Now that we're at the end, we do the freeing. */
-  {
-    g_list_free(begin_error_lines);
-  }
+    /* We need to resize parse_data->column_types since errors may have added columns. */
+    for (i = 0; i < parse_data->orig_lines->len; i++)
+    {
+        if (max_cols < ((GPtrArray*)(parse_data->orig_lines->pdata[i]))->len)
+            max_cols = ((GPtrArray*)(parse_data->orig_lines->pdata[i]))->len;
+    }
+    i = parse_data->column_types->len;
+    parse_data->column_types = g_array_set_size(parse_data->column_types, max_cols);
+    for (; i < max_cols; i++)
+    {
+        parse_data->column_types->data[i] = GNC_CSV_NONE;
+    }
 
-  /* We need to resize parse_data->column_types since errors may have added columns. */
-  for(i = 0; i < parse_data->orig_lines->len; i++)
-  {
-    if(max_cols < ((GPtrArray*)(parse_data->orig_lines->pdata[i]))->len)
-      max_cols = ((GPtrArray*)(parse_data->orig_lines->pdata[i]))->len;
-  }
-  i = parse_data->column_types->len;
-  parse_data->column_types = g_array_set_size(parse_data->column_types, max_cols);
-  for(; i < max_cols; i++)
-  {
-    parse_data->column_types->data[i] = GNC_CSV_NONE;
-  }
-
-  return 0;
+    return 0;
 }

Modified: gnucash/trunk/src/import-export/csv/gnc-csv-model.h
===================================================================
--- gnucash/trunk/src/import-export/csv/gnc-csv-model.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/csv/gnc-csv-model.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -45,21 +45,23 @@
                        GNC_CSV_DEPOSIT,
                        GNC_CSV_WITHDRAWAL,
                        GNC_CSV_NUM,
-                       GNC_CSV_NUM_COL_TYPES};
+                       GNC_CSV_NUM_COL_TYPES
+                      };
 
 /** Enumeration for error types. These are the different types of
  * errors that various functions used for the CSV/Fixed-Width importer
  * can have. */
 enum GncCsvErrorType {GNC_CSV_FILE_OPEN_ERR,
-                      GNC_CSV_ENCODING_ERR};
+                      GNC_CSV_ENCODING_ERR
+                     };
 
 /** Struct for containing a string. This struct simply contains
  * pointers to the beginning and end of a string. We need this because
  * the STF code that gnc_csv_parse calls requires these pointers. */
 typedef struct
 {
-  char* begin;
-  char* end;
+    char* begin;
+    char* end;
 } GncCsvStr;
 
 /* TODO We now sort transactions by date, not line number, so we
@@ -74,10 +76,10 @@
  * corrected rows into the right places. */
 typedef struct
 {
-  int line_no;
-  Transaction* trans;
-  gnc_numeric balance; /**< The (supposed) balance after this transaction takes place */
-  gboolean balance_set; /**< TRUE if balance has been set from user data, FALSE otherwise */
+    int line_no;
+    Transaction* trans;
+    gnc_numeric balance; /**< The (supposed) balance after this transaction takes place */
+    gboolean balance_set; /**< TRUE if balance has been set from user data, FALSE otherwise */
 } GncCsvTransLine;
 
 extern const int num_date_formats;
@@ -90,20 +92,20 @@
 /** Struct containing data for parsing a CSV/Fixed-Width file. */
 typedef struct
 {
-  gchar* encoding;
-  GMappedFile* raw_mapping; /**< The mapping containing raw_str */
-  GncCsvStr raw_str; /**< Untouched data from the file as a string */
-  GncCsvStr file_str; /**< raw_str translated into UTF-8 */
-  GPtrArray* orig_lines; /**< file_str parsed into a two-dimensional array of strings */
-  GArray* orig_row_lengths; /**< The lengths of rows in orig_lines
+    gchar* encoding;
+    GMappedFile* raw_mapping; /**< The mapping containing raw_str */
+    GncCsvStr raw_str; /**< Untouched data from the file as a string */
+    GncCsvStr file_str; /**< raw_str translated into UTF-8 */
+    GPtrArray* orig_lines; /**< file_str parsed into a two-dimensional array of strings */
+    GArray* orig_row_lengths; /**< The lengths of rows in orig_lines
                              * before error messages are appended */
-  int orig_max_row; /**< Holds the maximum value in orig_row_lengths */
-  GStringChunk* chunk; /**< A chunk of memory in which the contents of orig_lines is stored */
-  StfParseOptions_t* options; /**< Options controlling how file_str should be parsed */
-  GArray* column_types; /**< Array of values from the GncCsvColumnType enumeration */
-  GList* error_lines; /**< List of row numbers in orig_lines that have errors */
-  GList* transactions; /**< List of GncCsvTransLine*s created using orig_lines and column_types */
-  int date_format; /**< The format of the text in the date columns from date_format_internal. */
+    int orig_max_row; /**< Holds the maximum value in orig_row_lengths */
+    GStringChunk* chunk; /**< A chunk of memory in which the contents of orig_lines is stored */
+    StfParseOptions_t* options; /**< Options controlling how file_str should be parsed */
+    GArray* column_types; /**< Array of values from the GncCsvColumnType enumeration */
+    GList* error_lines; /**< List of row numbers in orig_lines that have errors */
+    GList* transactions; /**< List of GncCsvTransLine*s created using orig_lines and column_types */
+    int date_format; /**< The format of the text in the date columns from date_format_internal. */
 } GncCsvParseData;
 
 GncCsvParseData* gnc_csv_new_parse_data(void);

Modified: gnucash/trunk/src/import-export/csv/gnc-plugin-csv.c
===================================================================
--- gnucash/trunk/src/import-export/csv/gnc-plugin-csv.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/csv/gnc-plugin-csv.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-csv.c -- 
+/*
+ * gnc-plugin-csv.c --
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -41,16 +41,19 @@
 #define PLUGIN_ACTIONS_NAME "gnc-plugin-csv-actions"
 #define PLUGIN_UI_FILENAME  "gnc-plugin-csv-ui.xml"
 
-static GtkActionEntry gnc_plugin_actions [] = {
-  { "CsvImportAction", GTK_STOCK_CONVERT, N_("Import _CSV/Fixed-Width..."), NULL,
-    N_(" a CSV/Fixed-Width file"),
-    G_CALLBACK (gnc_plugin_csv_cmd_import) },
+static GtkActionEntry gnc_plugin_actions [] =
+{
+    {
+        "CsvImportAction", GTK_STOCK_CONVERT, N_("Import _CSV/Fixed-Width..."), NULL,
+        N_(" a CSV/Fixed-Width file"),
+        G_CALLBACK (gnc_plugin_csv_cmd_import)
+    },
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
 
 typedef struct GncPluginCsvPrivate
 {
-  gpointer dummy;
+    gpointer dummy;
 } GncPluginCsvPrivate;
 
 #define GNC_PLUGIN_CSV_GET_PRIVATE(o)  \
@@ -61,55 +64,57 @@
 GType
 gnc_plugin_csv_get_type (void)
 {
-  static GType gnc_plugin_csv_type = 0;
+    static GType gnc_plugin_csv_type = 0;
 
-  if (gnc_plugin_csv_type == 0) {
-    static const GTypeInfo our_info = {
-		sizeof (GncPluginCsvClass),
-		NULL,		/* base_init */
-		NULL,		/* base_finalize */
-		(GClassInitFunc) gnc_plugin_csv_class_init,
-		NULL,		/* class_finalize */
-		NULL,		/* class_data */
-		sizeof (GncPluginCsv),
-		0,		/* n_preallocs */
-		(GInstanceInitFunc) gnc_plugin_csv_init,
-    };
+    if (gnc_plugin_csv_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginCsvClass),
+            NULL,		/* base_init */
+            NULL,		/* base_finalize */
+            (GClassInitFunc) gnc_plugin_csv_class_init,
+            NULL,		/* class_finalize */
+            NULL,		/* class_data */
+            sizeof (GncPluginCsv),
+            0,		/* n_preallocs */
+            (GInstanceInitFunc) gnc_plugin_csv_init,
+        };
 
-    gnc_plugin_csv_type = g_type_register_static (GNC_TYPE_PLUGIN,
-						  "GncPluginCsv",
-						  &our_info, 0);
-  }
+        gnc_plugin_csv_type = g_type_register_static (GNC_TYPE_PLUGIN,
+                              "GncPluginCsv",
+                              &our_info, 0);
+    }
 
-  return gnc_plugin_csv_type;
+    return gnc_plugin_csv_type;
 }
 
 GncPlugin *
 gnc_plugin_csv_new (void)
 {
-  return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_CSV, NULL));
+    return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_CSV, NULL));
 }
 
 static void
 gnc_plugin_csv_class_init (GncPluginCsvClass *klass)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
 
-  parent_class = g_type_class_peek_parent (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-  object_class->finalize = gnc_plugin_csv_finalize;
+    object_class->finalize = gnc_plugin_csv_finalize;
 
-  /* plugin info */
-  plugin_class->plugin_name  = GNC_PLUGIN_CSV_NAME;
+    /* plugin info */
+    plugin_class->plugin_name  = GNC_PLUGIN_CSV_NAME;
 
-  /* widget addition/removal */
-  plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
-  plugin_class->actions      = gnc_plugin_actions;
-  plugin_class->n_actions    = gnc_plugin_n_actions;
-  plugin_class->ui_filename  = PLUGIN_UI_FILENAME;
+    /* widget addition/removal */
+    plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
+    plugin_class->actions      = gnc_plugin_actions;
+    plugin_class->n_actions    = gnc_plugin_n_actions;
+    plugin_class->ui_filename  = PLUGIN_UI_FILENAME;
 
-  g_type_class_add_private(klass, sizeof(GncPluginCsvPrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginCsvPrivate));
 }
 
 static void
@@ -120,15 +125,15 @@
 static void
 gnc_plugin_csv_finalize (GObject *object)
 {
-  GncPluginCsv *plugin;
-  GncPluginCsvPrivate *priv;
+    GncPluginCsv *plugin;
+    GncPluginCsvPrivate *priv;
 
-  g_return_if_fail (GNC_IS_PLUGIN_CSV (object));
+    g_return_if_fail (GNC_IS_PLUGIN_CSV (object));
 
-  plugin = GNC_PLUGIN_CSV (object);
-  priv = GNC_PLUGIN_CSV_GET_PRIVATE(plugin);
+    plugin = GNC_PLUGIN_CSV (object);
+    priv = GNC_PLUGIN_CSV_GET_PRIVATE(plugin);
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 /************************************************************
@@ -141,9 +146,9 @@
 
 static void
 gnc_plugin_csv_cmd_import (GtkAction *action,
-			   GncMainWindowActionData *data)
+                           GncMainWindowActionData *data)
 {
-  gnc_file_csv_import();
+    gnc_file_csv_import();
 }
 
 
@@ -154,7 +159,7 @@
 void
 gnc_plugin_csv_create_plugin (void)
 {
-  GncPlugin *plugin = gnc_plugin_csv_new ();
+    GncPlugin *plugin = gnc_plugin_csv_new ();
 
-  gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
+    gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
 }

Modified: gnucash/trunk/src/import-export/csv/gnc-plugin-csv.h
===================================================================
--- gnucash/trunk/src/import-export/csv/gnc-plugin-csv.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/csv/gnc-plugin-csv.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-csv.h -- 
+/*
+ * gnc-plugin-csv.h --
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -40,12 +40,14 @@
 #define GNC_PLUGIN_CSV_NAME "gnc-plugin-csv"
 
 /* typedefs & structures */
-typedef struct {
-	GncPlugin gnc_plugin;
+typedef struct
+{
+    GncPlugin gnc_plugin;
 } GncPluginCsv;
 
-typedef struct {
-	GncPluginClass gnc_plugin;
+typedef struct
+{
+    GncPluginClass gnc_plugin;
 } GncPluginCsvClass;
 
 /* function prototypes */

Modified: gnucash/trunk/src/import-export/csv/gncmod-csv-import.c
===================================================================
--- gnucash/trunk/src/import-export/csv/gncmod-csv-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/csv/gncmod-csv-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -18,11 +18,11 @@
 \********************************************************************/
 /** @addtogroup Import_Export
     @{ */
- /**@internal
- @file gncmod-csv-import.c
- @brief module definition/initialization for the csv importer
- @author Copyright (c) 2002 Benoit Grégoire bock at step.polymtl.ca
- */
+/**@internal
+ at file gncmod-csv-import.c
+ at brief module definition/initialization for the csv importer
+ at author Copyright (c) 2002 Benoit Grégoire bock at step.polymtl.ca
+*/
 #include "config.h"
 
 #include <gmodule.h>
@@ -48,44 +48,44 @@
 char *
 libgncmod_csv_gnc_module_path(void)
 {
-  return g_strdup("gnucash/import-export/csv");
+    return g_strdup("gnucash/import-export/csv");
 }
 
 char *
 libgncmod_csv_gnc_module_description(void)
 {
-  return g_strdup("Gnome GUI and C code for CSV importer using libcsv");
+    return g_strdup("Gnome GUI and C code for CSV importer using libcsv");
 }
 
 int
 libgncmod_csv_gnc_module_init(int refcount)
 {
-  if(!gnc_module_load("gnucash/engine", 0))
-  {
-    return FALSE;
-  }
-  if(!gnc_module_load("gnucash/app-utils", 0))
-  {
-    return FALSE;
-  }
-  if(!gnc_module_load("gnucash/gnome-utils", 0))
-  {
-    return FALSE;
-  }
-    if(!gnc_module_load("gnucash/import-export", 0))
-  {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/import-export", 0))
+    {
+        return FALSE;
+    }
 
-  /* Add menu items with C callbacks */
-  gnc_plugin_csv_create_plugin();
+    /* Add menu items with C callbacks */
+    gnc_plugin_csv_create_plugin();
 
-  return TRUE;
+    return TRUE;
 }
 
 int
 libgncmod_csv_gnc_module_end(int refcount)
 {
-  return TRUE;
+    return TRUE;
 }
 /** @}*/

Modified: gnucash/trunk/src/import-export/gnc-import-desc-format.c
===================================================================
--- gnucash/trunk/src/import-export/gnc-import-desc-format.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/gnc-import-desc-format.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -11,72 +11,72 @@
 static GNCDruidProviderDescClass *parent_class;
 
 GNC_BASIC_GOBJECT(GNCImportDescFormat, GNCImportDescFormatClass,
-		  G_TYPE_GNC_DRUID_PROVIDER_DESC,
-		  gnc_import_desc_format_class_init,
-		  gnc_import_desc_format_init,
-		  gnc_import_desc_format_get_type,
-		  gnc_import_desc_format_new)
+                  G_TYPE_GNC_DRUID_PROVIDER_DESC,
+                  gnc_import_desc_format_class_init,
+                  gnc_import_desc_format_init,
+                  gnc_import_desc_format_get_type,
+                  gnc_import_desc_format_new)
 
 static void
 gnc_import_desc_format_class_init (GNCImportDescFormatClass *klass)
 {
-  GObjectClass *object_class;
-	
-  object_class = G_OBJECT_CLASS (klass);
-  parent_class = g_type_class_peek_parent (klass);
+    GObjectClass *object_class;
 
-  object_class->finalize = gnc_import_desc_format_finalize;
+    object_class = G_OBJECT_CLASS (klass);
+    parent_class = g_type_class_peek_parent (klass);
+
+    object_class->finalize = gnc_import_desc_format_finalize;
 }
 
 static void
 gnc_import_desc_format_finalize (GObject *obj)
 {
-  GNCImportDescFormat *desc = (GNCImportDescFormat *)obj;
+    GNCImportDescFormat *desc = (GNCImportDescFormat *)obj;
 
-  if (desc->text)
-    g_free(desc->text);
+    if (desc->text)
+        g_free(desc->text);
 
-  G_OBJECT_CLASS (parent_class)->finalize(obj);
+    G_OBJECT_CLASS (parent_class)->finalize(obj);
 }
 
 static void
 gnc_import_desc_format_init (GNCImportDescFormat *o)
 {
-  o->parent.name = GNC_IMPORT_DESC_TYPE_FORMAT;
+    o->parent.name = GNC_IMPORT_DESC_TYPE_FORMAT;
 }
 
 GNCImportDescFormat*
 gnc_import_desc_format_new_with_data(const gchar* title,
-				     const gchar* text,
-				     gboolean (*next_cb)(GNCDruidCB*),
-				     GncImportFormat (*get_formats)(GNCImportFormatCB*),
-				     const gchar* (*get_sample)(GNCImportFormatCB*))
+                                     const gchar* text,
+                                     gboolean (*next_cb)(GNCDruidCB*),
+                                     GncImportFormat (*get_formats)(GNCImportFormatCB*),
+                                     const gchar* (*get_sample)(GNCImportFormatCB*))
 {
-  GNCImportDescFormat* desc;
+    GNCImportDescFormat* desc;
 
-  desc = gnc_import_desc_format_new();
-  g_assert(desc);
+    desc = gnc_import_desc_format_new();
+    g_assert(desc);
 
-  desc->parent.next_cb = next_cb;
-  desc->get_formats = get_formats;
-  desc->get_sample = get_sample;
+    desc->parent.next_cb = next_cb;
+    desc->get_formats = get_formats;
+    desc->get_sample = get_sample;
 
-  if (text)
-    gnc_import_desc_format_set_text(desc, text);
-  if (title)
-    gnc_druid_provider_desc_set_title(&(desc->parent), title);
+    if (text)
+        gnc_import_desc_format_set_text(desc, text);
+    if (title)
+        gnc_druid_provider_desc_set_title(&(desc->parent), title);
 
-  return desc;
+    return desc;
 }
 
 void
 gnc_import_desc_format_set_text(GNCImportDescFormat* desc, const gchar* text)
 {
-  g_return_if_fail(desc);
-  g_return_if_fail(IS_GNC_IMPORT_DESC_FORMAT(desc));
-  g_return_if_fail(text);
+    g_return_if_fail(desc);
+    g_return_if_fail(IS_GNC_IMPORT_DESC_FORMAT(desc));
+    g_return_if_fail(text);
 
-  if (desc->text)
-    g_free(desc->text);
-  desc->text = g_strdup(text);
+    if (desc->text)
+        g_free(desc->text);
+    desc->text = g_strdup(text);
 }

Modified: gnucash/trunk/src/import-export/gnc-import-desc-format.h
===================================================================
--- gnucash/trunk/src/import-export/gnc-import-desc-format.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/gnc-import-desc-format.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -26,30 +26,30 @@
 
 struct _GNCImportDescFormat
 {
-  GNCDruidProviderDesc parent;
+    GNCDruidProviderDesc parent;
 
-  gchar* text;
-  GncImportFormat (*get_formats)(GNCImportFormatCB*);
-  const gchar* (*get_sample)(GNCImportFormatCB*);
+    gchar* text;
+    GncImportFormat (*get_formats)(GNCImportFormatCB*);
+    const gchar* (*get_sample)(GNCImportFormatCB*);
 
 };
 
 struct _GNCImportDescFormatClass
 {
-  GNCDruidProviderDescClass parent;
+    GNCDruidProviderDescClass parent;
 };
 
 GType	gnc_import_desc_format_get_type(void);
 GNCImportDescFormat* gnc_import_desc_format_new(void);
 GNCImportDescFormat*
 gnc_import_desc_format_new_with_data(const gchar* title,
-				     const gchar* text,
-				     gboolean (*next_cb)(GNCDruidCB*),
-				     GncImportFormat (*get_formats)(GNCImportFormatCB*),
-				     const gchar* (*get_sample)(GNCImportFormatCB*));
+                                     const gchar* text,
+                                     gboolean (*next_cb)(GNCDruidCB*),
+                                     GncImportFormat (*get_formats)(GNCImportFormatCB*),
+                                     const gchar* (*get_sample)(GNCImportFormatCB*));
 
 void	gnc_import_desc_format_set_text(GNCImportDescFormat*,
-					       const gchar* text);
+                                        const gchar* text);
 
 /* methods */
 

Modified: gnucash/trunk/src/import-export/gnc-import-format-cb.c
===================================================================
--- gnucash/trunk/src/import-export/gnc-import-format-cb.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/gnc-import-format-cb.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -5,6 +5,6 @@
 #include "gnc-basic-gobject.h"
 
 GNC_BASIC_GOBJECT(GNCImportFormatCB, GNCImportFormatCBClass,
-		  G_TYPE_GNC_DRUID_CB, NULL, NULL,
-		  gnc_import_format_cb_get_type,
-		  gnc_import_format_cb_new)
+                  G_TYPE_GNC_DRUID_CB, NULL, NULL,
+                  gnc_import_format_cb_get_type,
+                  gnc_import_format_cb_new)

Modified: gnucash/trunk/src/import-export/gnc-import-format-cb.h
===================================================================
--- gnucash/trunk/src/import-export/gnc-import-format-cb.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/gnc-import-format-cb.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,14 +24,14 @@
 
 struct _GNCImportFormatCB
 {
-  GNCDruidCB parent;
+    GNCDruidCB parent;
 
-  GncImportFormat	format;
+    GncImportFormat	format;
 };
 
 struct _GNCImportFormatCBClass
 {
-  GNCDruidCBClass parent_class;
+    GNCDruidCBClass parent_class;
 };
 
 GType	gnc_import_format_cb_get_type(void);

Modified: gnucash/trunk/src/import-export/gnc-import-format-gnome.c
===================================================================
--- gnucash/trunk/src/import-export/gnc-import-format-gnome.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/gnc-import-format-gnome.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,58 +22,59 @@
 
 static GNCDruidProviderClass *parent_class;
 
-GNC_BASIC_GOBJECT_TYPE(GNCImportProvFormatGnome,GNCImportProvFormatGnomeClass,
-		       G_TYPE_GNC_DRUID_PROVIDER,
-		       gnc_import_format_gnome_class_init, NULL,
-		       gnc_import_format_gnome_get_type)
+GNC_BASIC_GOBJECT_TYPE(GNCImportProvFormatGnome, GNCImportProvFormatGnomeClass,
+                       G_TYPE_GNC_DRUID_PROVIDER,
+                       gnc_import_format_gnome_class_init, NULL,
+                       gnc_import_format_gnome_get_type)
 
-enum ifg_cols {
- IFG_COL_TEXT = 0,
- IFG_COL_VALUE,
- NUM_IFG_COLS
+enum ifg_cols
+{
+    IFG_COL_TEXT = 0,
+    IFG_COL_VALUE,
+    NUM_IFG_COLS
 };
 
 static void
 gnc_import_format_gnome_class_init (GNCImportProvFormatGnomeClass *klass)
 {
-  GObjectClass *object_class;
-  GNCDruidProviderClass *gdp_class = (GNCDruidProviderClass*)klass;
-	
-  object_class = G_OBJECT_CLASS (klass);
-  parent_class = g_type_class_peek_parent (klass);
+    GObjectClass *object_class;
+    GNCDruidProviderClass *gdp_class = (GNCDruidProviderClass*)klass;
 
-  object_class->finalize = gnc_import_format_gnome_finalize;
+    object_class = G_OBJECT_CLASS (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-  /* override methods */
-  gdp_class->first_page = gnc_ip_format_gnome_first_page;
-  gdp_class->last_page = gnc_ip_format_gnome_first_page;
-  gdp_class->next_page = gnc_ip_format_gnome_next_page;
-  // gdp_class->prev_page = gnc_ip_format_gnome_prev_page;
+    object_class->finalize = gnc_import_format_gnome_finalize;
+
+    /* override methods */
+    gdp_class->first_page = gnc_ip_format_gnome_first_page;
+    gdp_class->last_page = gnc_ip_format_gnome_first_page;
+    gdp_class->next_page = gnc_ip_format_gnome_next_page;
+    // gdp_class->prev_page = gnc_ip_format_gnome_prev_page;
 }
 
 static void
 gnc_import_format_gnome_finalize (GObject *obj)
 {
-  //GNCImportProvFormatGnome *prov_f = (GNCImportProvFormatGnome *)obj;
+    //GNCImportProvFormatGnome *prov_f = (GNCImportProvFormatGnome *)obj;
 
-  G_OBJECT_CLASS(parent_class)->finalize(obj);
+    G_OBJECT_CLASS(parent_class)->finalize(obj);
 }
 
 static void
 gnc_ifg_option_changed (GtkComboBox *combo, GNCImportProvFormatGnome *prov_f)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  GncImportFormat value;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    GncImportFormat value;
 
-  g_return_if_fail(GTK_IS_COMBO_BOX(combo));
+    g_return_if_fail(GTK_IS_COMBO_BOX(combo));
 
-  model = gtk_combo_box_get_model(combo);
-  if (!gtk_combo_box_get_active_iter(combo, &iter))
-    return;
+    model = gtk_combo_box_get_model(combo);
+    if (!gtk_combo_box_get_active_iter(combo, &iter))
+        return;
 
-  gtk_tree_model_get(model, &iter, IFG_COL_VALUE, &value, -1);
-  prov_f->choice = value;
+    gtk_tree_model_get(model, &iter, IFG_COL_VALUE, &value, -1);
+    prov_f->choice = value;
 }
 
 #define ADD_MENU_ITEM(str,op) { \
@@ -82,152 +83,152 @@
 		     IFG_COL_TEXT, str, \
 		     IFG_COL_VALUE, op, \
 		     -1); \
-} 
+}
 
 static void
 make_menu (GNCImportProvFormatGnome *prov_f, GncImportFormat formats)
 {
-  GtkComboBox *combo = prov_f->format_combo;
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GtkCellRenderer *renderer;
+    GtkComboBox *combo = prov_f->format_combo;
+    GtkListStore *store;
+    GtkTreeIter iter;
+    GtkCellRenderer *renderer;
 
-  store = gtk_list_store_new(NUM_IFG_COLS, G_TYPE_STRING, G_TYPE_INT);
-  gtk_combo_box_set_model(combo, GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    store = gtk_list_store_new(NUM_IFG_COLS, G_TYPE_STRING, G_TYPE_INT);
+    gtk_combo_box_set_model(combo, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-  renderer = gtk_cell_renderer_text_new();
-  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, TRUE);
-  gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo), renderer,
-				"text", IFG_COL_TEXT);
+    renderer = gtk_cell_renderer_text_new();
+    gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, TRUE);
+    gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo), renderer,
+                                  "text", IFG_COL_TEXT);
 
-  /* Numeric formats */
-  ADD_MENU_ITEM(_("Period-as-decimal (1,000.00)"), GNCIF_NUM_PERIOD);
-  ADD_MENU_ITEM(_("Comma-as-decimal (1.000,00)"), GNCIF_NUM_COMMA);
+    /* Numeric formats */
+    ADD_MENU_ITEM(_("Period-as-decimal (1,000.00)"), GNCIF_NUM_PERIOD);
+    ADD_MENU_ITEM(_("Comma-as-decimal (1.000,00)"), GNCIF_NUM_COMMA);
 
-  /* Date formats */
-  ADD_MENU_ITEM(_("m-d-y"), GNCIF_DATE_MDY);
-  ADD_MENU_ITEM(_("d-m-y"), GNCIF_DATE_DMY);
-  ADD_MENU_ITEM(_("y-m-d"), GNCIF_DATE_YMD);
-  ADD_MENU_ITEM(_("y-d-m"), GNCIF_DATE_YDM);
+    /* Date formats */
+    ADD_MENU_ITEM(_("m-d-y"), GNCIF_DATE_MDY);
+    ADD_MENU_ITEM(_("d-m-y"), GNCIF_DATE_DMY);
+    ADD_MENU_ITEM(_("y-m-d"), GNCIF_DATE_YMD);
+    ADD_MENU_ITEM(_("y-d-m"), GNCIF_DATE_YDM);
 
-  g_signal_connect(G_OBJECT(prov_f->format_combo), "changed",
-		   G_CALLBACK(gnc_ifg_option_changed), prov_f);
-  gtk_combo_box_set_active(prov_f->format_combo, 0);
+    g_signal_connect(G_OBJECT(prov_f->format_combo), "changed",
+                     G_CALLBACK(gnc_ifg_option_changed), prov_f);
+    gtk_combo_box_set_active(prov_f->format_combo, 0);
 }
 
 static GNCDruidPage*
 gnc_ip_format_gnome_first_page(GNCDruidProvider* prov)
 {
-  GNCImportProvFormatGnome *prov_f = GNC_IMPORT_FORMAT_GNOME(prov);
-  GNCImportDescFormat *desc_f = GNC_IMPORT_DESC_FORMAT(prov->desc);
-  GncImportFormat formats;
-  const gchar* sample;
+    GNCImportProvFormatGnome *prov_f = GNC_IMPORT_FORMAT_GNOME(prov);
+    GNCImportDescFormat *desc_f = GNC_IMPORT_DESC_FORMAT(prov->desc);
+    GncImportFormat formats;
+    const gchar* sample;
 
-  /* See if we have anything to do. */
-  formats = desc_f->get_formats(prov_f->cb);
+    /* See if we have anything to do. */
+    formats = desc_f->get_formats(prov_f->cb);
 
-  /* If nothing to do, return NULL */
-  if (formats == GNCIF_NONE)
-    return NULL;
+    /* If nothing to do, return NULL */
+    if (formats == GNCIF_NONE)
+        return NULL;
 
-  /* Otherwise set up the menu and sample, then let the user at it */
-  sample = desc_f->get_sample(prov_f->cb);
+    /* Otherwise set up the menu and sample, then let the user at it */
+    sample = desc_f->get_sample(prov_f->cb);
 
-  if (sample)
-    gtk_label_set_text(prov_f->sample_label, sample);
+    if (sample)
+        gtk_label_set_text(prov_f->sample_label, sample);
 
-  make_menu(prov_f, formats);
+    make_menu(prov_f, formats);
 
-  return prov->pages->data;
+    return prov->pages->data;
 }
 
 static GNCDruidPage*
 gnc_ip_format_gnome_next_page(GNCDruidProvider* prov)
 {
-  GNCImportProvFormatGnome *prov_f = GNC_IMPORT_FORMAT_GNOME(prov);
+    GNCImportProvFormatGnome *prov_f = GNC_IMPORT_FORMAT_GNOME(prov);
 
-  /* Grab the entry from the user and supply it to the backend */
-  prov_f->cb->format = prov_f->choice;
+    /* Grab the entry from the user and supply it to the backend */
+    prov_f->cb->format = prov_f->choice;
 
-  /* Figure out whether they want to move on or not */
-  if (prov->desc->next_cb(&(prov_f->cb->parent)))
-    return NULL;
+    /* Figure out whether they want to move on or not */
+    if (prov->desc->next_cb(&(prov_f->cb->parent)))
+        return NULL;
 
-  return prov->pages->data;
+    return prov->pages->data;
 }
 
 static GNCDruidProvider*
 gnc_import_pf_gnome_build(GNCDruid* druid, GNCDruidProviderDesc* desc)
 {
-  GNCDruidProvider *prov_base;
-  GNCImportProvFormatGnome *prov;
-  GNCImportDescFormat *desc_f;
-  GNCImportFormatCB *cb;
-  GtkWidget *window, *page, *label, *format_combo, *sample_label;
-  GladeXML *xml;
+    GNCDruidProvider *prov_base;
+    GNCImportProvFormatGnome *prov;
+    GNCImportDescFormat *desc_f;
+    GNCImportFormatCB *cb;
+    GtkWidget *window, *page, *label, *format_combo, *sample_label;
+    GladeXML *xml;
 
-  /* verify that this is the correct provider descriptor */
-  g_return_val_if_fail(IS_GNC_IMPORT_DESC_FORMAT(desc), NULL);
-  desc_f = GNC_IMPORT_DESC_FORMAT(desc);
+    /* verify that this is the correct provider descriptor */
+    g_return_val_if_fail(IS_GNC_IMPORT_DESC_FORMAT(desc), NULL);
+    desc_f = GNC_IMPORT_DESC_FORMAT(desc);
 
-  g_return_val_if_fail(desc->next_cb, NULL);
-  g_return_val_if_fail(desc_f->get_formats, NULL);
-  g_return_val_if_fail(desc_f->get_sample, NULL);
+    g_return_val_if_fail(desc->next_cb, NULL);
+    g_return_val_if_fail(desc_f->get_formats, NULL);
+    g_return_val_if_fail(desc_f->get_sample, NULL);
 
-  /* Build the provider */
-  prov = GNC_IMPORT_FORMAT_GNOME(g_object_new(G_TYPE_GNC_IMPORT_FORMAT_GNOME, NULL));
-  g_assert(prov);
-  prov_base = GNC_DRUID_PROVIDER(prov);
+    /* Build the provider */
+    prov = GNC_IMPORT_FORMAT_GNOME(g_object_new(G_TYPE_GNC_IMPORT_FORMAT_GNOME, NULL));
+    g_assert(prov);
+    prov_base = GNC_DRUID_PROVIDER(prov);
 
-  /* Build the callback object. */
-  cb = gnc_import_format_cb_new();
-  g_assert(cb);
-  cb->parent.prov_ctx = prov_base;
-  cb->parent.druid_ctx = druid;
-  prov->cb = cb;
+    /* Build the callback object. */
+    cb = gnc_import_format_cb_new();
+    g_assert(cb);
+    cb->parent.prov_ctx = prov_base;
+    cb->parent.druid_ctx = druid;
+    prov->cb = cb;
 
-  /* Build the Druid Page */
-  xml = gnc_glade_xml_new("import-provider-format.glade",
-			  "Format Provider Window");
-  g_assert(xml);
-  window = glade_xml_get_widget(xml, "Format Provider Window");
-  page = glade_xml_get_widget(xml, "Format Provider Page");
-  label = glade_xml_get_widget(xml, "inst_label");
-  format_combo = glade_xml_get_widget(xml, "import_format_combo");
-  sample_label = glade_xml_get_widget(xml, "format_sample_label");
+    /* Build the Druid Page */
+    xml = gnc_glade_xml_new("import-provider-format.glade",
+                            "Format Provider Window");
+    g_assert(xml);
+    window = glade_xml_get_widget(xml, "Format Provider Window");
+    page = glade_xml_get_widget(xml, "Format Provider Page");
+    label = glade_xml_get_widget(xml, "inst_label");
+    format_combo = glade_xml_get_widget(xml, "import_format_combo");
+    sample_label = glade_xml_get_widget(xml, "format_sample_label");
 
-  prov->format_combo = GTK_COMBO_BOX(format_combo);
-  prov->sample_label = GTK_LABEL(sample_label);
+    prov->format_combo = GTK_COMBO_BOX(format_combo);
+    prov->sample_label = GTK_LABEL(sample_label);
 
-  g_object_ref(page);
-  gtk_container_remove(GTK_CONTAINER(window), page);
-  gtk_widget_destroy(window);
+    g_object_ref(page);
+    gtk_container_remove(GTK_CONTAINER(window), page);
+    gtk_widget_destroy(window);
 
-  /* XXX: Am I going to have to unref this later? */
+    /* XXX: Am I going to have to unref this later? */
 
-  /* Remember this page for later */
-  g_assert(page);
-  prov->page = GNOME_DRUID_PAGE(page);
-  prov_base->pages = g_list_prepend(NULL, page);
+    /* Remember this page for later */
+    g_assert(page);
+    prov->page = GNOME_DRUID_PAGE(page);
+    prov_base->pages = g_list_prepend(NULL, page);
 
-  if (desc->title)
-    gnome_druid_page_standard_set_title(GNOME_DRUID_PAGE_STANDARD(page),
-					desc->title);
+    if (desc->title)
+        gnome_druid_page_standard_set_title(GNOME_DRUID_PAGE_STANDARD(page),
+                                            desc->title);
 
-  if (desc_f->text)
-    gtk_label_set_text(GTK_LABEL(label), desc_f->text);
+    if (desc_f->text)
+        gtk_label_set_text(GTK_LABEL(label), desc_f->text);
 
-  /* Show the page */
-  gtk_widget_show_all(GTK_WIDGET(page));
+    /* Show the page */
+    gtk_widget_show_all(GTK_WIDGET(page));
 
-  /* Return the provider instance */
-  return prov_base;
+    /* Return the provider instance */
+    return prov_base;
 }
 
 void
 gnc_import_format_gnome_register(void)
 {
-  gnc_druid_provider_register(GNC_DRUID_GNOME_UI, GNC_IMPORT_DESC_TYPE_FORMAT,
-			      gnc_import_pf_gnome_build);
+    gnc_druid_provider_register(GNC_DRUID_GNOME_UI, GNC_IMPORT_DESC_TYPE_FORMAT,
+                                gnc_import_pf_gnome_build);
 }

Modified: gnucash/trunk/src/import-export/gnc-import-format-gnome.h
===================================================================
--- gnucash/trunk/src/import-export/gnc-import-format-gnome.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/gnc-import-format-gnome.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -25,20 +25,20 @@
 
 struct _GNCImportProvFormatGnome
 {
-  GNCDruidProvider parent;
+    GNCDruidProvider parent;
 
-  GnomeDruidPage*	page;
-  GtkComboBox*		format_combo;
-  GtkLabel*		sample_label;
+    GnomeDruidPage*	page;
+    GtkComboBox*		format_combo;
+    GtkLabel*		sample_label;
 
-  GncImportFormat	choice;
+    GncImportFormat	choice;
 
-  GNCImportFormatCB* cb;
+    GNCImportFormatCB* cb;
 };
 
 struct _GNCImportProvFormatGnomeClass
 {
-  GNCDruidProviderClass parent_class;
+    GNCDruidProviderClass parent_class;
 };
 
 GType	gnc_import_format_gnome_get_type(void);

Modified: gnucash/trunk/src/import-export/gncmod-generic-import.c
===================================================================
--- gnucash/trunk/src/import-export/gncmod-generic-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/gncmod-generic-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,8 +1,8 @@
- /**@internal
- @file
- \brief module definition/initialization for the generic import infrastructure
- \author Copyright (c) 2002 Benoit Grégoire bock at step.polymtl.ca
- */
+/**@internal
+ at file
+\brief module definition/initialization for the generic import infrastructure
+\author Copyright (c) 2002 Benoit Grégoire bock at step.polymtl.ca
+*/
 
 #include "config.h"
 #include <gmodule.h>
@@ -30,43 +30,44 @@
 char *
 libgncmod_generic_import_gnc_module_path(void)
 {
-  return g_strdup("gnucash/import-export");
+    return g_strdup("gnucash/import-export");
 }
 
 char *
 libgncmod_generic_import_gnc_module_description(void)
 {
-  return g_strdup("Gnome GUI and C code for the generic import functions");
+    return g_strdup("Gnome GUI and C code for the generic import functions");
 }
 
 int
 libgncmod_generic_import_gnc_module_init(int refcount)
 {
-  if(!gnc_module_load("gnucash/engine", 0))
-  {
-    return FALSE;
-  }
-  if(!gnc_module_load("gnucash/app-utils", 0))
-  {
-    return FALSE;
-  }
-  if(!gnc_module_load("gnucash/gnome-utils", 0))
-  {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
 
-  if (!refcount) {
-    gnc_import_format_gnome_register();
-    gnc_preferences_add_to_page("generic-import.glade", "matcher_prefs",
-				_("Online Banking"));
+    if (!refcount)
+    {
+        gnc_import_format_gnome_register();
+        gnc_preferences_add_to_page("generic-import.glade", "matcher_prefs",
+                                    _("Online Banking"));
 
-  }
+    }
 
-  return TRUE;
+    return TRUE;
 }
 
 int
 libgncmod_generic_import_gnc_module_end(int refcount)
 {
-  return TRUE;
+    return TRUE;
 }

Modified: gnucash/trunk/src/import-export/hbci/dialog-daterange.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-daterange.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/dialog-daterange.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -29,12 +29,12 @@
 #include "gnc-date-edit.h"
 #include "dialog-daterange.h"
 
-typedef struct 
+typedef struct
 {
-  GtkWidget *enter_from_button;
-  GtkWidget *enter_to_button;
-  GtkWidget *from_dateedit;
-  GtkWidget *to_dateedit;
+    GtkWidget *enter_from_button;
+    GtkWidget *enter_to_button;
+    GtkWidget *from_dateedit;
+    GtkWidget *to_dateedit;
 } DaterangeInfo;
 
 void on_button_toggled (GtkToggleButton *button, gpointer user_data);
@@ -42,101 +42,102 @@
 
 gboolean
 gnc_hbci_enter_daterange (GtkWidget *parent,
-			  const char *heading,
-			  Timespec *from_date, 
-			  gboolean *last_retv_date,
-			  gboolean *first_possible_date,
-			  Timespec *to_date,
-			  gboolean *to_now)
+                          const char *heading,
+                          Timespec *from_date,
+                          gboolean *last_retv_date,
+                          gboolean *first_possible_date,
+                          Timespec *to_date,
+                          gboolean *to_now)
 {
-  GtkWidget *dialog;
-  GladeXML *xml;
-  gint result;
-  DaterangeInfo info;
+    GtkWidget *dialog;
+    GladeXML *xml;
+    gint result;
+    DaterangeInfo info;
 
-  GtkWidget *heading_label;
-  GtkWidget *last_retrieval_button;
-  GtkWidget *first_button;
-  GtkWidget *now_button;
-  
-  xml = gnc_glade_xml_new ("hbci.glade", "HBCI_daterange_dialog");
+    GtkWidget *heading_label;
+    GtkWidget *last_retrieval_button;
+    GtkWidget *first_button;
+    GtkWidget *now_button;
 
-  dialog = glade_xml_get_widget (xml, "HBCI_daterange_dialog");
+    xml = gnc_glade_xml_new ("hbci.glade", "HBCI_daterange_dialog");
 
-  if (parent)
-    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+    dialog = glade_xml_get_widget (xml, "HBCI_daterange_dialog");
 
-  heading_label  = glade_xml_get_widget (xml, "heading_label");
-  last_retrieval_button  = glade_xml_get_widget (xml, "last_retrieval_button");
-  first_button  = glade_xml_get_widget (xml, "first_button");
-  info.enter_from_button  = glade_xml_get_widget (xml, "enter_from_button");
-  info.enter_to_button  = glade_xml_get_widget (xml, "enter_to_button");
-  now_button  = glade_xml_get_widget (xml, "now_button");
+    if (parent)
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
 
-  info.from_dateedit = gnc_date_edit_new_ts (*from_date, FALSE, FALSE);
-  gtk_container_add (GTK_CONTAINER (glade_xml_get_widget 
-				    (xml, "enter_from_box")),
-		     info.from_dateedit);
+    heading_label  = glade_xml_get_widget (xml, "heading_label");
+    last_retrieval_button  = glade_xml_get_widget (xml, "last_retrieval_button");
+    first_button  = glade_xml_get_widget (xml, "first_button");
+    info.enter_from_button  = glade_xml_get_widget (xml, "enter_from_button");
+    info.enter_to_button  = glade_xml_get_widget (xml, "enter_to_button");
+    now_button  = glade_xml_get_widget (xml, "now_button");
 
-  info.to_dateedit = gnc_date_edit_new_ts (*to_date, FALSE, FALSE);
-  gtk_container_add (GTK_CONTAINER (glade_xml_get_widget 
-				    (xml, "enter_to_box")),
-		     info.to_dateedit);
+    info.from_dateedit = gnc_date_edit_new_ts (*from_date, FALSE, FALSE);
+    gtk_container_add (GTK_CONTAINER (glade_xml_get_widget
+                                      (xml, "enter_from_box")),
+                       info.from_dateedit);
 
-  if (*last_retv_date == FALSE) {
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (first_button), TRUE);
-    gtk_widget_set_sensitive (last_retrieval_button, FALSE);
-  }
+    info.to_dateedit = gnc_date_edit_new_ts (*to_date, FALSE, FALSE);
+    gtk_container_add (GTK_CONTAINER (glade_xml_get_widget
+                                      (xml, "enter_to_box")),
+                       info.to_dateedit);
 
-  gtk_widget_set_sensitive (info.from_dateedit, FALSE);
-  gtk_widget_set_sensitive (info.to_dateedit, FALSE);
-  g_signal_connect (info.enter_from_button, "toggled", 
-		    G_CALLBACK (on_button_toggled), &info);
-  g_signal_connect (info.enter_to_button, "toggled", 
-		    G_CALLBACK (on_button_toggled), &info);
+    if (*last_retv_date == FALSE)
+    {
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (first_button), TRUE);
+        gtk_widget_set_sensitive (last_retrieval_button, FALSE);
+    }
 
-  gtk_dialog_set_default_response (GTK_DIALOG (dialog), 1);
+    gtk_widget_set_sensitive (info.from_dateedit, FALSE);
+    gtk_widget_set_sensitive (info.to_dateedit, FALSE);
+    g_signal_connect (info.enter_from_button, "toggled",
+                      G_CALLBACK (on_button_toggled), &info);
+    g_signal_connect (info.enter_to_button, "toggled",
+                      G_CALLBACK (on_button_toggled), &info);
 
-  if (heading)
-    gtk_label_set_text (GTK_LABEL (heading_label), heading);
+    gtk_dialog_set_default_response (GTK_DIALOG (dialog), 1);
 
-  gtk_widget_grab_focus (glade_xml_get_widget (xml, "ok_button"));
+    if (heading)
+        gtk_label_set_text (GTK_LABEL (heading_label), heading);
 
-  gtk_widget_show_all (GTK_WIDGET (dialog));
-  
-  result = gtk_dialog_run (GTK_DIALOG (dialog));
-  if (result >= 0)
-    gtk_widget_hide (GTK_WIDGET (dialog));
+    gtk_widget_grab_focus (glade_xml_get_widget (xml, "ok_button"));
 
-  if (result == 1)
-  {
-    *from_date = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (info.from_dateedit));
-    *last_retv_date = gtk_toggle_button_get_active 
-      (GTK_TOGGLE_BUTTON (last_retrieval_button));
-    *first_possible_date = gtk_toggle_button_get_active 
-      (GTK_TOGGLE_BUTTON (first_button));
-    *to_date = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (info.to_dateedit));
-    *to_now = gtk_toggle_button_get_active 
-      (GTK_TOGGLE_BUTTON (now_button));
+    gtk_widget_show_all (GTK_WIDGET (dialog));
 
-    gtk_widget_destroy (GTK_WIDGET (dialog));
-    return TRUE;
-  }
-  
-  if (result >= 0)
-    gtk_widget_destroy (GTK_WIDGET (dialog));
-  return FALSE;
+    result = gtk_dialog_run (GTK_DIALOG (dialog));
+    if (result >= 0)
+        gtk_widget_hide (GTK_WIDGET (dialog));
+
+    if (result == 1)
+    {
+        *from_date = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (info.from_dateedit));
+        *last_retv_date = gtk_toggle_button_get_active
+                          (GTK_TOGGLE_BUTTON (last_retrieval_button));
+        *first_possible_date = gtk_toggle_button_get_active
+                               (GTK_TOGGLE_BUTTON (first_button));
+        *to_date = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (info.to_dateedit));
+        *to_now = gtk_toggle_button_get_active
+                  (GTK_TOGGLE_BUTTON (now_button));
+
+        gtk_widget_destroy (GTK_WIDGET (dialog));
+        return TRUE;
+    }
+
+    if (result >= 0)
+        gtk_widget_destroy (GTK_WIDGET (dialog));
+    return FALSE;
 }
 
 void on_button_toggled (GtkToggleButton *button, gpointer user_data)
 {
-  DaterangeInfo *info = user_data;
-  g_assert (info);
-  
-  gtk_widget_set_sensitive (info->from_dateedit, 
-			    gtk_toggle_button_get_active 
-			    (GTK_TOGGLE_BUTTON (info->enter_from_button)));
-  gtk_widget_set_sensitive (info->to_dateedit, 
-			    gtk_toggle_button_get_active 
-			    (GTK_TOGGLE_BUTTON (info->enter_to_button)));
+    DaterangeInfo *info = user_data;
+    g_assert (info);
+
+    gtk_widget_set_sensitive (info->from_dateedit,
+                              gtk_toggle_button_get_active
+                              (GTK_TOGGLE_BUTTON (info->enter_from_button)));
+    gtk_widget_set_sensitive (info->to_dateedit,
+                              gtk_toggle_button_get_active
+                              (GTK_TOGGLE_BUTTON (info->enter_to_button)));
 }

Modified: gnucash/trunk/src/import-export/hbci/dialog-daterange.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-daterange.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/dialog-daterange.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -27,12 +27,12 @@
 
 gboolean
 gnc_hbci_enter_daterange (GtkWidget *parent,
-			  const char *heading,
-			  Timespec *from_date, 
-			  gboolean *last_retv_date,
-			  gboolean *first_possible_date,
-			  Timespec *to_date,
-			  gboolean *to_now);
+                          const char *heading,
+                          Timespec *from_date,
+                          gboolean *last_retv_date,
+                          gboolean *first_possible_date,
+                          Timespec *to_date,
+                          gboolean *to_now);
 
 
 

Modified: gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -51,134 +51,135 @@
 
 #define TEMPLATE_LABEL "template"
 
-typedef enum {
-	TEMPLATE_NAME,
-	TEMPLATE_POINTER,
-	TEMPLATE_NUM_COLUMNS
+typedef enum
+{
+    TEMPLATE_NAME,
+    TEMPLATE_POINTER,
+    TEMPLATE_NUM_COLUMNS
 } TemplateListColumns;
 
 /* -------------------------------------- */
 /* Data structure */
 /* -------------------------------------- */
-struct _trans_data 
+struct _trans_data
 {
-  /* The dialog itself */
-  GtkWidget *dialog;
-  GtkWidget *parent;
+    /* The dialog itself */
+    GtkWidget *dialog;
+    GtkWidget *parent;
 
-  /* Whether this is a transfer or a direct debit */
-  GNC_HBCI_Transtype trans_type;
+    /* Whether this is a transfer or a direct debit */
+    GNC_HBCI_Transtype trans_type;
 
-  /* Recipient */
-  GtkWidget *recp_name_entry;
-  GtkWidget *recp_account_entry;
-  GtkWidget *recp_bankcode_entry;
+    /* Recipient */
+    GtkWidget *recp_name_entry;
+    GtkWidget *recp_account_entry;
+    GtkWidget *recp_bankcode_entry;
 
-  /* Amount */
-  GtkWidget *amount_edit;
+    /* Amount */
+    GtkWidget *amount_edit;
 
-  /* Purpose, description */
-  GtkWidget *purpose_entry;
-  GtkWidget *purpose_cont_entry;
-  GtkWidget *purpose_cont2_entry;
-  GtkWidget *purpose_cont3_entry;
+    /* Purpose, description */
+    GtkWidget *purpose_entry;
+    GtkWidget *purpose_cont_entry;
+    GtkWidget *purpose_cont2_entry;
+    GtkWidget *purpose_cont3_entry;
 
-  /* Recipient's bank name (may be filled in automatically sometime later) */
-  GtkWidget *recp_bankname_label;
+    /* Recipient's bank name (may be filled in automatically sometime later) */
+    GtkWidget *recp_bankname_label;
 
-  /* The template choosing GtkTreeView/GtkListStore */
-  GtkTreeView *template_gtktreeview;
-  GtkListStore *template_list_store;
+    /* The template choosing GtkTreeView/GtkListStore */
+    GtkTreeView *template_gtktreeview;
+    GtkListStore *template_list_store;
 
-  /* Flag, if template list has been changed */
-  gboolean templ_changed;
-  
-  /* The HBCI transaction that got created here */
-  AB_TRANSACTION *hbci_trans;
-  
-  /* The gnucash transaction dialog where the user specifies the gnucash transaction. */
-  XferDialog *gnc_trans_dialog;
-  
-  /* The Gnucash transaction that got created here */
-  Transaction *gnc_trans;
-  
+    /* Flag, if template list has been changed */
+    gboolean templ_changed;
+
+    /* The HBCI transaction that got created here */
+    AB_TRANSACTION *hbci_trans;
+
+    /* The gnucash transaction dialog where the user specifies the gnucash transaction. */
+    XferDialog *gnc_trans_dialog;
+
+    /* The Gnucash transaction that got created here */
+    Transaction *gnc_trans;
+
 #if HAVE_KTOBLZCHECK_H
-  /* object for Account number checking */
-  AccountNumberCheck *blzcheck;
+    /* object for Account number checking */
+    AccountNumberCheck *blzcheck;
 #endif
 };
 
 
 void gnc_hbci_dialog_delete(HBCITransDialog *td)
 {
-  if (!td) return;
-  /* Unregister handler for transaction creation callback */
-  if (td->gnc_trans_dialog)
-    gnc_xfer_dialog_set_txn_cb(td->gnc_trans_dialog, NULL, NULL);
-  if (td->hbci_trans)
-    AB_Transaction_free (td->hbci_trans);
+    if (!td) return;
+    /* Unregister handler for transaction creation callback */
+    if (td->gnc_trans_dialog)
+        gnc_xfer_dialog_set_txn_cb(td->gnc_trans_dialog, NULL, NULL);
+    if (td->hbci_trans)
+        AB_Transaction_free (td->hbci_trans);
 
-  if (td->dialog)
-    gtk_widget_destroy (GTK_WIDGET (td->dialog));
+    if (td->dialog)
+        gtk_widget_destroy (GTK_WIDGET (td->dialog));
 #if HAVE_KTOBLZCHECK_H
-  AccountNumberCheck_delete(td->blzcheck);
-#endif    
+    AccountNumberCheck_delete(td->blzcheck);
+#endif
 }
 
 static gboolean
 get_templ_helper (GtkTreeModel *model,
-		  GtkTreePath *path,
-		  GtkTreeIter *iter,
-		  gpointer data)
+                  GtkTreePath *path,
+                  GtkTreeIter *iter,
+                  gpointer data)
 {
-  GList **list = data;
-  GNCTransTempl *templ;
+    GList **list = data;
+    GNCTransTempl *templ;
 
-  gtk_tree_model_get (model, iter,
-		      TEMPLATE_POINTER, &templ,
-		      -1);
-  *list = g_list_append(*list, templ);
-  return FALSE; /* continue */
+    gtk_tree_model_get (model, iter,
+                        TEMPLATE_POINTER, &templ,
+                        -1);
+    *list = g_list_append(*list, templ);
+    return FALSE; /* continue */
 }
 
 GList *gnc_hbci_dialog_get_templ(const HBCITransDialog *td)
 {
-  GList *list = NULL;
+    GList *list = NULL;
 
-  g_assert(td);
-  gtk_tree_model_foreach(GTK_TREE_MODEL(td->template_list_store),
-			 get_templ_helper, &list);
- return list;
+    g_assert(td);
+    gtk_tree_model_foreach(GTK_TREE_MODEL(td->template_list_store),
+                           get_templ_helper, &list);
+    return list;
 }
 GtkWidget *gnc_hbci_dialog_get_parent(const HBCITransDialog *td)
 {
-  g_assert(td);
-  return td->parent;
+    g_assert(td);
+    return td->parent;
 }
 const AB_TRANSACTION *gnc_hbci_dialog_get_htrans(const HBCITransDialog *td)
 {
-  g_assert(td);
-  return td->hbci_trans;
+    g_assert(td);
+    return td->hbci_trans;
 }
 Transaction *gnc_hbci_dialog_get_gtrans(const HBCITransDialog *td)
 {
-  g_assert(td);
-  return td->gnc_trans;
+    g_assert(td);
+    return td->gnc_trans;
 }
 gboolean gnc_hbci_dialog_get_templ_changed(const HBCITransDialog *td)
 {
-  g_assert(td);
-  return td->templ_changed;
+    g_assert(td);
+    return td->templ_changed;
 }
 void gnc_hbci_dialog_hide(HBCITransDialog *td)
 {
-  g_assert(td);
-  gtk_widget_hide_all (td->dialog);
+    g_assert(td);
+    gtk_widget_hide_all (td->dialog);
 }
 void gnc_hbci_dialog_show(HBCITransDialog *td)
 {
-  g_assert(td);
-  gtk_widget_show_all (td->dialog);
+    g_assert(td);
+    gtk_widget_show_all (td->dialog);
 }
 
 
@@ -189,8 +190,8 @@
 AB_TRANSACTION *
 hbci_trans_fill_values(const AB_ACCOUNT *h_acc, HBCITransDialog *td);
 gboolean
-check_ktoblzcheck(GtkWidget *parent, const HBCITransDialog *td, 
-		  const AB_TRANSACTION *trans);
+check_ktoblzcheck(GtkWidget *parent, const HBCITransDialog *td,
+                  const AB_TRANSACTION *trans);
 
 void on_template_list_selection_changed(GtkTreeSelection *selection, gpointer user_data);
 
@@ -212,254 +213,255 @@
 /* doesn't exist any longer */
 
 /* ************************************************************
- * constructor 
+ * constructor
  */
 
 static void fill_template_list_func(gpointer data, gpointer user_data)
 {
-  GNCTransTempl *templ = data;
-  GtkListStore *list_store = user_data;
-  GtkTreeIter iter;
-  
-  g_assert(templ);
-  g_assert(list_store);
-  
-  gtk_list_store_append(list_store, &iter);
-  gtk_list_store_set(list_store, &iter,
-		     TEMPLATE_NAME, gnc_trans_templ_get_name(templ),
-		     TEMPLATE_POINTER, templ,
-		     -1);
+    GNCTransTempl *templ = data;
+    GtkListStore *list_store = user_data;
+    GtkTreeIter iter;
+
+    g_assert(templ);
+    g_assert(list_store);
+
+    gtk_list_store_append(list_store, &iter);
+    gtk_list_store_set(list_store, &iter,
+                       TEMPLATE_NAME, gnc_trans_templ_get_name(templ),
+                       TEMPLATE_POINTER, templ,
+                       -1);
 }
 
 HBCITransDialog *
 gnc_hbci_dialog_new (GtkWidget *parent,
-		const AB_ACCOUNT *h_acc,
-		Account *gnc_acc,
-		GNC_HBCI_Transtype trans_type,
-		GList *templates)
+                     const AB_ACCOUNT *h_acc,
+                     Account *gnc_acc,
+                     GNC_HBCI_Transtype trans_type,
+                     GList *templates)
 {
-  GladeXML *xml;
-  const char *hbci_bankid;
-  HBCITransDialog *td;
-  GtkTreeSelection *selection;
-  GtkTreeViewColumn *column;
-  GtkCellRenderer *renderer;
+    GladeXML *xml;
+    const char *hbci_bankid;
+    HBCITransDialog *td;
+    GtkTreeSelection *selection;
+    GtkTreeViewColumn *column;
+    GtkCellRenderer *renderer;
 
-  td = g_new0(HBCITransDialog, 1);
-  
-  td->parent = parent;
-  td->trans_type = trans_type;
-  g_assert (h_acc);
-  hbci_bankid = AB_Account_GetBankCode(h_acc);
+    td = g_new0(HBCITransDialog, 1);
+
+    td->parent = parent;
+    td->trans_type = trans_type;
+    g_assert (h_acc);
+    hbci_bankid = AB_Account_GetBankCode(h_acc);
 #if HAVE_KTOBLZCHECK_H
-  td->blzcheck = AccountNumberCheck_new();
+    td->blzcheck = AccountNumberCheck_new();
 #endif
-  
-  xml = gnc_glade_xml_new ("hbci.glade", "HBCI_trans_dialog");
 
-  td->dialog = glade_xml_get_widget (xml, "HBCI_trans_dialog");
+    xml = gnc_glade_xml_new ("hbci.glade", "HBCI_trans_dialog");
 
-  if (parent)
-    gtk_window_set_transient_for (GTK_WINDOW (td->dialog), 
-				  GTK_WINDOW (parent));
-  
-  {
-    gchar *hbci_bankname, *hbci_ownername;
-    GtkWidget *heading_label;
-    GtkWidget *recp_name_heading;
-    GtkWidget *recp_account_heading;
-    GtkWidget *recp_bankcode_heading;
-    GtkWidget *amount_hbox;
-    GtkWidget *orig_name_label;
-    GtkWidget *orig_account_label;
-    GtkWidget *orig_bankname_label;
-    GtkWidget *orig_bankcode_label;
-    GtkWidget *orig_name_heading;
-    GtkWidget *orig_account_heading;
-    GtkWidget *orig_bankname_heading;
-    GtkWidget *orig_bankcode_heading;
-    GtkWidget *exec_later_button;
-    GtkWidget *add_templ_button;
-    GtkWidget *moveup_templ_button;
-    GtkWidget *movedown_templ_button;
-    GtkWidget *sort_templ_button;
-    GtkWidget *del_templ_button;
-        
-    g_assert 
-      ((heading_label = glade_xml_get_widget (xml, "heading_label")) != NULL);
-    g_assert 
-      ((td->recp_name_entry = glade_xml_get_widget (xml, "recp_name_entry")) != NULL);
-    g_assert 
-      ((recp_name_heading = glade_xml_get_widget (xml, "recp_name_heading")) != NULL);
-    g_assert
-      ((td->recp_account_entry = glade_xml_get_widget (xml, "recp_account_entry")) != NULL);
-    g_assert
-      ((recp_account_heading = glade_xml_get_widget (xml, "recp_account_heading")) != NULL);
-    g_assert
-      ((td->recp_bankcode_entry = glade_xml_get_widget (xml, "recp_bankcode_entry")) != NULL);
-    g_assert
-      ((recp_bankcode_heading = glade_xml_get_widget (xml, "recp_bankcode_heading")) != NULL);
-    g_assert
-      ((td->recp_bankname_label = glade_xml_get_widget (xml, "recp_bankname_label")) != NULL);
-    g_assert
-      ((amount_hbox = glade_xml_get_widget (xml, "amount_hbox")) != NULL);
-    g_assert
-      ((td->purpose_entry = glade_xml_get_widget (xml, "purpose_entry")) != NULL);
-    g_assert
-      ((td->purpose_cont_entry = glade_xml_get_widget (xml, "purpose_cont_entry")) != NULL);
-    g_assert
-      ((td->purpose_cont2_entry = glade_xml_get_widget (xml, "purpose_cont2_entry")) != NULL);
-    g_assert
-      ((td->purpose_cont3_entry = glade_xml_get_widget (xml, "purpose_cont3_entry")) != NULL);
-    g_assert
-      ((orig_name_label = glade_xml_get_widget (xml, "orig_name_label")) != NULL);
-    g_assert
-      ((orig_account_label = glade_xml_get_widget (xml, "orig_account_label")) != NULL);
-    g_assert
-      ((orig_bankname_label = glade_xml_get_widget (xml, "orig_bankname_label")) != NULL);
-    g_assert
-      ((orig_bankcode_label = glade_xml_get_widget (xml, "orig_bankcode_label")) != NULL);
-    g_assert
-      ((orig_name_heading = glade_xml_get_widget (xml, "orig_name_heading")) != NULL);
-    g_assert
-      ((orig_account_heading = glade_xml_get_widget (xml, "orig_account_heading")) != NULL);
-    g_assert
-      ((orig_bankname_heading = glade_xml_get_widget (xml, "orig_bankname_heading")) != NULL);
-    g_assert
-      ((orig_bankcode_heading = glade_xml_get_widget (xml, "orig_bankcode_heading")) != NULL);
-    g_assert
-      ((exec_later_button = glade_xml_get_widget (xml, "exec_later_button")) != NULL);
-    g_assert
-      ((td->template_gtktreeview = GTK_TREE_VIEW(glade_xml_get_widget (xml, "template_list"))) != NULL);
-    g_assert
-      ((add_templ_button = glade_xml_get_widget (xml, "add_templ_button")) != NULL);
-    g_assert
-      ((moveup_templ_button = glade_xml_get_widget (xml, "moveup_templ_button")) != NULL);
-    g_assert
-      ((movedown_templ_button = glade_xml_get_widget (xml, "movedown_templ_button")) != NULL);
-    g_assert
-      ((sort_templ_button = glade_xml_get_widget (xml, "sort_templ_button")) != NULL);
-    g_assert
-      ((del_templ_button = glade_xml_get_widget (xml, "del_templ_button")) != NULL);
+    td->dialog = glade_xml_get_widget (xml, "HBCI_trans_dialog");
 
-    td->amount_edit = gnc_amount_edit_new();
-    gtk_box_pack_start_defaults(GTK_BOX(amount_hbox), td->amount_edit);
-    gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (td->amount_edit), 
-      TRUE);
-    gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (td->amount_edit),
-				  xaccAccountGetCommoditySCU (gnc_acc));
+    if (parent)
+        gtk_window_set_transient_for (GTK_WINDOW (td->dialog),
+                                      GTK_WINDOW (parent));
 
-    /* Check for what kind of transaction this should be, and change
-       the labels accordingly. */
-    switch (trans_type) {
-    case SINGLE_TRANSFER:
-    case SINGLE_INTERNAL_TRANSFER:
-      /* all labels are already set */
-      break;
-    case SINGLE_DEBITNOTE:
-      gtk_label_set_text (GTK_LABEL (heading_label), 
-      /* Translators: Strings from this file are needed only in
-       * countries that have one of aqbanking's Online Banking
-       * techniques available. This is 'OFX DirectConnect'
-       * (U.S. and others), 'HBCI' (in Germany), or 'YellowNet'
-       * (Switzerland). If none of these techniques are available
-       * in your country, you may safely ignore strings from the
-       * import-export/hbci subdirectory. */
-			  _("Enter an Online Direct Debit Note"));
+    {
+        gchar *hbci_bankname, *hbci_ownername;
+        GtkWidget *heading_label;
+        GtkWidget *recp_name_heading;
+        GtkWidget *recp_account_heading;
+        GtkWidget *recp_bankcode_heading;
+        GtkWidget *amount_hbox;
+        GtkWidget *orig_name_label;
+        GtkWidget *orig_account_label;
+        GtkWidget *orig_bankname_label;
+        GtkWidget *orig_bankcode_label;
+        GtkWidget *orig_name_heading;
+        GtkWidget *orig_account_heading;
+        GtkWidget *orig_bankname_heading;
+        GtkWidget *orig_bankcode_heading;
+        GtkWidget *exec_later_button;
+        GtkWidget *add_templ_button;
+        GtkWidget *moveup_templ_button;
+        GtkWidget *movedown_templ_button;
+        GtkWidget *sort_templ_button;
+        GtkWidget *del_templ_button;
 
-      gtk_label_set_text (GTK_LABEL (recp_name_heading),
-			  _("Debited Account Owner"));
-      gtk_label_set_text (GTK_LABEL (recp_account_heading),
-			  _("Debited Account Number"));
-      gtk_label_set_text (GTK_LABEL (recp_bankcode_heading),
-			  _("Debited Account Bank Code"));
+        g_assert
+        ((heading_label = glade_xml_get_widget (xml, "heading_label")) != NULL);
+        g_assert
+        ((td->recp_name_entry = glade_xml_get_widget (xml, "recp_name_entry")) != NULL);
+        g_assert
+        ((recp_name_heading = glade_xml_get_widget (xml, "recp_name_heading")) != NULL);
+        g_assert
+        ((td->recp_account_entry = glade_xml_get_widget (xml, "recp_account_entry")) != NULL);
+        g_assert
+        ((recp_account_heading = glade_xml_get_widget (xml, "recp_account_heading")) != NULL);
+        g_assert
+        ((td->recp_bankcode_entry = glade_xml_get_widget (xml, "recp_bankcode_entry")) != NULL);
+        g_assert
+        ((recp_bankcode_heading = glade_xml_get_widget (xml, "recp_bankcode_heading")) != NULL);
+        g_assert
+        ((td->recp_bankname_label = glade_xml_get_widget (xml, "recp_bankname_label")) != NULL);
+        g_assert
+        ((amount_hbox = glade_xml_get_widget (xml, "amount_hbox")) != NULL);
+        g_assert
+        ((td->purpose_entry = glade_xml_get_widget (xml, "purpose_entry")) != NULL);
+        g_assert
+        ((td->purpose_cont_entry = glade_xml_get_widget (xml, "purpose_cont_entry")) != NULL);
+        g_assert
+        ((td->purpose_cont2_entry = glade_xml_get_widget (xml, "purpose_cont2_entry")) != NULL);
+        g_assert
+        ((td->purpose_cont3_entry = glade_xml_get_widget (xml, "purpose_cont3_entry")) != NULL);
+        g_assert
+        ((orig_name_label = glade_xml_get_widget (xml, "orig_name_label")) != NULL);
+        g_assert
+        ((orig_account_label = glade_xml_get_widget (xml, "orig_account_label")) != NULL);
+        g_assert
+        ((orig_bankname_label = glade_xml_get_widget (xml, "orig_bankname_label")) != NULL);
+        g_assert
+        ((orig_bankcode_label = glade_xml_get_widget (xml, "orig_bankcode_label")) != NULL);
+        g_assert
+        ((orig_name_heading = glade_xml_get_widget (xml, "orig_name_heading")) != NULL);
+        g_assert
+        ((orig_account_heading = glade_xml_get_widget (xml, "orig_account_heading")) != NULL);
+        g_assert
+        ((orig_bankname_heading = glade_xml_get_widget (xml, "orig_bankname_heading")) != NULL);
+        g_assert
+        ((orig_bankcode_heading = glade_xml_get_widget (xml, "orig_bankcode_heading")) != NULL);
+        g_assert
+        ((exec_later_button = glade_xml_get_widget (xml, "exec_later_button")) != NULL);
+        g_assert
+        ((td->template_gtktreeview = GTK_TREE_VIEW(glade_xml_get_widget (xml, "template_list"))) != NULL);
+        g_assert
+        ((add_templ_button = glade_xml_get_widget (xml, "add_templ_button")) != NULL);
+        g_assert
+        ((moveup_templ_button = glade_xml_get_widget (xml, "moveup_templ_button")) != NULL);
+        g_assert
+        ((movedown_templ_button = glade_xml_get_widget (xml, "movedown_templ_button")) != NULL);
+        g_assert
+        ((sort_templ_button = glade_xml_get_widget (xml, "sort_templ_button")) != NULL);
+        g_assert
+        ((del_templ_button = glade_xml_get_widget (xml, "del_templ_button")) != NULL);
 
-      gtk_label_set_text (GTK_LABEL (orig_name_heading),
-			  _("Credited Account Owner"));
-      gtk_label_set_text (GTK_LABEL (orig_account_heading),
-			  _("Credited Account Number"));
-      gtk_label_set_text (GTK_LABEL (orig_bankcode_heading),
-			  _("Credited Account Bank Code"));
-      break;
+        td->amount_edit = gnc_amount_edit_new();
+        gtk_box_pack_start_defaults(GTK_BOX(amount_hbox), td->amount_edit);
+        gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (td->amount_edit),
+                                               TRUE);
+        gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (td->amount_edit),
+                                      xaccAccountGetCommoditySCU (gnc_acc));
 
-    default:
-      g_critical("dialog-hbcitrans: Oops, unknown GNC_HBCI_Transtype %d.\n",
-	     trans_type);
-    }
-    
-    /* Make this button insensitive since it's still unimplemented. */
-    gtk_widget_destroy (exec_later_button);
-    
-    /* aqbanking up to 2.3.0 did not guarantee the following strings
-       to be correct utf8; mentioned in bug#351371. */
-    hbci_bankname = 
-      gnc_utf8_strip_invalid_strdup (AB_Account_GetBankName(h_acc));
-    hbci_ownername = 
-      gnc_utf8_strip_invalid_strdup (AB_Account_GetOwnerName(h_acc));
+        /* Check for what kind of transaction this should be, and change
+           the labels accordingly. */
+        switch (trans_type)
+        {
+        case SINGLE_TRANSFER:
+        case SINGLE_INTERNAL_TRANSFER:
+            /* all labels are already set */
+            break;
+        case SINGLE_DEBITNOTE:
+            gtk_label_set_text (GTK_LABEL (heading_label),
+                                /* Translators: Strings from this file are needed only in
+                                 * countries that have one of aqbanking's Online Banking
+                                 * techniques available. This is 'OFX DirectConnect'
+                                 * (U.S. and others), 'HBCI' (in Germany), or 'YellowNet'
+                                 * (Switzerland). If none of these techniques are available
+                                 * in your country, you may safely ignore strings from the
+                                 * import-export/hbci subdirectory. */
+                                _("Enter an Online Direct Debit Note"));
 
-    /* Fill in the values from the objects */
-    gtk_label_set_text (GTK_LABEL (orig_name_label), 
-			hbci_ownername);
-    gtk_label_set_text (GTK_LABEL (orig_account_label), 
-			AB_Account_GetAccountNumber (h_acc));
-    gtk_label_set_text (GTK_LABEL (orig_bankname_label), 
-			(hbci_bankname && (strlen(hbci_bankname)>0) ?
-			 hbci_bankname :
-			 _("(unknown)")));
-    gtk_label_set_text (GTK_LABEL (orig_bankcode_label), 
-			hbci_bankid);
-    g_free (hbci_ownername);
-    g_free (hbci_bankname);
+            gtk_label_set_text (GTK_LABEL (recp_name_heading),
+                                _("Debited Account Owner"));
+            gtk_label_set_text (GTK_LABEL (recp_account_heading),
+                                _("Debited Account Number"));
+            gtk_label_set_text (GTK_LABEL (recp_bankcode_heading),
+                                _("Debited Account Bank Code"));
 
-    /* fill list for choosing a transaction template */
-     gtk_tree_view_set_headers_visible(td->template_gtktreeview, FALSE);
-    td->template_list_store = gtk_list_store_new(TEMPLATE_NUM_COLUMNS,
-						 G_TYPE_STRING,
-						 G_TYPE_POINTER);
-    gtk_tree_view_set_model(td->template_gtktreeview,
-			    GTK_TREE_MODEL(td->template_list_store));
-    g_object_unref(td->template_list_store);
-    g_list_foreach(templates, fill_template_list_func, td->template_list_store);
+            gtk_label_set_text (GTK_LABEL (orig_name_heading),
+                                _("Credited Account Owner"));
+            gtk_label_set_text (GTK_LABEL (orig_account_heading),
+                                _("Credited Account Number"));
+            gtk_label_set_text (GTK_LABEL (orig_bankcode_heading),
+                                _("Credited Account Bank Code"));
+            break;
 
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes ("Template Name",
-                                                      renderer,
-                                                      "text", TEMPLATE_NAME,
-                                                      NULL);
-    gtk_tree_view_append_column(td->template_gtktreeview, column);
+        default:
+            g_critical("dialog-hbcitrans: Oops, unknown GNC_HBCI_Transtype %d.\n",
+                       trans_type);
+        }
 
-    td->templ_changed = FALSE;
-    
-    /* Connect signals */
-    selection = gtk_tree_view_get_selection(td->template_gtktreeview);
-    g_signal_connect (selection, "changed",
-                      G_CALLBACK (on_template_list_selection_changed),
-                      td);
-                      
-    g_signal_connect (add_templ_button, "clicked",
-		      G_CALLBACK(add_template_cb), td);
-    g_signal_connect (moveup_templ_button, "clicked",
-                      G_CALLBACK (moveup_template_cb),
-                      td);
-                      
-    g_signal_connect (movedown_templ_button, "clicked",
-                      G_CALLBACK (movedown_template_cb),
-                      td);
+        /* Make this button insensitive since it's still unimplemented. */
+        gtk_widget_destroy (exec_later_button);
 
-     g_signal_connect (sort_templ_button, "clicked",
-                      G_CALLBACK (sort_template_cb),
-                      td);
+        /* aqbanking up to 2.3.0 did not guarantee the following strings
+           to be correct utf8; mentioned in bug#351371. */
+        hbci_bankname =
+            gnc_utf8_strip_invalid_strdup (AB_Account_GetBankName(h_acc));
+        hbci_ownername =
+            gnc_utf8_strip_invalid_strdup (AB_Account_GetOwnerName(h_acc));
 
-     g_signal_connect (del_templ_button, "clicked",
-                      G_CALLBACK (del_template_cb),
-                      td);
+        /* Fill in the values from the objects */
+        gtk_label_set_text (GTK_LABEL (orig_name_label),
+                            hbci_ownername);
+        gtk_label_set_text (GTK_LABEL (orig_account_label),
+                            AB_Account_GetAccountNumber (h_acc));
+        gtk_label_set_text (GTK_LABEL (orig_bankname_label),
+                            (hbci_bankname && (strlen(hbci_bankname) > 0) ?
+                             hbci_bankname :
+                             _("(unknown)")));
+        gtk_label_set_text (GTK_LABEL (orig_bankcode_label),
+                            hbci_bankid);
+        g_free (hbci_ownername);
+        g_free (hbci_bankname);
 
-    g_signal_connect (td->recp_bankcode_entry, "changed",
-		      G_CALLBACK(blz_changed_cb), td);
+        /* fill list for choosing a transaction template */
+        gtk_tree_view_set_headers_visible(td->template_gtktreeview, FALSE);
+        td->template_list_store = gtk_list_store_new(TEMPLATE_NUM_COLUMNS,
+                                  G_TYPE_STRING,
+                                  G_TYPE_POINTER);
+        gtk_tree_view_set_model(td->template_gtktreeview,
+                                GTK_TREE_MODEL(td->template_list_store));
+        g_object_unref(td->template_list_store);
+        g_list_foreach(templates, fill_template_list_func, td->template_list_store);
 
-  } /* GtkWidget declarations/definitions */
-  
-  return td;
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes ("Template Name",
+                 renderer,
+                 "text", TEMPLATE_NAME,
+                 NULL);
+        gtk_tree_view_append_column(td->template_gtktreeview, column);
+
+        td->templ_changed = FALSE;
+
+        /* Connect signals */
+        selection = gtk_tree_view_get_selection(td->template_gtktreeview);
+        g_signal_connect (selection, "changed",
+                          G_CALLBACK (on_template_list_selection_changed),
+                          td);
+
+        g_signal_connect (add_templ_button, "clicked",
+                          G_CALLBACK(add_template_cb), td);
+        g_signal_connect (moveup_templ_button, "clicked",
+                          G_CALLBACK (moveup_template_cb),
+                          td);
+
+        g_signal_connect (movedown_templ_button, "clicked",
+                          G_CALLBACK (movedown_template_cb),
+                          td);
+
+        g_signal_connect (sort_templ_button, "clicked",
+                          G_CALLBACK (sort_template_cb),
+                          td);
+
+        g_signal_connect (del_templ_button, "clicked",
+                          G_CALLBACK (del_template_cb),
+                          td);
+
+        g_signal_connect (td->recp_bankcode_entry, "changed",
+                          G_CALLBACK(blz_changed_cb), td);
+
+    } /* GtkWidget declarations/definitions */
+
+    return td;
 }
 
 
@@ -467,139 +469,149 @@
  * Now all the functions where the action happens.
  */
 
-int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td, 
-				 const AB_ACCOUNT *h_acc)
+int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td,
+                                 const AB_ACCOUNT *h_acc)
 {
-  gint result;
-  int max_purpose_lines;
-  gboolean values_ok;
+    gint result;
+    int max_purpose_lines;
+    gboolean values_ok;
 
-  {
-    AB_JOB *job = AB_JobSingleTransfer_new((AB_ACCOUNT *)h_acc);
-    if (AB_Job_CheckAvailability(job)) {
-      g_warning("gnc_hbci_trans_dialog_enqueue: Oops, job not available. Aborting.\n");
-      return GTK_RESPONSE_CANCEL;
-    }
     {
-      const AB_TRANSACTION_LIMITS *joblimits = AB_JobSingleTransfer_GetFieldLimits(job);
-      max_purpose_lines = (joblimits ?
-			   AB_TransactionLimits_GetMaxLinesPurpose (joblimits) :
-			   2);
+        AB_JOB *job = AB_JobSingleTransfer_new((AB_ACCOUNT *)h_acc);
+        if (AB_Job_CheckAvailability(job))
+        {
+            g_warning("gnc_hbci_trans_dialog_enqueue: Oops, job not available. Aborting.\n");
+            return GTK_RESPONSE_CANCEL;
+        }
+        {
+            const AB_TRANSACTION_LIMITS *joblimits = AB_JobSingleTransfer_GetFieldLimits(job);
+            max_purpose_lines = (joblimits ?
+                                 AB_TransactionLimits_GetMaxLinesPurpose (joblimits) :
+                                 2);
+        }
+        /* these are the number of fields, 27 characters each. */
+        AB_Job_free(job);
     }
-    /* these are the number of fields, 27 characters each. */
-    AB_Job_free(job);
-  }
-  /* gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_entry), max_purpose_lines > 0); */
-  gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_cont_entry), max_purpose_lines > 1);
-  gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_cont2_entry), max_purpose_lines > 2);
-  gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_cont3_entry), max_purpose_lines > 3);
+    /* gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_entry), max_purpose_lines > 0); */
+    gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_cont_entry), max_purpose_lines > 1);
+    gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_cont2_entry), max_purpose_lines > 2);
+    gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_cont3_entry), max_purpose_lines > 3);
 
-  /* Repeat until entered values make sense */
-  do {
+    /* Repeat until entered values make sense */
+    do
+    {
 
-    /* Make sure to show the dialog here */
-    gtk_widget_show_all (td->dialog); 
+        /* Make sure to show the dialog here */
+        gtk_widget_show_all (td->dialog);
 
-    /* Now run the dialog until it gets closed by a button press. */
-    result = gtk_dialog_run (GTK_DIALOG (td->dialog));
-    /* g_message("hbci_trans: result button was %d.\n", result); */
+        /* Now run the dialog until it gets closed by a button press. */
+        result = gtk_dialog_run (GTK_DIALOG (td->dialog));
+        /* g_message("hbci_trans: result button was %d.\n", result); */
 
-    /* The dialog gets hidden anyway as soon as any button is pressed. */
-    gtk_widget_hide_all (td->dialog);
+        /* The dialog gets hidden anyway as soon as any button is pressed. */
+        gtk_widget_hide_all (td->dialog);
 
-    /* Was cancel pressed or dialog closed?
-     *  GNC_RESPONSE_NOW == execute now
-     *  GNC_RESPONSE_LATER == scheduled for later execution (currently unimplemented)
-     *  GTK_RESPONSE_CANCEL == cancel
-     *  GTK_RESPONSE_DELETE_EVENT == window destroyed */
-    if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER)) {
-      gtk_widget_destroy (GTK_WIDGET (td->dialog));
-      td->dialog = NULL;
-      return GTK_RESPONSE_CANCEL;
-    }
+        /* Was cancel pressed or dialog closed?
+         *  GNC_RESPONSE_NOW == execute now
+         *  GNC_RESPONSE_LATER == scheduled for later execution (currently unimplemented)
+         *  GTK_RESPONSE_CANCEL == cancel
+         *  GTK_RESPONSE_DELETE_EVENT == window destroyed */
+        if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER))
+        {
+            gtk_widget_destroy (GTK_WIDGET (td->dialog));
+            td->dialog = NULL;
+            return GTK_RESPONSE_CANCEL;
+        }
 
-    /* Now fill in the values from the entry fields into a new
-       AB_TRANSACTION. */
-    td->hbci_trans = hbci_trans_fill_values(h_acc, td);
-    values_ok = TRUE;
+        /* Now fill in the values from the entry fields into a new
+           AB_TRANSACTION. */
+        td->hbci_trans = hbci_trans_fill_values(h_acc, td);
+        values_ok = TRUE;
 
-    /*printf("dialog-hbcitrans: Got value as %s .\n", 
-      AB_VALUE_toReadableString (AB_TRANSACTION_value (trans)));*/
-    if (AB_Value_GetValue (AB_Transaction_GetValue (td->hbci_trans)) == 0.0) {
-      gtk_widget_show_all (td->dialog); 
-      values_ok = !gnc_verify_dialog
-	(td->dialog,
-	 TRUE,
-	 "%s",
-	 _("The amount is zero or the amount field could not be "
-	   "interpreted correctly. You might have mixed up decimal "
-	   "point and comma, compared to your locale settings. "
-	   "This does not result in a valid online transfer job. \n"
-	   "\n"
-	   "Do you want to enter the job again?"));
-      if (values_ok) {
-	AB_Transaction_free (td->hbci_trans);
-	td->hbci_trans = NULL;
-	return GTK_RESPONSE_CANCEL;
-      }
-      continue;
-    } /* check Transaction_value */
+        /*printf("dialog-hbcitrans: Got value as %s .\n",
+          AB_VALUE_toReadableString (AB_TRANSACTION_value (trans)));*/
+        if (AB_Value_GetValue (AB_Transaction_GetValue (td->hbci_trans)) == 0.0)
+        {
+            gtk_widget_show_all (td->dialog);
+            values_ok = !gnc_verify_dialog
+                        (td->dialog,
+                         TRUE,
+                         "%s",
+                         _("The amount is zero or the amount field could not be "
+                           "interpreted correctly. You might have mixed up decimal "
+                           "point and comma, compared to your locale settings. "
+                           "This does not result in a valid online transfer job. \n"
+                           "\n"
+                           "Do you want to enter the job again?"));
+            if (values_ok)
+            {
+                AB_Transaction_free (td->hbci_trans);
+                td->hbci_trans = NULL;
+                return GTK_RESPONSE_CANCEL;
+            }
+            continue;
+        } /* check Transaction_value */
 
-    {
-      char *purpose = gnc_hbci_getpurpose (td->hbci_trans);
-      if (strlen(purpose) == 0) {
-	gtk_widget_show_all (td->dialog); 
-	values_ok = !gnc_verify_dialog
-	  (GTK_WIDGET (td->dialog),
-	   TRUE,
-	   "%s",
-	   _("You did not enter any transaction purpose. A purpose is "
-	     "required for an online transfer.\n"
-	     "\n"
-	     "Do you want to enter the job again?"));
-	if (values_ok) {
-	  AB_Transaction_free (td->hbci_trans);
-	  td->hbci_trans = NULL;
-	  return GTK_RESPONSE_CANCEL;
-	}
-	continue;
-      } /* check Transaction_purpose */
-    }
+        {
+            char *purpose = gnc_hbci_getpurpose (td->hbci_trans);
+            if (strlen(purpose) == 0)
+            {
+                gtk_widget_show_all (td->dialog);
+                values_ok = !gnc_verify_dialog
+                            (GTK_WIDGET (td->dialog),
+                             TRUE,
+                             "%s",
+                             _("You did not enter any transaction purpose. A purpose is "
+                               "required for an online transfer.\n"
+                               "\n"
+                               "Do you want to enter the job again?"));
+                if (values_ok)
+                {
+                    AB_Transaction_free (td->hbci_trans);
+                    td->hbci_trans = NULL;
+                    return GTK_RESPONSE_CANCEL;
+                }
+                continue;
+            } /* check Transaction_purpose */
+        }
 
-    {
-      char *othername = gnc_hbci_getremotename (td->hbci_trans);
-      if (!othername || (strlen (othername) == 0)) {
-	gtk_widget_show_all (td->dialog); 
-	values_ok = !gnc_verify_dialog
-	  (GTK_WIDGET (td->dialog),
-	   TRUE,
-	   "%s",
-	   _("You did not enter a recipient name.  A recipient name is "
-	     "required for an online transfer.\n"
-	     "\n"
-	     "Do you want to enter the job again?"));
-	if (othername)
-	  g_free (othername);
-	if (values_ok) {
-	  AB_Transaction_free (td->hbci_trans);
-	  td->hbci_trans = NULL;
-	  return GTK_RESPONSE_CANCEL;
-	}
-	continue;
-      } /* check Recipient Name (in aqbanking: Remote Name) */
-    }
+        {
+            char *othername = gnc_hbci_getremotename (td->hbci_trans);
+            if (!othername || (strlen (othername) == 0))
+            {
+                gtk_widget_show_all (td->dialog);
+                values_ok = !gnc_verify_dialog
+                            (GTK_WIDGET (td->dialog),
+                             TRUE,
+                             "%s",
+                             _("You did not enter a recipient name.  A recipient name is "
+                               "required for an online transfer.\n"
+                               "\n"
+                               "Do you want to enter the job again?"));
+                if (othername)
+                    g_free (othername);
+                if (values_ok)
+                {
+                    AB_Transaction_free (td->hbci_trans);
+                    td->hbci_trans = NULL;
+                    return GTK_RESPONSE_CANCEL;
+                }
+                continue;
+            } /* check Recipient Name (in aqbanking: Remote Name) */
+        }
 
-    /* FIXME: If this is a direct debit, set the textkey/ "Textschluessel"/
-       transactionCode according to some GUI selection here!! */
-    /*if (td->trans_type == SINGLE_DEBITNOTE)
-      AB_TRANSACTION_setTextKey (td->hbci_trans, 05);*/
+        /* FIXME: If this is a direct debit, set the textkey/ "Textschluessel"/
+           transactionCode according to some GUI selection here!! */
+        /*if (td->trans_type == SINGLE_DEBITNOTE)
+          AB_TRANSACTION_setTextKey (td->hbci_trans, 05);*/
 
-    /* And finally check the account code, if ktoblzcheck is available. */
-    values_ok = check_ktoblzcheck(GTK_WIDGET (td->dialog), td, td->hbci_trans);
+        /* And finally check the account code, if ktoblzcheck is available. */
+        values_ok = check_ktoblzcheck(GTK_WIDGET (td->dialog), td, td->hbci_trans);
 
-  } while (!values_ok);
+    }
+    while (!values_ok);
 
-  return result;
+    return result;
 }
 
 /** Create a new AB_TRANSACTION, fill the values from the entry
@@ -608,253 +620,260 @@
 AB_TRANSACTION *
 hbci_trans_fill_values(const AB_ACCOUNT *h_acc, HBCITransDialog *td)
 {
-  /* Fill in the user-entered values */
-  AB_TRANSACTION *trans = AB_Transaction_new();
-  gchar *tmpchar;
+    /* Fill in the user-entered values */
+    AB_TRANSACTION *trans = AB_Transaction_new();
+    gchar *tmpchar;
 
-  /* The internal source encoding is returned by
-     gnc_hbci_book_encoding(), which is hard-coded so far. This needs
-     to be fixed for the gnome2 version; the source encoding is then
-     probably utf-8 as well. iconv is also used in
-     gnc_AB_BANKING_interactors() in hbci-interaction.c. */
-  GIConv gnc_iconv_handler =
-    g_iconv_open(gnc_hbci_AQBANKING_encoding(), gnc_hbci_book_encoding());
-  g_assert(gnc_iconv_handler != (GIConv)(-1));
-	
-  /* OpenHBCI newer than 0.9.8: use account's bankCode values
-   * instead of the bank's ones since this is what some banks
-   * require. */
-  AB_Transaction_SetLocalBankCode (trans, 
-				   AB_Account_GetBankCode (h_acc));
-  AB_Transaction_SetLocalAccountNumber (trans, AB_Account_GetAccountNumber (h_acc));
-  AB_Transaction_SetLocalCountry (trans, "DE");
-	
-  AB_Transaction_SetRemoteBankCode
+    /* The internal source encoding is returned by
+       gnc_hbci_book_encoding(), which is hard-coded so far. This needs
+       to be fixed for the gnome2 version; the source encoding is then
+       probably utf-8 as well. iconv is also used in
+       gnc_AB_BANKING_interactors() in hbci-interaction.c. */
+    GIConv gnc_iconv_handler =
+        g_iconv_open(gnc_hbci_AQBANKING_encoding(), gnc_hbci_book_encoding());
+    g_assert(gnc_iconv_handler != (GIConv)(-1));
+
+    /* OpenHBCI newer than 0.9.8: use account's bankCode values
+     * instead of the bank's ones since this is what some banks
+     * require. */
+    AB_Transaction_SetLocalBankCode (trans,
+                                     AB_Account_GetBankCode (h_acc));
+    AB_Transaction_SetLocalAccountNumber (trans, AB_Account_GetAccountNumber (h_acc));
+    AB_Transaction_SetLocalCountry (trans, "DE");
+
+    AB_Transaction_SetRemoteBankCode
     (trans, gtk_entry_get_text (GTK_ENTRY (td->recp_bankcode_entry)));
-  /* g_message("Got otherBankCode %s.\n",
-     AB_Transaction_otherBankCode (trans)); */
-  AB_Transaction_SetRemoteAccountNumber
+    /* g_message("Got otherBankCode %s.\n",
+       AB_Transaction_otherBankCode (trans)); */
+    AB_Transaction_SetRemoteAccountNumber
     (trans, gtk_entry_get_text (GTK_ENTRY (td->recp_account_entry)));
-  /* g_message("Got otherAccountId %s.\n",
-     AB_Transaction_otherAccountId (trans)); */
-  AB_Transaction_SetRemoteCountry (trans, "DE");
+    /* g_message("Got otherAccountId %s.\n",
+       AB_Transaction_otherAccountId (trans)); */
+    AB_Transaction_SetRemoteCountry (trans, "DE");
 
-  /* Convert the result of GTK_ENTRY into UTF-8 */
-  tmpchar = gnc_call_iconv(gnc_iconv_handler, 
-			   gtk_entry_get_text (GTK_ENTRY (td->recp_name_entry)));
-  AB_Transaction_AddRemoteName (trans, tmpchar, FALSE);
-  g_free (tmpchar);
-	
-  /* The last argument means: If TRUE, then the string will be only be
-     appended if it doesn't exist yet. */
-  /* Convert the result of GTK_ENTRY into UTF-8 */
-  tmpchar = gnc_call_iconv(gnc_iconv_handler, 
-			   gtk_entry_get_text (GTK_ENTRY (td->purpose_entry)));
-  AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
-  g_free (tmpchar);
-  tmpchar = gnc_call_iconv(gnc_iconv_handler, 
-			   gtk_entry_get_text (GTK_ENTRY (td->purpose_cont_entry)));
-  if (strlen(tmpchar) > 0)
+    /* Convert the result of GTK_ENTRY into UTF-8 */
+    tmpchar = gnc_call_iconv(gnc_iconv_handler,
+                             gtk_entry_get_text (GTK_ENTRY (td->recp_name_entry)));
+    AB_Transaction_AddRemoteName (trans, tmpchar, FALSE);
+    g_free (tmpchar);
+
+    /* The last argument means: If TRUE, then the string will be only be
+       appended if it doesn't exist yet. */
+    /* Convert the result of GTK_ENTRY into UTF-8 */
+    tmpchar = gnc_call_iconv(gnc_iconv_handler,
+                             gtk_entry_get_text (GTK_ENTRY (td->purpose_entry)));
     AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
-  g_free (tmpchar);
-  tmpchar = gnc_call_iconv(gnc_iconv_handler, 
-			   gtk_entry_get_text (GTK_ENTRY (td->purpose_cont2_entry)));
-  if (strlen(tmpchar) > 0)
-    AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
-  g_free (tmpchar);
-  tmpchar = gnc_call_iconv(gnc_iconv_handler, 
-			   gtk_entry_get_text (GTK_ENTRY (td->purpose_cont3_entry)));
-  if (strlen(tmpchar) > 0)
-    AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
-  g_free (tmpchar);
-	
-  /* FIXME: Replace "EUR" by account-dependent string here. */
-  AB_Transaction_SetValue 
+    g_free (tmpchar);
+    tmpchar = gnc_call_iconv(gnc_iconv_handler,
+                             gtk_entry_get_text (GTK_ENTRY (td->purpose_cont_entry)));
+    if (strlen(tmpchar) > 0)
+        AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
+    g_free (tmpchar);
+    tmpchar = gnc_call_iconv(gnc_iconv_handler,
+                             gtk_entry_get_text (GTK_ENTRY (td->purpose_cont2_entry)));
+    if (strlen(tmpchar) > 0)
+        AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
+    g_free (tmpchar);
+    tmpchar = gnc_call_iconv(gnc_iconv_handler,
+                             gtk_entry_get_text (GTK_ENTRY (td->purpose_cont3_entry)));
+    if (strlen(tmpchar) > 0)
+        AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
+    g_free (tmpchar);
+
+    /* FIXME: Replace "EUR" by account-dependent string here. */
+    AB_Transaction_SetValue
     (trans, AB_Value_new
      (gnc_amount_edit_get_damount (GNC_AMOUNT_EDIT (td->amount_edit)), "EUR"));
 
-  /* If this is a direct debit, a textkey/ "Textschluessel"/
-     transactionCode different from the default has to be set. */
-  switch(td->trans_type) {
-  case SINGLE_DEBITNOTE:
-    /* AB_Transaction_SetTransactionCode (trans, 05); */
-    AB_Transaction_SetTextKey (trans, 05);
-    break;
-  default:
-    /* AB_Transaction_SetTransactionCode (trans, 51); */
-    AB_Transaction_SetTextKey (trans, 51);
-  }
+    /* If this is a direct debit, a textkey/ "Textschluessel"/
+       transactionCode different from the default has to be set. */
+    switch (td->trans_type)
+    {
+    case SINGLE_DEBITNOTE:
+        /* AB_Transaction_SetTransactionCode (trans, 05); */
+        AB_Transaction_SetTextKey (trans, 05);
+        break;
+    default:
+        /* AB_Transaction_SetTransactionCode (trans, 51); */
+        AB_Transaction_SetTextKey (trans, 51);
+    }
 
-  g_iconv_close(gnc_iconv_handler);
-  return trans;
+    g_iconv_close(gnc_iconv_handler);
+    return trans;
 }
 
 /** Checks the account code in the AB_TRANSACTION, if the
     ktoblzcheck package is available. Returns TRUE if everything is
     fine, or FALSE if this transaction should be entered again. */
 gboolean
-check_ktoblzcheck(GtkWidget *parent, const HBCITransDialog *td, 
-		  const AB_TRANSACTION *trans)	
+check_ktoblzcheck(GtkWidget *parent, const HBCITransDialog *td,
+                  const AB_TRANSACTION *trans)
 {
 #if HAVE_KTOBLZCHECK_H
-  int blzresult;
-  const char *blztext;
-  gboolean values_ok = TRUE;
-  
-  blzresult = AccountNumberCheck_check
-    (td->blzcheck, 
-     AB_Transaction_GetRemoteBankCode (trans),
-     AB_Transaction_GetRemoteAccountNumber (trans));
-  switch (blzresult) {
-  case 2:
-    gtk_widget_show_all (parent); 
-    values_ok = gnc_verify_dialog
-      (parent,
-       TRUE,
-       _("The internal check of the destination account number '%s' "
-	 "at the specified bank with bank code '%s' failed. This means "
-	 "the account number might contain an error. Should the online "
-	 "transfer job be sent with this account number anyway?"),
-       AB_Transaction_GetRemoteAccountNumber (trans),
-       AB_Transaction_GetRemoteBankCode (trans));
-    blztext = "Kontonummer wahrscheinlich falsch";
-    break;
-  case 0:
-    blztext = "Kontonummer ok";
-    break;
-  case 3:
-    blztext = "bank unbekannt";
-    break;
-  default:
-  case 1:
-    blztext = "unbekannt aus unbekanntem grund";
-    break;
-  }
-	
-  /*printf("gnc_hbci_trans: KtoBlzCheck said check is %d = %s\n",
-    blzresult, blztext);*/
-  return values_ok;
+    int blzresult;
+    const char *blztext;
+    gboolean values_ok = TRUE;
+
+    blzresult = AccountNumberCheck_check
+                (td->blzcheck,
+                 AB_Transaction_GetRemoteBankCode (trans),
+                 AB_Transaction_GetRemoteAccountNumber (trans));
+    switch (blzresult)
+    {
+    case 2:
+        gtk_widget_show_all (parent);
+        values_ok = gnc_verify_dialog
+                    (parent,
+                     TRUE,
+                     _("The internal check of the destination account number '%s' "
+                       "at the specified bank with bank code '%s' failed. This means "
+                       "the account number might contain an error. Should the online "
+                       "transfer job be sent with this account number anyway?"),
+                     AB_Transaction_GetRemoteAccountNumber (trans),
+                     AB_Transaction_GetRemoteBankCode (trans));
+        blztext = "Kontonummer wahrscheinlich falsch";
+        break;
+    case 0:
+        blztext = "Kontonummer ok";
+        break;
+    case 3:
+        blztext = "bank unbekannt";
+        break;
+    default:
+    case 1:
+        blztext = "unbekannt aus unbekanntem grund";
+        break;
+    }
+
+    /*printf("gnc_hbci_trans: KtoBlzCheck said check is %d = %s\n",
+      blzresult, blztext);*/
+    return values_ok;
 #else
-  return TRUE;
-#endif    
+    return TRUE;
+#endif
 }
 
 AB_JOB *
 gnc_hbci_trans_dialog_enqueue(const AB_TRANSACTION *hbci_trans, AB_BANKING *api,
-			      AB_ACCOUNT *h_acc, 
-			      GNC_HBCI_Transtype trans_type) 
+                              AB_ACCOUNT *h_acc,
+                              GNC_HBCI_Transtype trans_type)
 {
-  AB_JOB *job;
+    AB_JOB *job;
 
-  /* Create a Do-Transaction (Transfer) job. */
-  switch (trans_type) {
-  case SINGLE_DEBITNOTE:
-    job = AB_JobSingleDebitNote_new(h_acc);
-    break;
-  case SINGLE_INTERNAL_TRANSFER:
-    job = AB_JobInternalTransfer_new(h_acc);
-    break;
-  default:
-  case SINGLE_TRANSFER:
-    job = AB_JobSingleTransfer_new(h_acc);
-  };
-  if (AB_Job_CheckAvailability(job)) {
-    g_warning("gnc_hbci_trans_dialog_enqueue: Oops, job not available. Aborting.\n");
-    return NULL;
-  }
+    /* Create a Do-Transaction (Transfer) job. */
+    switch (trans_type)
+    {
+    case SINGLE_DEBITNOTE:
+        job = AB_JobSingleDebitNote_new(h_acc);
+        break;
+    case SINGLE_INTERNAL_TRANSFER:
+        job = AB_JobInternalTransfer_new(h_acc);
+        break;
+    default:
+    case SINGLE_TRANSFER:
+        job = AB_JobSingleTransfer_new(h_acc);
+    };
+    if (AB_Job_CheckAvailability(job))
+    {
+        g_warning("gnc_hbci_trans_dialog_enqueue: Oops, job not available. Aborting.\n");
+        return NULL;
+    }
 
-  switch (trans_type) {
-  case SINGLE_DEBITNOTE:
-    AB_JobSingleDebitNote_SetTransaction(job, hbci_trans);
-    break;
-  case SINGLE_INTERNAL_TRANSFER:
-    AB_JobInternalTransfer_SetTransaction(job, hbci_trans);
-    break;
-  default:
-  case SINGLE_TRANSFER:
-    AB_JobSingleTransfer_SetTransaction(job, hbci_trans);
-  };
+    switch (trans_type)
+    {
+    case SINGLE_DEBITNOTE:
+        AB_JobSingleDebitNote_SetTransaction(job, hbci_trans);
+        break;
+    case SINGLE_INTERNAL_TRANSFER:
+        AB_JobInternalTransfer_SetTransaction(job, hbci_trans);
+        break;
+    default:
+    case SINGLE_TRANSFER:
+        AB_JobSingleTransfer_SetTransaction(job, hbci_trans);
+    };
 
-  /* Add job to queue */
-  AB_Banking_EnqueueJob(api, job);
+    /* Add job to queue */
+    AB_Banking_EnqueueJob(api, job);
 
-  return job;
+    return job;
 }
 
-gboolean 
-gnc_hbci_trans_dialog_execute(HBCITransDialog *td, AB_BANKING *api, 
-			      AB_JOB *job, GNCInteractor *interactor)
+gboolean
+gnc_hbci_trans_dialog_execute(HBCITransDialog *td, AB_BANKING *api,
+                              AB_JOB *job, GNCInteractor *interactor)
 {
-  gboolean successful;
-  g_assert(td);
-  g_assert(api);
-  g_assert(job);
+    gboolean successful;
+    g_assert(td);
+    g_assert(api);
+    g_assert(job);
 
-  successful = gnc_AB_BANKING_execute (td->parent, api, job, interactor);
+    successful = gnc_AB_BANKING_execute (td->parent, api, job, interactor);
 
-  /*printf("dialog-hbcitrans: Ok, result of api_execute was %d.\n", 
-    successful);*/
-	  
-  if (!successful) {
-    /* AB_BANKING_executeOutbox failed. */
-    if ((AB_Job_GetStatus (job) == AB_Job_StatusPending) ||
-	(AB_Job_GetStatus (job) == AB_Job_StatusError)) 
-      successful = !gnc_verify_dialog
-	(td->parent, 
-	 FALSE,
-	 "%s",
-	 _("The job was sent to the bank successfully, but the "
-	   "bank is refusing to execute the job. Please check "
-	   "the log window for the exact error message of the "
-	   "bank. The line with the error message contains a "
-	   "code number that is greater than 9000.\n"
-	   "\n"
-	   "Do you want to enter the job again?"));
+    /*printf("dialog-hbcitrans: Ok, result of api_execute was %d.\n",
+      successful);*/
 
-    if (AB_Job_GetStatus (job) == AB_Job_StatusPending)
-      AB_Banking_DelPendingJob(api, job);
+    if (!successful)
+    {
+        /* AB_BANKING_executeOutbox failed. */
+        if ((AB_Job_GetStatus (job) == AB_Job_StatusPending) ||
+                (AB_Job_GetStatus (job) == AB_Job_StatusError))
+            successful = !gnc_verify_dialog
+                         (td->parent,
+                          FALSE,
+                          "%s",
+                          _("The job was sent to the bank successfully, but the "
+                            "bank is refusing to execute the job. Please check "
+                            "the log window for the exact error message of the "
+                            "bank. The line with the error message contains a "
+                            "code number that is greater than 9000.\n"
+                            "\n"
+                            "Do you want to enter the job again?"));
 
-    AB_Transaction_free (td->hbci_trans);
-    td->hbci_trans = NULL;
-  }
-  /* Watch out! The job *has* to be removed from the queue
-     here because otherwise it might be executed again. */
-  /* FIXME: need to do AB_Banking_DequeueJob(api, job); */
-  return successful;
+        if (AB_Job_GetStatus (job) == AB_Job_StatusPending)
+            AB_Banking_DelPendingJob(api, job);
+
+        AB_Transaction_free (td->hbci_trans);
+        td->hbci_trans = NULL;
+    }
+    /* Watch out! The job *has* to be removed from the queue
+       here because otherwise it might be executed again. */
+    /* FIXME: need to do AB_Banking_DequeueJob(api, job); */
+    return successful;
 }
 
 
 /* -------------------------------------- */
 /* Callbacks */
 /* -------------------------------------- */
-static void fill_entry(const char *str, GtkWidget *entry) { 
-  gtk_entry_set_text (GTK_ENTRY (entry), str ? str : ""); 
+static void fill_entry(const char *str, GtkWidget *entry)
+{
+    gtk_entry_set_text (GTK_ENTRY (entry), str ? str : "");
 }
 
 
 void
 on_template_list_selection_changed (GtkTreeSelection *selection,
-				    gpointer          user_data)
+                                    gpointer          user_data)
 {
-  HBCITransDialog *td = user_data;
-  GNCTransTempl *templ;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    HBCITransDialog *td = user_data;
+    GNCTransTempl *templ;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  g_assert(td);
+    g_assert(td);
 
-  if (!gtk_tree_selection_get_selected(selection, &model, &iter))
-    return;
-  gtk_tree_model_get(model, &iter, TEMPLATE_POINTER, &templ, -1);
+    if (!gtk_tree_selection_get_selected(selection, &model, &iter))
+        return;
+    gtk_tree_model_get(model, &iter, TEMPLATE_POINTER, &templ, -1);
 
-      fill_entry(gnc_trans_templ_get_recp_name(templ), td->recp_name_entry);
-      fill_entry(gnc_trans_templ_get_recp_account(templ), td->recp_account_entry);
-      fill_entry(gnc_trans_templ_get_recp_bankcode(templ), td->recp_bankcode_entry);
-      fill_entry(gnc_trans_templ_get_purpose(templ), td->purpose_entry);
-      fill_entry(gnc_trans_templ_get_purpose_cont(templ), td->purpose_cont_entry);
+    fill_entry(gnc_trans_templ_get_recp_name(templ), td->recp_name_entry);
+    fill_entry(gnc_trans_templ_get_recp_account(templ), td->recp_account_entry);
+    fill_entry(gnc_trans_templ_get_recp_bankcode(templ), td->recp_bankcode_entry);
+    fill_entry(gnc_trans_templ_get_purpose(templ), td->purpose_entry);
+    fill_entry(gnc_trans_templ_get_purpose_cont(templ), td->purpose_cont_entry);
 
-      gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (td->amount_edit),
-				  gnc_trans_templ_get_amount (templ));
+    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (td->amount_edit),
+                                gnc_trans_templ_get_amount (templ));
 
 }
 
@@ -862,223 +881,238 @@
 void blz_changed_cb(GtkEditable *e, gpointer user_data)
 {
 #if HAVE_KTOBLZCHECK_H
-  HBCITransDialog *td = user_data;
-  const AccountNumberCheck_Record *record;
-  g_assert(td);
+    HBCITransDialog *td = user_data;
+    const AccountNumberCheck_Record *record;
+    g_assert(td);
 
-  record = AccountNumberCheck_findBank
-    (td->blzcheck, 
-     gtk_entry_get_text (GTK_ENTRY (td->recp_bankcode_entry)));
-  
-  if (record) {
-    const char *bankname = AccountNumberCheck_Record_bankName (record);
-    GError *error = NULL;
-    const char *ktoblzcheck_encoding = 
+    record = AccountNumberCheck_findBank
+             (td->blzcheck,
+              gtk_entry_get_text (GTK_ENTRY (td->recp_bankcode_entry)));
+
+    if (record)
+    {
+        const char *bankname = AccountNumberCheck_Record_bankName (record);
+        GError *error = NULL;
+        const char *ktoblzcheck_encoding =
 #ifdef KTOBLZCHECK_VERSION_MAJOR
-      /* This version number macro has been added in
-	 ktoblzcheck-1.10, but this function exists already since
-	 ktoblzcheck-1.7, so we're on the safe side. */
-      AccountNumberCheck_stringEncoding()
+            /* This version number macro has been added in
+            	 ktoblzcheck-1.10, but this function exists already since
+            	 ktoblzcheck-1.7, so we're on the safe side. */
+            AccountNumberCheck_stringEncoding()
 #else
-      /* Every ktoblzcheck release before 1.10 is guaranteed to
-	 return strings only in ISO-8859-15. */
-      "ISO-8859-15"
+            /* Every ktoblzcheck release before 1.10 is guaranteed to
+            	 return strings only in ISO-8859-15. */
+            "ISO-8859-15"
 #endif
-      ;
-    gchar *utf8_bankname = g_convert (bankname, strlen(bankname), 
-				      "UTF-8", ktoblzcheck_encoding,
-				      NULL, NULL, &error);
-    if (error != NULL) {
-      g_critical ("Error converting bankname \"%s\" to UTF-8\n", bankname);
-      g_error_free (error);
-      /* Conversion was erroneous, so don't use the string */
-      utf8_bankname = g_strdup (_("(unknown)"));
-    }
-    gtk_label_set_text (GTK_LABEL (td->recp_bankname_label),
-			(strlen(utf8_bankname)>0 ? 
-			 utf8_bankname : _("(unknown)")));
-    g_free (utf8_bankname);
-    gtk_widget_show_all (td->recp_bankname_label);
+            ;
+        gchar *utf8_bankname = g_convert (bankname, strlen(bankname),
+                                          "UTF-8", ktoblzcheck_encoding,
+                                          NULL, NULL, &error);
+        if (error != NULL)
+        {
+            g_critical ("Error converting bankname \"%s\" to UTF-8\n", bankname);
+            g_error_free (error);
+            /* Conversion was erroneous, so don't use the string */
+            utf8_bankname = g_strdup (_("(unknown)"));
+        }
+        gtk_label_set_text (GTK_LABEL (td->recp_bankname_label),
+                            (strlen(utf8_bankname) > 0 ?
+                             utf8_bankname : _("(unknown)")));
+        g_free (utf8_bankname);
+        gtk_widget_show_all (td->recp_bankname_label);
 
-    /*printf("blz_changed_cb: KtoBlzCheck said check is bank is '%s' at '%s'.\n",
-      bankname,
-      AccountNumberCheck_Record_location (record));*/
+        /*printf("blz_changed_cb: KtoBlzCheck said check is bank is '%s' at '%s'.\n",
+          bankname,
+          AccountNumberCheck_Record_location (record));*/
 
-  } else {
-    gtk_label_set_text (GTK_LABEL (td->recp_bankname_label),
-			_("(unknown)"));
-    gtk_widget_show_all (td->recp_bankname_label);
-  }
-#endif    
+    }
+    else
+    {
+        gtk_label_set_text (GTK_LABEL (td->recp_bankname_label),
+                            _("(unknown)"));
+        gtk_widget_show_all (td->recp_bankname_label);
+    }
+#endif
 }
 
 /* -------------------------------------- */
 /* -------------------------------------- */
 
 void add_template_cb(GtkButton *b,
-		     gpointer user_data)
+                     gpointer user_data)
 {
-  HBCITransDialog *td = user_data;
-  GtkWidget *dlg;
-  const gchar *name;
-  int retval = -1;
-  GladeXML *xml;
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkTreeIter cur_iter, new_iter;
-  GtkWidget *entry;
+    HBCITransDialog *td = user_data;
+    GtkWidget *dlg;
+    const gchar *name;
+    int retval = -1;
+    GladeXML *xml;
+    GtkTreeSelection *selection;
+    GtkTreeModel *model;
+    GtkTreeIter cur_iter, new_iter;
+    GtkWidget *entry;
 
-  g_assert(td);
+    g_assert(td);
 
-  xml = gnc_glade_xml_new ("hbci.glade", "HBCI_template_name_dialog");
+    xml = gnc_glade_xml_new ("hbci.glade", "HBCI_template_name_dialog");
 
-  dlg = glade_xml_get_widget (xml, "HBCI_template_name_dialog");
-  entry = glade_xml_get_widget (xml, "template_name");
-  gtk_entry_set_text(GTK_ENTRY(entry),
-		     gtk_entry_get_text(GTK_ENTRY(td->recp_name_entry)));
+    dlg = glade_xml_get_widget (xml, "HBCI_template_name_dialog");
+    entry = glade_xml_get_widget (xml, "template_name");
+    gtk_entry_set_text(GTK_ENTRY(entry),
+                       gtk_entry_get_text(GTK_ENTRY(td->recp_name_entry)));
 
-  retval = gtk_dialog_run(GTK_DIALOG(dlg));
+    retval = gtk_dialog_run(GTK_DIALOG(dlg));
 
-  if (retval == GTK_RESPONSE_OK) {
-    name = gtk_entry_get_text(GTK_ENTRY(entry));
+    if (retval == GTK_RESPONSE_OK)
+    {
+        name = gtk_entry_get_text(GTK_ENTRY(entry));
 
-    if (name && (strlen(name) > 0)) {
-      GNCTransTempl *r;
-      /*printf("add_template_cb: adding template '%s'\n", name);*/
-      r = gnc_trans_templ_new_full
-	(name, 
-	 gtk_entry_get_text (GTK_ENTRY (td->recp_name_entry)),
-	 gtk_entry_get_text (GTK_ENTRY (td->recp_account_entry)),
-	 gtk_entry_get_text (GTK_ENTRY (td->recp_bankcode_entry)),
-	 gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (td->amount_edit)),
-	 gtk_entry_get_text (GTK_ENTRY (td->purpose_entry)),
-	 gtk_entry_get_text (GTK_ENTRY (td->purpose_cont_entry)));
+        if (name && (strlen(name) > 0))
+        {
+            GNCTransTempl *r;
+            /*printf("add_template_cb: adding template '%s'\n", name);*/
+            r = gnc_trans_templ_new_full
+                (name,
+                 gtk_entry_get_text (GTK_ENTRY (td->recp_name_entry)),
+                 gtk_entry_get_text (GTK_ENTRY (td->recp_account_entry)),
+                 gtk_entry_get_text (GTK_ENTRY (td->recp_bankcode_entry)),
+                 gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (td->amount_edit)),
+                 gtk_entry_get_text (GTK_ENTRY (td->purpose_entry)),
+                 gtk_entry_get_text (GTK_ENTRY (td->purpose_cont_entry)));
 
-      selection = gtk_tree_view_get_selection(td->template_gtktreeview);
-      if (gtk_tree_selection_get_selected(selection, &model, &cur_iter)) {
-	gtk_list_store_insert_after(td->template_list_store,
-				    &new_iter, &cur_iter);
-      } else {
-	gtk_list_store_append(GTK_LIST_STORE(model), &new_iter);
-      }
-      gtk_list_store_set(td->template_list_store, &new_iter,
-			 TEMPLATE_NAME, name,
-			 TEMPLATE_POINTER, r,
-			 -1);
-      td->templ_changed = TRUE;
+            selection = gtk_tree_view_get_selection(td->template_gtktreeview);
+            if (gtk_tree_selection_get_selected(selection, &model, &cur_iter))
+            {
+                gtk_list_store_insert_after(td->template_list_store,
+                                            &new_iter, &cur_iter);
+            }
+            else
+            {
+                gtk_list_store_append(GTK_LIST_STORE(model), &new_iter);
+            }
+            gtk_list_store_set(td->template_list_store, &new_iter,
+                               TEMPLATE_NAME, name,
+                               TEMPLATE_POINTER, r,
+                               -1);
+            td->templ_changed = TRUE;
+        }
     }
-  }
-  gtk_widget_destroy(dlg);
-  //  g_object_unref(xml);
+    gtk_widget_destroy(dlg);
+    //  g_object_unref(xml);
 }
 
 
 void
 moveup_template_cb(GtkButton       *button,
-                  gpointer         user_data)
+                   gpointer         user_data)
 {
-  HBCITransDialog *td = user_data;
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkTreeIter iter, prev_iter;
-  GtkTreePath *prev_path;
+    HBCITransDialog *td = user_data;
+    GtkTreeSelection *selection;
+    GtkTreeModel *model;
+    GtkTreeIter iter, prev_iter;
+    GtkTreePath *prev_path;
 
-  g_assert(td);
+    g_assert(td);
 
-  selection = gtk_tree_view_get_selection(td->template_gtktreeview);
-  if (!gtk_tree_selection_get_selected (selection, &model, &iter))
-    return;
+    selection = gtk_tree_view_get_selection(td->template_gtktreeview);
+    if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+        return;
 
-  prev_path = gtk_tree_model_get_path(model, &iter);
-  if (gtk_tree_path_prev(prev_path)) {
-    if (gtk_tree_model_get_iter(model, &prev_iter, prev_path)) {
-      gtk_list_store_move_before(GTK_LIST_STORE(model), &iter, &prev_iter);
-      td->templ_changed = TRUE;
+    prev_path = gtk_tree_model_get_path(model, &iter);
+    if (gtk_tree_path_prev(prev_path))
+    {
+        if (gtk_tree_model_get_iter(model, &prev_iter, prev_path))
+        {
+            gtk_list_store_move_before(GTK_LIST_STORE(model), &iter, &prev_iter);
+            td->templ_changed = TRUE;
+        }
     }
-  }
 
-  gtk_tree_path_free(prev_path);
+    gtk_tree_path_free(prev_path);
 }
 
 
 void
 movedown_template_cb(GtkButton       *button,
-                    gpointer         user_data)
+                     gpointer         user_data)
 {
-  HBCITransDialog *td = user_data;
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkTreeIter iter, next_iter;
+    HBCITransDialog *td = user_data;
+    GtkTreeSelection *selection;
+    GtkTreeModel *model;
+    GtkTreeIter iter, next_iter;
 
-  g_assert(td);
+    g_assert(td);
 
-  selection = gtk_tree_view_get_selection(td->template_gtktreeview);
-  if (!gtk_tree_selection_get_selected (selection, &model, &iter))
-    return;
+    selection = gtk_tree_view_get_selection(td->template_gtktreeview);
+    if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+        return;
 
-  next_iter = iter;
-  if (gtk_tree_model_iter_next(model, &next_iter)) {
-    gtk_list_store_move_after(GTK_LIST_STORE(model), &iter, &next_iter);
-    td->templ_changed = TRUE;
-  }
+    next_iter = iter;
+    if (gtk_tree_model_iter_next(model, &next_iter))
+    {
+        gtk_list_store_move_after(GTK_LIST_STORE(model), &iter, &next_iter);
+        td->templ_changed = TRUE;
+    }
 }
 
 void
 sort_template_cb(GtkButton       *button,
                  gpointer         user_data)
 {
-  HBCITransDialog *td = user_data;
-  g_assert(td);
+    HBCITransDialog *td = user_data;
+    g_assert(td);
 
-  gtk_tree_sortable_set_sort_column_id
+    gtk_tree_sortable_set_sort_column_id
     (GTK_TREE_SORTABLE(td->template_list_store),
      TEMPLATE_NAME, GTK_SORT_ASCENDING);
-  gtk_tree_sortable_set_sort_column_id
+    gtk_tree_sortable_set_sort_column_id
     (GTK_TREE_SORTABLE(td->template_list_store),
      GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID,
      GTK_SORT_ASCENDING);
-  td->templ_changed = TRUE;
+    td->templ_changed = TRUE;
 }
 
 
 
 void
 del_template_cb(GtkButton       *button,
-               gpointer         user_data)
+                gpointer         user_data)
 {
-  HBCITransDialog *td = user_data;
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    HBCITransDialog *td = user_data;
+    GtkTreeSelection *selection;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  g_assert(td);
+    g_assert(td);
 
-  selection = gtk_tree_view_get_selection(td->template_gtktreeview);
-  if (!gtk_tree_selection_get_selected (selection, &model, &iter))
-    return;
+    selection = gtk_tree_view_get_selection(td->template_gtktreeview);
+    if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+        return;
 
-  gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
-  td->templ_changed = TRUE;
+    gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+    td->templ_changed = TRUE;
 }
 
 
 
 void gnc_hbci_dialog_xfer_cb(Transaction *trans, gpointer user_data)
 {
-  HBCITransDialog *td = user_data;
-  g_assert(td);
-  if (trans) {
-    td->gnc_trans = trans;
-    /* Unregister handler for transaction creation callback */
-    if (td->gnc_trans_dialog)
-      gnc_xfer_dialog_set_txn_cb(td->gnc_trans_dialog, NULL, NULL);
-    td->gnc_trans_dialog = NULL;
-  }
-  else {
-    if (td->gnc_trans_dialog) {
-      gnc_xfer_dialog_set_txn_cb(td->gnc_trans_dialog, NULL, NULL);
-      td->gnc_trans_dialog = NULL;
+    HBCITransDialog *td = user_data;
+    g_assert(td);
+    if (trans)
+    {
+        td->gnc_trans = trans;
+        /* Unregister handler for transaction creation callback */
+        if (td->gnc_trans_dialog)
+            gnc_xfer_dialog_set_txn_cb(td->gnc_trans_dialog, NULL, NULL);
+        td->gnc_trans_dialog = NULL;
     }
-  }
-  return;
+    else
+    {
+        if (td->gnc_trans_dialog)
+        {
+            gnc_xfer_dialog_set_txn_cb(td->gnc_trans_dialog, NULL, NULL);
+            td->gnc_trans_dialog = NULL;
+        }
+    }
+    return;
 }

Modified: gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -36,10 +36,11 @@
 /** The dialog data structure. */
 typedef struct _trans_data HBCITransDialog;
 
-typedef enum GNC_HBCI_Transtype {
-  SINGLE_TRANSFER = 0,
-  SINGLE_DEBITNOTE,
-  SINGLE_INTERNAL_TRANSFER
+typedef enum GNC_HBCI_Transtype
+{
+    SINGLE_TRANSFER = 0,
+    SINGLE_DEBITNOTE,
+    SINGLE_INTERNAL_TRANSFER
 } GNC_HBCI_Transtype;
 
 #define GNC_RESPONSE_NOW GTK_RESPONSE_YES
@@ -59,10 +60,10 @@
  * specified by the arguments, and return a pointer to it. */
 HBCITransDialog *
 gnc_hbci_dialog_new (GtkWidget *parent,
-		     const AB_ACCOUNT *h_acc,
-		     Account *gnc_acc,
-		     GNC_HBCI_Transtype trans_type,
-		     GList *templ);
+                     const AB_ACCOUNT *h_acc,
+                     Account *gnc_acc,
+                     GNC_HBCI_Transtype trans_type,
+                     GList *templ);
 /** Destructor */
 void gnc_hbci_dialog_delete(HBCITransDialog *td);
 
@@ -83,12 +84,12 @@
 
 
 
-int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td, 
-				 const AB_ACCOUNT *h_acc);
+int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td,
+                                 const AB_ACCOUNT *h_acc);
 AB_JOB *
 gnc_hbci_trans_dialog_enqueue(const AB_TRANSACTION *hbci_trans, AB_BANKING *api,
-			      AB_ACCOUNT *h_acc, 
-			      GNC_HBCI_Transtype trans_type);
+                              AB_ACCOUNT *h_acc,
+                              GNC_HBCI_Transtype trans_type);
 /** Callback function for gnc_xfer_dialog_set_txn_cb(). The user_data
  * has to be a pointer to a HBCITransDialog structure.  */
 void gnc_hbci_dialog_xfer_cb(Transaction *trans, gpointer user_data);
@@ -96,9 +97,9 @@
 /** Execute the OutboxJob, delete it when finished. Returns TRUE if
  * the application should continue, and FALSE if the user wants to
  * enter this job again.  */
-gboolean 
-gnc_hbci_trans_dialog_execute(HBCITransDialog *td, AB_BANKING *api, 
-			      AB_JOB *job, GNCInteractor *interactor);
+gboolean
+gnc_hbci_trans_dialog_execute(HBCITransDialog *td, AB_BANKING *api,
+                              AB_JOB *job, GNCInteractor *interactor);
 
 
 #endif

Modified: gnucash/trunk/src/import-export/hbci/dialog-pass.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-pass.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/dialog-pass.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -32,122 +32,124 @@
 
 gboolean
 gnc_hbci_get_password (GtkWidget *parent,
-		       const char *windowtitle,
-		       const char *heading,
-		       const char *initial_password,
-		       char **password,
-		       gboolean hide_input)
+                       const char *windowtitle,
+                       const char *heading,
+                       const char *initial_password,
+                       char **password,
+                       gboolean hide_input)
 {
-  GtkWidget *dialog;
-  GtkWidget *heading_label;
-  GtkWidget *password_entry;
-  GladeXML *xml;
-  gint result;
+    GtkWidget *dialog;
+    GtkWidget *heading_label;
+    GtkWidget *password_entry;
+    GladeXML *xml;
+    gint result;
 
-  g_return_val_if_fail (password != NULL, FALSE);
+    g_return_val_if_fail (password != NULL, FALSE);
 
-  xml = gnc_glade_xml_new ("hbcipass.glade", "Password Dialog");
+    xml = gnc_glade_xml_new ("hbcipass.glade", "Password Dialog");
 
-  dialog = glade_xml_get_widget (xml, "Password Dialog");
+    dialog = glade_xml_get_widget (xml, "Password Dialog");
 
-  if (parent)
-    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+    if (parent)
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
 
-  heading_label  = glade_xml_get_widget (xml, "heading_label");
-  password_entry = glade_xml_get_widget (xml, "password_entry");
-  g_assert(heading_label && password_entry);
+    heading_label  = glade_xml_get_widget (xml, "heading_label");
+    password_entry = glade_xml_get_widget (xml, "password_entry");
+    g_assert(heading_label && password_entry);
 
-  gtk_dialog_set_default_response (GTK_DIALOG (dialog), 1);
+    gtk_dialog_set_default_response (GTK_DIALOG (dialog), 1);
 
-  gtk_entry_set_activates_default (GTK_ENTRY (password_entry), TRUE);
+    gtk_entry_set_activates_default (GTK_ENTRY (password_entry), TRUE);
 
-  if (windowtitle)
-    gtk_window_set_title (GTK_WINDOW (dialog), windowtitle);
+    if (windowtitle)
+        gtk_window_set_title (GTK_WINDOW (dialog), windowtitle);
 
-  if (heading)
-    gtk_label_set_text (GTK_LABEL (heading_label), heading);
+    if (heading)
+        gtk_label_set_text (GTK_LABEL (heading_label), heading);
 
-  if (initial_password)
-    gtk_entry_set_text (GTK_ENTRY (password_entry), initial_password);
-  gtk_entry_set_visibility (GTK_ENTRY (password_entry), !hide_input);
+    if (initial_password)
+        gtk_entry_set_text (GTK_ENTRY (password_entry), initial_password);
+    gtk_entry_set_visibility (GTK_ENTRY (password_entry), !hide_input);
 
-  result = gtk_dialog_run (GTK_DIALOG (dialog));
+    result = gtk_dialog_run (GTK_DIALOG (dialog));
 
-  if (result == 1) /* the hand-assigned response value */
-  {
-    *password = g_strdup (gtk_entry_get_text (GTK_ENTRY (password_entry)) );
+    if (result == 1) /* the hand-assigned response value */
+    {
+        *password = g_strdup (gtk_entry_get_text (GTK_ENTRY (password_entry)) );
+        gtk_widget_destroy(dialog);
+        return TRUE;
+    }
     gtk_widget_destroy(dialog);
-    return TRUE;
-  }
-  gtk_widget_destroy(dialog);
 
-  *password = NULL;
-  return FALSE;
+    *password = NULL;
+    return FALSE;
 }
 
 
 gboolean
 gnc_hbci_get_initial_password (GtkWidget *parent,
-			       const char *windowtitle,
-			       const char *heading,
-			       char **password)
+                               const char *windowtitle,
+                               const char *heading,
+                               char **password)
 {
-  GtkWidget *dialog;
-  GtkWidget *heading_label;
-  GtkWidget *password_entry;
-  GtkWidget *confirm_entry;
-  GladeXML *xml;
-  gint result;
+    GtkWidget *dialog;
+    GtkWidget *heading_label;
+    GtkWidget *password_entry;
+    GtkWidget *confirm_entry;
+    GladeXML *xml;
+    gint result;
 
-  g_return_val_if_fail (password != NULL, FALSE);
+    g_return_val_if_fail (password != NULL, FALSE);
 
-  xml = gnc_glade_xml_new ("hbcipass.glade", "Initial Password Dialog");
+    xml = gnc_glade_xml_new ("hbcipass.glade", "Initial Password Dialog");
 
-  dialog = glade_xml_get_widget (xml, "Initial Password Dialog");
+    dialog = glade_xml_get_widget (xml, "Initial Password Dialog");
 
-  if (parent)
-    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+    if (parent)
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
 
-  heading_label  = glade_xml_get_widget (xml, "heading_label");
-  password_entry = glade_xml_get_widget (xml, "password_entry");
-  confirm_entry = glade_xml_get_widget (xml, "confirm_entry");
-  g_assert(heading_label && password_entry && confirm_entry);
+    heading_label  = glade_xml_get_widget (xml, "heading_label");
+    password_entry = glade_xml_get_widget (xml, "password_entry");
+    confirm_entry = glade_xml_get_widget (xml, "confirm_entry");
+    g_assert(heading_label && password_entry && confirm_entry);
 
-  gtk_dialog_set_default_response (GTK_DIALOG (dialog), 1);
+    gtk_dialog_set_default_response (GTK_DIALOG (dialog), 1);
 
-  gtk_entry_set_activates_default (GTK_ENTRY (password_entry), FALSE);
-  gtk_entry_set_activates_default (GTK_ENTRY (confirm_entry), TRUE);
+    gtk_entry_set_activates_default (GTK_ENTRY (password_entry), FALSE);
+    gtk_entry_set_activates_default (GTK_ENTRY (confirm_entry), TRUE);
 
-  if (windowtitle)
-    gtk_window_set_title (GTK_WINDOW (dialog), windowtitle);
+    if (windowtitle)
+        gtk_window_set_title (GTK_WINDOW (dialog), windowtitle);
 
-  if (heading)
-    gtk_label_set_text (GTK_LABEL (heading_label), heading);
+    if (heading)
+        gtk_label_set_text (GTK_LABEL (heading_label), heading);
 
-  while (TRUE) {
-    result = gtk_dialog_run (GTK_DIALOG (dialog));
-    
-    if (result == 1) /* the hand-assigned response value */
-      {
-	const char *pw = gtk_entry_get_text (GTK_ENTRY (password_entry));
-	const char *confirm = gtk_entry_get_text (GTK_ENTRY (confirm_entry));
-	if (strcmp (pw, confirm) == 0) {
-	  *password = g_strdup(pw);
-	  gtk_widget_destroy (GTK_WIDGET (dialog));
-	  return TRUE;
-	}
-      }
-    else
-      break;
+    while (TRUE)
+    {
+        result = gtk_dialog_run (GTK_DIALOG (dialog));
 
-    /* strings didn't match */
-    if (gnc_ok_cancel_dialog (parent, GTK_RESPONSE_OK,
-			      _("The two passwords didn't match. "
-				"Please try again."))
-	!= GTK_RESPONSE_OK)
-      break;
-  }
-  *password = NULL;
-  gtk_widget_destroy (GTK_WIDGET (dialog));
-  return FALSE;
+        if (result == 1) /* the hand-assigned response value */
+        {
+            const char *pw = gtk_entry_get_text (GTK_ENTRY (password_entry));
+            const char *confirm = gtk_entry_get_text (GTK_ENTRY (confirm_entry));
+            if (strcmp (pw, confirm) == 0)
+            {
+                *password = g_strdup(pw);
+                gtk_widget_destroy (GTK_WIDGET (dialog));
+                return TRUE;
+            }
+        }
+        else
+            break;
+
+        /* strings didn't match */
+        if (gnc_ok_cancel_dialog (parent, GTK_RESPONSE_OK,
+                                  _("The two passwords didn't match. "
+                                    "Please try again."))
+                != GTK_RESPONSE_OK)
+            break;
+    }
+    *password = NULL;
+    gtk_widget_destroy (GTK_WIDGET (dialog));
+    return FALSE;
 }

Modified: gnucash/trunk/src/import-export/hbci/dialog-pass.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-pass.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/dialog-pass.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -25,16 +25,16 @@
 
 gboolean
 gnc_hbci_get_password (GtkWidget *parent,
-		       const char *windowtitle,
-		       const char *heading,
-		       const char *initial_password,
-		       char **password,
-		       gboolean hide_input);
+                       const char *windowtitle,
+                       const char *heading,
+                       const char *initial_password,
+                       char **password,
+                       gboolean hide_input);
 gboolean
 gnc_hbci_get_initial_password (GtkWidget *parent,
-			       const char *windowtitle,
-			       const char *heading,
-			       char **password);
+                               const char *windowtitle,
+                               const char *heading,
+                               char **password);
 
 
 #endif

Modified: gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -58,35 +58,36 @@
 #define DRUID_HBCI_IMPORT_CM_CLASS "druid-hbci-import"
 /* #define DEFAULT_HBCI_VERSION 201 */
 
-enum account_list_cols {
-  ACCOUNT_LIST_COL_INDEX = 0,
-  ACCOUNT_LIST_COL_HBCI_NAME,
-  ACCOUNT_LIST_COL_HBCI_ACCT,
-  ACCOUNT_LIST_COL_GNC_NAME,
-  ACCOUNT_LIST_COL_CHECKED,
-  NUM_ACCOUNT_LIST_COLS
+enum account_list_cols
+{
+    ACCOUNT_LIST_COL_INDEX = 0,
+    ACCOUNT_LIST_COL_HBCI_NAME,
+    ACCOUNT_LIST_COL_HBCI_ACCT,
+    ACCOUNT_LIST_COL_GNC_NAME,
+    ACCOUNT_LIST_COL_CHECKED,
+    NUM_ACCOUNT_LIST_COLS
 };
 
-struct _hbciinitialinfo 
+struct _hbciinitialinfo
 {
-  GtkWidget *window;
-  GtkWidget *druid;
+    GtkWidget *window;
+    GtkWidget *druid;
 
-  /* configfile page */
-  GtkWidget *filepage;
-  
-  /* account match page */
-  GtkWidget *accountpage;
-  GtkTreeView *accountview;
-  GtkListStore *accountstore;
-    
-  /* OpenHBCI stuff */
-  AB_BANKING *api;
-  GNCInteractor *interactor;
+    /* configfile page */
+    GtkWidget *filepage;
 
-  /* hbci_account (direct) -> gnucash_account  -- DO NOT DELETE THE KEYS! */
-  GHashTable *gnc_hash;
+    /* account match page */
+    GtkWidget *accountpage;
+    GtkTreeView *accountview;
+    GtkListStore *accountstore;
 
+    /* OpenHBCI stuff */
+    AB_BANKING *api;
+    GNCInteractor *interactor;
+
+    /* hbci_account (direct) -> gnucash_account  -- DO NOT DELETE THE KEYS! */
+    GHashTable *gnc_hash;
+
 };
 
 /* Is TRUE as long as the druid is opened and running. Is being
@@ -97,59 +98,60 @@
 static void
 reset_initial_info (HBCIInitialInfo *info)
 {
-  if (info == NULL) return;
+    if (info == NULL) return;
 
-  if (info->api != NULL) {
-    gnc_AB_BANKING_delete (info->api);
-  }
-  info->api = NULL;
+    if (info->api != NULL)
+    {
+        gnc_AB_BANKING_delete (info->api);
+    }
+    info->api = NULL;
 
-  if (info->gnc_hash != NULL)
-    g_hash_table_destroy (info->gnc_hash);
-  info->gnc_hash = NULL;
+    if (info->gnc_hash != NULL)
+        g_hash_table_destroy (info->gnc_hash);
+    info->gnc_hash = NULL;
 }
 
 static void
 delete_initial_druid (HBCIInitialInfo *info)
 {
-  if (info == NULL) return;
+    if (info == NULL) return;
 
-  gnc_unregister_gui_component_by_data(DRUID_HBCI_IMPORT_CM_CLASS, info);
+    gnc_unregister_gui_component_by_data(DRUID_HBCI_IMPORT_CM_CLASS, info);
 
-  reset_initial_info (info);
-  
-  /* if (info->interactor)
-     GNCInteractor_delete(info->interactor);  -- being destroyed by AB_BANKING*/
+    reset_initial_info (info);
 
-  if (info->window != NULL) 
-    gtk_widget_destroy (info->window);
+    /* if (info->interactor)
+       GNCInteractor_delete(info->interactor);  -- being destroyed by AB_BANKING*/
 
-  hbci_druid_is_active = FALSE;
-  g_free (info);
+    if (info->window != NULL)
+        gtk_widget_destroy (info->window);
+
+    hbci_druid_is_active = FALSE;
+    g_free (info);
 }
 
 
 static gchar *gnc_hbci_account_longname(const AB_ACCOUNT *hacc)
 {
-  gchar *bankname;
-  gchar *result;
-  const char *bankcode;
-  g_assert(hacc);
-  bankname = 
-    gnc_utf8_strip_invalid_strdup (AB_Account_GetBankName (hacc));
-  bankcode = AB_Account_GetBankCode (hacc);
-  /* Translators: Strings are 1. Account code, 2. Bank name, 3. Bank code. */
-  if (strlen(bankname) > 0)
-    result = g_strdup_printf(_("%s at %s (code %s)"),
-			   AB_Account_GetAccountNumber (hacc),
-			   bankname,
-			   bankcode);
-  else
-    result = g_strdup_printf(_("%s at bank code %s"),
-			   AB_Account_GetAccountNumber (hacc),
-			   bankcode);
-  g_free (bankname);
-  return result;
+    gchar *bankname;
+    gchar *result;
+    const char *bankcode;
+    g_assert(hacc);
+    bankname =
+        gnc_utf8_strip_invalid_strdup (AB_Account_GetBankName (hacc));
+    bankcode = AB_Account_GetBankCode (hacc);
+    /* Translators: Strings are 1. Account code, 2. Bank name, 3. Bank code. */
+    if (strlen(bankname) > 0)
+        result = g_strdup_printf(_("%s at %s (code %s)"),
+                                 AB_Account_GetAccountNumber (hacc),
+                                 bankname,
+                                 bankcode);
+    else
+        result = g_strdup_printf(_("%s at bank code %s"),
+                                 AB_Account_GetAccountNumber (hacc),
+                                 bankcode);
+    g_free (bankname);
+    return result;
 }
 
 
@@ -159,99 +161,100 @@
 static AB_ACCOUNT *
 update_accountlist_acc_cb (AB_ACCOUNT *hacc, gpointer user_data)
 {
-  HBCIInitialInfo *info = user_data;
-  gchar *gnc_name, *hbci_name;
-  Account *gacc;
-  GtkTreeIter iter;
+    HBCIInitialInfo *info = user_data;
+    gchar *gnc_name, *hbci_name;
+    Account *gacc;
+    GtkTreeIter iter;
 
-  g_assert(hacc);
-  g_assert(info);
+    g_assert(hacc);
+    g_assert(info);
 
-  hbci_name = gnc_hbci_account_longname(hacc);
-		
-  /* Get corresponding gnucash account */
-  gacc = g_hash_table_lookup (info->gnc_hash, hacc);
+    hbci_name = gnc_hbci_account_longname(hacc);
 
-  /* Build the text for the gnucash account. */
-  if (gacc == NULL)
-    gnc_name = g_strdup("");
-  else 
-    gnc_name = gnc_account_get_full_name (gacc);
+    /* Get corresponding gnucash account */
+    gacc = g_hash_table_lookup (info->gnc_hash, hacc);
 
-  gtk_list_store_append(info->accountstore, &iter);
-  gtk_list_store_set(info->accountstore, &iter,
-		     ACCOUNT_LIST_COL_HBCI_NAME, hbci_name,
-		     ACCOUNT_LIST_COL_HBCI_ACCT, hacc,
-		     ACCOUNT_LIST_COL_GNC_NAME, gnc_name,
-		     ACCOUNT_LIST_COL_CHECKED, FALSE,
-		     -1);
+    /* Build the text for the gnucash account. */
+    if (gacc == NULL)
+        gnc_name = g_strdup("");
+    else
+        gnc_name = gnc_account_get_full_name (gacc);
 
-  g_free(gnc_name);
-  g_free(hbci_name);
-  return NULL;
+    gtk_list_store_append(info->accountstore, &iter);
+    gtk_list_store_set(info->accountstore, &iter,
+                       ACCOUNT_LIST_COL_HBCI_NAME, hbci_name,
+                       ACCOUNT_LIST_COL_HBCI_ACCT, hacc,
+                       ACCOUNT_LIST_COL_GNC_NAME, gnc_name,
+                       ACCOUNT_LIST_COL_CHECKED, FALSE,
+                       -1);
+
+    g_free(gnc_name);
+    g_free(hbci_name);
+    return NULL;
 }
 
 /* Update the account list GtkListStore widget */
 static void
 update_accountlist (HBCIInitialInfo *info)
 {
-  AB_BANKING *banking;
-  AB_ACCOUNT_LIST2 *acclist;
-  GtkTreeModel *model;
-  GtkTreeSelection *selection;
-  GtkTreeIter iter;
-  GtkTreePath *path = NULL;
+    AB_BANKING *banking;
+    AB_ACCOUNT_LIST2 *acclist;
+    GtkTreeModel *model;
+    GtkTreeSelection *selection;
+    GtkTreeIter iter;
+    GtkTreePath *path = NULL;
 
-  g_assert(info);
-  banking = info->api;
-  g_assert(banking);
-  g_assert(info->gnc_hash);
+    g_assert(info);
+    banking = info->api;
+    g_assert(banking);
+    g_assert(info->gnc_hash);
 
-  /* Store old selected row here. */
-  selection = gtk_tree_view_get_selection(info->accountview);
-  if (gtk_tree_selection_get_selected(selection, &model, &iter))
-    path = gtk_tree_model_get_path(model, &iter);
+    /* Store old selected row here. */
+    selection = gtk_tree_view_get_selection(info->accountview);
+    if (gtk_tree_selection_get_selected(selection, &model, &iter))
+        path = gtk_tree_model_get_path(model, &iter);
 
-  /* Delete old list */
-  gtk_list_store_clear(info->accountstore);
-  
-  /* Go through all HBCI accounts */
-  acclist = AB_Banking_GetAccounts(banking);
-  if (acclist)
-    AB_Account_List2_ForEach (acclist,
-			      update_accountlist_acc_cb,
-			      info);
-  else
-    g_warning("update_accountlist: Oops, account list from AB_Banking is NULL.\n");
+    /* Delete old list */
+    gtk_list_store_clear(info->accountstore);
 
-  /* g_message("update_accountlist: GNC hash has %d entries.\n", g_hash_table_size(info->gnc_hash)); */
+    /* Go through all HBCI accounts */
+    acclist = AB_Banking_GetAccounts(banking);
+    if (acclist)
+        AB_Account_List2_ForEach (acclist,
+                                  update_accountlist_acc_cb,
+                                  info);
+    else
+        g_warning("update_accountlist: Oops, account list from AB_Banking is NULL.\n");
 
-  if (path) {
-    gtk_tree_selection_select_path(selection, path);
-    gtk_tree_view_scroll_to_cell(info->accountview, path, NULL, FALSE, 0.0, 0.0);
-    gtk_tree_path_free(path);
-  }
+    /* g_message("update_accountlist: GNC hash has %d entries.\n", g_hash_table_size(info->gnc_hash)); */
+
+    if (path)
+    {
+        gtk_tree_selection_select_path(selection, path);
+        gtk_tree_view_scroll_to_cell(info->accountview, path, NULL, FALSE, 0.0, 0.0);
+        gtk_tree_path_free(path);
+    }
 }
 /*
- * end update_accountlist 
+ * end update_accountlist
  *******************************************************************/
 
 /*******************************************************************
  *
  * Button enabling */
-static void 
+static void
 druid_enable_next_button(HBCIInitialInfo *info)
 {
-  g_assert(info);
-  gnome_druid_set_buttons_sensitive (GNOME_DRUID (info->druid),
-				     TRUE, TRUE, TRUE, TRUE);
+    g_assert(info);
+    gnome_druid_set_buttons_sensitive (GNOME_DRUID (info->druid),
+                                       TRUE, TRUE, TRUE, TRUE);
 }
-static void 
+static void
 druid_disable_next_button(HBCIInitialInfo *info)
 {
-  g_assert(info);
-  gnome_druid_set_buttons_sensitive (GNOME_DRUID (info->druid),
-				     TRUE, FALSE, TRUE, TRUE);
+    g_assert(info);
+    gnome_druid_set_buttons_sensitive (GNOME_DRUID (info->druid),
+                                       TRUE, FALSE, TRUE, TRUE);
 }
 /*
  * end button enabling
@@ -265,149 +268,154 @@
 
 static gboolean banking_has_accounts(AB_BANKING *banking)
 {
-  AB_ACCOUNT_LIST2 *accl;
-  gboolean result;
-  g_assert(banking);
+    AB_ACCOUNT_LIST2 *accl;
+    gboolean result;
+    g_assert(banking);
 
-  accl = AB_Banking_GetAccounts(banking);
-  
-  if (accl && (AB_Account_List2_GetSize(accl) > 0))
-    result = TRUE;
-  else
-    result = FALSE;
+    accl = AB_Banking_GetAccounts(banking);
 
-  if (accl)
-    AB_Account_List2_free(accl);
-  return result;
+    if (accl && (AB_Account_List2_GetSize(accl) > 0))
+        result = TRUE;
+    else
+        result = FALSE;
+
+    if (accl)
+        AB_Account_List2_free(accl);
+    return result;
 }
 
 
 static void
 cm_close_handler(gpointer user_data)
 {
-  HBCIInitialInfo *info = user_data;
+    HBCIInitialInfo *info = user_data;
 
-  /* FIXME: Need to choose a fixed ending procedure here */
-  /* probably not saving because of 'cancel', but for now we save too */
-  gnc_AB_BANKING_fini (info->api);
-  delete_initial_druid(info);
+    /* FIXME: Need to choose a fixed ending procedure here */
+    /* probably not saving because of 'cancel', but for now we save too */
+    gnc_AB_BANKING_fini (info->api);
+    delete_initial_druid(info);
 }
 
 static void
 on_cancel (GnomeDruid *gnomedruid,
-	   gpointer user_data)
+           gpointer user_data)
 {
-  cm_close_handler(user_data);
+    cm_close_handler(user_data);
 }
 
 static void
 on_finish (GnomeDruidPage *gnomedruidpage,
-	   gpointer arg1,
-	   gpointer user_data)
+           gpointer arg1,
+           gpointer user_data)
 {
-  HBCIInitialInfo *info = user_data;
-  gboolean successful = TRUE;
-  g_assert (info);
+    HBCIInitialInfo *info = user_data;
+    gboolean successful = TRUE;
+    g_assert (info);
 
-  if (successful && info->gnc_hash)
-    accounts_save_kvp (info->gnc_hash);
-  
-  gnc_AB_BANKING_fini (info->api);
-  delete_initial_druid(info);
+    if (successful && info->gnc_hash)
+        accounts_save_kvp (info->gnc_hash);
+
+    gnc_AB_BANKING_fini (info->api);
+    delete_initial_druid(info);
 }
 
 
 static void
 on_aqbutton_prepare (GnomeDruidPage *gnomedruidpage,
-		     gpointer arg1,
-		     gpointer user_data)
+                     gpointer arg1,
+                     gpointer user_data)
 {
-  HBCIInitialInfo *info = user_data;
-  AB_BANKING *banking = info->api;
-  g_assert(banking);
+    HBCIInitialInfo *info = user_data;
+    AB_BANKING *banking = info->api;
+    g_assert(banking);
 
-  if (banking_has_accounts(banking))
-    druid_enable_next_button(info);
-  else
-    druid_disable_next_button(info);
+    if (banking_has_accounts(banking))
+        druid_enable_next_button(info);
+    else
+        druid_disable_next_button(info);
 }
 
 
 static void
 on_accountlist_prepare (GnomeDruidPage *gnomedruidpage,
-			gpointer arg1,
-			gpointer user_data)
+                        gpointer arg1,
+                        gpointer user_data)
 {
-  HBCIInitialInfo *info = user_data;
-  
-  /* Make sure the api reads in the current data */
-  AB_Banking_Fini (info->api);
-  AB_Banking_Init (info->api);
+    HBCIInitialInfo *info = user_data;
 
-  if (info->gnc_hash == NULL)
-    info->gnc_hash = gnc_hbci_new_hash_from_kvp (info->api);
-  
-  gnome_druid_set_buttons_sensitive (GNOME_DRUID (info->druid),
-				     FALSE, TRUE, TRUE, TRUE);
+    /* Make sure the api reads in the current data */
+    AB_Banking_Fini (info->api);
+    AB_Banking_Init (info->api);
 
-  update_accountlist(info);
+    if (info->gnc_hash == NULL)
+        info->gnc_hash = gnc_hbci_new_hash_from_kvp (info->api);
+
+    gnome_druid_set_buttons_sensitive (GNOME_DRUID (info->druid),
+                                       FALSE, TRUE, TRUE, TRUE);
+
+    update_accountlist(info);
 }
 
 
 static void
 on_accountlist_changed (GtkTreeSelection *selection,
-			gpointer          user_data)     
+                        gpointer          user_data)
 {
-  HBCIInitialInfo *info = user_data;
-  AB_ACCOUNT *hbci_acc;
-  Account *gnc_acc, *old_value;
-  gchar *longname, *gnc_name;
-  gnc_commodity *currency = NULL;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  
-  if (!gtk_tree_selection_get_selected(selection, &model, &iter))
-    return;
-  gtk_tree_selection_unselect_iter(selection, &iter);
-  gtk_tree_model_get(model, &iter,
-		     ACCOUNT_LIST_COL_HBCI_ACCT, &hbci_acc,
-		     -1);
+    HBCIInitialInfo *info = user_data;
+    AB_ACCOUNT *hbci_acc;
+    Account *gnc_acc, *old_value;
+    gchar *longname, *gnc_name;
+    gnc_commodity *currency = NULL;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  if (hbci_acc) {
-    old_value = g_hash_table_lookup (info->gnc_hash, hbci_acc);
+    if (!gtk_tree_selection_get_selected(selection, &model, &iter))
+        return;
+    gtk_tree_selection_unselect_iter(selection, &iter);
+    gtk_tree_model_get(model, &iter,
+                       ACCOUNT_LIST_COL_HBCI_ACCT, &hbci_acc,
+                       -1);
 
-    /* g_message("on_accountlist_select_row: Selected hbci_acc id %s; old_value %p \n",
-	   AB_Account_GetAccountNumber(hbci_acc),
-	   old_value); */
+    if (hbci_acc)
+    {
+        old_value = g_hash_table_lookup (info->gnc_hash, hbci_acc);
 
-    longname = gnc_hbci_account_longname(hbci_acc);
-    if (AB_Account_GetCurrency (hbci_acc) && 
-	(strlen(AB_Account_GetCurrency (hbci_acc)) > 0)) {
-      currency = gnc_commodity_table_lookup 
-	(gnc_book_get_commodity_table (gnc_get_current_book ()), 
-	 GNC_COMMODITY_NS_CURRENCY, AB_Account_GetCurrency (hbci_acc));
-    }
+        /* g_message("on_accountlist_select_row: Selected hbci_acc id %s; old_value %p \n",
+           AB_Account_GetAccountNumber(hbci_acc),
+           old_value); */
 
-    gnc_acc = gnc_import_select_account(info->window,
-					NULL, TRUE, longname, currency,
-					ACCT_TYPE_BANK, old_value, NULL);
-    g_free(longname);
+        longname = gnc_hbci_account_longname(hbci_acc);
+        if (AB_Account_GetCurrency (hbci_acc) &&
+                (strlen(AB_Account_GetCurrency (hbci_acc)) > 0))
+        {
+            currency = gnc_commodity_table_lookup
+                       (gnc_book_get_commodity_table (gnc_get_current_book ()),
+                        GNC_COMMODITY_NS_CURRENCY, AB_Account_GetCurrency (hbci_acc));
+        }
 
-    if (gnc_acc) {
-      if (old_value) 
-	g_hash_table_remove (info->gnc_hash, hbci_acc);
-      g_hash_table_insert (info->gnc_hash, hbci_acc, gnc_acc);
-      gnc_name = gnc_account_get_full_name (gnc_acc);
-      gtk_list_store_set(info->accountstore, &iter,
-			 ACCOUNT_LIST_COL_GNC_NAME, gnc_name,
-			 -1);
-      g_free(gnc_name);
-    } else {
-      gtk_list_store_set(info->accountstore, &iter,
-			 ACCOUNT_LIST_COL_GNC_NAME, "",
-			 -1);
-    }
-  } /* hbci_acc */
+        gnc_acc = gnc_import_select_account(info->window,
+                                            NULL, TRUE, longname, currency,
+                                            ACCT_TYPE_BANK, old_value, NULL);
+        g_free(longname);
+
+        if (gnc_acc)
+        {
+            if (old_value)
+                g_hash_table_remove (info->gnc_hash, hbci_acc);
+            g_hash_table_insert (info->gnc_hash, hbci_acc, gnc_acc);
+            gnc_name = gnc_account_get_full_name (gnc_acc);
+            gtk_list_store_set(info->accountstore, &iter,
+                               ACCOUNT_LIST_COL_GNC_NAME, gnc_name,
+                               -1);
+            g_free(gnc_name);
+        }
+        else
+        {
+            gtk_list_store_set(info->accountstore, &iter,
+                               ACCOUNT_LIST_COL_GNC_NAME, "",
+                               -1);
+        }
+    } /* hbci_acc */
 }
 
 
@@ -415,15 +423,15 @@
 static void
 on_child_exit (GPid pid, gint status, gpointer data)
 {
-  gint *data_status = data;
+    gint *data_status = data;
 #ifdef G_OS_WIN32
-  *data_status = status;
+    *data_status = status;
 #else
-  *data_status = WEXITSTATUS (status);
+    *data_status = WEXITSTATUS (status);
 #endif
 
-  g_spawn_close_pid (pid);
-  gtk_main_quit ();
+    g_spawn_close_pid (pid);
+    gtk_main_quit ();
 }
 
 
@@ -441,261 +449,283 @@
 
 static void
 on_aqhbci_button (GtkButton *button,
-		  gpointer user_data)
+                  gpointer user_data)
 {
-  HBCIInitialInfo *info = user_data;
-  GWEN_BUFFER *buf;
-  int res;
-  char *backend_name;
+    HBCIInitialInfo *info = user_data;
+    GWEN_BUFFER *buf;
+    int res;
+    char *backend_name;
 
-  /* This is the point where we look for and start an external
-     application shipped with aqhbci that contains the setup druid for
-     AqBanking related stuff. It requires qt (but not kde). This
-     application contains the very verbose step-by-step setup wizard
-     for the AqBanking account, and the application is shared with other
-     AqBanking-based financial managers that offer the AqBanking features
-     (e.g. KMyMoney). See gnucash-devel discussion here
-     https://lists.gnucash.org/pipermail/gnucash-devel/2004-December/012351.html
-  */
-  gboolean wizard_exists;
-  gboolean qt_probably_unavailable = FALSE;
-  const char *wizard_path;
-  AB_BANKING *banking = info->api;
-  g_assert(info->druid);
+    /* This is the point where we look for and start an external
+       application shipped with aqhbci that contains the setup druid for
+       AqBanking related stuff. It requires qt (but not kde). This
+       application contains the very verbose step-by-step setup wizard
+       for the AqBanking account, and the application is shared with other
+       AqBanking-based financial managers that offer the AqBanking features
+       (e.g. KMyMoney). See gnucash-devel discussion here
+       https://lists.gnucash.org/pipermail/gnucash-devel/2004-December/012351.html
+    */
+    gboolean wizard_exists;
+    gboolean qt_probably_unavailable = FALSE;
+    const char *wizard_path;
+    AB_BANKING *banking = info->api;
+    g_assert(info->druid);
 
-  /* See note above about wizard choice. */
+    /* See note above about wizard choice. */
 #ifndef AQBANKING_WIZARD_ALLBACKENDS
-  {
-  GWEN_PLUGIN_DESCRIPTION_LIST2 *pluginlist;
-  const char *backend_name_nc;
+    {
+        GWEN_PLUGIN_DESCRIPTION_LIST2 *pluginlist;
+        const char *backend_name_nc;
 
-  /* Get list of all backends, active or inactive */
-  pluginlist = AB_Banking_GetProviderDescrs (banking);
+        /* Get list of all backends, active or inactive */
+        pluginlist = AB_Banking_GetProviderDescrs (banking);
 
-  /* If there is only one backend, use it, otherwise ask the user */
-  if (!pluginlist || (GWEN_PluginDescription_List2_GetSize(pluginlist) < 1))
-    /* No backend at all? Try aqhbci */
-    backend_name_nc = "aqhbci";
-  else {
-    GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR *pluginlist_it = 
-      GWEN_PluginDescription_List2_First(pluginlist);
-    GWEN_PLUGIN_DESCRIPTION *plugindescr;
-    g_assert (pluginlist_it);
+        /* If there is only one backend, use it, otherwise ask the user */
+        if (!pluginlist || (GWEN_PluginDescription_List2_GetSize(pluginlist) < 1))
+            /* No backend at all? Try aqhbci */
+            backend_name_nc = "aqhbci";
+        else
+        {
+            GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR *pluginlist_it =
+                GWEN_PluginDescription_List2_First(pluginlist);
+            GWEN_PLUGIN_DESCRIPTION *plugindescr;
+            g_assert (pluginlist_it);
 
-    plugindescr = GWEN_PluginDescription_List2Iterator_Data (pluginlist_it);
-    if (GWEN_PluginDescription_List2_GetSize(pluginlist) == 1)
-      /* Only one backend? Use it */
-      backend_name_nc = GWEN_PluginDescription_GetName(plugindescr);
-    else {
-      /* Present a selection dialog to select a particular backend */
-      GList *radio_list = NULL;
-      int x;
+            plugindescr = GWEN_PluginDescription_List2Iterator_Data (pluginlist_it);
+            if (GWEN_PluginDescription_List2_GetSize(pluginlist) == 1)
+                /* Only one backend? Use it */
+                backend_name_nc = GWEN_PluginDescription_GetName(plugindescr);
+            else
+            {
+                /* Present a selection dialog to select a particular backend */
+                GList *radio_list = NULL;
+                int x;
 
-      while (plugindescr) {
-	radio_list = 
-	  g_list_append(radio_list, 
-			g_strdup_printf("%s: %s",
-					GWEN_PluginDescription_GetName(plugindescr),
-					GWEN_PluginDescription_GetShortDescr(plugindescr)));
-	plugindescr = GWEN_PluginDescription_List2Iterator_Next (pluginlist_it);
-      }
-      GWEN_PluginDescription_List2Iterator_free(pluginlist_it);
+                while (plugindescr)
+                {
+                    radio_list =
+                        g_list_append(radio_list,
+                                      g_strdup_printf("%s: %s",
+                                                      GWEN_PluginDescription_GetName(plugindescr),
+                                                      GWEN_PluginDescription_GetShortDescr(plugindescr)));
+                    plugindescr = GWEN_PluginDescription_List2Iterator_Next (pluginlist_it);
+                }
+                GWEN_PluginDescription_List2Iterator_free(pluginlist_it);
 
-      x = gnc_choose_radio_option_dialog
-	(GTK_WIDGET(info->window),
-	 _("Choose AqBanking Backend"),
-	 _("Please choose an AqBanking backend to be configured"),
-	 _("Co_nfigure"),
-	 0,
-	 radio_list);
-      g_list_free(radio_list);
+                x = gnc_choose_radio_option_dialog
+                    (GTK_WIDGET(info->window),
+                     _("Choose AqBanking Backend"),
+                     _("Please choose an AqBanking backend to be configured"),
+                     _("Co_nfigure"),
+                     0,
+                     radio_list);
+                g_list_free(radio_list);
 
-      /* User pressed cancel in choice dialog */
-      if (x == -1) {
-	if (pluginlist)
-	  GWEN_PluginDescription_List2_freeAll(pluginlist);
+                /* User pressed cancel in choice dialog */
+                if (x == -1)
+                {
+                    if (pluginlist)
+                        GWEN_PluginDescription_List2_freeAll(pluginlist);
 #if ((GWENHYWFAR_VERSION_MAJOR < 1) || \
      ((GWENHYWFAR_VERSION_MAJOR == 1) && \
       ((GWENHYWFAR_VERSION_MINOR < 98))))
-	/* Memory cleanup needed for gwenhywfar<1.98.x but not for
-	   gwenhywfar>=1.98.x */
-	if (pluginlist)
-	  GWEN_PluginDescription_List2_free(pluginlist);
+                    /* Memory cleanup needed for gwenhywfar<1.98.x but not for
+                       gwenhywfar>=1.98.x */
+                    if (pluginlist)
+                        GWEN_PluginDescription_List2_free(pluginlist);
 #endif
-	return;
-      }
+                    return;
+                }
 
-      pluginlist_it = GWEN_PluginDescription_List2_First(pluginlist);
-      plugindescr = GWEN_PluginDescription_List2Iterator_Data (pluginlist_it);
-      while (x > 0) {
-	plugindescr = GWEN_PluginDescription_List2Iterator_Next (pluginlist_it);
-	x--;
-      }
-      backend_name_nc = GWEN_PluginDescription_GetName(plugindescr);
-    }
-    GWEN_PluginDescription_List2Iterator_free(pluginlist_it);
-  }
+                pluginlist_it = GWEN_PluginDescription_List2_First(pluginlist);
+                plugindescr = GWEN_PluginDescription_List2Iterator_Data (pluginlist_it);
+                while (x > 0)
+                {
+                    plugindescr = GWEN_PluginDescription_List2Iterator_Next (pluginlist_it);
+                    x--;
+                }
+                backend_name_nc = GWEN_PluginDescription_GetName(plugindescr);
+            }
+            GWEN_PluginDescription_List2Iterator_free(pluginlist_it);
+        }
 
-  /* Allocate the backend name again because the PluginDescr list will
-     be freed */
-  backend_name = g_strdup (backend_name_nc);
-  if (pluginlist)
-    GWEN_PluginDescription_List2_freeAll (pluginlist);
+        /* Allocate the backend name again because the PluginDescr list will
+           be freed */
+        backend_name = g_strdup (backend_name_nc);
+        if (pluginlist)
+            GWEN_PluginDescription_List2_freeAll (pluginlist);
 #if ((GWENHYWFAR_VERSION_MAJOR < 1) || \
      ((GWENHYWFAR_VERSION_MAJOR == 1) && \
       ((GWENHYWFAR_VERSION_MINOR < 98))))
-  /* Memory cleanup needed for gwenhywfar<1.98.x but not for
-     gwenhywfar>=1.98.x */
-  if (pluginlist)
-    GWEN_PluginDescription_List2_free (pluginlist);
+        /* Memory cleanup needed for gwenhywfar<1.98.x but not for
+           gwenhywfar>=1.98.x */
+        if (pluginlist)
+            GWEN_PluginDescription_List2_free (pluginlist);
 #endif
-  }
+    }
 
 #else /* AQBANKING_WIZARD_ALLBACKENDS */
-  backend_name = g_strdup("");
+    backend_name = g_strdup("");
 #endif /* AQBANKING_WIZARD_ALLBACKENDS */
 
-  /* ***** */
+    /* ***** */
 
-  /* Now find out the wizard name for that backend */
-  buf = GWEN_Buffer_new(NULL, 300, 0, 0);
-  AB_Banking_FindWizard(banking, backend_name, NULL, buf);
-  wizard_exists = (strlen(GWEN_Buffer_GetStart(buf)) > 0);
-  wizard_path = GWEN_Buffer_GetStart(buf);
+    /* Now find out the wizard name for that backend */
+    buf = GWEN_Buffer_new(NULL, 300, 0, 0);
+    AB_Banking_FindWizard(banking, backend_name, NULL, buf);
+    wizard_exists = (strlen(GWEN_Buffer_GetStart(buf)) > 0);
+    wizard_path = GWEN_Buffer_GetStart(buf);
 
-  if (wizard_exists) {
-    /* Really check whether the file exists */
-    int fd = g_open( wizard_path, O_RDONLY, 0 );
-    if ( fd == -1)
-      wizard_exists = FALSE;
-    else
-      close( fd );
-  }
+    if (wizard_exists)
+    {
+        /* Really check whether the file exists */
+        int fd = g_open( wizard_path, O_RDONLY, 0 );
+        if ( fd == -1)
+            wizard_exists = FALSE;
+        else
+            close( fd );
+    }
 
 #ifdef G_OS_WIN32
-  {
-    const char *check_file = "qtdemo.exe";
-    gchar *found_program = g_find_program_in_path(check_file);
-    if (found_program) {
-      g_debug("Yes, we found the Qt demo program in %s\n", found_program);
-      g_free(found_program);
-    } else {
-      g_warning("Ouch, no Qt demo program was found. Qt not installed?\n");
-      qt_probably_unavailable = TRUE;
+    {
+        const char *check_file = "qtdemo.exe";
+        gchar *found_program = g_find_program_in_path(check_file);
+        if (found_program)
+        {
+            g_debug("Yes, we found the Qt demo program in %s\n", found_program);
+            g_free(found_program);
+        }
+        else
+        {
+            g_warning("Ouch, no Qt demo program was found. Qt not installed?\n");
+            qt_probably_unavailable = TRUE;
+        }
     }
-  }
 #endif
 
-  druid_disable_next_button(info);
-  /* AB_Banking_DeactivateProvider(banking, backend_name); */
-  if (wizard_exists) {
-    /* Call the qt wizard. See the note above about why this approach
-       is chosen. */
+    druid_disable_next_button(info);
+    /* AB_Banking_DeactivateProvider(banking, backend_name); */
+    if (wizard_exists)
+    {
+        /* Call the qt wizard. See the note above about why this approach
+           is chosen. */
 
 #if ((AQBANKING_VERSION_MAJOR == 2) && \
      (AQBANKING_VERSION_MINOR >= 3))
-    /* With aqbanking>=2.3.0, we can directly activate all backends
-       here. Reduces user confusion. But in aqbanking-3.x this won't
-       be needed anymore. */
-    AB_Banking_ActivateAllProviders (info->api);
+        /* With aqbanking>=2.3.0, we can directly activate all backends
+           here. Reduces user confusion. But in aqbanking-3.x this won't
+           be needed anymore. */
+        AB_Banking_ActivateAllProviders (info->api);
 #endif
 
-    /* Reset existing mapping tables */
-    AB_Banking_Fini (info->api);
-    if (info->gnc_hash != NULL)
-      g_hash_table_destroy (info->gnc_hash);
-    info->gnc_hash = NULL;
+        /* Reset existing mapping tables */
+        AB_Banking_Fini (info->api);
+        if (info->gnc_hash != NULL)
+            g_hash_table_destroy (info->gnc_hash);
+        info->gnc_hash = NULL;
 
-    {
-      GPid pid;
-      GError *error = NULL;
-      gchar *argv[2];
-      gboolean spawned;
+        {
+            GPid pid;
+            GError *error = NULL;
+            gchar *argv[2];
+            gboolean spawned;
 
-      argv[0] = g_strdup (wizard_path);
-      argv[1] = NULL;
-      spawned = g_spawn_async (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD,
-			       NULL, NULL, &pid, &error);
-      g_free (argv[0]);
+            argv[0] = g_strdup (wizard_path);
+            argv[1] = NULL;
+            spawned = g_spawn_async (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD,
+                                     NULL, NULL, &pid, &error);
+            g_free (argv[0]);
 
-      if (error)
-	g_critical("Error on starting AqBanking setup wizard: Code %d: %s",
-		   error->code,
-		   error->message ? error->message : "(null)");
+            if (error)
+                g_critical("Error on starting AqBanking setup wizard: Code %d: %s",
+                           error->code,
+                           error->message ? error->message : "(null)");
 
-      if (!spawned) {
-	g_critical("Could not start AqBanking setup wizard: %s",
-		   error->message ? error->message : "(null)");
-	g_error_free (error);
-	res = -1;
-      } else {
-	g_child_watch_add (pid, on_child_exit, &res);
-	hbci_druid_is_active = TRUE;
-	gtk_main ();
-	if (!hbci_druid_is_active) {
-	  /* Just in case the druid has been canceled in the meantime. */
-	  g_free (backend_name);
-	  GWEN_Buffer_free(buf);
-	  return;
-	}
-      }
-      AB_Banking_Init (info->api);
-    }
+            if (!spawned)
+            {
+                g_critical("Could not start AqBanking setup wizard: %s",
+                           error->message ? error->message : "(null)");
+                g_error_free (error);
+                res = -1;
+            }
+            else
+            {
+                g_child_watch_add (pid, on_child_exit, &res);
+                hbci_druid_is_active = TRUE;
+                gtk_main ();
+                if (!hbci_druid_is_active)
+                {
+                    /* Just in case the druid has been canceled in the meantime. */
+                    g_free (backend_name);
+                    GWEN_Buffer_free(buf);
+                    return;
+                }
+            }
+            AB_Banking_Init (info->api);
+        }
 
-    if (res == 0) {
+        if (res == 0)
+        {
 #ifndef AQBANKING_WIZARD_ALLBACKENDS
-      res = AB_Banking_ActivateProvider(banking, backend_name);
+            res = AB_Banking_ActivateProvider(banking, backend_name);
 #endif
-      if ((res == 0) || (res == AB_ERROR_FOUND))
-	druid_enable_next_button(info);
-      else {
-	g_warning("on_aqhbci_button: Oops, after successful wizard the activation return nonzero value: %d. \n", res);
-	druid_disable_next_button(info);
-      }
+            if ((res == 0) || (res == AB_ERROR_FOUND))
+                druid_enable_next_button(info);
+            else
+            {
+                g_warning("on_aqhbci_button: Oops, after successful wizard the activation return nonzero value: %d. \n", res);
+                druid_disable_next_button(info);
+            }
+        }
+        else
+        {
+            if (qt_probably_unavailable)
+            {
+                g_warning("on_aqhbci_button: Oops, aqhbci wizard return nonzero value: %d. The called program was \"%s\".\n", res, wizard_path);
+                gnc_error_dialog
+                (info->window,
+                 _("The external program \"AqBanking Setup Wizard\" failed "
+                   "to run successfully because the "
+                   "additional software \"Qt\" was not found.  "
+                   "Please install the \"Qt/Windows Open Source Edition\" "
+                   "from Trolltech by downloading it from www.trolltech.com"
+                   "\n\n"
+                   "If you have installed Qt already, you will have to adapt "
+                   "the PATH variable of your system appropriately.  "
+                   "Contact the GnuCash developers if you need further "
+                   "assistance on how to install Qt correctly."
+                   "\n\n"
+                   "Online Banking cannot be setup without Qt.  Press \"Close\" "
+                   "now, then \"Cancel\" to cancel the Online Banking setup."));
+            }
+            else
+            {
+                g_warning("on_aqhbci_button: Oops, aqhbci wizard return nonzero value: %d. The called program was \"%s\".\n", res, wizard_path);
+                gnc_error_dialog
+                (info->window,
+                 _("The external program \"AqBanking Setup Wizard\" failed "
+                   "to run successfully.  Online Banking can only be setup "
+                   "if this wizard has run successfully.  "
+                   "Please try running the \"AqBanking Setup Wizard\" again."));
+            }
+            druid_disable_next_button(info);
+        }
     }
-    else {
-      if (qt_probably_unavailable) {
-	g_warning("on_aqhbci_button: Oops, aqhbci wizard return nonzero value: %d. The called program was \"%s\".\n", res, wizard_path);
-	gnc_error_dialog
-	  (info->window,
-	   _("The external program \"AqBanking Setup Wizard\" failed "
-	     "to run successfully because the "
-	     "additional software \"Qt\" was not found.  "
-	     "Please install the \"Qt/Windows Open Source Edition\" "
-	     "from Trolltech by downloading it from www.trolltech.com"
-	     "\n\n"
-	     "If you have installed Qt already, you will have to adapt "
-	     "the PATH variable of your system appropriately.  "
-	     "Contact the GnuCash developers if you need further "
-	     "assistance on how to install Qt correctly."
-	     "\n\n"
-	     "Online Banking cannot be setup without Qt.  Press \"Close\" "
-	     "now, then \"Cancel\" to cancel the Online Banking setup."));
-      } else {
-      g_warning("on_aqhbci_button: Oops, aqhbci wizard return nonzero value: %d. The called program was \"%s\".\n", res, wizard_path);
-      gnc_error_dialog
-	(info->window,
-	 _("The external program \"AqBanking Setup Wizard\" failed "
-	   "to run successfully.  Online Banking can only be setup "
-	   "if this wizard has run successfully.  "
-	   "Please try running the \"AqBanking Setup Wizard\" again."));
-      }
-      druid_disable_next_button(info);
+    else
+    {
+        g_warning("on_aqhbci_button: Oops, no aqhbci setup wizard found.");
+        gnc_error_dialog
+        (info->window,
+         _("The external program \"AqBanking Setup Wizard\" has not "
+           "been found. \n\n"
+           "The %s package should include the "
+           "program \"qt3-wizard\".  Please check your installation to "
+           "ensure this program is present.  On some distributions this "
+           "may require installing additional packages."), QT3_WIZARD_PACKAGE);
+        druid_disable_next_button(info);
     }
-  } else {
-    g_warning("on_aqhbci_button: Oops, no aqhbci setup wizard found.");
-    gnc_error_dialog
-      (info->window,
-       _("The external program \"AqBanking Setup Wizard\" has not "
-	 "been found. \n\n"
-	 "The %s package should include the "
-	 "program \"qt3-wizard\".  Please check your installation to "
-	 "ensure this program is present.  On some distributions this "
-	 "may require installing additional packages."), QT3_WIZARD_PACKAGE);
-    druid_disable_next_button(info);
-  }
-  g_free (backend_name);
-  GWEN_Buffer_free(buf);
+    g_free (backend_name);
+    GWEN_Buffer_free(buf);
 }
 
 
@@ -704,89 +734,89 @@
 
 void gnc_hbci_initial_druid (void)
 {
-  HBCIInitialInfo *info;
-  GladeXML *xml;
-  GtkWidget *page;
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
-  GtkTreeSelection *selection;
-  gint component_id;
-  
-  info = g_new0 (HBCIInitialInfo, 1);
+    HBCIInitialInfo *info;
+    GladeXML *xml;
+    GtkWidget *page;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+    GtkTreeSelection *selection;
+    gint component_id;
 
-  xml = gnc_glade_xml_new ("hbci.glade", "HBCI Init Druid");
+    info = g_new0 (HBCIInitialInfo, 1);
 
-  info->window = glade_xml_get_widget (xml, "HBCI Init Druid");
+    xml = gnc_glade_xml_new ("hbci.glade", "HBCI Init Druid");
 
-  info->druid = glade_xml_get_widget (xml, "hbci_init_druid");
-  gnc_druid_set_colors (GNOME_DRUID (info->druid));
-  
-  glade_xml_signal_connect_data (xml, "on_finish", 
-				 G_CALLBACK (on_finish), info);
-  glade_xml_signal_connect_data (xml, "on_cancel", 
-				 G_CALLBACK (on_cancel), info);
-  
-  info->api = gnc_AB_BANKING_new_currentbook(info->window, &(info->interactor));
-  g_assert(info->api);
+    info->window = glade_xml_get_widget (xml, "HBCI Init Druid");
 
-  {
-    /* Page with config file entry widget */
-    page = glade_xml_get_widget(xml, "configfile_page");
-    info->filepage = page;
-    g_signal_connect (page, "prepare",
-		      G_CALLBACK (on_aqbutton_prepare), info);
-    g_signal_connect (glade_xml_get_widget (xml, "aqhbci_button"),
-		      "clicked",
-		      G_CALLBACK (on_aqhbci_button), info);
-  }
-  {
-    page = glade_xml_get_widget(xml, "account_match_page");
-    info->accountpage = page;
-    info->accountview =
-      GTK_TREE_VIEW(glade_xml_get_widget(xml, "account_page_view"));
-    info->accountstore = gtk_list_store_new(NUM_ACCOUNT_LIST_COLS,
-					    G_TYPE_INT, G_TYPE_STRING,
-					    G_TYPE_POINTER, G_TYPE_STRING,
-					    G_TYPE_BOOLEAN);
-    gtk_tree_view_set_model(info->accountview, GTK_TREE_MODEL(info->accountstore));
-    g_object_unref(info->accountstore);
+    info->druid = glade_xml_get_widget (xml, "hbci_init_druid");
+    gnc_druid_set_colors (GNOME_DRUID (info->druid));
 
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Online Banking Account Name"),
-						      renderer,
-						      "text", ACCOUNT_LIST_COL_HBCI_NAME,
-						      NULL);
-    gtk_tree_view_append_column(info->accountview, column);
+    glade_xml_signal_connect_data (xml, "on_finish",
+                                   G_CALLBACK (on_finish), info);
+    glade_xml_signal_connect_data (xml, "on_cancel",
+                                   G_CALLBACK (on_cancel), info);
 
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("GnuCash Account Name"),
-						      renderer,
-						      "text", ACCOUNT_LIST_COL_GNC_NAME,
-						      NULL);
-    gtk_tree_view_append_column(info->accountview, column);
-    gtk_tree_view_column_set_expand(column, TRUE);
+    info->api = gnc_AB_BANKING_new_currentbook(info->window, &(info->interactor));
+    g_assert(info->api);
 
-    renderer = gtk_cell_renderer_toggle_new();
-    column = gtk_tree_view_column_new_with_attributes(_("New?"),
-						      renderer,
-						      "active", ACCOUNT_LIST_COL_CHECKED,
-						      NULL);
-    gtk_tree_view_append_column(info->accountview, column);
+    {
+        /* Page with config file entry widget */
+        page = glade_xml_get_widget(xml, "configfile_page");
+        info->filepage = page;
+        g_signal_connect (page, "prepare",
+                          G_CALLBACK (on_aqbutton_prepare), info);
+        g_signal_connect (glade_xml_get_widget (xml, "aqhbci_button"),
+                          "clicked",
+                          G_CALLBACK (on_aqhbci_button), info);
+    }
+    {
+        page = glade_xml_get_widget(xml, "account_match_page");
+        info->accountpage = page;
+        info->accountview =
+            GTK_TREE_VIEW(glade_xml_get_widget(xml, "account_page_view"));
+        info->accountstore = gtk_list_store_new(NUM_ACCOUNT_LIST_COLS,
+                                                G_TYPE_INT, G_TYPE_STRING,
+                                                G_TYPE_POINTER, G_TYPE_STRING,
+                                                G_TYPE_BOOLEAN);
+        gtk_tree_view_set_model(info->accountview, GTK_TREE_MODEL(info->accountstore));
+        g_object_unref(info->accountstore);
 
-    selection = gtk_tree_view_get_selection(info->accountview);
-    g_signal_connect (selection, "changed",
-		      G_CALLBACK (on_accountlist_changed), info);
-    g_signal_connect (page, "prepare", 
-		      G_CALLBACK (on_accountlist_prepare), info);
-  }
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes(_("Online Banking Account Name"),
+                 renderer,
+                 "text", ACCOUNT_LIST_COL_HBCI_NAME,
+                 NULL);
+        gtk_tree_view_append_column(info->accountview, column);
 
-  component_id = gnc_register_gui_component(DRUID_HBCI_IMPORT_CM_CLASS,
-					    NULL, cm_close_handler,
-					    info);
-  gnc_gui_component_set_session(component_id, gnc_get_current_session());
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes(_("GnuCash Account Name"),
+                 renderer,
+                 "text", ACCOUNT_LIST_COL_GNC_NAME,
+                 NULL);
+        gtk_tree_view_append_column(info->accountview, column);
+        gtk_tree_view_column_set_expand(column, TRUE);
 
-  /*g_signal_connect (dialog, "destroy",*/
-  /*                  G_CALLBACK(gnc_hierarchy_destroy_cb), NULL);*/
+        renderer = gtk_cell_renderer_toggle_new();
+        column = gtk_tree_view_column_new_with_attributes(_("New?"),
+                 renderer,
+                 "active", ACCOUNT_LIST_COL_CHECKED,
+                 NULL);
+        gtk_tree_view_append_column(info->accountview, column);
 
-  gtk_widget_show_all (info->window);
+        selection = gtk_tree_view_get_selection(info->accountview);
+        g_signal_connect (selection, "changed",
+                          G_CALLBACK (on_accountlist_changed), info);
+        g_signal_connect (page, "prepare",
+                          G_CALLBACK (on_accountlist_prepare), info);
+    }
+
+    component_id = gnc_register_gui_component(DRUID_HBCI_IMPORT_CM_CLASS,
+                   NULL, cm_close_handler,
+                   info);
+    gnc_gui_component_set_session(component_id, gnc_get_current_session());
+
+    /*g_signal_connect (dialog, "destroy",*/
+    /*                  G_CALLBACK(gnc_hierarchy_destroy_cb), NULL);*/
+
+    gtk_widget_show_all (info->window);
 }

Modified: gnucash/trunk/src/import-export/hbci/druid-hbci-utils.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/druid-hbci-utils.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/druid-hbci-utils.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -41,39 +41,39 @@
 static void
 accounts_save_kvp_cb (gpointer key, gpointer value, gpointer user_data)
 {
-  AB_ACCOUNT *hbci_acc = key;
-  Account *gnc_acc = value;
-  g_assert(hbci_acc);
-  g_assert(gnc_acc);
+    AB_ACCOUNT *hbci_acc = key;
+    Account *gnc_acc = value;
+    g_assert(hbci_acc);
+    g_assert(gnc_acc);
 
-  if (gnc_hbci_get_account_uid(gnc_acc) !=
-      AB_Account_GetUniqueId(hbci_acc))
-    gnc_hbci_set_account_uid
-      (gnc_acc, AB_Account_GetUniqueId(hbci_acc));
+    if (gnc_hbci_get_account_uid(gnc_acc) !=
+            AB_Account_GetUniqueId(hbci_acc))
+        gnc_hbci_set_account_uid
+        (gnc_acc, AB_Account_GetUniqueId(hbci_acc));
 
-  if (AB_Account_GetAccountNumber(hbci_acc) && 
-      ((gnc_hbci_get_account_accountid(gnc_acc) == NULL) ||
-       (strcmp(gnc_hbci_get_account_accountid(gnc_acc), 
-	       AB_Account_GetAccountNumber(hbci_acc)) != 0)))
-    gnc_hbci_set_account_accountid
-      (gnc_acc, AB_Account_GetAccountNumber(hbci_acc));
+    if (AB_Account_GetAccountNumber(hbci_acc) &&
+            ((gnc_hbci_get_account_accountid(gnc_acc) == NULL) ||
+             (strcmp(gnc_hbci_get_account_accountid(gnc_acc),
+                     AB_Account_GetAccountNumber(hbci_acc)) != 0)))
+        gnc_hbci_set_account_accountid
+        (gnc_acc, AB_Account_GetAccountNumber(hbci_acc));
 
-  if (AB_Account_GetBankCode(hbci_acc) && 
-      ((gnc_hbci_get_account_bankcode(gnc_acc) == NULL) ||
-       (strcmp(gnc_hbci_get_account_bankcode(gnc_acc), 
-	       AB_Account_GetBankCode(hbci_acc)) != 0)))
-    gnc_hbci_set_account_bankcode
-      (gnc_acc, AB_Account_GetBankCode(hbci_acc));
+    if (AB_Account_GetBankCode(hbci_acc) &&
+            ((gnc_hbci_get_account_bankcode(gnc_acc) == NULL) ||
+             (strcmp(gnc_hbci_get_account_bankcode(gnc_acc),
+                     AB_Account_GetBankCode(hbci_acc)) != 0)))
+        gnc_hbci_set_account_bankcode
+        (gnc_acc, AB_Account_GetBankCode(hbci_acc));
 }
 
 static void accounts_clear_kvp (Account *gnc_acc, gpointer user_data)
 {
-  if (gnc_hbci_get_account_uid(gnc_acc))
-    gnc_hbci_set_account_uid (gnc_acc, 0);
-  if (gnc_hbci_get_account_accountid(gnc_acc))
-    gnc_hbci_set_account_accountid (gnc_acc, "");
-  if (gnc_hbci_get_account_bankcode(gnc_acc))
-    gnc_hbci_set_account_bankcode (gnc_acc, "");
+    if (gnc_hbci_get_account_uid(gnc_acc))
+        gnc_hbci_set_account_uid (gnc_acc, 0);
+    if (gnc_hbci_get_account_accountid(gnc_acc))
+        gnc_hbci_set_account_accountid (gnc_acc, "");
+    if (gnc_hbci_get_account_bankcode(gnc_acc))
+        gnc_hbci_set_account_bankcode (gnc_acc, "");
 }
 
 /* hash is a DIRECT hash from each HBCI account to each gnucash
@@ -81,13 +81,13 @@
 void
 accounts_save_kvp (GHashTable *hash)
 {
-  Account *root;
-  g_assert(hash);
+    Account *root;
+    g_assert(hash);
 
-  root = gnc_book_get_root_account (gnc_get_current_book ());
-  gnc_account_foreach_descendant (root, accounts_clear_kvp, NULL);
+    root = gnc_book_get_root_account (gnc_get_current_book ());
+    gnc_account_foreach_descendant (root, accounts_clear_kvp, NULL);
 
-  g_hash_table_foreach (hash, &accounts_save_kvp_cb, NULL);
+    g_hash_table_foreach (hash, &accounts_save_kvp_cb, NULL);
 }
 /*
 ******************************************************/
@@ -95,79 +95,83 @@
 
 
 void
-update_accounts (GtkWidget *parent, AB_BANKING *api, GNCInteractor *inter) 
+update_accounts (GtkWidget *parent, AB_BANKING *api, GNCInteractor *inter)
 {
-  g_assert(api);
+    g_assert(api);
 
 }
 
 
 
-struct hbci_acc_cb_data 
+struct hbci_acc_cb_data
 {
-  AB_BANKING *api;
-  GHashTable *hash;
+    AB_BANKING *api;
+    GHashTable *hash;
 };
 
-static void 
+static void
 gnc_hbci_new_hash_from_kvp_cb (Account *gnc_acc, gpointer user_data)
 {
-  struct hbci_acc_cb_data *data = user_data;
-  AB_ACCOUNT *hbci_acc = NULL;
+    struct hbci_acc_cb_data *data = user_data;
+    AB_ACCOUNT *hbci_acc = NULL;
 
-  hbci_acc = (AB_ACCOUNT *) gnc_hbci_get_hbci_acc (data->api, gnc_acc);
-  if (hbci_acc) {
-    g_hash_table_insert (data->hash, hbci_acc, gnc_acc);
-  }
+    hbci_acc = (AB_ACCOUNT *) gnc_hbci_get_hbci_acc (data->api, gnc_acc);
+    if (hbci_acc)
+    {
+        g_hash_table_insert (data->hash, hbci_acc, gnc_acc);
+    }
 }
 
 GHashTable *
 gnc_hbci_new_hash_from_kvp (AB_BANKING *api)
 {
-  GHashTable *hash;
+    GHashTable *hash;
 
-  hash = g_hash_table_new (&g_direct_hash, &g_direct_equal);
-  if (api) {
-    struct hbci_acc_cb_data data;
-    Account *root = gnc_book_get_root_account (gnc_get_current_book ());
-    data.api = api;
-    data.hash = hash;
-    gnc_account_foreach_descendant(root, gnc_hbci_new_hash_from_kvp_cb, &data);
-  }
-  return hash;
+    hash = g_hash_table_new (&g_direct_hash, &g_direct_equal);
+    if (api)
+    {
+        struct hbci_acc_cb_data data;
+        Account *root = gnc_book_get_root_account (gnc_get_current_book ());
+        data.api = api;
+        data.hash = hash;
+        gnc_account_foreach_descendant(root, gnc_hbci_new_hash_from_kvp_cb, &data);
+    }
+    return hash;
 }
 
 
-gboolean 
+gboolean
 gnc_verify_exist_or_new_file (GtkWidget *parent, const char *filename)
 {
-  g_assert (parent);
-  
-  if (g_file_test (filename, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK)) {
-    return TRUE;
-  }
+    g_assert (parent);
 
-  return gnc_verify_dialog
-    (parent, TRUE,
-     _("The file %s does not exist. Would you like to create it now?"),
-     filename ? filename : _("(null)"));
+    if (g_file_test (filename, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK))
+    {
+        return TRUE;
+    }
+
+    return gnc_verify_dialog
+           (parent, TRUE,
+            _("The file %s does not exist. Would you like to create it now?"),
+            filename ? filename : _("(null)"));
 }
 
 gboolean
-gnc_test_dir_exist_error (GtkWindow *parent, const char *filename) 
+gnc_test_dir_exist_error (GtkWindow *parent, const char *filename)
 {
-  char *dirname = g_path_get_dirname (filename);
-  gboolean dirtest = g_file_test (dirname, G_FILE_TEST_IS_DIR);
-  g_free (dirname);
-  if (!dirtest) {
-    gnc_error_dialog
-      (GTK_WIDGET (parent), 
-       _("The directory for file %s does not exist. "
-	 "Please choose another place for this file."), 
-       filename ? filename : _("(null)"));
-    return FALSE;
-  }
-  return TRUE;
+    char *dirname = g_path_get_dirname (filename);
+    gboolean dirtest = g_file_test (dirname, G_FILE_TEST_IS_DIR);
+    g_free (dirname);
+    if (!dirtest)
+    {
+        gnc_error_dialog
+        (GTK_WIDGET (parent),
+         _("The directory for file %s does not exist. "
+           "Please choose another place for this file."),
+         filename ? filename : _("(null)"));
+        return FALSE;
+    }
+    return TRUE;
 }
 
 

Modified: gnucash/trunk/src/import-export/hbci/druid-hbci-utils.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/druid-hbci-utils.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/druid-hbci-utils.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -38,8 +38,8 @@
  * AB_BANKING. Straightforward, if we have only one bank and one user
  * with one customer. All other cases are not currently
  * implemented. */
-void update_accounts (GtkWidget *parent, AB_BANKING *api, 
-		      GNCInteractor *inter);
+void update_accounts (GtkWidget *parent, AB_BANKING *api,
+                      GNCInteractor *inter);
 
 /** Builds a new hash table mapping all HBCI accounts to Gnucash
  * accounts, where the Gnucash accounts already have the reference
@@ -47,7 +47,7 @@
 GHashTable *
 gnc_hbci_new_hash_from_kvp (AB_BANKING *api);
 
-gboolean 
+gboolean
 gnc_verify_exist_or_new_file (GtkWidget *parent, const char *filename);
 
 gboolean

Modified: gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -63,164 +63,174 @@
 \********************************************************************/
 
 void gnc_file_aqbanking_import (const gchar *aqbanking_importername,
-				const gchar *aqbanking_profilename,
-				gboolean execute_transactions)
+                                const gchar *aqbanking_profilename,
+                                gboolean execute_transactions)
 {
-  char *selected_filename;
-  char *default_dir;
-  int dtaus_fd;
+    char *selected_filename;
+    char *default_dir;
+    int dtaus_fd;
 
-  DEBUG("gnc_file_dtaus_import(): Begin...\n");
+    DEBUG("gnc_file_dtaus_import(): Begin...\n");
 
-  default_dir = gnc_get_default_directory(GCONF_SECTION);
-  selected_filename = gnc_file_dialog(_("Select a file to import"),
-				      NULL,
-				      default_dir,
-				      GNC_FILE_DIALOG_IMPORT);
-  g_free(default_dir);
-
-  if(selected_filename!=NULL) {
-    /* Remember the directory as the default. */
-    default_dir = g_path_get_dirname(selected_filename);
-    gnc_set_default_directory(GCONF_SECTION, default_dir);
+    default_dir = gnc_get_default_directory(GCONF_SECTION);
+    selected_filename = gnc_file_dialog(_("Select a file to import"),
+                                        NULL,
+                                        default_dir,
+                                        GNC_FILE_DIALOG_IMPORT);
     g_free(default_dir);
 
-    /*strncpy(file,selected_filename, 255);*/
-    DEBUG("Filename found: %s",selected_filename);
+    if (selected_filename != NULL)
+    {
+        /* Remember the directory as the default. */
+        default_dir = g_path_get_dirname(selected_filename);
+        gnc_set_default_directory(GCONF_SECTION, default_dir);
+        g_free(default_dir);
 
-    DEBUG("Opening selected file");
-    dtaus_fd = g_open(selected_filename, O_RDONLY, 0);
-    if (dtaus_fd == -1) {
-      DEBUG("Could not open file %s", selected_filename);
-      return;
-    }
-    g_free(selected_filename);
+        /*strncpy(file,selected_filename, 255);*/
+        DEBUG("Filename found: %s", selected_filename);
 
-    {
-      int result;
-      AB_BANKING *ab;
-      AB_IMEXPORTER *importer;
-      AB_IMEXPORTER_CONTEXT *ctx=0;
-      GWEN_BUFFEREDIO *buffio;
-      GWEN_DB_NODE *dbProfiles;
-      GWEN_DB_NODE *dbProfile;
-      GNCInteractor *interactor = NULL;
-      const char *importerName = aqbanking_importername;
-      const char *profileName = aqbanking_profilename;
+        DEBUG("Opening selected file");
+        dtaus_fd = g_open(selected_filename, O_RDONLY, 0);
+        if (dtaus_fd == -1)
+        {
+            DEBUG("Could not open file %s", selected_filename);
+            return;
+        }
+        g_free(selected_filename);
 
-      /* Get API */
-      ab = gnc_AB_BANKING_new_currentbook (NULL, &interactor);
-      if (ab == NULL) {
-	g_message("gnc_file_dtaus_import: Couldn't get HBCI API. Nothing will happen.\n");
-	return;
-      }
-      g_assert (interactor);
+        {
+            int result;
+            AB_BANKING *ab;
+            AB_IMEXPORTER *importer;
+            AB_IMEXPORTER_CONTEXT *ctx = 0;
+            GWEN_BUFFEREDIO *buffio;
+            GWEN_DB_NODE *dbProfiles;
+            GWEN_DB_NODE *dbProfile;
+            GNCInteractor *interactor = NULL;
+            const char *importerName = aqbanking_importername;
+            const char *profileName = aqbanking_profilename;
 
-      /* get import module */
-      importer=AB_Banking_GetImExporter(ab, importerName);
-      if (!importer) {
-	DEBUG("Import module %s not found", importerName);
-	gnc_error_dialog(NULL, "%s",("Import module for DTAUS import not found."));
-	return;
-      }
-      g_assert(importer);
+            /* Get API */
+            ab = gnc_AB_BANKING_new_currentbook (NULL, &interactor);
+            if (ab == NULL)
+            {
+                g_message("gnc_file_dtaus_import: Couldn't get HBCI API. Nothing will happen.\n");
+                return;
+            }
+            g_assert (interactor);
 
-      /* load the import profile */
-      dbProfiles=AB_Banking_GetImExporterProfiles(ab, importerName);
+            /* get import module */
+            importer = AB_Banking_GetImExporter(ab, importerName);
+            if (!importer)
+            {
+                DEBUG("Import module %s not found", importerName);
+                gnc_error_dialog(NULL, "%s", ("Import module for DTAUS import not found."));
+                return;
+            }
+            g_assert(importer);
 
-      /* select profile */
-      dbProfile=GWEN_DB_GetFirstGroup(dbProfiles);
-      while(dbProfile) {
-	const char *name;
+            /* load the import profile */
+            dbProfiles = AB_Banking_GetImExporterProfiles(ab, importerName);
 
-	name=GWEN_DB_GetCharValue(dbProfile, "name", 0, 0);
-	g_assert(name);
-	if (strcasecmp(name, profileName)==0)
-	  break;
-	dbProfile=GWEN_DB_GetNextGroup(dbProfile);
-      }
-      if (!dbProfile) {
-	g_warning("Profile \"%s\" for importer \"%s\" not found\n",
-	      profileName, importerName);
-	/* For debugging: Print those available names that have been found. */
-	dbProfile=GWEN_DB_GetFirstGroup(dbProfiles);
-	while(dbProfile) {
-	  const char *name;
-	  name=GWEN_DB_GetCharValue(dbProfile, "name", 0, 0);
-	  g_assert(name);
-	  g_warning("Only found profile \"%s\"\n", name);
-	  dbProfile=GWEN_DB_GetNextGroup(dbProfile);
-	}
-	return;
-      }
-      g_assert(dbProfile);
+            /* select profile */
+            dbProfile = GWEN_DB_GetFirstGroup(dbProfiles);
+            while (dbProfile)
+            {
+                const char *name;
 
-      /* import new context */
-      ctx=AB_ImExporterContext_new();
-      g_assert(ctx);
+                name = GWEN_DB_GetCharValue(dbProfile, "name", 0, 0);
+                g_assert(name);
+                if (strcasecmp(name, profileName) == 0)
+                    break;
+                dbProfile = GWEN_DB_GetNextGroup(dbProfile);
+            }
+            if (!dbProfile)
+            {
+                g_warning("Profile \"%s\" for importer \"%s\" not found\n",
+                          profileName, importerName);
+                /* For debugging: Print those available names that have been found. */
+                dbProfile = GWEN_DB_GetFirstGroup(dbProfiles);
+                while (dbProfile)
+                {
+                    const char *name;
+                    name = GWEN_DB_GetCharValue(dbProfile, "name", 0, 0);
+                    g_assert(name);
+                    g_warning("Only found profile \"%s\"\n", name);
+                    dbProfile = GWEN_DB_GetNextGroup(dbProfile);
+                }
+                return;
+            }
+            g_assert(dbProfile);
 
-      /* Wrap file in gwen_bufferedio */
-      buffio = GWEN_BufferedIO_File_new(dtaus_fd);
-      g_assert(buffio);
-      GWEN_BufferedIO_SetReadBuffer(buffio, 0, 1024);
+            /* import new context */
+            ctx = AB_ImExporterContext_new();
+            g_assert(ctx);
 
-      result = AB_ImExporter_Import(importer,
-				  ctx,
-				  buffio,
-				  dbProfile);
+            /* Wrap file in gwen_bufferedio */
+            buffio = GWEN_BufferedIO_File_new(dtaus_fd);
+            g_assert(buffio);
+            GWEN_BufferedIO_SetReadBuffer(buffio, 0, 1024);
 
-      DEBUG("Parsing result: %d\n", result);
+            result = AB_ImExporter_Import(importer,
+                                          ctx,
+                                          buffio,
+                                          dbProfile);
 
-      GWEN_BufferedIO_Close(buffio);
-      GWEN_BufferedIO_free(buffio);
-      GWEN_DB_Group_free(dbProfiles);
+            DEBUG("Parsing result: %d\n", result);
 
-      {
-	/* Now get all accountinfos */
-	GNCImportMainMatcher *importer_generic_gui;
-	GtkWidget *parent = NULL;
-	gboolean successful = FALSE;
-	GList *ab_job_list;
+            GWEN_BufferedIO_Close(buffio);
+            GWEN_BufferedIO_free(buffio);
+            GWEN_DB_Group_free(dbProfiles);
 
-	/* Create importer GUI */
-	importer_generic_gui = gnc_gen_trans_list_new(parent, NULL, TRUE, 14);
+            {
+                /* Now get all accountinfos */
+                GNCImportMainMatcher *importer_generic_gui;
+                GtkWidget *parent = NULL;
+                gboolean successful = FALSE;
+                GList *ab_job_list;
 
-	/* Import the transactions from the ctx into gnucash. */
-	ab_job_list = gnc_hbci_import_ctx(ab, ctx, importer_generic_gui,
-					  execute_transactions);
-	/* Finished importing. */
+                /* Create importer GUI */
+                importer_generic_gui = gnc_gen_trans_list_new(parent, NULL, TRUE, 14);
 
-	/* We clean up here. */
-	AB_ImExporterContext_free(ctx);
+                /* Import the transactions from the ctx into gnucash. */
+                ab_job_list = gnc_hbci_import_ctx(ab, ctx, importer_generic_gui,
+                                                  execute_transactions);
+                /* Finished importing. */
 
-	if (execute_transactions) {
-	  /* Wait for the gnucash importer to be finished (it is being
-	     run anyway). */
-	  result = gnc_gen_trans_list_run (importer_generic_gui);
+                /* We clean up here. */
+                AB_ImExporterContext_free(ctx);
 
-	  if (result)
-	    /* Execute these jobs now. This function already delete()s the
-	       job. */
-	    /* no parent so far; otherwise add this: GNCInteractor_reparent (interactor, parent); */
-	    successful = gnc_hbci_multijob_execute (parent, ab, ab_job_list, interactor);
-	  /* else */
-	  
-	  /* Delete all jobs from queue in any case. */
-	  gnc_hbci_clearqueue (ab, ab_job_list);
-	}
-	else {
-	  successful = TRUE;
-	}
+                if (execute_transactions)
+                {
+                    /* Wait for the gnucash importer to be finished (it is being
+                       run anyway). */
+                    result = gnc_gen_trans_list_run (importer_generic_gui);
 
-	if (successful) {
-	  /* If execution was not successful, leave the log window
-	     still intact and open. */
-	  gnc_AB_BANKING_fini (ab);
-	  gnc_AB_BANKING_delete (ab);
-	}
-      }
+                    if (result)
+                        /* Execute these jobs now. This function already delete()s the
+                           job. */
+                        /* no parent so far; otherwise add this: GNCInteractor_reparent (interactor, parent); */
+                        successful = gnc_hbci_multijob_execute (parent, ab, ab_job_list, interactor);
+                    /* else */
+
+                    /* Delete all jobs from queue in any case. */
+                    gnc_hbci_clearqueue (ab, ab_job_list);
+                }
+                else
+                {
+                    successful = TRUE;
+                }
+
+                if (successful)
+                {
+                    /* If execution was not successful, leave the log window
+                       still intact and open. */
+                    gnc_AB_BANKING_fini (ab);
+                    gnc_AB_BANKING_delete (ab);
+                }
+            }
+        }
     }
-  }
 }
 
 

Modified: gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -16,12 +16,12 @@
  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 \********************************************************************/
- /** @file
-     @brief dtaus import module interface
-     *
-     gnc-dtaus-import.h
-     @author Copyright (c) 2002 Benoit Grégoire <bock at step.polymtl.ca>
- */
+/** @file
+    @brief dtaus import module interface
+    *
+    gnc-dtaus-import.h
+    @author Copyright (c) 2002 Benoit Grégoire <bock at step.polymtl.ca>
+*/
 #ifndef DTAUS_IMPORT_H
 #define DTAUS_IMPORT_H
 
@@ -38,8 +38,8 @@
  * @param aqbanking_formatname In aqbanking, each importer has one or
  * more data formats available which define the actual data
  * fields that should be used. In aqbanking, such a different format
- * is called a "profile". 
- * Possible values for swift: "swift-mt940" or "swift-mt942", 
+ * is called a "profile".
+ * Possible values for swift: "swift-mt940" or "swift-mt942",
  * but for all others: "default", or more precisely: Look into
  * $datadir/aqbanking/imexporters and look into the "name" field of
  * the foo.conf files.
@@ -49,8 +49,8 @@
  * just import the transactions and that's it.
  */
 void gnc_file_aqbanking_import (const gchar *aqbanking_importername,
-				const gchar *aqbanking_formatname,
-				gboolean exec_as_aqbanking_jobs);
+                                const gchar *aqbanking_formatname,
+                                gboolean exec_as_aqbanking_jobs);
 
 
 #endif

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -38,301 +38,317 @@
 
 
 void gnc_hbci_getbalance_debugprint(AB_JOB *balance_job,
-				    const AB_ACCOUNT *h_acc);
+                                    const AB_ACCOUNT *h_acc);
 
 #if 0
-static void 
+static void
 bal_print_debug(const char *name,
-		const AB_VALUE *val,
-		gboolean negative,
-		const char *date_str,
-		const char *time_str)
+                const AB_VALUE *val,
+                gboolean negative,
+                const char *date_str,
+                const char *time_str)
 {
-  char *str = gnc_AB_VALUE_toReadableString (val);
-  g_message("GetBalance: %s%s %s at date %s %s",
-	 (negative ? "-" : ""), str, 
-	 name, date_str, time_str);
-  free (str);
+    char *str = gnc_AB_VALUE_toReadableString (val);
+    g_message("GetBalance: %s%s %s at date %s %s",
+              (negative ? "-" : ""), str,
+              name, date_str, time_str);
+    free (str);
 }
-#endif 
+#endif
 
 
 void
 gnc_hbci_getbalance (GtkWidget *parent, Account *gnc_acc)
 {
-  AB_BANKING *api = NULL;
-  const AB_ACCOUNT *h_acc = NULL;
-  GNCInteractor *interactor = NULL;
-  
-  g_assert(parent);
-  if (gnc_acc == NULL)
-    return;
+    AB_BANKING *api = NULL;
+    const AB_ACCOUNT *h_acc = NULL;
+    GNCInteractor *interactor = NULL;
 
-  /* Get API */
-  api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
-  if (api == NULL) {
-    g_message("gnc_hbci_getbalance: Couldn't get AB_BANKING API.\n");
-    return;
-  }
-  g_assert (interactor);
+    g_assert(parent);
+    if (gnc_acc == NULL)
+        return;
 
-  /* Get HBCI account */
-  h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
-  if (h_acc == NULL) {
-    g_warning("gnc_hbci_getbalance: No HBCI account found.\n");
-    /* FIXME: free unneeded data */
-    return;
-  }
-  /* g_message("gnc_hbci_getbalance: HBCI account no. %s found.\n",
-     AB_ACCOUNT_accountId (h_acc)); */
-  
-  {
-    /* Execute a GetBalance job. */
-    AB_JOB *job;
+    /* Get API */
+    api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
+    if (api == NULL)
+    {
+        g_message("gnc_hbci_getbalance: Couldn't get AB_BANKING API.\n");
+        return;
+    }
+    g_assert (interactor);
 
-    job = AB_JobGetBalance_new((AB_ACCOUNT*)h_acc);
-    if (AB_Job_CheckAvailability(job)) {
-      g_message("gnc_hbci_getbalance: JobGetBalance not available for this account.\n");
-      /* FIXME: free unneeded data */
-      return;
+    /* Get HBCI account */
+    h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
+    if (h_acc == NULL)
+    {
+        g_warning("gnc_hbci_getbalance: No HBCI account found.\n");
+        /* FIXME: free unneeded data */
+        return;
     }
-    
-    /* Add job to API queue */
-    AB_Banking_EnqueueJob(api, job);
+    /* g_message("gnc_hbci_getbalance: HBCI account no. %s found.\n",
+       AB_ACCOUNT_accountId (h_acc)); */
 
-    /* Execute Outbox. */
-    if (!gnc_AB_BANKING_execute (parent, api, job, interactor)) {
+    {
+        /* Execute a GetBalance job. */
+        AB_JOB *job;
 
-      /* AB_BANKING_executeOutbox failed. */
-      gnc_hbci_cleanup_job(api, job);
-      /* FIXME: free unneeded data */
-      return;
-    }
+        job = AB_JobGetBalance_new((AB_ACCOUNT*)h_acc);
+        if (AB_Job_CheckAvailability(job))
+        {
+            g_message("gnc_hbci_getbalance: JobGetBalance not available for this account.\n");
+            /* FIXME: free unneeded data */
+            return;
+        }
 
-    /* gnc_hbci_getbalance_debugprint(balance_job, h_acc); */
-    
-    /* Finish this job. */
-    gnc_hbci_getbalance_finish (parent, 
-				gnc_acc,
-				job);
+        /* Add job to API queue */
+        AB_Banking_EnqueueJob(api, job);
 
-    /* Clean up after ourselves. */
-    gnc_hbci_cleanup_job(api, job);
-    gnc_AB_BANKING_fini (api);
-    GNCInteractor_hide (interactor);
-  }
+        /* Execute Outbox. */
+        if (!gnc_AB_BANKING_execute (parent, api, job, interactor))
+        {
+
+            /* AB_BANKING_executeOutbox failed. */
+            gnc_hbci_cleanup_job(api, job);
+            /* FIXME: free unneeded data */
+            return;
+        }
+
+        /* gnc_hbci_getbalance_debugprint(balance_job, h_acc); */
+
+        /* Finish this job. */
+        gnc_hbci_getbalance_finish (parent,
+                                    gnc_acc,
+                                    job);
+
+        /* Clean up after ourselves. */
+        gnc_hbci_cleanup_job(api, job);
+        gnc_AB_BANKING_fini (api);
+        GNCInteractor_hide (interactor);
+    }
 }
 
 
 #if 0
 void gnc_hbci_getbalance_debugprint(AB_JOB *job,
-				    const AB_ACCOUNT *h_acc)
+                                    const AB_ACCOUNT *h_acc)
 {
-  GWEN_DB_NODE *response, *acc_bal;
-  GWEN_DB_NODE *noted_grp, *booked_grp;
-  AB_VALUE *booked_val, *noted_val;
-  /* time_t balance_tt, noted_tt, booked_tt; */
-	
-  response = HBCI_Job_responseData(AB_JOB_Job(job));
-  if (!response)
-    return;
-  acc_bal =GWEN_DB_GetGroup(response, 
-			    GWEN_PATH_FLAGS_NAMEMUSTEXIST, "balance");
-  if (!acc_bal) 
-    return;
+    GWEN_DB_NODE *response, *acc_bal;
+    GWEN_DB_NODE *noted_grp, *booked_grp;
+    AB_VALUE *booked_val, *noted_val;
+    /* time_t balance_tt, noted_tt, booked_tt; */
 
-  noted_grp = GWEN_DB_GetGroup(response, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "noted");
-  booked_grp = GWEN_DB_GetGroup(response, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "booked");
+    response = HBCI_Job_responseData(AB_JOB_Job(job));
+    if (!response)
+        return;
+    acc_bal = GWEN_DB_GetGroup(response,
+                               GWEN_PATH_FLAGS_NAMEMUSTEXIST, "balance");
+    if (!acc_bal)
+        return;
 
-  booked_val = AB_VALUE_new(GWEN_DB_GetCharValue(booked_grp, "value", 0, "0"),
-			      GWEN_DB_GetCharValue(booked_grp, "currency", 0, "EUR"));
-  noted_val = AB_VALUE_new(GWEN_DB_GetCharValue(noted_grp, "value", 0, "0"),
-			     GWEN_DB_GetCharValue(noted_grp, "currency", 0, "EUR"));
-    
-  g_message("GetBalance: Balances for account %s :\n",
-	 AB_ACCOUNT_accountId (h_acc));
-  bal_print_debug("Booked balance",
-		  booked_val,
-		  (strcasecmp(GWEN_DB_GetCharValue(booked_grp, "debitmark", 0, "C"),"D")==0),
-		  GWEN_DB_GetCharValue(booked_grp, "date", 0, ""),
-		  GWEN_DB_GetCharValue(booked_grp, "time", 0, ""));
-  bal_print_debug("Noted balance",
-		  noted_val,
-		  (strcasecmp(GWEN_DB_GetCharValue(noted_grp, "debitmark", 0, "C"),"D")==0),
-		  GWEN_DB_GetCharValue(noted_grp, "date", 0, ""),
-		  GWEN_DB_GetCharValue(noted_grp, "time", 0, ""));
-/*   bal_print_debug("Bank Line",  */
-/* 		  AB_ACCOUNTBalance_bankLine (acc_bal), FALSE, */
-/* 		  balance_tt); */
-/*   bal_print_debug("Disposable amount", */
-/* 		  AB_ACCOUNTBalance_disposable (acc_bal), FALSE, */
-/* 		  balance_tt); */
-/*   bal_print_debug("Already disposed", */
-/* 		  AB_ACCOUNTBalance_disposed (acc_bal), FALSE, */
-/* 		  balance_tt); */
-  AB_VALUE_delete(booked_val);
-  AB_VALUE_delete(noted_val);
+    noted_grp = GWEN_DB_GetGroup(response, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "noted");
+    booked_grp = GWEN_DB_GetGroup(response, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "booked");
+
+    booked_val = AB_VALUE_new(GWEN_DB_GetCharValue(booked_grp, "value", 0, "0"),
+                              GWEN_DB_GetCharValue(booked_grp, "currency", 0, "EUR"));
+    noted_val = AB_VALUE_new(GWEN_DB_GetCharValue(noted_grp, "value", 0, "0"),
+                             GWEN_DB_GetCharValue(noted_grp, "currency", 0, "EUR"));
+
+    g_message("GetBalance: Balances for account %s :\n",
+              AB_ACCOUNT_accountId (h_acc));
+    bal_print_debug("Booked balance",
+                    booked_val,
+                    (strcasecmp(GWEN_DB_GetCharValue(booked_grp, "debitmark", 0, "C"), "D") == 0),
+                    GWEN_DB_GetCharValue(booked_grp, "date", 0, ""),
+                    GWEN_DB_GetCharValue(booked_grp, "time", 0, ""));
+    bal_print_debug("Noted balance",
+                    noted_val,
+                    (strcasecmp(GWEN_DB_GetCharValue(noted_grp, "debitmark", 0, "C"), "D") == 0),
+                    GWEN_DB_GetCharValue(noted_grp, "date", 0, ""),
+                    GWEN_DB_GetCharValue(noted_grp, "time", 0, ""));
+    /*   bal_print_debug("Bank Line",  */
+    /* 		  AB_ACCOUNTBalance_bankLine (acc_bal), FALSE, */
+    /* 		  balance_tt); */
+    /*   bal_print_debug("Disposable amount", */
+    /* 		  AB_ACCOUNTBalance_disposable (acc_bal), FALSE, */
+    /* 		  balance_tt); */
+    /*   bal_print_debug("Already disposed", */
+    /* 		  AB_ACCOUNTBalance_disposed (acc_bal), FALSE, */
+    /* 		  balance_tt); */
+    AB_VALUE_delete(booked_val);
+    AB_VALUE_delete(noted_val);
 }
 #endif
 
 static gchar*
 bal_print_balance(const char *format,
-		  const AB_VALUE *val)
+                  const AB_VALUE *val)
 {
-  char *str = gnc_AB_VALUE_toReadableString (val);
-  char *res = g_strdup_printf(format, 
-			      str);
-  free (str);
-  return res;
+    char *str = gnc_AB_VALUE_toReadableString (val);
+    char *res = g_strdup_printf(format,
+                                str);
+    free (str);
+    return res;
 }
 
 
 
 gboolean
-gnc_hbci_getbalance_finish (GtkWidget *parent, 
-			    Account *gnc_acc,
-			    const AB_JOB *job)
+gnc_hbci_getbalance_finish (GtkWidget *parent,
+                            Account *gnc_acc,
+                            const AB_JOB *job)
 {
-  const AB_ACCOUNT_STATUS *response;
-  const AB_BALANCE *noted_grp, *booked_grp;
-  const AB_VALUE *booked_val, *noted_val;
-  time_t booked_tt=0;
-  gboolean dialogres;
-  double booked_value, noted_value;
-  gnc_numeric value;
-  GtkWidget *dialog;
+    const AB_ACCOUNT_STATUS *response;
+    const AB_BALANCE *noted_grp, *booked_grp;
+    const AB_VALUE *booked_val, *noted_val;
+    time_t booked_tt = 0;
+    gboolean dialogres;
+    double booked_value, noted_value;
+    gnc_numeric value;
+    GtkWidget *dialog;
 
-  response = AB_JobGetBalance_GetAccountStatus((AB_JOB*)job);
-  if (!response) {
-    g_critical("gnc_hbci_getbalance_finish: Oops, response == NULL.\n");
-    return TRUE;
-  }
+    response = AB_JobGetBalance_GetAccountStatus((AB_JOB*)job);
+    if (!response)
+    {
+        g_critical("gnc_hbci_getbalance_finish: Oops, response == NULL.\n");
+        return TRUE;
+    }
 
-  noted_grp = AB_AccountStatus_GetNotedBalance(response);
-  booked_grp = AB_AccountStatus_GetBookedBalance(response);
+    noted_grp = AB_AccountStatus_GetNotedBalance(response);
+    booked_grp = AB_AccountStatus_GetBookedBalance(response);
 
-  if (booked_grp) {
-    const GWEN_TIME *ti;
+    if (booked_grp)
+    {
+        const GWEN_TIME *ti;
 
-    ti=AB_Balance_GetTime(booked_grp);
-    if (ti)
-      booked_tt = GWEN_Time_toTime_t (ti);
+        ti = AB_Balance_GetTime(booked_grp);
+        if (ti)
+            booked_tt = GWEN_Time_toTime_t (ti);
+        else
+            /* No time found? Use today because the HBCI query asked for
+            	 today's balance. */
+            booked_tt = gnc_timet_get_day_start(time(NULL));
+        booked_val = AB_Balance_GetValue(booked_grp);
+        if (booked_val)
+            booked_value = AB_Value_GetValue (booked_val);
+        else
+        {
+            g_warning("gnc_hbci_getbalance_finish: Warning: booked_val == NULL. Assuming 0.\n");
+            booked_value = 0.0;
+        }
+    }
     else
-      /* No time found? Use today because the HBCI query asked for
-	 today's balance. */
-      booked_tt = gnc_timet_get_day_start(time(NULL));
-    booked_val = AB_Balance_GetValue(booked_grp);
-    if (booked_val)
-      booked_value = AB_Value_GetValue (booked_val);
-    else {
-      g_warning("gnc_hbci_getbalance_finish: Warning: booked_val == NULL. Assuming 0.\n");
-      booked_value = 0.0;
+    {
+        g_warning("gnc_hbci_getbalance_finish: Warning: booked_grp == NULL. Assuming 0.\n");
+        booked_value = 0.0;
+        booked_val = NULL;
+        booked_tt = 0;
     }
-  } else {
-    g_warning("gnc_hbci_getbalance_finish: Warning: booked_grp == NULL. Assuming 0.\n");
-    booked_value = 0.0;
-    booked_val = NULL;
-    booked_tt = 0;
-  }
 
-  if (noted_grp) {
-    noted_val = AB_Balance_GetValue(noted_grp);
-    /* noted_tt = GWEN_Time_toTime_t (AB_Balance_GetTime(noted_grp)); */
-    if (noted_val)
-      noted_value = AB_Value_GetValue (noted_val);
-    else {
-      g_warning("gnc_hbci_getbalance_finish: Warning: noted_val == NULL. Assuming 0.\n");
-      noted_value = 0.0;
+    if (noted_grp)
+    {
+        noted_val = AB_Balance_GetValue(noted_grp);
+        /* noted_tt = GWEN_Time_toTime_t (AB_Balance_GetTime(noted_grp)); */
+        if (noted_val)
+            noted_value = AB_Value_GetValue (noted_val);
+        else
+        {
+            g_warning("gnc_hbci_getbalance_finish: Warning: noted_val == NULL. Assuming 0.\n");
+            noted_value = 0.0;
+        }
     }
-  } else {
-    g_warning("gnc_hbci_getbalance_finish: Warning: noted_grp == NULL. Assuming 0.\n");
-    noted_value = 0.0;
-    noted_val = NULL;
-  }
+    else
+    {
+        g_warning("gnc_hbci_getbalance_finish: Warning: noted_grp == NULL. Assuming 0.\n");
+        noted_value = 0.0;
+        noted_val = NULL;
+    }
 
-  value = double_to_gnc_numeric (booked_value,
-				 xaccAccountGetCommoditySCU(gnc_acc),
-				 GNC_RND_ROUND);
-  if ((noted_value == 0.0) && (booked_value == 0.0))
+    value = double_to_gnc_numeric (booked_value,
+                                   xaccAccountGetCommoditySCU(gnc_acc),
+                                   GNC_RND_ROUND);
+    if ((noted_value == 0.0) && (booked_value == 0.0))
     {
-      dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
-				      GTK_DIALOG_MODAL
-				      | GTK_DIALOG_DESTROY_WITH_PARENT,
-				      GTK_MESSAGE_INFO,
-				      GTK_BUTTONS_OK,
-				      "%s",
-      /* Translators: Strings from this file are needed only in
-       * countries that have one of aqbanking's Online Banking
-       * techniques available. This is 'OFX DirectConnect'
-       * (U.S. and others), 'HBCI' (in Germany), or 'YellowNet'
-       * (Switzerland). If none of these techniques are available
-       * in your country, you may safely ignore strings from the
-       * import-export/hbci subdirectory. */
-	 _("The downloaded Online Banking Balance was zero.\n\n"
-	   "Either this is the correct balance, or your bank does not "
-	   "support Balance download in this Online Banking version. "
-	   "In the latter case you should choose a different "
-	   "Online Banking version number in the Online Banking "
-	   "(AqBanking or HBCI) Setup. After that, try again to "
-	   "download the Online Banking Balance."));
-      gtk_dialog_run(GTK_DIALOG(dialog));
-      gtk_widget_destroy(GTK_WIDGET(dialog));
-      dialogres = FALSE;
+        dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
+                                        GTK_DIALOG_MODAL
+                                        | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                        GTK_MESSAGE_INFO,
+                                        GTK_BUTTONS_OK,
+                                        "%s",
+                                        /* Translators: Strings from this file are needed only in
+                                         * countries that have one of aqbanking's Online Banking
+                                         * techniques available. This is 'OFX DirectConnect'
+                                         * (U.S. and others), 'HBCI' (in Germany), or 'YellowNet'
+                                         * (Switzerland). If none of these techniques are available
+                                         * in your country, you may safely ignore strings from the
+                                         * import-export/hbci subdirectory. */
+                                        _("The downloaded Online Banking Balance was zero.\n\n"
+                                          "Either this is the correct balance, or your bank does not "
+                                          "support Balance download in this Online Banking version. "
+                                          "In the latter case you should choose a different "
+                                          "Online Banking version number in the Online Banking "
+                                          "(AqBanking or HBCI) Setup. After that, try again to "
+                                          "download the Online Banking Balance."));
+        gtk_dialog_run(GTK_DIALOG(dialog));
+        gtk_widget_destroy(GTK_WIDGET(dialog));
+        dialogres = FALSE;
     }
-  else
+    else
     {
-      gnc_numeric reconc_balance = xaccAccountGetReconciledBalance (gnc_acc);
+        gnc_numeric reconc_balance = xaccAccountGetReconciledBalance (gnc_acc);
 
-      char *booked_str = gnc_AB_VALUE_toReadableString (booked_val);
-      char *message1 = g_strdup_printf
-	(
-	 _("Result of Online Banking job: \n"
-	   "Account booked balance is %s"),
-	 booked_str);
-      char *message2 = 
-	((noted_value == 0.0) ?
-	 g_strdup_printf("%s", "") :
-	 bal_print_balance
-	 (_("For your information: This account also "
-	    "has a noted balance of %s\n"),
-	  noted_val));
+        char *booked_str = gnc_AB_VALUE_toReadableString (booked_val);
+        char *message1 = g_strdup_printf
+                         (
+                             _("Result of Online Banking job: \n"
+                               "Account booked balance is %s"),
+                             booked_str);
+        char *message2 =
+            ((noted_value == 0.0) ?
+             g_strdup_printf("%s", "") :
+             bal_print_balance
+             (_("For your information: This account also "
+                "has a noted balance of %s\n"),
+              noted_val));
 
-      if (gnc_numeric_equal(value, reconc_balance)) {
-	const char *message3 = _("The booked balance is identical to the current "
-				 "reconciled balance of the account.");
-	dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
-					GTK_DIALOG_MODAL
-					| GTK_DIALOG_DESTROY_WITH_PARENT,
-					GTK_MESSAGE_INFO,
-					GTK_BUTTONS_OK,
-					"%s\n%s\n%s",
-					message1, message2, message3);
-	gtk_dialog_run(GTK_DIALOG(dialog));
-	gtk_widget_destroy(GTK_WIDGET(dialog));
-	dialogres = FALSE;
+        if (gnc_numeric_equal(value, reconc_balance))
+        {
+            const char *message3 = _("The booked balance is identical to the current "
+                                     "reconciled balance of the account.");
+            dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
+                                            GTK_DIALOG_MODAL
+                                            | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                            GTK_MESSAGE_INFO,
+                                            GTK_BUTTONS_OK,
+                                            "%s\n%s\n%s",
+                                            message1, message2, message3);
+            gtk_dialog_run(GTK_DIALOG(dialog));
+            gtk_widget_destroy(GTK_WIDGET(dialog));
+            dialogres = FALSE;
 
-      } else {
-	const char *message3 = _("Reconcile account now?");
+        }
+        else
+        {
+            const char *message3 = _("Reconcile account now?");
 
-	dialogres = gnc_verify_dialog
-	  (parent, 
-	   TRUE,
-	   "%s%s\n%s",
-	   message1, message2, message3);
-      }
-      g_free (message1);
-      g_free (message2);
-      free (booked_str);
+            dialogres = gnc_verify_dialog
+                        (parent,
+                         TRUE,
+                         "%s%s\n%s",
+                         message1, message2, message3);
+        }
+        g_free (message1);
+        g_free (message2);
+        free (booked_str);
     }
 
-      
-  if (dialogres) 
+
+    if (dialogres)
     {
-      recnWindowWithBalance (parent, 
-			     gnc_acc, 
-			     value,
-			     booked_tt);
+        recnWindowWithBalance (parent,
+                               gnc_acc,
+                               value,
+                               booked_tt);
     }
-      
-  return TRUE;
+
+    return TRUE;
 }

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -34,9 +34,9 @@
 /** Finalizes all the things that have to be done with a GetBalance
  * job.  Returns true if everything has been finished succesfully. */
 gboolean
-gnc_hbci_getbalance_finish (GtkWidget *parent, 
-			    Account *gnc_acc,
-			    const AB_JOB *job);
+gnc_hbci_getbalance_finish (GtkWidget *parent,
+                            Account *gnc_acc,
+                            const AB_JOB *job);
 
 
 #endif /* GNC_HBCI_GETBALANCE_H */

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -45,8 +45,8 @@
 
 
 gboolean
-gettrans_dates(GtkWidget *parent, Account *gnc_acc, 
-	       GWEN_TIME **from_date, GWEN_TIME **to_date);
+gettrans_dates(GtkWidget *parent, Account *gnc_acc,
+               GWEN_TIME **from_date, GWEN_TIME **to_date);
 
 
 
@@ -54,77 +54,81 @@
 void
 gnc_hbci_gettrans (GtkWidget *parent, Account *gnc_acc)
 {
-  AB_BANKING *api = NULL;
-  const AB_ACCOUNT *h_acc = NULL;
-  GNCInteractor *interactor = NULL;
-  
-  g_assert(parent);
-  g_assert(gnc_acc);
+    AB_BANKING *api = NULL;
+    const AB_ACCOUNT *h_acc = NULL;
+    GNCInteractor *interactor = NULL;
 
-  /* Get the api */
-  api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
-  if (api == NULL) {
-    g_message("gnc_hbci_gettrans: Couldn't get HBCI API.\n");
-    return;
-  }
-  g_assert (interactor);
+    g_assert(parent);
+    g_assert(gnc_acc);
 
-  /* Get HBCI account */
-  h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
-  if (h_acc == NULL) {
-    g_warning("gnc_hbci_getbalance: No HBCI account found.\n");
-    /* FIXME: free unneeded data */
-    return;
-  }
+    /* Get the api */
+    api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
+    if (api == NULL)
+    {
+        g_message("gnc_hbci_gettrans: Couldn't get HBCI API.\n");
+        return;
+    }
+    g_assert (interactor);
 
-  {
-    /* Execute a GetTransactions job. */
-    AB_JOB *job;
-    Timespec until_timespec;
-    GWEN_TIME *from_date, *to_date;
-
-    /* Get the start and end dates for the Gettrans job.  */
-    if (!gettrans_dates(parent, gnc_acc, &from_date, &to_date))
-      return;
-    /* Use this as a local storage for the until_time below. */
-    timespecFromTime_t(&until_timespec, GWEN_Time_toTime_t(to_date));
-    
-    /* Create OutboxJob */
-    job = AB_JobGetTransactions_new((AB_ACCOUNT*)h_acc);
-    if (AB_Job_CheckAvailability(job)) {
-      g_warning("gnc_hbci_gettrans: Oops, job not available. Aborting.\n");
-      /* FIXME: free unneeded data */
-      return;
+    /* Get HBCI account */
+    h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
+    if (h_acc == NULL)
+    {
+        g_warning("gnc_hbci_getbalance: No HBCI account found.\n");
+        /* FIXME: free unneeded data */
+        return;
     }
-    AB_JobGetTransactions_SetFromTime(job, from_date);
-    AB_JobGetTransactions_SetToTime(job, to_date);
 
-    /* Add job to AB_BANKING queue. */
-    AB_Banking_EnqueueJob(api, job);
+    {
+        /* Execute a GetTransactions job. */
+        AB_JOB *job;
+        Timespec until_timespec;
+        GWEN_TIME *from_date, *to_date;
 
-    /* Execute Outbox. */
-    if (!gnc_AB_BANKING_execute (parent, api, job, interactor) ||
-	(AB_Job_GetStatus(job) == AB_Job_StatusError) ||
-	GNCInteractor_hadErrors (interactor)) {
-      /* AB_BANKING_executeOutbox failed. */
-      gnc_hbci_cleanup_job(api, job);
-      return;
-    }
+        /* Get the start and end dates for the Gettrans job.  */
+        if (!gettrans_dates(parent, gnc_acc, &from_date, &to_date))
+            return;
+        /* Use this as a local storage for the until_time below. */
+        timespecFromTime_t(&until_timespec, GWEN_Time_toTime_t(to_date));
 
-    /* Store the date of this retrieval */
-    gnc_hbci_set_account_trans_retrieval (gnc_acc, until_timespec);
+        /* Create OutboxJob */
+        job = AB_JobGetTransactions_new((AB_ACCOUNT*)h_acc);
+        if (AB_Job_CheckAvailability(job))
+        {
+            g_warning("gnc_hbci_gettrans: Oops, job not available. Aborting.\n");
+            /* FIXME: free unneeded data */
+            return;
+        }
+        AB_JobGetTransactions_SetFromTime(job, from_date);
+        AB_JobGetTransactions_SetToTime(job, to_date);
 
-    /* Now finish the job duties. */
-    gnc_hbci_gettrans_final(parent, gnc_acc, job, FALSE);
+        /* Add job to AB_BANKING queue. */
+        AB_Banking_EnqueueJob(api, job);
 
-    /* Clean up behind ourself. */
-    gnc_hbci_cleanup_job(api, job);
-    gnc_AB_BANKING_fini (api);
-    GNCInteractor_hide (interactor);
-    if (from_date) 
-      GWEN_Time_free (from_date);
-    GWEN_Time_free (to_date);
-  }
+        /* Execute Outbox. */
+        if (!gnc_AB_BANKING_execute (parent, api, job, interactor) ||
+                (AB_Job_GetStatus(job) == AB_Job_StatusError) ||
+                GNCInteractor_hadErrors (interactor))
+        {
+            /* AB_BANKING_executeOutbox failed. */
+            gnc_hbci_cleanup_job(api, job);
+            return;
+        }
+
+        /* Store the date of this retrieval */
+        gnc_hbci_set_account_trans_retrieval (gnc_acc, until_timespec);
+
+        /* Now finish the job duties. */
+        gnc_hbci_gettrans_final(parent, gnc_acc, job, FALSE);
+
+        /* Clean up behind ourself. */
+        gnc_hbci_cleanup_job(api, job);
+        gnc_AB_BANKING_fini (api);
+        GNCInteractor_hide (interactor);
+        if (from_date)
+            GWEN_Time_free (from_date);
+        GWEN_Time_free (to_date);
+    }
 }
 
 
@@ -133,108 +137,111 @@
     to_date are not pointing to valid objects and may not be
     deleted. */
 gboolean
-gettrans_dates(GtkWidget *parent, Account *gnc_acc, 
-	       GWEN_TIME **from_date, GWEN_TIME **to_date)
+gettrans_dates(GtkWidget *parent, Account *gnc_acc,
+               GWEN_TIME **from_date, GWEN_TIME **to_date)
 {
-  Timespec last_timespec, until_timespec;
-  time_t now = time(NULL);
-  gboolean use_last_date = TRUE, 
-    use_earliest_date = TRUE, use_until_now = TRUE;
+    Timespec last_timespec, until_timespec;
+    time_t now = time(NULL);
+    gboolean use_last_date = TRUE,
+             use_earliest_date = TRUE, use_until_now = TRUE;
 
-  g_assert(from_date);
-  g_assert(to_date);
-  /* Get time of last retrieval */
-  last_timespec = gnc_hbci_get_account_trans_retrieval (gnc_acc);
-  if (last_timespec.tv_sec == 0) {
-    use_last_date = FALSE;
-    timespecFromTime_t (&last_timespec, now);
-  }
-  timespecFromTime_t (&until_timespec, now);
+    g_assert(from_date);
+    g_assert(to_date);
+    /* Get time of last retrieval */
+    last_timespec = gnc_hbci_get_account_trans_retrieval (gnc_acc);
+    if (last_timespec.tv_sec == 0)
+    {
+        use_last_date = FALSE;
+        timespecFromTime_t (&last_timespec, now);
+    }
+    timespecFromTime_t (&until_timespec, now);
 
-  /* Let the user choose the date range of retrieval */
-  if (!gnc_hbci_enter_daterange (parent, NULL, 
-				 &last_timespec, 
-				 &use_last_date, &use_earliest_date,
-				 &until_timespec, &use_until_now))
-    return FALSE;
+    /* Let the user choose the date range of retrieval */
+    if (!gnc_hbci_enter_daterange (parent, NULL,
+                                   &last_timespec,
+                                   &use_last_date, &use_earliest_date,
+                                   &until_timespec, &use_until_now))
+        return FALSE;
 
-  /*printf("Retrieving transactions from date %s to date %s. \n",
-    ctime(&()))*/
-    
-  /* Now calculate from date */
-  if (use_earliest_date)
-    *from_date = NULL;
-  /* for an old version this was: from_date = GWEN_Time_fromSeconds(0); */
-  else {
-    if (use_last_date)
-      last_timespec = gnc_hbci_get_account_trans_retrieval (gnc_acc);
-    *from_date = GWEN_Time_fromSeconds(timespecToTime_t(last_timespec));
-  }
+    /*printf("Retrieving transactions from date %s to date %s. \n",
+      ctime(&()))*/
 
-  /* Now calculate to date */
-  if (use_until_now)
-    timespecFromTime_t (&until_timespec, now);
-  *to_date = GWEN_Time_fromSeconds(timespecToTime_t (until_timespec));
+    /* Now calculate from date */
+    if (use_earliest_date)
+        *from_date = NULL;
+    /* for an old version this was: from_date = GWEN_Time_fromSeconds(0); */
+    else
+    {
+        if (use_last_date)
+            last_timespec = gnc_hbci_get_account_trans_retrieval (gnc_acc);
+        *from_date = GWEN_Time_fromSeconds(timespecToTime_t(last_timespec));
+    }
 
-  return TRUE;
+    /* Now calculate to date */
+    if (use_until_now)
+        timespecFromTime_t (&until_timespec, now);
+    *to_date = GWEN_Time_fromSeconds(timespecToTime_t (until_timespec));
+
+    return TRUE;
 }
 
 
 /** Finalizes all the things that have to be done with a GetTrans
  * job.  Returns true if everything has been finished succesfully. */
 gboolean
-gnc_hbci_gettrans_final(GtkWidget *parent, 
-			Account *gnc_acc, 
-			const AB_JOB *trans_job,
-			gboolean run_until_done)
+gnc_hbci_gettrans_final(GtkWidget *parent,
+                        Account *gnc_acc,
+                        const AB_JOB *trans_job,
+                        gboolean run_until_done)
 {
-  GtkWidget *dialog;
+    GtkWidget *dialog;
 
-  /* Now add the retrieved transactions to the gnucash account. */
-  AB_TRANSACTION_LIST2 *trans_list;
+    /* Now add the retrieved transactions to the gnucash account. */
+    AB_TRANSACTION_LIST2 *trans_list;
 
-  trans_list = AB_JobGetTransactions_GetTransactions(trans_job);
-  if (trans_list && (AB_Transaction_List2_GetSize(trans_list) > 0)) {
-    /* Final importing part. */
-    return gnc_hbci_import_final(parent, gnc_acc, trans_list, run_until_done);
-  }
+    trans_list = AB_JobGetTransactions_GetTransactions(trans_job);
+    if (trans_list && (AB_Transaction_List2_GetSize(trans_list) > 0))
+    {
+        /* Final importing part. */
+        return gnc_hbci_import_final(parent, gnc_acc, trans_list, run_until_done);
+    }
 
-  dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
-				  GTK_DIALOG_MODAL
-				  | GTK_DIALOG_DESTROY_WITH_PARENT,
-				  GTK_MESSAGE_INFO,
-				  GTK_BUTTONS_OK,
-				  "%s",
-				  _("The Online Banking import returned no transactions "
-				    "for the selected time period."));
-  gtk_dialog_run(GTK_DIALOG(dialog));
-  gtk_widget_destroy(GTK_WIDGET(dialog));
-  return TRUE;
+    dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
+                                    GTK_DIALOG_MODAL
+                                    | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_INFO,
+                                    GTK_BUTTONS_OK,
+                                    "%s",
+                                    _("The Online Banking import returned no transactions "
+                                      "for the selected time period."));
+    gtk_dialog_run(GTK_DIALOG(dialog));
+    gtk_widget_destroy(GTK_WIDGET(dialog));
+    return TRUE;
 }
 
 
 gboolean
-gnc_hbci_import_final(GtkWidget *parent, 
-		      Account *gnc_acc,
-		      AB_TRANSACTION_LIST2 *trans_list, 
-		      gboolean run_until_done)
+gnc_hbci_import_final(GtkWidget *parent,
+                      Account *gnc_acc,
+                      AB_TRANSACTION_LIST2 *trans_list,
+                      gboolean run_until_done)
 {
-  struct trans_list_data data;
-  GNCImportMainMatcher *importer_generic_gui;
+    struct trans_list_data data;
+    GNCImportMainMatcher *importer_generic_gui;
 
-  if (!trans_list || (AB_Transaction_List2_GetSize(trans_list) == 0)) 
-    return TRUE;
-    
-  importer_generic_gui = gnc_gen_trans_list_new(parent, NULL, TRUE, 14);
+    if (!trans_list || (AB_Transaction_List2_GetSize(trans_list) == 0))
+        return TRUE;
 
-  data.importer_generic = importer_generic_gui;
-  data.gnc_acc = gnc_acc;
-	
-  AB_Transaction_List2_ForEach (trans_list, gnc_hbci_trans_list_cb, &data);
+    importer_generic_gui = gnc_gen_trans_list_new(parent, NULL, TRUE, 14);
 
-  if (run_until_done)
-    return gnc_gen_trans_list_run (importer_generic_gui);
-  return TRUE;
+    data.importer_generic = importer_generic_gui;
+    data.gnc_acc = gnc_acc;
+
+    AB_Transaction_List2_ForEach (trans_list, gnc_hbci_trans_list_cb, &data);
+
+    if (run_until_done)
+        return gnc_gen_trans_list_run (importer_generic_gui);
+    return TRUE;
 }
 
 
@@ -242,116 +249,116 @@
    GNC transaction is done here, once for each AB_TRANSACTION.  */
 AB_TRANSACTION *gnc_hbci_trans_list_cb(AB_TRANSACTION *h_trans, void *user_data)
 {
-  time_t current_time;
-  /* time_t tt1, tt2; */
-  /*struct tm tm1, tm2;*/
-  Account *gnc_acc;
-  GNCBook *book;
-  Transaction *gnc_trans;
-  const GWEN_TIME *valutaDate, *normalDate;
-  Split *split;
-  struct trans_list_data *data = user_data;
-  g_assert(data);
+    time_t current_time;
+    /* time_t tt1, tt2; */
+    /*struct tm tm1, tm2;*/
+    Account *gnc_acc;
+    GNCBook *book;
+    Transaction *gnc_trans;
+    const GWEN_TIME *valutaDate, *normalDate;
+    Split *split;
+    struct trans_list_data *data = user_data;
+    g_assert(data);
 
-  if (!h_trans) return NULL;
+    if (!h_trans) return NULL;
 
-  gnc_acc = data->gnc_acc;
-  g_assert(gnc_acc);
-  book = gnc_account_get_book(gnc_acc);
+    gnc_acc = data->gnc_acc;
+    g_assert(gnc_acc);
+    book = gnc_account_get_book(gnc_acc);
 
-  /* Create new gnucash transaction for the given hbci one */
-  gnc_trans = xaccMallocTransaction(book);
-  xaccTransBeginEdit(gnc_trans);
+    /* Create new gnucash transaction for the given hbci one */
+    gnc_trans = xaccMallocTransaction(book);
+    xaccTransBeginEdit(gnc_trans);
 
-  normalDate = AB_Transaction_GetDate(h_trans);
-  valutaDate = AB_Transaction_GetValutaDate(h_trans);
-  if (normalDate && !valutaDate)
-    valutaDate = normalDate;
-  /* Watch out -- any of the GWEN_TIME may be NULL */
-  /*   tt1 = GWEN_Time_toTime_t (normalDate); */
-  /*   tt2 = GWEN_Time_toTime_t (valutaDate); */
-  /*printf("Date? %s ValutaDate? %s", ctime(&tt1), ctime(&tt2));*/
-  
-  
-  /* Date / Time */
-  if (valutaDate)
-    xaccTransSetDateSecs
-      (gnc_trans, GWEN_Time_toTime_t (valutaDate));
-  else
-    g_warning("trans_list_cb: Oops, date 'valutaDate' was NULL.\n");
-    
-  current_time = time(NULL);
-  xaccTransSetDateEnteredSecs(gnc_trans, mktime(localtime(&current_time)));
-    
-  /* Currency; we take simply the default currency of the gnucash account */
-  xaccTransSetCurrency(gnc_trans, xaccAccountGetCommodity(gnc_acc));
-    
-  {
-    /* Number. We use the "customer reference", if there is one. */
-    const char *custref = AB_Transaction_GetCustomerReference (h_trans);
-    if (custref && (strlen (custref) > 0) && 
-	(g_ascii_strncasecmp (custref, "NONREF", 6) != 0))
-      xaccTransSetNum (gnc_trans, custref);
-  }
-    
-  /* Description */
-  {
-    char *g_descr = gnc_hbci_descr_tognc (h_trans);
-    xaccTransSetDescription (gnc_trans, g_descr);
-    g_free (g_descr);
-  }
-  
-  /* Notes. */
-  /*xaccTransSetNotes (gnc_trans, g_notes);*/
-  /* But Nobody ever uses the Notes field? */
-  
-  /* Add one split */
-  split=xaccMallocSplit(book);
-  xaccTransAppendSplit(gnc_trans, split);
-  xaccAccountInsertSplit(gnc_acc, split);
-    
+    normalDate = AB_Transaction_GetDate(h_trans);
+    valutaDate = AB_Transaction_GetValutaDate(h_trans);
+    if (normalDate && !valutaDate)
+        valutaDate = normalDate;
+    /* Watch out -- any of the GWEN_TIME may be NULL */
+    /*   tt1 = GWEN_Time_toTime_t (normalDate); */
+    /*   tt2 = GWEN_Time_toTime_t (valutaDate); */
+    /*printf("Date? %s ValutaDate? %s", ctime(&tt1), ctime(&tt2));*/
 
-  {
-    /* OFX unique transaction ID */
-    const char *fitid = AB_Transaction_GetFiId(h_trans);
-    if (fitid && (strlen (fitid) > 0))
-      gnc_import_set_split_online_id(split, fitid);
-  }
 
-  {
-    /* Amount into the split */
-    const AB_VALUE *h_value = AB_Transaction_GetValue (h_trans);
-    double d_value = h_value ? AB_Value_GetValue (h_value) : 0.0;
-    AB_TRANSACTION_TYPE h_type = AB_Transaction_GetType (h_trans);
-    gnc_numeric gnc_amount;
+    /* Date / Time */
+    if (valutaDate)
+        xaccTransSetDateSecs
+        (gnc_trans, GWEN_Time_toTime_t (valutaDate));
+    else
+        g_warning("trans_list_cb: Oops, date 'valutaDate' was NULL.\n");
 
-    /*printf("Transaction with value %f has type %d\n", d_value, h_type);*/
-    /* If the value is positive, but the transaction type says the
-       money is transferred away from our account (Transfer instead of
-       DebitNote), we switch the value to negative. */
-    if (d_value > 0.0 && h_type == AB_Transaction_TypeTransfer)
-      d_value = -d_value;
+    current_time = time(NULL);
+    xaccTransSetDateEnteredSecs(gnc_trans, mktime(localtime(&current_time)));
 
-    gnc_amount = double_to_gnc_numeric
-      (d_value,
-       xaccAccountGetCommoditySCU(gnc_acc),
-       GNC_RND_ROUND);
-    if (!h_value)
-      g_warning("trans_list_cb: Oops, value was NULL. Using 0.\n");
-    xaccSplitSetBaseValue(split, gnc_amount, xaccAccountGetCommodity(gnc_acc));
-  }
-    
-  /* Memo in the Split. */
-  {
-    char *g_memo = gnc_hbci_memo_tognc (h_trans);
-    xaccSplitSetMemo(split, g_memo);
-    g_free (g_memo);
-  }
-    
-  /* Instead of xaccTransCommitEdit(gnc_trans)  */
-  g_assert (data->importer_generic);
-  gnc_gen_trans_list_add_trans (data->importer_generic, gnc_trans);
+    /* Currency; we take simply the default currency of the gnucash account */
+    xaccTransSetCurrency(gnc_trans, xaccAccountGetCommodity(gnc_acc));
 
-  return NULL;
-  
+    {
+        /* Number. We use the "customer reference", if there is one. */
+        const char *custref = AB_Transaction_GetCustomerReference (h_trans);
+        if (custref && (strlen (custref) > 0) &&
+                (g_ascii_strncasecmp (custref, "NONREF", 6) != 0))
+            xaccTransSetNum (gnc_trans, custref);
+    }
+
+    /* Description */
+    {
+        char *g_descr = gnc_hbci_descr_tognc (h_trans);
+        xaccTransSetDescription (gnc_trans, g_descr);
+        g_free (g_descr);
+    }
+
+    /* Notes. */
+    /*xaccTransSetNotes (gnc_trans, g_notes);*/
+    /* But Nobody ever uses the Notes field? */
+
+    /* Add one split */
+    split = xaccMallocSplit(book);
+    xaccTransAppendSplit(gnc_trans, split);
+    xaccAccountInsertSplit(gnc_acc, split);
+
+
+    {
+        /* OFX unique transaction ID */
+        const char *fitid = AB_Transaction_GetFiId(h_trans);
+        if (fitid && (strlen (fitid) > 0))
+            gnc_import_set_split_online_id(split, fitid);
+    }
+
+    {
+        /* Amount into the split */
+        const AB_VALUE *h_value = AB_Transaction_GetValue (h_trans);
+        double d_value = h_value ? AB_Value_GetValue (h_value) : 0.0;
+        AB_TRANSACTION_TYPE h_type = AB_Transaction_GetType (h_trans);
+        gnc_numeric gnc_amount;
+
+        /*printf("Transaction with value %f has type %d\n", d_value, h_type);*/
+        /* If the value is positive, but the transaction type says the
+           money is transferred away from our account (Transfer instead of
+           DebitNote), we switch the value to negative. */
+        if (d_value > 0.0 && h_type == AB_Transaction_TypeTransfer)
+            d_value = -d_value;
+
+        gnc_amount = double_to_gnc_numeric
+                     (d_value,
+                      xaccAccountGetCommoditySCU(gnc_acc),
+                      GNC_RND_ROUND);
+        if (!h_value)
+            g_warning("trans_list_cb: Oops, value was NULL. Using 0.\n");
+        xaccSplitSetBaseValue(split, gnc_amount, xaccAccountGetCommodity(gnc_acc));
+    }
+
+    /* Memo in the Split. */
+    {
+        char *g_memo = gnc_hbci_memo_tognc (h_trans);
+        xaccSplitSetMemo(split, g_memo);
+        g_free (g_memo);
+    }
+
+    /* Instead of xaccTransCommitEdit(gnc_trans)  */
+    g_assert (data->importer_generic);
+    gnc_gen_trans_list_add_trans (data->importer_generic, gnc_trans);
+
+    return NULL;
+
 }

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -35,30 +35,30 @@
 /** Finalizes all the things that have to be done with a GetTrans
  * job.  Returns true if everything has been finished succesfully. */
 gboolean
-gnc_hbci_gettrans_final(GtkWidget *parent, 
-			Account *gnc_acc, 
-			const AB_JOB *trans_job,
-			gboolean run_until_done);
+gnc_hbci_gettrans_final(GtkWidget *parent,
+                        Account *gnc_acc,
+                        const AB_JOB *trans_job,
+                        gboolean run_until_done);
 
 /** Finalize the final importing part of a GetTrans job.  Returns true
  * if everything has been finished succesfully. */
 gboolean
-gnc_hbci_import_final(GtkWidget *parent, 
-		      Account *gnc_acc,
-		      AB_TRANSACTION_LIST2 *trans_list, 
-		      gboolean run_until_done);
+gnc_hbci_import_final(GtkWidget *parent,
+                      Account *gnc_acc,
+                      AB_TRANSACTION_LIST2 *trans_list,
+                      gboolean run_until_done);
 
 /** user_data struct for the gnc_hbci_trans_list_cb() structure */
-struct trans_list_data 
+struct trans_list_data
 {
-  Account *gnc_acc;
-  GNCImportMainMatcher *importer_generic;
+    Account *gnc_acc;
+    GNCImportMainMatcher *importer_generic;
 };
 
 /** AB_TRANSACTION_LIST2_foreach callback. The Conversion from HBCI to
    GNC transaction is done here, once for each AB_TRANSACTION.  */
-AB_TRANSACTION *gnc_hbci_trans_list_cb(AB_TRANSACTION *imported_trans, 
-				       void *user_data);
+AB_TRANSACTION *gnc_hbci_trans_list_cb(AB_TRANSACTION *imported_trans,
+                                       void *user_data);
 
 
 #endif /* GNC_HBCI_GETTRANS_H */

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -34,90 +34,90 @@
 
 static void force_account_dirty(Account *acct)
 {
-  gchar *name = g_strdup(xaccAccountGetName(acct));
+    gchar *name = g_strdup(xaccAccountGetName(acct));
 
-  /* This is necessary because modifying the KvpFrames doesn't mark
-     accounts dirty, which means the changes wont be propagated to the
-     backend. */
-  xaccAccountSetName(acct, name);
-  g_free(name);
+    /* This is necessary because modifying the KvpFrames doesn't mark
+       accounts dirty, which means the changes wont be propagated to the
+       backend. */
+    xaccAccountSetName(acct, name);
+    g_free(name);
 }
 
 /* Account */
 char *gnc_hbci_get_account_accountid (Account *a)
 {
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
-  kvp_value *value = kvp_frame_get_slot (frame, HBCI_ACCOUNT_ID);
-  return kvp_value_get_string (value);
+    kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
+    kvp_value *value = kvp_frame_get_slot (frame, HBCI_ACCOUNT_ID);
+    return kvp_value_get_string (value);
 }
 char *gnc_hbci_get_account_bankcode (Account *a)
 {
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
-  kvp_value *value = kvp_frame_get_slot (frame, HBCI_BANK_CODE);
-  return kvp_value_get_string (value);
+    kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
+    kvp_value *value = kvp_frame_get_slot (frame, HBCI_BANK_CODE);
+    return kvp_value_get_string (value);
 }
 gint gnc_hbci_get_account_countrycode (Account *a)
 {
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
-  kvp_value *value = kvp_frame_get_slot (frame, HBCI_COUNTRY_CODE);
-  return kvp_value_get_gint64 (value);
+    kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
+    kvp_value *value = kvp_frame_get_slot (frame, HBCI_COUNTRY_CODE);
+    return kvp_value_get_gint64 (value);
 }
 void gnc_hbci_set_account_accountid (Account *a, const char *id)
 {
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
-  kvp_value *value = kvp_value_new_string (id);
-  xaccAccountBeginEdit(a);
-  kvp_frame_set_slot_nc (frame, HBCI_ACCOUNT_ID, value);
-  force_account_dirty (a);
-  xaccAccountCommitEdit (a);
+    kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
+    kvp_value *value = kvp_value_new_string (id);
+    xaccAccountBeginEdit(a);
+    kvp_frame_set_slot_nc (frame, HBCI_ACCOUNT_ID, value);
+    force_account_dirty (a);
+    xaccAccountCommitEdit (a);
 }
 void gnc_hbci_set_account_bankcode (Account *a, const char *code)
 {
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
-  kvp_value *value = kvp_value_new_string (code);
-  xaccAccountBeginEdit (a);
-  kvp_frame_set_slot_nc (frame, HBCI_BANK_CODE, value);
-  force_account_dirty (a);
-  xaccAccountCommitEdit (a);
+    kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
+    kvp_value *value = kvp_value_new_string (code);
+    xaccAccountBeginEdit (a);
+    kvp_frame_set_slot_nc (frame, HBCI_BANK_CODE, value);
+    force_account_dirty (a);
+    xaccAccountCommitEdit (a);
 }
 void gnc_hbci_set_account_countrycode (Account *a, gint code)
 {
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
-  kvp_value *value = kvp_value_new_gint64 (code);
-  xaccAccountBeginEdit (a);
-  kvp_frame_set_slot_nc (frame, HBCI_COUNTRY_CODE, value);
-  force_account_dirty (a);
-  xaccAccountCommitEdit (a);
+    kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
+    kvp_value *value = kvp_value_new_gint64 (code);
+    xaccAccountBeginEdit (a);
+    kvp_frame_set_slot_nc (frame, HBCI_COUNTRY_CODE, value);
+    force_account_dirty (a);
+    xaccAccountCommitEdit (a);
 }
 gint gnc_hbci_get_account_uid (Account *a)
 {
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
-  kvp_value *value = kvp_frame_get_slot (frame, HBCI_ACCOUNT_UID);
-  return kvp_value_get_gint64 (value);
+    kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
+    kvp_value *value = kvp_frame_get_slot (frame, HBCI_ACCOUNT_UID);
+    return kvp_value_get_gint64 (value);
 }
 void gnc_hbci_set_account_uid (Account *a, gint uid)
 {
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
-  kvp_value *value = kvp_value_new_gint64 (uid);
-  xaccAccountBeginEdit (a);
-  kvp_frame_set_slot_nc (frame, HBCI_ACCOUNT_UID, value);
-  force_account_dirty (a);
-  xaccAccountCommitEdit (a);
+    kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
+    kvp_value *value = kvp_value_new_gint64 (uid);
+    xaccAccountBeginEdit (a);
+    kvp_frame_set_slot_nc (frame, HBCI_ACCOUNT_UID, value);
+    force_account_dirty (a);
+    xaccAccountCommitEdit (a);
 }
 Timespec gnc_hbci_get_account_trans_retrieval (Account *a)
 {
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
-  kvp_value *value = kvp_frame_get_slot (frame, HBCI_TRANS_RETRIEVAL);
-  return kvp_value_get_timespec (value);
+    kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
+    kvp_value *value = kvp_frame_get_slot (frame, HBCI_TRANS_RETRIEVAL);
+    return kvp_value_get_timespec (value);
 }
 void gnc_hbci_set_account_trans_retrieval (Account *a, Timespec time)
 {
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
-  kvp_value *value = kvp_value_new_timespec (time);
-  xaccAccountBeginEdit (a);
-  kvp_frame_set_slot_nc (frame, HBCI_TRANS_RETRIEVAL, value);
-  force_account_dirty (a);
-  xaccAccountCommitEdit (a);
+    kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
+    kvp_value *value = kvp_value_new_timespec (time);
+    xaccAccountBeginEdit (a);
+    kvp_frame_set_slot_nc (frame, HBCI_TRANS_RETRIEVAL, value);
+    force_account_dirty (a);
+    xaccAccountCommitEdit (a);
 }
 
 
@@ -128,44 +128,44 @@
 
 char *gnc_hbci_get_book_configfile (GNCBook *b)
 {
-  kvp_frame *frame = gnc_hbci_get_book_kvp (b, FALSE);
-  kvp_value *value = kvp_frame_get_slot (frame, HBCI_CONFIGFILE);
-  return kvp_value_get_string (value);
+    kvp_frame *frame = gnc_hbci_get_book_kvp (b, FALSE);
+    kvp_value *value = kvp_frame_get_slot (frame, HBCI_CONFIGFILE);
+    return kvp_value_get_string (value);
 }
 void gnc_hbci_set_book_configfile (GNCBook *b, const char *filename)
 {
-  kvp_frame *frame = gnc_hbci_get_book_kvp (b, TRUE);
-  kvp_value *value = kvp_value_new_string (filename);
-  kvp_frame_set_slot_nc (frame, HBCI_CONFIGFILE, value);
-  qof_book_kvp_changed (b);
+    kvp_frame *frame = gnc_hbci_get_book_kvp (b, TRUE);
+    kvp_value *value = kvp_value_new_string (filename);
+    kvp_frame_set_slot_nc (frame, HBCI_CONFIGFILE, value);
+    qof_book_kvp_changed (b);
 }
 GList *gnc_hbci_get_book_template_list (GNCBook *b)
 {
-  kvp_frame *frame = gnc_hbci_get_book_kvp (b, FALSE);
-  kvp_value *value = kvp_frame_get_slot (frame, HBCI_TEMPLATES);
-  return kvp_value_get_glist (value);
+    kvp_frame *frame = gnc_hbci_get_book_kvp (b, FALSE);
+    kvp_value *value = kvp_frame_get_slot (frame, HBCI_TEMPLATES);
+    return kvp_value_get_glist (value);
 }
 void gnc_hbci_set_book_template_list (GNCBook *b, GList *template_list)
 {
-  kvp_frame *frame = gnc_hbci_get_book_kvp (b, TRUE);
-  kvp_value *value = kvp_value_new_glist_nc (template_list);
-  kvp_frame_set_slot_nc (frame, HBCI_TEMPLATES, value);
-  qof_book_kvp_changed (b);
+    kvp_frame *frame = gnc_hbci_get_book_kvp (b, TRUE);
+    kvp_value *value = kvp_value_new_glist_nc (template_list);
+    kvp_frame_set_slot_nc (frame, HBCI_TEMPLATES, value);
+    qof_book_kvp_changed (b);
 }
 
 #if 0
 GList *gnc_hbci_get_book_account_list (GNCBook *b)
 {
-  kvp_frame *frame = gnc_hbci_get_book_kvp (b, FALSE);
-  kvp_value *value = kvp_frame_get_slot (frame, HBCI_ACCOUNTS);
-  return kvp_value_get_glist (value);
+    kvp_frame *frame = gnc_hbci_get_book_kvp (b, FALSE);
+    kvp_value *value = kvp_frame_get_slot (frame, HBCI_ACCOUNTS);
+    return kvp_value_get_glist (value);
 }
 void gnc_hbci_set_book_account_list (GNCBook *b, GList *account_list)
 {
-  kvp_frame *frame = gnc_hbci_get_book_kvp (b, TRUE);
-  kvp_value *value = kvp_value_new_glist_nc (account_list);
-  kvp_frame_set_slot_nc (frame, HBCI_ACCOUNTS, value);
-  qof_book_kvp_changed (b);
+    kvp_frame *frame = gnc_hbci_get_book_kvp (b, TRUE);
+    kvp_value *value = kvp_value_new_glist_nc (account_list);
+    kvp_frame_set_slot_nc (frame, HBCI_ACCOUNTS, value);
+    qof_book_kvp_changed (b);
 }
 #endif
 
@@ -174,13 +174,14 @@
 /* getters  for kvp frame in book */
 kvp_frame *gnc_hbci_get_book_kvp (GNCBook *b, gboolean create)
 {
-  kvp_frame *toplevel = qof_book_get_slots (b);
-  kvp_frame *result = kvp_frame_get_frame (toplevel, HBCI_KEY);
-  if (!result && create) {
-      result = kvp_frame_new();
-      kvp_frame_add_frame_nc (toplevel, HBCI_KEY, result);
-  }
-  return result;
+    kvp_frame *toplevel = qof_book_get_slots (b);
+    kvp_frame *result = kvp_frame_get_frame (toplevel, HBCI_KEY);
+    if (!result && create)
+    {
+        result = kvp_frame_new();
+        kvp_frame_add_frame_nc (toplevel, HBCI_KEY, result);
+    }
+    return result;
 }
 
 
@@ -188,11 +189,12 @@
 /* kvp frame in Account */
 kvp_frame *gnc_hbci_get_account_kvp (Account *a, gboolean create)
 {
-  kvp_frame *toplevel = xaccAccountGetSlots (a);
-  kvp_frame *result = kvp_frame_get_frame (toplevel, HBCI_KEY);
-  if (!result && create) {
-      result = kvp_frame_new();
-      kvp_frame_add_frame_nc (toplevel, HBCI_KEY, result);
-  }
-  return result;
+    kvp_frame *toplevel = xaccAccountGetSlots (a);
+    kvp_frame *result = kvp_frame_get_frame (toplevel, HBCI_KEY);
+    if (!result && create)
+    {
+        result = kvp_frame_new();
+        kvp_frame_add_frame_nc (toplevel, HBCI_KEY, result);
+    }
+    return result;
 }

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -26,73 +26,73 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
-struct _trans_data 
+struct _trans_data
 {
-  /* Name of this Template */
-  gchar *name;
-  gchar *name_key;	/* Collation key */
-  
-  /* Recipient */
-  gchar *recp_name;
-  gchar *recp_account;
-  gchar *recp_bankcode;
+    /* Name of this Template */
+    gchar *name;
+    gchar *name_key;	/* Collation key */
 
-  /* Amount */
-  gnc_numeric amount;
+    /* Recipient */
+    gchar *recp_name;
+    gchar *recp_account;
+    gchar *recp_bankcode;
 
-  /* Purpose, description */
-  gchar *purpose;
-  gchar *purpose_cont;
+    /* Amount */
+    gnc_numeric amount;
+
+    /* Purpose, description */
+    gchar *purpose;
+    gchar *purpose_cont;
 };
 
 
 GNCTransTempl *gnc_trans_templ_new()
 {
-  GNCTransTempl *r = g_new0(GNCTransTempl, 1);
-  r->amount = gnc_numeric_zero();
-  return r;
+    GNCTransTempl *r = g_new0(GNCTransTempl, 1);
+    r->amount = gnc_numeric_zero();
+    return r;
 }
-GNCTransTempl *gnc_trans_templ_new_full(const char *name, 
-					const char *recp_name,
-					const char *recp_account, 
-					const char *recp_bankcode, 
-					gnc_numeric amount, 
-					const char *purpose, 
-					const char *purpose_cont)
+GNCTransTempl *gnc_trans_templ_new_full(const char *name,
+                                        const char *recp_name,
+                                        const char *recp_account,
+                                        const char *recp_bankcode,
+                                        gnc_numeric amount,
+                                        const char *purpose,
+                                        const char *purpose_cont)
 {
-  GNCTransTempl *r = g_new0(GNCTransTempl, 1);
-  r->name = g_strdup(name);
-  r->name_key = g_utf8_collate_key(name, -1);
-  r->recp_name = g_strdup(recp_name);
-  r->recp_account = g_strdup(recp_account);
-  r->recp_bankcode = g_strdup(recp_bankcode);
-  r->amount = amount;
-  r->purpose = g_strdup(purpose);
-  r->purpose_cont = g_strdup(purpose_cont);
-  return r;
+    GNCTransTempl *r = g_new0(GNCTransTempl, 1);
+    r->name = g_strdup(name);
+    r->name_key = g_utf8_collate_key(name, -1);
+    r->recp_name = g_strdup(recp_name);
+    r->recp_account = g_strdup(recp_account);
+    r->recp_bankcode = g_strdup(recp_bankcode);
+    r->amount = amount;
+    r->purpose = g_strdup(purpose);
+    r->purpose_cont = g_strdup(purpose_cont);
+    return r;
 }
 
 void gnc_trans_templ_delete(GNCTransTempl *t)
 {
-  if (!t) return;
-  if (t->name) g_free(t->name);
-  if (t->name_key) g_free(t->name_key);
-  if (t->recp_name) g_free(t->recp_name);
-  if (t->recp_account) g_free(t->recp_account);
-  if (t->recp_bankcode) g_free(t->recp_bankcode);
-  if (t->purpose) g_free(t->purpose);
-  if (t->purpose_cont) g_free(t->purpose_cont);
-  g_free(t);
+    if (!t) return;
+    if (t->name) g_free(t->name);
+    if (t->name_key) g_free(t->name_key);
+    if (t->recp_name) g_free(t->recp_name);
+    if (t->recp_account) g_free(t->recp_account);
+    if (t->recp_bankcode) g_free(t->recp_bankcode);
+    if (t->purpose) g_free(t->purpose);
+    if (t->purpose_cont) g_free(t->purpose_cont);
+    g_free(t);
 }
 static void delete_glist_func(gpointer data, gpointer user_data)
 {
-  GNCTransTempl *t = data;
-  gnc_trans_templ_delete(t);
+    GNCTransTempl *t = data;
+    gnc_trans_templ_delete(t);
 }
 void gnc_trans_templ_delete_glist(GList *l)
 {
-  g_list_foreach(l, delete_glist_func, NULL);
-  g_list_free(l);
+    g_list_foreach(l, delete_glist_func, NULL);
+    g_list_free(l);
 }
 
 
@@ -108,60 +108,60 @@
 /** Constructor from a kvp_frame */
 GNCTransTempl *gnc_trans_templ_from_kvp(kvp_frame *k)
 {
-  GNCTransTempl *res = gnc_trans_templ_new();
-  g_assert(k);
+    GNCTransTempl *res = gnc_trans_templ_new();
+    g_assert(k);
 
-  res->name = g_strdup(kvp_value_get_string
-		       (kvp_frame_get_slot(k, TT_NAME)));
-  res->name_key = g_utf8_collate_key(res->name, -1);
-  res->recp_name = g_strdup(kvp_value_get_string
-			    (kvp_frame_get_slot(k, TT_RNAME)));
-  res->recp_account = g_strdup(kvp_value_get_string
-			       (kvp_frame_get_slot(k, TT_RACC)));
-  res->recp_bankcode = g_strdup(kvp_value_get_string
-				(kvp_frame_get_slot(k, TT_RBCODE)));
-  res->purpose = g_strdup(kvp_value_get_string
-			       (kvp_frame_get_slot(k, TT_PURPOS)));
-  res->purpose_cont = g_strdup(kvp_value_get_string
-				    (kvp_frame_get_slot(k, TT_PURPOSCT)));
-  res->amount = kvp_value_get_numeric(kvp_frame_get_slot(k, TT_AMOUNT));
-  return res;
+    res->name = g_strdup(kvp_value_get_string
+                         (kvp_frame_get_slot(k, TT_NAME)));
+    res->name_key = g_utf8_collate_key(res->name, -1);
+    res->recp_name = g_strdup(kvp_value_get_string
+                              (kvp_frame_get_slot(k, TT_RNAME)));
+    res->recp_account = g_strdup(kvp_value_get_string
+                                 (kvp_frame_get_slot(k, TT_RACC)));
+    res->recp_bankcode = g_strdup(kvp_value_get_string
+                                  (kvp_frame_get_slot(k, TT_RBCODE)));
+    res->purpose = g_strdup(kvp_value_get_string
+                            (kvp_frame_get_slot(k, TT_PURPOS)));
+    res->purpose_cont = g_strdup(kvp_value_get_string
+                                 (kvp_frame_get_slot(k, TT_PURPOSCT)));
+    res->amount = kvp_value_get_numeric(kvp_frame_get_slot(k, TT_AMOUNT));
+    return res;
 }
 
 /** Creates a kvp_frame from this TransTempl */
 kvp_frame *gnc_trans_templ_to_kvp(const GNCTransTempl *t)
 {
-  kvp_frame *k = kvp_frame_new();
-  g_assert(t);
+    kvp_frame *k = kvp_frame_new();
+    g_assert(t);
 
-  kvp_frame_set_slot(k, TT_NAME, kvp_value_new_string(t->name));
-  kvp_frame_set_slot(k, TT_RNAME, kvp_value_new_string(t->recp_name));
-  kvp_frame_set_slot(k, TT_RACC, kvp_value_new_string(t->recp_account));
-  kvp_frame_set_slot(k, TT_RBCODE, kvp_value_new_string(t->recp_bankcode));
-  kvp_frame_set_slot(k, TT_PURPOS, kvp_value_new_string(t->purpose));
-  kvp_frame_set_slot(k, TT_PURPOSCT, kvp_value_new_string(t->purpose_cont));
-  kvp_frame_set_slot(k, TT_AMOUNT, kvp_value_new_gnc_numeric(t->amount));
-  return k;
+    kvp_frame_set_slot(k, TT_NAME, kvp_value_new_string(t->name));
+    kvp_frame_set_slot(k, TT_RNAME, kvp_value_new_string(t->recp_name));
+    kvp_frame_set_slot(k, TT_RACC, kvp_value_new_string(t->recp_account));
+    kvp_frame_set_slot(k, TT_RBCODE, kvp_value_new_string(t->recp_bankcode));
+    kvp_frame_set_slot(k, TT_PURPOS, kvp_value_new_string(t->purpose));
+    kvp_frame_set_slot(k, TT_PURPOSCT, kvp_value_new_string(t->purpose_cont));
+    kvp_frame_set_slot(k, TT_AMOUNT, kvp_value_new_gnc_numeric(t->amount));
+    return k;
 }
 
 /** Creates a GList of GNCTransTempl from a GList of kvp_values which
     in turn contain a kvp_frame. */
 static void glist_from_kvp_func(gpointer data, gpointer user_data)
 {
-  GList **tmp = user_data;
-  GList *res = *tmp;
-  kvp_value *k = data;
-  *tmp = g_list_append(res, gnc_trans_templ_from_kvp(kvp_value_get_frame(k)));
+    GList **tmp = user_data;
+    GList *res = *tmp;
+    kvp_value *k = data;
+    *tmp = g_list_append(res, gnc_trans_templ_from_kvp(kvp_value_get_frame(k)));
 }
 /** Creates a GList of GNCTransTempl from a GList of kvp_values which
     in turn contain a kvp_frame. */
 GList *gnc_trans_templ_glist_from_kvp_glist(GList *v)
 {
-  GList *res = NULL;
-  if (!v) return NULL;
+    GList *res = NULL;
+    if (!v) return NULL;
 
-  g_list_foreach (v, glist_from_kvp_func, &res);
-  return res;
+    g_list_foreach (v, glist_from_kvp_func, &res);
+    return res;
 }
 
 
@@ -169,118 +169,118 @@
     from a GList of GNCTransTempl. */
 static void glist_to_kvp_func(gpointer data, gpointer user_data)
 {
-  GList **tmp = user_data;
-  GList *res = *tmp;
-  GNCTransTempl *g = data;
-  *tmp = g_list_append(res, 
-		       kvp_value_new_frame_nc(gnc_trans_templ_to_kvp(g)));
+    GList **tmp = user_data;
+    GList *res = *tmp;
+    GNCTransTempl *g = data;
+    *tmp = g_list_append(res,
+                         kvp_value_new_frame_nc(gnc_trans_templ_to_kvp(g)));
 }
 /** Creates a GList of kvp_value (which in turn contain a kvp_frame)
     from a GList of GNCTransTempl. */
 GList *gnc_trans_templ_kvp_glist_from_glist(GList *k)
 {
-  GList *res = NULL;
-  if (!k) return NULL;
+    GList *res = NULL;
+    if (!k) return NULL;
 
-  g_list_foreach (k, glist_to_kvp_func, &res);
-  return res;
+    g_list_foreach (k, glist_to_kvp_func, &res);
+    return res;
 }
 
 
 
-/* Value accessors. 
+/* Value accessors.
  *
  * Gee, how I *HATE* OO programming in C! This STINKS! barf barf barf */
 const char *gnc_trans_templ_get_name(const GNCTransTempl *t)
 {
-  g_assert(t);
-  return t->name;
+    g_assert(t);
+    return t->name;
 }
 const char *gnc_trans_templ_get_name_key(const GNCTransTempl *t)
 {
-  g_assert(t);
-  return t->name_key;
+    g_assert(t);
+    return t->name_key;
 }
 const char *gnc_trans_templ_get_recp_name(const GNCTransTempl *t)
 {
-  g_assert(t);
-  return t->recp_name;
+    g_assert(t);
+    return t->recp_name;
 }
 const char *gnc_trans_templ_get_recp_account(const GNCTransTempl *t)
 {
-  g_assert(t);
-  return t->recp_account;
+    g_assert(t);
+    return t->recp_account;
 }
 const char *gnc_trans_templ_get_recp_bankcode(const GNCTransTempl *t)
 {
-  g_assert(t);
-  return t->recp_bankcode;
+    g_assert(t);
+    return t->recp_bankcode;
 }
 gnc_numeric gnc_trans_templ_get_amount(const GNCTransTempl *t)
 {
-  g_assert(t);
-  return t->amount;
+    g_assert(t);
+    return t->amount;
 }
 const char *gnc_trans_templ_get_purpose(const GNCTransTempl *t)
 {
-  g_assert(t);
-  return t->purpose;
+    g_assert(t);
+    return t->purpose;
 }
 const char *gnc_trans_templ_get_purpose_cont(const GNCTransTempl *t)
 {
-  g_assert(t);
-  return t->purpose_cont;
+    g_assert(t);
+    return t->purpose_cont;
 }
 /** value storing. This sucks even more. barf barf barf again */
 void gnc_trans_templ_set_amount(GNCTransTempl *t, gnc_numeric n)
 {
-  g_assert(t);
-  t->amount = n;
+    g_assert(t);
+    t->amount = n;
 }
 void gnc_trans_templ_set_name(GNCTransTempl *t, const char *c)
 {
-  g_assert(t);
-  if (t->name)
-    g_free(t->name);
-  if (t->name_key)
-    g_free(t->name_key);
-  t->name = g_strdup(c);
-  t->name_key = g_utf8_collate_key(c, -1);
+    g_assert(t);
+    if (t->name)
+        g_free(t->name);
+    if (t->name_key)
+        g_free(t->name_key);
+    t->name = g_strdup(c);
+    t->name_key = g_utf8_collate_key(c, -1);
 }
 void gnc_trans_templ_set_recp_name(GNCTransTempl *t, const char *c)
 {
-  g_assert(t);
-  if (t->recp_name)
-    g_free(t->recp_name);
-  t->recp_name = g_strdup(c);
+    g_assert(t);
+    if (t->recp_name)
+        g_free(t->recp_name);
+    t->recp_name = g_strdup(c);
 }
 void gnc_trans_templ_set_recp_account(GNCTransTempl *t, const char *c)
 {
-  g_assert(t);
-  if (t->recp_account)
-    g_free(t->recp_account);
-  t->recp_account = g_strdup(c);
+    g_assert(t);
+    if (t->recp_account)
+        g_free(t->recp_account);
+    t->recp_account = g_strdup(c);
 }
 void gnc_trans_templ_set_recp_bankcode(GNCTransTempl *t, const char *c)
 {
-  g_assert(t);
-  if (t->recp_bankcode)
-    g_free(t->recp_bankcode);
-  t->recp_bankcode = g_strdup(c);
+    g_assert(t);
+    if (t->recp_bankcode)
+        g_free(t->recp_bankcode);
+    t->recp_bankcode = g_strdup(c);
 }
 void gnc_trans_templ_set_purpose(GNCTransTempl *t, const char *c)
 {
-  g_assert(t);
-  if (t->purpose)
-    g_free(t->purpose);
-  t->purpose = g_strdup(c);
+    g_assert(t);
+    if (t->purpose)
+        g_free(t->purpose);
+    t->purpose = g_strdup(c);
 }
 void gnc_trans_templ_set_purpose_cont(GNCTransTempl *t, const char *c)
 {
-  g_assert(t);
-  if (t->purpose_cont)
-    g_free(t->purpose_cont);
-  t->purpose_cont = g_strdup(c);
+    g_assert(t);
+    if (t->purpose_cont)
+        g_free(t->purpose_cont);
+    t->purpose_cont = g_strdup(c);
 }
 
 

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -30,13 +30,13 @@
 /** @name Constructor */
 /*@{*/
 GNCTransTempl *gnc_trans_templ_new(void);
-GNCTransTempl *gnc_trans_templ_new_full(const char *name, 
-					const char *recp_name,
-					const char *recp_account, 
-					const char *recp_bankcode, 
-					gnc_numeric amount, 
-					const char *purpose, 
-					const char *purpose_cont);
+GNCTransTempl *gnc_trans_templ_new_full(const char *name,
+                                        const char *recp_name,
+                                        const char *recp_account,
+                                        const char *recp_bankcode,
+                                        gnc_numeric amount,
+                                        const char *purpose,
+                                        const char *purpose_cont);
 
 void gnc_trans_templ_delete(GNCTransTempl *t);
 void gnc_trans_templ_delete_glist(GList *l);

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -42,256 +42,268 @@
 #include "gnc-hbci-kvp.h"
 
 
-void maketrans_save_templates(GtkWidget *parent, Account *gnc_acc, 
-			      GList *template_list, gboolean dont_ask);
+void maketrans_save_templates(GtkWidget *parent, Account *gnc_acc,
+                              GList *template_list, gboolean dont_ask);
 
 
-void 
+void
 gnc_hbci_maketrans (GtkWidget *parent, Account *gnc_acc,
-		    GNC_HBCI_Transtype trans_type)
+                    GNC_HBCI_Transtype trans_type)
 {
-  AB_BANKING *api = NULL;
-  const AB_ACCOUNT *h_acc = NULL;
-  GNCInteractor *interactor = NULL;
-  
-  g_assert(parent);
-  g_assert(gnc_acc);
+    AB_BANKING *api = NULL;
+    const AB_ACCOUNT *h_acc = NULL;
+    GNCInteractor *interactor = NULL;
 
-  /* Get API */
-  api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
-  if (api == NULL) {
-    g_message("gnc_hbci_maketrans: Couldn't get HBCI API. Nothing will happen.\n");
-    return;
-  }
-  g_assert (interactor);
+    g_assert(parent);
+    g_assert(gnc_acc);
 
-  /* Get HBCI account */
-  h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
-  if (h_acc == NULL) {
-    g_warning("gnc_hbci_maketrans: No HBCI account found. Nothing will happen.\n");
-    return;
-  }
-  /*printf("gnc_hbci_maketrans: HBCI account no. %s found.\n",
-    AB_ACCOUNT_accountId (h_acc));*/
-  
-  {
-    GList *template_list = 
-      gnc_trans_templ_glist_from_kvp_glist
-      ( gnc_hbci_get_book_template_list
-	( gnc_account_get_book(gnc_acc)));
-    int result;
-    gboolean successful = FALSE;
-    HBCITransDialog *td;
+    /* Get API */
+    api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
+    if (api == NULL)
+    {
+        g_message("gnc_hbci_maketrans: Couldn't get HBCI API. Nothing will happen.\n");
+        return;
+    }
+    g_assert (interactor);
 
-    /* Now open the HBCI_trans_dialog, which also calls
-       AB_BANKING_executeQueue. */
-      
-    /* Create new HBCIDialogTrans */
-    td = gnc_hbci_dialog_new(parent, h_acc, gnc_acc, 
-			     trans_type, template_list);
+    /* Get HBCI account */
+    h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
+    if (h_acc == NULL)
+    {
+        g_warning("gnc_hbci_maketrans: No HBCI account found. Nothing will happen.\n");
+        return;
+    }
+    /*printf("gnc_hbci_maketrans: HBCI account no. %s found.\n",
+      AB_ACCOUNT_accountId (h_acc));*/
 
-    /* Delete the list.  The data is still pointed to by the
-     *  GtkListStore in the dialog. */
-    g_list_free(template_list);
-    template_list = NULL;
-	
-    /* Repeat until HBCI action was successful or user pressed cancel */
-    do {
+    {
+        GList *template_list =
+            gnc_trans_templ_glist_from_kvp_glist
+            ( gnc_hbci_get_book_template_list
+              ( gnc_account_get_book(gnc_acc)));
+        int result;
+        gboolean successful = FALSE;
+        HBCITransDialog *td;
 
-      /* Let the user enter the values. If cancel is pressed, -1 is returned.  */
-      result = gnc_hbci_dialog_run_until_ok(td, h_acc);
+        /* Now open the HBCI_trans_dialog, which also calls
+           AB_BANKING_executeQueue. */
 
-      if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER)) {
-	/* If cancel has been pressed, the dialog doesn't exist
-	   anymore and we cannot query for the template
-	   list. Therefore break immediately. */
-	break;
-      } 
+        /* Create new HBCIDialogTrans */
+        td = gnc_hbci_dialog_new(parent, h_acc, gnc_acc,
+                                 trans_type, template_list);
 
-      /* Set the template list in case it got modified. */
-      if (template_list)
-	g_list_free(template_list);
-      template_list = gnc_hbci_dialog_get_templ(td);
+        /* Delete the list.  The data is still pointed to by the
+         *  GtkListStore in the dialog. */
+        g_list_free(template_list);
+        template_list = NULL;
 
-      /* templates changed? If yes, store them */
-      if (gnc_hbci_dialog_get_templ_changed(td) )
-	       maketrans_save_templates(parent, gnc_acc, template_list,
-					(result == GNC_RESPONSE_NOW));
+        /* Repeat until HBCI action was successful or user pressed cancel */
+        do
+        {
 
-      /* Make really sure the dialog is hidden now. */
-      gnc_hbci_dialog_hide(td);
+            /* Let the user enter the values. If cancel is pressed, -1 is returned.  */
+            result = gnc_hbci_dialog_run_until_ok(td, h_acc);
 
-      {
-	AB_JOB *job = 
-	  gnc_hbci_trans_dialog_enqueue(gnc_hbci_dialog_get_htrans(td), api,
-					(AB_ACCOUNT *)h_acc, trans_type);
+            if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER))
+            {
+                /* If cancel has been pressed, the dialog doesn't exist
+                   anymore and we cannot query for the template
+                   list. Therefore break immediately. */
+                break;
+            }
 
-	/* Check whether we really got a job */
-	if (!job) {
-	  /* Oops, no job, probably not supported by bank. */
-	  if (gnc_verify_dialog
-	      (parent, 
-	       FALSE,
-	       "%s",
-	       _("The backend found an error during the preparation "
-		 "of the job. It is not possible to execute this job. \n"
-		 "\n"
-		 "Most probable the bank does not support your chosen "
-		 "job or your Online Banking account does not have the permission "
-		 "to execute this job. More error messages might be "
-		 "visible on your console log.\n"
-		 "\n"
-		 "Do you want to enter the job again?")))
-	    continue;
-	  else
-	    /* job is NULL anyway, so it doesn't have to be cleaned up */
-	    break;
-	}
-      
-	/* HBCI Transaction has been created and enqueued, so now open
-	 * the gnucash transaction dialog and fill in all values. */
-	successful = gnc_hbci_maketrans_final (td, gnc_acc, trans_type);
+            /* Set the template list in case it got modified. */
+            if (template_list)
+                g_list_free(template_list);
+            template_list = gnc_hbci_dialog_get_templ(td);
 
-	/* User pressed cancel? Then go back to HBCI transaction */
-	if (!successful) {
-	  AB_Banking_DequeueJob (api, job);
-	  AB_Job_free (job);
-	  continue;
-	}
+            /* templates changed? If yes, store them */
+            if (gnc_hbci_dialog_get_templ_changed(td) )
+                maketrans_save_templates(parent, gnc_acc, template_list,
+                                         (result == GNC_RESPONSE_NOW));
 
-	/* Result of run_until_ok:
-	 *  GNC_RESPONSE_NOW == execute now
-	 *  GNC_RESPONSE_LATER == scheduled for later execution (currently unimplemented)
-	 *  GTK_RESPONSE_CANCEL == cancel
-	 *  GTK_RESPONSE_DELETE_EVENT == window destroyed */
-	if (result == GNC_RESPONSE_NOW) {
+            /* Make really sure the dialog is hidden now. */
+            gnc_hbci_dialog_hide(td);
 
-	  /* If the user pressed "execute now", then execute this job
-	     now. This function already delete()s the job. */
-	  successful = gnc_hbci_trans_dialog_execute(td, api, 
-						     job, interactor);
+            {
+                AB_JOB *job =
+                    gnc_hbci_trans_dialog_enqueue(gnc_hbci_dialog_get_htrans(td), api,
+                                                  (AB_ACCOUNT *)h_acc, trans_type);
 
-	  if (!successful) {
-	    /* HBCI job failed -- then remove gnc txn from the books. */
-	    Transaction *gtrans = gnc_hbci_dialog_get_gtrans(td);
-	    xaccTransBeginEdit(gtrans);
-	    xaccTransDestroy(gtrans);
-	    xaccTransCommitEdit(gtrans);
-	  }
-	  
-	  gnc_hbci_cleanup_job(api, job);
-	} /* result == GNC_RESPONSE_NOW */
-	else {
-	  /* Simply ignore any other case. */
-	  break;
-	} /* result == GNC_RESPONSE_NOW */
-	  
-      } /* Create a do-transaction (transfer) job */
-	
-    } while (!successful);
-    
-    /* If we wanted to do something here with the gnc txn, we could. */
-    /*if (result >= 0) {
-      Transaction *gtrans = gnc_hbci_dialog_get_gtrans(td);
-      g_message("gnc-hbci-transfer: Got gnc txn w/ description: %s\n",
-      xaccTransGetDescription(gtrans));
-      }*/
+                /* Check whether we really got a job */
+                if (!job)
+                {
+                    /* Oops, no job, probably not supported by bank. */
+                    if (gnc_verify_dialog
+                            (parent,
+                             FALSE,
+                             "%s",
+                             _("The backend found an error during the preparation "
+                               "of the job. It is not possible to execute this job. \n"
+                               "\n"
+                               "Most probable the bank does not support your chosen "
+                               "job or your Online Banking account does not have the permission "
+                               "to execute this job. More error messages might be "
+                               "visible on your console log.\n"
+                               "\n"
+                               "Do you want to enter the job again?")))
+                        continue;
+                    else
+                        /* job is NULL anyway, so it doesn't have to be cleaned up */
+                        break;
+                }
 
-    /* Just to be on the safe side, clear queue once again. */
-    gnc_AB_BANKING_fini (api);
-    gnc_hbci_dialog_delete(td);
-    gnc_trans_templ_delete_glist (template_list);
-    
-    /* GNCInteractor_hide (interactor); */
-  }
+                /* HBCI Transaction has been created and enqueued, so now open
+                 * the gnucash transaction dialog and fill in all values. */
+                successful = gnc_hbci_maketrans_final (td, gnc_acc, trans_type);
+
+                /* User pressed cancel? Then go back to HBCI transaction */
+                if (!successful)
+                {
+                    AB_Banking_DequeueJob (api, job);
+                    AB_Job_free (job);
+                    continue;
+                }
+
+                /* Result of run_until_ok:
+                 *  GNC_RESPONSE_NOW == execute now
+                 *  GNC_RESPONSE_LATER == scheduled for later execution (currently unimplemented)
+                 *  GTK_RESPONSE_CANCEL == cancel
+                 *  GTK_RESPONSE_DELETE_EVENT == window destroyed */
+                if (result == GNC_RESPONSE_NOW)
+                {
+
+                    /* If the user pressed "execute now", then execute this job
+                       now. This function already delete()s the job. */
+                    successful = gnc_hbci_trans_dialog_execute(td, api,
+                                 job, interactor);
+
+                    if (!successful)
+                    {
+                        /* HBCI job failed -- then remove gnc txn from the books. */
+                        Transaction *gtrans = gnc_hbci_dialog_get_gtrans(td);
+                        xaccTransBeginEdit(gtrans);
+                        xaccTransDestroy(gtrans);
+                        xaccTransCommitEdit(gtrans);
+                    }
+
+                    gnc_hbci_cleanup_job(api, job);
+                } /* result == GNC_RESPONSE_NOW */
+                else
+                {
+                    /* Simply ignore any other case. */
+                    break;
+                } /* result == GNC_RESPONSE_NOW */
+
+            } /* Create a do-transaction (transfer) job */
+
+        }
+        while (!successful);
+
+        /* If we wanted to do something here with the gnc txn, we could. */
+        /*if (result >= 0) {
+          Transaction *gtrans = gnc_hbci_dialog_get_gtrans(td);
+          g_message("gnc-hbci-transfer: Got gnc txn w/ description: %s\n",
+          xaccTransGetDescription(gtrans));
+          }*/
+
+        /* Just to be on the safe side, clear queue once again. */
+        gnc_AB_BANKING_fini (api);
+        gnc_hbci_dialog_delete(td);
+        gnc_trans_templ_delete_glist (template_list);
+
+        /* GNCInteractor_hide (interactor); */
+    }
 }
 
 
 /** Store the template_list in the given Account gnc_acc. If dont_ask
     is FALSE, first ask whether they really should be saved. */
-void maketrans_save_templates(GtkWidget *parent, Account *gnc_acc, 
-			      GList *template_list, gboolean dont_ask)
+void maketrans_save_templates(GtkWidget *parent, Account *gnc_acc,
+                              GList *template_list, gboolean dont_ask)
 {
-  if (dont_ask || gnc_verify_dialog
-      (parent, 
-       FALSE,
-       "%s",
-       _("You have changed the list of online transfer templates, "
-	 "but you cancelled the transfer dialog. "
-	 "Do you nevertheless want to store the changes?"))) {
-    GList *kvp_list = gnc_trans_templ_kvp_glist_from_glist (template_list);
-    /*printf ("Now having %d templates. List: '%s'\n", 
-      g_list_length(template_list),
-      kvp_value_glist_to_string(kvp_list));*/
-    gnc_hbci_set_book_template_list
-      (gnc_account_get_book(gnc_acc), kvp_list);
-  }
+    if (dont_ask || gnc_verify_dialog
+            (parent,
+             FALSE,
+             "%s",
+             _("You have changed the list of online transfer templates, "
+               "but you cancelled the transfer dialog. "
+               "Do you nevertheless want to store the changes?")))
+    {
+        GList *kvp_list = gnc_trans_templ_kvp_glist_from_glist (template_list);
+        /*printf ("Now having %d templates. List: '%s'\n",
+          g_list_length(template_list),
+          kvp_value_glist_to_string(kvp_list));*/
+        gnc_hbci_set_book_template_list
+        (gnc_account_get_book(gnc_acc), kvp_list);
+    }
 }
 
 gboolean
 gnc_hbci_maketrans_final(HBCITransDialog *td, Account *gnc_acc,
-			  GNC_HBCI_Transtype trans_type)
+                         GNC_HBCI_Transtype trans_type)
 {
-  gnc_numeric amount;
-  XferDialog *transdialog;
-  const AB_TRANSACTION *h_trans;
-  gboolean run_until_done = TRUE;
-  g_assert(td);
+    gnc_numeric amount;
+    XferDialog *transdialog;
+    const AB_TRANSACTION *h_trans;
+    gboolean run_until_done = TRUE;
+    g_assert(td);
 
-  h_trans = gnc_hbci_dialog_get_htrans(td);
-  
-  /* HBCI Transaction has finished, so now open the gnucash
-     transaction dialog and fill in all values. */
-  
-  transdialog = gnc_xfer_dialog (gnc_hbci_dialog_get_parent(td), gnc_acc);
-  
-  switch (trans_type) {
-  case SINGLE_DEBITNOTE:
-    gnc_xfer_dialog_set_title (transdialog, _("Online Banking Direct Debit Note"));
-  case SINGLE_INTERNAL_TRANSFER:
-    gnc_xfer_dialog_set_title (transdialog, _("Online Banking Bank-Internal Transfer"));
-  case SINGLE_TRANSFER:
-  default:
-    gnc_xfer_dialog_set_title (transdialog, _("Online Banking Transaction"));
-  }
-      
-  /* Amount */
-  amount = double_to_gnc_numeric 
-    (AB_Value_GetValue (AB_Transaction_GetValue (h_trans)),
-     xaccAccountGetCommoditySCU(gnc_acc),
-     GNC_RND_ROUND); 
-  /*switch (trans_type) {
+    h_trans = gnc_hbci_dialog_get_htrans(td);
+
+    /* HBCI Transaction has finished, so now open the gnucash
+       transaction dialog and fill in all values. */
+
+    transdialog = gnc_xfer_dialog (gnc_hbci_dialog_get_parent(td), gnc_acc);
+
+    switch (trans_type)
+    {
     case SINGLE_DEBITNOTE:
-    gnc_xfer_dialog_set_amount (transdialog, gnc_numeric_neg (amount));
+        gnc_xfer_dialog_set_title (transdialog, _("Online Banking Direct Debit Note"));
+    case SINGLE_INTERNAL_TRANSFER:
+        gnc_xfer_dialog_set_title (transdialog, _("Online Banking Bank-Internal Transfer"));
     case SINGLE_TRANSFER:
-    default:*/
-  gnc_xfer_dialog_set_amount (transdialog, amount);
-  /*}*/
-  /* gnc_xfer_dialog_toggle_currency_frame (transdialog, FALSE); */
+    default:
+        gnc_xfer_dialog_set_title (transdialog, _("Online Banking Transaction"));
+    }
 
-  {
-    /* Description */
-    char *g_descr = gnc_hbci_descr_tognc (h_trans);
-    gnc_xfer_dialog_set_description (transdialog, g_descr);
-    g_free (g_descr);
-  }
+    /* Amount */
+    amount = double_to_gnc_numeric
+             (AB_Value_GetValue (AB_Transaction_GetValue (h_trans)),
+              xaccAccountGetCommoditySCU(gnc_acc),
+              GNC_RND_ROUND);
+    /*switch (trans_type) {
+      case SINGLE_DEBITNOTE:
+      gnc_xfer_dialog_set_amount (transdialog, gnc_numeric_neg (amount));
+      case SINGLE_TRANSFER:
+      default:*/
+    gnc_xfer_dialog_set_amount (transdialog, amount);
+    /*}*/
+    /* gnc_xfer_dialog_toggle_currency_frame (transdialog, FALSE); */
 
-  {
-    /* Memo. */
-    char *g_memo = gnc_hbci_memo_tognc (h_trans);
-    gnc_xfer_dialog_set_memo (transdialog, g_memo);
-    g_free (g_memo);
-  }
-  /*gnc_xfer_dialog_set_date(XferDialog *xferData, time_t set_time)*/
+    {
+        /* Description */
+        char *g_descr = gnc_hbci_descr_tognc (h_trans);
+        gnc_xfer_dialog_set_description (transdialog, g_descr);
+        g_free (g_descr);
+    }
 
-  /* Set the callback for the Gnucash Transaction */
-  gnc_xfer_dialog_set_txn_cb(transdialog, gnc_hbci_dialog_xfer_cb, td);
-  
-  /* Run the dialog until the user has either successfully completed the
-   * transaction (just clicking OK doesn't always count) or clicked Cancel.
-   * Return TRUE if the transaction was a success, FALSE otherwise.
-   */
-  return run_until_done 
-    ? gnc_xfer_dialog_run_until_done( transdialog )
-    : TRUE;
+    {
+        /* Memo. */
+        char *g_memo = gnc_hbci_memo_tognc (h_trans);
+        gnc_xfer_dialog_set_memo (transdialog, g_memo);
+        g_free (g_memo);
+    }
+    /*gnc_xfer_dialog_set_date(XferDialog *xferData, time_t set_time)*/
+
+    /* Set the callback for the Gnucash Transaction */
+    gnc_xfer_dialog_set_txn_cb(transdialog, gnc_hbci_dialog_xfer_cb, td);
+
+    /* Run the dialog until the user has either successfully completed the
+     * transaction (just clicking OK doesn't always count) or clicked Cancel.
+     * Return TRUE if the transaction was a success, FALSE otherwise.
+     */
+    return run_until_done
+           ? gnc_xfer_dialog_run_until_done( transdialog )
+           : TRUE;
 }

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -27,9 +27,9 @@
 #include "Account.h"
 #include "dialog-hbcitrans.h"
 
-void 
+void
 gnc_hbci_maketrans (GtkWidget *parent, Account *gnc_acc,
-		    GNC_HBCI_Transtype trans_type);
+                    GNC_HBCI_Transtype trans_type);
 
 /** Open a gnucash transfer dialog for gnucash Account gnc_acc and
  * fill in all the values from the AB_TRANSACTION inside the
@@ -37,7 +37,7 @@
  * successfully created, FALSE if e.g. the user pressed cancel. */
 gboolean
 gnc_hbci_maketrans_final(HBCITransDialog *td, Account *gnc_acc,
-			 GNC_HBCI_Transtype trans_type);
+                         GNC_HBCI_Transtype trans_type);
 
 
 #endif /* GNC_HBCI_TRANSFER_H */

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -33,7 +33,7 @@
 #include "gnc-hbci-kvp.h"
 #include "gnc-gconf-utils.h"
 #include "gnc-ui-util.h"
-#include "qof.h" 
+#include "qof.h"
 #include "gnc-glib-utils.h"
 
 #include "import-main-matcher.h"
@@ -65,186 +65,201 @@
        ((AQBANKING_VERSION_PATCHLEVEL < 7)))))
 static AB_IMEXPORTER_ACCOUNTINFO *
 AB_ImExporterContext_AccountInfoForEach(AB_IMEXPORTER_CONTEXT *iec,
-					AB_IMEXPORTER_ACCOUNTINFO *
-					(* func)(AB_IMEXPORTER_ACCOUNTINFO *element,
-						 void *user_data),
-					void* user_data)
+                                        AB_IMEXPORTER_ACCOUNTINFO *
+                                        (* func)(AB_IMEXPORTER_ACCOUNTINFO *element,
+                                                void *user_data),
+                                        void* user_data)
 {
-  AB_IMEXPORTER_ACCOUNTINFO *it;
-  AB_IMEXPORTER_ACCOUNTINFO *retval;
-  g_assert(iec);
+    AB_IMEXPORTER_ACCOUNTINFO *it;
+    AB_IMEXPORTER_ACCOUNTINFO *retval;
+    g_assert(iec);
 
-  it = AB_ImExporterContext_GetFirstAccountInfo (iec);
-  while (it) {
-    retval = func(it, user_data);
-    if (retval) {
-      return retval;
+    it = AB_ImExporterContext_GetFirstAccountInfo (iec);
+    while (it)
+    {
+        retval = func(it, user_data);
+        if (retval)
+        {
+            return retval;
+        }
+        it = AB_ImExporterContext_GetNextAccountInfo (iec);
     }
-    it = AB_ImExporterContext_GetNextAccountInfo (iec);
-  }
-  return 0;
+    return 0;
 
 }
 static const AB_TRANSACTION *
 AB_ImExporterAccountInfo_TransactionsForEach(AB_IMEXPORTER_ACCOUNTINFO *iea,
-					     const AB_TRANSACTION *
-					     (* func)(const AB_TRANSACTION *element,
-						      void *user_data),
-					     void* user_data)
+        const AB_TRANSACTION *
+        (* func)(const AB_TRANSACTION *element,
+                 void *user_data),
+        void* user_data)
 {
-  const AB_TRANSACTION *it;
-  const AB_TRANSACTION *retval;
-  g_assert(iea);
+    const AB_TRANSACTION *it;
+    const AB_TRANSACTION *retval;
+    g_assert(iea);
 
-  it = AB_ImExporterAccountInfo_GetFirstTransaction (iea);
-  while (it) {
-    retval = func(it, user_data);
-    if (retval) {
-      return retval;
+    it = AB_ImExporterAccountInfo_GetFirstTransaction (iea);
+    while (it)
+    {
+        retval = func(it, user_data);
+        if (retval)
+        {
+            return retval;
+        }
+        it = AB_ImExporterAccountInfo_GetNextTransaction (iea);
     }
-    it = AB_ImExporterAccountInfo_GetNextTransaction (iea);
-  }
-  return 0;
+    return 0;
 }
 #endif /* aqbanking < 1.9.7 */
 
 
 
-AB_BANKING * gnc_AB_BANKING_new_currentbook (GtkWidget *parent, 
-					     GNCInteractor **inter)
+AB_BANKING * gnc_AB_BANKING_new_currentbook (GtkWidget *parent,
+        GNCInteractor **inter)
 {
-  if (gnc_AB_BANKING == NULL) {
-    /* No API cached -- create new one. */
-    AB_BANKING *api = NULL;
-  
-    api = AB_Banking_new ("gnucash", 0);
-    g_assert(api);
+    if (gnc_AB_BANKING == NULL)
     {
-      int r = AB_Banking_Init(api);
-      if (r != 0)
-	g_critical("gnc_AB_BANKING_new: Warning: Error %d on AB_Banking_init\n", r);
+        /* No API cached -- create new one. */
+        AB_BANKING *api = NULL;
+
+        api = AB_Banking_new ("gnucash", 0);
+        g_assert(api);
+        {
+            int r = AB_Banking_Init(api);
+            if (r != 0)
+                g_critical("gnc_AB_BANKING_new: Warning: Error %d on AB_Banking_init\n", r);
+        }
+
+        gnc_hbci_inter = gnc_AB_BANKING_interactors (api, parent);
+        gnc_AB_BANKING = api;
+
+        if (inter)
+            *inter = gnc_hbci_inter;
+
+        gnc_AB_BANKING_refcnt = 1;
+        return gnc_AB_BANKING;
     }
-    
-    gnc_hbci_inter = gnc_AB_BANKING_interactors (api, parent);
-    gnc_AB_BANKING = api;
-    
-    if (inter)
-      *inter = gnc_hbci_inter;
+    else
+    {
+        /* API cached. */
 
-    gnc_AB_BANKING_refcnt = 1;
-    return gnc_AB_BANKING;
-  } else {
-    /* API cached. */
+        /* Init the API again. */
+        if (gnc_AB_BANKING_refcnt == 0)
+            AB_Banking_Init(gnc_AB_BANKING);
 
-    /* Init the API again. */
-    if (gnc_AB_BANKING_refcnt == 0)
-      AB_Banking_Init(gnc_AB_BANKING);
+        if (inter)
+        {
+            *inter = gnc_hbci_inter;
+            GNCInteractor_reparent (*inter, parent);
+        }
 
-    if (inter) {
-      *inter = gnc_hbci_inter;
-      GNCInteractor_reparent (*inter, parent);
+        gnc_AB_BANKING_refcnt++;
+        return gnc_AB_BANKING;
     }
-    
-    gnc_AB_BANKING_refcnt++;
-    return gnc_AB_BANKING;
-  }
 }
 
 void gnc_AB_BANKING_delete (AB_BANKING *api)
 {
-  if (api == 0)
-    api = gnc_AB_BANKING;
+    if (api == 0)
+        api = gnc_AB_BANKING;
 
-  if (api) {
-    if (api == gnc_AB_BANKING) {
-      gnc_AB_BANKING = NULL;
-      gnc_hbci_inter = NULL;
-      if (gnc_AB_BANKING_refcnt > 0)
-	AB_Banking_Fini(api);
+    if (api)
+    {
+        if (api == gnc_AB_BANKING)
+        {
+            gnc_AB_BANKING = NULL;
+            gnc_hbci_inter = NULL;
+            if (gnc_AB_BANKING_refcnt > 0)
+                AB_Banking_Fini(api);
+        }
+
+        AB_Banking_free(api);
     }
-
-    AB_Banking_free(api);
-  }
 }
 
 
-int gnc_AB_BANKING_fini (AB_BANKING *api) 
+int gnc_AB_BANKING_fini (AB_BANKING *api)
 {
-  if (api == gnc_AB_BANKING) {
-    gnc_AB_BANKING_refcnt--;
-    if (gnc_AB_BANKING_refcnt == 0)
-      return AB_Banking_Fini(api);
-  }
-  else
-    return AB_Banking_Fini(api);
-  return 0;
+    if (api == gnc_AB_BANKING)
+    {
+        gnc_AB_BANKING_refcnt--;
+        if (gnc_AB_BANKING_refcnt == 0)
+            return AB_Banking_Fini(api);
+    }
+    else
+        return AB_Banking_Fini(api);
+    return 0;
 }
 
 
 
 
 AB_ACCOUNT *
-gnc_hbci_get_hbci_acc (const AB_BANKING *api, Account *gnc_acc) 
+gnc_hbci_get_hbci_acc (const AB_BANKING *api, Account *gnc_acc)
 {
-  int account_uid = 0;
-  AB_ACCOUNT *hbci_acc = NULL;
-  const char *bankcode = NULL, *accountid = NULL;
+    int account_uid = 0;
+    AB_ACCOUNT *hbci_acc = NULL;
+    const char *bankcode = NULL, *accountid = NULL;
 
-  bankcode = gnc_hbci_get_account_bankcode (gnc_acc);
-  accountid = gnc_hbci_get_account_accountid (gnc_acc);
-  account_uid = gnc_hbci_get_account_uid (gnc_acc);
-  if (account_uid > 0) {
-    /*printf("gnc_hbci_get_hbci_acc: gnc_acc %s has blz %s and ccode %d\n",
-      xaccAccountGetName (gnc_acc), bankcode, countrycode);*/
-    hbci_acc = AB_Banking_GetAccount(api, account_uid);
+    bankcode = gnc_hbci_get_account_bankcode (gnc_acc);
+    accountid = gnc_hbci_get_account_accountid (gnc_acc);
+    account_uid = gnc_hbci_get_account_uid (gnc_acc);
+    if (account_uid > 0)
+    {
+        /*printf("gnc_hbci_get_hbci_acc: gnc_acc %s has blz %s and ccode %d\n",
+          xaccAccountGetName (gnc_acc), bankcode, countrycode);*/
+        hbci_acc = AB_Banking_GetAccount(api, account_uid);
 
-    if (!hbci_acc && bankcode && (strlen(bankcode)>0) &&
-	accountid && (strlen(accountid) > 0)) {
-      g_message("gnc_hbci_get_hbci_acc: No AB_ACCOUNT found for UID %d, trying bank code\n", account_uid);
-      hbci_acc = AB_Banking_GetAccountByCodeAndNumber(api, bankcode, accountid);
+        if (!hbci_acc && bankcode && (strlen(bankcode) > 0) &&
+                accountid && (strlen(accountid) > 0))
+        {
+            g_message("gnc_hbci_get_hbci_acc: No AB_ACCOUNT found for UID %d, trying bank code\n", account_uid);
+            hbci_acc = AB_Banking_GetAccountByCodeAndNumber(api, bankcode, accountid);
+        }
+        /* g_message("gnc_hbci_get_hbci_acc: return HBCI_Account %p\n", hbci_acc); */
+        return hbci_acc;
     }
-    /* g_message("gnc_hbci_get_hbci_acc: return HBCI_Account %p\n", hbci_acc); */
-    return hbci_acc;
-  } else if (bankcode && (strlen(bankcode)>0) && accountid && (strlen(accountid) > 0)) {
-    hbci_acc = AB_Banking_GetAccountByCodeAndNumber(api, bankcode, accountid);
-    return hbci_acc;
-  }
+    else if (bankcode && (strlen(bankcode) > 0) && accountid && (strlen(accountid) > 0))
+    {
+        hbci_acc = AB_Banking_GetAccountByCodeAndNumber(api, bankcode, accountid);
+        return hbci_acc;
+    }
 
-  return NULL;
+    return NULL;
 }
 
 #if 0
 static void *
 print_list_int_cb (int value, void *user_data)
 {
-  g_warning("%d, ", value);
-  return NULL;
+    g_warning("%d, ", value);
+    return NULL;
 }
-static void 
+static void
 print_list_int (const list_int *list)
 {
-  g_assert(list);
-  list_int_foreach (list, &print_list_int_cb, NULL);
-  g_warning ("\n");
+    g_assert(list);
+    list_int_foreach (list, &print_list_int_cb, NULL);
+    g_warning ("\n");
 }
 static void *
 get_resultcode_error_cb (int value, void *user_data)
 {
-  int *tmp_result = user_data;
-  if (value > *tmp_result)
-    *tmp_result = value;
-  if (value >= 9000)
-    return (void*) value;
-  else
-    return NULL;
+    int *tmp_result = user_data;
+    if (value > *tmp_result)
+        *tmp_result = value;
+    if (value >= 9000)
+        return (void*) value;
+    else
+        return NULL;
 }
 static int
 get_resultcode_error (const list_int *list)
 {
-  int tmp_result = 0, cause = 0;
-  g_assert (list);
-  cause = (int) list_int_foreach (list, &get_resultcode_error_cb, &tmp_result);
-  return MAX(tmp_result, cause);
+    int tmp_result = 0, cause = 0;
+    g_assert (list);
+    cause = (int) list_int_foreach (list, &get_resultcode_error_cb, &tmp_result);
+    return MAX(tmp_result, cause);
 }
 #endif
 
@@ -254,150 +269,164 @@
 static int
 gnc_hbci_debug_outboxjob (GNCInteractor *inter, AB_JOB *job, gboolean verbose)
 {
-  int cause = 0;
-  AB_JOB_STATUS jobstatus;
-  
-  g_assert (job);
+    int cause = 0;
+    AB_JOB_STATUS jobstatus;
 
-  if (verbose) {
-    g_warning("gnc_hbci_debug_outboxjob: Job status: %s", AB_Job_Status2Char(AB_Job_GetStatus(job)));
+    g_assert (job);
 
-    g_warning(", result: %s", AB_Job_GetResultText(job) ? AB_Job_GetResultText(job) : "(none)");
-    g_warning("\n");
-  }
+    if (verbose)
+    {
+        g_warning("gnc_hbci_debug_outboxjob: Job status: %s", AB_Job_Status2Char(AB_Job_GetStatus(job)));
 
-  jobstatus = AB_Job_GetStatus (job);
-  if (jobstatus == AB_Job_StatusError) {
-    if (AB_Job_GetResultText (job)) {
-      /* Add the "result text" to the log window */
-      char *logstring = g_strdup_printf("Job %s had an error: %s\n",
-					AB_Job_Type2Char(AB_Job_GetType(job)),
-					AB_Job_GetResultText(job));
-      GNCInteractor_add_log_text (inter, logstring);
-      g_free (logstring);
+        g_warning(", result: %s", AB_Job_GetResultText(job) ? AB_Job_GetResultText(job) : "(none)");
+        g_warning("\n");
     }
 
-    if (!verbose)
-      g_warning("gnc_hbci_debug_outboxjob: Job %s had an error: %s\n",
-	     AB_Job_Type2Char(AB_Job_GetType(job)),
-	     AB_Job_GetResultText(job) ? AB_Job_GetResultText(job) : "(none)");
-    cause = 9000;
-  } else {
-    cause = 0;
-  }
+    jobstatus = AB_Job_GetStatus (job);
+    if (jobstatus == AB_Job_StatusError)
+    {
+        if (AB_Job_GetResultText (job))
+        {
+            /* Add the "result text" to the log window */
+            char *logstring = g_strdup_printf("Job %s had an error: %s\n",
+                                              AB_Job_Type2Char(AB_Job_GetType(job)),
+                                              AB_Job_GetResultText(job));
+            GNCInteractor_add_log_text (inter, logstring);
+            g_free (logstring);
+        }
 
-#if 0  
-  /* hbci debugging code; might be adapted to aqbanking at a later
-     point in time */
-  list = AB_JOB_resultCodes (job);
-  if (list_int_size (list) > 0) {
+        if (!verbose)
+            g_warning("gnc_hbci_debug_outboxjob: Job %s had an error: %s\n",
+                      AB_Job_Type2Char(AB_Job_GetType(job)),
+                      AB_Job_GetResultText(job) ? AB_Job_GetResultText(job) : "(none)");
+        cause = 9000;
+    }
+    else
+    {
+        cause = 0;
+    }
 
-    cause = get_resultcode_error (list);
+#if 0
+    /* hbci debugging code; might be adapted to aqbanking at a later
+       point in time */
+    list = AB_JOB_resultCodes (job);
+    if (list_int_size (list) > 0)
+    {
 
-    if (verbose) {
-      g_warning("OutboxJob resultcodes: ");
-      print_list_int (list);
+        cause = get_resultcode_error (list);
 
-      switch (cause) {
-      case 9310:
-	msg = "Schluessel noch nicht hinterlegt";
-	break;
-      case 9320:
-	msg = "Schluessel noch nicht freigeschaltet";
-	break;
-      case 9330:
-	msg = "Schluessel gesperrt";
-	break;
-      case 9340:
-	msg = "Schluessel falsch";
-	break;
-      default:
-	msg = "Unknown";
-      }
-      g_warning("Probable cause of error was: code %d, msg: %s\n", cause, msg);
+        if (verbose)
+        {
+            g_warning("OutboxJob resultcodes: ");
+            print_list_int (list);
+
+            switch (cause)
+            {
+            case 9310:
+                msg = "Schluessel noch nicht hinterlegt";
+                break;
+            case 9320:
+                msg = "Schluessel noch nicht freigeschaltet";
+                break;
+            case 9330:
+                msg = "Schluessel gesperrt";
+                break;
+            case 9340:
+                msg = "Schluessel falsch";
+                break;
+            default:
+                msg = "Unknown";
+            }
+            g_warning("Probable cause of error was: code %d, msg: %s\n", cause, msg);
+        }
     }
-  } else {
-    if (verbose)
-      g_warning("OutboxJob's resultCodes list has zero length.\n");
-  }
-  list_int_delete (list);
+    else
+    {
+        if (verbose)
+            g_warning("OutboxJob's resultCodes list has zero length.\n");
+    }
+    list_int_delete (list);
 #endif
 
-  return cause;
+    return cause;
 }
 
 void
 gnc_hbci_cleanup_job(AB_BANKING *api, AB_JOB *job)
 {
-  if (AB_Job_GetStatus(job) == AB_Job_StatusFinished) {
-    AB_Banking_DelFinishedJob(api, job);
-  } else if (AB_Job_GetStatus(job) == AB_Job_StatusPending) {
-    AB_Banking_DelPendingJob(api, job);
-  }
-  /* Martin assured me that there will be no job in the queue after
-     ExecuteQueue, so we don't need to remove it from the queue. */
+    if (AB_Job_GetStatus(job) == AB_Job_StatusFinished)
+    {
+        AB_Banking_DelFinishedJob(api, job);
+    }
+    else if (AB_Job_GetStatus(job) == AB_Job_StatusPending)
+    {
+        AB_Banking_DelPendingJob(api, job);
+    }
+    /* Martin assured me that there will be no job in the queue after
+       ExecuteQueue, so we don't need to remove it from the queue. */
 }
 
 
 gboolean
-gnc_hbci_Error_retry (GtkWidget *parent, int error, 
-		      GNCInteractor *inter)
+gnc_hbci_Error_retry (GtkWidget *parent, int error,
+                      GNCInteractor *inter)
 {
-  int code = error;
+    int code = error;
 
-  switch (code) {
+    switch (code)
+    {
 #if 0
-    /* these error codes existed in openhbci, but no longer in
-       aqbanking. Maybe they might get reintroduced later, but maybe
-       not. */
-  case AB_ERROR_PIN_WRONG:
-    GNCInteractor_erasePIN (inter);
-    return gnc_verify_dialog (parent,
-				       TRUE,
-				       _("The PIN you entered was wrong.\n"
-					 "Do you want to try again?"));
-  case AB_ERROR_PIN_WRONG_0:
-    GNCInteractor_erasePIN (inter);
-    return gnc_verify_dialog (parent,
-				       TRUE,
-				       _("The PIN you entered was wrong.\n"
-					 "ATTENTION: You have zero further wrong retries left!\n"
-					 "Do you want to try again?"));
-  case AB_ERROR_CARD_DESTROYED:
-    GNCInteractor_hide (inter);
-    gnc_error_dialog
-      (parent,
-       _("Unfortunately you entered a wrong PIN for too many times. "
-	 "Your chip card is therefore destroyed. Aborting."));
-    return FALSE;
-  case AB_ERROR_FILE_NOT_FOUND:
-    /*     g_warning("gnc_hbci_Error_feedback: File not found error.\n"); */
-    return FALSE;
-  case AB_ERROR_NO_CARD:
-    return gnc_verify_dialog (parent,
-			      TRUE,
-			      _("No chip card has been found in the chip card reader. "
-				"Do you want to try again?"));
-  case AB_ERROR_JOB_NOT_SUPPORTED:
-    GNCInteractor_hide (inter);
-    gnc_error_dialog 
-      (parent,
-       _("Unfortunately this Online Banking job is not supported "
-	 "by your bank or for your account. Aborting."));
-    return FALSE;
+        /* these error codes existed in openhbci, but no longer in
+           aqbanking. Maybe they might get reintroduced later, but maybe
+           not. */
+    case AB_ERROR_PIN_WRONG:
+        GNCInteractor_erasePIN (inter);
+        return gnc_verify_dialog (parent,
+                                  TRUE,
+                                  _("The PIN you entered was wrong.\n"
+                                    "Do you want to try again?"));
+    case AB_ERROR_PIN_WRONG_0:
+        GNCInteractor_erasePIN (inter);
+        return gnc_verify_dialog (parent,
+                                  TRUE,
+                                  _("The PIN you entered was wrong.\n"
+                                    "ATTENTION: You have zero further wrong retries left!\n"
+                                    "Do you want to try again?"));
+    case AB_ERROR_CARD_DESTROYED:
+        GNCInteractor_hide (inter);
+        gnc_error_dialog
+        (parent,
+         _("Unfortunately you entered a wrong PIN for too many times. "
+           "Your chip card is therefore destroyed. Aborting."));
+        return FALSE;
+    case AB_ERROR_FILE_NOT_FOUND:
+        /*     g_warning("gnc_hbci_Error_feedback: File not found error.\n"); */
+        return FALSE;
+    case AB_ERROR_NO_CARD:
+        return gnc_verify_dialog (parent,
+                                  TRUE,
+                                  _("No chip card has been found in the chip card reader. "
+                                    "Do you want to try again?"));
+    case AB_ERROR_JOB_NOT_SUPPORTED:
+        GNCInteractor_hide (inter);
+        gnc_error_dialog
+        (parent,
+         _("Unfortunately this Online Banking job is not supported "
+           "by your bank or for your account. Aborting."));
+        return FALSE;
 #endif
-  case AB_ERROR_NETWORK:
-    if (inter) GNCInteractor_hide (inter);
-    gnc_error_dialog 
-      (parent,
-       _("The server of your bank refused the Online Banking connection. "
-	 "Please try again later. Aborting."));
-    return FALSE;
-      
-  default:
-    return FALSE;
-  }
-  
+    case AB_ERROR_NETWORK:
+        if (inter) GNCInteractor_hide (inter);
+        gnc_error_dialog
+        (parent,
+         _("The server of your bank refused the Online Banking connection. "
+           "Please try again later. Aborting."));
+        return FALSE;
+
+    default:
+        return FALSE;
+    }
+
 }
 
 #if 0
@@ -407,194 +436,216 @@
 /* Prints all results that can be found in the outbox into the interactor */
 static void gnc_hbci_printresult(HBCI_Outbox *outbox, GNCInteractor *inter)
 {
-  /* Got no sysid. */
-  GWEN_DB_NODE *rsp, *n;
-  g_assert(outbox);
-  if (!inter) 
-    return;
-  
-  rsp = HBCI_Outbox_response(outbox);
-  n = GWEN_DB_GetFirstGroup(rsp);
-  while(n) {
-    if (strcasecmp(GWEN_DB_GroupName(n), "msgresult")==0) {
-      GWEN_DB_NODE *r = GWEN_DB_GetFirstGroup(n);
-      while (r) {
-	if (strcasecmp(GWEN_DB_GroupName(r), "result") == 0) {
-	  gchar *logtext;
-	  int resultcode;
-	  const char *text, *elementref, *param;
-	  
-	  resultcode = GWEN_DB_GetIntValue(r, "resultcode", 0, 0);
-	  text = GWEN_DB_GetCharValue(r, "text", 0, "Response without text");
-	  elementref = GWEN_DB_GetCharValue(r, "elementref", 0, "");
-	  param = GWEN_DB_GetCharValue(r, "param", 0, "");
+    /* Got no sysid. */
+    GWEN_DB_NODE *rsp, *n;
+    g_assert(outbox);
+    if (!inter)
+        return;
 
-	  if (strlen(elementref)>0 || strlen(param) > 0)
-	    logtext = g_strdup_printf("%s (%d; Elementref %s; Param %s)", text, 
-				      resultcode, elementref, param);
-	  else
-	    logtext = g_strdup_printf("%s (%d)", text, resultcode);
-	  GNCInteractor_add_log_text(inter, logtext);
-	  g_free(logtext);
-	}
-	r = GWEN_DB_GetNextGroup(r);
-      }
-    } 
-    else if (strcasecmp(GWEN_DB_GroupName(n), "segresult")==0) {
-      GWEN_DB_NODE *r = GWEN_DB_GetFirstGroup(n);
-      while (r) {
-	if (strcasecmp(GWEN_DB_GroupName(r), "result") == 0) {
-	}
-	r = GWEN_DB_GetNextGroup(r);
-      }
-    } 
-    n=GWEN_DB_GetNextGroup(n);
-  } /* while */
+    rsp = HBCI_Outbox_response(outbox);
+    n = GWEN_DB_GetFirstGroup(rsp);
+    while (n)
+    {
+        if (strcasecmp(GWEN_DB_GroupName(n), "msgresult") == 0)
+        {
+            GWEN_DB_NODE *r = GWEN_DB_GetFirstGroup(n);
+            while (r)
+            {
+                if (strcasecmp(GWEN_DB_GroupName(r), "result") == 0)
+                {
+                    gchar *logtext;
+                    int resultcode;
+                    const char *text, *elementref, *param;
 
-  GWEN_DB_Group_free(rsp);
+                    resultcode = GWEN_DB_GetIntValue(r, "resultcode", 0, 0);
+                    text = GWEN_DB_GetCharValue(r, "text", 0, "Response without text");
+                    elementref = GWEN_DB_GetCharValue(r, "elementref", 0, "");
+                    param = GWEN_DB_GetCharValue(r, "param", 0, "");
+
+                    if (strlen(elementref) > 0 || strlen(param) > 0)
+                        logtext = g_strdup_printf("%s (%d; Elementref %s; Param %s)", text,
+                                                  resultcode, elementref, param);
+                    else
+                        logtext = g_strdup_printf("%s (%d)", text, resultcode);
+                    GNCInteractor_add_log_text(inter, logtext);
+                    g_free(logtext);
+                }
+                r = GWEN_DB_GetNextGroup(r);
+            }
+        }
+        else if (strcasecmp(GWEN_DB_GroupName(n), "segresult") == 0)
+        {
+            GWEN_DB_NODE *r = GWEN_DB_GetFirstGroup(n);
+            while (r)
+            {
+                if (strcasecmp(GWEN_DB_GroupName(r), "result") == 0)
+                {
+                }
+                r = GWEN_DB_GetNextGroup(r);
+            }
+        }
+        n = GWEN_DB_GetNextGroup(n);
+    } /* while */
+
+    GWEN_DB_Group_free(rsp);
 }
 #endif
 
 /* ------------------------------------------------------- */
 
-static gboolean hbci_Error_isOk(int err) {
-  switch (err) {
-  case 0:
-    return TRUE;
-  default:
-    return FALSE;
-  };
+static gboolean hbci_Error_isOk(int err)
+{
+    switch (err)
+    {
+    case 0:
+        return TRUE;
+    default:
+        return FALSE;
+    };
 }
 
 gboolean
 gnc_AB_BANKING_execute (GtkWidget *parent, AB_BANKING *api,
-			AB_JOB *job, GNCInteractor *inter)
+                        AB_JOB *job, GNCInteractor *inter)
 {
-  int err;
-  int resultcode = 3000; /* This code means: Warnings, but not errors */
-  int be_verbose = FALSE;
-  g_assert (api);
-	  
-  if (inter)
-    GNCInteractor_show (inter);
+    int err;
+    int resultcode = 3000; /* This code means: Warnings, but not errors */
+    int be_verbose = FALSE;
+    g_assert (api);
 
-  if (gnc_gconf_get_bool(GCONF_SECTION, KEY_VERBOSE_DEBUG, NULL)) {
-    GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevelNotice);
-    GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevelInfo);
-    GWEN_Logger_SetLevel("aqhbci", GWEN_LoggerLevelInfo);
-    be_verbose = TRUE;
-  }
-  else {
-    GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevelError);
-    GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevelError);
-    GWEN_Logger_SetLevel("aqhbci", GWEN_LoggerLevelError);
-  }
+    if (inter)
+        GNCInteractor_show (inter);
 
-  do {
-    if (inter) {
-      GNCInteractor_show_nodelete (inter);
-      AB_Banking_SetPinCacheEnabled (api, GNCInteractor_get_cache_valid(inter));
+    if (gnc_gconf_get_bool(GCONF_SECTION, KEY_VERBOSE_DEBUG, NULL))
+    {
+        GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevelNotice);
+        GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevelInfo);
+        GWEN_Logger_SetLevel("aqhbci", GWEN_LoggerLevelInfo);
+        be_verbose = TRUE;
     }
+    else
+    {
+        GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevelError);
+        GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevelError);
+        GWEN_Logger_SetLevel("aqhbci", GWEN_LoggerLevelError);
+    }
 
-    err = AB_Banking_ExecuteQueue (api);
+    do
+    {
+        if (inter)
+        {
+            GNCInteractor_show_nodelete (inter);
+            AB_Banking_SetPinCacheEnabled (api, GNCInteractor_get_cache_valid(inter));
+        }
 
-    /* Print result codes to interactor */
-/*     gnc_hbci_printresult(queue, inter); */
-    
-  } while (gnc_hbci_Error_retry (parent, err, inter));
-  
-  if (job)
-    resultcode = gnc_hbci_debug_outboxjob (inter, job, be_verbose);
-  if (!hbci_Error_isOk(err)) {
-    if (job) gnc_hbci_debug_outboxjob (inter, job, TRUE);
-    if (inter) GNCInteractor_show_nodelete (inter);
-    return FALSE;
-  }
+        err = AB_Banking_ExecuteQueue (api);
 
-  GNCInteractor_set_cache_valid (inter, TRUE);
-  if (resultcode <= 20 && (! GNCInteractor_errorsLogged (inter)) ) {
-    return TRUE;
-  }
-  else {
-    g_message("gnc_AB_BANKING_execute: Some error at executeQueue (see gwen/aqbanking messages above); this does not necessarily mean that the results are unusable.");
-    GNCInteractor_show_nodelete (inter);
-    return TRUE; /* <- This used to be a FALSE but this was probably
+        /* Print result codes to interactor */
+        /*     gnc_hbci_printresult(queue, inter); */
+
+    }
+    while (gnc_hbci_Error_retry (parent, err, inter));
+
+    if (job)
+        resultcode = gnc_hbci_debug_outboxjob (inter, job, be_verbose);
+    if (!hbci_Error_isOk(err))
+    {
+        if (job) gnc_hbci_debug_outboxjob (inter, job, TRUE);
+        if (inter) GNCInteractor_show_nodelete (inter);
+        return FALSE;
+    }
+
+    GNCInteractor_set_cache_valid (inter, TRUE);
+    if (resultcode <= 20 && (! GNCInteractor_errorsLogged (inter)) )
+    {
+        return TRUE;
+    }
+    else
+    {
+        g_message("gnc_AB_BANKING_execute: Some error at executeQueue (see gwen/aqbanking messages above); this does not necessarily mean that the results are unusable.");
+        GNCInteractor_show_nodelete (inter);
+        return TRUE; /* <- This used to be a FALSE but this was probably
 		  * as wrong as it could get. @%$! */
-  }
+    }
 }
 
 static void multijob_cb (gpointer element, gpointer user_data);
 
-gboolean 
-gnc_hbci_multijob_execute(GtkWidget *parent, AB_BANKING *api, 
-			  GList *job_list, GNCInteractor *interactor)
+gboolean
+gnc_hbci_multijob_execute(GtkWidget *parent, AB_BANKING *api,
+                          GList *job_list, GNCInteractor *interactor)
 {
-  gboolean successful;
-  g_assert(api);
+    gboolean successful;
+    g_assert(api);
 
-  successful = gnc_AB_BANKING_execute (parent, api, NULL, interactor);
+    successful = gnc_AB_BANKING_execute (parent, api, NULL, interactor);
 
-  /*printf("dialog-hbcitrans: Ok, result of api_execute was %d.\n", 
-    successful);*/
-	  
-  if (!successful) {
-    /* AB_BANKING_executeOutbox failed. */
-    gnc_error_dialog (GNCInteractor_dialog (interactor),
-		      "%s",
-		      _("Executing the Online Banking outbox failed. Please check the log window."));
-    GNCInteractor_show_nodelete(interactor);
+    /*printf("dialog-hbcitrans: Ok, result of api_execute was %d.\n",
+      successful);*/
 
-    g_list_foreach (job_list, multijob_cb, GNCInteractor_dialog (interactor));
-  }
-  /* Watch out! The job *has* to be removed from the queue
-     here because otherwise it might be executed again. */
-  /* AB_Banking_DequeueJob(api, job); is done in the calling function. */
-  return successful;
+    if (!successful)
+    {
+        /* AB_BANKING_executeOutbox failed. */
+        gnc_error_dialog (GNCInteractor_dialog (interactor),
+                          "%s",
+                          _("Executing the Online Banking outbox failed. Please check the log window."));
+        GNCInteractor_show_nodelete(interactor);
+
+        g_list_foreach (job_list, multijob_cb, GNCInteractor_dialog (interactor));
+    }
+    /* Watch out! The job *has* to be removed from the queue
+       here because otherwise it might be executed again. */
+    /* AB_Banking_DequeueJob(api, job); is done in the calling function. */
+    return successful;
 }
 
 
 void multijob_cb (gpointer element, gpointer user_data)
 {
-  AB_JOB *job = element;
-  GtkWidget *parent = user_data;
+    AB_JOB *job = element;
+    GtkWidget *parent = user_data;
 
-  if ((AB_Job_GetStatus (job) == AB_Job_StatusPending) ||
-      (AB_Job_GetStatus (job) == AB_Job_StatusError)) {
-    /* There was some error in this job. */
-    if (AB_Job_GetType (job) == AB_Job_TypeDebitNote) {
-      const AB_TRANSACTION *h_trans =
-	AB_JobSingleDebitNote_GetTransaction (job);
-      gchar *descr_name = gnc_hbci_descr_tognc (h_trans);
-      gchar *value = 
-	gnc_AB_VALUE_toReadableString (AB_Transaction_GetValue (h_trans));
-      gchar *errortext;
-      errortext =
-	g_strdup_printf(_("A debit note has been refused by the bank. The refused debit note has the following data:\n"
-			  "Remote bank code: \"%s\"\n"
-			  "Remote account number: \"%s\"\n"
-			  "Description and remote name: \"%s\"\n"
-			  "Value: \"%s\"\n"),
-			AB_Transaction_GetRemoteBankCode (h_trans),
-			AB_Transaction_GetRemoteAccountNumber (h_trans),
-			descr_name,
-			value);
-      g_warning ("%s", errortext);
-      gnc_error_dialog (parent, "%s", errortext);
-      g_free (errortext);
-      g_free (descr_name);
-    } else {
-    gnc_error_dialog 
-      (parent, "%s",
-       _("One of the jobs was sent to the bank successfully, but the "
-	 "bank is refusing to execute the job. Please check "
-	 "the log window for the exact error message of the "
-	 "bank. The line with the error message contains a "
-	 "code number that is greater than 9000.\n"
-	 "\n"
-	 "The job has been removed from the queue."));
-    /* FIXME: Might make more useful user feedback here. */
+    if ((AB_Job_GetStatus (job) == AB_Job_StatusPending) ||
+            (AB_Job_GetStatus (job) == AB_Job_StatusError))
+    {
+        /* There was some error in this job. */
+        if (AB_Job_GetType (job) == AB_Job_TypeDebitNote)
+        {
+            const AB_TRANSACTION *h_trans =
+                AB_JobSingleDebitNote_GetTransaction (job);
+            gchar *descr_name = gnc_hbci_descr_tognc (h_trans);
+            gchar *value =
+                gnc_AB_VALUE_toReadableString (AB_Transaction_GetValue (h_trans));
+            gchar *errortext;
+            errortext =
+                g_strdup_printf(_("A debit note has been refused by the bank. The refused debit note has the following data:\n"
+                                  "Remote bank code: \"%s\"\n"
+                                  "Remote account number: \"%s\"\n"
+                                  "Description and remote name: \"%s\"\n"
+                                  "Value: \"%s\"\n"),
+                                AB_Transaction_GetRemoteBankCode (h_trans),
+                                AB_Transaction_GetRemoteAccountNumber (h_trans),
+                                descr_name,
+                                value);
+            g_warning ("%s", errortext);
+            gnc_error_dialog (parent, "%s", errortext);
+            g_free (errortext);
+            g_free (descr_name);
+        }
+        else
+        {
+            gnc_error_dialog
+            (parent, "%s",
+             _("One of the jobs was sent to the bank successfully, but the "
+               "bank is refusing to execute the job. Please check "
+               "the log window for the exact error message of the "
+               "bank. The line with the error message contains a "
+               "code number that is greater than 9000.\n"
+               "\n"
+               "The job has been removed from the queue."));
+            /* FIXME: Might make more useful user feedback here. */
+        }
     }
-  }
 }
 
 
@@ -606,126 +657,135 @@
 static AB_IMEXPORTER_ACCOUNTINFO *
 accountinfolist_cb(AB_IMEXPORTER_ACCOUNTINFO *element, void *user_data);
 
-struct import_data 
+struct import_data
 {
-  Account *gnc_acc;
-  GNCImportMainMatcher *importer_generic;
-  AB_BANKING *ab;
-  AB_ACCOUNT *hbci_account;
-  GList *job_list;
-  gboolean execute_transactions;
+    Account *gnc_acc;
+    GNCImportMainMatcher *importer_generic;
+    AB_BANKING *ab;
+    AB_ACCOUNT *hbci_account;
+    GList *job_list;
+    gboolean execute_transactions;
 };
 
 
 GList *
 gnc_hbci_import_ctx(AB_BANKING *ab, AB_IMEXPORTER_CONTEXT *ctx,
-		    GNCImportMainMatcher *importer_generic_gui,
-		    gboolean exec_as_aqbanking_jobs)
+                    GNCImportMainMatcher *importer_generic_gui,
+                    gboolean exec_as_aqbanking_jobs)
 {
-  struct import_data data;
-  data.importer_generic = importer_generic_gui;
-  data.ab = ab;
-  data.job_list = NULL;
-  data.execute_transactions = exec_as_aqbanking_jobs;
-  
-  /* Iterate through all accounts */
-  AB_ImExporterContext_AccountInfoForEach(ctx, accountinfolist_cb, &data);
-  /* All accounts finished. Finished importing. */
-  return data.job_list;
+    struct import_data data;
+    data.importer_generic = importer_generic_gui;
+    data.ab = ab;
+    data.job_list = NULL;
+    data.execute_transactions = exec_as_aqbanking_jobs;
+
+    /* Iterate through all accounts */
+    AB_ImExporterContext_AccountInfoForEach(ctx, accountinfolist_cb, &data);
+    /* All accounts finished. Finished importing. */
+    return data.job_list;
 }
 
 
 static AB_IMEXPORTER_ACCOUNTINFO *
-accountinfolist_cb(AB_IMEXPORTER_ACCOUNTINFO *accinfo, void *user_data) {
-  Account *gnc_acc;
-  struct import_data *data = user_data;
-  const char *bank_code =
-    AB_ImExporterAccountInfo_GetBankCode(accinfo);
-  const char *account_number = 
-    AB_ImExporterAccountInfo_GetAccountNumber(accinfo);
-  const char *account_name = 
-    AB_ImExporterAccountInfo_GetAccountName(accinfo);
-  gchar *online_id = g_strconcat (bank_code, account_number, NULL);
-  
-  gnc_acc = gnc_import_select_account(NULL, 
-				      online_id, 1, account_name, NULL, 
-				      ACCT_TYPE_NONE, NULL, NULL);
-  g_free(online_id);
-  if (gnc_acc) {
-    /* Store chosen gnucash account in callback data */
-    data->gnc_acc = gnc_acc;
+accountinfolist_cb(AB_IMEXPORTER_ACCOUNTINFO *accinfo, void *user_data)
+{
+    Account *gnc_acc;
+    struct import_data *data = user_data;
+    const char *bank_code =
+        AB_ImExporterAccountInfo_GetBankCode(accinfo);
+    const char *account_number =
+        AB_ImExporterAccountInfo_GetAccountNumber(accinfo);
+    const char *account_name =
+        AB_ImExporterAccountInfo_GetAccountName(accinfo);
+    gchar *online_id = g_strconcat (bank_code, account_number, NULL);
 
-    if (data->execute_transactions) {
-      /* Retrieve the aqbanking account that belongs to this gnucash
-	 account */
-      data->hbci_account = gnc_hbci_get_hbci_acc (data->ab, gnc_acc);
-      if (data->hbci_account == NULL) {
-	gnc_error_dialog (NULL, _("No Online Banking account found for this gnucash account. These transactions will not be executed by Online Banking."));
-      }
+    gnc_acc = gnc_import_select_account(NULL,
+                                        online_id, 1, account_name, NULL,
+                                        ACCT_TYPE_NONE, NULL, NULL);
+    g_free(online_id);
+    if (gnc_acc)
+    {
+        /* Store chosen gnucash account in callback data */
+        data->gnc_acc = gnc_acc;
+
+        if (data->execute_transactions)
+        {
+            /* Retrieve the aqbanking account that belongs to this gnucash
+            	 account */
+            data->hbci_account = gnc_hbci_get_hbci_acc (data->ab, gnc_acc);
+            if (data->hbci_account == NULL)
+            {
+                gnc_error_dialog (NULL, _("No Online Banking account found for this gnucash account. These transactions will not be executed by Online Banking."));
+            }
+        }
+        else
+        {
+            data->hbci_account = NULL;
+        }
+
+        /* Iterate through all transactions.  */
+        AB_ImExporterAccountInfo_TransactionsForEach (accinfo, translist_cb, data);
+        /* all transactions finished. */
     }
-    else {
-      data->hbci_account = NULL;
-    }
-  
-    /* Iterate through all transactions.  */
-    AB_ImExporterAccountInfo_TransactionsForEach (accinfo, translist_cb, data);
-    /* all transactions finished. */
-  }
-  return NULL;
+    return NULL;
 }
 
 static const AB_TRANSACTION *
-translist_cb (const AB_TRANSACTION *element, void *user_data) {
-  AB_JOB *job;
-  AB_TRANSACTION *trans = (AB_TRANSACTION*)element;
-  GtkWidget *parent = NULL;
-  struct import_data *data = user_data;
-  struct trans_list_data hbci_userdata;
+translist_cb (const AB_TRANSACTION *element, void *user_data)
+{
+    AB_JOB *job;
+    AB_TRANSACTION *trans = (AB_TRANSACTION*)element;
+    GtkWidget *parent = NULL;
+    struct import_data *data = user_data;
+    struct trans_list_data hbci_userdata;
 
-  /* This callback in the hbci module will add the imported
-     transaction to gnucash's importer. */
-  hbci_userdata.gnc_acc = data->gnc_acc;
-  hbci_userdata.importer_generic = data->importer_generic;
-  /* The call will use "trans" only as const* */
-  gnc_hbci_trans_list_cb((AB_TRANSACTION*) trans, &hbci_userdata);
+    /* This callback in the hbci module will add the imported
+       transaction to gnucash's importer. */
+    hbci_userdata.gnc_acc = data->gnc_acc;
+    hbci_userdata.importer_generic = data->importer_generic;
+    /* The call will use "trans" only as const* */
+    gnc_hbci_trans_list_cb((AB_TRANSACTION*) trans, &hbci_userdata);
 
-  if (data->hbci_account) {
-    /* NEW: The imported transaction has been imported into
-       gnucash. Now also add it as a job to aqbanking. */
-    AB_Transaction_SetLocalBankCode (trans, 
-				     AB_Account_GetBankCode (data->hbci_account));
-    AB_Transaction_SetLocalAccountNumber (trans, AB_Account_GetAccountNumber (data->hbci_account));
-    AB_Transaction_SetLocalCountry (trans, "DE");
+    if (data->hbci_account)
+    {
+        /* NEW: The imported transaction has been imported into
+           gnucash. Now also add it as a job to aqbanking. */
+        AB_Transaction_SetLocalBankCode (trans,
+                                         AB_Account_GetBankCode (data->hbci_account));
+        AB_Transaction_SetLocalAccountNumber (trans, AB_Account_GetAccountNumber (data->hbci_account));
+        AB_Transaction_SetLocalCountry (trans, "DE");
 
-    job = 
-      gnc_hbci_trans_dialog_enqueue(trans, data->ab,
-				    data->hbci_account, SINGLE_DEBITNOTE);
+        job =
+            gnc_hbci_trans_dialog_enqueue(trans, data->ab,
+                                          data->hbci_account, SINGLE_DEBITNOTE);
 
-    /* Check whether we really got a job */
-    if (!job) {
-      /* Oops, no job, probably not supported by bank. */
-      if (gnc_verify_dialog
-	  (parent, 
-	   FALSE,
-	   "%s",
-	   _("The backend found an error during the preparation "
-	     "of the job. It is not possible to execute this job. \n"
-	     "\n"
-	     "Most probable the bank does not support your chosen "
-	     "job or your Online Banking account does not have the permission "
-	     "to execute this job. More error messages might be "
-	     "visible on your console log.\n"
-	     "\n"
-	     "Do you want to enter the job again?"))) {
-	gnc_error_dialog (parent, "Sorry, not implemented yet.");
-      }
-      /* else
-	 break; */
+        /* Check whether we really got a job */
+        if (!job)
+        {
+            /* Oops, no job, probably not supported by bank. */
+            if (gnc_verify_dialog
+                    (parent,
+                     FALSE,
+                     "%s",
+                     _("The backend found an error during the preparation "
+                       "of the job. It is not possible to execute this job. \n"
+                       "\n"
+                       "Most probable the bank does not support your chosen "
+                       "job or your Online Banking account does not have the permission "
+                       "to execute this job. More error messages might be "
+                       "visible on your console log.\n"
+                       "\n"
+                       "Do you want to enter the job again?")))
+            {
+                gnc_error_dialog (parent, "Sorry, not implemented yet.");
+            }
+            /* else
+            	 break; */
+        }
+        data->job_list = g_list_append(data->job_list, job);
     }
-    data->job_list = g_list_append(data->job_list, job);
-  }
 
-  return NULL;
+    return NULL;
 }
 
 
@@ -736,184 +796,188 @@
 void
 gnc_hbci_clearqueue(AB_BANKING *ab, GList *ab_job_list)
 {
-  g_list_foreach (ab_job_list, delpending_cb, ab);
+    g_list_foreach (ab_job_list, delpending_cb, ab);
 }
 
 void delpending_cb (gpointer element, gpointer user_data)
 {
-  AB_JOB *job = element;
-  AB_BANKING *ab = user_data;
+    AB_JOB *job = element;
+    AB_BANKING *ab = user_data;
 
-  if (AB_Job_GetStatus (job) == AB_Job_StatusPending)
-    AB_Banking_DelPendingJob(ab, job);
+    if (AB_Job_GetStatus (job) == AB_Job_StatusPending)
+        AB_Banking_DelPendingJob(ab, job);
 }
 
 /* ------------------------------------------------------- */
 
-struct cb_struct {
-  gchar **result;
-  GIConv gnc_iconv_handler;
+struct cb_struct
+{
+    gchar **result;
+    GIConv gnc_iconv_handler;
 };
 
 /* Needed for the gnc_hbci_descr_tognc and gnc_hbci_memo_tognc. */
 static void *gnc_list_string_cb (const char *string, void *user_data)
 {
-  struct cb_struct *u = user_data;
-  gchar **res = u->result;
-  gchar *tmp1, *tmp2;
+    struct cb_struct *u = user_data;
+    gchar **res = u->result;
+    gchar *tmp1, *tmp2;
 
-  if (!string) return NULL;
-  tmp1 = gnc_call_iconv(u->gnc_iconv_handler, string);
+    if (!string) return NULL;
+    tmp1 = gnc_call_iconv(u->gnc_iconv_handler, string);
 
-  g_strstrip (tmp1);
-  if (strlen (tmp1) > 0) {
-    /* Ensure string is in utf8 */
-    gnc_utf8_strip_invalid (tmp1);
+    g_strstrip (tmp1);
+    if (strlen (tmp1) > 0)
+    {
+        /* Ensure string is in utf8 */
+        gnc_utf8_strip_invalid (tmp1);
 
-    if (*res != NULL) {
-      /* The " " is the separating string in between each two strings. */
-      tmp2 = g_strjoin (" ", *res, tmp1, NULL);
-      g_free (tmp1);
-      
-      g_free (*res);
-      *res = tmp2;
+        if (*res != NULL)
+        {
+            /* The " " is the separating string in between each two strings. */
+            tmp2 = g_strjoin (" ", *res, tmp1, NULL);
+            g_free (tmp1);
+
+            g_free (*res);
+            *res = tmp2;
+        }
+        else
+        {
+            *res = tmp1;
+        }
     }
-    else {
-      *res = tmp1;
-    }
-  }
-  
-  return NULL;
+
+    return NULL;
 }
 
 
 char *gnc_hbci_descr_tognc (const AB_TRANSACTION *h_trans)
 {
-  /* Description */
-  char *h_descr = gnc_hbci_getpurpose (h_trans);
-  char *othername = gnc_hbci_getremotename (h_trans);
-  char *g_descr;
+    /* Description */
+    char *h_descr = gnc_hbci_getpurpose (h_trans);
+    char *othername = gnc_hbci_getremotename (h_trans);
+    char *g_descr;
 
-  /* Get othername */
-  /*DEBUG("HBCI Description '%s'", h_descr);*/
+    /* Get othername */
+    /*DEBUG("HBCI Description '%s'", h_descr);*/
 
-  if (othername && strlen (othername) > 0)
-    g_descr = 
-      ((strlen (h_descr) > 0) ?
-       g_strdup_printf ("%s; %s", 
-			h_descr,
-			othername) :
-       g_strdup (othername));
-  else
-    g_descr = 
-      ((strlen (h_descr) > 0) ?
-       g_strdup (h_descr) : 
-       g_strdup (_("Unspecified")));
+    if (othername && strlen (othername) > 0)
+        g_descr =
+            ((strlen (h_descr) > 0) ?
+             g_strdup_printf ("%s; %s",
+                              h_descr,
+                              othername) :
+             g_strdup (othername));
+    else
+        g_descr =
+            ((strlen (h_descr) > 0) ?
+             g_strdup (h_descr) :
+             g_strdup (_("Unspecified")));
 
-  g_free (h_descr);
-  if (othername) g_free (othername);
-  return g_descr;
+    g_free (h_descr);
+    if (othername) g_free (othername);
+    return g_descr;
 }
 
 char *gnc_hbci_getremotename (const AB_TRANSACTION *h_trans)
 {
-  /* Description */
-  char *othername = NULL;
-  char *result;
-  const GWEN_STRINGLIST *h_remotename = AB_Transaction_GetRemoteName (h_trans);
-  struct cb_struct cb_object;
+    /* Description */
+    char *othername = NULL;
+    char *result;
+    const GWEN_STRINGLIST *h_remotename = AB_Transaction_GetRemoteName (h_trans);
+    struct cb_struct cb_object;
 
-  cb_object.gnc_iconv_handler = 
-    g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
-  g_assert(cb_object.gnc_iconv_handler != (GIConv)(-1));
+    cb_object.gnc_iconv_handler =
+        g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
+    g_assert(cb_object.gnc_iconv_handler != (GIConv)(-1));
 
-  /* Get othername */
-  cb_object.result = &othername;
-  if (h_remotename)
-    GWEN_StringList_ForEach (h_remotename,
-			     &gnc_list_string_cb,
-			     &cb_object);
-  /*DEBUG("HBCI Description '%s'", h_descr);*/
+    /* Get othername */
+    cb_object.result = &othername;
+    if (h_remotename)
+        GWEN_StringList_ForEach (h_remotename,
+                                 &gnc_list_string_cb,
+                                 &cb_object);
+    /*DEBUG("HBCI Description '%s'", h_descr);*/
 
-  if (othername && (strlen (othername) > 0))
-    result = g_strdup (othername);
-  else
-    result = NULL;
+    if (othername && (strlen (othername) > 0))
+        result = g_strdup (othername);
+    else
+        result = NULL;
 
-  g_iconv_close(cb_object.gnc_iconv_handler);
-  g_free (othername);
-  return result;
+    g_iconv_close(cb_object.gnc_iconv_handler);
+    g_free (othername);
+    return result;
 }
 
 char *gnc_hbci_getpurpose (const AB_TRANSACTION *h_trans)
 {
-  /* Description */
-  char *h_descr = NULL;
-  char *g_descr;
-  const GWEN_STRINGLIST *h_purpose = AB_Transaction_GetPurpose (h_trans);
-  struct cb_struct cb_object;
+    /* Description */
+    char *h_descr = NULL;
+    char *g_descr;
+    const GWEN_STRINGLIST *h_purpose = AB_Transaction_GetPurpose (h_trans);
+    struct cb_struct cb_object;
 
-  cb_object.gnc_iconv_handler = 
-    g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
-  g_assert(cb_object.gnc_iconv_handler != (GIConv)(-1));
+    cb_object.gnc_iconv_handler =
+        g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
+    g_assert(cb_object.gnc_iconv_handler != (GIConv)(-1));
 
-  cb_object.result = &h_descr;
-  if (h_purpose)
-    GWEN_StringList_ForEach (h_purpose,
-			     &gnc_list_string_cb,
-			     &cb_object);
+    cb_object.result = &h_descr;
+    if (h_purpose)
+        GWEN_StringList_ForEach (h_purpose,
+                                 &gnc_list_string_cb,
+                                 &cb_object);
 
-  g_descr = g_strdup (h_descr ? h_descr : "");
+    g_descr = g_strdup (h_descr ? h_descr : "");
 
-  g_iconv_close(cb_object.gnc_iconv_handler);
-  g_free (h_descr);
-  return g_descr;
+    g_iconv_close(cb_object.gnc_iconv_handler);
+    g_free (h_descr);
+    return g_descr;
 }
 
 char *gnc_hbci_memo_tognc (const AB_TRANSACTION *h_trans)
 {
-  /* Memo in the Split. HBCI's transactionText contains strings like
-   * "STANDING ORDER", "UEBERWEISUNGSGUTSCHRIFT", etc.  */
-  /*   char *h_transactionText =  */
-  /*     g_strdup (AB_TRANSACTION_transactionText (h_trans)); */
-  const char *h_remoteAccountNumber = 
-    AB_Transaction_GetRemoteAccountNumber (h_trans);
-  const char *h_remoteBankCode = 
-    AB_Transaction_GetRemoteBankCode (h_trans);
-  char *h_otherAccountId =
-    g_strdup (h_remoteAccountNumber ? h_remoteAccountNumber : _("unknown"));
-  char *h_otherBankCode =
-    g_strdup (h_remoteBankCode ? h_remoteBankCode : _("unknown"));
-  char *g_memo;
+    /* Memo in the Split. HBCI's transactionText contains strings like
+     * "STANDING ORDER", "UEBERWEISUNGSGUTSCHRIFT", etc.  */
+    /*   char *h_transactionText =  */
+    /*     g_strdup (AB_TRANSACTION_transactionText (h_trans)); */
+    const char *h_remoteAccountNumber =
+        AB_Transaction_GetRemoteAccountNumber (h_trans);
+    const char *h_remoteBankCode =
+        AB_Transaction_GetRemoteBankCode (h_trans);
+    char *h_otherAccountId =
+        g_strdup (h_remoteAccountNumber ? h_remoteAccountNumber : _("unknown"));
+    char *h_otherBankCode =
+        g_strdup (h_remoteBankCode ? h_remoteBankCode : _("unknown"));
+    char *g_memo;
 
-  /*   g_strstrip (h_transactionText); */
-  g_strstrip (h_otherAccountId);
-  g_strstrip (h_otherBankCode);
-  /* Ensure string is in utf8 */
-  gnc_utf8_strip_invalid (h_otherAccountId);
-  gnc_utf8_strip_invalid (h_otherBankCode);
+    /*   g_strstrip (h_transactionText); */
+    g_strstrip (h_otherAccountId);
+    g_strstrip (h_otherBankCode);
+    /* Ensure string is in utf8 */
+    gnc_utf8_strip_invalid (h_otherAccountId);
+    gnc_utf8_strip_invalid (h_otherBankCode);
 
-  g_memo = 
-    (h_otherAccountId && (strlen (h_otherAccountId) > 0) ?
-     g_strdup_printf ("%s %s %s %s",
-		      _("Account"), h_otherAccountId,
-		      _("Bank"), h_otherBankCode) :
-     g_strdup (""));
-  gnc_utf8_strip_invalid (g_memo);
-    
-  g_free (h_otherAccountId);
-  g_free (h_otherBankCode);
-  return g_memo;
+    g_memo =
+        (h_otherAccountId && (strlen (h_otherAccountId) > 0) ?
+         g_strdup_printf ("%s %s %s %s",
+                          _("Account"), h_otherAccountId,
+                          _("Bank"), h_otherBankCode) :
+         g_strdup (""));
+    gnc_utf8_strip_invalid (g_memo);
+
+    g_free (h_otherAccountId);
+    g_free (h_otherBankCode);
+    return g_memo;
 }
 
 char *gnc_AB_VALUE_toReadableString(const AB_VALUE *v)
 {
-  char tmp[100];
-  if (v)
-    sprintf(tmp, "%.2f %s", AB_Value_GetValue(v), AB_Value_GetCurrency(v));
-  else
-    sprintf(tmp, "%.2f", 0.0);
-  return g_strdup(tmp);
+    char tmp[100];
+    if (v)
+        sprintf(tmp, "%.2f %s", AB_Value_GetValue(v), AB_Value_GetCurrency(v));
+    else
+        sprintf(tmp, "%.2f", 0.0);
+    return g_strdup(tmp);
 }
 
 /* Note: In the gnome2-branch we don't need the iconv(3) conversion
@@ -927,26 +991,26 @@
    handler */
 gchar *gnc_call_iconv(GIConv handler, const gchar* input)
 {
-  gchar *inbuffer = (gchar*)input;
-  gchar *outbuffer, *outbufferstart;
-  gsize inbytes, outbytes;
+    gchar *inbuffer = (gchar*)input;
+    gchar *outbuffer, *outbufferstart;
+    gsize inbytes, outbytes;
 
-  inbytes = strlen(inbuffer);
-  outbytes = inbytes + 2;
-  outbufferstart = g_strndup(inbuffer, outbytes);
-  outbuffer = outbufferstart;
-  g_iconv(handler, &inbuffer, &inbytes, &outbuffer, &outbytes);
-  if (outbytes > 0) 
-    *outbuffer = '\0';
-  return outbufferstart;
+    inbytes = strlen(inbuffer);
+    outbytes = inbytes + 2;
+    outbufferstart = g_strndup(inbuffer, outbytes);
+    outbuffer = outbufferstart;
+    g_iconv(handler, &inbuffer, &inbytes, &outbuffer, &outbytes);
+    if (outbytes > 0)
+        *outbuffer = '\0';
+    return outbufferstart;
 }
 
 const char *gnc_hbci_book_encoding()
 {
-  return "UTF-8";
+    return "UTF-8";
 }
 
 const char *gnc_hbci_AQBANKING_encoding()
 {
-  return "UTF-8";
+    return "UTF-8";
 }

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -54,14 +54,14 @@
 
 
 /** Create a new AB_BANKING and let it load its environment from its
- * default configuration. 
+ * default configuration.
  *
  * @param parent When displaying dialogs, use this GtkWidget as parent.
- * @param inter Reference to a GNCInteractor-pointer in order to use this later. 
+ * @param inter Reference to a GNCInteractor-pointer in order to use this later.
  * May be NULL.
- */ 
+ */
 AB_BANKING * gnc_AB_BANKING_new_currentbook (GtkWidget *parent,
-					     GNCInteractor **inter);
+        GNCInteractor **inter);
 
 /** Delete the given AB_BANKING. If this is also the one that was cached
     by gnc_AB_BANKING_new_currentbook, then that reference is deleted, too. */
@@ -95,8 +95,8 @@
  * other hand, returns false if the user can't do anything about this
  * error right now. */
 gboolean
-gnc_hbci_Error_retry (GtkWidget *parent, int error, 
-		      GNCInteractor *inter);
+gnc_hbci_Error_retry (GtkWidget *parent, int error,
+                      GNCInteractor *inter);
 
 /* Calls AB_BANKING_executeQueue with some supplementary stuff around
  * it: set the debugLevel, show the GNCInteractor, and do some error
@@ -106,7 +106,7 @@
  * must not be NULL.  */
 gboolean
 gnc_AB_BANKING_execute (GtkWidget *parent, AB_BANKING *api,
-			AB_JOB *job, GNCInteractor *inter);
+                        AB_JOB *job, GNCInteractor *inter);
 
 /* Calls AB_Banking_executeQueue() with some supplementary stuff
  * around it: set the debugLevel, show the GNCInteractor, and do some
@@ -115,14 +115,14 @@
  * should abort. parent may be NULL, job_list (a GList of AB_JOBs) may
  * be NULL (although in this case no HBCI result codes can be
  * checked!), inter may be NULL; api must not be NULL.  */
-gboolean 
-gnc_hbci_multijob_execute(GtkWidget *parent, AB_BANKING *api, 
-			  GList *job_list, GNCInteractor *inter);
+gboolean
+gnc_hbci_multijob_execute(GtkWidget *parent, AB_BANKING *api,
+                          GList *job_list, GNCInteractor *inter);
 
 /**
  * Imports the account/transaction/balance data of an aqbanking
  * "imexporter-context" into the matching gnucash accounts, using the
- * given importer_generic_gui. 
+ * given importer_generic_gui.
  *
  * If exec_as_jobs is TRUE, additionally queue each transaction as a
  * new aqbanking online banking job.
@@ -144,8 +144,8 @@
  */
 GList *
 gnc_hbci_import_ctx(AB_BANKING *ab, AB_IMEXPORTER_CONTEXT *ctx,
-		    GNCImportMainMatcher *importer_generic_gui,
-		    gboolean exec_as_aqbanking_jobs);
+                    GNCImportMainMatcher *importer_generic_gui,
+                    gboolean exec_as_aqbanking_jobs);
 
 /** Clear all the AB_JOBs of the ab_job_list from aqbanking's
  * queue. */
@@ -183,30 +183,30 @@
  * bankName is available. */
 /* const char *bank_to_str (const HBCI_Bank *bank); */
 
-/** Chooses one bank out of the given list. 
+/** Chooses one bank out of the given list.
  *
  * If the list has more than one bank, this displays a multichoice
  * dialog so that the user can choose one bank. If the list has only
  * one bank, it returns it. If the list has zero banks, it returns
- * NULL. */ 
+ * NULL. */
 /* const HBCI_Bank * */
 /* choose_one_bank (gncUIWidget parent, const list_HBCI_Bank *banklist); */
 
-/** Chooses one customer out of the given list. 
+/** Chooses one customer out of the given list.
  *
  * If the list has more than one customer, this displays a multichoice
  * dialog so that the user can choose one customer. If the list has only
  * one customer, it returns it. If the list has zero customers, it returns
- * NULL. */ 
+ * NULL. */
 /* const HBCI_Customer * */
 /* choose_one_customer (gncUIWidget parent, const list_HBCI_Customer *custlist); */
 
-/** Chooses one user out of the given list. 
+/** Chooses one user out of the given list.
  *
  * If the list has more than one user, this displays a multichoice
  * dialog so that the user can choose one user. If the list has only
  * one user, it returns it. If the list has zero users, it returns
- * NULL. */ 
+ * NULL. */
 /* const HBCI_User * */
 /* choose_one_user (gncUIWidget parent, const list_HBCI_User *userlist); */
 

Modified: gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-hbci.c -- 
+/*
+ * gnc-plugin-hbci.c --
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
  * Copyright (C) 2002 Christian Stimming                            *
  *
@@ -51,20 +51,20 @@
 static void gnc_plugin_hbci_finalize (GObject *object);
 
 static void gnc_plugin_hbci_add_to_window (GncPlugin *plugin,
-					   GncMainWindow *window,
-					   GQuark type);
+        GncMainWindow *window,
+        GQuark type);
 static void gnc_plugin_hbci_remove_from_window (GncPlugin *plugin,
-						GncMainWindow *window,
-						GQuark type);
+        GncMainWindow *window,
+        GQuark type);
 
 /* Callbacks on other objects */
 static void gnc_plugin_hbci_main_window_page_added   (GncMainWindow *window,
-						      GncPluginPage *page);
+        GncPluginPage *page);
 static void gnc_plugin_hbci_main_window_page_changed (GncMainWindow *window,
-						      GncPluginPage *page);
+        GncPluginPage *page);
 static void gnc_plugin_hbci_account_selected         (GncPluginPage *plugin_page,
-						      Account *account,
-						      gpointer user_data);
+        Account *account,
+        gpointer user_data);
 
 /* Command callbacks */
 static void gnc_plugin_hbci_cmd_setup (GtkAction *action, GncMainWindowActionData *data);
@@ -84,87 +84,115 @@
 #define PLUGIN_ACTIONS_NAME "gnc-plugin-hbci-actions"
 #define PLUGIN_UI_FILENAME  "gnc-plugin-hbci-ui.xml"
 
-static GtkActionEntry gnc_plugin_actions [] = {
-  /* Menus */
-  { "OnlineActionsAction", NULL, N_("_Online Actions"), NULL, NULL, NULL },
+static GtkActionEntry gnc_plugin_actions [] =
+{
+    /* Menus */
+    { "OnlineActionsAction", NULL, N_("_Online Actions"), NULL, NULL, NULL },
 
-  /* Menu Items */
-  { "HbciSetupAction", NULL, N_("_Online Banking Setup..."), NULL,
-    N_("Initial setup of Online Banking access (HBCI, or OFX DirectConnect, using AqBanking)"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_setup) },
-  { "HbciGetBalanceAction", NULL, N_("Get _Balance"), NULL,
-    N_("Get the account balance online through Online Banking"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_get_balance) },
-  { "HbciGetTransAction", NULL, N_("Get _Transactions..."), NULL,
-    N_("Get the transactions online through Online Banking"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_get_transactions) },
-  { "HbciIssueTransAction", NULL, N_("_Issue Transaction..."), NULL,
-    N_("Issue a new transaction online through Online Banking"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_issue_transaction) },
-  { "HbciIssueIntTransAction", NULL, N_("I_nternal Transaction..."), NULL,
-    N_("Issue a new bank-internal transaction online through Online Banking"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_issue_inttransaction) },
-  { "HbciIssueDirectDebitAction", NULL, N_("_Direct Debit..."), NULL,
-    N_("Issue a new direct debit note online through Online Banking"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_issue_direct_debit) },
+    /* Menu Items */
+    {
+        "HbciSetupAction", NULL, N_("_Online Banking Setup..."), NULL,
+        N_("Initial setup of Online Banking access (HBCI, or OFX DirectConnect, using AqBanking)"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_setup)
+    },
+    {
+        "HbciGetBalanceAction", NULL, N_("Get _Balance"), NULL,
+        N_("Get the account balance online through Online Banking"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_get_balance)
+    },
+    {
+        "HbciGetTransAction", NULL, N_("Get _Transactions..."), NULL,
+        N_("Get the transactions online through Online Banking"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_get_transactions)
+    },
+    {
+        "HbciIssueTransAction", NULL, N_("_Issue Transaction..."), NULL,
+        N_("Issue a new transaction online through Online Banking"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_issue_transaction)
+    },
+    {
+        "HbciIssueIntTransAction", NULL, N_("I_nternal Transaction..."), NULL,
+        N_("Issue a new bank-internal transaction online through Online Banking"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_issue_inttransaction)
+    },
+    {
+        "HbciIssueDirectDebitAction", NULL, N_("_Direct Debit..."), NULL,
+        N_("Issue a new direct debit note online through Online Banking"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_issue_direct_debit)
+    },
 
-  /* File -> Import menu item */
-  { "Mt940ImportAction", GTK_STOCK_CONVERT, N_("Import _MT940"), NULL,
-    N_("Import a MT940 file into GnuCash"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_mt940_import) },
-  { "Mt942ImportAction", GTK_STOCK_CONVERT, N_("Import MT94_2"), NULL,
-    N_("Import a MT942 file into GnuCash"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_mt942_import) },
-  { "DtausImportAction", GTK_STOCK_CONVERT, N_("Import _DTAUS"), NULL,
-    N_("Import a DTAUS file into GnuCash"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_dtaus_import) },
+    /* File -> Import menu item */
+    {
+        "Mt940ImportAction", GTK_STOCK_CONVERT, N_("Import _MT940"), NULL,
+        N_("Import a MT940 file into GnuCash"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_mt940_import)
+    },
+    {
+        "Mt942ImportAction", GTK_STOCK_CONVERT, N_("Import MT94_2"), NULL,
+        N_("Import a MT942 file into GnuCash"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_mt942_import)
+    },
+    {
+        "DtausImportAction", GTK_STOCK_CONVERT, N_("Import _DTAUS"), NULL,
+        N_("Import a DTAUS file into GnuCash"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_dtaus_import)
+    },
 #ifdef CSV_IMPORT_FUNCTIONAL
-  { "CsvImportAction", GTK_STOCK_CONVERT, N_("Import _CSV"), NULL,
-    N_("Import a CSV file into GnuCash"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_csv_import) },
-  { "CsvImportSendAction", GTK_STOCK_CONVERT, N_("Import CSV and s_end..."), NULL,
-    N_("Import a CSV file into GnuCash and send the transfers online through Online Banking"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_csv_importsend) },
+    {
+        "CsvImportAction", GTK_STOCK_CONVERT, N_("Import _CSV"), NULL,
+        N_("Import a CSV file into GnuCash"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_csv_import)
+    },
+    {
+        "CsvImportSendAction", GTK_STOCK_CONVERT, N_("Import CSV and s_end..."), NULL,
+        N_("Import a CSV file into GnuCash and send the transfers online through Online Banking"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_csv_importsend)
+    },
 #endif
-  { "DtausImportSendAction", GTK_STOCK_CONVERT, N_("Import DTAUS and _send..."), NULL,
-    N_("Import a DTAUS file into GnuCash and send the transfers online through Online Banking"),
-    G_CALLBACK (gnc_plugin_hbci_cmd_dtaus_importsend) },
+    {
+        "DtausImportSendAction", GTK_STOCK_CONVERT, N_("Import DTAUS and _send..."), NULL,
+        N_("Import a DTAUS file into GnuCash and send the transfers online through Online Banking"),
+        G_CALLBACK (gnc_plugin_hbci_cmd_dtaus_importsend)
+    },
 
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
 
-static const gchar *account_tree_actions[] = {
-  "HbciSetupAction",
-  "HbciGetBalanceAction",
-  "HbciGetTransAction",
-  "HbciIssueTransAction",
-  "HbciIssueIntTransAction",
-  "HbciIssueDirectDebitAction",
-  NULL
+static const gchar *account_tree_actions[] =
+{
+    "HbciSetupAction",
+    "HbciGetBalanceAction",
+    "HbciGetTransAction",
+    "HbciIssueTransAction",
+    "HbciIssueIntTransAction",
+    "HbciIssueDirectDebitAction",
+    NULL
 };
 
-static const gchar *register_actions[] = {
-  "HbciSetupAction",
-  "HbciGetBalanceAction",
-  "HbciGetTransAction",
-  "HbciIssueTransAction",
-  "HbciIssueIntTransAction",
-  "HbciIssueDirectDebitAction",
-  NULL
+static const gchar *register_actions[] =
+{
+    "HbciSetupAction",
+    "HbciGetBalanceAction",
+    "HbciGetTransAction",
+    "HbciIssueTransAction",
+    "HbciIssueIntTransAction",
+    "HbciIssueDirectDebitAction",
+    NULL
 };
 
-static const gchar *need_account_actions[] = {
-  "HbciGetBalanceAction",
-  "HbciGetTransAction",
-  "HbciIssueTransAction",
-  "HbciIssueIntTransAction",
-  "HbciIssueDirectDebitAction",
-  NULL
+static const gchar *need_account_actions[] =
+{
+    "HbciGetBalanceAction",
+    "HbciGetTransAction",
+    "HbciIssueTransAction",
+    "HbciIssueIntTransAction",
+    "HbciIssueDirectDebitAction",
+    NULL
 };
 
 typedef struct GncPluginHbciPrivate
 {
-  gpointer dummy;
+    gpointer dummy;
 } GncPluginHbciPrivate;
 
 #define GNC_PLUGIN_HBCI_GET_PRIVATE(o)  \
@@ -179,57 +207,59 @@
 GType
 gnc_plugin_hbci_get_type (void)
 {
-  static GType gnc_plugin_hbci_type = 0;
+    static GType gnc_plugin_hbci_type = 0;
 
-  if (gnc_plugin_hbci_type == 0) {
-    static const GTypeInfo our_info = {
-      sizeof (GncPluginHbciClass),
-		NULL,		/* base_init */
-		NULL,		/* base_finalize */
-		(GClassInitFunc) gnc_plugin_hbci_class_init,
-		NULL,		/* class_finalize */
-		NULL,		/* class_data */
-		sizeof (GncPluginHbci),
-		0,		/* n_preallocs */
-		(GInstanceInitFunc) gnc_plugin_hbci_init,
-    };
+    if (gnc_plugin_hbci_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginHbciClass),
+            NULL,		/* base_init */
+            NULL,		/* base_finalize */
+            (GClassInitFunc) gnc_plugin_hbci_class_init,
+            NULL,		/* class_finalize */
+            NULL,		/* class_data */
+            sizeof (GncPluginHbci),
+            0,		/* n_preallocs */
+            (GInstanceInitFunc) gnc_plugin_hbci_init,
+        };
 
-    gnc_plugin_hbci_type = g_type_register_static (GNC_TYPE_PLUGIN,
-						   "GncPluginHbci",
-						   &our_info, 0);
-  }
+        gnc_plugin_hbci_type = g_type_register_static (GNC_TYPE_PLUGIN,
+                               "GncPluginHbci",
+                               &our_info, 0);
+    }
 
-  return gnc_plugin_hbci_type;
+    return gnc_plugin_hbci_type;
 }
 
 GncPlugin *
 gnc_plugin_hbci_new (void)
 {
-  return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_HBCI, NULL));
+    return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_HBCI, NULL));
 }
 
 static void
 gnc_plugin_hbci_class_init (GncPluginHbciClass *klass)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
 
-  parent_class = g_type_class_peek_parent (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-  object_class->finalize = gnc_plugin_hbci_finalize;
+    object_class->finalize = gnc_plugin_hbci_finalize;
 
-  /* plugin info */
-  plugin_class->plugin_name  = GNC_PLUGIN_HBCI_NAME;
+    /* plugin info */
+    plugin_class->plugin_name  = GNC_PLUGIN_HBCI_NAME;
 
-  /* widget addition/removal */
-  plugin_class->actions_name  	   = PLUGIN_ACTIONS_NAME;
-  plugin_class->actions       	   = gnc_plugin_actions;
-  plugin_class->n_actions     	   = gnc_plugin_n_actions;
-  plugin_class->ui_filename   	   = PLUGIN_UI_FILENAME;
-  plugin_class->add_to_window 	   = gnc_plugin_hbci_add_to_window;
-  plugin_class->remove_from_window = gnc_plugin_hbci_remove_from_window;
+    /* widget addition/removal */
+    plugin_class->actions_name  	   = PLUGIN_ACTIONS_NAME;
+    plugin_class->actions       	   = gnc_plugin_actions;
+    plugin_class->n_actions     	   = gnc_plugin_n_actions;
+    plugin_class->ui_filename   	   = PLUGIN_UI_FILENAME;
+    plugin_class->add_to_window 	   = gnc_plugin_hbci_add_to_window;
+    plugin_class->remove_from_window = gnc_plugin_hbci_remove_from_window;
 
-  g_type_class_add_private(klass, sizeof(GncPluginHbciPrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginHbciPrivate));
 }
 
 static void
@@ -240,15 +270,15 @@
 static void
 gnc_plugin_hbci_finalize (GObject *object)
 {
-  GncPluginHbci *plugin;
-  GncPluginHbciPrivate *priv;
+    GncPluginHbci *plugin;
+    GncPluginHbciPrivate *priv;
 
-  g_return_if_fail (GNC_IS_PLUGIN_HBCI (object));
+    g_return_if_fail (GNC_IS_PLUGIN_HBCI (object));
 
-  plugin = GNC_PLUGIN_HBCI (object);
-  priv = GNC_PLUGIN_HBCI_GET_PRIVATE(plugin);
+    plugin = GNC_PLUGIN_HBCI (object);
+    priv = GNC_PLUGIN_HBCI_GET_PRIVATE(plugin);
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 /*
@@ -259,28 +289,28 @@
  */
 static void
 gnc_plugin_hbci_add_to_window (GncPlugin *plugin,
-			       GncMainWindow *window,
-			       GQuark type)
+                               GncMainWindow *window,
+                               GQuark type)
 {
-  g_signal_connect (G_OBJECT(window), "page_added",
-		    G_CALLBACK (gnc_plugin_hbci_main_window_page_added),
-		    plugin);
-  g_signal_connect (G_OBJECT(window), "page_changed",
-		    G_CALLBACK (gnc_plugin_hbci_main_window_page_changed),
-		    plugin);
+    g_signal_connect (G_OBJECT(window), "page_added",
+                      G_CALLBACK (gnc_plugin_hbci_main_window_page_added),
+                      plugin);
+    g_signal_connect (G_OBJECT(window), "page_changed",
+                      G_CALLBACK (gnc_plugin_hbci_main_window_page_changed),
+                      plugin);
 }
 
 static void
 gnc_plugin_hbci_remove_from_window (GncPlugin *plugin,
-				    GncMainWindow *window,
-				    GQuark type)
+                                    GncMainWindow *window,
+                                    GQuark type)
 {
-  g_signal_handlers_disconnect_by_func(G_OBJECT(window),
-				       G_CALLBACK (gnc_plugin_hbci_main_window_page_changed),
-				       plugin);
-  g_signal_handlers_disconnect_by_func(G_OBJECT(window),
-				       G_CALLBACK (gnc_plugin_hbci_main_window_page_added),
-				       plugin);
+    g_signal_handlers_disconnect_by_func(G_OBJECT(window),
+                                         G_CALLBACK (gnc_plugin_hbci_main_window_page_changed),
+                                         plugin);
+    g_signal_handlers_disconnect_by_func(G_OBJECT(window),
+                                         G_CALLBACK (gnc_plugin_hbci_main_window_page_added),
+                                         plugin);
 }
 
 /************************************************************
@@ -301,43 +331,51 @@
 static Account *
 main_window_to_account (GncMainWindow *window)
 {
-  GncPluginPage  *page;
-  const gchar    *page_name;
-  Account        *account = NULL;
-  const gchar    *account_name;
+    GncPluginPage  *page;
+    const gchar    *page_name;
+    Account        *account = NULL;
+    const gchar    *account_name;
 
-  ENTER("main window %p", window);
-  if (!GNC_IS_MAIN_WINDOW(window)) {
-    LEAVE("no main_window");
-    return NULL;
-  }
+    ENTER("main window %p", window);
+    if (!GNC_IS_MAIN_WINDOW(window))
+    {
+        LEAVE("no main_window");
+        return NULL;
+    }
 
-  /* Ensure we are called from a register page. */
-  page = gnc_main_window_get_current_page(window);
-  if (!GNC_IS_PLUGIN_PAGE(page)) {
-    LEAVE("no plugin_page");
-    return NULL;
-  }
-  page_name = gnc_plugin_page_get_plugin_name(page);
-  if (!page_name) {
-    LEAVE("no page_name of plugin_page");
-    return NULL;
-  }
+    /* Ensure we are called from a register page. */
+    page = gnc_main_window_get_current_page(window);
+    if (!GNC_IS_PLUGIN_PAGE(page))
+    {
+        LEAVE("no plugin_page");
+        return NULL;
+    }
+    page_name = gnc_plugin_page_get_plugin_name(page);
+    if (!page_name)
+    {
+        LEAVE("no page_name of plugin_page");
+        return NULL;
+    }
 
-  if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER_NAME) == 0) {
-    DEBUG("register page");
-    account =
-      gnc_plugin_page_register_get_account (GNC_PLUGIN_PAGE_REGISTER(page));
-  } else if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0) {
-    DEBUG("account tree page");
-    account =
-      gnc_plugin_page_account_tree_get_current_account (GNC_PLUGIN_PAGE_ACCOUNT_TREE(page));
-  } else {
-    account = NULL;
-  }
-  account_name = account ? xaccAccountGetName(account) : NULL;
-  LEAVE("account %s(%p)", account_name ? account_name : "(null)", account);
-  return account;
+    if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER_NAME) == 0)
+    {
+        DEBUG("register page");
+        account =
+            gnc_plugin_page_register_get_account (GNC_PLUGIN_PAGE_REGISTER(page));
+    }
+    else if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
+    {
+        DEBUG("account tree page");
+        account =
+            gnc_plugin_page_account_tree_get_current_account (GNC_PLUGIN_PAGE_ACCOUNT_TREE(page));
+    }
+    else
+    {
+        account = NULL;
+    }
+    account_name = account ? xaccAccountGetName(account) : NULL;
+    LEAVE("account %s(%p)", account_name ? account_name : "(null)", account);
+    return account;
 }
 
 /************************************************************
@@ -348,108 +386,118 @@
  *  Update the hbci mennus appropriately. */
 static void
 gnc_plugin_hbci_account_selected (GncPluginPage *plugin_page,
-				  Account *account,
-				  gpointer user_data)
+                                  Account *account,
+                                  gpointer user_data)
 {
-  GtkActionGroup *action_group;
-  GncMainWindow  *window;
+    GtkActionGroup *action_group;
+    GncMainWindow  *window;
 
-  g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
-  window = GNC_MAIN_WINDOW(plugin_page->window);
-  g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
-  action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
-  g_return_if_fail (GTK_IS_ACTION_GROUP (action_group));
-  gnc_plugin_update_actions(action_group, need_account_actions,
-			    "sensitive", account != NULL);
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
+    window = GNC_MAIN_WINDOW(plugin_page->window);
+    g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+    action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
+    g_return_if_fail (GTK_IS_ACTION_GROUP (action_group));
+    gnc_plugin_update_actions(action_group, need_account_actions,
+                              "sensitive", account != NULL);
 }
 
 /** A new page has been added to a main window.  Connect a signal to
  *  it so that hbci can track when accounts are selected. */
 static void
 gnc_plugin_hbci_main_window_page_added (GncMainWindow *window,
-					GncPluginPage *page)
+                                        GncPluginPage *page)
 {
-  const gchar    *page_name;
+    const gchar    *page_name;
 
-  ENTER("main window %p, page %p", window, page);
-  if (!GNC_IS_PLUGIN_PAGE(page)) { 
-    LEAVE("no plugin_page");
-    return;
-  }
+    ENTER("main window %p, page %p", window, page);
+    if (!GNC_IS_PLUGIN_PAGE(page))
+    {
+        LEAVE("no plugin_page");
+        return;
+    }
 
-  page_name = gnc_plugin_page_get_plugin_name(page);
-  if (!page_name) {
-    LEAVE("no page_name of plugin_page");
-    return;
-  }
+    page_name = gnc_plugin_page_get_plugin_name(page);
+    if (!page_name)
+    {
+        LEAVE("no page_name of plugin_page");
+        return;
+    }
 
-  if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0) {
-    DEBUG("account tree page, adding signal");
-    g_signal_connect (G_OBJECT(page),
-		      "account_selected",
-		      G_CALLBACK (gnc_plugin_hbci_account_selected),
-		      NULL);
+    if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
+    {
+        DEBUG("account tree page, adding signal");
+        g_signal_connect (G_OBJECT(page),
+                          "account_selected",
+                          G_CALLBACK (gnc_plugin_hbci_account_selected),
+                          NULL);
 
-  }
-  LEAVE(" ");
+    }
+    LEAVE(" ");
 }
 
 /** Whenever the current page has changed, update the hbci menus based
  *  upon the page that is currently selected. */
 static void
 gnc_plugin_hbci_main_window_page_changed (GncMainWindow *window,
-					  GncPluginPage *page)
+        GncPluginPage *page)
 {
-  GtkActionGroup *action_group;
-  const gchar    *page_name;
-  Account        *account;
+    GtkActionGroup *action_group;
+    const gchar    *page_name;
+    Account        *account;
 
-  ENTER("main window %p, page %p", window, page);
-  if (!GNC_IS_MAIN_WINDOW (window)) {
-    LEAVE("no main_window");
-    return;
-  }
+    ENTER("main window %p, page %p", window, page);
+    if (!GNC_IS_MAIN_WINDOW (window))
+    {
+        LEAVE("no main_window");
+        return;
+    }
 
-  action_group = gnc_main_window_get_action_group(window,PLUGIN_ACTIONS_NAME);
-  if (!GTK_IS_ACTION_GROUP (action_group)) {
-    LEAVE("no action_group");
-    return;
-  }
+    action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
+    if (!GTK_IS_ACTION_GROUP (action_group))
+    {
+        LEAVE("no action_group");
+        return;
+    }
 
-  /* Reset everything to known state */
-  gnc_plugin_update_actions(action_group, need_account_actions,
-			    "sensitive", FALSE);
-  gnc_plugin_update_actions(action_group, account_tree_actions,
-			    "visible", FALSE);
-  gnc_plugin_update_actions(action_group, register_actions,
-			    "visible", FALSE);
-
-  /* Any page selected? */
-  if (page == NULL) {
-    LEAVE("no page");
-    return;
-  }
-
-  /* Selectively make items visible */
-  page_name = gnc_plugin_page_get_plugin_name(page);
-  g_return_if_fail (page_name);
-  if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0) {
-    DEBUG("account tree page");
+    /* Reset everything to known state */
+    gnc_plugin_update_actions(action_group, need_account_actions,
+                              "sensitive", FALSE);
     gnc_plugin_update_actions(action_group, account_tree_actions,
-			      "visible", TRUE);
-  } else if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER_NAME) == 0) {
-    DEBUG("register page");
+                              "visible", FALSE);
     gnc_plugin_update_actions(action_group, register_actions,
-			      "visible", TRUE);
-  }
+                              "visible", FALSE);
 
-  /* Only make items sensitive if an account can be determined */
-  account = main_window_to_account (window);
-  if (account) {
-    gnc_plugin_update_actions(action_group, need_account_actions,
-			      "sensitive", TRUE);
-  }
-  LEAVE(" ");
+    /* Any page selected? */
+    if (page == NULL)
+    {
+        LEAVE("no page");
+        return;
+    }
+
+    /* Selectively make items visible */
+    page_name = gnc_plugin_page_get_plugin_name(page);
+    g_return_if_fail (page_name);
+    if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
+    {
+        DEBUG("account tree page");
+        gnc_plugin_update_actions(action_group, account_tree_actions,
+                                  "visible", TRUE);
+    }
+    else if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER_NAME) == 0)
+    {
+        DEBUG("register page");
+        gnc_plugin_update_actions(action_group, register_actions,
+                                  "visible", TRUE);
+    }
+
+    /* Only make items sensitive if an account can be determined */
+    account = main_window_to_account (window);
+    if (account)
+    {
+        gnc_plugin_update_actions(action_group, need_account_actions,
+                                  "sensitive", TRUE);
+    }
+    LEAVE(" ");
 }
 /************************************************************
  *                    Command Callbacks                     *
@@ -457,145 +505,150 @@
 
 static void
 gnc_plugin_hbci_cmd_setup (GtkAction *action,
-			   GncMainWindowActionData *data)
+                           GncMainWindowActionData *data)
 {
-  ENTER("action %p, main window data %p", action, data);
-  gnc_hbci_initial_druid ();
-  LEAVE(" ");
+    ENTER("action %p, main window data %p", action, data);
+    gnc_hbci_initial_druid ();
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_hbci_cmd_get_balance (GtkAction *action,
-				 GncMainWindowActionData *data)
+                                 GncMainWindowActionData *data)
 {
-  Account *account;
+    Account *account;
 
-  ENTER("action %p, main window data %p", action, data);
-  account = main_window_to_account(data->window);
-  if (account == NULL) {
-    LEAVE("no account");
-    return;
-  }
+    ENTER("action %p, main window data %p", action, data);
+    account = main_window_to_account(data->window);
+    if (account == NULL)
+    {
+        LEAVE("no account");
+        return;
+    }
 
-  gnc_hbci_getbalance(GTK_WIDGET(data->window), account);
-  LEAVE(" ");
+    gnc_hbci_getbalance(GTK_WIDGET(data->window), account);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_hbci_cmd_get_transactions (GtkAction *action,
-				      GncMainWindowActionData *data)
+                                      GncMainWindowActionData *data)
 {
-  Account *account;
+    Account *account;
 
-  ENTER("action %p, main window data %p", action, data);
-  account = main_window_to_account(data->window);
-  if (account == NULL) {
-    LEAVE("no account");
-    return;
-  }
+    ENTER("action %p, main window data %p", action, data);
+    account = main_window_to_account(data->window);
+    if (account == NULL)
+    {
+        LEAVE("no account");
+        return;
+    }
 
-  gnc_hbci_gettrans(GTK_WIDGET(data->window), account);
-  LEAVE(" ");
+    gnc_hbci_gettrans(GTK_WIDGET(data->window), account);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_hbci_cmd_issue_transaction (GtkAction *action,
-					GncMainWindowActionData *data)
+                                       GncMainWindowActionData *data)
 {
-  Account *account;
+    Account *account;
 
-  ENTER("action %p, main window data %p", action, data);
-  account = main_window_to_account(data->window);
-  if (account == NULL) {
-    LEAVE("no account");
-    return;
-  }
+    ENTER("action %p, main window data %p", action, data);
+    account = main_window_to_account(data->window);
+    if (account == NULL)
+    {
+        LEAVE("no account");
+        return;
+    }
 
-  gnc_hbci_maketrans(GTK_WIDGET(data->window), account, SINGLE_TRANSFER);
-  LEAVE(" ");
+    gnc_hbci_maketrans(GTK_WIDGET(data->window), account, SINGLE_TRANSFER);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_hbci_cmd_issue_inttransaction (GtkAction *action,
-					GncMainWindowActionData *data)
+        GncMainWindowActionData *data)
 {
-  Account *account;
+    Account *account;
 
-  ENTER("action %p, main window data %p", action, data);
-  account = main_window_to_account(data->window);
-  if (account == NULL) {
-    LEAVE("no account");
-    return;
-  }
+    ENTER("action %p, main window data %p", action, data);
+    account = main_window_to_account(data->window);
+    if (account == NULL)
+    {
+        LEAVE("no account");
+        return;
+    }
 
-  gnc_hbci_maketrans(GTK_WIDGET(data->window), account, SINGLE_INTERNAL_TRANSFER);
-  LEAVE(" ");
+    gnc_hbci_maketrans(GTK_WIDGET(data->window), account, SINGLE_INTERNAL_TRANSFER);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_hbci_cmd_issue_direct_debit (GtkAction *action,
-					GncMainWindowActionData *data)
+                                        GncMainWindowActionData *data)
 {
-  Account *account;
+    Account *account;
 
-  ENTER("action %p, main window data %p", action, data);
-  account = main_window_to_account(data->window);
-  if (account == NULL) {
-    LEAVE("no account");
-    return;
-  }
-  gnc_hbci_maketrans (GTK_WIDGET(data->window), account, SINGLE_DEBITNOTE);
-  LEAVE(" ");
+    ENTER("action %p, main window data %p", action, data);
+    account = main_window_to_account(data->window);
+    if (account == NULL)
+    {
+        LEAVE("no account");
+        return;
+    }
+    gnc_hbci_maketrans (GTK_WIDGET(data->window), account, SINGLE_DEBITNOTE);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_hbci_cmd_dtaus_importsend (GtkAction *action,
-				  GncMainWindowActionData *data)
+                                      GncMainWindowActionData *data)
 {
-  char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_DTAUS, NULL);
-  gnc_file_aqbanking_import ("dtaus", format ? format : "default", TRUE);
-  g_free (format);
+    char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_DTAUS, NULL);
+    gnc_file_aqbanking_import ("dtaus", format ? format : "default", TRUE);
+    g_free (format);
 }
 static void
 gnc_plugin_hbci_cmd_csv_importsend (GtkAction *action,
-				  GncMainWindowActionData *data)
+                                    GncMainWindowActionData *data)
 {
-  char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_CSV, NULL);
-  gnc_file_aqbanking_import ("csv", format ? format : "default", TRUE);
-  g_free (format);
+    char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_CSV, NULL);
+    gnc_file_aqbanking_import ("csv", format ? format : "default", TRUE);
+    g_free (format);
 }
 
 static void
 gnc_plugin_hbci_cmd_mt940_import (GtkAction *action,
-				  GncMainWindowActionData *data)
+                                  GncMainWindowActionData *data)
 {
-  char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_SWIFT940, NULL);
-  gnc_file_aqbanking_import ("swift", format ? format : "swift-mt940", FALSE);
-  g_free (format);
+    char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_SWIFT940, NULL);
+    gnc_file_aqbanking_import ("swift", format ? format : "swift-mt940", FALSE);
+    g_free (format);
 }
 static void
 gnc_plugin_hbci_cmd_mt942_import (GtkAction *action,
-				  GncMainWindowActionData *data)
+                                  GncMainWindowActionData *data)
 {
-  char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_SWIFT942, NULL);
-  gnc_file_aqbanking_import ("swift", format ? format : "swift-mt942", FALSE);
-  g_free (format);
+    char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_SWIFT942, NULL);
+    gnc_file_aqbanking_import ("swift", format ? format : "swift-mt942", FALSE);
+    g_free (format);
 }
 static void
 gnc_plugin_hbci_cmd_dtaus_import (GtkAction *action,
-				  GncMainWindowActionData *data)
+                                  GncMainWindowActionData *data)
 {
-  char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_DTAUS, NULL);
-  gnc_file_aqbanking_import ("dtaus", format ? format : "default", FALSE);
-  g_free (format);
+    char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_DTAUS, NULL);
+    gnc_file_aqbanking_import ("dtaus", format ? format : "default", FALSE);
+    g_free (format);
 }
 static void
 gnc_plugin_hbci_cmd_csv_import (GtkAction *action,
-				  GncMainWindowActionData *data)
+                                GncMainWindowActionData *data)
 {
-  char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_CSV, NULL);
-  gnc_file_aqbanking_import ("csv", format ? format : "default", FALSE);
-  g_free (format);
+    char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_CSV, NULL);
+    gnc_file_aqbanking_import ("csv", format ? format : "default", FALSE);
+    g_free (format);
 }
 /************************************************************
  *                    Plugin Bootstrapping                   *
@@ -604,7 +657,7 @@
 void
 gnc_plugin_hbci_create_plugin (void)
 {
-  GncPlugin *plugin = gnc_plugin_hbci_new ();
+    GncPlugin *plugin = gnc_plugin_hbci_new ();
 
-  gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
+    gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
 }

Modified: gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-hbci.h -- 
+/*
+ * gnc-plugin-hbci.h --
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -40,12 +40,14 @@
 #define GNC_PLUGIN_HBCI_NAME "gnc-plugin-hbci"
 
 /* typedefs & structures */
-typedef struct {
-	GncPlugin gnc_plugin;
+typedef struct
+{
+    GncPlugin gnc_plugin;
 } GncPluginHbci;
 
-typedef struct {
-	GncPluginClass gnc_plugin;
+typedef struct
+{
+    GncPluginClass gnc_plugin;
 } GncPluginHbciClass;
 
 /* function prototypes */

Modified: gnucash/trunk/src/import-export/hbci/gncmod-hbci.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gncmod-hbci.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/gncmod-hbci.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -31,54 +31,61 @@
 
 
 char *
-libgncmod_hbci_gnc_module_path(void) {
-  return g_strdup("gnucash/import-export/hbci");
+libgncmod_hbci_gnc_module_path(void)
+{
+    return g_strdup("gnucash/import-export/hbci");
 }
 
 char *
-libgncmod_hbci_gnc_module_description(void) {
-  return g_strdup("Support for Online Banking protocols");
+libgncmod_hbci_gnc_module_description(void)
+{
+    return g_strdup("Support for Online Banking protocols");
 }
 
 
 int
 libgncmod_hbci_gnc_module_init(int refcount)
 {
-  /* load the engine (we depend on it) */
-  if(!gnc_module_load("gnucash/engine", 0)) {
-    return FALSE;
-  }
+    /* load the engine (we depend on it) */
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
 
-  /* load the app-utils (we depend on it) */
-  if(!gnc_module_load("gnucash/app-utils", 0)) {
-    return FALSE;
-  }
-  if(!gnc_module_load("gnucash/gnome-utils", 0)) {
-    return FALSE;
-  }
+    /* load the app-utils (we depend on it) */
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
 
-  if(!gnc_module_load("gnucash/import-export", 0)) {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/import-export", 0))
+    {
+        return FALSE;
+    }
 
-  /* Add menu items with C callbacks */
-  gnc_plugin_hbci_create_plugin();
+    /* Add menu items with C callbacks */
+    gnc_plugin_hbci_create_plugin();
 
-  gnc_preferences_add_to_page("hbciprefs.glade", "hbci_prefs",
-			      _("Online Banking"));
+    gnc_preferences_add_to_page("hbciprefs.glade", "hbci_prefs",
+                                _("Online Banking"));
 
-  /* Initialize gwen library */
-  GWEN_Init();
+    /* Initialize gwen library */
+    GWEN_Init();
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_hbci_gnc_module_end(int refcount) {
-  gnc_AB_BANKING_delete(0);
+libgncmod_hbci_gnc_module_end(int refcount)
+{
+    gnc_AB_BANKING_delete(0);
 
-  /* Finalize gwen library */
-  GWEN_Fini();
+    /* Finalize gwen library */
+    GWEN_Fini();
 
-  return TRUE;
+    return TRUE;
 }

Modified: gnucash/trunk/src/import-export/hbci/hbci-interaction.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/hbci-interaction.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/hbci-interaction.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -80,57 +80,58 @@
 /** Adds the interactor and progressmonitor classes to the api. */
 GNCInteractor *gnc_AB_BANKING_interactors (AB_BANKING *api, GtkWidget *parent)
 {
-  GNCInteractor *data;
-  gint component_id;
-  
-  data = g_new0 (GNCInteractor, 1);
-  data->parent = parent;
-  /* FIXME: The internal target encoding is hard-coded so far. This
-     needs to be fixed for the gnome2 version; the target encoding is
-     then probably utf-8 as well. iconv is also used in
-     gnc_hbci_descr_tognc() in gnc-hbci-utils.c. */
-  data->gnc_iconv_handler = 
-    g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
-  g_assert(data->gnc_iconv_handler != (GIConv)(-1));
-  data->keepAlive = TRUE;
-  data->cache_pin = 
-    gnc_gconf_get_bool(GCONF_SECTION, KEY_REMEMBER_PIN, NULL);
-  data->showbox_id = 1;
-  data->showbox_hash = g_hash_table_new(NULL, NULL); 
-  data->min_loglevel = AB_Banking_LogLevelVerbous;
+    GNCInteractor *data;
+    gint component_id;
 
-  component_id = gnc_register_gui_component(DIALOG_HBCILOG_CM_CLASS,
-					    NULL, cm_close_handler,
-					    data);
-  gnc_gui_component_set_session(component_id, gnc_get_current_session());
+    data = g_new0 (GNCInteractor, 1);
+    data->parent = parent;
+    /* FIXME: The internal target encoding is hard-coded so far. This
+       needs to be fixed for the gnome2 version; the target encoding is
+       then probably utf-8 as well. iconv is also used in
+       gnc_hbci_descr_tognc() in gnc-hbci-utils.c. */
+    data->gnc_iconv_handler =
+        g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
+    g_assert(data->gnc_iconv_handler != (GIConv)(-1));
+    data->keepAlive = TRUE;
+    data->cache_pin =
+        gnc_gconf_get_bool(GCONF_SECTION, KEY_REMEMBER_PIN, NULL);
+    data->showbox_id = 1;
+    data->showbox_hash = g_hash_table_new(NULL, NULL);
+    data->min_loglevel = AB_Banking_LogLevelVerbous;
 
-  /* set HBCI_Interactor */
-  gnc_hbci_add_callbacks(api, data);
-  return data;
+    component_id = gnc_register_gui_component(DIALOG_HBCILOG_CM_CLASS,
+                   NULL, cm_close_handler,
+                   data);
+    gnc_gui_component_set_session(component_id, gnc_get_current_session());
+
+    /* set HBCI_Interactor */
+    gnc_hbci_add_callbacks(api, data);
+    return data;
 }
 
 void GNCInteractor_delete(GNCInteractor *data)
 {
-  if (data == NULL)
-    return;
-  if (data->dialog != NULL) {
-    gnc_gconf_set_bool(GCONF_SECTION, KEY_CLOSE_ON_FINISH,
-		       gtk_toggle_button_get_active 
-		       (GTK_TOGGLE_BUTTON (data->close_checkbutton)),
-		       NULL);
-    gnc_save_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (data->dialog));
-    g_object_unref (G_OBJECT (data->dialog));
-    gtk_widget_destroy (data->dialog);
-  }
-  
-  gnc_unregister_gui_component_by_data(DIALOG_HBCILOG_CM_CLASS, data);
+    if (data == NULL)
+        return;
+    if (data->dialog != NULL)
+    {
+        gnc_gconf_set_bool(GCONF_SECTION, KEY_CLOSE_ON_FINISH,
+                           gtk_toggle_button_get_active
+                           (GTK_TOGGLE_BUTTON (data->close_checkbutton)),
+                           NULL);
+        gnc_save_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (data->dialog));
+        g_object_unref (G_OBJECT (data->dialog));
+        gtk_widget_destroy (data->dialog);
+    }
 
-  data->dialog = NULL;
+    gnc_unregister_gui_component_by_data(DIALOG_HBCILOG_CM_CLASS, data);
 
-  g_hash_table_destroy(data->showbox_hash);
-  g_iconv_close(data->gnc_iconv_handler);
+    data->dialog = NULL;
 
-  g_free (data);
+    g_hash_table_destroy(data->showbox_hash);
+    g_iconv_close(data->gnc_iconv_handler);
+
+    g_free (data);
 }
 
 
@@ -141,72 +142,73 @@
 
 GtkWidget *GNCInteractor_parent(const GNCInteractor *i)
 {
-  g_assert(i);
-  return i->parent;
+    g_assert(i);
+    return i->parent;
 }
 
 GtkWidget *GNCInteractor_dialog(const GNCInteractor *i)
 {
-  g_assert(i);
-  return i->dialog;
+    g_assert(i);
+    return i->dialog;
 }
 
 static void GNCInteractor_setRunning (GNCInteractor *data)
 {
-  g_assert(data);
-  data->state = RUNNING;
-  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), TRUE);
-  gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), FALSE);
-  data->keepAlive = TRUE;
+    g_assert(data);
+    data->state = RUNNING;
+    gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), TRUE);
+    gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), FALSE);
+    data->keepAlive = TRUE;
 }
 static void GNCInteractor_setFinished (GNCInteractor *data)
 {
-  g_assert(data);
-  data->state = FINISHED;
-  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
-  gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), TRUE);
-  if (gtk_toggle_button_get_active
-      (GTK_TOGGLE_BUTTON (data->close_checkbutton)))
-    GNCInteractor_hide (data);
+    g_assert(data);
+    data->state = FINISHED;
+    gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
+    gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), TRUE);
+    if (gtk_toggle_button_get_active
+            (GTK_TOGGLE_BUTTON (data->close_checkbutton)))
+        GNCInteractor_hide (data);
 }
 static void GNCInteractor_setAborted (GNCInteractor *data)
 {
-  g_assert(data);
-  data->state = ABORTED;
-  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
-  gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), TRUE);
-  data->keepAlive = FALSE;
+    g_assert(data);
+    data->state = ABORTED;
+    gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
+    gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), TRUE);
+    data->keepAlive = FALSE;
 }
 
 
 gboolean GNCInteractor_aborted(const GNCInteractor *i)
 {
-  g_assert(i);
-  return !(i->keepAlive);
+    g_assert(i);
+    return !(i->keepAlive);
 }
 
 void GNCInteractor_show_nodelete(GNCInteractor *i)
 {
-  gboolean cache_pin = 
-    gnc_gconf_get_bool(GCONF_SECTION, KEY_REMEMBER_PIN, NULL);
-  g_assert(i);
-  /* Show widgets */
-  gtk_widget_show_all (i->dialog);
+    gboolean cache_pin =
+        gnc_gconf_get_bool(GCONF_SECTION, KEY_REMEMBER_PIN, NULL);
+    g_assert(i);
+    /* Show widgets */
+    gtk_widget_show_all (i->dialog);
 
-  /* Make sure the cache_pin option is up to date. */
-  if (cache_pin != i->cache_pin) {
-    /* AB_Banking_SetEnablePinCaching (ab, cache_pin); */
-    i->cache_pin = cache_pin;
-    if (cache_pin == FALSE)
-      GNCInteractor_erasePIN (i);
-  }
+    /* Make sure the cache_pin option is up to date. */
+    if (cache_pin != i->cache_pin)
+    {
+        /* AB_Banking_SetEnablePinCaching (ab, cache_pin); */
+        i->cache_pin = cache_pin;
+        if (cache_pin == FALSE)
+            GNCInteractor_erasePIN (i);
+    }
 }
 void GNCInteractor_show(GNCInteractor *i)
 {
-  g_assert(i);
-  GNCInteractor_show_nodelete(i);
-  /* Clear log window. */
-  gtk_text_buffer_set_text
+    g_assert(i);
+    GNCInteractor_show_nodelete(i);
+    /* Clear log window. */
+    gtk_text_buffer_set_text
     (gtk_text_view_get_buffer (GTK_TEXT_VIEW (i->log_text) ),
      "", 0);
 }
@@ -214,329 +216,343 @@
 
 void GNCInteractor_hide(GNCInteractor *i)
 {
-  g_assert(i);
-  if (gtk_toggle_button_get_active 
-      (GTK_TOGGLE_BUTTON (i->close_checkbutton)))
-    gtk_widget_hide_all (i->dialog);
-  gnc_gconf_set_bool(GCONF_SECTION, KEY_CLOSE_ON_FINISH,
-		     gtk_toggle_button_get_active 
-		     (GTK_TOGGLE_BUTTON (i->close_checkbutton)),
-		     NULL);
-  gnc_save_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (i->dialog));
+    g_assert(i);
+    if (gtk_toggle_button_get_active
+            (GTK_TOGGLE_BUTTON (i->close_checkbutton)))
+        gtk_widget_hide_all (i->dialog);
+    gnc_gconf_set_bool(GCONF_SECTION, KEY_CLOSE_ON_FINISH,
+                       gtk_toggle_button_get_active
+                       (GTK_TOGGLE_BUTTON (i->close_checkbutton)),
+                       NULL);
+    gnc_save_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (i->dialog));
 }
 
 gboolean GNCInteractor_get_cache_valid(const GNCInteractor *i)
 {
-  g_assert(i);
-  return i->cache_pin;
+    g_assert(i);
+    return i->cache_pin;
 }
 void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value)
 {
-  g_assert(i);
-  /* Nothing to be done right now. */
+    g_assert(i);
+    /* Nothing to be done right now. */
 }
 
 void GNCInteractor_erasePIN(GNCInteractor *i)
 {
-  g_assert(i);
-  /* Nothing to be done right now. */
+    g_assert(i);
+    /* Nothing to be done right now. */
 }
 void GNCInteractor_reparent (GNCInteractor *i, GtkWidget *new_parent)
 {
-  g_assert (i);
-  if (new_parent != i->parent)
+    g_assert (i);
+    if (new_parent != i->parent)
     {
-      i->parent = new_parent;
-      /*if (GTK_WIDGET (i->dialog) -> parent != NULL)
-	gtk_widget_reparent (GTK_WIDGET (i->dialog), new_parent);
-	else
-	gtk_widget_set_parent (GTK_WIDGET (i->dialog), new_parent);*/
-      gtk_window_set_transient_for (GTK_WINDOW (i->dialog), 
-			       GTK_WINDOW (new_parent));
+        i->parent = new_parent;
+        /*if (GTK_WIDGET (i->dialog) -> parent != NULL)
+        	gtk_widget_reparent (GTK_WIDGET (i->dialog), new_parent);
+        	else
+        	gtk_widget_set_parent (GTK_WIDGET (i->dialog), new_parent);*/
+        gtk_window_set_transient_for (GTK_WINDOW (i->dialog),
+                                      GTK_WINDOW (new_parent));
     }
 }
 
 gboolean GNCInteractor_hadErrors (const GNCInteractor *i)
 {
-  g_assert (i);
-  return (i->msgBoxError != 0);
+    g_assert (i);
+    return (i->msgBoxError != 0);
 }
 
 gboolean GNCInteractor_errorsLogged (const GNCInteractor *i)
 {
-  g_assert (i);
-  /* Note: Unfortunately this does not mean at all that there actually
-     has been any error. Old aqbanking versions had some debugging
-     messages set at "error" level, and there can also be errors when
-     closing connection that don't affect the job result at all. */
-  return (i->min_loglevel < AB_Banking_LogLevelNotice);
+    g_assert (i);
+    /* Note: Unfortunately this does not mean at all that there actually
+       has been any error. Old aqbanking versions had some debugging
+       messages set at "error" level, and there can also be errors when
+       closing connection that don't affect the job result at all. */
+    return (i->min_loglevel < AB_Banking_LogLevelNotice);
 }
 
-/* ************************************************************ 
+/* ************************************************************
  */
 
 /* This function extracts the normal text part out of the
    combi-strings that are passed from aqbanking. */
-gchar *gnc__extractText(const char *text) 
+gchar *gnc__extractText(const char *text)
 {
-  gchar *res;
-  GWEN_BUFFEREDIO *bio;
-  GWEN_XMLNODE *xmlNode;
-  GWEN_BUFFER *buf;
-  int rv;
+    gchar *res;
+    GWEN_BUFFEREDIO *bio;
+    GWEN_XMLNODE *xmlNode;
+    GWEN_BUFFER *buf;
+    int rv;
 
-  if (!text)
-    text = "";
+    if (!text)
+        text = "";
 
-  buf=GWEN_Buffer_new(0, 256, 0, 1);
-  GWEN_Buffer_AppendString(buf, text);
-  GWEN_Buffer_Rewind(buf);
+    buf = GWEN_Buffer_new(0, 256, 0, 1);
+    GWEN_Buffer_AppendString(buf, text);
+    GWEN_Buffer_Rewind(buf);
 
-  /* check whether there is a html tag */
-  bio=GWEN_BufferedIO_Buffer2_new(buf, 1);
-  GWEN_BufferedIO_SetReadBuffer(bio, 0, 256);
-  xmlNode=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "html");
-  rv=GWEN_XML_Parse(xmlNode, bio,
-		    GWEN_XML_FLAGS_DEFAULT |
-		    GWEN_XML_FLAGS_HANDLE_OPEN_HTMLTAGS |
-		    GWEN_XML_FLAGS_NO_CONDENSE |
-		    GWEN_XML_FLAGS_KEEP_CNTRL);
-  GWEN_BufferedIO_Close(bio);
-  GWEN_BufferedIO_free(bio);
+    /* check whether there is a html tag */
+    bio = GWEN_BufferedIO_Buffer2_new(buf, 1);
+    GWEN_BufferedIO_SetReadBuffer(bio, 0, 256);
+    xmlNode = GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "html");
+    rv = GWEN_XML_Parse(xmlNode, bio,
+                        GWEN_XML_FLAGS_DEFAULT |
+                        GWEN_XML_FLAGS_HANDLE_OPEN_HTMLTAGS |
+                        GWEN_XML_FLAGS_NO_CONDENSE |
+                        GWEN_XML_FLAGS_KEEP_CNTRL);
+    GWEN_BufferedIO_Close(bio);
+    GWEN_BufferedIO_free(bio);
 
-  if (rv) {
-    res = g_strdup(text);
-  }
-  else {
-    GWEN_XMLNODE *nn;
+    if (rv)
+    {
+        res = g_strdup(text);
+    }
+    else
+    {
+        GWEN_XMLNODE *nn;
 
-    nn=GWEN_XMLNode_GetFirstData(xmlNode);
-    if (nn) {
-      res = g_strdup(GWEN_XMLNode_GetData(nn));
+        nn = GWEN_XMLNode_GetFirstData(xmlNode);
+        if (nn)
+        {
+            res = g_strdup(GWEN_XMLNode_GetData(nn));
+        }
+        else
+        {
+            res = g_strdup(text);
+        }
     }
-    else {
-      res = g_strdup(text);
-    }
-  }
-  GWEN_XMLNode_free(xmlNode);
-  return res;
+    GWEN_XMLNode_free(xmlNode);
+    return res;
 }
 
 
 char *gnc_hbci_utf8ToLatin1(GNCInteractor *data, const char *utf)
 {
-  char *utf8extracted, *latin1;
+    char *utf8extracted, *latin1;
 
-  g_assert(data);
-  if (!utf) return g_strdup("");
+    g_assert(data);
+    if (!utf) return g_strdup("");
 
-  /* Get rid of the aaaarg html-combi-text part */
-  utf8extracted = gnc__extractText(utf);
-/*   printf("Extracted \"%s\" into \"%s\"\n", utf, utf8extracted); */
+    /* Get rid of the aaaarg html-combi-text part */
+    utf8extracted = gnc__extractText(utf);
+    /*   printf("Extracted \"%s\" into \"%s\"\n", utf, utf8extracted); */
 
-  latin1 = gnc_call_iconv(data->gnc_iconv_handler, utf8extracted);
+    latin1 = gnc_call_iconv(data->gnc_iconv_handler, utf8extracted);
 
-/*   printf("Converted \"%s\" into \"%s\"\n", utf8extracted, latin1); */
-  g_free(utf8extracted);
-  return latin1;
+    /*   printf("Converted \"%s\" into \"%s\"\n", utf8extracted, latin1); */
+    g_free(utf8extracted);
+    return latin1;
 }
 
 /********************************************************
- * Now all the callback functions 
+ * Now all the callback functions
  */
 
 static int inputBoxCB(AB_BANKING *ab,
-		      GWEN_TYPE_UINT32 flags,
-		      const char *utf8title,
-		      const char *utf8text,
-		      char *resultbuffer,
-		      int minsize,
-		      int maxLen)
+                      GWEN_TYPE_UINT32 flags,
+                      const char *utf8title,
+                      const char *utf8text,
+                      char *resultbuffer,
+                      int minsize,
+                      int maxLen)
 {
-  GNCInteractor *data;
-  char *passwd = NULL;
-  int retval = 0;
-  int newPin;
-  int hideInput;
-  gchar *title, *text;
+    GNCInteractor *data;
+    char *passwd = NULL;
+    int retval = 0;
+    int newPin;
+    int hideInput;
+    gchar *title, *text;
 
-  g_assert(ab);
-  data = AB_Banking_GetUserData(ab);
-  g_assert(data);
-  g_assert(maxLen > minsize);
-  data->msgBoxError = flags & AB_BANKING_MSG_FLAGS_TYPE_ERROR;
+    g_assert(ab);
+    data = AB_Banking_GetUserData(ab);
+    g_assert(data);
+    g_assert(maxLen > minsize);
+    data->msgBoxError = flags & AB_BANKING_MSG_FLAGS_TYPE_ERROR;
 
-  text = gnc_hbci_utf8ToLatin1(data, utf8text);
-  title = gnc_hbci_utf8ToLatin1(data, utf8title);
+    text = gnc_hbci_utf8ToLatin1(data, utf8text);
+    title = gnc_hbci_utf8ToLatin1(data, utf8title);
 
-  newPin = (flags | AB_BANKING_INPUT_FLAGS_CONFIRM) == 0;
-  hideInput = (flags | AB_BANKING_INPUT_FLAGS_SHOW) != 0;
+    newPin = (flags | AB_BANKING_INPUT_FLAGS_CONFIRM) == 0;
+    hideInput = (flags | AB_BANKING_INPUT_FLAGS_SHOW) != 0;
 
-  while (TRUE) {
+    while (TRUE)
+    {
 
-    if (newPin) {
-      if (!hideInput)
-	g_warning("inputBoxCB: Oops, hideInput==false and newPin==true, i.e. the input is supposed to be readable -- not implemented (since I thought this does not make sense when entering a new PIN).\n");
-      retval = gnc_hbci_get_initial_password (data->parent,
-					      title,
-					      text,
-					      &passwd);
+        if (newPin)
+        {
+            if (!hideInput)
+                g_warning("inputBoxCB: Oops, hideInput==false and newPin==true, i.e. the input is supposed to be readable -- not implemented (since I thought this does not make sense when entering a new PIN).\n");
+            retval = gnc_hbci_get_initial_password (data->parent,
+                                                    title,
+                                                    text,
+                                                    &passwd);
+        }
+        else
+        {
+            retval = gnc_hbci_get_password (data->parent,
+                                            title,
+                                            text,
+                                            NULL,
+                                            &passwd,
+                                            hideInput);
+        } /* newPin */
+
+        if (!retval)
+            break;
+
+        g_assert(passwd);
+        if (strlen(passwd) < (unsigned int)minsize)
+        {
+            gboolean retval;
+            char *msg =
+                g_strdup_printf (  _("The PIN needs to be at least %d characters "
+                                     "long. Do you want to try again?"),
+                                   minsize);
+            retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
+                                        TRUE,
+                                        "%s", msg);
+            g_free (msg);
+            if (!retval)
+                break;
+        }
+        else if (strlen(passwd) > (unsigned int)maxLen)
+        {
+            gboolean retval;
+            char *msg =
+                g_strdup_printf (  _("You entered %ld characters, but the PIN must "
+                                     "be no longer than %d characters. "
+                                     "Do you want to try again?"),
+                                   (long)strlen(passwd), maxLen);
+            retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
+                                        TRUE,
+                                        "%s", msg);
+            g_free (msg);
+            if (!retval)
+                break;
+        }
+        else
+        {
+            g_assert (maxLen > strlen(passwd)); /* assertion was queried above */
+            strcpy(resultbuffer, passwd);
+            g_free (memset (passwd, 0, strlen (passwd)));
+            g_free(title);
+            g_free(text);
+            return 0;
+        }
     }
-    else {
-      retval = gnc_hbci_get_password (data->parent,
-				      title,
-				      text,
-				      NULL,
-				      &passwd,
-				      hideInput);
-    } /* newPin */
-    
-    if (!retval)
-      break;
-    
-    g_assert(passwd);
-    if (strlen(passwd) < (unsigned int)minsize) {
-      gboolean retval;
-      char *msg = 
-	g_strdup_printf (  _("The PIN needs to be at least %d characters "
-			     "long. Do you want to try again?"),
-			   minsize);
-      retval = gnc_verify_dialog (GTK_WIDGET (data->parent), 
-					   TRUE,
-					   "%s", msg);
-      g_free (msg);
-      if (!retval)
-	break;
-    }
-    else if (strlen(passwd) > (unsigned int)maxLen) {
-      gboolean retval;
-      char *msg = 
-	g_strdup_printf (  _("You entered %ld characters, but the PIN must "
-			     "be no longer than %d characters. "
-			     "Do you want to try again?"),
-			   (long)strlen(passwd), maxLen);
-      retval = gnc_verify_dialog (GTK_WIDGET (data->parent), 
-					   TRUE,
-					   "%s", msg);
-      g_free (msg);
-      if (!retval)
-	break;
-    }
-    else {
-      g_assert (maxLen > strlen(passwd)); /* assertion was queried above */
-      strcpy(resultbuffer, passwd);
-      g_free (memset (passwd, 0, strlen (passwd)));
-      g_free(title);
-      g_free(text);
-      return 0;
-    }
-  }
-  
-  /* User wanted to abort. */
-  g_free(title);
-  g_free(text);
-  return 1;
+
+    /* User wanted to abort. */
+    g_free(title);
+    g_free(text);
+    return 1;
 }
 
-/* **************************************** 
+/* ****************************************
  */
 
 
 static int getTanCB(AB_BANKING *ab,
-		    const char *token,
-		    const char *utf8title,
-		    const char *utf8text,
-		    char *resultbuffer,
-		    int minsize,
-		    int maxLen)
+                    const char *token,
+                    const char *utf8title,
+                    const char *utf8text,
+                    char *resultbuffer,
+                    int minsize,
+                    int maxLen)
 {
-  GNCInteractor *data;
-  char *passwd = NULL;
-  int retval = 0;
-  gchar *title, *text;
+    GNCInteractor *data;
+    char *passwd = NULL;
+    int retval = 0;
+    gchar *title, *text;
 
-  g_assert(ab);
-  data = AB_Banking_GetUserData(ab);
-  g_assert(data);
-  g_assert(maxLen > minsize);
-  data->msgBoxError = 0;
+    g_assert(ab);
+    data = AB_Banking_GetUserData(ab);
+    g_assert(data);
+    g_assert(maxLen > minsize);
+    data->msgBoxError = 0;
 
-  text = gnc_hbci_utf8ToLatin1(data, utf8text);
-  title = gnc_hbci_utf8ToLatin1(data, utf8title);
+    text = gnc_hbci_utf8ToLatin1(data, utf8text);
+    title = gnc_hbci_utf8ToLatin1(data, utf8title);
 
-  while (TRUE) {
+    while (TRUE)
+    {
 
-    retval = gnc_hbci_get_password (data->parent,
-				    title,
-				    text,
-				    NULL,
-				    &passwd,
-				    FALSE);
+        retval = gnc_hbci_get_password (data->parent,
+                                        title,
+                                        text,
+                                        NULL,
+                                        &passwd,
+                                        FALSE);
 
-    if (!retval)
-      break;
-    
-    if (strlen(passwd) < (unsigned int)minsize) {
-      gboolean retval;
-      char *msg = 
-	g_strdup_printf (  _("This TAN needs to be at least %d characters "
-			     "long. Do you want to try again?"),
-			   minsize);
-      retval = gnc_verify_dialog (GTK_WIDGET (data->parent), 
-					   TRUE,
-					   "%s", msg);
-      g_free (msg);
-      if (!retval)
-	break;
+        if (!retval)
+            break;
+
+        if (strlen(passwd) < (unsigned int)minsize)
+        {
+            gboolean retval;
+            char *msg =
+                g_strdup_printf (  _("This TAN needs to be at least %d characters "
+                                     "long. Do you want to try again?"),
+                                   minsize);
+            retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
+                                        TRUE,
+                                        "%s", msg);
+            g_free (msg);
+            if (!retval)
+                break;
+        }
+        else if (strlen(passwd) > (unsigned int)maxLen)
+        {
+            gboolean retval;
+            char *msg =
+                g_strdup_printf (  _("You entered %ld characters, but the TAN must "
+                                     "be no longer than %d characters. "
+                                     "Do you want to try again?"),
+                                   (long)strlen(passwd), maxLen);
+            retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
+                                        TRUE,
+                                        "%s", msg);
+            g_free (msg);
+            if (!retval)
+                break;
+        }
+        else
+        {
+            g_assert (maxLen > strlen(passwd)); /* assertion was queried above */
+            strcpy(resultbuffer, passwd);
+
+            g_free (memset (passwd, 0, strlen (passwd)));
+            g_free(title);
+            g_free(text);
+            return 0;
+        }
     }
-    else if (strlen(passwd) > (unsigned int)maxLen) {
-      gboolean retval;
-      char *msg = 
-	g_strdup_printf (  _("You entered %ld characters, but the TAN must "
-			     "be no longer than %d characters. "
-			     "Do you want to try again?"),
-			   (long)strlen(passwd), maxLen);
-      retval = gnc_verify_dialog (GTK_WIDGET (data->parent), 
-					   TRUE,
-					   "%s", msg);
-      g_free (msg);
-      if (!retval)
-	break;
-    }
-    else {
-      g_assert (maxLen > strlen(passwd)); /* assertion was queried above */
-      strcpy(resultbuffer, passwd);
 
-      g_free (memset (passwd, 0, strlen (passwd)));
-      g_free(title);
-      g_free(text);
-      return 0;
-    }
-  }
-  
-  /* User wanted to abort. */
-  g_free(title);
-  g_free(text);
-  return 1;
+    /* User wanted to abort. */
+    g_free(title);
+    g_free(text);
+    return 1;
 }
 
 
-/* ************************************************************ 
+/* ************************************************************
  */
 
 static int keepAlive(void *user_data)
 {
-  GNCInteractor *data = user_data;
-  GMainContext *context;
+    GNCInteractor *data = user_data;
+    GMainContext *context;
 
-  g_assert(data);
-  /*fprintf(stdout, "my-keepAlive: returning 1\n");*/
+    g_assert(data);
+    /*fprintf(stdout, "my-keepAlive: returning 1\n");*/
 
-  /* Let the widgets be redrawn */
-  context = g_main_context_default();
-  while (g_main_context_iteration(context, FALSE));
+    /* Let the widgets be redrawn */
+    context = g_main_context_default();
+    while (g_main_context_iteration(context, FALSE));
 
-  return data->keepAlive;
+    return data->keepAlive;
 }
 
 
@@ -547,386 +563,401 @@
 #endif
 static void GWENHYWFAR_CB destr(void *bp, void *user_data)
 {
-  GNCInteractor *data = user_data;
-  if (data == NULL)
-    return;
+    GNCInteractor *data = user_data;
+    if (data == NULL)
+        return;
 
-  GNCInteractor_delete (data);
+    GNCInteractor_delete (data);
 }
 
 
-/* ************************************************************ 
+/* ************************************************************
  */
 
-static void 
+static void
 hideBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id)
 {
-  GNCInteractor *data;
-  GtkWidget *dialog;
-  g_assert(ab);
-  data = AB_Banking_GetUserData(ab);
-  g_assert(data);
+    GNCInteractor *data;
+    GtkWidget *dialog;
+    g_assert(ab);
+    data = AB_Banking_GetUserData(ab);
+    g_assert(data);
 
-  if (id > 0) {
-    dialog = g_hash_table_lookup(data->showbox_hash, GUINT_TO_POINTER(id));
-  } else {
-    dialog = data->showbox_last;
-  }
-  if (dialog) {
-    gtk_widget_hide (dialog);
-    gtk_widget_destroy (dialog);
-    g_hash_table_remove(data->showbox_hash, GUINT_TO_POINTER(id));
-  }
+    if (id > 0)
+    {
+        dialog = g_hash_table_lookup(data->showbox_hash, GUINT_TO_POINTER(id));
+    }
+    else
+    {
+        dialog = data->showbox_last;
+    }
+    if (dialog)
+    {
+        gtk_widget_hide (dialog);
+        gtk_widget_destroy (dialog);
+        g_hash_table_remove(data->showbox_hash, GUINT_TO_POINTER(id));
+    }
 }
 
 static GWEN_TYPE_UINT32
 showBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 flags,
-	  const char *utf8title, const char *utf8text)
+          const char *utf8title, const char *utf8text)
 {
-  GtkWidget *dialog;
-  GNCInteractor *data;
-  GWEN_TYPE_UINT32 result;
-  gchar *title, *text;
+    GtkWidget *dialog;
+    GNCInteractor *data;
+    GWEN_TYPE_UINT32 result;
+    gchar *title, *text;
 
-  g_assert(ab);
-  data = AB_Banking_GetUserData(ab);
-  g_assert(data);
-  data->msgBoxError = flags & AB_BANKING_MSG_FLAGS_TYPE_ERROR;
-  
-  text = gnc_hbci_utf8ToLatin1(data, utf8text);
-  title = gnc_hbci_utf8ToLatin1(data, utf8title);
+    g_assert(ab);
+    data = AB_Banking_GetUserData(ab);
+    g_assert(data);
+    data->msgBoxError = flags & AB_BANKING_MSG_FLAGS_TYPE_ERROR;
 
-  /* Create new dialog */
-  dialog = gtk_message_dialog_new(GTK_WINDOW(data->parent),
-				  0,
-				  GTK_MESSAGE_INFO,
-				  GTK_BUTTONS_OK,
-				  "%s", text);
+    text = gnc_hbci_utf8ToLatin1(data, utf8text);
+    title = gnc_hbci_utf8ToLatin1(data, utf8title);
 
-  if (title && (strlen(title) > 0))
-    gtk_window_set_title (GTK_WINDOW (dialog), title);
+    /* Create new dialog */
+    dialog = gtk_message_dialog_new(GTK_WINDOW(data->parent),
+                                    0,
+                                    GTK_MESSAGE_INFO,
+                                    GTK_BUTTONS_OK,
+                                    "%s", text);
 
-  g_signal_connect(G_OBJECT(dialog), "response",
-		   (GCallback)gtk_widget_hide, NULL);
-  gtk_widget_show_all (dialog);
+    if (title && (strlen(title) > 0))
+        gtk_window_set_title (GTK_WINDOW (dialog), title);
 
-  result = data->showbox_id;
-  g_hash_table_insert(data->showbox_hash, GUINT_TO_POINTER(result), dialog);
-  data->showbox_id++;
-  data->showbox_last = dialog;
+    g_signal_connect(G_OBJECT(dialog), "response",
+                     (GCallback)gtk_widget_hide, NULL);
+    gtk_widget_show_all (dialog);
 
-  g_free(title);
-  g_free(text);
-  return result;
+    result = data->showbox_id;
+    g_hash_table_insert(data->showbox_hash, GUINT_TO_POINTER(result), dialog);
+    data->showbox_id++;
+    data->showbox_last = dialog;
+
+    g_free(title);
+    g_free(text);
+    return result;
 }
 
-/* ************************************************************ 
+/* ************************************************************
  */
 
-static int messageBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 flags, 
-			const char *utf8title, const char *utf8text, 
-			const char *b1, const char *b2, const char *b3)
+static int messageBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 flags,
+                        const char *utf8title, const char *utf8text,
+                        const char *b1, const char *b2, const char *b3)
 {
-  GNCInteractor *data;
-  GtkWidget *dialog, *label;
-  int result;
-  gchar *text, *title, *b1text, *b2text, *b3text;
+    GNCInteractor *data;
+    GtkWidget *dialog, *label;
+    int result;
+    gchar *text, *title, *b1text, *b2text, *b3text;
 
-  g_assert(ab);
-  data = AB_Banking_GetUserData(ab);
-  g_assert(data);
-  data->msgBoxError = flags & AB_BANKING_MSG_FLAGS_TYPE_ERROR;
+    g_assert(ab);
+    data = AB_Banking_GetUserData(ab);
+    g_assert(data);
+    data->msgBoxError = flags & AB_BANKING_MSG_FLAGS_TYPE_ERROR;
 
-  text = gnc_hbci_utf8ToLatin1(data, utf8text);
-  title = gnc_hbci_utf8ToLatin1(data, utf8title);
-  b1text = gnc_hbci_utf8ToLatin1(data, b1);
-  b2text = gnc_hbci_utf8ToLatin1(data, b2);
-  b3text = gnc_hbci_utf8ToLatin1(data, b3);
+    text = gnc_hbci_utf8ToLatin1(data, utf8text);
+    title = gnc_hbci_utf8ToLatin1(data, utf8title);
+    b1text = gnc_hbci_utf8ToLatin1(data, b1);
+    b2text = gnc_hbci_utf8ToLatin1(data, b2);
+    b3text = gnc_hbci_utf8ToLatin1(data, b3);
 
-  dialog = gtk_dialog_new_with_buttons (title, 
-					GTK_WINDOW (data->parent),
-					GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-					b1 ? b1text : NULL,
-					1,
-					b2 ? b2text : NULL,
-					2,
-					b3 ? b3text : NULL,
-					3,
-					NULL);
-  /* Add the label, and show everything we've added to the dialog. */
-  label = gtk_label_new (text);
-  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
-		     label);
-  gtk_widget_show_all (dialog);
+    dialog = gtk_dialog_new_with_buttons (title,
+                                          GTK_WINDOW (data->parent),
+                                          GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                          b1 ? b1text : NULL,
+                                          1,
+                                          b2 ? b2text : NULL,
+                                          2,
+                                          b3 ? b3text : NULL,
+                                          3,
+                                          NULL);
+    /* Add the label, and show everything we've added to the dialog. */
+    label = gtk_label_new (text);
+    gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+    gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
+                       label);
+    gtk_widget_show_all (dialog);
 
-  result = gtk_dialog_run (GTK_DIALOG (dialog));
-  gtk_widget_destroy (dialog);
-  if (result<1 || result>3) {
-    g_warning("messageBoxCB: Bad result %d", result);
-    result = 0;
-  }
-  g_free(title);
-  g_free(text);
-  g_free(b1text);
-  g_free(b2text);
-  g_free(b3text);
-  return result;
+    result = gtk_dialog_run (GTK_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
+    if (result < 1 || result > 3)
+    {
+        g_warning("messageBoxCB: Bad result %d", result);
+        result = 0;
+    }
+    g_free(title);
+    g_free(text);
+    g_free(b1text);
+    g_free(b2text);
+    g_free(b3text);
+    return result;
 }
 
 
-/* ************************************************************ 
+/* ************************************************************
  */
 
 #define progress_id 4711
 
-static GWEN_TYPE_UINT32 progressStartCB(AB_BANKING *ab, const char *utf8title, 
-					const char *utf8text, GWEN_TYPE_UINT32 total)
+static GWEN_TYPE_UINT32 progressStartCB(AB_BANKING *ab, const char *utf8title,
+                                        const char *utf8text, GWEN_TYPE_UINT32 total)
 {
-  GNCInteractor *data;
-  gchar *title, *text;
+    GNCInteractor *data;
+    gchar *title, *text;
 
-  g_assert(ab);
-  data = AB_Banking_GetUserData(ab);
-  g_assert(data);
-  
-  text = gnc_hbci_utf8ToLatin1(data, utf8text);
-  title = gnc_hbci_utf8ToLatin1(data, utf8title);
+    g_assert(ab);
+    data = AB_Banking_GetUserData(ab);
+    g_assert(data);
 
-  /* Now set the text etc */
-  gtk_entry_set_text (GTK_ENTRY (data->job_entry), title);
-  gtk_entry_set_text (GTK_ENTRY (data->action_entry), text);
+    text = gnc_hbci_utf8ToLatin1(data, utf8text);
+    title = gnc_hbci_utf8ToLatin1(data, utf8title);
 
-  /*   printf("progressLogCB: Logging msg: %s\n", text); */
-  /*   GNCInteractor_add_log_text (data, text); */
+    /* Now set the text etc */
+    gtk_entry_set_text (GTK_ENTRY (data->job_entry), title);
+    gtk_entry_set_text (GTK_ENTRY (data->action_entry), text);
 
-  /* Set progress bar */
-  gtk_widget_set_sensitive (data->action_progress, TRUE);
-  gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(data->action_progress), 0.0);
-  data->action_max = total;
-  GNCInteractor_setRunning(data);
-  /* printf("progressStartCB: Action \"%s\" started, total %d.\n",
-     text, total); */
+    /*   printf("progressLogCB: Logging msg: %s\n", text); */
+    /*   GNCInteractor_add_log_text (data, text); */
 
-  /* Show the dialog */
-  GNCInteractor_show(data);
+    /* Set progress bar */
+    gtk_widget_set_sensitive (data->action_progress, TRUE);
+    gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(data->action_progress), 0.0);
+    data->action_max = total;
+    GNCInteractor_setRunning(data);
+    /* printf("progressStartCB: Action \"%s\" started, total %d.\n",
+       text, total); */
 
-  /* Initialize loglevel caching */
-  data->min_loglevel = AB_Banking_LogLevelVerbous;
+    /* Show the dialog */
+    GNCInteractor_show(data);
 
-  g_free(title);
-  g_free(text);
-  return progress_id;
+    /* Initialize loglevel caching */
+    data->min_loglevel = AB_Banking_LogLevelVerbous;
+
+    g_free(title);
+    g_free(text);
+    return progress_id;
 }
 
-static int progressAdvanceCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id, 
-			     GWEN_TYPE_UINT32 progress)
+static int progressAdvanceCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id,
+                             GWEN_TYPE_UINT32 progress)
 {
-  GNCInteractor *data;
+    GNCInteractor *data;
 
-  g_assert(ab);
-  data = AB_Banking_GetUserData(ab);
-  g_assert(data);
+    g_assert(ab);
+    data = AB_Banking_GetUserData(ab);
+    g_assert(data);
 
-  if ((id != 0) && (id != progress_id)) {
-/*     printf("progressLogCB: Oops, wrong progress id %d -- ignored.\n", id); */
-  }
+    if ((id != 0) && (id != progress_id))
+    {
+        /*     printf("progressLogCB: Oops, wrong progress id %d -- ignored.\n", id); */
+    }
 
-  if (progress != AB_BANKING_PROGRESS_NONE) {
-    /* printf("progressLogCB: Progress set to %d out of %f.\n", 
-       progress, data->action_max); */
-    if (progress <= data->action_max) 
-      gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (data->action_progress),
-				     progress/data->action_max);
-  }
+    if (progress != AB_BANKING_PROGRESS_NONE)
+    {
+        /* printf("progressLogCB: Progress set to %d out of %f.\n",
+           progress, data->action_max); */
+        if (progress <= data->action_max)
+            gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (data->action_progress),
+                                           progress / data->action_max);
+    }
 
-  return !keepAlive(data);
+    return !keepAlive(data);
 }
 
 
-static int progressLogCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id, 
-			 AB_BANKING_LOGLEVEL level, const char *utf8text)
+static int progressLogCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id,
+                         AB_BANKING_LOGLEVEL level, const char *utf8text)
 {
-  GNCInteractor *data;
-  gchar *text;
+    GNCInteractor *data;
+    gchar *text;
 
-  g_assert(ab);
-  data = AB_Banking_GetUserData(ab);
-  g_assert(data);
+    g_assert(ab);
+    data = AB_Banking_GetUserData(ab);
+    g_assert(data);
 
-  text = gnc_hbci_utf8ToLatin1(data, utf8text);
+    text = gnc_hbci_utf8ToLatin1(data, utf8text);
 
-  if ((id != 0) && (id != progress_id)) {
-/*     printf("progressLogCB: Oops, wrong progress id %d -- ignored.\n", id); */
-  }
+    if ((id != 0) && (id != progress_id))
+    {
+        /*     printf("progressLogCB: Oops, wrong progress id %d -- ignored.\n", id); */
+    }
 
-  /* printf("progressLogCB: Logging msg: %s\n", text); */
-  GNCInteractor_add_log_text (data, text);
+    /* printf("progressLogCB: Logging msg: %s\n", text); */
+    GNCInteractor_add_log_text (data, text);
 
-  /* Cache loglevel */
-  if (level < data->min_loglevel)
-    data->min_loglevel = level;
+    /* Cache loglevel */
+    if (level < data->min_loglevel)
+        data->min_loglevel = level;
 
-  g_free(text);
-  return !keepAlive(data);
+    g_free(text);
+    return !keepAlive(data);
 }
 
 static int progressEndCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id)
 {
-  GNCInteractor *data;
-  g_assert(ab);
-  data = AB_Banking_GetUserData(ab);
-  g_assert(data);
+    GNCInteractor *data;
+    g_assert(ab);
+    data = AB_Banking_GetUserData(ab);
+    g_assert(data);
 
-  if ((id != 0) && (id != progress_id)) {
-/*     printf("progressLogCB: Oops, wrong progress id %d -- ignored.\n", id); */
-  }
+    if ((id != 0) && (id != progress_id))
+    {
+        /*     printf("progressLogCB: Oops, wrong progress id %d -- ignored.\n", id); */
+    }
 
-  GNCInteractor_setFinished(data);
+    GNCInteractor_setFinished(data);
 
-  keepAlive(data);
-  return 0;
+    keepAlive(data);
+    return 0;
 }
 
 
 
-/* ************************************************************ 
+/* ************************************************************
  */
 
 int debug_pmonitor = FALSE;
 void GNCInteractor_add_log_text (GNCInteractor *data, const char *msg)
 {
-  GtkTextBuffer *tb;
-  GtkTextView *tv;
-  g_assert(data);
+    GtkTextBuffer *tb;
+    GtkTextView *tv;
+    g_assert(data);
 
-  tv = GTK_TEXT_VIEW (data->log_text);
-  tb = gtk_text_view_get_buffer (tv);
-  gtk_text_buffer_insert_at_cursor (tb, msg, -1);
-  gtk_text_buffer_insert_at_cursor (tb, "\n", -1);
-  /* and scroll to the end of the buffer */
-  gtk_text_view_scroll_to_mark (tv, gtk_text_buffer_get_insert (tb),
-				0.0, FALSE, 0.0, 0.0);
+    tv = GTK_TEXT_VIEW (data->log_text);
+    tb = gtk_text_view_get_buffer (tv);
+    gtk_text_buffer_insert_at_cursor (tb, msg, -1);
+    gtk_text_buffer_insert_at_cursor (tb, "\n", -1);
+    /* and scroll to the end of the buffer */
+    gtk_text_view_scroll_to_mark (tv, gtk_text_buffer_get_insert (tb),
+                                  0.0, FALSE, 0.0, 0.0);
 }
 
 static void
 on_button_clicked (GtkButton *button,
-		   gpointer user_data)
+                   gpointer user_data)
 {
-  GNCInteractor *data = user_data;
-  GMainContext *context;
-  const char *name;
-  g_assert(data);
-  
-  name = gtk_widget_get_name (GTK_WIDGET (button));
-  if (strcmp (name, "abort_button") == 0) {
-    GNCInteractor_setAborted(data);
-  } else if (strcmp (name, "close_button") == 0) {
-    if (data->state != RUNNING) {
-      gtk_widget_hide_all (data->dialog); 
-      /*data->dont_hide = FALSE;*/
-      /*GNCInteractor_hide (data);*/
+    GNCInteractor *data = user_data;
+    GMainContext *context;
+    const char *name;
+    g_assert(data);
+
+    name = gtk_widget_get_name (GTK_WIDGET (button));
+    if (strcmp (name, "abort_button") == 0)
+    {
+        GNCInteractor_setAborted(data);
     }
-  } else {
-    g_critical("on_button_clicked: Oops, unknown button: %s\n",
-	   name);
-  }
-  /* Let the widgets be redrawn */
-  context = g_main_context_default();
-  while (g_main_context_iteration(context, FALSE));
+    else if (strcmp (name, "close_button") == 0)
+    {
+        if (data->state != RUNNING)
+        {
+            gtk_widget_hide_all (data->dialog);
+            /*data->dont_hide = FALSE;*/
+            /*GNCInteractor_hide (data);*/
+        }
+    }
+    else
+    {
+        g_critical("on_button_clicked: Oops, unknown button: %s\n",
+                   name);
+    }
+    /* Let the widgets be redrawn */
+    context = g_main_context_default();
+    while (g_main_context_iteration(context, FALSE));
 }
 
 static void
 cm_close_handler(gpointer user_data)
 {
-  GNCInteractor *data = user_data;
+    GNCInteractor *data = user_data;
 
-  GNCInteractor_setAborted(data);
-  /* Notes about correctly handling this ComponentManager close event:
-     We can't actually close the dialog here because AqBanking might
-     still be running and expecting the GNCInteractor object to exist
-     (and it doesn't offer any handlers for aborting from here). This
-     is not per se a problem with gnucash objects because as soon as
-     AqBanking received the SetAborted signal, it will abort and not
-     deliver any actual results, which means the gnc-hbci module will
-     not continue any operation. 
+    GNCInteractor_setAborted(data);
+    /* Notes about correctly handling this ComponentManager close event:
+       We can't actually close the dialog here because AqBanking might
+       still be running and expecting the GNCInteractor object to exist
+       (and it doesn't offer any handlers for aborting from here). This
+       is not per se a problem with gnucash objects because as soon as
+       AqBanking received the SetAborted signal, it will abort and not
+       deliver any actual results, which means the gnc-hbci module will
+       not continue any operation.
 
-     However, the dialog and the AB_BANKING object will still be
-     around. It is unclear whether this is 1. correct or 2. wrong:
-     1. It might be correct because a user might still want to see the
-     log messages in the window until he manually closes the
-     GNCInteractor. 2. It might be wrong because once we've received
-     the close event, nobody wants to see the GNCInteractor log
-     messages anyway. To implement the behaviour #2, we should add a
-     new flag in GNCInteractor that is being queried in
-     gnc_AB_BANKING_execute() right after AB_Banking_ExecuteQueue()
-     has finished, and if it is activated from the cm_close_handler,
-     gnc_AB_BANKING_execute should immediately delete the AB_BANKING
-     object (which will also delete the GNCInteractor object) and
-     abort.
-  */
+       However, the dialog and the AB_BANKING object will still be
+       around. It is unclear whether this is 1. correct or 2. wrong:
+       1. It might be correct because a user might still want to see the
+       log messages in the window until he manually closes the
+       GNCInteractor. 2. It might be wrong because once we've received
+       the close event, nobody wants to see the GNCInteractor log
+       messages anyway. To implement the behaviour #2, we should add a
+       new flag in GNCInteractor that is being queried in
+       gnc_AB_BANKING_execute() right after AB_Banking_ExecuteQueue()
+       has finished, and if it is activated from the cm_close_handler,
+       gnc_AB_BANKING_execute should immediately delete the AB_BANKING
+       object (which will also delete the GNCInteractor object) and
+       abort.
+    */
 }
 
 
 /********************************************************
- * Constructor 
+ * Constructor
  */
 void
 gnc_hbci_add_callbacks(AB_BANKING *ab, GNCInteractor *data)
 {
-  GtkWidget *dialog;
-  GladeXML *xml;
+    GtkWidget *dialog;
+    GladeXML *xml;
 
-  /* Create the progress dialog window */
-  xml = gnc_glade_xml_new ("hbci.glade", "HBCI_connection_dialog");
+    /* Create the progress dialog window */
+    xml = gnc_glade_xml_new ("hbci.glade", "HBCI_connection_dialog");
 
-  g_assert ((dialog = glade_xml_get_widget (xml, "HBCI_connection_dialog")) != NULL);
-  data->dialog = dialog;
-  g_assert ((data->job_entry = glade_xml_get_widget (xml, "job_entry")) != NULL);
-  g_assert ((data->action_entry = glade_xml_get_widget (xml, "action_entry")) != NULL);
-  g_assert ((data->action_progress = 
-	     glade_xml_get_widget (xml, "action_progress")) != NULL);
-  g_assert ((data->log_text = glade_xml_get_widget (xml, "log_text")) != NULL);
-  g_assert ((data->abort_button = glade_xml_get_widget (xml, "abort_button")) != NULL);
-  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
-  g_assert ((data->close_button = glade_xml_get_widget (xml, "close_button")) != NULL);
-  g_assert ((data->close_checkbutton = 
-	     glade_xml_get_widget (xml, "close_checkbutton")) != NULL);
+    g_assert ((dialog = glade_xml_get_widget (xml, "HBCI_connection_dialog")) != NULL);
+    data->dialog = dialog;
+    g_assert ((data->job_entry = glade_xml_get_widget (xml, "job_entry")) != NULL);
+    g_assert ((data->action_entry = glade_xml_get_widget (xml, "action_entry")) != NULL);
+    g_assert ((data->action_progress =
+                   glade_xml_get_widget (xml, "action_progress")) != NULL);
+    g_assert ((data->log_text = glade_xml_get_widget (xml, "log_text")) != NULL);
+    g_assert ((data->abort_button = glade_xml_get_widget (xml, "abort_button")) != NULL);
+    gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
+    g_assert ((data->close_button = glade_xml_get_widget (xml, "close_button")) != NULL);
+    g_assert ((data->close_checkbutton =
+                   glade_xml_get_widget (xml, "close_checkbutton")) != NULL);
 
-  /* grey out the progress bar -- its unused at the moment */
-  gtk_widget_set_sensitive (data->action_progress, FALSE);
-  gtk_toggle_button_set_active 
-    (GTK_TOGGLE_BUTTON (data->close_checkbutton), 
+    /* grey out the progress bar -- its unused at the moment */
+    gtk_widget_set_sensitive (data->action_progress, FALSE);
+    gtk_toggle_button_set_active
+    (GTK_TOGGLE_BUTTON (data->close_checkbutton),
      gnc_gconf_get_bool(GCONF_SECTION, KEY_CLOSE_ON_FINISH, NULL));
 
-  g_signal_connect (data->abort_button, "clicked", 
-		    G_CALLBACK (on_button_clicked), data);
-  g_signal_connect (data->close_button, "clicked", 
-		    G_CALLBACK (on_button_clicked), data);
+    g_signal_connect (data->abort_button, "clicked",
+                      G_CALLBACK (on_button_clicked), data);
+    g_signal_connect (data->close_button, "clicked",
+                      G_CALLBACK (on_button_clicked), data);
 
-  if (data->parent)
-    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (data->parent));
-  gnc_restore_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (dialog));
+    if (data->parent)
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (data->parent));
+    gnc_restore_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (dialog));
 
-  g_object_ref (G_OBJECT (dialog));
-  gtk_widget_hide_all (dialog);
+    g_object_ref (G_OBJECT (dialog));
+    gtk_widget_hide_all (dialog);
 
-  GWEN_INHERIT_SETDATA(AB_BANKING, GNCInteractor,
-                       ab, data,
-                       &destr);
+    GWEN_INHERIT_SETDATA(AB_BANKING, GNCInteractor,
+                         ab, data,
+                         &destr);
 
-  AB_Banking_SetMessageBoxFn(ab, messageBoxCB);
-  AB_Banking_SetInputBoxFn(ab, inputBoxCB);
-  AB_Banking_SetShowBoxFn(ab, showBoxCB);
-  AB_Banking_SetHideBoxFn(ab, hideBoxCB);
-  AB_Banking_SetProgressStartFn(ab, progressStartCB);
-  AB_Banking_SetProgressAdvanceFn(ab, progressAdvanceCB);
-  AB_Banking_SetProgressLogFn(ab, progressLogCB);
-  AB_Banking_SetProgressEndFn(ab, progressEndCB);
+    AB_Banking_SetMessageBoxFn(ab, messageBoxCB);
+    AB_Banking_SetInputBoxFn(ab, inputBoxCB);
+    AB_Banking_SetShowBoxFn(ab, showBoxCB);
+    AB_Banking_SetHideBoxFn(ab, hideBoxCB);
+    AB_Banking_SetProgressStartFn(ab, progressStartCB);
+    AB_Banking_SetProgressAdvanceFn(ab, progressAdvanceCB);
+    AB_Banking_SetProgressLogFn(ab, progressLogCB);
+    AB_Banking_SetProgressEndFn(ab, progressEndCB);
 
-  /* AB_Banking_SetGetPinFn(ab,); */
-  AB_Banking_SetGetTanFn(ab, getTanCB);
+    /* AB_Banking_SetGetPinFn(ab,); */
+    AB_Banking_SetGetTanFn(ab, getTanCB);
 
-  AB_Banking_SetUserData(ab, data);
+    AB_Banking_SetUserData(ab, data);
 
 }

Modified: gnucash/trunk/src/import-export/hbci/hbci-interactionP.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/hbci-interactionP.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/hbci-interactionP.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,4 +1,4 @@
-/* hbci-interactorP.h -- private header for the functionality offerd by the 
+/* hbci-interactorP.h -- private header for the functionality offerd by the
    method in hbci-interaction.h.
    Copyright 2002 by Christian Stimming <stimming at tuhh.de> */
 
@@ -29,58 +29,59 @@
 #include "gnc-hbci-utils.h"
 
 
-typedef enum {
-  INIT,
-  RUNNING,
-  FINISHED,
-  ABORTED,
-  CLOSING
+typedef enum
+{
+    INIT,
+    RUNNING,
+    FINISHED,
+    ABORTED,
+    CLOSING
 } PMon_state;
 
-struct _inter_data 
+struct _inter_data
 {
-  GtkWidget *parent;
-  GtkWidget *dialog;
+    GtkWidget *parent;
+    GtkWidget *dialog;
 
-  /* Progress bars */
-  GtkWidget *job_entry;
-  GtkWidget *action_entry;
-  GtkWidget *action_progress;
-  /* Counters for progress bar */
-  double action_max;
+    /* Progress bars */
+    GtkWidget *job_entry;
+    GtkWidget *action_entry;
+    GtkWidget *action_progress;
+    /* Counters for progress bar */
+    double action_max;
 
-  /* Log window */
-  GtkWidget *log_text;
+    /* Log window */
+    GtkWidget *log_text;
 
-  /* Buttons */
-  GtkWidget *abort_button;
-  GtkWidget *close_button;
-  GtkWidget *close_checkbutton;
+    /* Buttons */
+    GtkWidget *abort_button;
+    GtkWidget *close_button;
+    GtkWidget *close_checkbutton;
 
-  const char *format_pin_user_bank;
-  const char *format_pin_min_char;
+    const char *format_pin_user_bank;
+    const char *format_pin_min_char;
 
-  /* The iconv handler for utf8 -> latin1 conversion */
-  GIConv gnc_iconv_handler;
+    /* The iconv handler for utf8 -> latin1 conversion */
+    GIConv gnc_iconv_handler;
 
-  /* Flags to keep track on whether an HBCI action is running or
-     not. */
-  gboolean keepAlive;
-  PMon_state state;
+    /* Flags to keep track on whether an HBCI action is running or
+       not. */
+    gboolean keepAlive;
+    PMon_state state;
 
-  /* Flag on Whether the PIN should be cached. */
-  gboolean cache_pin;
+    /* Flag on Whether the PIN should be cached. */
+    gboolean cache_pin;
 
-  /* Dialogs */
-  int showbox_id;
-  GHashTable *showbox_hash; 
-  GtkWidget *showbox_last;
+    /* Dialogs */
+    int showbox_id;
+    GHashTable *showbox_hash;
+    GtkWidget *showbox_last;
 
-  /* Flag whether the last dialog showed any error */
-  gboolean msgBoxError;
-  /* Cache the lowest loglevel, corresponding to the most serious
-     warning. */
-  AB_BANKING_LOGLEVEL min_loglevel;
+    /* Flag whether the last dialog showed any error */
+    gboolean msgBoxError;
+    /* Cache the lowest loglevel, corresponding to the most serious
+       warning. */
+    AB_BANKING_LOGLEVEL min_loglevel;
 };
 
 void delete_GNCInteractor (GNCInteractor *data);

Modified: gnucash/trunk/src/import-export/hbci/test/test-link-module.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/test/test-link-module.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/hbci/test/test-link-module.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,6 +1,6 @@
 int
-main(int argc, char ** argv) 
+main(int argc, char ** argv)
 {
-  return 0;
+    return 0;
 }
 

Modified: gnucash/trunk/src/import-export/import-account-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-account-matcher.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-account-matcher.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -47,233 +47,238 @@
  *   Structs   *
 \********************************************************************/
 
-struct _accountpickerdialog {
-  GtkWidget       * dialog;
-  GncTreeViewAccount *account_tree;
-  GtkWidget       * account_tree_sw;
-  const gchar * account_human_description;
-  const gchar * account_online_id_value;
-  gnc_commodity * new_account_default_commodity;
-  GNCAccountType new_account_default_type;
+struct _accountpickerdialog
+{
+    GtkWidget       * dialog;
+    GncTreeViewAccount *account_tree;
+    GtkWidget       * account_tree_sw;
+    const gchar * account_human_description;
+    const gchar * account_online_id_value;
+    gnc_commodity * new_account_default_commodity;
+    GNCAccountType new_account_default_type;
 };
 
 /*-******************************************************************\
  * Functions needed by gnc_import_select_account
- * 
+ *
 \********************************************************************/
 
 static void
 build_acct_tree(struct _accountpickerdialog * picker)
 {
-  GtkTreeView *account_tree;
-  GtkTreeViewColumn *col;
+    GtkTreeView *account_tree;
+    GtkTreeViewColumn *col;
 
-  /* Build a new account tree */
-  DEBUG("Begin");
-  account_tree = gnc_tree_view_account_new(FALSE);
-  picker->account_tree = GNC_TREE_VIEW_ACCOUNT(account_tree);
-  gtk_tree_view_set_headers_visible (account_tree, TRUE);
+    /* Build a new account tree */
+    DEBUG("Begin");
+    account_tree = gnc_tree_view_account_new(FALSE);
+    picker->account_tree = GNC_TREE_VIEW_ACCOUNT(account_tree);
+    gtk_tree_view_set_headers_visible (account_tree, TRUE);
 
-  col = gnc_tree_view_find_column_by_name(GNC_TREE_VIEW(account_tree), "type");
-  g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
+    col = gnc_tree_view_find_column_by_name(GNC_TREE_VIEW(account_tree), "type");
+    g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
 
-  /* Add our custom column. */
-  col = gnc_tree_view_account_add_kvp_column (picker->account_tree,
-					_("Account ID"), "online_id");
-  g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
+    /* Add our custom column. */
+    col = gnc_tree_view_account_add_kvp_column (picker->account_tree,
+            _("Account ID"), "online_id");
+    g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
 
-  gtk_container_add(GTK_CONTAINER(picker->account_tree_sw),
-		    GTK_WIDGET(picker->account_tree));
+    gtk_container_add(GTK_CONTAINER(picker->account_tree_sw),
+                      GTK_WIDGET(picker->account_tree));
 
-  /* Configure the columns */
-  gnc_tree_view_configure_columns (GNC_TREE_VIEW(picker->account_tree));
-  g_object_set(account_tree,
-               "gconf-section", GCONF_SECTION,
-               "show-column-menu", TRUE,
-               (gchar*) NULL);
+    /* Configure the columns */
+    gnc_tree_view_configure_columns (GNC_TREE_VIEW(picker->account_tree));
+    g_object_set(account_tree,
+                 "gconf-section", GCONF_SECTION,
+                 "show-column-menu", TRUE,
+                 (gchar*) NULL);
 }
 
 /* When user clicks to create a new account */
 static void
 gnc_import_add_account(struct _accountpickerdialog * picker)
 {
-  Account *selected_account, *new_account;
-  GList * valid_types = NULL;
-  /*DEBUG("Begin");  */
+    Account *selected_account, *new_account;
+    GList * valid_types = NULL;
+    /*DEBUG("Begin");  */
 
-  if(picker->new_account_default_type!=ACCT_TYPE_NONE)
+    if (picker->new_account_default_type != ACCT_TYPE_NONE)
     {
-      /*Yes, this is weird, but we really DO want to pass the value instead of the pointer...*/
-      valid_types = g_list_prepend(valid_types, GINT_TO_POINTER(picker->new_account_default_type));
+        /*Yes, this is weird, but we really DO want to pass the value instead of the pointer...*/
+        valid_types = g_list_prepend(valid_types, GINT_TO_POINTER(picker->new_account_default_type));
     }
-  selected_account = gnc_tree_view_account_get_selected_account(picker->account_tree);
-  new_account = gnc_ui_new_accounts_from_name_with_defaults ( picker->account_human_description,
-							      valid_types,
-							      picker->new_account_default_commodity,
-							      selected_account);
-  g_list_free(valid_types);
-  gnc_tree_view_account_set_selected_account(picker->account_tree, new_account);
+    selected_account = gnc_tree_view_account_get_selected_account(picker->account_tree);
+    new_account = gnc_ui_new_accounts_from_name_with_defaults ( picker->account_human_description,
+                  valid_types,
+                  picker->new_account_default_commodity,
+                  selected_account);
+    g_list_free(valid_types);
+    gnc_tree_view_account_set_selected_account(picker->account_tree, new_account);
 }
 
 /* When user double-clicks an account */
 static void
 account_tree_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
-			      GtkTreeViewColumn *column,
-			      struct _accountpickerdialog *picker)
+                              GtkTreeViewColumn *column,
+                              struct _accountpickerdialog *picker)
 {
-  g_return_if_fail(picker && picker->dialog);
+    g_return_if_fail(picker && picker->dialog);
 
-  gtk_dialog_response(GTK_DIALOG(picker->dialog), GTK_RESPONSE_OK);
+    gtk_dialog_response(GTK_DIALOG(picker->dialog), GTK_RESPONSE_OK);
 }
 
 static gpointer test_acct_online_id_match(Account *acct, gpointer param_online_id)
 {
-  const gchar * current_online_id = gnc_import_get_acc_online_id(acct);
-  if( (current_online_id != NULL
-       && param_online_id != NULL )
-      && strcmp( current_online_id, param_online_id ) == 0 )
+    const gchar * current_online_id = gnc_import_get_acc_online_id(acct);
+    if ( (current_online_id != NULL
+            && param_online_id != NULL )
+            && strcmp( current_online_id, param_online_id ) == 0 )
     {
-      return (gpointer *) acct;
+        return (gpointer *) acct;
     }
-  else
+    else
     {
-      return NULL;
+        return NULL;
     }
 }
 
 Account * gnc_import_select_account(gncUIWidget parent,
-				    const gchar * account_online_id_value,
-				    gboolean auto_create,
-				    const gchar * account_human_description,
-				    gnc_commodity * new_account_default_commodity,
-				    GNCAccountType new_account_default_type,
-				    Account * default_selection,
-				    gboolean * ok_pressed)
+                                    const gchar * account_online_id_value,
+                                    gboolean auto_create,
+                                    const gchar * account_human_description,
+                                    gnc_commodity * new_account_default_commodity,
+                                    GNCAccountType new_account_default_type,
+                                    Account * default_selection,
+                                    gboolean * ok_pressed)
 {
-  #define ACCOUNT_DESCRIPTION_MAX_SIZE 255
-  struct _accountpickerdialog * picker;
-  gint response;
-  Account * retval = NULL;
-  const gchar *retval_name = NULL;
-  GladeXML *xml;
-  GtkWidget * online_id_label, *button;
-  gchar account_description_text[ACCOUNT_DESCRIPTION_MAX_SIZE] = "";
-  gboolean ok_pressed_retval = FALSE;
+#define ACCOUNT_DESCRIPTION_MAX_SIZE 255
+    struct _accountpickerdialog * picker;
+    gint response;
+    Account * retval = NULL;
+    const gchar *retval_name = NULL;
+    GladeXML *xml;
+    GtkWidget * online_id_label, *button;
+    gchar account_description_text[ACCOUNT_DESCRIPTION_MAX_SIZE] = "";
+    gboolean ok_pressed_retval = FALSE;
 
-  ENTER("Default commodity received: %s",gnc_commodity_get_fullname( new_account_default_commodity));
-  DEBUG("Default account type received: %s",xaccAccountGetTypeStr( new_account_default_type));
-  picker = g_new0(struct _accountpickerdialog, 1);
+    ENTER("Default commodity received: %s", gnc_commodity_get_fullname( new_account_default_commodity));
+    DEBUG("Default account type received: %s", xaccAccountGetTypeStr( new_account_default_type));
+    picker = g_new0(struct _accountpickerdialog, 1);
 
-  picker->account_online_id_value = account_online_id_value;
-  picker->account_human_description =  account_human_description;
-  picker->new_account_default_commodity = new_account_default_commodity;
-  picker->new_account_default_type = new_account_default_type;
+    picker->account_online_id_value = account_online_id_value;
+    picker->account_human_description =  account_human_description;
+    picker->new_account_default_commodity = new_account_default_commodity;
+    picker->new_account_default_type = new_account_default_type;
 
-  /*DEBUG("Looking for account with online_id: %s", account_online_id_value);*/
-  if(account_online_id_value!=NULL)
+    /*DEBUG("Looking for account with online_id: %s", account_online_id_value);*/
+    if (account_online_id_value != NULL)
     {
-      retval =
-	gnc_account_foreach_descendant_until(gnc_get_current_root_account (),
-				       test_acct_online_id_match,
-				       /* This argument will only be
-					  used as a "const char*" */
-				       (void*)account_online_id_value);
+        retval =
+            gnc_account_foreach_descendant_until(gnc_get_current_root_account (),
+                    test_acct_online_id_match,
+                    /* This argument will only be
+                    					  used as a "const char*" */
+                    (void*)account_online_id_value);
     }
-  if(retval==NULL && auto_create != 0)
+    if (retval == NULL && auto_create != 0)
     {
-      /* load the interface */
-      xml = gnc_glade_xml_new ("generic-import.glade", "Generic Import Account Picker");
-      /* connect the signals in the interface */
-      if(xml==NULL)
-	{
-	  PERR("Error opening the glade interface");
-	}
-      
-      picker->dialog     = glade_xml_get_widget (xml, "Generic Import Account Picker");
-      if (parent)
-	gtk_window_set_transient_for (GTK_WINDOW (picker->dialog), 
-				      GTK_WINDOW (parent));
-      picker->account_tree_sw   = glade_xml_get_widget (xml, "account_tree_sw");
-      online_id_label = glade_xml_get_widget (xml, "online_id_label");
-      button = glade_xml_get_widget (xml, "newbutton");
-      gtk_button_set_use_stock (GTK_BUTTON(button), TRUE);
+        /* load the interface */
+        xml = gnc_glade_xml_new ("generic-import.glade", "Generic Import Account Picker");
+        /* connect the signals in the interface */
+        if (xml == NULL)
+        {
+            PERR("Error opening the glade interface");
+        }
 
-      //printf("gnc_import_select_account(): Fin get widget\n");
+        picker->dialog     = glade_xml_get_widget (xml, "Generic Import Account Picker");
+        if (parent)
+            gtk_window_set_transient_for (GTK_WINDOW (picker->dialog),
+                                          GTK_WINDOW (parent));
+        picker->account_tree_sw   = glade_xml_get_widget (xml, "account_tree_sw");
+        online_id_label = glade_xml_get_widget (xml, "online_id_label");
+        button = glade_xml_get_widget (xml, "newbutton");
+        gtk_button_set_use_stock (GTK_BUTTON(button), TRUE);
 
-      if(account_human_description!=NULL)
-	{
-	  strncat(account_description_text, account_human_description,
-		  ACCOUNT_DESCRIPTION_MAX_SIZE-strlen(account_description_text));
-	  strncat(account_description_text, "\n",
-		  ACCOUNT_DESCRIPTION_MAX_SIZE-strlen(account_description_text));
-	}
-      if(account_online_id_value!=NULL)
-	{
-	  strncat(account_description_text,_("(Full account ID: "),
-		  ACCOUNT_DESCRIPTION_MAX_SIZE-strlen(account_description_text));
-	  strncat(account_description_text, account_online_id_value,
-		  ACCOUNT_DESCRIPTION_MAX_SIZE-strlen(account_description_text));
-	  strncat(account_description_text, ")",
-		  ACCOUNT_DESCRIPTION_MAX_SIZE-strlen(account_description_text));
-	}
-      gtk_label_set_text((GtkLabel*)online_id_label, account_description_text);
-      build_acct_tree(picker);
-      gnc_tree_view_account_set_selected_account(picker->account_tree, default_selection);
+        //printf("gnc_import_select_account(): Fin get widget\n");
 
-      gtk_window_set_modal(GTK_WINDOW(picker->dialog), TRUE);
-      g_signal_connect(picker->account_tree, "row-activated",
-		       G_CALLBACK(account_tree_row_activated_cb), picker);
-      do {
-	response = gtk_dialog_run(GTK_DIALOG(picker->dialog));
-	switch (response) {
-	 case GTK_RESPONSE_OK:
-	  retval = gnc_tree_view_account_get_selected_account(picker->account_tree);
-	  if (retval)
-	    retval_name = xaccAccountGetName(retval);
-	  if (!retval_name)
-	    retval_name = "(null)";
-	  DEBUG("Selected account %p, %s", retval, retval_name);
+        if (account_human_description != NULL)
+        {
+            strncat(account_description_text, account_human_description,
+                    ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
+            strncat(account_description_text, "\n",
+                    ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
+        }
+        if (account_online_id_value != NULL)
+        {
+            strncat(account_description_text, _("(Full account ID: "),
+                    ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
+            strncat(account_description_text, account_online_id_value,
+                    ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
+            strncat(account_description_text, ")",
+                    ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
+        }
+        gtk_label_set_text((GtkLabel*)online_id_label, account_description_text);
+        build_acct_tree(picker);
+        gnc_tree_view_account_set_selected_account(picker->account_tree, default_selection);
 
-	  /* See if the selected account is a placeholder. */
-	  if (retval && xaccAccountGetPlaceholder (retval)) {
-	    gnc_error_dialog
-	      (picker->dialog,
-	       _("The account %s is a placeholder account and does not allow "
-		 "transactions. Please choose a different account."),
-	       retval_name);
-	    response = GNC_RESPONSE_NEW;
-	    break;
-	  }
+        gtk_window_set_modal(GTK_WINDOW(picker->dialog), TRUE);
+        g_signal_connect(picker->account_tree, "row-activated",
+                         G_CALLBACK(account_tree_row_activated_cb), picker);
+        do
+        {
+            response = gtk_dialog_run(GTK_DIALOG(picker->dialog));
+            switch (response)
+            {
+            case GTK_RESPONSE_OK:
+                retval = gnc_tree_view_account_get_selected_account(picker->account_tree);
+                if (retval)
+                    retval_name = xaccAccountGetName(retval);
+                if (!retval_name)
+                    retval_name = "(null)";
+                DEBUG("Selected account %p, %s", retval, retval_name);
 
-	  if( account_online_id_value != NULL)
-	    {
-	      gnc_import_set_acc_online_id(retval, account_online_id_value);
-	    }
-	  ok_pressed_retval=TRUE;
-	  break;
-	 case GNC_RESPONSE_NEW:
-	  gnc_import_add_account(picker);
-	  break;
-	 default:
-	  ok_pressed_retval=FALSE;
-	  break;
-	}
-      } while (response == GNC_RESPONSE_NEW);
-      gtk_widget_destroy(picker->dialog);
+                /* See if the selected account is a placeholder. */
+                if (retval && xaccAccountGetPlaceholder (retval))
+                {
+                    gnc_error_dialog
+                    (picker->dialog,
+                     _("The account %s is a placeholder account and does not allow "
+                       "transactions. Please choose a different account."),
+                     retval_name);
+                    response = GNC_RESPONSE_NEW;
+                    break;
+                }
+
+                if ( account_online_id_value != NULL)
+                {
+                    gnc_import_set_acc_online_id(retval, account_online_id_value);
+                }
+                ok_pressed_retval = TRUE;
+                break;
+            case GNC_RESPONSE_NEW:
+                gnc_import_add_account(picker);
+                break;
+            default:
+                ok_pressed_retval = FALSE;
+                break;
+            }
+        }
+        while (response == GNC_RESPONSE_NEW);
+        gtk_widget_destroy(picker->dialog);
     }
-  else
+    else
     {
-      retval_name = xaccAccountGetName(retval);
-      ok_pressed_retval=TRUE; /* There was no dialog involved, so the computer "pressed" ok */
-    }   
-  /*FIXME: DEBUG("WRITEME: gnc_import_select_account() Here we should check if account type is compatible, currency matches, etc.\n"); */
-  g_free(picker);
-  /*DEBUG("Return value: %p%s%s%s",retval,", account name:",xaccAccountGetName(retval),"\n");*/
-  if(ok_pressed!=NULL)
+        retval_name = xaccAccountGetName(retval);
+        ok_pressed_retval = TRUE; /* There was no dialog involved, so the computer "pressed" ok */
+    }
+    /*FIXME: DEBUG("WRITEME: gnc_import_select_account() Here we should check if account type is compatible, currency matches, etc.\n"); */
+    g_free(picker);
+    /*DEBUG("Return value: %p%s%s%s",retval,", account name:",xaccAccountGetName(retval),"\n");*/
+    if (ok_pressed != NULL)
     {
-      *ok_pressed=ok_pressed_retval;
+        *ok_pressed = ok_pressed_retval;
     }
-  LEAVE("Selected account %p, %s", retval, retval_name ? retval_name : "(null)");
-  return retval;
+    LEAVE("Selected account %p, %s", retval, retval_name ? retval_name : "(null)");
+    return retval;
 }
 /**@}*/

Modified: gnucash/trunk/src/import-export/import-account-matcher.h
===================================================================
--- gnucash/trunk/src/import-export/import-account-matcher.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-account-matcher.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,7 +24,7 @@
  */
 #ifndef ACCOUNT_MATCHER_H
 #define ACCOUNT_MATCHER_H
- 
+
 #include "Account.h"
 #include "gnc-ui-common.h"
 
@@ -44,11 +44,11 @@
     normal mode of operation. Can be NULL.
 
     If account_online_id_value==NULL, you basically end up with an account
-    selector that allows you to select an account whose GUID will be 
+    selector that allows you to select an account whose GUID will be
     remembered elsewhere.  You would fill account_human_description to tell
     the user what he is looking for.  In this mode, the  online_id
     kvp_frame of the found account will not be touched.  To use this mode,
-    auto_create must NOT be set to 0.  
+    auto_create must NOT be set to 0.
 
     @param account_human_description
 	 A human-readable description of
@@ -70,7 +70,7 @@
     ACCT_TYPE_NONE, the function will also warn the user if the found
     or created account's commodity doesn't match.
 
-    @param auto_create 
+    @param auto_create
          Only active if no account with the
     account_online_id_value could be found in gnucash, or if online-id
     was NULL. In that case, if auto_create is TRUE (nonzero), the user
@@ -78,26 +78,26 @@
     (zero), this function will simply return NULL but will neither
     select nor create any account.
 
-    @param default_selection If not NULL, that account will be 
+    @param default_selection If not NULL, that account will be
     pre-selected by default.
 
     @param ok_pressed A pointer to gboolean.  If non-NULL, whether or
     not the picker dialog was closed by the user pressing ok will be
-    stored in the parameter.  If no dialog was created by the  
+    stored in the parameter.  If no dialog was created by the
     gnc_import_select_account() call, TRUE is always returned.
 
   @return A pointer to the found or created Account, or NULL if no
   account was found or created.
 */
 Account * gnc_import_select_account(gncUIWidget parent,
-				    const gchar * account_online_id_value,
-				    gboolean auto_create,
-				    const gchar * account_human_description,
-				    gnc_commodity * new_account_default_commodity,
-				    GNCAccountType new_account_default_type,
-				    Account * default_selection,
-				    gboolean * ok_pressed
-				    );
+                                    const gchar * account_online_id_value,
+                                    gboolean auto_create,
+                                    const gchar * account_human_description,
+                                    gnc_commodity * new_account_default_commodity,
+                                    GNCAccountType new_account_default_type,
+                                    Account * default_selection,
+                                    gboolean * ok_pressed
+                                   );
 
 #endif
 /**@}*/

Modified: gnucash/trunk/src/import-export/import-backend.c
===================================================================
--- gnucash/trunk/src/import-export/import-backend.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-backend.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -25,12 +25,12 @@
     @author Christian Stimming
     @author Copyright (c) 2006 David Hampton <hampton at employees.org>
 */
- 
+
 #include "config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
-#include <stdlib.h> 
+#include <stdlib.h>
 #include <math.h>
 
 #include <errno.h>
@@ -56,7 +56,7 @@
  *   Constants, should ideally be defined a user preference dialog  *
 \********************************************************************/
 
-static const int MATCH_DATE_THRESHOLD=4; /*within 4 days*/
+static const int MATCH_DATE_THRESHOLD = 4; /*within 4 days*/
 static const int MATCH_DATE_NOT_THRESHOLD = 14;
 
 /********************************************************************\
@@ -64,9 +64,9 @@
 \********************************************************************/
 
 static void
-matchmap_store_destination (GncImportMatchMap *matchmap, 
-			    GNCImportTransInfo *trans_info,
-			    gboolean use_match);
+matchmap_store_destination (GncImportMatchMap *matchmap,
+                            GNCImportTransInfo *trans_info,
+                            gboolean use_match);
 
 
 /********************************************************************\
@@ -75,31 +75,31 @@
 
 struct _transactioninfo
 {
-  Transaction * trans;
-  Split * first_split;
+    Transaction * trans;
+    Split * first_split;
 
-  /* GList of GNCImportMatchInfo's, one for each possible duplicate match. */
-  GList * match_list;
-  GNCImportMatchInfo * selected_match_info;
-  gboolean match_selected_manually;
+    /* GList of GNCImportMatchInfo's, one for each possible duplicate match. */
+    GList * match_list;
+    GNCImportMatchInfo * selected_match_info;
+    gboolean match_selected_manually;
 
-  GNCImportAction action;
-  GNCImportAction previous_action;
+    GNCImportAction action;
+    GNCImportAction previous_action;
 
-  /* A list of tokenized strings to use for bayesian matching purposes */
-  GList * match_tokens;
+    /* A list of tokenized strings to use for bayesian matching purposes */
+    GList * match_tokens;
 
-  /* In case of a single destination account it is stored here. */
-  Account *dest_acc;
-  gboolean dest_acc_selected_manually;
+    /* In case of a single destination account it is stored here. */
+    Account *dest_acc;
+    gboolean dest_acc_selected_manually;
 };
 
 struct _matchinfo
 {
-  Transaction * trans;
-  Split * split;
-  /*GNC_match_probability probability;*/
-  gint probability;
+    Transaction * trans;
+    Split * split;
+    /*GNC_match_probability probability;*/
+    gint probability;
 };
 
 /* Some simple getters and setters for the above data types. */
@@ -107,246 +107,247 @@
 GList *
 gnc_import_TransInfo_get_match_list (const GNCImportTransInfo *info)
 {
-  g_assert (info);
-  return info->match_list;
+    g_assert (info);
+    return info->match_list;
 }
 
 Transaction *
 gnc_import_TransInfo_get_trans (const GNCImportTransInfo *info)
 {
-  g_assert (info);
-  return info->trans;
+    g_assert (info);
+    return info->trans;
 }
 
-gboolean 
+gboolean
 gnc_import_TransInfo_is_balanced (const GNCImportTransInfo *info)
 {
- g_assert (info);
- /* Assume that the importer won't create a transaction that involves two or more
-    currencies and no non-currency commodity.  In that case can use the simpler
-    value imbalance check. */
- if(gnc_numeric_zero_p(xaccTransGetImbalanceValue(gnc_import_TransInfo_get_trans(info))))
-   {
-     return TRUE;
-   }
- else
-   {
-     return FALSE;
-   }
+    g_assert (info);
+    /* Assume that the importer won't create a transaction that involves two or more
+       currencies and no non-currency commodity.  In that case can use the simpler
+       value imbalance check. */
+    if (gnc_numeric_zero_p(xaccTransGetImbalanceValue(gnc_import_TransInfo_get_trans(info))))
+    {
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 
 Split *
 gnc_import_TransInfo_get_fsplit (const GNCImportTransInfo *info)
 {
-  g_assert (info);
-  return info->first_split;
+    g_assert (info);
+    return info->first_split;
 }
 
 GNCImportMatchInfo *
 gnc_import_TransInfo_get_selected_match (const GNCImportTransInfo *info)
 {
-  g_assert (info);
-  return info->selected_match_info;
+    g_assert (info);
+    return info->selected_match_info;
 }
 
 void
 gnc_import_TransInfo_set_selected_match (GNCImportTransInfo *info,
-					 GNCImportMatchInfo *match,
-					 gboolean selected_manually)
+        GNCImportMatchInfo *match,
+        gboolean selected_manually)
 {
-  g_assert (info);
-  info->selected_match_info = match;
-  info->match_selected_manually = selected_manually;
+    g_assert (info);
+    info->selected_match_info = match;
+    info->match_selected_manually = selected_manually;
 }
 
 gboolean
 gnc_import_TransInfo_get_match_selected_manually (const GNCImportTransInfo *info)
 {
-  g_assert (info);
-  return info->match_selected_manually;
+    g_assert (info);
+    return info->match_selected_manually;
 }
 
 GNCImportAction
 gnc_import_TransInfo_get_action (const GNCImportTransInfo *info)
 {
-  g_assert (info);
-  return info->action;
+    g_assert (info);
+    return info->action;
 }
 
 void
-gnc_import_TransInfo_set_action (GNCImportTransInfo *info, 
-				 GNCImportAction action)
+gnc_import_TransInfo_set_action (GNCImportTransInfo *info,
+                                 GNCImportAction action)
 {
-  g_assert (info);
-  if(action!=info->action)
+    g_assert (info);
+    if (action != info->action)
     {
-      info->previous_action = info->action;
-      info->action = action;
+        info->previous_action = info->action;
+        info->action = action;
     }
 }
 
 Account *
 gnc_import_TransInfo_get_destacc (const GNCImportTransInfo *info)
 {
-  g_assert (info);
-  return info->dest_acc;
+    g_assert (info);
+    return info->dest_acc;
 }
-void gnc_import_TransInfo_set_destacc (GNCImportTransInfo *info, 
-				       Account *acc,
-				       gboolean selected_manually)
+void gnc_import_TransInfo_set_destacc (GNCImportTransInfo *info,
+                                       Account *acc,
+                                       gboolean selected_manually)
 {
-  g_assert (info);
-  info->dest_acc = acc;
-  info->dest_acc_selected_manually = selected_manually;
+    g_assert (info);
+    info->dest_acc = acc;
+    info->dest_acc_selected_manually = selected_manually;
 
-  /* Store the mapping to the other account in the MatchMap. */
-  if(selected_manually)
+    /* Store the mapping to the other account in the MatchMap. */
+    if (selected_manually)
     {
-      matchmap_store_destination (NULL, info, FALSE);
+        matchmap_store_destination (NULL, info, FALSE);
     }
 }
 
 gboolean
 gnc_import_TransInfo_get_destacc_selected_manually (const GNCImportTransInfo *info)
 {
-  g_assert (info);
-  return info->dest_acc_selected_manually;
+    g_assert (info);
+    return info->dest_acc_selected_manually;
 }
 
-Split * 
+Split *
 gnc_import_MatchInfo_get_split (const GNCImportMatchInfo * info)
 {
-  g_assert (info);
-  return info->split;
+    g_assert (info);
+    return info->split;
 }
 
-gint 
+gint
 gnc_import_MatchInfo_get_probability (const GNCImportMatchInfo * info)
 {
-  if(info)
+    if (info)
     {
-      return info->probability;
+        return info->probability;
     }
-  else
+    else
     {
-      return 0;
+        return 0;
     }
 }
 
 void gnc_import_TransInfo_delete (GNCImportTransInfo *info)
 {
-  if (info) {
-    g_list_free (info->match_list);
-    /*If the transaction exists and is still open, it must be destroyed*/
-    if(info->trans && xaccTransIsOpen(info->trans))
-      {
-        xaccTransDestroy(info->trans);
-        xaccTransCommitEdit(info->trans);
-      }
-    if (info->match_tokens)
-      {
-        GList *node;
+    if (info)
+    {
+        g_list_free (info->match_list);
+        /*If the transaction exists and is still open, it must be destroyed*/
+        if (info->trans && xaccTransIsOpen(info->trans))
+        {
+            xaccTransDestroy(info->trans);
+            xaccTransCommitEdit(info->trans);
+        }
+        if (info->match_tokens)
+        {
+            GList *node;
 
-        for (node = info->match_tokens; node; node = node->next)
-          g_free (node->data);
+            for (node = info->match_tokens; node; node = node->next)
+                g_free (node->data);
 
-        g_list_free (info->match_tokens);
-      }
-    g_free(info);
-  }
+            g_list_free (info->match_tokens);
+        }
+        g_free(info);
+    }
 }
 
 GdkPixbuf* gen_probability_pixbuf(gint score_original, GNCImportSettings *settings, GtkWidget * widget)
 {
-  GdkPixbuf* retval = NULL;
-  gint i, j;
-  gint score;
-  const gint height = 15;
-  const gint width_each_bar = 7;
-  gchar * green_bar = ("bggggb ");
-  gchar * yellow_bar = ("byyyyb ");
-  gchar * red_bar = ("brrrrb ");
-  gchar * black_bar = ("bbbbbb ");
-  const gint width_first_bar = 1;
-  gchar * black_first_bar = ("b");
-  const gint num_colors = 5;
-  gchar * size_str;
-  gchar * none_color_str = g_strdup_printf("  c None");
-  gchar * green_color_str = g_strdup_printf("g c green");
-  gchar * yellow_color_str = g_strdup_printf("y c yellow");
-  gchar * red_color_str = g_strdup_printf("r c red");
-  gchar * black_color_str = g_strdup_printf("b c black");
-  gchar * xpm[2+num_colors+height];
-  gint add_threshold, clear_threshold;
+    GdkPixbuf* retval = NULL;
+    gint i, j;
+    gint score;
+    const gint height = 15;
+    const gint width_each_bar = 7;
+    gchar * green_bar = ("bggggb ");
+    gchar * yellow_bar = ("byyyyb ");
+    gchar * red_bar = ("brrrrb ");
+    gchar * black_bar = ("bbbbbb ");
+    const gint width_first_bar = 1;
+    gchar * black_first_bar = ("b");
+    const gint num_colors = 5;
+    gchar * size_str;
+    gchar * none_color_str = g_strdup_printf("  c None");
+    gchar * green_color_str = g_strdup_printf("g c green");
+    gchar * yellow_color_str = g_strdup_printf("y c yellow");
+    gchar * red_color_str = g_strdup_printf("r c red");
+    gchar * black_color_str = g_strdup_printf("b c black");
+    gchar * xpm[2+num_colors+height];
+    gint add_threshold, clear_threshold;
 
-  g_assert(settings);
-  g_assert(widget);
-  if (score_original < 0)
+    g_assert(settings);
+    g_assert(widget);
+    if (score_original < 0)
     {
-      score = 0;
+        score = 0;
     }
-  else
+    else
     {
-      score=score_original;
+        score = score_original;
     }
-  size_str = g_strdup_printf("%d%s%d%s%d%s",(width_each_bar*score)+width_first_bar/*width*/," ",height," ",num_colors," 1"/*characters per pixel*/);
+    size_str = g_strdup_printf("%d%s%d%s%d%s", (width_each_bar * score) + width_first_bar/*width*/, " ", height, " ", num_colors, " 1"/*characters per pixel*/);
 
-  /*DEBUG("Begin");*/
-  xpm[0]=size_str;
-  xpm[1]=none_color_str;
-  xpm[2]=green_color_str;
-  xpm[3]=yellow_color_str;
-  xpm[4]=red_color_str; 
-  xpm[5]=black_color_str;
-  add_threshold = gnc_import_Settings_get_add_threshold(settings);
-  clear_threshold = gnc_import_Settings_get_clear_threshold(settings);
+    /*DEBUG("Begin");*/
+    xpm[0] = size_str;
+    xpm[1] = none_color_str;
+    xpm[2] = green_color_str;
+    xpm[3] = yellow_color_str;
+    xpm[4] = red_color_str;
+    xpm[5] = black_color_str;
+    add_threshold = gnc_import_Settings_get_add_threshold(settings);
+    clear_threshold = gnc_import_Settings_get_clear_threshold(settings);
 
-  for(i=0;i<height;i++)
+    for (i = 0; i < height; i++)
     {
-      xpm[num_colors+1+i]= g_new0(char,(width_each_bar*score)+width_first_bar+1);
-      for(j=0;j<=score;j++)
-	{
-	  if(i==0||i==height-1)
-	    {
-	      if (j==0)
-		{
-		  strcat(xpm[num_colors+1+i],black_first_bar);
-		}
-	      else
-		{
-	      strcat(xpm[num_colors+1+i],black_bar);
-		}
-	    }
-	  else
-	    {
-	      if (j==0)
-		{
-		  strcat(xpm[num_colors+1+i],black_first_bar);
-		}
-	      else if (j <= add_threshold)
-		{
-		  strcat(xpm[num_colors+1+i],red_bar);
-		}
-	      else if (j >= clear_threshold)
-		{
-		  strcat(xpm[num_colors+1+i],green_bar);
-		}
-	      else
-		{
-		  strcat(xpm[num_colors+1+i],yellow_bar);
-		}
-	    }
-	}
-    }  
-  
-  retval =  gdk_pixbuf_new_from_xpm_data((const gchar **)xpm);
-  for(i=0;i<=num_colors+height;i++)
-    { 
-      /*DEBUG("free_loop i=%d%s%s",i,": ",xpm[i]);*/
-      g_free(xpm[i]);
+        xpm[num_colors+1+i] = g_new0(char, (width_each_bar * score) + width_first_bar + 1);
+        for (j = 0; j <= score; j++)
+        {
+            if (i == 0 || i == height - 1)
+            {
+                if (j == 0)
+                {
+                    strcat(xpm[num_colors+1+i], black_first_bar);
+                }
+                else
+                {
+                    strcat(xpm[num_colors+1+i], black_bar);
+                }
+            }
+            else
+            {
+                if (j == 0)
+                {
+                    strcat(xpm[num_colors+1+i], black_first_bar);
+                }
+                else if (j <= add_threshold)
+                {
+                    strcat(xpm[num_colors+1+i], red_bar);
+                }
+                else if (j >= clear_threshold)
+                {
+                    strcat(xpm[num_colors+1+i], green_bar);
+                }
+                else
+                {
+                    strcat(xpm[num_colors+1+i], yellow_bar);
+                }
+            }
+        }
     }
-  
-  return retval;
+
+    retval =  gdk_pixbuf_new_from_xpm_data((const gchar **)xpm);
+    for (i = 0; i <= num_colors + height; i++)
+    {
+        /*DEBUG("free_loop i=%d%s%s",i,": ",xpm[i]);*/
+        g_free(xpm[i]);
+    }
+
+    return retval;
 }
 
 /*************************************************************************
@@ -359,83 +360,83 @@
 static GList*
 tokenize_string(GList* existing_tokens, const char *string)
 {
-  char **tokenized_strings; /* array of strings returned by g_strsplit() */
-  char **stringpos;
+    char **tokenized_strings; /* array of strings returned by g_strsplit() */
+    char **stringpos;
 
-  tokenized_strings = g_strsplit(string, " ", 0);
-  stringpos = tokenized_strings;
+    tokenized_strings = g_strsplit(string, " ", 0);
+    stringpos = tokenized_strings;
 
-  /* add each token to the token GList */
-  while(stringpos && *stringpos)
-  {
-    /* prepend the char* to the token GList */
-    existing_tokens = g_list_prepend(existing_tokens, g_strdup(*stringpos));
+    /* add each token to the token GList */
+    while (stringpos && *stringpos)
+    {
+        /* prepend the char* to the token GList */
+        existing_tokens = g_list_prepend(existing_tokens, g_strdup(*stringpos));
 
-    /* then move to the next string */
-    stringpos++;
-  }
+        /* then move to the next string */
+        stringpos++;
+    }
 
-  /* free up the strings that g_strsplit() created */
-  g_strfreev(tokenized_strings);
+    /* free up the strings that g_strsplit() created */
+    g_strfreev(tokenized_strings);
 
-  return existing_tokens;
+    return existing_tokens;
 }
 
 /* create and return a list of tokens for a given transaction info. */
 static GList*
 TransactionGetTokens(GNCImportTransInfo *info)
 {
-  Transaction* transaction;
-  GList* tokens;
-  const char* text;
-  time_t transtime;
-  struct tm *tm_struct;
-  char local_day_of_week[16];
-  Split* split;
-  int split_index;
+    Transaction* transaction;
+    GList* tokens;
+    const char* text;
+    time_t transtime;
+    struct tm *tm_struct;
+    char local_day_of_week[16];
+    Split* split;
+    int split_index;
 
-  g_return_val_if_fail (info, NULL);
-  if (info->match_tokens) return info->match_tokens;
+    g_return_val_if_fail (info, NULL);
+    if (info->match_tokens) return info->match_tokens;
 
-  transaction = gnc_import_TransInfo_get_trans(info);
-  g_assert(transaction);
+    transaction = gnc_import_TransInfo_get_trans(info);
+    g_assert(transaction);
 
-  tokens = 0; /* start off with an empty list */
+    tokens = 0; /* start off with an empty list */
 
-  /* make tokens from the transaction description */
-  text = xaccTransGetDescription(transaction);
-  tokens = tokenize_string(tokens, text);
+    /* make tokens from the transaction description */
+    text = xaccTransGetDescription(transaction);
+    tokens = tokenize_string(tokens, text);
 
-  /* The day of week the transaction occured is a good indicator of
-   * what account this transaction belongs in.  Get the date and covert
-   * it to day of week as a token
-   */
-  transtime = xaccTransGetDate(transaction);
-  tm_struct = gmtime(&transtime);
-  if(!qof_strftime(local_day_of_week, sizeof(local_day_of_week), "%A", tm_struct))
+    /* The day of week the transaction occured is a good indicator of
+     * what account this transaction belongs in.  Get the date and covert
+     * it to day of week as a token
+     */
+    transtime = xaccTransGetDate(transaction);
+    tm_struct = gmtime(&transtime);
+    if (!qof_strftime(local_day_of_week, sizeof(local_day_of_week), "%A", tm_struct))
     {
-      PERR("TransactionGetTokens: error, strftime failed\n");
+        PERR("TransactionGetTokens: error, strftime failed\n");
     }
 
-  /* we cannot add a locally allocated string to this array, dup it so
-   * it frees the same way the rest do
-   */
-  tokens = g_list_prepend(tokens, g_strdup(local_day_of_week));
+    /* we cannot add a locally allocated string to this array, dup it so
+     * it frees the same way the rest do
+     */
+    tokens = g_list_prepend(tokens, g_strdup(local_day_of_week));
 
-  /* make tokens from the memo of each split of this transaction */
-  split_index = 0;
-  while((split = xaccTransGetSplit(transaction, split_index)))
-  {
-       text = xaccSplitGetMemo(split);
-       tokens = tokenize_string(tokens, text);
-       split_index++; /* next split */
-  }
+    /* make tokens from the memo of each split of this transaction */
+    split_index = 0;
+    while ((split = xaccTransGetSplit(transaction, split_index)))
+    {
+        text = xaccSplitGetMemo(split);
+        tokens = tokenize_string(tokens, text);
+        split_index++; /* next split */
+    }
 
-  /* remember the list of tokens for later.. */
-  info->match_tokens = tokens;
+    /* remember the list of tokens for later.. */
+    info->match_tokens = tokens;
 
-  /* return the pointer to the GList */
-  return tokens;
+    /* return the pointer to the GList */
+    return tokens;
 }
 
 /* searches using the GNCImportTransInfo through all existing transactions
@@ -444,48 +445,50 @@
 static Account *
 matchmap_find_destination (GncImportMatchMap *matchmap, GNCImportTransInfo *info)
 {
-  GncImportMatchMap *tmp_map;
-  Account *result;
-  GList* tokens;
-  gboolean useBayes;
+    GncImportMatchMap *tmp_map;
+    Account *result;
+    GList* tokens;
+    gboolean useBayes;
 
-  g_assert (info);
-  tmp_map = ((matchmap != NULL) ? matchmap : 
-	     gnc_imap_create_from_account 
-	     (xaccSplitGetAccount
-	      (gnc_import_TransInfo_get_fsplit (info))));
+    g_assert (info);
+    tmp_map = ((matchmap != NULL) ? matchmap :
+               gnc_imap_create_from_account
+               (xaccSplitGetAccount
+                (gnc_import_TransInfo_get_fsplit (info))));
 
-  useBayes = gnc_gconf_get_bool(GCONF_SECTION, BAYES_OPTION, NULL);
-  if(useBayes)
+    useBayes = gnc_gconf_get_bool(GCONF_SECTION, BAYES_OPTION, NULL);
+    if (useBayes)
     {
-      /* get the tokens for this transaction* */
-      tokens = TransactionGetTokens(info);
+        /* get the tokens for this transaction* */
+        tokens = TransactionGetTokens(info);
 
-      /* try to find the destination account for this transaction from its tokens */
-      result = gnc_imap_find_account_bayes(tmp_map, tokens);
+        /* try to find the destination account for this transaction from its tokens */
+        result = gnc_imap_find_account_bayes(tmp_map, tokens);
 
-    } else {
-      /* old system of transaction to account matching */
-      result = gnc_imap_find_account 
-        (tmp_map, GNCIMPORT_DESC, 
-         xaccTransGetDescription (gnc_import_TransInfo_get_trans (info)));
     }
+    else
+    {
+        /* old system of transaction to account matching */
+        result = gnc_imap_find_account
+                 (tmp_map, GNCIMPORT_DESC,
+                  xaccTransGetDescription (gnc_import_TransInfo_get_trans (info)));
+    }
 
-  /* Disable matching by memo, until bayesian filtering is implemented. 
-   * It's currently unlikely to help, and has adverse effects,
-   * causing false positives, since very often the type of the 
-   * transaction is stored there.
-     
-     if (result == NULL)
-     result = gnc_imap_find_account 
-     (tmp_map, GNCIMPORT_MEMO, 
-     xaccSplitGetMemo (gnc_import_TransInfo_get_fsplit (info)));
-  */
-  
-  if (matchmap == NULL)
-    gnc_imap_destroy (tmp_map);
+    /* Disable matching by memo, until bayesian filtering is implemented.
+     * It's currently unlikely to help, and has adverse effects,
+     * causing false positives, since very often the type of the
+     * transaction is stored there.
 
-  return result;
+       if (result == NULL)
+       result = gnc_imap_find_account
+       (tmp_map, GNCIMPORT_MEMO,
+       xaccSplitGetMemo (gnc_import_TransInfo_get_fsplit (info)));
+    */
+
+    if (matchmap == NULL)
+        gnc_imap_destroy (tmp_map);
+
+    return result;
 }
 
 /** Store the destination account from trans_info in the matchmap. If
@@ -493,270 +496,275 @@
     matching/duplicate transaction is used; otherwise, the stored
     destination_acc pointer is used. */
 static void
-matchmap_store_destination (GncImportMatchMap *matchmap, 
-			    GNCImportTransInfo *trans_info,
-			    gboolean use_match)
+matchmap_store_destination (GncImportMatchMap *matchmap,
+                            GNCImportTransInfo *trans_info,
+                            gboolean use_match)
 {
-  GncImportMatchMap *tmp_matchmap = NULL;
-  Account *dest;
-  const char *descr, *memo;
-  GList *tokens;
-  gboolean useBayes;
+    GncImportMatchMap *tmp_matchmap = NULL;
+    Account *dest;
+    const char *descr, *memo;
+    GList *tokens;
+    gboolean useBayes;
 
-  g_assert (trans_info);
+    g_assert (trans_info);
 
-  /* This will store the destination account of the selected match if 
-     the reconcile match selected has only two splits.  Good idea  
-     Christian! */ 
-  dest = ((use_match) ?
-	  xaccSplitGetAccount
-	  (xaccSplitGetOtherSplit 
-	   (gnc_import_MatchInfo_get_split 
-	    (gnc_import_TransInfo_get_selected_match (trans_info)))) :
-	  gnc_import_TransInfo_get_destacc (trans_info));
-  if (dest == NULL)
-    return;
-  
-  tmp_matchmap = ((matchmap != NULL) ? 
-		  matchmap : 
-		  gnc_imap_create_from_account 
-		  (xaccSplitGetAccount
-		   (gnc_import_TransInfo_get_fsplit (trans_info))));
+    /* This will store the destination account of the selected match if
+       the reconcile match selected has only two splits.  Good idea
+       Christian! */
+    dest = ((use_match) ?
+            xaccSplitGetAccount
+            (xaccSplitGetOtherSplit
+             (gnc_import_MatchInfo_get_split
+              (gnc_import_TransInfo_get_selected_match (trans_info)))) :
+            gnc_import_TransInfo_get_destacc (trans_info));
+    if (dest == NULL)
+        return;
 
-  /* see what matching system we are currently using */
-  useBayes = gnc_gconf_get_bool(GCONF_SECTION, BAYES_OPTION, NULL);
-  if(useBayes)
+    tmp_matchmap = ((matchmap != NULL) ?
+                    matchmap :
+                    gnc_imap_create_from_account
+                    (xaccSplitGetAccount
+                     (gnc_import_TransInfo_get_fsplit (trans_info))));
+
+    /* see what matching system we are currently using */
+    useBayes = gnc_gconf_get_bool(GCONF_SECTION, BAYES_OPTION, NULL);
+    if (useBayes)
     {
-      /* tokenize this transaction */
-      tokens = TransactionGetTokens(trans_info);
+        /* tokenize this transaction */
+        tokens = TransactionGetTokens(trans_info);
 
-      /* add the tokens to the imap with the given destination account */
-      gnc_imap_add_account_bayes(tmp_matchmap, tokens, dest);
+        /* add the tokens to the imap with the given destination account */
+        gnc_imap_add_account_bayes(tmp_matchmap, tokens, dest);
 
-  } else {
-    /* old matching system */
-      descr = xaccTransGetDescription 
-          (gnc_import_TransInfo_get_trans (trans_info));
-      if (descr && (strlen (descr) > 0))
-          gnc_imap_add_account (tmp_matchmap, 
-			    GNCIMPORT_DESC, 
-			    descr,
-			    dest);
-      memo = xaccSplitGetMemo 
-          (gnc_import_TransInfo_get_fsplit (trans_info));
-      if (memo && (strlen (memo) > 0))
-          gnc_imap_add_account (tmp_matchmap, 
-			    GNCIMPORT_MEMO, 
-			    memo,
-			    dest);
+    }
+    else
+    {
+        /* old matching system */
+        descr = xaccTransGetDescription
+                (gnc_import_TransInfo_get_trans (trans_info));
+        if (descr && (strlen (descr) > 0))
+            gnc_imap_add_account (tmp_matchmap,
+                                  GNCIMPORT_DESC,
+                                  descr,
+                                  dest);
+        memo = xaccSplitGetMemo
+               (gnc_import_TransInfo_get_fsplit (trans_info));
+        if (memo && (strlen (memo) > 0))
+            gnc_imap_add_account (tmp_matchmap,
+                                  GNCIMPORT_MEMO,
+                                  memo,
+                                  dest);
     } /* if(useBayes) */
 
-  if (matchmap == NULL)
-    gnc_imap_destroy (tmp_matchmap);
+    if (matchmap == NULL)
+        gnc_imap_destroy (tmp_matchmap);
 }
 
 
 
-/** @brief The transaction matching heuristics are here. 
+/** @brief The transaction matching heuristics are here.
  */
 static void split_find_match (GNCImportTransInfo * trans_info,
-			      Split * split, 
-			      gint display_threshold,
-			      double fuzzy_amount_difference)
+                              Split * split,
+                              gint display_threshold,
+                              double fuzzy_amount_difference)
 {
-  /* DEBUG("Begin"); */
-  
-  /*Ignore the split if the transaction is open for edit, meaning it
-    was just downloaded. */
-  if (xaccTransIsOpen(xaccSplitGetParent(split)) == FALSE)
+    /* DEBUG("Begin"); */
+
+    /*Ignore the split if the transaction is open for edit, meaning it
+      was just downloaded. */
+    if (xaccTransIsOpen(xaccSplitGetParent(split)) == FALSE)
     {
-      GNCImportMatchInfo * match_info;
-      gint prob = 0;
-      double downloaded_split_amount, match_split_amount;
-      time_t match_time, download_time;
-      int datediff_day;
-      Transaction *new_trans = gnc_import_TransInfo_get_trans (trans_info);
-      Split *new_trans_fsplit = gnc_import_TransInfo_get_fsplit (trans_info);
-    
-      /* Matching heuristics */
-    
-      /* Amount heuristics */
-      downloaded_split_amount = 
-	gnc_numeric_to_double (xaccSplitGetAmount(new_trans_fsplit));
-      /*DEBUG(" downloaded_split_amount=%f", downloaded_split_amount);*/
-      match_split_amount = gnc_numeric_to_double(xaccSplitGetAmount(split));
-      /*DEBUG(" match_split_amount=%f", match_split_amount);*/
-      if(fabs(downloaded_split_amount - match_split_amount) < 1e-6)
-	/* bug#347791: Double type shouldn't be compared for exact
-	   equality, so we're using fabs() instead. */
-	/*if (gnc_numeric_equal(xaccSplitGetAmount
-	  (new_trans_fsplit),
-	  xaccSplitGetAmount(split))) 
-	  -- gnc_numeric_equal is an expensive function call */
-	{
-	  prob = prob+3;
-	  /*DEBUG("heuristics:  probability + 3 (amount)");*/
-	}
-      else if (fabs (downloaded_split_amount - match_split_amount) <= 
-	       fuzzy_amount_difference)
-	{
-	  /* ATM fees are sometimes added directly in the transaction.
-	     So you withdraw 100$ and get charged 101,25$ in the same
-	     transaction */ 
-	  prob = prob+2;
-	  /*DEBUG("heuristics:  probability + 2 (amount)");*/
-	}
-      else
-	{
-	  /* If a transaction's amount doesn't match within the
-	     threshold, it's very unlikely to be the same transaction
-	     so we give it an extra -5 penality */
-	  prob = prob-5;
-	  /* DEBUG("heuristics:  probability - 1 (amount)"); */
-	}
-      
-      /* Date heuristics */
-      match_time = xaccTransGetDate (xaccSplitGetParent (split));
-      download_time = xaccTransGetDate (new_trans);
-      datediff_day = abs(match_time - download_time)/86400;
-      /* Sorry, there are not really functions around at all that
-	 provide for less hacky calculation of days of date
-	 differences. Whatever. On the other hand, the difference
-	 calculation itself will work regardless of month/year
-	 turnarounds. */
-      /*DEBUG("diff day %d", datediff_day);*/
-      if (datediff_day == 0)
-	{
-	  prob = prob+3;
-	  /*DEBUG("heuristics:  probability + 3 (date)");*/
-	}
-      else if (datediff_day <= MATCH_DATE_THRESHOLD)
-	{
-	  prob = prob+2;
-	  /*DEBUG("heuristics:  probability + 2 (date)");*/
-	}
-      else if (datediff_day > MATCH_DATE_NOT_THRESHOLD)
-	{
-	  /* Extra penalty if that split lies awfully far away from
-	     the given one. */
-	  prob = prob-5;
-	  /*DEBUG("heuristics:  probability - 5 (date)"); */
-	  /* Changed 2005-02-21: Revert the hard-limiting behaviour
-	     back to the previous large penalty. (Changed 2004-11-27:
-	     The penalty is so high that we can forget about this
-	     split anyway and skip the rest of the tests.) */
-	}
-      
-      /* Check number heuristics */
-      {
-	const char *new_trans_str = xaccTransGetNum(new_trans);
-	if (new_trans_str && strlen(new_trans_str) != 0) { 
-          long new_trans_number, split_number;
-          const gchar *split_str;
-          char *endptr;
-          gboolean conversion_ok = TRUE;
-          
-          /* To distinguish success/failure after strtol call */
-          errno = 0;
-          new_trans_number = strtol(new_trans_str, &endptr, 10);
-          /* Possible addressed problems: over/underflow, only non
-	     numbers on string and string empty */
-          if (errno || endptr == new_trans_str) 
-	    conversion_ok = FALSE;
-            
-          split_str = xaccTransGetNum (xaccSplitGetParent (split));
-          errno = 0;
-          split_number = strtol(split_str, &endptr, 10);
-          if (errno || endptr == split_str) 
-	    conversion_ok = FALSE;
-            
-          if ( (conversion_ok && (split_number == new_trans_number)) || 
-	       (safe_strcmp(new_trans_str, split_str) == 0) )
-            {  
-              /* An exact match of the Check number gives a +4 */
-              prob += 4;
-              /*DEBUG("heuristics:  probability + 4 (Check number)");*/
+        GNCImportMatchInfo * match_info;
+        gint prob = 0;
+        double downloaded_split_amount, match_split_amount;
+        time_t match_time, download_time;
+        int datediff_day;
+        Transaction *new_trans = gnc_import_TransInfo_get_trans (trans_info);
+        Split *new_trans_fsplit = gnc_import_TransInfo_get_fsplit (trans_info);
+
+        /* Matching heuristics */
+
+        /* Amount heuristics */
+        downloaded_split_amount =
+            gnc_numeric_to_double (xaccSplitGetAmount(new_trans_fsplit));
+        /*DEBUG(" downloaded_split_amount=%f", downloaded_split_amount);*/
+        match_split_amount = gnc_numeric_to_double(xaccSplitGetAmount(split));
+        /*DEBUG(" match_split_amount=%f", match_split_amount);*/
+        if (fabs(downloaded_split_amount - match_split_amount) < 1e-6)
+            /* bug#347791: Double type shouldn't be compared for exact
+               equality, so we're using fabs() instead. */
+            /*if (gnc_numeric_equal(xaccSplitGetAmount
+              (new_trans_fsplit),
+              xaccSplitGetAmount(split)))
+              -- gnc_numeric_equal is an expensive function call */
+        {
+            prob = prob + 3;
+            /*DEBUG("heuristics:  probability + 3 (amount)");*/
+        }
+        else if (fabs (downloaded_split_amount - match_split_amount) <=
+                 fuzzy_amount_difference)
+        {
+            /* ATM fees are sometimes added directly in the transaction.
+               So you withdraw 100$ and get charged 101,25$ in the same
+               transaction */
+            prob = prob + 2;
+            /*DEBUG("heuristics:  probability + 2 (amount)");*/
+        }
+        else
+        {
+            /* If a transaction's amount doesn't match within the
+               threshold, it's very unlikely to be the same transaction
+               so we give it an extra -5 penality */
+            prob = prob - 5;
+            /* DEBUG("heuristics:  probability - 1 (amount)"); */
+        }
+
+        /* Date heuristics */
+        match_time = xaccTransGetDate (xaccSplitGetParent (split));
+        download_time = xaccTransGetDate (new_trans);
+        datediff_day = abs(match_time - download_time) / 86400;
+        /* Sorry, there are not really functions around at all that
+        	 provide for less hacky calculation of days of date
+        	 differences. Whatever. On the other hand, the difference
+        	 calculation itself will work regardless of month/year
+        	 turnarounds. */
+        /*DEBUG("diff day %d", datediff_day);*/
+        if (datediff_day == 0)
+        {
+            prob = prob + 3;
+            /*DEBUG("heuristics:  probability + 3 (date)");*/
+        }
+        else if (datediff_day <= MATCH_DATE_THRESHOLD)
+        {
+            prob = prob + 2;
+            /*DEBUG("heuristics:  probability + 2 (date)");*/
+        }
+        else if (datediff_day > MATCH_DATE_NOT_THRESHOLD)
+        {
+            /* Extra penalty if that split lies awfully far away from
+               the given one. */
+            prob = prob - 5;
+            /*DEBUG("heuristics:  probability - 5 (date)"); */
+            /* Changed 2005-02-21: Revert the hard-limiting behaviour
+               back to the previous large penalty. (Changed 2004-11-27:
+               The penalty is so high that we can forget about this
+               split anyway and skip the rest of the tests.) */
+        }
+
+        /* Check number heuristics */
+        {
+            const char *new_trans_str = xaccTransGetNum(new_trans);
+            if (new_trans_str && strlen(new_trans_str) != 0)
+            {
+                long new_trans_number, split_number;
+                const gchar *split_str;
+                char *endptr;
+                gboolean conversion_ok = TRUE;
+
+                /* To distinguish success/failure after strtol call */
+                errno = 0;
+                new_trans_number = strtol(new_trans_str, &endptr, 10);
+                /* Possible addressed problems: over/underflow, only non
+                	     numbers on string and string empty */
+                if (errno || endptr == new_trans_str)
+                    conversion_ok = FALSE;
+
+                split_str = xaccTransGetNum (xaccSplitGetParent (split));
+                errno = 0;
+                split_number = strtol(split_str, &endptr, 10);
+                if (errno || endptr == split_str)
+                    conversion_ok = FALSE;
+
+                if ( (conversion_ok && (split_number == new_trans_number)) ||
+                        (safe_strcmp(new_trans_str, split_str) == 0) )
+                {
+                    /* An exact match of the Check number gives a +4 */
+                    prob += 4;
+                    /*DEBUG("heuristics:  probability + 4 (Check number)");*/
+                }
+                else if (strlen(new_trans_str) > 0 && strlen(split_str) > 0)
+                {
+                    /* If both number are not empty yet do not match, add a
+                    		 little extra penality */
+                    prob -= 2;
+                }
             }
-          else if(strlen(new_trans_str) > 0 && strlen(split_str) > 0)
+        }
+
+        /* Memo heuristics */
+        {
+            const char *memo = xaccSplitGetMemo(new_trans_fsplit);
+            if (memo && strlen(memo) != 0)
             {
-              /* If both number are not empty yet do not match, add a
-		 little extra penality */
-              prob -= 2;
+                if (safe_strcmp(memo, xaccSplitGetMemo(split)) == 0)
+                {
+                    /* An exact match of memo gives a +2 */
+                    prob = prob + 2;
+                    /* DEBUG("heuristics:  probability + 2 (memo)"); */
+                }
+                else if ((strncmp(memo, xaccSplitGetMemo(split),
+                                  strlen(xaccSplitGetMemo(split)) / 2)
+                          == 0))
+                {
+                    /* Very primitive fuzzy match worth +1.  This matches the
+                    		 first 50% of the strings to skip annoying transaction
+                    		 number some banks seem to include in the memo but someone
+                    		 should write something more sophisticated */
+                    prob = prob + 1;
+                    /*DEBUG("heuristics:  probability + 1 (memo)");	*/
+                }
             }
         }
-      }
 
-      /* Memo heuristics */  
-      {
-	const char *memo = xaccSplitGetMemo(new_trans_fsplit);
-	if (memo && strlen(memo) != 0) {
-	  if (safe_strcmp(memo, xaccSplitGetMemo(split)) == 0)
-	    {	
-	      /* An exact match of memo gives a +2 */
-	      prob = prob+2;
-	      /* DEBUG("heuristics:  probability + 2 (memo)"); */
-	    }
-	  else if((strncmp(memo, xaccSplitGetMemo(split),
-			   strlen(xaccSplitGetMemo(split))/2)
-		   ==0))
-	    {
-	      /* Very primitive fuzzy match worth +1.  This matches the
-		 first 50% of the strings to skip annoying transaction
-		 number some banks seem to include in the memo but someone
-		 should write something more sophisticated */ 
-	      prob = prob+1;
-	      /*DEBUG("heuristics:  probability + 1 (memo)");	*/
-	    }
-	}
-      }
+        /* Description heuristics */
+        {
+            const char *descr = xaccTransGetDescription(new_trans);
+            if (descr && strlen(descr) != 0)
+            {
+                if (safe_strcmp(descr,
+                                xaccTransGetDescription(xaccSplitGetParent(split)))
+                        == 0)
+                {
+                    /*An exact match of Description gives a +2 */
+                    prob = prob + 2;
+                    /*DEBUG("heuristics:  probability + 2 (description)");*/
+                }
+                else if ((strncmp(descr,
+                                  xaccTransGetDescription (xaccSplitGetParent(split)),
+                                  strlen(xaccTransGetDescription (new_trans)) / 2)
+                          == 0))
+                {
+                    /* Very primitive fuzzy match worth +1.  This matches the
+                    		 first 50% of the strings to skip annoying transaction
+                    		 number some banks seem to include in the memo but someone
+                    		 should write something more sophisticated */
+                    prob = prob + 1;
+                    /*DEBUG("heuristics:  probability + 1 (description)");	*/
+                }
+            }
+        }
 
-      /* Description heuristics */
-      {
-	const char *descr = xaccTransGetDescription(new_trans);
-	if (descr && strlen(descr) != 0) {
-	  if (safe_strcmp(descr,
-			  xaccTransGetDescription(xaccSplitGetParent(split)))
-	      ==0)
-	    {	
-	      /*An exact match of Description gives a +2 */
-	      prob = prob+2;
-	      /*DEBUG("heuristics:  probability + 2 (description)");*/
-	    }
-	  else if((strncmp(descr,
-			   xaccTransGetDescription (xaccSplitGetParent(split)),
-			   strlen(xaccTransGetDescription (new_trans))/2)
-		   ==0))
-	    {
-	      /* Very primitive fuzzy match worth +1.  This matches the
-		 first 50% of the strings to skip annoying transaction
-		 number some banks seem to include in the memo but someone
-		 should write something more sophisticated */ 
-	      prob = prob+1;
-	      /*DEBUG("heuristics:  probability + 1 (description)");	*/
-	    }
-	}
-      }
+        /* Is the probability high enough? Otherwise do nothing and return. */
+        if (prob < display_threshold)
+        {
+            return;
+        }
 
-      /* Is the probability high enough? Otherwise do nothing and return. */
-      if(prob < display_threshold)
-	{
-	  return;
-	}
-      
-      /* The probability is high enough, so allocate an object
-	 here. Allocating it only when it's actually being used is
-	 probably quite some performance gain. */
-      match_info = g_new0(GNCImportMatchInfo,1);
-    
-      match_info->probability = prob;
-      match_info->split = split;
-      match_info->trans = xaccSplitGetParent(split);
-      
-      
-      /* Append that to the list. */
-      trans_info->match_list = 
-	g_list_append(trans_info->match_list,
-		      match_info);
+        /* The probability is high enough, so allocate an object
+        	 here. Allocating it only when it's actually being used is
+        	 probably quite some performance gain. */
+        match_info = g_new0(GNCImportMatchInfo, 1);
+
+        match_info->probability = prob;
+        match_info->split = split;
+        match_info->trans = xaccSplitGetParent(split);
+
+
+        /* Append that to the list. */
+        trans_info->match_list =
+            g_list_append(trans_info->match_list,
+                          match_info);
     }
 }/* end split_find_match */
 
@@ -764,59 +772,59 @@
 /** /brief Iterate through all splits of the originating account of the given
    transaction, and find all matching splits there. */
 void gnc_import_find_split_matches(GNCImportTransInfo *trans_info,
-				   gint process_threshold, 
-				   double fuzzy_amount_difference,
-				   gint match_date_hardlimit)
+                                   gint process_threshold,
+                                   double fuzzy_amount_difference,
+                                   gint match_date_hardlimit)
 {
-  GList * list_element;
-  Query *query = xaccMallocQuery();
-  g_assert (trans_info);
-  
-  /* Get list of splits of the originating account. */
-  {
-    /* We used to traverse *all* splits of the account by using
-       xaccAccountGetSplitList, which is a bad idea because 90% of these
-       splits are outside the date range that is interesting. We should
-       rather use a query according to the date region, which is
-       implemented here. 
-    */
-    Account *importaccount = 
-      xaccSplitGetAccount (gnc_import_TransInfo_get_fsplit (trans_info));
-    time_t download_time = xaccTransGetDate (gnc_import_TransInfo_get_trans (trans_info));
+    GList * list_element;
+    Query *query = xaccMallocQuery();
+    g_assert (trans_info);
 
-    xaccQuerySetBook (query, gnc_get_current_book());
-    xaccQueryAddSingleAccountMatch (query, importaccount,			    
-				    QOF_QUERY_AND);
-    xaccQueryAddDateMatchTT (query,
-			     TRUE, download_time - match_date_hardlimit*86400,
-			     TRUE, download_time + match_date_hardlimit*86400,
-			     QOF_QUERY_AND);
-    list_element = xaccQueryGetSplits (query);
-    /* Sigh. Doesnt help too much. We still create and run one query
-       for each imported transaction. Maybe it would improve
-       performance further if there is one single (master-)query at
-       the beginning, matching the full date range and all accounts in
-       question. However, this doesnt quite work because this function
-       here is called from each gnc_gen_trans_list_add_trans(), which
-       is called one at a time. Therefore the whole importer would
-       have to change its behaviour: Accept the imported txns via
-       gnc_gen_trans_list_add_trans(), and only when
-       gnc_gen_trans_list_run() is called, then calculate all the
-       different match candidates. That's too much work for now.
-    */
-  }
+    /* Get list of splits of the originating account. */
+    {
+        /* We used to traverse *all* splits of the account by using
+           xaccAccountGetSplitList, which is a bad idea because 90% of these
+           splits are outside the date range that is interesting. We should
+           rather use a query according to the date region, which is
+           implemented here.
+        */
+        Account *importaccount =
+            xaccSplitGetAccount (gnc_import_TransInfo_get_fsplit (trans_info));
+        time_t download_time = xaccTransGetDate (gnc_import_TransInfo_get_trans (trans_info));
 
-  /* Traverse that list, calling split_find_match on each one. Note
-     that xaccAccountForEachSplit is declared in Account.h but
-     implemented nowhere :-( */
-  while(list_element!=NULL)
+        xaccQuerySetBook (query, gnc_get_current_book());
+        xaccQueryAddSingleAccountMatch (query, importaccount,
+                                        QOF_QUERY_AND);
+        xaccQueryAddDateMatchTT (query,
+                                 TRUE, download_time - match_date_hardlimit * 86400,
+                                 TRUE, download_time + match_date_hardlimit * 86400,
+                                 QOF_QUERY_AND);
+        list_element = xaccQueryGetSplits (query);
+        /* Sigh. Doesnt help too much. We still create and run one query
+           for each imported transaction. Maybe it would improve
+           performance further if there is one single (master-)query at
+           the beginning, matching the full date range and all accounts in
+           question. However, this doesnt quite work because this function
+           here is called from each gnc_gen_trans_list_add_trans(), which
+           is called one at a time. Therefore the whole importer would
+           have to change its behaviour: Accept the imported txns via
+           gnc_gen_trans_list_add_trans(), and only when
+           gnc_gen_trans_list_run() is called, then calculate all the
+           different match candidates. That's too much work for now.
+        */
+    }
+
+    /* Traverse that list, calling split_find_match on each one. Note
+       that xaccAccountForEachSplit is declared in Account.h but
+       implemented nowhere :-( */
+    while (list_element != NULL)
     {
-      split_find_match (trans_info, list_element->data, 
-			process_threshold, fuzzy_amount_difference);
-      list_element = g_list_next (list_element);
+        split_find_match (trans_info, list_element->data,
+                          process_threshold, fuzzy_amount_difference);
+        list_element = g_list_next (list_element);
     }
 
-  xaccFreeQuery (query);
+    xaccFreeQuery (query);
 }
 
 
@@ -827,125 +835,128 @@
    according to its selected action.  */
 gboolean
 gnc_import_process_trans_item (GncImportMatchMap *matchmap,
-			       GNCImportTransInfo *trans_info)
+                               GNCImportTransInfo *trans_info)
 {
-  /* DEBUG("Begin"); */
+    /* DEBUG("Begin"); */
 
-      g_assert (trans_info);
-      /*DEBUG("Iteration %d, action %d, split %s", i, 
-	trans_info->action,
-	xaccTransGetDescription (gnc_import_TransInfo_get_trans 
-	(trans_info)))*/
-      switch (gnc_import_TransInfo_get_action (trans_info))
-	{
-	case GNCImport_SKIP:
-	  return FALSE;
-	case GNCImport_ADD:
-	  /* Transaction gets imported. */
+    g_assert (trans_info);
+    /*DEBUG("Iteration %d, action %d, split %s", i,
+    	trans_info->action,
+    	xaccTransGetDescription (gnc_import_TransInfo_get_trans
+    	(trans_info)))*/
+    switch (gnc_import_TransInfo_get_action (trans_info))
+    {
+    case GNCImport_SKIP:
+        return FALSE;
+    case GNCImport_ADD:
+        /* Transaction gets imported. */
 
-	  /* Is the transaction not balanced and there is a non-NULL destination account? */
-	  if (gnc_import_TransInfo_is_balanced(trans_info) == FALSE
-	      && gnc_import_TransInfo_get_destacc(trans_info) != NULL) {
-	    /* Create the 'other' split. */
-	    Split *split = 
-	      xaccMallocSplit
-	      (gnc_account_get_book
-	       (gnc_import_TransInfo_get_destacc (trans_info)));
-	    xaccTransAppendSplit
-	      (gnc_import_TransInfo_get_trans (trans_info), split);
-	    xaccAccountInsertSplit
-	      (gnc_import_TransInfo_get_destacc (trans_info), split);
-	    /*xaccSplitSetBaseValue
-	      (split, 
-	       gnc_numeric_neg(xaccTransGetImbalance 
-			       (gnc_import_TransInfo_get_trans (trans_info))),
-	       xaccTransGetCurrency 
-	       (gnc_import_TransInfo_get_trans (trans_info)));*/
-	    {
-	      /* This is a quick workaround for the bug described in
-		 http://gnucash.org/pipermail/gnucash-devel/2003-August/009982.html
-                 Assume that importers won't create transactions involving two or more
-                 currencies so we can use xaccTransGetImbalanceValue. */
-	      gnc_numeric v = 
-		gnc_numeric_neg (xaccTransGetImbalanceValue 
-				 (gnc_import_TransInfo_get_trans (trans_info)));
-	      xaccSplitSetValue (split, v);
-	      xaccSplitSetAmount (split, v);
-	    }
-	    /*xaccSplitSetMemo (split, _("Auto-Balance split"));
-	      -- disabled due to popular request */
-	  }
-	  
-	  xaccSplitSetReconcile(gnc_import_TransInfo_get_fsplit (trans_info), CREC);
-	  /*Set reconcile date to today*/
-	  xaccSplitSetDateReconciledSecs(gnc_import_TransInfo_get_fsplit (trans_info),
-					 time(NULL));
-	  /* Done editing. */
-	  xaccTransCommitEdit 
-	    (gnc_import_TransInfo_get_trans (trans_info));
-	  return TRUE;
-	case GNCImport_CLEAR: {
-	  GNCImportMatchInfo *selected_match =
-	    gnc_import_TransInfo_get_selected_match (trans_info);
+        /* Is the transaction not balanced and there is a non-NULL destination account? */
+        if (gnc_import_TransInfo_is_balanced(trans_info) == FALSE
+                && gnc_import_TransInfo_get_destacc(trans_info) != NULL)
+        {
+            /* Create the 'other' split. */
+            Split *split =
+                xaccMallocSplit
+                (gnc_account_get_book
+                 (gnc_import_TransInfo_get_destacc (trans_info)));
+            xaccTransAppendSplit
+            (gnc_import_TransInfo_get_trans (trans_info), split);
+            xaccAccountInsertSplit
+            (gnc_import_TransInfo_get_destacc (trans_info), split);
+            /*xaccSplitSetBaseValue
+              (split,
+               gnc_numeric_neg(xaccTransGetImbalance
+            	       (gnc_import_TransInfo_get_trans (trans_info))),
+               xaccTransGetCurrency
+               (gnc_import_TransInfo_get_trans (trans_info)));*/
+            {
+                /* This is a quick workaround for the bug described in
+                		 http://gnucash.org/pipermail/gnucash-devel/2003-August/009982.html
+                       Assume that importers won't create transactions involving two or more
+                       currencies so we can use xaccTransGetImbalanceValue. */
+                gnc_numeric v =
+                    gnc_numeric_neg (xaccTransGetImbalanceValue
+                                     (gnc_import_TransInfo_get_trans (trans_info)));
+                xaccSplitSetValue (split, v);
+                xaccSplitSetAmount (split, v);
+            }
+            /*xaccSplitSetMemo (split, _("Auto-Balance split"));
+              -- disabled due to popular request */
+        }
 
-	  /* If there is no selection, ignore this transaction. */
-	  if (!selected_match) {
-	    PWARN("No matching translaction to be cleared was chosen. Imported transaction will be ignored.");
-	    break;
-	  }
+        xaccSplitSetReconcile(gnc_import_TransInfo_get_fsplit (trans_info), CREC);
+        /*Set reconcile date to today*/
+        xaccSplitSetDateReconciledSecs(gnc_import_TransInfo_get_fsplit (trans_info),
+                                       time(NULL));
+        /* Done editing. */
+        xaccTransCommitEdit
+        (gnc_import_TransInfo_get_trans (trans_info));
+        return TRUE;
+    case GNCImport_CLEAR:
+    {
+        GNCImportMatchInfo *selected_match =
+            gnc_import_TransInfo_get_selected_match (trans_info);
 
-	  /* Transaction gets not imported but the matching one gets 
-	     reconciled. */
-	  if(gnc_import_MatchInfo_get_split (selected_match) ==NULL)
-	    {
-                PERR("The split I am trying to reconcile is NULL, shouldn't happen!");
-	    }
-	  else
-	    {
-	      /* Reconcile the matching transaction */
-	      /*DEBUG("BeginEdit selected_match")*/
-	      xaccTransBeginEdit(selected_match->trans);
+        /* If there is no selection, ignore this transaction. */
+        if (!selected_match)
+        {
+            PWARN("No matching translaction to be cleared was chosen. Imported transaction will be ignored.");
+            break;
+        }
 
-	      if (xaccSplitGetReconcile 
-		  (selected_match->split) == NREC)
-		xaccSplitSetReconcile
-		  (selected_match->split, CREC);
-	      /* Set reconcile date to today */
-	      xaccSplitSetDateReconciledSecs
-		(selected_match->split,time(NULL));
+        /* Transaction gets not imported but the matching one gets
+           reconciled. */
+        if (gnc_import_MatchInfo_get_split (selected_match) == NULL)
+        {
+            PERR("The split I am trying to reconcile is NULL, shouldn't happen!");
+        }
+        else
+        {
+            /* Reconcile the matching transaction */
+            /*DEBUG("BeginEdit selected_match")*/
+            xaccTransBeginEdit(selected_match->trans);
 
-	      /* Copy the online id to the reconciled transaction, so
-		 the match will be remembered */ 
-	      if (gnc_import_split_has_online_id(trans_info->first_split))
-		gnc_import_set_split_online_id
-		  (selected_match->split,
-		   gnc_import_get_split_online_id(trans_info->first_split));
-	      
-	      /* Done editing. */
-	      /*DEBUG("CommitEdit selected_match")*/
-	      xaccTransCommitEdit
-		(selected_match->trans);
-	      
-	      /* Store the mapping to the other account in the MatchMap. */
-	      matchmap_store_destination (matchmap, trans_info, TRUE);
+            if (xaccSplitGetReconcile
+                    (selected_match->split) == NREC)
+                xaccSplitSetReconcile
+                (selected_match->split, CREC);
+            /* Set reconcile date to today */
+            xaccSplitSetDateReconciledSecs
+            (selected_match->split, time(NULL));
 
-	      /* Erase the downloaded transaction */
-	      xaccTransDestroy(trans_info->trans);
-	      /*DEBUG("CommitEdit trans")*/
-	      xaccTransCommitEdit(trans_info->trans);
-	      /* Very important: Make sure the freed transaction is not freed again! */
-	      trans_info->trans = NULL;
-	    }
-	  }
-	  return TRUE;
-	case GNCImport_EDIT:
-	    PERR("EDIT action is UNSUPPORTED!");
-	  break;
-	default:
-	  DEBUG("Invalid GNCImportAction for this imported transaction.");
-	}
-  /*DEBUG("End");*/
-  return FALSE;
+            /* Copy the online id to the reconciled transaction, so
+            		 the match will be remembered */
+            if (gnc_import_split_has_online_id(trans_info->first_split))
+                gnc_import_set_split_online_id
+                (selected_match->split,
+                 gnc_import_get_split_online_id(trans_info->first_split));
+
+            /* Done editing. */
+            /*DEBUG("CommitEdit selected_match")*/
+            xaccTransCommitEdit
+            (selected_match->trans);
+
+            /* Store the mapping to the other account in the MatchMap. */
+            matchmap_store_destination (matchmap, trans_info, TRUE);
+
+            /* Erase the downloaded transaction */
+            xaccTransDestroy(trans_info->trans);
+            /*DEBUG("CommitEdit trans")*/
+            xaccTransCommitEdit(trans_info->trans);
+            /* Very important: Make sure the freed transaction is not freed again! */
+            trans_info->trans = NULL;
+        }
+    }
+    return TRUE;
+    case GNCImport_EDIT:
+        PERR("EDIT action is UNSUPPORTED!");
+        break;
+    default:
+        DEBUG("Invalid GNCImportAction for this imported transaction.");
+    }
+    /*DEBUG("End");*/
+    return FALSE;
 }
 
 /********************************************************************\
@@ -956,38 +967,38 @@
 \********************************************************************/
 static gint check_trans_online_id(Transaction *trans1, void *user_data)
 {
-  Account *account;
-  Split *split1;
-  Split *split2 = user_data;
-  const gchar *online_id1;
-  const gchar *online_id2;
+    Account *account;
+    Split *split1;
+    Split *split2 = user_data;
+    const gchar *online_id1;
+    const gchar *online_id2;
 
-  account = xaccSplitGetAccount(split2);
-  split1 = xaccTransFindSplitByAccount(trans1, account);
-  if (split1 == split2)
-    return 0;
+    account = xaccSplitGetAccount(split2);
+    split1 = xaccTransFindSplitByAccount(trans1, account);
+    if (split1 == split2)
+        return 0;
 
-  /* hack - we really want to iterate over the _splits_ of the account
-     instead of the transactions */
-  g_assert(split1 != NULL);
+    /* hack - we really want to iterate over the _splits_ of the account
+       instead of the transactions */
+    g_assert(split1 != NULL);
 
-  if (gnc_import_split_has_online_id(split1))
-    online_id1 = gnc_import_get_split_online_id(split1);
-  else
-    online_id1 = gnc_import_get_trans_online_id(trans1);
+    if (gnc_import_split_has_online_id(split1))
+        online_id1 = gnc_import_get_split_online_id(split1);
+    else
+        online_id1 = gnc_import_get_trans_online_id(trans1);
 
-  online_id2 = gnc_import_get_split_online_id(split2);
+    online_id2 = gnc_import_get_split_online_id(split2);
 
-  if ((online_id1 == NULL) ||
-      (online_id2 == NULL) ||
-      (strcmp(online_id1, online_id2) != 0))
+    if ((online_id1 == NULL) ||
+            (online_id2 == NULL) ||
+            (strcmp(online_id1, online_id2) != 0))
     {
-      return 0;
+        return 0;
     }
-  else
+    else
     {
-      /*printf("test_trans_online_id(): Duplicate found\n");*/
-      return 1;
+        /*printf("test_trans_online_id(): Duplicate found\n");*/
+        return 1;
     }
 }
 
@@ -995,29 +1006,29 @@
   its parent account. */
 gboolean gnc_import_exists_online_id (Transaction *trans)
 {
-  int i;
-  gboolean online_id_exists = FALSE;
-  Account *dest_acct;
-  Split *source_split;
+    int i;
+    gboolean online_id_exists = FALSE;
+    Account *dest_acct;
+    Split *source_split;
 
-  /* Look for an online_id in the first split */
-  source_split = xaccTransGetSplit(trans, 0);
+    /* Look for an online_id in the first split */
+    source_split = xaccTransGetSplit(trans, 0);
 
-  /* DEBUG("%s%d%s","Checking split ",i," for duplicates"); */
-  dest_acct = xaccSplitGetAccount(source_split);
-  online_id_exists = xaccAccountForEachTransaction(dest_acct,
-						   check_trans_online_id,
-						   source_split);
+    /* DEBUG("%s%d%s","Checking split ",i," for duplicates"); */
+    dest_acct = xaccSplitGetAccount(source_split);
+    online_id_exists = xaccAccountForEachTransaction(dest_acct,
+                       check_trans_online_id,
+                       source_split);
 
-  /* If it does, abort the process for this transaction, since it is
-     already in the system. */
-  if (online_id_exists == TRUE)
+    /* If it does, abort the process for this transaction, since it is
+       already in the system. */
+    if (online_id_exists == TRUE)
     {
-      DEBUG("%s","Transaction with same online ID exists, destroying current transaction");
-      xaccTransDestroy(trans);
-      xaccTransCommitEdit(trans);
+        DEBUG("%s", "Transaction with same online ID exists, destroying current transaction");
+        xaccTransDestroy(trans);
+        xaccTransCommitEdit(trans);
     }
-  return online_id_exists;
+    return online_id_exists;
 }
 
 
@@ -1028,78 +1039,78 @@
 GNCImportTransInfo *
 gnc_import_TransInfo_new (Transaction *trans, GncImportMatchMap *matchmap)
 {
-  GNCImportTransInfo *transaction_info;
-  g_assert (trans);
-  
-  transaction_info = g_new0(GNCImportTransInfo,1);
-      
-  transaction_info->trans=trans;
-  /* Only use first split, the source split */
-  transaction_info->first_split = xaccTransGetSplit(trans,0);
-  
-  /* Try to find a previously selected destination account 
-     string match for the ADD action */
-  gnc_import_TransInfo_set_destacc (transaction_info, 
-				    matchmap_find_destination (matchmap, transaction_info),
-				    FALSE); 
-  return transaction_info;
+    GNCImportTransInfo *transaction_info;
+    g_assert (trans);
+
+    transaction_info = g_new0(GNCImportTransInfo, 1);
+
+    transaction_info->trans = trans;
+    /* Only use first split, the source split */
+    transaction_info->first_split = xaccTransGetSplit(trans, 0);
+
+    /* Try to find a previously selected destination account
+       string match for the ADD action */
+    gnc_import_TransInfo_set_destacc (transaction_info,
+                                      matchmap_find_destination (matchmap, transaction_info),
+                                      FALSE);
+    return transaction_info;
 }
 
 
 /** compare_probability() is used by g_list_sort to sort by probability */
 static gint compare_probability (gconstpointer a,
-				 gconstpointer b)
+                                 gconstpointer b)
 {
-  return(((GNCImportMatchInfo *)b)->probability - 
-	 ((GNCImportMatchInfo *)a)->probability);
+    return(((GNCImportMatchInfo *)b)->probability -
+           ((GNCImportMatchInfo *)a)->probability);
 }
 
 /** Iterates through all splits of the originating account of
  * trans_info. Sorts the resulting list and sets the selected_match
- * and action fields in the trans_info. 
+ * and action fields in the trans_info.
  */
-void 
+void
 gnc_import_TransInfo_init_matches (GNCImportTransInfo *trans_info,
-				   GNCImportSettings *settings)
+                                   GNCImportSettings *settings)
 {
-  GNCImportMatchInfo * best_match;
-  g_assert (trans_info);
-  
-  
-  /* Find all split matches in originating account. */
-  gnc_import_find_split_matches(trans_info,  
-				gnc_import_Settings_get_display_threshold (settings),
-				gnc_import_Settings_get_fuzzy_amount (settings),
-				gnc_import_Settings_get_match_date_hardlimit (settings));
-  
-  if (trans_info->match_list != NULL) 
+    GNCImportMatchInfo * best_match;
+    g_assert (trans_info);
+
+
+    /* Find all split matches in originating account. */
+    gnc_import_find_split_matches(trans_info,
+                                  gnc_import_Settings_get_display_threshold (settings),
+                                  gnc_import_Settings_get_fuzzy_amount (settings),
+                                  gnc_import_Settings_get_match_date_hardlimit (settings));
+
+    if (trans_info->match_list != NULL)
     {
-      trans_info->match_list = g_list_sort(trans_info->match_list,
-					   compare_probability);
-      best_match = g_list_nth_data(trans_info->match_list,0);
-      gnc_import_TransInfo_set_selected_match (trans_info,
-					       best_match,
-					       FALSE);
-      if(best_match != NULL && 
-	 best_match->probability >= gnc_import_Settings_get_clear_threshold(settings))
-	{
-	  trans_info->action = GNCImport_CLEAR;
-	  trans_info->selected_match_info = best_match;
-	}
-      else if(best_match == NULL ||
-	      best_match->probability <= gnc_import_Settings_get_add_threshold(settings) )
-	{
-	  trans_info->action=GNCImport_ADD;
-	}
-      else
-	{
-	  trans_info->action=GNCImport_SKIP;
-	}
+        trans_info->match_list = g_list_sort(trans_info->match_list,
+                                             compare_probability);
+        best_match = g_list_nth_data(trans_info->match_list, 0);
+        gnc_import_TransInfo_set_selected_match (trans_info,
+                best_match,
+                FALSE);
+        if (best_match != NULL &&
+                best_match->probability >= gnc_import_Settings_get_clear_threshold(settings))
+        {
+            trans_info->action = GNCImport_CLEAR;
+            trans_info->selected_match_info = best_match;
+        }
+        else if (best_match == NULL ||
+                 best_match->probability <= gnc_import_Settings_get_add_threshold(settings) )
+        {
+            trans_info->action = GNCImport_ADD;
+        }
+        else
+        {
+            trans_info->action = GNCImport_SKIP;
+        }
     }
-  else
-    trans_info->action = GNCImport_ADD;
-  
-  trans_info->previous_action=trans_info->action;
+    else
+        trans_info->action = GNCImport_ADD;
+
+    trans_info->previous_action = trans_info->action;
 }
 
 
@@ -1107,33 +1118,35 @@
 /* transaction hasn't already been manually assigned to another account */
 gboolean
 gnc_import_TransInfo_refresh_destacc (GNCImportTransInfo *transaction_info,
-				      GncImportMatchMap *matchmap)
+                                      GncImportMatchMap *matchmap)
 {
-  Account *orig_destacc;
-  Account *new_destacc = NULL;
-  g_assert(transaction_info);
+    Account *orig_destacc;
+    Account *new_destacc = NULL;
+    g_assert(transaction_info);
 
-  orig_destacc = gnc_import_TransInfo_get_destacc(transaction_info);
+    orig_destacc = gnc_import_TransInfo_get_destacc(transaction_info);
 
-  /* if we haven't manually selected a destination account for this transaction */
-  if(gnc_import_TransInfo_get_destacc_selected_manually(transaction_info) == FALSE)
-  {
-    /* Try to find the destination account for this transaction based on prior ones */
-    new_destacc = matchmap_find_destination(matchmap, transaction_info);
-    gnc_import_TransInfo_set_destacc(transaction_info, new_destacc, FALSE);
-  } else
-  {
-    new_destacc = orig_destacc;
-  }
+    /* if we haven't manually selected a destination account for this transaction */
+    if (gnc_import_TransInfo_get_destacc_selected_manually(transaction_info) == FALSE)
+    {
+        /* Try to find the destination account for this transaction based on prior ones */
+        new_destacc = matchmap_find_destination(matchmap, transaction_info);
+        gnc_import_TransInfo_set_destacc(transaction_info, new_destacc, FALSE);
+    }
+    else
+    {
+        new_destacc = orig_destacc;
+    }
 
-  /* account has changed */
-  if(new_destacc != orig_destacc)
-  {
-    return TRUE;
-  } else /* account is the same */
-  {
-    return FALSE;
-  }
+    /* account has changed */
+    if (new_destacc != orig_destacc)
+    {
+        return TRUE;
+    }
+    else   /* account is the same */
+    {
+        return FALSE;
+    }
 }
 
 

Modified: gnucash/trunk/src/import-export/import-backend.h
===================================================================
--- gnucash/trunk/src/import-export/import-backend.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-backend.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,7 +24,7 @@
     @author Christian Stimming
     @author Copyright (c) 2006 David Hampton <hampton at employees.org>
 */
- 
+
 #ifndef TRANSACTION_MATCHER_H
 #define TRANSACTION_MATCHER_H
 
@@ -35,13 +35,14 @@
 typedef struct _transactioninfo GNCImportTransInfo;
 typedef struct _matchinfo GNCImportMatchInfo;
 
-typedef enum _action {
-  GNCImport_SKIP,
-  GNCImport_ADD,
-  GNCImport_CLEAR,
-  GNCImport_EDIT,
-  GNCImport_LAST_ACTION,
-  GNCImport_INVALID_ACTION
+typedef enum _action
+{
+    GNCImport_SKIP,
+    GNCImport_ADD,
+    GNCImport_CLEAR,
+    GNCImport_EDIT,
+    GNCImport_LAST_ACTION,
+    GNCImport_INVALID_ACTION
 } GNCImportAction;
 
 /************************************************************************
@@ -71,7 +72,7 @@
  * @param fuzzy_amount_difference For fuzzy amount matching, a certain
  * fuzzyness in the matching amount is allowed up to this value. May
  * be e.g. 3.00 dollars for ATM fees, or 0.0 if you only want to allow
- * exact matches. 
+ * exact matches.
  *
  * @param match_date_hardlimit The number of days that a matching
  * split may differ from the given transaction before it is discarded
@@ -80,30 +81,30 @@
  * ignored altogether. For use cases without paper checks (e.g. HBCI),
  * values like 14 (days) might be appropriate, whereas for use cases
  * with paper checks (e.g. OFX, QIF), values like 42 (days) seem more
- * appropriate. 
+ * appropriate.
  */
 void gnc_import_find_split_matches(GNCImportTransInfo *trans_info,
-				   gint process_threshold, 
-				   double fuzzy_amount_difference,
-				   gint match_date_hardlimit);
+                                   gint process_threshold,
+                                   double fuzzy_amount_difference,
+                                   gint match_date_hardlimit);
 
 /** Iterates through all splits of the originating account of
  * trans_info. Sorts the resulting list and sets the selected_match
- * and action fields in the trans_info. 
+ * and action fields in the trans_info.
  *
  * @param trans_info The TransInfo for which the matches should be
- * found, sorted, and selected. 
+ * found, sorted, and selected.
  *
  * @param settings The structure that holds all the user preferences.
  */
-void 
+void
 gnc_import_TransInfo_init_matches (GNCImportTransInfo *trans_info,
-				   GNCImportSettings *settings);
+                                   GNCImportSettings *settings);
 
 /** This function is intended to be called when the importer dialog is
  * finished. It should be called once for each imported transaction
  * and processes each ImportTransInfo according to its selected action:
- * For GNCImport_ADD, the transaction is added etc. etc. 
+ * For GNCImport_ADD, the transaction is added etc. etc.
  *
  * Each succesful match is also stored in the given ImportMatchMap,
  * or, if that argument is NULL, in the ImportMatchMap of each
@@ -119,14 +120,14 @@
  */
 gboolean
 gnc_import_process_trans_item (GncImportMatchMap *matchmap,
-			       GNCImportTransInfo *trans_info);
+                               GNCImportTransInfo *trans_info);
 
 /** This function generates a new pixmap representing a match score.
-    It is a series of vertical bars of different colors.  
+    It is a series of vertical bars of different colors.
     -Below or at the add_threshold the bars are red
     -Above or at the clear_threshold the bars are green
     -Between the two threshold the bars are yellow
- 
+
     @param score The score for which to generate a pixmap.
 
     @param settings The user settings from which to get the threshold
@@ -134,15 +135,15 @@
     @param widget The parent widget in which the pixmap will eventually
     be added.  Will be used to generate the colormap.
  */
-GdkPixbuf* gen_probability_pixbuf (gint score, 
-				   GNCImportSettings *settings,
-				   GtkWidget * widget);
+GdkPixbuf* gen_probability_pixbuf (gint score,
+                                   GNCImportSettings *settings,
+                                   GtkWidget * widget);
 
 /*@}*/
 
 
 /************************************************************************
- *   Getter/Setter Functions for the Data Types. 
+ *   Getter/Setter Functions for the Data Types.
  ************************************************************************/
 
 /** @name Getters/Setters for GNCImportTransInfo */
@@ -182,13 +183,13 @@
 gnc_import_TransInfo_get_selected_match (const GNCImportTransInfo *info);
 
 /** Sets the currently selected match in this TransInfo.
-    @param selected_manually TRUE or FALSE; Was this match set as a result of a selection 
+    @param selected_manually TRUE or FALSE; Was this match set as a result of a selection
     by the user or by an algorithm?
 */
 void
 gnc_import_TransInfo_set_selected_match (GNCImportTransInfo *info,
-					 GNCImportMatchInfo *match,
-					 gboolean selected_manually);
+        GNCImportMatchInfo *match,
+        gboolean selected_manually);
 
 /** Returns if the currently selected match was selected by the user. */
 gboolean
@@ -200,26 +201,26 @@
 
 /** Set the action for this TransInfo. Also sets the previous action. */
 void
-gnc_import_TransInfo_set_action (GNCImportTransInfo *info, 
-				 GNCImportAction action);
+gnc_import_TransInfo_set_action (GNCImportTransInfo *info,
+                                 GNCImportAction action);
 
 /** Returns the 'other account' of this transaction. May return NULL. */
 Account *
 gnc_import_TransInfo_get_destacc (const GNCImportTransInfo *info);
 
 /** Set the 'other account' of this transaction (used for auto-balance if needed). May be set to NULL.
-    @param selected_manually TRUE or FALSE; Was this account set as a result of a selection 
+    @param selected_manually TRUE or FALSE; Was this account set as a result of a selection
     by the user or by an algorithm?
 */
-void 
+void
 gnc_import_TransInfo_set_destacc (GNCImportTransInfo *info,
-				  Account *acc,
-				  gboolean selected_manually);
+                                  Account *acc,
+                                  gboolean selected_manually);
 
 /** Try to automatch a given transaction to a destination account */
 gboolean
 gnc_import_TransInfo_refresh_destacc (GNCImportTransInfo *transaction_info,
-				      GncImportMatchMap *matchmap);
+                                      GncImportMatchMap *matchmap);
 
 /** Returns if the currently selected destination account for auto-matching was selected by the user. */
 gboolean
@@ -231,13 +232,13 @@
 /**@{*/
 
 /** Get the split ('this-side split') of this MatchInfo. */
-Split * 
+Split *
 gnc_import_MatchInfo_get_split (const GNCImportMatchInfo * info);
 
 
-/** Get the probability (confidence level) of this MatchInfo. 
+/** Get the probability (confidence level) of this MatchInfo.
 @param info Can be NULL, in which case the function returns 0*/
-gint 
+gint
 gnc_import_MatchInfo_get_probability (const GNCImportMatchInfo * info);
 /**@}*/
 

Modified: gnucash/trunk/src/import-export/import-commodity-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-commodity-matcher.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-commodity-matcher.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -21,7 +21,7 @@
 /**@internal
  @file import-commodity-matcher.c
   @brief  A Generic commodity matcher/picker
-  @author Copyright (C) 2002 Benoit Grégoire <bock at step.polymtl.ca>    
+  @author Copyright (C) 2002 Benoit Grégoire <bock at step.polymtl.ca>
  */
 #include "config.h"
 
@@ -52,94 +52,94 @@
 
 
 gnc_commodity * gnc_import_select_commodity(char * cusip,
-				    char auto_create,
-				    char * default_fullname,
-				    char * default_mnemonic)
+        char auto_create,
+        char * default_fullname,
+        char * default_mnemonic)
 {
-  gnc_commodity_table * commodity_table = gnc_get_current_commodities ();
-  gnc_commodity * retval = NULL;
-  gnc_commodity * tmp_commodity = NULL;
-  char * tmp_namespace = NULL;
-  GList * commodity_list=NULL;
-  GList * namespace_list=NULL;
-  DEBUG("Default fullname received: %s",
-        default_fullname ? default_fullname : "(null)");
-  DEBUG("Default mnemonic received: %s",
-        default_mnemonic ? default_mnemonic : "(null)");
-  
-  DEBUG("Looking for commodity with exchange_code: %s", cusip);
+    gnc_commodity_table * commodity_table = gnc_get_current_commodities ();
+    gnc_commodity * retval = NULL;
+    gnc_commodity * tmp_commodity = NULL;
+    char * tmp_namespace = NULL;
+    GList * commodity_list = NULL;
+    GList * namespace_list = NULL;
+    DEBUG("Default fullname received: %s",
+          default_fullname ? default_fullname : "(null)");
+    DEBUG("Default mnemonic received: %s",
+          default_mnemonic ? default_mnemonic : "(null)");
 
-  namespace_list = gnc_commodity_table_get_namespaces(commodity_table);
+    DEBUG("Looking for commodity with exchange_code: %s", cusip);
 
+    namespace_list = gnc_commodity_table_get_namespaces(commodity_table);
 
-  namespace_list = g_list_first(namespace_list);
-  while( namespace_list!=NULL&&retval==NULL)
+
+    namespace_list = g_list_first(namespace_list);
+    while ( namespace_list != NULL && retval == NULL)
     {
-      tmp_namespace=namespace_list->data;
-      DEBUG("Looking at namespace %s",tmp_namespace);
-      
+        tmp_namespace = namespace_list->data;
+        DEBUG("Looking at namespace %s", tmp_namespace);
 
-      /*Nested loop*/
-      commodity_list = gnc_commodity_table_get_commodities(commodity_table,
-							   tmp_namespace);
-      commodity_list  = g_list_first(commodity_list);
-      while( commodity_list!=NULL&&retval==NULL)
-	{
-	  tmp_commodity=commodity_list->data;
-	  DEBUG("Looking at commodity %s",gnc_commodity_get_fullname(tmp_commodity));
-	  
-	  if(gnc_commodity_get_cusip(tmp_commodity)!=NULL &&
-	     cusip != NULL &&
-	     strncmp(gnc_commodity_get_cusip(tmp_commodity),cusip,strlen(cusip))==0)
-	    {
-	      retval = tmp_commodity;
-	      DEBUG("Commodity %s%s",gnc_commodity_get_fullname(retval)," matches.");
-	    }    
-	  commodity_list=g_list_next(commodity_list);
-	}  
-      /*End nested loop*/
 
-      namespace_list=g_list_next(namespace_list);
-    }  
-  
+        /*Nested loop*/
+        commodity_list = gnc_commodity_table_get_commodities(commodity_table,
+                         tmp_namespace);
+        commodity_list  = g_list_first(commodity_list);
+        while ( commodity_list != NULL && retval == NULL)
+        {
+            tmp_commodity = commodity_list->data;
+            DEBUG("Looking at commodity %s", gnc_commodity_get_fullname(tmp_commodity));
 
+            if (gnc_commodity_get_cusip(tmp_commodity) != NULL &&
+                    cusip != NULL &&
+                    strncmp(gnc_commodity_get_cusip(tmp_commodity), cusip, strlen(cusip)) == 0)
+            {
+                retval = tmp_commodity;
+                DEBUG("Commodity %s%s", gnc_commodity_get_fullname(retval), " matches.");
+            }
+            commodity_list = g_list_next(commodity_list);
+        }
+        /*End nested loop*/
 
-  
-  g_list_free(commodity_list);
-  g_list_free(namespace_list);
+        namespace_list = g_list_next(namespace_list);
+    }
 
-  if(retval==NULL && auto_create != 0)
+
+
+
+    g_list_free(commodity_list);
+    g_list_free(namespace_list);
+
+    if (retval == NULL && auto_create != 0)
     {
-      const gchar *message = 
-        _("Please select a commodity to match the following exchange "
-	  "specific code. Please note that the exchange code of the "
-	  "commodity you select will be overwritten.");
-      retval=gnc_ui_select_commodity_modal_full(NULL,
-						NULL,
-						DIAG_COMM_ALL,
-						message,
-						cusip,
-						default_fullname,
-						default_mnemonic);
-      
+        const gchar *message =
+            _("Please select a commodity to match the following exchange "
+              "specific code. Please note that the exchange code of the "
+              "commodity you select will be overwritten.");
+        retval = gnc_ui_select_commodity_modal_full(NULL,
+                 NULL,
+                 DIAG_COMM_ALL,
+                 message,
+                 cusip,
+                 default_fullname,
+                 default_mnemonic);
+
     }
-  /* There seems to be a problem here - if the matched commodity does not
-     have a cusip defined (gnc_commodity_get_cusip returns NULL) then
-     it does not get overwritten - which is not consistent with the
-     message - so Im adding it to do this.  Looks like this is all
-     that was needed to fix the cash value used as stock units problem
-     for pre-defined commodities which didnt have the cusip defined! */
-  if (retval != NULL&&
-      gnc_commodity_get_cusip(retval)!=NULL &&
-      cusip != NULL &&
-      (strncmp(gnc_commodity_get_cusip(retval),cusip,strlen(cusip))!=0))
+    /* There seems to be a problem here - if the matched commodity does not
+       have a cusip defined (gnc_commodity_get_cusip returns NULL) then
+       it does not get overwritten - which is not consistent with the
+       message - so Im adding it to do this.  Looks like this is all
+       that was needed to fix the cash value used as stock units problem
+       for pre-defined commodities which didnt have the cusip defined! */
+    if (retval != NULL &&
+            gnc_commodity_get_cusip(retval) != NULL &&
+            cusip != NULL &&
+            (strncmp(gnc_commodity_get_cusip(retval), cusip, strlen(cusip)) != 0))
     {
-      gnc_commodity_set_cusip(retval, cusip);
+        gnc_commodity_set_cusip(retval, cusip);
     }
-  else if (gnc_commodity_get_cusip(retval)==NULL && cusip != NULL)
+    else if (gnc_commodity_get_cusip(retval) == NULL && cusip != NULL)
     {
-      gnc_commodity_set_cusip(retval, cusip);
+        gnc_commodity_set_cusip(retval, cusip);
     }
-  return retval;
+    return retval;
 };
 /**@}*/

Modified: gnucash/trunk/src/import-export/import-commodity-matcher.h
===================================================================
--- gnucash/trunk/src/import-export/import-commodity-matcher.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-commodity-matcher.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,7 +20,7 @@
     @{ */
 /** @file import-commodity-matcher.h
   @brief A Generic commodity matcher/picker
-  @author Copyright (C) 2002 Benoit Grégoire <bock at step.polymtl.ca>    
+  @author Copyright (C) 2002 Benoit Grégoire <bock at step.polymtl.ca>
  */
 #ifndef IMPORT_COMMODITY_MATCHER_H
 #define IMPORT_COMMODITY_MATCHER_H
@@ -32,7 +32,7 @@
   commodity.  If an commodity with a matching cusip is
   found, the function immediately returns with a pointer to that
   commodity.  Otherwise, the user may be prompted to select a GnuCash
-  account or create a new one (in both cases, the cusip is 
+  account or create a new one (in both cases, the cusip is
   written to the commodity's cusip field, overwriting anything that
   was there before.
 
@@ -41,7 +41,7 @@
     The stock ticker is NOT appropriate, unless you have no other option.
 
     @param auto_create If 0, if the cusip value in unknown,
-    the function returns NULL, otherwise, the user will be asked to 
+    the function returns NULL, otherwise, the user will be asked to
     create a new account.
 
     @param default_fullname A human-readable description of the commodity, such
@@ -59,9 +59,9 @@
 
 */
 gnc_commodity * gnc_import_select_commodity(char * cusip,
-				    char auto_create,
-				    char * default_fullname,
-				    char * default_mnemonic);
+        char auto_create,
+        char * default_fullname,
+        char * default_mnemonic);
 
 #endif
 /**@}*/

Modified: gnucash/trunk/src/import-export/import-format-dialog.c
===================================================================
--- gnucash/trunk/src/import-export/import-format-dialog.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-format-dialog.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -40,100 +40,107 @@
 static void
 choice_option_changed (GtkWidget *widget, gint index, gpointer index_p)
 {
-  gint *my_index = index_p;
-  *my_index = index;
+    gint *my_index = index_p;
+    *my_index = index;
 }
 
 static GncImportFormat
 add_menu_and_run_dialog(GtkWidget *dialog, GtkWidget *menu_box, GncImportFormat fmt)
 {
-  GtkWidget *menu;
-  gint index = 0, count = 0;
-  GncImportFormat formats[MAX_CHOICES];
-  GNCOptionInfo menus[MAX_CHOICES];
+    GtkWidget *menu;
+    gint index = 0, count = 0;
+    GncImportFormat formats[MAX_CHOICES];
+    GNCOptionInfo menus[MAX_CHOICES];
 
-  memset(&menus, 0, sizeof(menus));
+    memset(&menus, 0, sizeof(menus));
 
-  if (fmt & GNCIF_NUM_PERIOD) {
-    formats[count] = GNCIF_NUM_PERIOD;
-    menus[count].name = _("Period: 123,456.78");
-    menus[count].callback = choice_option_changed;
-    menus[count].user_data = &index;
-    count++;
-  }
+    if (fmt & GNCIF_NUM_PERIOD)
+    {
+        formats[count] = GNCIF_NUM_PERIOD;
+        menus[count].name = _("Period: 123,456.78");
+        menus[count].callback = choice_option_changed;
+        menus[count].user_data = &index;
+        count++;
+    }
 
-  if (fmt & GNCIF_NUM_COMMA) {
-    formats[count] = GNCIF_NUM_COMMA;
-    menus[count].name = _("Comma: 123.456,78");
-    menus[count].callback = choice_option_changed;
-    menus[count].user_data = &index;
-    count++;
-  }
+    if (fmt & GNCIF_NUM_COMMA)
+    {
+        formats[count] = GNCIF_NUM_COMMA;
+        menus[count].name = _("Comma: 123.456,78");
+        menus[count].callback = choice_option_changed;
+        menus[count].user_data = &index;
+        count++;
+    }
 
-  if (fmt & GNCIF_DATE_MDY) {
-    formats[count] = GNCIF_DATE_MDY;
-    menus[count].name = _("m/d/y");
-    menus[count].callback = choice_option_changed;
-    menus[count].user_data = &index;
-    count++;
-  }
+    if (fmt & GNCIF_DATE_MDY)
+    {
+        formats[count] = GNCIF_DATE_MDY;
+        menus[count].name = _("m/d/y");
+        menus[count].callback = choice_option_changed;
+        menus[count].user_data = &index;
+        count++;
+    }
 
-  if (fmt & GNCIF_DATE_DMY) {
-    formats[count] = GNCIF_DATE_DMY;
-    menus[count].name = _("d/m/y");
-    menus[count].callback = choice_option_changed;
-    menus[count].user_data = &index;
-    count++;
-  }
+    if (fmt & GNCIF_DATE_DMY)
+    {
+        formats[count] = GNCIF_DATE_DMY;
+        menus[count].name = _("d/m/y");
+        menus[count].callback = choice_option_changed;
+        menus[count].user_data = &index;
+        count++;
+    }
 
-  if (fmt & GNCIF_DATE_YMD) {
-    formats[count] = GNCIF_DATE_YMD;
-    menus[count].name = _("y/m/d");
-    menus[count].callback = choice_option_changed;
-    menus[count].user_data = &index;
-    count++;
-  }
+    if (fmt & GNCIF_DATE_YMD)
+    {
+        formats[count] = GNCIF_DATE_YMD;
+        menus[count].name = _("y/m/d");
+        menus[count].callback = choice_option_changed;
+        menus[count].user_data = &index;
+        count++;
+    }
 
-  if (fmt & GNCIF_DATE_YDM) {
-    formats[count] = GNCIF_DATE_YDM;
-    menus[count].name = _("y/d/m");
-    menus[count].callback = choice_option_changed;
-    menus[count].user_data = &index;
-    count++;
-  }
+    if (fmt & GNCIF_DATE_YDM)
+    {
+        formats[count] = GNCIF_DATE_YDM;
+        menus[count].name = _("y/d/m");
+        menus[count].callback = choice_option_changed;
+        menus[count].user_data = &index;
+        count++;
+    }
 
-  g_assert(count > 1);
-  menu = gnc_build_option_menu(menus, count);
-  gtk_box_pack_start(GTK_BOX(menu_box), menu, TRUE, TRUE, 0);
+    g_assert(count > 1);
+    menu = gnc_build_option_menu(menus, count);
+    gtk_box_pack_start(GTK_BOX(menu_box), menu, TRUE, TRUE, 0);
 
-  gtk_widget_show_all(dialog);
-  gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
-  gtk_dialog_run(GTK_DIALOG(dialog));
-  gtk_widget_destroy(dialog);
+    gtk_widget_show_all(dialog);
+    gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
+    gtk_dialog_run(GTK_DIALOG(dialog));
+    gtk_widget_destroy(dialog);
 
-  return formats[index];
+    return formats[index];
 }
 
 GncImportFormat
 gnc_import_choose_fmt(const char* msg, GncImportFormat fmts, gpointer data)
-		      
+
 {
-  GladeXML *xml;
-  GtkWidget *dialog;
-  GtkWidget *widget;
+    GladeXML *xml;
+    GtkWidget *dialog;
+    GtkWidget *widget;
 
-  g_return_val_if_fail(fmts, FALSE);
+    g_return_val_if_fail(fmts, FALSE);
 
-  /* if there is only one format availble, just return it */
-  if (!(fmts & (fmts-1))) {
-    return fmts;
-  }
+    /* if there is only one format availble, just return it */
+    if (!(fmts & (fmts - 1)))
+    {
+        return fmts;
+    }
 
-  xml = gnc_glade_xml_new("generic-import.glade", "format_picker");
-  dialog = glade_xml_get_widget(xml, "format_picker");
-  widget = glade_xml_get_widget(xml, "msg_label");
-  gtk_label_set_text(GTK_LABEL(widget), msg);
+    xml = gnc_glade_xml_new("generic-import.glade", "format_picker");
+    dialog = glade_xml_get_widget(xml, "format_picker");
+    widget = glade_xml_get_widget(xml, "msg_label");
+    gtk_label_set_text(GTK_LABEL(widget), msg);
 
-  widget = glade_xml_get_widget(xml, "menu_box");
-  return add_menu_and_run_dialog(dialog, widget, fmts);
+    widget = glade_xml_get_widget(xml, "menu_box");
+    return add_menu_and_run_dialog(dialog, widget, fmts);
 }

Modified: gnucash/trunk/src/import-export/import-main-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-main-matcher.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-main-matcher.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,7 +22,7 @@
     @file import-main-matcher.c
     @brief Transaction matcher main window
     @author Copyright (C) 2002 Benoit Grégoire
-    @author Christian Stimming    
+    @author Christian Stimming
     @author Copyright (c) 2006 David Hampton <hampton at employees.org>
 */
 #include "config.h"
@@ -46,29 +46,30 @@
 
 struct _main_matcher_info
 {
-  GtkWidget *dialog;
-  GtkTreeView *view;
-  GNCImportSettings *user_settings;
-  GdkColor color_back_red;
-  GdkColor color_back_green;
-  GdkColor color_back_yellow;
-  int selected_row;
+    GtkWidget *dialog;
+    GtkTreeView *view;
+    GNCImportSettings *user_settings;
+    GdkColor color_back_red;
+    GdkColor color_back_green;
+    GdkColor color_back_yellow;
+    int selected_row;
 };
 
-enum downloaded_cols {
-  DOWNLOADED_COL_DATE = 0,
-  DOWNLOADED_COL_ACCOUNT,
-  DOWNLOADED_COL_AMOUNT,
-  DOWNLOADED_COL_DESCRIPTION,
-  DOWNLOADED_COL_MEMO,
-  DOWNLOADED_COL_ACTION_ADD,
-  DOWNLOADED_COL_ACTION_CLEAR,
-  DOWNLOADED_COL_ACTION_EDIT,
-  DOWNLOADED_COL_ACTION_INFO,
-  DOWNLOADED_COL_ACTION_PIXBUF,
-  DOWNLOADED_COL_DATA,
-  DOWNLOADED_COL_COLOR,
-  NUM_DOWNLOADED_COLS
+enum downloaded_cols
+{
+    DOWNLOADED_COL_DATE = 0,
+    DOWNLOADED_COL_ACCOUNT,
+    DOWNLOADED_COL_AMOUNT,
+    DOWNLOADED_COL_DESCRIPTION,
+    DOWNLOADED_COL_MEMO,
+    DOWNLOADED_COL_ACTION_ADD,
+    DOWNLOADED_COL_ACTION_CLEAR,
+    DOWNLOADED_COL_ACTION_EDIT,
+    DOWNLOADED_COL_ACTION_INFO,
+    DOWNLOADED_COL_ACTION_PIXBUF,
+    DOWNLOADED_COL_DATA,
+    DOWNLOADED_COL_COLOR,
+    NUM_DOWNLOADED_COLS
 };
 
 #define COLOR_RED    "brown1"
@@ -80,696 +81,704 @@
 /* Local prototypes */
 static void
 automatch_store_transactions(GNCImportMainMatcher *info,
-			     GtkTreeModel *model,
-			     GtkTreeIter *iter,
-			     GNCImportTransInfo *trans_info);
+                             GtkTreeModel *model,
+                             GtkTreeIter *iter,
+                             GNCImportTransInfo *trans_info);
 static void
 refresh_model_row(GNCImportMainMatcher *gui, GtkTreeModel *model,
-		  GtkTreeIter *iter, GNCImportTransInfo *info);
+                  GtkTreeIter *iter, GNCImportTransInfo *info);
 
 void gnc_gen_trans_list_delete (GNCImportMainMatcher *info)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  GNCImportTransInfo *trans_info;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    GNCImportTransInfo *trans_info;
 
-  if (info == NULL) 
-    return;
+    if (info == NULL)
+        return;
 
-  model = gtk_tree_view_get_model(info->view);
-  if (gtk_tree_model_get_iter_first(model, &iter)) {
-    do {
-      gtk_tree_model_get(model, &iter,
-		         DOWNLOADED_COL_DATA, &trans_info,
-		         -1);
-      gnc_import_TransInfo_delete(trans_info);
-    } while (gtk_tree_model_iter_next (model, &iter));
-  }
+    model = gtk_tree_view_get_model(info->view);
+    if (gtk_tree_model_get_iter_first(model, &iter))
+    {
+        do
+        {
+            gtk_tree_model_get(model, &iter,
+                               DOWNLOADED_COL_DATA, &trans_info,
+                               -1);
+            gnc_import_TransInfo_delete(trans_info);
+        }
+        while (gtk_tree_model_iter_next (model, &iter));
+    }
 
-  gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->dialog));
-  gnc_import_Settings_delete (info->user_settings);
-  gtk_widget_destroy (GTK_WIDGET (info->dialog));
-  g_free (info);
+    gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->dialog));
+    gnc_import_Settings_delete (info->user_settings);
+    gtk_widget_destroy (GTK_WIDGET (info->dialog));
+    g_free (info);
 }
 
-static void 
+static void
 on_matcher_ok_clicked (GtkButton *button,
-		       GNCImportMainMatcher *info)
+                       GNCImportMainMatcher *info)
 {
-  GtkTreeModel *model;
-  GtkTreePath *path;
-  GtkTreeRowReference *ref;
-  GtkTreeIter iter;
-  GNCImportTransInfo *trans_info;
-  GSList *refs_list = NULL, *item;
+    GtkTreeModel *model;
+    GtkTreePath *path;
+    GtkTreeRowReference *ref;
+    GtkTreeIter iter;
+    GNCImportTransInfo *trans_info;
+    GSList *refs_list = NULL, *item;
 
-  g_assert (info);
+    g_assert (info);
 
-  /*   DEBUG ("Begin") */
+    /*   DEBUG ("Begin") */
 
-  model = gtk_tree_view_get_model(info->view);
-  if (!gtk_tree_model_get_iter_first(model, &iter))
-    return;
+    model = gtk_tree_view_get_model(info->view);
+    if (!gtk_tree_model_get_iter_first(model, &iter))
+        return;
 
-  do {
-    gtk_tree_model_get(model, &iter,
-		       DOWNLOADED_COL_DATA, &trans_info,
-		       -1);
-    if (gnc_import_process_trans_item (NULL, trans_info)) {
-      path = gtk_tree_model_get_path(model, &iter);
-      ref = gtk_tree_row_reference_new(model, path);
-      refs_list = g_slist_append(refs_list, ref);
-      gtk_tree_path_free(path);
+    do
+    {
+        gtk_tree_model_get(model, &iter,
+                           DOWNLOADED_COL_DATA, &trans_info,
+                           -1);
+        if (gnc_import_process_trans_item (NULL, trans_info))
+        {
+            path = gtk_tree_model_get_path(model, &iter);
+            ref = gtk_tree_row_reference_new(model, path);
+            refs_list = g_slist_append(refs_list, ref);
+            gtk_tree_path_free(path);
+        }
     }
-  } while (gtk_tree_model_iter_next (model, &iter));
+    while (gtk_tree_model_iter_next (model, &iter));
 
-  /* DEBUG ("Deleting") */
-  /* DRH: Is this necessary. Isn't the call to trans_list_delete at
-     the end of this routine going to destroy the entire list store
-     anyway? */
-  for (item = refs_list; item; item = g_slist_next(item)) {
-    ref = item->data;
-    path =  gtk_tree_row_reference_get_path(ref);
-    if (gtk_tree_model_get_iter(model, &iter, path))
-      gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
-    gtk_tree_path_free(path);
-    gtk_tree_row_reference_free(ref);
-  }
-  g_slist_free(refs_list);
+    /* DEBUG ("Deleting") */
+    /* DRH: Is this necessary. Isn't the call to trans_list_delete at
+       the end of this routine going to destroy the entire list store
+       anyway? */
+    for (item = refs_list; item; item = g_slist_next(item))
+    {
+        ref = item->data;
+        path =  gtk_tree_row_reference_get_path(ref);
+        if (gtk_tree_model_get_iter(model, &iter, path))
+            gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+        gtk_tree_path_free(path);
+        gtk_tree_row_reference_free(ref);
+    }
+    g_slist_free(refs_list);
 
-  gnc_gen_trans_list_delete (info);
-  /* DEBUG ("End") */
+    gnc_gen_trans_list_delete (info);
+    /* DEBUG ("End") */
 }
 
-static void 
+static void
 on_matcher_cancel_clicked (GtkButton *button,
-			   gpointer user_data)
+                           gpointer user_data)
 {
-  GNCImportMainMatcher *info = user_data;
-  gnc_gen_trans_list_delete (info);
+    GNCImportMainMatcher *info = user_data;
+    gnc_gen_trans_list_delete (info);
 }
 
-static void 
+static void
 on_matcher_help_close_clicked (GtkButton *button,
-			       gpointer user_data)
+                               gpointer user_data)
 {
-  GtkWidget *help_dialog = user_data;
+    GtkWidget *help_dialog = user_data;
 
-  gtk_widget_destroy(help_dialog);
+    gtk_widget_destroy(help_dialog);
 }
 
-static void 
+static void
 on_matcher_help_clicked (GtkButton *button,
-			 gpointer user_data)
+                         gpointer user_data)
 {
-  GNCImportMainMatcher *info = user_data;
-  GladeXML *xml;
-  GtkWidget *help_dialog, *box;
-  
-  xml = gnc_glade_xml_new ("generic-import.glade", "matcher_help");
+    GNCImportMainMatcher *info = user_data;
+    GladeXML *xml;
+    GtkWidget *help_dialog, *box;
 
-  box = glade_xml_get_widget (xml, "red");
-  gtk_widget_modify_bg(box, GTK_STATE_NORMAL, &info->color_back_red);
-  box = glade_xml_get_widget (xml, "yellow");
-  gtk_widget_modify_bg(box, GTK_STATE_NORMAL, &info->color_back_yellow);
-  box = glade_xml_get_widget (xml, "green");
-  gtk_widget_modify_bg(box, GTK_STATE_NORMAL, &info->color_back_green);
+    xml = gnc_glade_xml_new ("generic-import.glade", "matcher_help");
 
-  help_dialog = glade_xml_get_widget (xml, "matcher_help");
-  gtk_window_set_transient_for(GTK_WINDOW(help_dialog),
-			       GTK_WINDOW(info->dialog));
+    box = glade_xml_get_widget (xml, "red");
+    gtk_widget_modify_bg(box, GTK_STATE_NORMAL, &info->color_back_red);
+    box = glade_xml_get_widget (xml, "yellow");
+    gtk_widget_modify_bg(box, GTK_STATE_NORMAL, &info->color_back_yellow);
+    box = glade_xml_get_widget (xml, "green");
+    gtk_widget_modify_bg(box, GTK_STATE_NORMAL, &info->color_back_green);
 
-  glade_xml_signal_connect_data(xml, "on_matcher_help_close_clicked",
-				G_CALLBACK(on_matcher_help_close_clicked), 
-				help_dialog);
+    help_dialog = glade_xml_get_widget (xml, "matcher_help");
+    gtk_window_set_transient_for(GTK_WINDOW(help_dialog),
+                                 GTK_WINDOW(info->dialog));
 
-  gtk_widget_show(help_dialog);
+    glade_xml_signal_connect_data(xml, "on_matcher_help_close_clicked",
+                                  G_CALLBACK(on_matcher_help_close_clicked),
+                                  help_dialog);
+
+    gtk_widget_show(help_dialog);
 }
 
-static void 
-run_account_picker_dialog (GNCImportMainMatcher *info, 
-			   GtkTreeModel *model,
-			   GtkTreeIter *iter,
-			   GNCImportTransInfo *trans_info)
+static void
+run_account_picker_dialog (GNCImportMainMatcher *info,
+                           GtkTreeModel *model,
+                           GtkTreeIter *iter,
+                           GNCImportTransInfo *trans_info)
 {
-  Account *old_acc, *new_acc;
-  gboolean ok_pressed;
-  g_assert (trans_info);
-  old_acc = gnc_import_TransInfo_get_destacc (trans_info);
-  new_acc = gnc_import_select_account(info->dialog,
-				      NULL,
-				      TRUE,
-				      _("Destination account for the auto-balance split."),
-				      xaccTransGetCurrency(gnc_import_TransInfo_get_trans(trans_info)),
-				      ACCT_TYPE_NONE,
-				      old_acc,
-				      &ok_pressed);
-  if(ok_pressed)
+    Account *old_acc, *new_acc;
+    gboolean ok_pressed;
+    g_assert (trans_info);
+    old_acc = gnc_import_TransInfo_get_destacc (trans_info);
+    new_acc = gnc_import_select_account(info->dialog,
+                                        NULL,
+                                        TRUE,
+                                        _("Destination account for the auto-balance split."),
+                                        xaccTransGetCurrency(gnc_import_TransInfo_get_trans(trans_info)),
+                                        ACCT_TYPE_NONE,
+                                        old_acc,
+                                        &ok_pressed);
+    if (ok_pressed)
     {
-      gnc_import_TransInfo_set_destacc (trans_info,
-					new_acc,
-					TRUE);
+        gnc_import_TransInfo_set_destacc (trans_info,
+                                          new_acc,
+                                          TRUE);
 
-      /* Iterate through the transactions in a given clist to auto match them */
-      automatch_store_transactions(info, model, iter, trans_info);
+        /* Iterate through the transactions in a given clist to auto match them */
+        automatch_store_transactions(info, model, iter, trans_info);
     }
 }
 
-static void 
-run_match_dialog (GNCImportMainMatcher *info, 
-		  GNCImportTransInfo *trans_info)
+static void
+run_match_dialog (GNCImportMainMatcher *info,
+                  GNCImportTransInfo *trans_info)
 {
-  gnc_import_match_picker_run_and_close (trans_info);
+    gnc_import_match_picker_run_and_close (trans_info);
 }
 
 static void
 gnc_gen_trans_add_toggled_cb (GtkCellRendererToggle *cell_renderer,
-			      gchar                 *path,
-			      GNCImportMainMatcher  *gui)
+                              gchar                 *path,
+                              GNCImportMainMatcher  *gui)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  GNCImportTransInfo *trans_info;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    GNCImportTransInfo *trans_info;
 
-  model = gtk_tree_view_get_model(gui->view);
-  if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
-    return;
-  gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
+    model = gtk_tree_view_get_model(gui->view);
+    if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
+        return;
+    gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
 
-  if( gnc_import_TransInfo_get_action(trans_info)==GNCImport_ADD 
-      && gnc_import_Settings_get_action_skip_enabled (gui->user_settings)==TRUE)
+    if ( gnc_import_TransInfo_get_action(trans_info) == GNCImport_ADD
+            && gnc_import_Settings_get_action_skip_enabled (gui->user_settings) == TRUE)
     {
-      gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
+        gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
     }
-  else
+    else
     {
-      gnc_import_TransInfo_set_action(trans_info, GNCImport_ADD);
+        gnc_import_TransInfo_set_action(trans_info, GNCImport_ADD);
     }
-  refresh_model_row(gui, model, &iter, trans_info);
+    refresh_model_row(gui, model, &iter, trans_info);
 }
 
 static void
 gnc_gen_trans_clear_toggled_cb (GtkCellRendererToggle *cell_renderer,
-				gchar                 *path,
-				GNCImportMainMatcher  *gui)
+                                gchar                 *path,
+                                GNCImportMainMatcher  *gui)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  GNCImportTransInfo *trans_info;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    GNCImportTransInfo *trans_info;
 
-  model = gtk_tree_view_get_model(gui->view);
-  if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
-    return;
-  gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
+    model = gtk_tree_view_get_model(gui->view);
+    if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
+        return;
+    gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
 
-  if( gnc_import_TransInfo_get_action(trans_info)==GNCImport_CLEAR
-      && gnc_import_Settings_get_action_skip_enabled (gui->user_settings)==TRUE)
+    if ( gnc_import_TransInfo_get_action(trans_info) == GNCImport_CLEAR
+            && gnc_import_Settings_get_action_skip_enabled (gui->user_settings) == TRUE)
     {
-      gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
+        gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
     }
-  else
+    else
     {
-      gnc_import_TransInfo_set_action(trans_info, GNCImport_CLEAR);
+        gnc_import_TransInfo_set_action(trans_info, GNCImport_CLEAR);
     }
-  refresh_model_row(gui, model, &iter, trans_info);
+    refresh_model_row(gui, model, &iter, trans_info);
 }
 
 static void
 gnc_gen_trans_edit_toggled_cb (GtkCellRendererToggle *cell_renderer,
-			       gchar                 *path,
-			       GNCImportMainMatcher  *gui)
+                               gchar                 *path,
+                               GNCImportMainMatcher  *gui)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  GNCImportTransInfo *trans_info;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    GNCImportTransInfo *trans_info;
 
-  model = gtk_tree_view_get_model(gui->view);
-  if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
-    return;
-  gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
+    model = gtk_tree_view_get_model(gui->view);
+    if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
+        return;
+    gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
 
-  if( gnc_import_TransInfo_get_action(trans_info)==GNCImport_EDIT
-      && gnc_import_Settings_get_action_skip_enabled (gui->user_settings)==TRUE)
+    if ( gnc_import_TransInfo_get_action(trans_info) == GNCImport_EDIT
+            && gnc_import_Settings_get_action_skip_enabled (gui->user_settings) == TRUE)
     {
-      gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
+        gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
     }
-  else
+    else
     {
-      gnc_import_TransInfo_set_action(trans_info, GNCImport_EDIT);
+        gnc_import_TransInfo_set_action(trans_info, GNCImport_EDIT);
     }
-  refresh_model_row(gui, model, &iter, trans_info);
+    refresh_model_row(gui, model, &iter, trans_info);
 }
 
 static void
 gnc_gen_trans_row_activated_cb (GtkTreeView           *view,
-				GtkTreePath           *path,
-				GtkTreeViewColumn     *column,
-				GNCImportMainMatcher  *gui)    
+                                GtkTreePath           *path,
+                                GtkTreeViewColumn     *column,
+                                GNCImportMainMatcher  *gui)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  GNCImportTransInfo *trans_info;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    GNCImportTransInfo *trans_info;
 
-  model = gtk_tree_view_get_model(gui->view);
-  if (!gtk_tree_model_get_iter(model, &iter, path))
-    return;
-  gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
+    model = gtk_tree_view_get_model(gui->view);
+    if (!gtk_tree_model_get_iter(model, &iter, path))
+        return;
+    gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
 
-  switch(gnc_import_TransInfo_get_action (trans_info))
+    switch (gnc_import_TransInfo_get_action (trans_info))
     {
     case GNCImport_ADD:
-      if (gnc_import_TransInfo_is_balanced(trans_info) == FALSE) {
-	run_account_picker_dialog (gui, model, &iter, trans_info);
-      }
-      break;
+        if (gnc_import_TransInfo_is_balanced(trans_info) == FALSE)
+        {
+            run_account_picker_dialog (gui, model, &iter, trans_info);
+        }
+        break;
     case GNCImport_CLEAR:
-      run_match_dialog (gui, trans_info);
-      break;
+        run_match_dialog (gui, trans_info);
+        break;
     case GNCImport_SKIP:
-      /*The information displayed is only informative, until you select an action*/
-      break;
+        /*The information displayed is only informative, until you select an action*/
+        break;
     default:
-      PERR("I don't know what to do! (Yet...)");
+        PERR("I don't know what to do! (Yet...)");
     }
-  refresh_model_row(gui, model, &iter, trans_info);
+    refresh_model_row(gui, model, &iter, trans_info);
 }
 
 static void
 gnc_gen_trans_row_changed_cb (GtkTreeSelection *selection,
-			      GNCImportMainMatcher *gui)
+                              GNCImportMainMatcher *gui)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  if (!gtk_tree_selection_get_selected(selection, &model, &iter))
-    return;
-  gtk_tree_selection_unselect_iter(selection, &iter);
+    if (!gtk_tree_selection_get_selected(selection, &model, &iter))
+        return;
+    gtk_tree_selection_unselect_iter(selection, &iter);
 }
 
 static GtkTreeViewColumn *
 add_text_column(GtkTreeView *view, const gchar *title, int col_num)
 {
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
- 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes
-    (title, renderer,
-     "text", col_num,
-     "background", DOWNLOADED_COL_COLOR,
-     NULL);
-  gtk_tree_view_column_set_sort_column_id(column, col_num);
-  g_object_set(G_OBJECT(column),
-	       "reorderable", TRUE,
-	       "resizable", TRUE,
-	       NULL);
-  gtk_tree_view_append_column(view, column);
-  return column;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes
+             (title, renderer,
+              "text", col_num,
+              "background", DOWNLOADED_COL_COLOR,
+              NULL);
+    gtk_tree_view_column_set_sort_column_id(column, col_num);
+    g_object_set(G_OBJECT(column),
+                 "reorderable", TRUE,
+                 "resizable", TRUE,
+                 NULL);
+    gtk_tree_view_append_column(view, column);
+    return column;
 }
 
 static GtkTreeViewColumn *
 add_toggle_column(GtkTreeView *view, const gchar *title, int col_num,
-		  GCallback cb_fn, gpointer cb_arg)
+                  GCallback cb_fn, gpointer cb_arg)
 {
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
- 
-  renderer = gtk_cell_renderer_toggle_new();
-  column = gtk_tree_view_column_new_with_attributes
-    (title, renderer,
-     "active", col_num,
-     "cell-background", DOWNLOADED_COL_COLOR,
-     NULL);
-  gtk_tree_view_column_set_sort_column_id(column, col_num);
-  g_object_set(G_OBJECT(column),
-	       "reorderable", TRUE,
-	       NULL);
-  g_signal_connect(renderer, "toggled", cb_fn, cb_arg);
-  gtk_tree_view_append_column(view, column);
-  return column;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+
+    renderer = gtk_cell_renderer_toggle_new();
+    column = gtk_tree_view_column_new_with_attributes
+             (title, renderer,
+              "active", col_num,
+              "cell-background", DOWNLOADED_COL_COLOR,
+              NULL);
+    gtk_tree_view_column_set_sort_column_id(column, col_num);
+    g_object_set(G_OBJECT(column),
+                 "reorderable", TRUE,
+                 NULL);
+    g_signal_connect(renderer, "toggled", cb_fn, cb_arg);
+    gtk_tree_view_append_column(view, column);
+    return column;
 }
 
 static void
 gnc_gen_trans_init_view (GNCImportMainMatcher *info,
-			 gboolean show_account,
-			 gboolean show_edit)
+                         gboolean show_account,
+                         gboolean show_edit)
 {
-  GtkTreeView *view;
-  GtkListStore *store;
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
-  GtkTreeSelection *selection;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+    GtkTreeSelection *selection;
 
-  view = info->view;
-  store = gtk_list_store_new(NUM_DOWNLOADED_COLS,
-			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
-			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN,
-			     G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING,
-			     GDK_TYPE_PIXBUF, G_TYPE_POINTER, G_TYPE_STRING);
-  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    view = info->view;
+    store = gtk_list_store_new(NUM_DOWNLOADED_COLS,
+                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN,
+                               G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING,
+                               GDK_TYPE_PIXBUF, G_TYPE_POINTER, G_TYPE_STRING);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-  /* Add the columns */
-  add_text_column(view, _("Date"), DOWNLOADED_COL_DATE);
-  column = add_text_column(view, _("Account"), DOWNLOADED_COL_ACCOUNT);
-  gtk_tree_view_column_set_visible(column, show_account);
-  add_text_column(view, _("Amount"), DOWNLOADED_COL_AMOUNT);
-  add_text_column(view, _("Description"), DOWNLOADED_COL_DESCRIPTION);
-  add_text_column(view, _("Memo"), DOWNLOADED_COL_MEMO);
-  add_toggle_column(view, _("A"), DOWNLOADED_COL_ACTION_ADD,
-		    G_CALLBACK(gnc_gen_trans_add_toggled_cb), info);
-  add_toggle_column(view, _("R"), DOWNLOADED_COL_ACTION_CLEAR,
-		    G_CALLBACK(gnc_gen_trans_clear_toggled_cb), info);
-  column = add_toggle_column(view, _("Edit"), DOWNLOADED_COL_ACTION_EDIT,
-			     G_CALLBACK(gnc_gen_trans_edit_toggled_cb), info);
-  gtk_tree_view_column_set_visible(column, show_edit);
+    /* Add the columns */
+    add_text_column(view, _("Date"), DOWNLOADED_COL_DATE);
+    column = add_text_column(view, _("Account"), DOWNLOADED_COL_ACCOUNT);
+    gtk_tree_view_column_set_visible(column, show_account);
+    add_text_column(view, _("Amount"), DOWNLOADED_COL_AMOUNT);
+    add_text_column(view, _("Description"), DOWNLOADED_COL_DESCRIPTION);
+    add_text_column(view, _("Memo"), DOWNLOADED_COL_MEMO);
+    add_toggle_column(view, _("A"), DOWNLOADED_COL_ACTION_ADD,
+                      G_CALLBACK(gnc_gen_trans_add_toggled_cb), info);
+    add_toggle_column(view, _("R"), DOWNLOADED_COL_ACTION_CLEAR,
+                      G_CALLBACK(gnc_gen_trans_clear_toggled_cb), info);
+    column = add_toggle_column(view, _("Edit"), DOWNLOADED_COL_ACTION_EDIT,
+                               G_CALLBACK(gnc_gen_trans_edit_toggled_cb), info);
+    gtk_tree_view_column_set_visible(column, show_edit);
 
 
-  /* The last column has multiple renderers */
-  renderer = gtk_cell_renderer_pixbuf_new();
-  g_object_set(renderer, "xalign", 0.0, NULL);
-  column = gtk_tree_view_column_new_with_attributes(_("Info"), renderer,
-				      "pixbuf", DOWNLOADED_COL_ACTION_PIXBUF,
-				      "cell-background", DOWNLOADED_COL_COLOR,
-				      NULL);
-  renderer = gtk_cell_renderer_text_new();
-  gtk_tree_view_column_pack_start(column, renderer, TRUE);
-  gtk_tree_view_column_set_attributes(column, renderer,
-				      "text", DOWNLOADED_COL_ACTION_INFO,
-				      "background", DOWNLOADED_COL_COLOR,
-				      NULL);
-  gtk_tree_view_column_set_sort_column_id(column, DOWNLOADED_COL_ACTION_INFO);
-  g_object_set(G_OBJECT(column),
-	       "reorderable", TRUE,
-	       "resizable", TRUE,
-	       NULL);
-  gtk_tree_view_append_column(info->view, column);
+    /* The last column has multiple renderers */
+    renderer = gtk_cell_renderer_pixbuf_new();
+    g_object_set(renderer, "xalign", 0.0, NULL);
+    column = gtk_tree_view_column_new_with_attributes(_("Info"), renderer,
+             "pixbuf", DOWNLOADED_COL_ACTION_PIXBUF,
+             "cell-background", DOWNLOADED_COL_COLOR,
+             NULL);
+    renderer = gtk_cell_renderer_text_new();
+    gtk_tree_view_column_pack_start(column, renderer, TRUE);
+    gtk_tree_view_column_set_attributes(column, renderer,
+                                        "text", DOWNLOADED_COL_ACTION_INFO,
+                                        "background", DOWNLOADED_COL_COLOR,
+                                        NULL);
+    gtk_tree_view_column_set_sort_column_id(column, DOWNLOADED_COL_ACTION_INFO);
+    g_object_set(G_OBJECT(column),
+                 "reorderable", TRUE,
+                 "resizable", TRUE,
+                 NULL);
+    gtk_tree_view_append_column(info->view, column);
 
 
-  selection = gtk_tree_view_get_selection(info->view);
-  g_signal_connect(info->view, "row-activated",
-		   G_CALLBACK(gnc_gen_trans_row_activated_cb), info);
-  g_signal_connect(selection, "changed",
-		   G_CALLBACK(gnc_gen_trans_row_changed_cb), info);
+    selection = gtk_tree_view_get_selection(info->view);
+    g_signal_connect(info->view, "row-activated",
+                     G_CALLBACK(gnc_gen_trans_row_activated_cb), info);
+    g_signal_connect(selection, "changed",
+                     G_CALLBACK(gnc_gen_trans_row_changed_cb), info);
 }
 
-GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent, 
-					      const gchar* heading,
-					      gboolean all_from_same_account,
-					      gint match_date_hardlimit)
+GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
+        const gchar* heading,
+        gboolean all_from_same_account,
+        gint match_date_hardlimit)
 {
-  GNCImportMainMatcher *info;
-  GladeXML *xml;
-  GtkWidget *heading_label;
-  gboolean show_edit;
-  
-  info = g_new0 (GNCImportMainMatcher, 1);
+    GNCImportMainMatcher *info;
+    GladeXML *xml;
+    GtkWidget *heading_label;
+    gboolean show_edit;
 
-  /* Initialize user Settings. */
-  info->user_settings = gnc_import_Settings_new ();
-  gnc_import_Settings_set_match_date_hardlimit (info->user_settings, match_date_hardlimit);
+    info = g_new0 (GNCImportMainMatcher, 1);
 
-  /* Initialize the GtkDialog. */
-  xml = gnc_glade_xml_new ("generic-import.glade", "transaction_matcher");
+    /* Initialize user Settings. */
+    info->user_settings = gnc_import_Settings_new ();
+    gnc_import_Settings_set_match_date_hardlimit (info->user_settings, match_date_hardlimit);
 
-  info->dialog = glade_xml_get_widget (xml, "transaction_matcher");
-  g_assert (info->dialog != NULL);
-  info->view = GTK_TREE_VIEW(glade_xml_get_widget (xml, "downloaded_view"));
-  g_assert (info->view != NULL);
+    /* Initialize the GtkDialog. */
+    xml = gnc_glade_xml_new ("generic-import.glade", "transaction_matcher");
 
-  show_edit = gnc_import_Settings_get_action_edit_enabled (info->user_settings);
-  gnc_gen_trans_init_view(info, all_from_same_account, show_edit);
-  heading_label = glade_xml_get_widget (xml, "heading_label");
-  g_assert (heading_label != NULL);
+    info->dialog = glade_xml_get_widget (xml, "transaction_matcher");
+    g_assert (info->dialog != NULL);
+    info->view = GTK_TREE_VIEW(glade_xml_get_widget (xml, "downloaded_view"));
+    g_assert (info->view != NULL);
 
-  /* if (parent)
-    gtk_window_set_transient_for (GTK_WINDOW (info->dialog), 
-				  GTK_WINDOW (parent));*/
+    show_edit = gnc_import_Settings_get_action_edit_enabled (info->user_settings);
+    gnc_gen_trans_init_view(info, all_from_same_account, show_edit);
+    heading_label = glade_xml_get_widget (xml, "heading_label");
+    g_assert (heading_label != NULL);
 
-  /* Connect signals */
-  glade_xml_signal_connect_data(xml, "on_matcher_ok_clicked", 
-				G_CALLBACK(on_matcher_ok_clicked),
-				info);
-  glade_xml_signal_connect_data(xml, "on_matcher_cancel_clicked", 
-				G_CALLBACK(on_matcher_cancel_clicked),
-				info);
-  glade_xml_signal_connect_data(xml, "on_matcher_help_clicked", 
-				G_CALLBACK(on_matcher_help_clicked),
-				info);
+    /* if (parent)
+      gtk_window_set_transient_for (GTK_WINDOW (info->dialog),
+    			  GTK_WINDOW (parent));*/
 
- /*Initialise the colors */
-  gdk_color_parse(COLOR_RED,    &info->color_back_red);
-  gdk_color_parse(COLOR_YELLOW, &info->color_back_yellow);
-  gdk_color_parse(COLOR_GREEN,  &info->color_back_green);
+    /* Connect signals */
+    glade_xml_signal_connect_data(xml, "on_matcher_ok_clicked",
+                                  G_CALLBACK(on_matcher_ok_clicked),
+                                  info);
+    glade_xml_signal_connect_data(xml, "on_matcher_cancel_clicked",
+                                  G_CALLBACK(on_matcher_cancel_clicked),
+                                  info);
+    glade_xml_signal_connect_data(xml, "on_matcher_help_clicked",
+                                  G_CALLBACK(on_matcher_help_clicked),
+                                  info);
 
-  if (heading)
-    gtk_label_set_text (GTK_LABEL (heading_label), heading);
-  
-  gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(info->dialog));
-  gtk_widget_show_all (GTK_WIDGET (info->dialog));
-  return info;
+    /*Initialise the colors */
+    gdk_color_parse(COLOR_RED,    &info->color_back_red);
+    gdk_color_parse(COLOR_YELLOW, &info->color_back_yellow);
+    gdk_color_parse(COLOR_GREEN,  &info->color_back_green);
+
+    if (heading)
+        gtk_label_set_text (GTK_LABEL (heading_label), heading);
+
+    gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(info->dialog));
+    gtk_widget_show_all (GTK_WIDGET (info->dialog));
+    return info;
 }
 
-gboolean gnc_gen_trans_list_run (GNCImportMainMatcher *info) 
+gboolean gnc_gen_trans_list_run (GNCImportMainMatcher *info)
 {
-  gboolean result;
-  
-  /* DEBUG("Begin"); */
+    gboolean result;
 
-  result = gtk_dialog_run (GTK_DIALOG (info->dialog));
+    /* DEBUG("Begin"); */
 
-  /* DEBUG("Result was %d", result); */
+    result = gtk_dialog_run (GTK_DIALOG (info->dialog));
 
-  /* No destroying here since the dialog was already destroyed through
-     the ok_clicked handlers. */
-  return result;
+    /* DEBUG("Result was %d", result); */
+
+    /* No destroying here since the dialog was already destroyed through
+       the ok_clicked handlers. */
+    return result;
 }
 
 
 static void
 refresh_model_row (GNCImportMainMatcher *gui,
-		   GtkTreeModel *model,
-		   GtkTreeIter *iter,
-		   GNCImportTransInfo *info)
+                   GtkTreeModel *model,
+                   GtkTreeIter *iter,
+                   GNCImportTransInfo *info)
 {
-  GtkListStore *store;
-  GtkTreeSelection *selection;
-  gchar *tmp,*imbalance,*text,*color;
-  const gchar *ro_text;
-  g_assert (gui);
-  g_assert (model);
-  g_assert (info);
-  /*DEBUG("Begin");*/
-  
-  store = GTK_LIST_STORE(model);
-  gtk_list_store_set(store, iter, DOWNLOADED_COL_DATA, info, -1);
+    GtkListStore *store;
+    GtkTreeSelection *selection;
+    gchar *tmp, *imbalance, *text, *color;
+    const gchar *ro_text;
+    g_assert (gui);
+    g_assert (model);
+    g_assert (info);
+    /*DEBUG("Begin");*/
 
-  /*Account:*/
-  ro_text =
-    xaccAccountGetName(xaccSplitGetAccount(gnc_import_TransInfo_get_fsplit (info)));
-  gtk_list_store_set(store, iter, DOWNLOADED_COL_ACCOUNT, ro_text, -1);
+    store = GTK_LIST_STORE(model);
+    gtk_list_store_set(store, iter, DOWNLOADED_COL_DATA, info, -1);
 
-  /*Date*/
+    /*Account:*/
+    ro_text =
+        xaccAccountGetName(xaccSplitGetAccount(gnc_import_TransInfo_get_fsplit (info)));
+    gtk_list_store_set(store, iter, DOWNLOADED_COL_ACCOUNT, ro_text, -1);
 
-  text =
-    qof_print_date ( xaccTransGetDate( gnc_import_TransInfo_get_trans(info) ) );
-  gtk_list_store_set(store, iter, DOWNLOADED_COL_DATE, text, -1);
-  g_free(text);
-  
-  /*Amount*/
-  ro_text = xaccPrintAmount 
-	     (xaccSplitGetAmount (gnc_import_TransInfo_get_fsplit(info) ), 
-	      gnc_split_amount_print_info(gnc_import_TransInfo_get_fsplit(info), TRUE) 
-	      );
-  gtk_list_store_set(store, iter, DOWNLOADED_COL_AMOUNT, ro_text, -1);
-  
-  /*Description*/
-  ro_text = xaccTransGetDescription(gnc_import_TransInfo_get_trans(info) );
-  gtk_list_store_set(store, iter, DOWNLOADED_COL_DESCRIPTION, ro_text, -1);
+    /*Date*/
 
-  /*Memo*/
-  ro_text = xaccSplitGetMemo(gnc_import_TransInfo_get_fsplit(info) );
-  gtk_list_store_set(store, iter, DOWNLOADED_COL_MEMO, ro_text, -1);
-  
-  /*Actions*/
-  
-  /* Action informations */
-  ro_text = text = color = NULL;
-  switch(gnc_import_TransInfo_get_action(info))
+    text =
+        qof_print_date ( xaccTransGetDate( gnc_import_TransInfo_get_trans(info) ) );
+    gtk_list_store_set(store, iter, DOWNLOADED_COL_DATE, text, -1);
+    g_free(text);
+
+    /*Amount*/
+    ro_text = xaccPrintAmount
+              (xaccSplitGetAmount (gnc_import_TransInfo_get_fsplit(info) ),
+               gnc_split_amount_print_info(gnc_import_TransInfo_get_fsplit(info), TRUE)
+              );
+    gtk_list_store_set(store, iter, DOWNLOADED_COL_AMOUNT, ro_text, -1);
+
+    /*Description*/
+    ro_text = xaccTransGetDescription(gnc_import_TransInfo_get_trans(info) );
+    gtk_list_store_set(store, iter, DOWNLOADED_COL_DESCRIPTION, ro_text, -1);
+
+    /*Memo*/
+    ro_text = xaccSplitGetMemo(gnc_import_TransInfo_get_fsplit(info) );
+    gtk_list_store_set(store, iter, DOWNLOADED_COL_MEMO, ro_text, -1);
+
+    /*Actions*/
+
+    /* Action informations */
+    ro_text = text = color = NULL;
+    switch (gnc_import_TransInfo_get_action(info))
     {
     case GNCImport_ADD:
-      if(gnc_import_TransInfo_is_balanced(info)==TRUE)
-	{
-	  ro_text = _("New, already balanced");
-	  color = COLOR_GREEN;
-	}
-      else
-	{
-          /* Assume that importers won't create transactions in two or more
-             currencies so we can use xaccTransGetImbalanceValue */
-	  imbalance = 
-	    g_strdup 
-	    (xaccPrintAmount
-	     (gnc_numeric_neg(xaccTransGetImbalanceValue
-			      (gnc_import_TransInfo_get_trans(info) )), 
-	      gnc_commodity_print_info 
-	      (xaccTransGetCurrency(gnc_import_TransInfo_get_trans (info)),
-	       TRUE) ));
-	  if (gnc_import_TransInfo_get_destacc (info) != NULL)
-	    {
-	      color = COLOR_GREEN;
-	      tmp = gnc_account_get_full_name 
-		(gnc_import_TransInfo_get_destacc (info));
-	      if(gnc_import_TransInfo_get_destacc_selected_manually(info)
-		 == TRUE)
-		{
-		  text = 
-		    /* Translators: %1$s is the amount to be 
-		       transferred. %2$s is the destination account. */
-		    g_strdup_printf(_("New, transfer %s to (manual) \"%s\""),
-				    imbalance, tmp);
-		}
-	      else
-		{
-		  text = 
-		    /* Translators: %1$s is the amount to be 
-		       transferred. %2$s is the destination account. */
-		    g_strdup_printf(_("New, transfer %s to (auto) \"%s\""),
-				    imbalance,tmp);
-		}
-	      g_free (tmp);
+        if (gnc_import_TransInfo_is_balanced(info) == TRUE)
+        {
+            ro_text = _("New, already balanced");
+            color = COLOR_GREEN;
+        }
+        else
+        {
+            /* Assume that importers won't create transactions in two or more
+               currencies so we can use xaccTransGetImbalanceValue */
+            imbalance =
+                g_strdup
+                (xaccPrintAmount
+                 (gnc_numeric_neg(xaccTransGetImbalanceValue
+                                  (gnc_import_TransInfo_get_trans(info) )),
+                  gnc_commodity_print_info
+                  (xaccTransGetCurrency(gnc_import_TransInfo_get_trans (info)),
+                   TRUE) ));
+            if (gnc_import_TransInfo_get_destacc (info) != NULL)
+            {
+                color = COLOR_GREEN;
+                tmp = gnc_account_get_full_name
+                      (gnc_import_TransInfo_get_destacc (info));
+                if (gnc_import_TransInfo_get_destacc_selected_manually(info)
+                        == TRUE)
+                {
+                    text =
+                        /* Translators: %1$s is the amount to be
+                           transferred. %2$s is the destination account. */
+                        g_strdup_printf(_("New, transfer %s to (manual) \"%s\""),
+                                        imbalance, tmp);
+                }
+                else
+                {
+                    text =
+                        /* Translators: %1$s is the amount to be
+                           transferred. %2$s is the destination account. */
+                        g_strdup_printf(_("New, transfer %s to (auto) \"%s\""),
+                                        imbalance, tmp);
+                }
+                g_free (tmp);
 
-	    }
-	  else
-	    {
-	      color = COLOR_YELLOW;
-	      text = 
-		/* Translators: %s is the amount to be transferred. */
-		g_strdup_printf(_("New, UNBALANCED (need acct to transfer %s)!"),
-				imbalance);
-	    }
-	  g_free (imbalance);
-	}
-      break;
-    case GNCImport_CLEAR: 
-      if(gnc_import_TransInfo_get_selected_match(info))
-	{
-	  color = COLOR_GREEN;
-	  if(gnc_import_TransInfo_get_match_selected_manually(info)==TRUE)
-	    {
-	      ro_text = _("Reconcile (manual) match");
-	    }
-	  else
-	    {
-	      ro_text = _("Reconcile (auto) match");
-	    }
-	}
-      else
-	{
-	  color = COLOR_RED;
-	  ro_text = _("Match missing!");
-	}
-      break;
-    case GNCImport_EDIT: 
-      color = "white";
-      ro_text = "NOT SUPPORTED YET!";
-      break;
-    case GNCImport_SKIP: 
-      color = COLOR_RED;
-      ro_text = _("Do not import (no action selected)");
-      break;
+            }
+            else
+            {
+                color = COLOR_YELLOW;
+                text =
+                    /* Translators: %s is the amount to be transferred. */
+                    g_strdup_printf(_("New, UNBALANCED (need acct to transfer %s)!"),
+                                    imbalance);
+            }
+            g_free (imbalance);
+        }
+        break;
+    case GNCImport_CLEAR:
+        if (gnc_import_TransInfo_get_selected_match(info))
+        {
+            color = COLOR_GREEN;
+            if (gnc_import_TransInfo_get_match_selected_manually(info) == TRUE)
+            {
+                ro_text = _("Reconcile (manual) match");
+            }
+            else
+            {
+                ro_text = _("Reconcile (auto) match");
+            }
+        }
+        else
+        {
+            color = COLOR_RED;
+            ro_text = _("Match missing!");
+        }
+        break;
+    case GNCImport_EDIT:
+        color = "white";
+        ro_text = "NOT SUPPORTED YET!";
+        break;
+    case GNCImport_SKIP:
+        color = COLOR_RED;
+        ro_text = _("Do not import (no action selected)");
+        break;
     default:
-      color = "white";
-      ro_text = "WRITEME, this is an unknown action";
+        color = "white";
+        ro_text = "WRITEME, this is an unknown action";
     }
 
-  gtk_list_store_set(store, iter,
-		     DOWNLOADED_COL_COLOR, color,
-		     DOWNLOADED_COL_ACTION_INFO, ro_text ? ro_text : text,
-		     -1);
-  if (text)
-    g_free(text);
+    gtk_list_store_set(store, iter,
+                       DOWNLOADED_COL_COLOR, color,
+                       DOWNLOADED_COL_ACTION_INFO, ro_text ? ro_text : text,
+                       -1);
+    if (text)
+        g_free(text);
 
-  /* Set the pixmaps */
-  gtk_list_store_set(store, iter,
-		     DOWNLOADED_COL_ACTION_ADD,
-		     gnc_import_TransInfo_get_action(info)==GNCImport_ADD,
-		     -1);
-  if(gnc_import_TransInfo_get_action(info)==GNCImport_SKIP)
-    {      
-      /*Show the best match's confidence pixmap in the info column*/
-      gtk_list_store_set(store, iter,
-			 DOWNLOADED_COL_ACTION_PIXBUF,
-			 gen_probability_pixbuf( gnc_import_MatchInfo_get_probability 
-						     ( gnc_import_TransInfo_get_selected_match (info)),
-						     gui->user_settings, 
-						     GTK_WIDGET(gui->view)),
-			 -1);
+    /* Set the pixmaps */
+    gtk_list_store_set(store, iter,
+                       DOWNLOADED_COL_ACTION_ADD,
+                       gnc_import_TransInfo_get_action(info) == GNCImport_ADD,
+                       -1);
+    if (gnc_import_TransInfo_get_action(info) == GNCImport_SKIP)
+    {
+        /*Show the best match's confidence pixmap in the info column*/
+        gtk_list_store_set(store, iter,
+                           DOWNLOADED_COL_ACTION_PIXBUF,
+                           gen_probability_pixbuf( gnc_import_MatchInfo_get_probability
+                                   ( gnc_import_TransInfo_get_selected_match (info)),
+                                   gui->user_settings,
+                                   GTK_WIDGET(gui->view)),
+                           -1);
     }
-  
-  gtk_list_store_set(store, iter,
-		     DOWNLOADED_COL_ACTION_CLEAR,
-		     gnc_import_TransInfo_get_action(info)==GNCImport_CLEAR,
-		     -1);
-  if(gnc_import_TransInfo_get_action(info)==GNCImport_CLEAR)
+
+    gtk_list_store_set(store, iter,
+                       DOWNLOADED_COL_ACTION_CLEAR,
+                       gnc_import_TransInfo_get_action(info) == GNCImport_CLEAR,
+                       -1);
+    if (gnc_import_TransInfo_get_action(info) == GNCImport_CLEAR)
     {
-      /*Show the best match's confidence pixmap in the info column*/
-      gtk_list_store_set(store, iter,
-			 DOWNLOADED_COL_ACTION_PIXBUF,
-			 gen_probability_pixbuf( gnc_import_MatchInfo_get_probability 
-						     ( gnc_import_TransInfo_get_selected_match (info)),
-						     gui->user_settings, 
-						     GTK_WIDGET(gui->view)),
-			 -1);
+        /*Show the best match's confidence pixmap in the info column*/
+        gtk_list_store_set(store, iter,
+                           DOWNLOADED_COL_ACTION_PIXBUF,
+                           gen_probability_pixbuf( gnc_import_MatchInfo_get_probability
+                                   ( gnc_import_TransInfo_get_selected_match (info)),
+                                   gui->user_settings,
+                                   GTK_WIDGET(gui->view)),
+                           -1);
     }
-  
-  gtk_list_store_set(store, iter,
-		     DOWNLOADED_COL_ACTION_EDIT,
-		     gnc_import_TransInfo_get_action(info)==GNCImport_EDIT,
-		     -1);
 
-  selection = gtk_tree_view_get_selection(gui->view);
-  gtk_tree_selection_unselect_all(selection);
+    gtk_list_store_set(store, iter,
+                       DOWNLOADED_COL_ACTION_EDIT,
+                       gnc_import_TransInfo_get_action(info) == GNCImport_EDIT,
+                       -1);
+
+    selection = gtk_tree_view_get_selection(gui->view);
+    gtk_tree_selection_unselect_all(selection);
 }
 
 
 void gnc_gen_trans_list_add_trans(GNCImportMainMatcher *gui, Transaction *trans)
 {
-  GNCImportTransInfo * transaction_info = NULL;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  g_assert (gui);
-  g_assert (trans);
-  
+    GNCImportTransInfo * transaction_info = NULL;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    g_assert (gui);
+    g_assert (trans);
 
-  if (gnc_import_exists_online_id (trans))
-    return;
-  else
+
+    if (gnc_import_exists_online_id (trans))
+        return;
+    else
     {
-      transaction_info = gnc_import_TransInfo_new(trans, NULL);
-      
-      gnc_import_TransInfo_init_matches (transaction_info, 
-					 gui->user_settings);
+        transaction_info = gnc_import_TransInfo_new(trans, NULL);
 
-      model = gtk_tree_view_get_model(gui->view);
-      gtk_list_store_append(GTK_LIST_STORE(model), &iter);
-      refresh_model_row (gui, model, &iter, transaction_info);
+        gnc_import_TransInfo_init_matches (transaction_info,
+                                           gui->user_settings);
+
+        model = gtk_tree_view_get_model(gui->view);
+        gtk_list_store_append(GTK_LIST_STORE(model), &iter);
+        refresh_model_row (gui, model, &iter, transaction_info);
     }
-  return;
+    return;
 }/* end gnc_import_add_trans() */
 
 /* Iterate through the rows of the clist and try to automatch each of them */
 static void
 automatch_store_transactions (GNCImportMainMatcher *info,
-			      GtkTreeModel *model,
-			      GtkTreeIter *iter,
-			      GNCImportTransInfo *trans_info)
+                              GtkTreeModel *model,
+                              GtkTreeIter *iter,
+                              GNCImportTransInfo *trans_info)
 {
-      /* returns TRUE if we changed this row, so update it */
-      if(gnc_import_TransInfo_refresh_destacc(trans_info, NULL))
-	{
-	  refresh_model_row(info, model, iter, trans_info);
-	}
+    /* returns TRUE if we changed this row, so update it */
+    if (gnc_import_TransInfo_refresh_destacc(trans_info, NULL))
+    {
+        refresh_model_row(info, model, iter, trans_info);
+    }
 }
 
 /** @} */

Modified: gnucash/trunk/src/import-export/import-main-matcher.h
===================================================================
--- gnucash/trunk/src/import-export/import-main-matcher.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-main-matcher.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -21,7 +21,7 @@
 /**@file import-main-matcher.h
    @brief Transaction matcher main window
    @author Copyright (C) 2002 Benoit Grégoire
-   @author Christian Stimming    
+   @author Christian Stimming
 */
 
 #ifndef GNC_IMPORT_MAIN_MATCHER_H
@@ -31,7 +31,7 @@
 
 typedef struct _main_matcher_info GNCImportMainMatcher;
 
-/** Create a new generic transaction dialog window and return it. 
+/** Create a new generic transaction dialog window and return it.
  *
  * @param parent The parent GtkWidget. May be NULL.
  *
@@ -49,12 +49,12 @@
  * ignored altogether. For use cases without paper checks (e.g. HBCI),
  * values like 14 (days) might be appropriate, whereas for use cases
  * with paper checks (e.g. OFX, QIF), values like 42 (days) seem more
- * appropriate. 
+ * appropriate.
 */
-GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent, 
-					   const gchar* heading,
-					   gboolean all_from_same_account,
-					      gint match_date_hardlimit);
+GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
+        const gchar* heading,
+        gboolean all_from_same_account,
+        gint match_date_hardlimit);
 
 /** Deletes the given object. */
 void gnc_gen_trans_list_delete (GNCImportMainMatcher *info);

Modified: gnucash/trunk/src/import-export/import-match-map.c
===================================================================
--- gnucash/trunk/src/import-export/import-match-map.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-match-map.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -41,10 +41,11 @@
 static QofLogModule log_module = GNC_MOD_IMPORT;
 
 
-struct _GncImportMatchMap {
-  kvp_frame *	frame;
-  Account *	acc;
-  QofBook *	book;
+struct _GncImportMatchMap
+{
+    kvp_frame *	frame;
+    Account *	acc;
+    QofBook *	book;
 };
 
 #define IMAP_FRAME		"import-map"
@@ -53,122 +54,124 @@
 static GncImportMatchMap *
 gnc_imap_create_from_frame (kvp_frame *frame, Account *acc, QofBook *book)
 {
-  GncImportMatchMap *imap;
+    GncImportMatchMap *imap;
 
-  g_return_val_if_fail (frame != NULL, NULL);
-  g_return_val_if_fail ((acc && !book) || (!acc && book), NULL);
+    g_return_val_if_fail (frame != NULL, NULL);
+    g_return_val_if_fail ((acc && !book) || (!acc && book), NULL);
 
-  imap = g_new0(GncImportMatchMap, 1);
-  imap->frame = frame;
+    imap = g_new0(GncImportMatchMap, 1);
+    imap->frame = frame;
 
-  /* Cache the book for easy lookups; store the account/book for
-   * marking dirtiness
-   */
-  if (acc)
-    book = gnc_account_get_book (acc);
-  imap->acc = acc;
-  imap->book = book;
-  
-  return imap;
+    /* Cache the book for easy lookups; store the account/book for
+     * marking dirtiness
+     */
+    if (acc)
+        book = gnc_account_get_book (acc);
+    imap->acc = acc;
+    imap->book = book;
+
+    return imap;
 }
 
 /** Obtain an ImportMatchMap object from an Account or a Book */
 GncImportMatchMap * gnc_imap_create_from_account (Account *acc)
 {
-  kvp_frame * frame;
+    kvp_frame * frame;
 
-  if (!acc) return NULL;
-  frame = xaccAccountGetSlots (acc);
-  g_return_val_if_fail (frame != NULL, NULL);
+    if (!acc) return NULL;
+    frame = xaccAccountGetSlots (acc);
+    g_return_val_if_fail (frame != NULL, NULL);
 
-  return gnc_imap_create_from_frame (frame, acc, NULL);
+    return gnc_imap_create_from_frame (frame, acc, NULL);
 }
 
 GncImportMatchMap * gnc_imap_create_from_book (QofBook *book)
 {
-  kvp_frame * frame;
+    kvp_frame * frame;
 
-  if (!book) return NULL;
-  frame = gnc_book_get_slots (book);
-  g_return_val_if_fail (frame != NULL, NULL);
+    if (!book) return NULL;
+    frame = gnc_book_get_slots (book);
+    g_return_val_if_fail (frame != NULL, NULL);
 
-  return gnc_imap_create_from_frame (frame, NULL, book);
+    return gnc_imap_create_from_frame (frame, NULL, book);
 }
 
 /** Destroy an import map */
 void gnc_imap_destroy (GncImportMatchMap *imap)
 {
-  if (!imap) return;
-  g_free (imap);
+    if (!imap) return;
+    g_free (imap);
 }
 
 /** Clear an import map -- this removes ALL entries in the map */
 void gnc_imap_clear (GncImportMatchMap *imap)
 {
-  if (!imap) return;
+    if (!imap) return;
 
-  /* Clear the IMAP_FRAME kvp */
-  kvp_frame_set_slot_path (imap->frame, NULL, IMAP_FRAME);
+    /* Clear the IMAP_FRAME kvp */
+    kvp_frame_set_slot_path (imap->frame, NULL, IMAP_FRAME);
 
-  /* Clear the bayes kvp, IMAP_FRAME_BAYES */
-  kvp_frame_set_slot_path (imap->frame, NULL, IMAP_FRAME_BAYES);
+    /* Clear the bayes kvp, IMAP_FRAME_BAYES */
+    kvp_frame_set_slot_path (imap->frame, NULL, IMAP_FRAME_BAYES);
 
-  /* XXX: mark the account (or book) as dirty! */
+    /* XXX: mark the account (or book) as dirty! */
 }
 
 /** Look up an Account in the map */
 Account * gnc_imap_find_account (GncImportMatchMap *imap, const char *category,
-				 const char *key)
+                                 const char *key)
 {
-  kvp_value *value;
-  GUID * guid;
+    kvp_value *value;
+    GUID * guid;
 
-  if (!imap || !key) return NULL;
-  if (!category) {
-    category = key;
-    key = NULL;
-  }
+    if (!imap || !key) return NULL;
+    if (!category)
+    {
+        category = key;
+        key = NULL;
+    }
 
-  value = kvp_frame_get_slot_path (imap->frame, IMAP_FRAME, category, key, NULL);
-  if (!value) return NULL;
+    value = kvp_frame_get_slot_path (imap->frame, IMAP_FRAME, category, key, NULL);
+    if (!value) return NULL;
 
-  guid = kvp_value_get_guid (value);
-  return xaccAccountLookup (guid, imap->book);
+    guid = kvp_value_get_guid (value);
+    return xaccAccountLookup (guid, imap->book);
 }
 
 /** Store an Account in the map */
 void gnc_imap_add_account (GncImportMatchMap *imap, const char *category,
-			   const char *key, Account *acc)
+                           const char *key, Account *acc)
 {
-  kvp_value *value;
+    kvp_value *value;
 
-  if (!imap || !key || !acc || (strlen (key) == 0)) return;
-  if (!category) {
-    category = key;
-    key = NULL;
-  }
+    if (!imap || !key || !acc || (strlen (key) == 0)) return;
+    if (!category)
+    {
+        category = key;
+        key = NULL;
+    }
 
-  value = kvp_value_new_guid (xaccAccountGetGUID (acc));
-  g_return_if_fail (value != NULL);
+    value = kvp_value_new_guid (xaccAccountGetGUID (acc));
+    g_return_if_fail (value != NULL);
 
-  kvp_frame_set_slot_path (imap->frame, value, IMAP_FRAME, category, key, NULL);
-  kvp_value_delete (value);
+    kvp_frame_set_slot_path (imap->frame, value, IMAP_FRAME, category, key, NULL);
+    kvp_value_delete (value);
 
-  /* XXX Mark the account (or book) as dirty! */
+    /* XXX Mark the account (or book) as dirty! */
 }
 
 
 
 
 /*--------------------------------------------------------------------------
- Below here is the bayes transaction to account matching system 
+ Below here is the bayes transaction to account matching system
 --------------------------------------------------------------------------*/
 
 
 struct account_token_count
 {
-  char* account_name;
-  gint64 token_count; /**< occurances of a given token for this account_name */
+    char* account_name;
+    gint64 token_count; /**< occurances of a given token for this account_name */
 };
 
 /** total_count and the token_count for a given account let us calculate the
@@ -176,8 +179,8 @@
  */
 struct token_accounts_info
 {
-  GList *accounts; /**< array of struct account_token_count */
-  gint64 total_count;
+    GList *accounts; /**< array of struct account_token_count */
+    gint64 total_count;
 };
 
 /** gpointer is a pointer to a struct token_accounts_info
@@ -185,25 +188,25 @@
  */
 static void buildTokenInfo(const char *key, kvp_value *value, gpointer data)
 {
-  struct token_accounts_info *tokenInfo = (struct token_accounts_info*)data;
-  struct account_token_count* this_account;
+    struct token_accounts_info *tokenInfo = (struct token_accounts_info*)data;
+    struct account_token_count* this_account;
 
-  //  PINFO("buildTokenInfo: account '%s', token_count: '%ld'\n", (char*)key,
-  //			(long)kvp_value_get_gint64(value));
+    //  PINFO("buildTokenInfo: account '%s', token_count: '%ld'\n", (char*)key,
+    //			(long)kvp_value_get_gint64(value));
 
-  /* add the count to the total_count */
-  tokenInfo->total_count += kvp_value_get_gint64(value);
+    /* add the count to the total_count */
+    tokenInfo->total_count += kvp_value_get_gint64(value);
 
-  /* allocate a new structure for this account and it's token count */
-  this_account = (struct account_token_count*)
-    g_new0(struct account_token_count, 1);
+    /* allocate a new structure for this account and it's token count */
+    this_account = (struct account_token_count*)
+                   g_new0(struct account_token_count, 1);
 
-  /* fill in the account name and number of tokens found for this account name */
-  this_account->account_name = (char*)key;
-  this_account->token_count = kvp_value_get_gint64(value);
+    /* fill in the account name and number of tokens found for this account name */
+    this_account->account_name = (char*)key;
+    this_account->token_count = kvp_value_get_gint64(value);
 
- /* append onto the glist a pointer to the new account_token_count structure */
-  tokenInfo->accounts = g_list_prepend(tokenInfo->accounts, this_account);
+    /* append onto the glist a pointer to the new account_token_count structure */
+    tokenInfo->accounts = g_list_prepend(tokenInfo->accounts, this_account);
 }
 
 /** intermediate values used to calculate the bayes probability of a given account
@@ -212,8 +215,8 @@
  */
 struct account_probability
 {
-  double product; /* product of probabilities */
-  double product_difference; /* product of (1-probabilities) */
+    double product; /* product of probabilities */
+    double product_difference; /* product of (1-probabilities) */
 };
 
 /** convert a hash table of account names and (struct account_probability*)
@@ -228,12 +231,12 @@
 
     /* P(AB) = A*B / [A*B + (1-A)*(1-B)]
      * NOTE: so we only keep track of a running product(A*B*C...)
-     * and product difference ((1-A)(1-B)...) 
+     * and product difference ((1-A)(1-B)...)
      */
     gint32 probability =
-      (account_p->product /
-       (account_p->product + account_p->product_difference))
-      * PROBABILITY_FACTOR;
+        (account_p->product /
+         (account_p->product + account_p->product_difference))
+        * PROBABILITY_FACTOR;
 
     PINFO("P('%s') = '%d'\n", (char*)key, probability);
 
@@ -243,10 +246,10 @@
 /** Frees an array of the same time that buildProperties built */
 static void freeProbabilities(gpointer key, gpointer value, gpointer data)
 {
- /* free up the struct account_probability that was allocated
-  * in gnc_imap_find_account_bayes()
-  */
-  g_free(value);
+    /* free up the struct account_probability that was allocated
+     * in gnc_imap_find_account_bayes()
+     */
+    g_free(value);
 }
 
 /** holds an account name and its corresponding integer probability
@@ -254,8 +257,8 @@
  */
 struct account_info
 {
-  char* account_name;
-  gint32 probability;
+    char* account_name;
+    gint32 probability;
 };
 
 /** Find the highest probability and the corresponding account name
@@ -266,14 +269,14 @@
 */
 static void highestProbability(gpointer key, gpointer value, gpointer data)
 {
-  struct account_info *account_i = (struct account_info*)data;
+    struct account_info *account_i = (struct account_info*)data;
 
-  /* if the current probability is greater than the stored, store the current */
-  if(GPOINTER_TO_INT(value) > account_i->probability)
+    /* if the current probability is greater than the stored, store the current */
+    if (GPOINTER_TO_INT(value) > account_i->probability)
     {
-      /* Save the new highest probability and the assoaciated account name */
-      account_i->probability = GPOINTER_TO_INT(value);
-      account_i->account_name = key;
+        /* Save the new highest probability and the assoaciated account name */
+        account_i->probability = GPOINTER_TO_INT(value);
+        account_i->account_name = key;
     }
 }
 
@@ -283,254 +286,254 @@
 /** Look up an Account in the map */
 Account* gnc_imap_find_account_bayes(GncImportMatchMap *imap, GList *tokens)
 {
-  struct token_accounts_info tokenInfo; /**< holds the accounts and total 
+    struct token_accounts_info tokenInfo; /**< holds the accounts and total
 					 * token count for a single token */
-  GList *current_token;		        /**< pointer to the current token from the
+    GList *current_token;		        /**< pointer to the current token from the
 				         * input GList *tokens */
-  GList *current_account_token;		/**< pointer to the struct
+    GList *current_account_token;		/**< pointer to the struct
 					 * account_token_count */
-  struct account_token_count *account_c; /**< an account name and the number
+    struct account_token_count *account_c; /**< an account name and the number
 					  * of times a token has appeared
 					  * for the account */
-  struct account_probability *account_p; /**< intermediate storage of values
+    struct account_probability *account_p; /**< intermediate storage of values
 					  * to compute the bayes probability
 					  * of an account */
-  GHashTable *running_probabilities = g_hash_table_new(g_str_hash, g_str_equal);
-  GHashTable *final_probabilities = g_hash_table_new(g_str_hash, g_str_equal);
-  struct account_info account_i;
-  kvp_value* value;
-  kvp_frame* token_frame;
+    GHashTable *running_probabilities = g_hash_table_new(g_str_hash, g_str_equal);
+    GHashTable *final_probabilities = g_hash_table_new(g_str_hash, g_str_equal);
+    struct account_info account_i;
+    kvp_value* value;
+    kvp_frame* token_frame;
 
-  ENTER(" ");
+    ENTER(" ");
 
-  /* check to see if the imap is NULL */
-  if(!imap)
-  {
-    PINFO("imap is null, returning null");
-    LEAVE(" ");
-    return NULL;
-  }
+    /* check to see if the imap is NULL */
+    if (!imap)
+    {
+        PINFO("imap is null, returning null");
+        LEAVE(" ");
+        return NULL;
+    }
 
-  /* find the probability for each account that contains any of the tokens
-   * in the input tokens list
-   */
-  for(current_token = tokens; current_token; current_token = current_token->next)
+    /* find the probability for each account that contains any of the tokens
+     * in the input tokens list
+     */
+    for (current_token = tokens; current_token; current_token = current_token->next)
     {
-      /* zero out the token_accounts_info structure */
-      memset(&tokenInfo, 0, sizeof(struct token_accounts_info));
+        /* zero out the token_accounts_info structure */
+        memset(&tokenInfo, 0, sizeof(struct token_accounts_info));
 
-      PINFO("token: '%s'", (char*)current_token->data);
-      
-      /* find the slot for the given token off of the source account
-       * for these tokens, search off of the IMAP_FRAME_BAYES path so
-       * we aren't looking from the parent of the entire kvp tree
-       */
-      value = kvp_frame_get_slot_path(imap->frame, IMAP_FRAME_BAYES,
-				      (char*)current_token->data, NULL); 
+        PINFO("token: '%s'", (char*)current_token->data);
 
-      /* if value is null we should skip over this token */
-      if(!value)
-      	continue;
+        /* find the slot for the given token off of the source account
+         * for these tokens, search off of the IMAP_FRAME_BAYES path so
+         * we aren't looking from the parent of the entire kvp tree
+         */
+        value = kvp_frame_get_slot_path(imap->frame, IMAP_FRAME_BAYES,
+                                        (char*)current_token->data, NULL);
 
-      /* convert the slot(value) into a the frame that contains the
-       * list of accounts
-       */
-      token_frame = kvp_value_get_frame(value);
+        /* if value is null we should skip over this token */
+        if (!value)
+            continue;
 
-      /* token_frame should NEVER be null */
-      if(!token_frame)
-      {
-	PERR("token '%s' has no accounts", (char*)current_token->data);
-        continue; /* skip over this token */
-      }
+        /* convert the slot(value) into a the frame that contains the
+         * list of accounts
+         */
+        token_frame = kvp_value_get_frame(value);
 
-      /* process the accounts for this token, adding the account if it
-       * doesn't already exist or adding to the existing accounts token
-       * count if it does
-       */
-      kvp_frame_for_each_slot(token_frame, buildTokenInfo, &tokenInfo);
+        /* token_frame should NEVER be null */
+        if (!token_frame)
+        {
+            PERR("token '%s' has no accounts", (char*)current_token->data);
+            continue; /* skip over this token */
+        }
 
-      /* for each account we have just found, see if the account already exists
-       * in the list of account probabilities, if not add it
-       */
-      for(current_account_token = tokenInfo.accounts; current_account_token;
-	  current_account_token = current_account_token->next)
-      {
-	/* get the account name and corresponding token count */
-	account_c = (struct account_token_count*)current_account_token->data;
+        /* process the accounts for this token, adding the account if it
+         * doesn't already exist or adding to the existing accounts token
+         * count if it does
+         */
+        kvp_frame_for_each_slot(token_frame, buildTokenInfo, &tokenInfo);
 
-	PINFO("account_c->account_name('%s'), "
-	      "account_c->token_count('%ld')/total_count('%ld')",
-	      account_c->account_name, (long)account_c->token_count,
-	      (long)tokenInfo.total_count); 
+        /* for each account we have just found, see if the account already exists
+         * in the list of account probabilities, if not add it
+         */
+        for (current_account_token = tokenInfo.accounts; current_account_token;
+                current_account_token = current_account_token->next)
+        {
+            /* get the account name and corresponding token count */
+            account_c = (struct account_token_count*)current_account_token->data;
 
-	account_p = g_hash_table_lookup(running_probabilities,
-					account_c->account_name);
+            PINFO("account_c->account_name('%s'), "
+                  "account_c->token_count('%ld')/total_count('%ld')",
+                  account_c->account_name, (long)account_c->token_count,
+                  (long)tokenInfo.total_count);
 
-	/* if the account exists in the list then continue 
-	 * the running probablities
-	 */
-	if(account_p)
-	  {
-	    account_p->product =
-	      ((double)account_c->token_count / (double)tokenInfo.total_count)
-	      * account_p->product;
-	    account_p->product_difference =
-	      ((double)1 - ((double)account_c->token_count /
-			    (double)tokenInfo.total_count))
-	      * account_p->product_difference;
-	    PINFO("product == %f, product_difference == %f",
-		  account_p->product, account_p->product_difference);
-	  }
-	else
-	  {
-	    /* add a new entry */
-	    PINFO("adding a new entry for this account");
-	    account_p = (struct account_probability*)
-	      g_new0(struct account_probability, 1);
+            account_p = g_hash_table_lookup(running_probabilities,
+                                            account_c->account_name);
 
-	    /* set the product and product difference values */
-	    account_p->product = ((double)account_c->token_count /
-				  (double)tokenInfo.total_count);
-	    account_p->product_difference =
-	      (double)1 - ((double)account_c->token_count /
-			   (double)tokenInfo.total_count);
+            /* if the account exists in the list then continue
+             * the running probablities
+             */
+            if (account_p)
+            {
+                account_p->product =
+                    ((double)account_c->token_count / (double)tokenInfo.total_count)
+                    * account_p->product;
+                account_p->product_difference =
+                    ((double)1 - ((double)account_c->token_count /
+                                  (double)tokenInfo.total_count))
+                    * account_p->product_difference;
+                PINFO("product == %f, product_difference == %f",
+                      account_p->product, account_p->product_difference);
+            }
+            else
+            {
+                /* add a new entry */
+                PINFO("adding a new entry for this account");
+                account_p = (struct account_probability*)
+                            g_new0(struct account_probability, 1);
 
-	    PINFO("product == %f, product_difference == %f",
-		  account_p->product, account_p->product_difference);
-	    
-	    /* add the account name and (struct account_probability*)
-	     * to the hash table */
-	    g_hash_table_insert(running_probabilities,
-				account_c->account_name, account_p);
-	  }
-      } /* for all accounts in tokenInfo */
+                /* set the product and product difference values */
+                account_p->product = ((double)account_c->token_count /
+                                      (double)tokenInfo.total_count);
+                account_p->product_difference =
+                    (double)1 - ((double)account_c->token_count /
+                                 (double)tokenInfo.total_count);
 
-      /* free the data in tokenInfo */
-      for(current_account_token = tokenInfo.accounts; current_account_token;
-	  current_account_token = current_account_token->next)
-      {
-	/* free up each struct account_token_count we allocated */
-	g_free((struct account_token_count*)current_account_token->data);
-      }
+                PINFO("product == %f, product_difference == %f",
+                      account_p->product, account_p->product_difference);
 
-      g_list_free(tokenInfo.accounts); /* free the accounts GList */
+                /* add the account name and (struct account_probability*)
+                 * to the hash table */
+                g_hash_table_insert(running_probabilities,
+                                    account_c->account_name, account_p);
+            }
+        } /* for all accounts in tokenInfo */
+
+        /* free the data in tokenInfo */
+        for (current_account_token = tokenInfo.accounts; current_account_token;
+                current_account_token = current_account_token->next)
+        {
+            /* free up each struct account_token_count we allocated */
+            g_free((struct account_token_count*)current_account_token->data);
+        }
+
+        g_list_free(tokenInfo.accounts); /* free the accounts GList */
     }
 
-  /* build a hash table of account names and their final probabilities
-   * from each entry in the running_probabilties hash table
-   */
-  g_hash_table_foreach(running_probabilities, buildProbabilities,
-		       final_probabilities);
+    /* build a hash table of account names and their final probabilities
+     * from each entry in the running_probabilties hash table
+     */
+    g_hash_table_foreach(running_probabilities, buildProbabilities,
+                         final_probabilities);
 
-  /* find the highest probabilty and the corresponding account */
-  memset(&account_i, 0, sizeof(struct account_info));
-  g_hash_table_foreach(final_probabilities, highestProbability, &account_i);
+    /* find the highest probabilty and the corresponding account */
+    memset(&account_i, 0, sizeof(struct account_info));
+    g_hash_table_foreach(final_probabilities, highestProbability, &account_i);
 
-  /* free each element of the running_probabilities hash */
-  g_hash_table_foreach(running_probabilities, freeProbabilities, NULL);
+    /* free each element of the running_probabilities hash */
+    g_hash_table_foreach(running_probabilities, freeProbabilities, NULL);
 
-  /* free the hash tables */
-  g_hash_table_destroy(running_probabilities);
-  g_hash_table_destroy(final_probabilities);
+    /* free the hash tables */
+    g_hash_table_destroy(running_probabilities);
+    g_hash_table_destroy(final_probabilities);
 
-  PINFO("highest P('%s') = '%d'",
-        account_i.account_name ? account_i.account_name: "(null)",
-        account_i.probability);
+    PINFO("highest P('%s') = '%d'",
+          account_i.account_name ? account_i.account_name : "(null)",
+          account_i.probability);
 
-  /* has this probability met our threshold? */
-  if(account_i.probability >= threshold)
+    /* has this probability met our threshold? */
+    if (account_i.probability >= threshold)
     {
-      PINFO("found match");
-      LEAVE(" ");
-      return gnc_account_lookup_by_full_name(gnc_book_get_root_account(imap->book),
-                                             account_i.account_name);
+        PINFO("found match");
+        LEAVE(" ");
+        return gnc_account_lookup_by_full_name(gnc_book_get_root_account(imap->book),
+                                               account_i.account_name);
     }
 
-  PINFO("no match");
-  LEAVE(" ");
+    PINFO("no match");
+    LEAVE(" ");
 
-  return NULL; /* we didn't meet our threshold, return NULL for an account */
+    return NULL; /* we didn't meet our threshold, return NULL for an account */
 }
 
 
 /** Updates the imap for a given account using a list of tokens */
 void gnc_imap_add_account_bayes(GncImportMatchMap *imap, GList *tokens, Account *acc)
 {
-  GList *current_token;
-  kvp_value *value;
-  gint64 token_count;
-  char* account_fullname;
-  kvp_value *new_value; /* the value that will be added back into the kvp tree */
+    GList *current_token;
+    kvp_value *value;
+    gint64 token_count;
+    char* account_fullname;
+    kvp_value *new_value; /* the value that will be added back into the kvp tree */
 
-  ENTER(" ");
+    ENTER(" ");
 
-  /* if imap is null return */
-  if(!imap)
-  {
-    LEAVE(" ");
-    return;
-  }
+    /* if imap is null return */
+    if (!imap)
+    {
+        LEAVE(" ");
+        return;
+    }
 
-  account_fullname = gnc_account_get_full_name(acc);
+    account_fullname = gnc_account_get_full_name(acc);
 
-  PINFO("account name: '%s'\n", account_fullname);
+    PINFO("account name: '%s'\n", account_fullname);
 
-  /* process each token in the list */
-  for(current_token = g_list_first(tokens); current_token;
-      current_token = current_token->next)
+    /* process each token in the list */
+    for (current_token = g_list_first(tokens); current_token;
+            current_token = current_token->next)
     {
-      /* Jump to next iteration if the pointer is not valid or if the
-	 string is empty. In HBCI import we almost always get an empty
-	 string, which doesn't work in the kvp loopkup later. So we
-	 skip this case here. */
-      if (!current_token->data || (*((char*)current_token->data) == '\0'))
-           continue;
+        /* Jump to next iteration if the pointer is not valid or if the
+        	 string is empty. In HBCI import we almost always get an empty
+        	 string, which doesn't work in the kvp loopkup later. So we
+        	 skip this case here. */
+        if (!current_token->data || (*((char*)current_token->data) == '\0'))
+            continue;
 
-      /* start off with no tokens for this account */
-      token_count = 0;
+        /* start off with no tokens for this account */
+        token_count = 0;
 
-      PINFO("adding token '%s'\n", (char*)current_token->data);
+        PINFO("adding token '%s'\n", (char*)current_token->data);
 
-      /* is this token/account_name already in the kvp tree? */
-      value = kvp_frame_get_slot_path(imap->frame, IMAP_FRAME_BAYES,
-				      (char*)current_token->data, account_fullname,
-				      NULL);
+        /* is this token/account_name already in the kvp tree? */
+        value = kvp_frame_get_slot_path(imap->frame, IMAP_FRAME_BAYES,
+                                        (char*)current_token->data, account_fullname,
+                                        NULL);
 
-      /* if the token/account is already in the tree, read the current
-       * value from the tree and use this for the basis of the value we
-       * are putting back
-       */
-      if(value)
-	{
-	  PINFO("found existing value of '%ld'\n",
-		(long)kvp_value_get_gint64(value));
+        /* if the token/account is already in the tree, read the current
+         * value from the tree and use this for the basis of the value we
+         * are putting back
+         */
+        if (value)
+        {
+            PINFO("found existing value of '%ld'\n",
+                  (long)kvp_value_get_gint64(value));
 
-	  /* convert this value back into an integer */
-	  token_count+=kvp_value_get_gint64(value);
-	}
+            /* convert this value back into an integer */
+            token_count += kvp_value_get_gint64(value);
+        }
 
-      /* increment the token count */
-      token_count++;
+        /* increment the token count */
+        token_count++;
 
-      /* create a new value */
-      new_value = kvp_value_new_gint64(token_count);
+        /* create a new value */
+        new_value = kvp_value_new_gint64(token_count);
 
-      /* insert the value into the kvp tree at
-       * /imap->frame/IMAP_FRAME/token_string/account_name_string
-       */
-      kvp_frame_set_slot_path(imap->frame, new_value, IMAP_FRAME_BAYES, 
-			      (char*)current_token->data, account_fullname, NULL);
+        /* insert the value into the kvp tree at
+         * /imap->frame/IMAP_FRAME/token_string/account_name_string
+         */
+        kvp_frame_set_slot_path(imap->frame, new_value, IMAP_FRAME_BAYES,
+                                (char*)current_token->data, account_fullname, NULL);
 
-      /* kvp_frame_set_slot_path() copied the value so we
-       * need to delete this one ;-) */
-      kvp_value_delete(new_value);
+        /* kvp_frame_set_slot_path() copied the value so we
+         * need to delete this one ;-) */
+        kvp_value_delete(new_value);
     }
 
-  /* free up the account fullname string */
-  g_free(account_fullname);
- 
-  LEAVE(" ");
+    /* free up the account fullname string */
+    g_free(account_fullname);
+
+    LEAVE(" ");
 }
 
 /** @} */

Modified: gnucash/trunk/src/import-export/import-match-map.h
===================================================================
--- gnucash/trunk/src/import-export/import-match-map.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-match-map.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -49,13 +49,13 @@
 
 /** Look up an Account in the map */
 Account* gnc_imap_find_account(GncImportMatchMap *imap, const char* category,
-			       const char *key);
+                               const char *key);
 
 /** Store an Account in the map. This mapping is immediatly stored in
   the underlying kvp frame, regardless of whether the MatchMap is
   destroyed later or not. */
 void gnc_imap_add_account (GncImportMatchMap *imap, const char *category,
-			   const char *key, Account *acc);
+                           const char *key, Account *acc);
 
 /** Look up an Account in the map from a GList* of pointers to strings(tokens)
   from the current transaction */
@@ -65,11 +65,11 @@
   the underlying kvp frame, regardless of whether the MatchMap is
   destroyed later or not. */
 void gnc_imap_add_account_bayes (GncImportMatchMap *imap, GList* tokens,
-				 Account *acc);
+                                 Account *acc);
 
 
 /** @name Some well-known categories
- 
+
   NOTE: You DO NOT have to use these values in your importer -- these
   are just "well known" values, not "mandatory" values.  You are free
   to use these if they apply, map your own fields to these labels, or

Modified: gnucash/trunk/src/import-export/import-match-picker.c
===================================================================
--- gnucash/trunk/src/import-export/import-match-picker.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-match-picker.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,12 +20,12 @@
     @{ */
 /** @internal
 @file import-match-picker.c
-   @brief The transaction match picker dialog 
+   @brief The transaction match picker dialog
    implementation
    @author Copyright (C) 2002 Benoit Grégoire
    @author Copyright (c) 2006 David Hampton <hampton at employees.org>
 */
- 
+
 #include "config.h"
 
 #include <gtk/gtk.h>
@@ -44,26 +44,28 @@
 
 #define GCONF_SECTION "dialogs/import/generic_matcher/match_picker"
 
-enum downloaded_cols {
-  DOWNLOADED_COL_ACCOUNT = 0,
-  DOWNLOADED_COL_DATE,
-  DOWNLOADED_COL_AMOUNT,
-  DOWNLOADED_COL_DESCRIPTION,
-  DOWNLOADED_COL_MEMO,
-  DOWNLOADED_COL_BALANCED,
-  DOWNLOADED_COL_INFO_PTR,
-  NUM_DOWNLOADED_COLS
+enum downloaded_cols
+{
+    DOWNLOADED_COL_ACCOUNT = 0,
+    DOWNLOADED_COL_DATE,
+    DOWNLOADED_COL_AMOUNT,
+    DOWNLOADED_COL_DESCRIPTION,
+    DOWNLOADED_COL_MEMO,
+    DOWNLOADED_COL_BALANCED,
+    DOWNLOADED_COL_INFO_PTR,
+    NUM_DOWNLOADED_COLS
 };
 
-enum matcher_cols {
-  MATCHER_COL_CONFIDENCE = 0,
-  MATCHER_COL_CONFIDENCE_PIXBUF,
-  MATCHER_COL_DATE,
-  MATCHER_COL_AMOUNT,
-  MATCHER_COL_DESCRIPTION,
-  MATCHER_COL_MEMO,
-  MATCHER_COL_INFO_PTR,
-  NUM_MATCHER_COLS
+enum matcher_cols
+{
+    MATCHER_COL_CONFIDENCE = 0,
+    MATCHER_COL_CONFIDENCE_PIXBUF,
+    MATCHER_COL_DATE,
+    MATCHER_COL_AMOUNT,
+    MATCHER_COL_DESCRIPTION,
+    MATCHER_COL_MEMO,
+    MATCHER_COL_INFO_PTR,
+    NUM_MATCHER_COLS
 };
 
 /* Needs to be commented in again if any DEBUG() macro is used here. */
@@ -79,90 +81,95 @@
  *               Structures passed between the functions             *
 \********************************************************************/
 
-struct _transpickerdialog {
-  GtkWidget * transaction_matcher;
-  GtkTreeView * downloaded_view;
-  GtkTreeView * match_view;
-  GNCImportSettings * user_settings;
-  struct _transactioninfo * selected_trans_info;
-  GNCImportMatchInfo * selected_match_info;
+struct _transpickerdialog
+{
+    GtkWidget * transaction_matcher;
+    GtkTreeView * downloaded_view;
+    GtkTreeView * match_view;
+    GNCImportSettings * user_settings;
+    struct _transactioninfo * selected_trans_info;
+    GNCImportMatchInfo * selected_match_info;
 };
 
 
 
 static void
 downloaded_transaction_append(GNCImportMatchPicker * matcher,
-			      GNCImportTransInfo * transaction_info)
+                              GNCImportTransInfo * transaction_info)
 {
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GtkTreeSelection *selection;
-  Transaction *trans;
-  Split *split;
-  gchar *text;
-  const gchar *ro_text;
-  gboolean found = FALSE;
-  GNCImportTransInfo *local_info;
+    GtkListStore *store;
+    GtkTreeIter iter;
+    GtkTreeSelection *selection;
+    Transaction *trans;
+    Split *split;
+    gchar *text;
+    const gchar *ro_text;
+    gboolean found = FALSE;
+    GNCImportTransInfo *local_info;
 
-  g_assert(matcher);
-  g_assert(transaction_info);
+    g_assert(matcher);
+    g_assert(transaction_info);
 
-  /*DEBUG("Begin");*/
+    /*DEBUG("Begin");*/
 
-  /* Has the transaction already been added? */
-  store = GTK_LIST_STORE(gtk_tree_view_get_model(matcher->downloaded_view));
-  if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) {
-    do {
-      gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
-			 DOWNLOADED_COL_INFO_PTR, &local_info,
-			 -1);
-      if (local_info == transaction_info) {
-	found = TRUE;
-	break;
-      }
-    } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter));
-  }
-  if (!found)
-    gtk_list_store_append(store, &iter);
-  
-  split = gnc_import_TransInfo_get_fsplit(transaction_info);
-  trans = gnc_import_TransInfo_get_trans(transaction_info);
-  
-  /*Account*/
-  ro_text = xaccAccountGetName(xaccSplitGetAccount(split));
-  gtk_list_store_set(store, &iter, DOWNLOADED_COL_ACCOUNT, ro_text, -1);
+    /* Has the transaction already been added? */
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(matcher->downloaded_view));
+    if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter))
+    {
+        do
+        {
+            gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
+                               DOWNLOADED_COL_INFO_PTR, &local_info,
+                               -1);
+            if (local_info == transaction_info)
+            {
+                found = TRUE;
+                break;
+            }
+        }
+        while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter));
+    }
+    if (!found)
+        gtk_list_store_append(store, &iter);
 
-  /*Date*/
-  text = qof_print_date(xaccTransGetDate(trans));
-  gtk_list_store_set(store, &iter, DOWNLOADED_COL_DATE, text, -1);
-  g_free(text);
-  
-  /*Amount*/
-  ro_text = xaccPrintAmount(xaccSplitGetAmount(split),
-			    gnc_split_amount_print_info(split, TRUE));
-  gtk_list_store_set(store, &iter, DOWNLOADED_COL_AMOUNT, ro_text, -1);
- 
-  /*Description*/
-  ro_text = xaccTransGetDescription(trans);
-  gtk_list_store_set(store, &iter, DOWNLOADED_COL_DESCRIPTION, ro_text, -1);
-  
-  /*Memo*/
-  ro_text = xaccSplitGetMemo(split);
-  gtk_list_store_set(store, &iter, DOWNLOADED_COL_MEMO, ro_text, -1);
+    split = gnc_import_TransInfo_get_fsplit(transaction_info);
+    trans = gnc_import_TransInfo_get_trans(transaction_info);
 
-  /*Imbalance*/
- /* Assume that the importer won't create a transaction that involves two or more
-    currencies and no non-currency commodity.  In that case can use the simpler
-    value imbalance check. */
-  ro_text = xaccPrintAmount(xaccTransGetImbalanceValue(trans), 
-			    gnc_default_print_info(TRUE));
-  gtk_list_store_set(store, &iter, DOWNLOADED_COL_BALANCED, ro_text, -1);
+    /*Account*/
+    ro_text = xaccAccountGetName(xaccSplitGetAccount(split));
+    gtk_list_store_set(store, &iter, DOWNLOADED_COL_ACCOUNT, ro_text, -1);
 
-  gtk_list_store_set(store, &iter, DOWNLOADED_COL_INFO_PTR,
-		     transaction_info, -1);
+    /*Date*/
+    text = qof_print_date(xaccTransGetDate(trans));
+    gtk_list_store_set(store, &iter, DOWNLOADED_COL_DATE, text, -1);
+    g_free(text);
 
-  selection = gtk_tree_view_get_selection(matcher->downloaded_view);
-  gtk_tree_selection_select_iter(selection, &iter);
+    /*Amount*/
+    ro_text = xaccPrintAmount(xaccSplitGetAmount(split),
+                              gnc_split_amount_print_info(split, TRUE));
+    gtk_list_store_set(store, &iter, DOWNLOADED_COL_AMOUNT, ro_text, -1);
+
+    /*Description*/
+    ro_text = xaccTransGetDescription(trans);
+    gtk_list_store_set(store, &iter, DOWNLOADED_COL_DESCRIPTION, ro_text, -1);
+
+    /*Memo*/
+    ro_text = xaccSplitGetMemo(split);
+    gtk_list_store_set(store, &iter, DOWNLOADED_COL_MEMO, ro_text, -1);
+
+    /*Imbalance*/
+    /* Assume that the importer won't create a transaction that involves two or more
+       currencies and no non-currency commodity.  In that case can use the simpler
+       value imbalance check. */
+    ro_text = xaccPrintAmount(xaccTransGetImbalanceValue(trans),
+                              gnc_default_print_info(TRUE));
+    gtk_list_store_set(store, &iter, DOWNLOADED_COL_BALANCED, ro_text, -1);
+
+    gtk_list_store_set(store, &iter, DOWNLOADED_COL_INFO_PTR,
+                       transaction_info, -1);
+
+    selection = gtk_tree_view_get_selection(matcher->downloaded_view);
+    gtk_tree_selection_select_iter(selection, &iter);
 }
 
 /********************************************************************\
@@ -173,216 +180,218 @@
 
 static void
 downloaded_transaction_changed_cb (GtkTreeSelection *selection,
-				   GNCImportMatchPicker *matcher) 
+                                   GNCImportMatchPicker *matcher)
 {
-  GNCImportMatchInfo * match_info;
-  GtkTreeModel *dl_model;
-  GtkListStore *match_store;
-  GtkTreeIter iter;
-  GList * list_element;
-  gchar *text;
-  const gchar *ro_text;
-  /*DEBUG("row: %d%s%d",row,", column: ",column);*/
+    GNCImportMatchInfo * match_info;
+    GtkTreeModel *dl_model;
+    GtkListStore *match_store;
+    GtkTreeIter iter;
+    GList * list_element;
+    gchar *text;
+    const gchar *ro_text;
+    /*DEBUG("row: %d%s%d",row,", column: ",column);*/
 
-  /* Get the transaction info from the "downloaded" model.  */
-  if (!gtk_tree_selection_get_selected(selection, &dl_model, &iter)) {
-      matcher->selected_trans_info=NULL;
-      return;
-  }
-  gtk_tree_model_get(dl_model, &iter,
-		     DOWNLOADED_COL_INFO_PTR, &matcher->selected_trans_info,
-		     -1);
-  
-  /* Now rewrite the "match" model based on that trans. */
-  match_store = GTK_LIST_STORE(gtk_tree_view_get_model(matcher->match_view));
-  gtk_list_store_clear(match_store);
-  list_element = g_list_first (gnc_import_TransInfo_get_match_list
-			       (matcher->selected_trans_info));
-  while(list_element!=NULL)
+    /* Get the transaction info from the "downloaded" model.  */
+    if (!gtk_tree_selection_get_selected(selection, &dl_model, &iter))
     {
-      match_info = list_element->data;
-      
-      gtk_list_store_append(match_store, &iter);
+        matcher->selected_trans_info = NULL;
+        return;
+    }
+    gtk_tree_model_get(dl_model, &iter,
+                       DOWNLOADED_COL_INFO_PTR, &matcher->selected_trans_info,
+                       -1);
 
-      /* Print fields. */
+    /* Now rewrite the "match" model based on that trans. */
+    match_store = GTK_LIST_STORE(gtk_tree_view_get_model(matcher->match_view));
+    gtk_list_store_clear(match_store);
+    list_element = g_list_first (gnc_import_TransInfo_get_match_list
+                                 (matcher->selected_trans_info));
+    while (list_element != NULL)
+    {
+        match_info = list_element->data;
 
-      /* Probability */
-      text = g_strdup_printf("%d", gnc_import_MatchInfo_get_probability (match_info));
-      gtk_list_store_set(match_store, &iter, MATCHER_COL_CONFIDENCE, text, -1);
-      g_free(text);
+        gtk_list_store_append(match_store, &iter);
 
-      /* Date */
-      text =
-	qof_print_date 
-	( xaccTransGetDate
-	  ( xaccSplitGetParent
-	    ( gnc_import_MatchInfo_get_split(match_info) ) ));
-      gtk_list_store_set(match_store, &iter, MATCHER_COL_DATE, text, -1);
-      g_free(text);
-      
-      /* Amount */
-      ro_text =
-	xaccPrintAmount( xaccSplitGetAmount ( gnc_import_MatchInfo_get_split(match_info)  ), 
-				  gnc_split_amount_print_info(gnc_import_MatchInfo_get_split(match_info), TRUE) 
-				  );
-      gtk_list_store_set(match_store, &iter, MATCHER_COL_AMOUNT, ro_text, -1);
-      
-      /*Description*/
-      ro_text = xaccTransGetDescription
-	( xaccSplitGetParent( gnc_import_MatchInfo_get_split(match_info)) );
-      gtk_list_store_set(match_store, &iter, MATCHER_COL_DESCRIPTION, ro_text, -1);
-      
-      /*Split memo*/    
-      ro_text = xaccSplitGetMemo(gnc_import_MatchInfo_get_split(match_info) );
-      gtk_list_store_set(match_store, &iter, MATCHER_COL_MEMO, ro_text, -1);
-      
-      gtk_list_store_set(match_store, &iter, MATCHER_COL_INFO_PTR, match_info, -1);
-      if(gnc_import_MatchInfo_get_probability(match_info) != 0)
-	{
-	  if(SHOW_NUMERIC_SCORE==TRUE)
-	    {
-	      gtk_list_store_set(match_store, &iter,
-				     MATCHER_COL_CONFIDENCE_PIXBUF,
-				     gen_probability_pixbuf(gnc_import_MatchInfo_get_probability(match_info), 
-							    matcher->user_settings, 
-							    GTK_WIDGET(matcher->match_view)),
-				     -1);
-	    }
-	  else
-	    {
-	      gtk_list_store_set(match_store, &iter,
-				    MATCHER_COL_CONFIDENCE_PIXBUF,
-				    gen_probability_pixbuf(gnc_import_MatchInfo_get_probability(match_info),
-							   matcher->user_settings, 
-							   GTK_WIDGET(matcher->match_view)),
-				    -1);
-	    }
-	}
-      
-      if(match_info == 
-	 gnc_import_TransInfo_get_selected_match (matcher->selected_trans_info))
-	{
-	  GtkTreeSelection *selection;
+        /* Print fields. */
 
-	  selection = gtk_tree_view_get_selection(matcher->match_view);
-	  gtk_tree_selection_select_iter(selection, &iter);
-	}
-      
-      list_element=g_list_next(list_element);
+        /* Probability */
+        text = g_strdup_printf("%d", gnc_import_MatchInfo_get_probability (match_info));
+        gtk_list_store_set(match_store, &iter, MATCHER_COL_CONFIDENCE, text, -1);
+        g_free(text);
+
+        /* Date */
+        text =
+            qof_print_date
+            ( xaccTransGetDate
+              ( xaccSplitGetParent
+                ( gnc_import_MatchInfo_get_split(match_info) ) ));
+        gtk_list_store_set(match_store, &iter, MATCHER_COL_DATE, text, -1);
+        g_free(text);
+
+        /* Amount */
+        ro_text =
+            xaccPrintAmount( xaccSplitGetAmount ( gnc_import_MatchInfo_get_split(match_info)  ),
+                             gnc_split_amount_print_info(gnc_import_MatchInfo_get_split(match_info), TRUE)
+                           );
+        gtk_list_store_set(match_store, &iter, MATCHER_COL_AMOUNT, ro_text, -1);
+
+        /*Description*/
+        ro_text = xaccTransGetDescription
+                  ( xaccSplitGetParent( gnc_import_MatchInfo_get_split(match_info)) );
+        gtk_list_store_set(match_store, &iter, MATCHER_COL_DESCRIPTION, ro_text, -1);
+
+        /*Split memo*/
+        ro_text = xaccSplitGetMemo(gnc_import_MatchInfo_get_split(match_info) );
+        gtk_list_store_set(match_store, &iter, MATCHER_COL_MEMO, ro_text, -1);
+
+        gtk_list_store_set(match_store, &iter, MATCHER_COL_INFO_PTR, match_info, -1);
+        if (gnc_import_MatchInfo_get_probability(match_info) != 0)
+        {
+            if (SHOW_NUMERIC_SCORE == TRUE)
+            {
+                gtk_list_store_set(match_store, &iter,
+                                   MATCHER_COL_CONFIDENCE_PIXBUF,
+                                   gen_probability_pixbuf(gnc_import_MatchInfo_get_probability(match_info),
+                                           matcher->user_settings,
+                                           GTK_WIDGET(matcher->match_view)),
+                                   -1);
+            }
+            else
+            {
+                gtk_list_store_set(match_store, &iter,
+                                   MATCHER_COL_CONFIDENCE_PIXBUF,
+                                   gen_probability_pixbuf(gnc_import_MatchInfo_get_probability(match_info),
+                                           matcher->user_settings,
+                                           GTK_WIDGET(matcher->match_view)),
+                                   -1);
+            }
+        }
+
+        if (match_info ==
+                gnc_import_TransInfo_get_selected_match (matcher->selected_trans_info))
+        {
+            GtkTreeSelection *selection;
+
+            selection = gtk_tree_view_get_selection(matcher->match_view);
+            gtk_tree_selection_select_iter(selection, &iter);
+        }
+
+        list_element = g_list_next(list_element);
     }
 }
 
 static void
 match_transaction_changed_cb (GtkTreeSelection *selection,
-			      GNCImportMatchPicker *matcher) 
+                              GNCImportMatchPicker *matcher)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
-      matcher->selected_match_info=NULL;
-      return;
-  }
+    if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+    {
+        matcher->selected_match_info = NULL;
+        return;
+    }
 
-  gtk_tree_model_get(model, &iter,
-		     MATCHER_COL_INFO_PTR, &matcher->selected_match_info,
-		     -1);
+    gtk_tree_model_get(model, &iter,
+                       MATCHER_COL_INFO_PTR, &matcher->selected_match_info,
+                       -1);
 }
 
 static void
 match_transaction_row_activated_cb (GtkTreeView *view, GtkTreePath *path,
-				    GtkTreeViewColumn *column,
-				    GNCImportMatchPicker *matcher)
+                                    GtkTreeViewColumn *column,
+                                    GNCImportMatchPicker *matcher)
 {
-  g_return_if_fail (matcher && matcher->transaction_matcher);
+    g_return_if_fail (matcher && matcher->transaction_matcher);
 
-  gtk_dialog_response (GTK_DIALOG (matcher->transaction_matcher),
-		       GTK_RESPONSE_OK);
+    gtk_dialog_response (GTK_DIALOG (matcher->transaction_matcher),
+                         GTK_RESPONSE_OK);
 }
 
 static void
 add_column(GtkTreeView *view, const gchar *title, int col_num)
 {
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
- 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(title, renderer,
-						    "text", col_num,
-						    NULL);
-  gtk_tree_view_append_column(view, column);
-  g_object_set(G_OBJECT(column),
-	       "reorderable", TRUE,
-	       "resizable", TRUE,
-	       NULL);
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(title, renderer,
+             "text", col_num,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+    g_object_set(G_OBJECT(column),
+                 "reorderable", TRUE,
+                 "resizable", TRUE,
+                 NULL);
 }
 
 static void
 gnc_import_match_picker_init_downloaded_view (GNCImportMatchPicker * matcher)
 {
-  GtkTreeView *view;
-  GtkListStore *store;
-  GtkTreeSelection *selection;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkTreeSelection *selection;
 
-  view = matcher->downloaded_view;
-  store = gtk_list_store_new(NUM_DOWNLOADED_COLS,
-			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
-			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
-			     G_TYPE_POINTER);
-  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    view = matcher->downloaded_view;
+    store = gtk_list_store_new(NUM_DOWNLOADED_COLS,
+                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+                               G_TYPE_POINTER);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-  add_column(view, _("Account"),     DOWNLOADED_COL_ACCOUNT);
-  add_column(view, _("Date"),        DOWNLOADED_COL_DATE);
-  add_column(view, _("Amount"),      DOWNLOADED_COL_AMOUNT);
-  add_column(view, _("Description"), DOWNLOADED_COL_DESCRIPTION);
-  add_column(view, _("Memo"),        DOWNLOADED_COL_MEMO);
-  add_column(view, _("Balanced"),    DOWNLOADED_COL_BALANCED);
+    add_column(view, _("Account"),     DOWNLOADED_COL_ACCOUNT);
+    add_column(view, _("Date"),        DOWNLOADED_COL_DATE);
+    add_column(view, _("Amount"),      DOWNLOADED_COL_AMOUNT);
+    add_column(view, _("Description"), DOWNLOADED_COL_DESCRIPTION);
+    add_column(view, _("Memo"),        DOWNLOADED_COL_MEMO);
+    add_column(view, _("Balanced"),    DOWNLOADED_COL_BALANCED);
 
-  selection = gtk_tree_view_get_selection(view);
-  g_signal_connect(selection, "changed",
-		   G_CALLBACK(downloaded_transaction_changed_cb), matcher);
+    selection = gtk_tree_view_get_selection(view);
+    g_signal_connect(selection, "changed",
+                     G_CALLBACK(downloaded_transaction_changed_cb), matcher);
 }
 
 static void
 gnc_import_match_picker_init_match_view (GNCImportMatchPicker * matcher)
 {
-  GtkTreeView *view;
-  GtkListStore *store;
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
-  GtkTreeSelection *selection;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+    GtkTreeSelection *selection;
 
-  view = matcher->match_view;
-  store = gtk_list_store_new(NUM_MATCHER_COLS,
-			     G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, 
-			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
-			     G_TYPE_POINTER);
-  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    view = matcher->match_view;
+    store = gtk_list_store_new(NUM_MATCHER_COLS,
+                               G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING,
+                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+                               G_TYPE_POINTER);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-  renderer = gtk_cell_renderer_pixbuf_new();
-  g_object_set(renderer, "xalign", 0.0, NULL);
-  column = gtk_tree_view_column_new_with_attributes(_("Confidence"), renderer,
-				      "pixbuf", MATCHER_COL_CONFIDENCE_PIXBUF,
-				      NULL);
-  renderer = gtk_cell_renderer_text_new();
-  gtk_tree_view_column_pack_start(column, renderer, TRUE);
-  gtk_tree_view_column_set_attributes(column, renderer,
-				      "text", MATCHER_COL_CONFIDENCE,
-				      NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_pixbuf_new();
+    g_object_set(renderer, "xalign", 0.0, NULL);
+    column = gtk_tree_view_column_new_with_attributes(_("Confidence"), renderer,
+             "pixbuf", MATCHER_COL_CONFIDENCE_PIXBUF,
+             NULL);
+    renderer = gtk_cell_renderer_text_new();
+    gtk_tree_view_column_pack_start(column, renderer, TRUE);
+    gtk_tree_view_column_set_attributes(column, renderer,
+                                        "text", MATCHER_COL_CONFIDENCE,
+                                        NULL);
+    gtk_tree_view_append_column(view, column);
 
-  add_column(view, _("Date"),        MATCHER_COL_DATE);
-  add_column(view, _("Amount"),      MATCHER_COL_AMOUNT);
-  add_column(view, _("Description"), MATCHER_COL_DESCRIPTION);
-  add_column(view, _("Memo"),        MATCHER_COL_MEMO);
+    add_column(view, _("Date"),        MATCHER_COL_DATE);
+    add_column(view, _("Amount"),      MATCHER_COL_AMOUNT);
+    add_column(view, _("Description"), MATCHER_COL_DESCRIPTION);
+    add_column(view, _("Memo"),        MATCHER_COL_MEMO);
 
-  selection = gtk_tree_view_get_selection(view);
-  g_signal_connect(selection, "changed",
-		   G_CALLBACK(match_transaction_changed_cb), matcher);
-  g_signal_connect(view, "row-activated",
-		   G_CALLBACK(match_transaction_row_activated_cb), matcher);
+    selection = gtk_tree_view_get_selection(view);
+    g_signal_connect(selection, "changed",
+                     G_CALLBACK(match_transaction_changed_cb), matcher);
+    g_signal_connect(view, "row-activated",
+                     G_CALLBACK(match_transaction_row_activated_cb), matcher);
 }
 
 /********************************************************************\
@@ -392,75 +401,76 @@
 static void
 init_match_picker_gui(GNCImportMatchPicker * matcher)
 {
-  GladeXML *xml;
-  
-  /* DEBUG("Begin..."); */
+    GladeXML *xml;
 
-  /* Initialize user Settings. */
-  matcher->user_settings = gnc_import_Settings_new ();
+    /* DEBUG("Begin..."); */
 
-  /* load the interface */
-  xml = gnc_glade_xml_new ("generic-import.glade", "match_picker");
-  g_return_if_fail (xml != NULL);
+    /* Initialize user Settings. */
+    matcher->user_settings = gnc_import_Settings_new ();
 
-  matcher->transaction_matcher = glade_xml_get_widget (xml, "match_picker");
-  matcher->downloaded_view = (GtkTreeView *)glade_xml_get_widget (xml, "downloaded_view");
-  matcher->match_view = (GtkTreeView *)glade_xml_get_widget (xml, "matched_view");
+    /* load the interface */
+    xml = gnc_glade_xml_new ("generic-import.glade", "match_picker");
+    g_return_if_fail (xml != NULL);
 
-  gnc_import_match_picker_init_downloaded_view(matcher);
-  gnc_import_match_picker_init_match_view(matcher);
+    matcher->transaction_matcher = glade_xml_get_widget (xml, "match_picker");
+    matcher->downloaded_view = (GtkTreeView *)glade_xml_get_widget (xml, "downloaded_view");
+    matcher->match_view = (GtkTreeView *)glade_xml_get_widget (xml, "matched_view");
 
-  /* DEBUG("User prefs:%s%d%s%d%s%d%s%d%s%d",
-     " action_replace_enabled:",matcher->action_replace_enabled,
-     ", action_skip_enabled:",matcher->action_skip_enabled,
-     ", clear_threshold:",matcher->clear_threshold,
-     ", add_threshold:",matcher->add_threshold,
-     ", display_threshold:",matcher->display_threshold); */
-  
-  gnc_restore_window_size(GCONF_SECTION,
-			  GTK_WINDOW (matcher->transaction_matcher));
-  gtk_widget_show(matcher->transaction_matcher);  
-  
+    gnc_import_match_picker_init_downloaded_view(matcher);
+    gnc_import_match_picker_init_match_view(matcher);
+
+    /* DEBUG("User prefs:%s%d%s%d%s%d%s%d%s%d",
+       " action_replace_enabled:",matcher->action_replace_enabled,
+       ", action_skip_enabled:",matcher->action_skip_enabled,
+       ", clear_threshold:",matcher->clear_threshold,
+       ", add_threshold:",matcher->add_threshold,
+       ", display_threshold:",matcher->display_threshold); */
+
+    gnc_restore_window_size(GCONF_SECTION,
+                            GTK_WINDOW (matcher->transaction_matcher));
+    gtk_widget_show(matcher->transaction_matcher);
+
 }/* end init_match_picker_gui */
 
-/** 
+/**
  * Run a match_picker dialog so that the selected-MatchInfo in the
  * given trans_info is updated accordingly. This functions will only
  * return after the user clicked Ok, Cancel, or Window-Close.
  */
-void 
+void
 gnc_import_match_picker_run_and_close (GNCImportTransInfo *transaction_info)
 {
-  GNCImportMatchPicker *matcher;
-  gint response;
-  GNCImportMatchInfo *old;
-  g_assert (transaction_info);
-  
-  /* Create a new match_picker, even though it's stored in a
-     transmatcher struct :-) */
-  matcher = g_new0(GNCImportMatchPicker, 1);
-  /* DEBUG("Init match_picker"); */
-  init_match_picker_gui(matcher);
- 
-  /* Append this single transaction to the view and select it */
-  downloaded_transaction_append(matcher, transaction_info);
-  
-  old = gnc_import_TransInfo_get_selected_match(transaction_info);
-  
-  /* Let this dialog run and close. */
-  /*DEBUG("Right before run and close");*/
-  gtk_window_set_modal(GTK_WINDOW(matcher->transaction_matcher), TRUE);
-  response = gtk_dialog_run (GTK_DIALOG (matcher->transaction_matcher));
-  gnc_save_window_size(GCONF_SECTION,
-		       GTK_WINDOW (matcher->transaction_matcher));
-  gtk_widget_destroy (matcher->transaction_matcher);
-  /*DEBUG("Right after run and close");*/
-  /* DEBUG("Response was %d.", response); */
-  if (response == GTK_RESPONSE_OK && matcher->selected_match_info != old)
-    {    /* OK was pressed */
-      gnc_import_TransInfo_set_selected_match (transaction_info,
-					       matcher->selected_match_info,
-					       TRUE);
+    GNCImportMatchPicker *matcher;
+    gint response;
+    GNCImportMatchInfo *old;
+    g_assert (transaction_info);
+
+    /* Create a new match_picker, even though it's stored in a
+       transmatcher struct :-) */
+    matcher = g_new0(GNCImportMatchPicker, 1);
+    /* DEBUG("Init match_picker"); */
+    init_match_picker_gui(matcher);
+
+    /* Append this single transaction to the view and select it */
+    downloaded_transaction_append(matcher, transaction_info);
+
+    old = gnc_import_TransInfo_get_selected_match(transaction_info);
+
+    /* Let this dialog run and close. */
+    /*DEBUG("Right before run and close");*/
+    gtk_window_set_modal(GTK_WINDOW(matcher->transaction_matcher), TRUE);
+    response = gtk_dialog_run (GTK_DIALOG (matcher->transaction_matcher));
+    gnc_save_window_size(GCONF_SECTION,
+                         GTK_WINDOW (matcher->transaction_matcher));
+    gtk_widget_destroy (matcher->transaction_matcher);
+    /*DEBUG("Right after run and close");*/
+    /* DEBUG("Response was %d.", response); */
+    if (response == GTK_RESPONSE_OK && matcher->selected_match_info != old)
+    {
+        /* OK was pressed */
+        gnc_import_TransInfo_set_selected_match (transaction_info,
+                matcher->selected_match_info,
+                TRUE);
     }
 }
 

Modified: gnucash/trunk/src/import-export/import-match-picker.h
===================================================================
--- gnucash/trunk/src/import-export/import-match-picker.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-match-picker.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,7 +22,7 @@
    @brief The transaction match picker dialog interface
    @author Copyright (C) 2002 Benoit Grégoire
 */
- 
+
 #ifndef GNC_GEN_MATCH_PICKER_H
 #define GNC_GEN_MATCH_PICKER_H
 
@@ -31,10 +31,10 @@
 typedef struct _transpickerdialog GNCImportMatchPicker;
 
 /************************************************************************
- * GUI Functions 
+ * GUI Functions
  ************************************************************************/
 
-/** 
+/**
  * Run a match_picker dialog where the user should pick the best match for 'one' given
  * transaction, so that the selected-MatchInfo in the
  * given trans_info is updated accordingly. This functions will only
@@ -49,7 +49,7 @@
  *
  * @param transaction_info The TransInfo for which the user is supposed to
  * pick a matching transaction. */
-void 
+void
 gnc_import_match_picker_run_and_close (GNCImportTransInfo *transaction_info);
 /**@}*/
 

Modified: gnucash/trunk/src/import-export/import-parse.c
===================================================================
--- gnucash/trunk/src/import-export/import-parse.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-parse.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -56,42 +56,44 @@
 static void
 compile_regex(void)
 {
-  int flags = REG_EXTENDED;
+    int flags = REG_EXTENDED;
 
-  /* compile the numeric regular expressions */
-  regcomp(&decimal_radix_regex,
-	  "^ *\\$?[+-]?\\$?[0-9]+ *$|^ *\\$?[+-]?\\$?[0-9]?[0-9]?[0-9]?(,[0-9][0-9][0-9])*(\\.[0-9]*)? *$|^ *\\$?[+-]?\\$?[0-9]+\\.[0-9]* *$", flags);
-  regcomp(&comma_radix_regex,
-	  "^ *\\$?[+-]?\\$?[0-9]+ *$|^ *\\$?[+-]?\\$?[0-9]?[0-9]?[0-9]?(\\.[0-9][0-9][0-9])*(,[0-9]*)? *$|^ *\\$?[+-]?\\$?[0-9]+,[0-9]* *$", flags);
+    /* compile the numeric regular expressions */
+    regcomp(&decimal_radix_regex,
+            "^ *\\$?[+-]?\\$?[0-9]+ *$|^ *\\$?[+-]?\\$?[0-9]?[0-9]?[0-9]?(,[0-9][0-9][0-9])*(\\.[0-9]*)? *$|^ *\\$?[+-]?\\$?[0-9]+\\.[0-9]* *$", flags);
+    regcomp(&comma_radix_regex,
+            "^ *\\$?[+-]?\\$?[0-9]+ *$|^ *\\$?[+-]?\\$?[0-9]?[0-9]?[0-9]?(\\.[0-9][0-9][0-9])*(,[0-9]*)? *$|^ *\\$?[+-]?\\$?[0-9]+,[0-9]* *$", flags);
 
-  /* compile the date-parsing regular expressions */
-  regcomp(&date_regex,
-	  "^ *([0-9]+) *[-/.'] *([0-9]+) *[-/.'] *([0-9]+).*$|^ *([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]).*$", flags);
-  regcomp(&date_mdy_regex, "([0-9][0-9])([0-9][0-9])([0-9][0-9][0-9][0-9])", flags);
-  regcomp(&date_ymd_regex, "([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])", flags);
+    /* compile the date-parsing regular expressions */
+    regcomp(&date_regex,
+            "^ *([0-9]+) *[-/.'] *([0-9]+) *[-/.'] *([0-9]+).*$|^ *([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]).*$", flags);
+    regcomp(&date_mdy_regex, "([0-9][0-9])([0-9][0-9])([0-9][0-9][0-9][0-9])", flags);
+    regcomp(&date_ymd_regex, "([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])", flags);
 
-  regex_compiled = TRUE;
+    regex_compiled = TRUE;
 }
 
 static gint
 my_strntol(const char *str, int len)
 {
-  gint res = 0;
+    gint res = 0;
 
-  g_return_val_if_fail(str, 0);
-  g_return_val_if_fail(len, 0);
+    g_return_val_if_fail(str, 0);
+    g_return_val_if_fail(len, 0);
 
-  while(len--) {
+    while (len--)
+    {
 
-    if (*str < '0' || *str > '9') {
-      str++;
-      continue;
+        if (*str < '0' || *str > '9')
+        {
+            str++;
+            continue;
+        }
+
+        res *= 10;
+        res += *(str++) - '0';
     }
-      
-    res *= 10;
-    res += *(str++) - '0';
-  }
-  return res;
+    return res;
 }
 
 /*
@@ -102,153 +104,163 @@
 static GncImportFormat
 check_date_format(const char * str, regmatch_t *match, GncImportFormat fmts)
 {
-  GncImportFormat res = 0;
-  int len0=0, len1=0, len2=0;
-  int val0=0, val1=0, val2=0;
+    GncImportFormat res = 0;
+    int len0 = 0, len1 = 0, len2 = 0;
+    int val0 = 0, val1 = 0, val2 = 0;
 
-  g_return_val_if_fail(match, res);
-  g_return_val_if_fail(fmts, res);
+    g_return_val_if_fail(match, res);
+    g_return_val_if_fail(fmts, res);
 
-  /* Compute the lengths */
-  len0 = match[1].rm_eo - match[1].rm_so;
-  len1 = match[2].rm_eo - match[2].rm_so;
-  len2 = match[3].rm_eo - match[3].rm_so;
+    /* Compute the lengths */
+    len0 = match[1].rm_eo - match[1].rm_so;
+    len1 = match[2].rm_eo - match[2].rm_so;
+    len2 = match[3].rm_eo - match[3].rm_so;
 
-  /* compute the numeric values */
-  val0 = my_strntol(str + match[1].rm_so, len0);
-  val1 = my_strntol(str + match[2].rm_so, len1);
-  val2 = my_strntol(str + match[3].rm_so, len2);
+    /* compute the numeric values */
+    val0 = my_strntol(str + match[1].rm_so, len0);
+    val1 = my_strntol(str + match[2].rm_so, len1);
+    val2 = my_strntol(str + match[3].rm_so, len2);
 
-  /* Filter out the possibilities.  Hopefully only one will remain */
+    /* Filter out the possibilities.  Hopefully only one will remain */
 
-  if (val0 > 12) import_clear_flag(fmts, GNCIF_DATE_MDY);
-  if (val0 > 31) import_clear_flag(fmts, GNCIF_DATE_DMY);
-  if (val0 < 1) {
-    import_clear_flag(fmts, GNCIF_DATE_DMY);
-    import_clear_flag(fmts, GNCIF_DATE_MDY);
-  }
+    if (val0 > 12) import_clear_flag(fmts, GNCIF_DATE_MDY);
+    if (val0 > 31) import_clear_flag(fmts, GNCIF_DATE_DMY);
+    if (val0 < 1)
+    {
+        import_clear_flag(fmts, GNCIF_DATE_DMY);
+        import_clear_flag(fmts, GNCIF_DATE_MDY);
+    }
 
-  if (val1 > 12) {
-    import_clear_flag(fmts, GNCIF_DATE_DMY);
-    import_clear_flag(fmts, GNCIF_DATE_YMD);
-  }
-  if (val1 > 31) {
-    import_clear_flag(fmts, GNCIF_DATE_MDY);
-    import_clear_flag(fmts, GNCIF_DATE_YDM);
-  }
+    if (val1 > 12)
+    {
+        import_clear_flag(fmts, GNCIF_DATE_DMY);
+        import_clear_flag(fmts, GNCIF_DATE_YMD);
+    }
+    if (val1 > 31)
+    {
+        import_clear_flag(fmts, GNCIF_DATE_MDY);
+        import_clear_flag(fmts, GNCIF_DATE_YDM);
+    }
 
-  if (val2 > 12) import_clear_flag(fmts, GNCIF_DATE_YDM);
-  if (val2 > 31) import_clear_flag(fmts, GNCIF_DATE_YMD);
-  if (val2 < 1) {
-    import_clear_flag(fmts, GNCIF_DATE_YMD);
-    import_clear_flag(fmts, GNCIF_DATE_YDM);
-  }
+    if (val2 > 12) import_clear_flag(fmts, GNCIF_DATE_YDM);
+    if (val2 > 31) import_clear_flag(fmts, GNCIF_DATE_YMD);
+    if (val2 < 1)
+    {
+        import_clear_flag(fmts, GNCIF_DATE_YMD);
+        import_clear_flag(fmts, GNCIF_DATE_YDM);
+    }
 
-  /* if we've got a 4-character year, make sure the value is greater
-   * than 1930 and less than 2100.  XXX: be sure to fix this by 2100!
-   */
-  if (len0 == 4 && (val0 < 1930 || val0 > 2100)) {
-    import_clear_flag(fmts, GNCIF_DATE_YMD);
-    import_clear_flag(fmts, GNCIF_DATE_YDM);
-  }
-  if (len2 == 4 && (val2 < 1930 || val2 > 2100)) {
-    import_clear_flag(fmts, GNCIF_DATE_MDY);
-    import_clear_flag(fmts, GNCIF_DATE_DMY);
-  }
+    /* if we've got a 4-character year, make sure the value is greater
+     * than 1930 and less than 2100.  XXX: be sure to fix this by 2100!
+     */
+    if (len0 == 4 && (val0 < 1930 || val0 > 2100))
+    {
+        import_clear_flag(fmts, GNCIF_DATE_YMD);
+        import_clear_flag(fmts, GNCIF_DATE_YDM);
+    }
+    if (len2 == 4 && (val2 < 1930 || val2 > 2100))
+    {
+        import_clear_flag(fmts, GNCIF_DATE_MDY);
+        import_clear_flag(fmts, GNCIF_DATE_DMY);
+    }
 
-  /* If the first string has a length of only 1, then it is definitely
-   * not a year (although it could be a month or day).
-   */
-  if (len0 == 1) {
-    import_clear_flag(fmts, GNCIF_DATE_YMD);
-    import_clear_flag(fmts, GNCIF_DATE_YDM);
-  }
+    /* If the first string has a length of only 1, then it is definitely
+     * not a year (although it could be a month or day).
+     */
+    if (len0 == 1)
+    {
+        import_clear_flag(fmts, GNCIF_DATE_YMD);
+        import_clear_flag(fmts, GNCIF_DATE_YDM);
+    }
 
-  return fmts;
+    return fmts;
 }
 
 GncImportFormat
 gnc_import_test_numeric(const char* str, GncImportFormat fmts)
 {
-  GncImportFormat res = 0;
+    GncImportFormat res = 0;
 
-  g_return_val_if_fail(str, fmts);
+    g_return_val_if_fail(str, fmts);
 
-  if (!regex_compiled)
-    compile_regex();
+    if (!regex_compiled)
+        compile_regex();
 
-  if ((fmts & GNCIF_NUM_PERIOD) && !regexec(&decimal_radix_regex, str, 0, NULL, 0))
-    res |= GNCIF_NUM_PERIOD;
+    if ((fmts & GNCIF_NUM_PERIOD) && !regexec(&decimal_radix_regex, str, 0, NULL, 0))
+        res |= GNCIF_NUM_PERIOD;
 
-  if ((fmts & GNCIF_NUM_COMMA) && !regexec(&comma_radix_regex, str, 0, NULL, 0))
-    res |= GNCIF_NUM_COMMA;
+    if ((fmts & GNCIF_NUM_COMMA) && !regexec(&comma_radix_regex, str, 0, NULL, 0))
+        res |= GNCIF_NUM_COMMA;
 
-  return res;
+    return res;
 }
 
 
 GncImportFormat
 gnc_import_test_date(const char* str, GncImportFormat fmts)
 {
-  regmatch_t match[5];
-  GncImportFormat res = 0;
+    regmatch_t match[5];
+    GncImportFormat res = 0;
 
-  g_return_val_if_fail(str, fmts);
-  g_return_val_if_fail(strlen(str) > 1, fmts);
+    g_return_val_if_fail(str, fmts);
+    g_return_val_if_fail(strlen(str) > 1, fmts);
 
-  if (!regex_compiled)
-    compile_regex();
+    if (!regex_compiled)
+        compile_regex();
 
-  if (!regexec(&date_regex, str, 5, match, 0)) {
-    if (match[1].rm_so != -1)
-      res = check_date_format(str, match, fmts);
-    else {
-      /* Hmm, it matches XXXXXXXX, but is this YYYYxxxx or xxxxYYYY?
-       * let's try both ways and let the parser check that YYYY is
-       * valid.
-       */
-      char temp[9];
+    if (!regexec(&date_regex, str, 5, match, 0))
+    {
+        if (match[1].rm_so != -1)
+            res = check_date_format(str, match, fmts);
+        else
+        {
+            /* Hmm, it matches XXXXXXXX, but is this YYYYxxxx or xxxxYYYY?
+             * let's try both ways and let the parser check that YYYY is
+             * valid.
+             */
+            char temp[9];
 
-      g_return_val_if_fail(match[4].rm_so != -1, fmts);
-      g_return_val_if_fail(match[4].rm_eo - match[4].rm_so == 8, fmts);
-      
-      /* make a temp copy of the XXXXXXXX string */
-      strncpy(temp, str+match[4].rm_so, 8);
-      temp[8] = '\0';
+            g_return_val_if_fail(match[4].rm_so != -1, fmts);
+            g_return_val_if_fail(match[4].rm_eo - match[4].rm_so == 8, fmts);
 
-      /* then check it against the ymd or mdy formats, as necessary */
-      if (((fmts & GNCIF_DATE_YDM) || (fmts & GNCIF_DATE_YMD)) &&
-	  !regexec(&date_ymd_regex, temp, 4, match, 0))
-	res |= check_date_format(temp, match, fmts);
+            /* make a temp copy of the XXXXXXXX string */
+            strncpy(temp, str + match[4].rm_so, 8);
+            temp[8] = '\0';
 
-      if (((fmts & GNCIF_DATE_DMY) || (fmts & GNCIF_DATE_MDY)) &&
-	  !regexec(&date_mdy_regex, temp, 4, match, 0))
-	res |= check_date_format(temp, match, fmts);
+            /* then check it against the ymd or mdy formats, as necessary */
+            if (((fmts & GNCIF_DATE_YDM) || (fmts & GNCIF_DATE_YMD)) &&
+                    !regexec(&date_ymd_regex, temp, 4, match, 0))
+                res |= check_date_format(temp, match, fmts);
+
+            if (((fmts & GNCIF_DATE_DMY) || (fmts & GNCIF_DATE_MDY)) &&
+                    !regexec(&date_mdy_regex, temp, 4, match, 0))
+                res |= check_date_format(temp, match, fmts);
+        }
     }
-  }
 
-  return res;
+    return res;
 }
 
 gboolean
 gnc_import_parse_numeric(const char* str, GncImportFormat fmt, gnc_numeric *val)
 {
-  g_return_val_if_fail(str, FALSE);
-  g_return_val_if_fail(val, FALSE);
-  g_return_val_if_fail(fmt, FALSE);
-  g_return_val_if_fail(!(fmt & (fmt-1)), FALSE);
+    g_return_val_if_fail(str, FALSE);
+    g_return_val_if_fail(val, FALSE);
+    g_return_val_if_fail(fmt, FALSE);
+    g_return_val_if_fail(!(fmt & (fmt - 1)), FALSE);
 
-  switch(fmt) {
-  case GNCIF_NUM_PERIOD:
-    return xaccParseAmountExtended(str, TRUE, '-', '.', ',', NULL, "$+",
-				   val, NULL);
-  case GNCIF_NUM_COMMA:
-    return xaccParseAmountExtended(str, TRUE, '-', ',', '.', NULL, "$+",
-				   val, NULL);
-  default:
-    PERR("invalid format: %d", fmt);
-    return FALSE;
-  }
+    switch (fmt)
+    {
+    case GNCIF_NUM_PERIOD:
+        return xaccParseAmountExtended(str, TRUE, '-', '.', ',', NULL, "$+",
+                                       val, NULL);
+    case GNCIF_NUM_COMMA:
+        return xaccParseAmountExtended(str, TRUE, '-', ',', '.', NULL, "$+",
+                                       val, NULL);
+    default:
+        PERR("invalid format: %d", fmt);
+        return FALSE;
+    }
 }
 
 /* Handle y2k fixes, etc.
@@ -258,123 +270,144 @@
 static int
 fix_year(int y)
 {
-  /* two-digit numbers less than "70"  are interpretted to be post-2000. */
-  if (y < 70)
-    return (y + 2000);
+    /* two-digit numbers less than "70"  are interpretted to be post-2000. */
+    if (y < 70)
+        return (y + 2000);
 
-  /* fix a common bug in printing post-2000 dates as 19100, etc. */
-  if (y > 19000)
-    return (1900 + (y - 19000));
+    /* fix a common bug in printing post-2000 dates as 19100, etc. */
+    if (y > 19000)
+        return (1900 + (y - 19000));
 
-  /* At this point we just want to make sure that this is a real date.
-   * y _should_ be a 'unix year' (which is the number of years since
-   * 1900), but it _COULD_ be a full date (1999, 2001, etc.).  At some
-   * point in the future we can't tell the difference, but are we really
-   * going to care if this code fails in 3802?
-   */
-  if (y < 1902)
-    return (y + 1900);
+    /* At this point we just want to make sure that this is a real date.
+     * y _should_ be a 'unix year' (which is the number of years since
+     * 1900), but it _COULD_ be a full date (1999, 2001, etc.).  At some
+     * point in the future we can't tell the difference, but are we really
+     * going to care if this code fails in 3802?
+     */
+    if (y < 1902)
+        return (y + 1900);
 
-  /* y is good as it is */
-  return y;
+    /* y is good as it is */
+    return y;
 }
 
 gboolean
 gnc_import_parse_date(const char *str, GncImportFormat fmt, Timespec *val)
 {
-  regmatch_t match[5];
-  char temp[9];
-  const char *datestr;
+    regmatch_t match[5];
+    char temp[9];
+    const char *datestr;
 
-  int v0 = 0, v1=0, v2=0;
-  int m=0, d=0, y=0;
+    int v0 = 0, v1 = 0, v2 = 0;
+    int m = 0, d = 0, y = 0;
 
-  g_return_val_if_fail(str, FALSE);
-  g_return_val_if_fail(val, FALSE);
-  g_return_val_if_fail(fmt, FALSE);
-  g_return_val_if_fail(!(fmt & (fmt-1)), FALSE);
+    g_return_val_if_fail(str, FALSE);
+    g_return_val_if_fail(val, FALSE);
+    g_return_val_if_fail(fmt, FALSE);
+    g_return_val_if_fail(!(fmt & (fmt - 1)), FALSE);
 
-  if (!regexec(&date_regex, str, 5, match, 0)) {
-    if (match[1].rm_so != -1)
-      datestr = str;
-    else {
-      /* date is of the form XXXXXXX; save it to a temp string and
-       * split it based on the format, either YYYYaabb or aabbYYYY
-       */
-      g_return_val_if_fail(match[4].rm_so != -1, FALSE);
-      g_return_val_if_fail(match[4].rm_eo - match[4].rm_so == 8, FALSE);
+    if (!regexec(&date_regex, str, 5, match, 0))
+    {
+        if (match[1].rm_so != -1)
+            datestr = str;
+        else
+        {
+            /* date is of the form XXXXXXX; save it to a temp string and
+             * split it based on the format, either YYYYaabb or aabbYYYY
+             */
+            g_return_val_if_fail(match[4].rm_so != -1, FALSE);
+            g_return_val_if_fail(match[4].rm_eo - match[4].rm_so == 8, FALSE);
 
-      strncpy(temp, str+match[4].rm_so, 8);
-      temp[8] = '\0';
+            strncpy(temp, str + match[4].rm_so, 8);
+            temp[8] = '\0';
 
-      switch (fmt) {
-      case GNCIF_DATE_DMY:
-      case GNCIF_DATE_MDY:
-	g_return_val_if_fail(!regexec(&date_mdy_regex, temp, 4, match, 0), FALSE);
-	break;
-      case GNCIF_DATE_YMD:
-      case GNCIF_DATE_YDM:
-	g_return_val_if_fail(!regexec(&date_ymd_regex, temp, 4, match, 0), FALSE);
-	break;
-      default:
-	PERR("Invalid date format provided: %d", fmt);
-	return FALSE;
-      }
-      datestr = temp;
-    }
+            switch (fmt)
+            {
+            case GNCIF_DATE_DMY:
+            case GNCIF_DATE_MDY:
+                g_return_val_if_fail(!regexec(&date_mdy_regex, temp, 4, match, 0), FALSE);
+                break;
+            case GNCIF_DATE_YMD:
+            case GNCIF_DATE_YDM:
+                g_return_val_if_fail(!regexec(&date_ymd_regex, temp, 4, match, 0), FALSE);
+                break;
+            default:
+                PERR("Invalid date format provided: %d", fmt);
+                return FALSE;
+            }
+            datestr = temp;
+        }
 
-    /* datestr points to the date string, and match[123] contains the matches. */
+        /* datestr points to the date string, and match[123] contains the matches. */
 
-    if (match[1].rm_so == -1 || match[2].rm_so == -1 || match[3].rm_so == -1) {
-      PERR("can't interpret date %s", str);
-      return FALSE;
-    }
+        if (match[1].rm_so == -1 || match[2].rm_so == -1 || match[3].rm_so == -1)
+        {
+            PERR("can't interpret date %s", str);
+            return FALSE;
+        }
 
-    /* grab the numerics */
-    v0 = my_strntol(datestr + match[1].rm_so, match[1].rm_eo-match[1].rm_so);
-    v1 = my_strntol(datestr + match[2].rm_so, match[2].rm_eo-match[2].rm_so);
-    v2 = my_strntol(datestr + match[3].rm_so, match[3].rm_eo-match[3].rm_so);
+        /* grab the numerics */
+        v0 = my_strntol(datestr + match[1].rm_so, match[1].rm_eo - match[1].rm_so);
+        v1 = my_strntol(datestr + match[2].rm_so, match[2].rm_eo - match[2].rm_so);
+        v2 = my_strntol(datestr + match[3].rm_so, match[3].rm_eo - match[3].rm_so);
 
-    switch (fmt) {
-    case GNCIF_DATE_DMY:
-      if (v0 > 0 && v0 <= 31 && v1 > 0 && v1 <= 12 && v2 > 0) {
-	d = v0; m = v1; y = v2;
-      } else
-	PERR("format is d/m/y but date is %s", str);
-      break;
+        switch (fmt)
+        {
+        case GNCIF_DATE_DMY:
+            if (v0 > 0 && v0 <= 31 && v1 > 0 && v1 <= 12 && v2 > 0)
+            {
+                d = v0;
+                m = v1;
+                y = v2;
+            }
+            else
+                PERR("format is d/m/y but date is %s", str);
+            break;
 
-    case GNCIF_DATE_MDY:
-      if (v0 > 0 && v0 <= 12 && v1 > 0 && v1 <= 31 && v2 > 0) {
-	m = v0; d = v1; y = v2;
-      } else
-	PERR("format is m/d/y but date is %s", str);
-      break;
+        case GNCIF_DATE_MDY:
+            if (v0 > 0 && v0 <= 12 && v1 > 0 && v1 <= 31 && v2 > 0)
+            {
+                m = v0;
+                d = v1;
+                y = v2;
+            }
+            else
+                PERR("format is m/d/y but date is %s", str);
+            break;
 
-    case GNCIF_DATE_YMD:
-      if (v0 > 0 && v1 > 0 && v1 <= 12 && v2 > 0 && v2 <= 31) {
-	y = v0; m = v1; d = v2;
-      } else
-	PERR("format is y/m/d but date is %s", str);
-      break;
+        case GNCIF_DATE_YMD:
+            if (v0 > 0 && v1 > 0 && v1 <= 12 && v2 > 0 && v2 <= 31)
+            {
+                y = v0;
+                m = v1;
+                d = v2;
+            }
+            else
+                PERR("format is y/m/d but date is %s", str);
+            break;
 
-    case GNCIF_DATE_YDM:
-      if (v0 > 0 && v1 > 0 && v1 <= 31 && v2 > 0 && v2 <= 12) {
-	y = v0; d = v1; m = v2;
-      } else
-	PERR("format is y/d/m but date is %s", str);
-      break;
+        case GNCIF_DATE_YDM:
+            if (v0 > 0 && v1 > 0 && v1 <= 31 && v2 > 0 && v2 <= 12)
+            {
+                y = v0;
+                d = v1;
+                m = v2;
+            }
+            else
+                PERR("format is y/d/m but date is %s", str);
+            break;
 
-    default:
-      PERR("invalid date format: %d", fmt);
-    }
+        default:
+            PERR("invalid date format: %d", fmt);
+        }
 
-    if (!m || !d || !y)
-      return FALSE;
+        if (!m || !d || !y)
+            return FALSE;
 
-    y = fix_year(y);
-    *val = gnc_dmy2timespec(d, m, y);
-    return TRUE;
-  }
+        y = fix_year(y);
+        *val = gnc_dmy2timespec(d, m, y);
+        return TRUE;
+    }
 
-  return FALSE;
+    return FALSE;
 }

Modified: gnucash/trunk/src/import-export/import-parse.h
===================================================================
--- gnucash/trunk/src/import-export/import-parse.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-parse.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -29,18 +29,19 @@
 
 #include "qof.h"
 
-typedef enum {
-  GNCIF_NONE		= 0,
+typedef enum
+{
+    GNCIF_NONE		= 0,
 
-  /* number formats */
-  GNCIF_NUM_PERIOD	= (1 << 1),
-  GNCIF_NUM_COMMA	= (1 << 2),
+    /* number formats */
+    GNCIF_NUM_PERIOD	= (1 << 1),
+    GNCIF_NUM_COMMA	= (1 << 2),
 
-  /* date formats */
-  GNCIF_DATE_MDY	= (1 << 8),
-  GNCIF_DATE_DMY	= (1 << 9),
-  GNCIF_DATE_YMD	= (1 << 10),
-  GNCIF_DATE_YDM	= (1 << 11)
+    /* date formats */
+    GNCIF_DATE_MDY	= (1 << 8),
+    GNCIF_DATE_DMY	= (1 << 9),
+    GNCIF_DATE_YMD	= (1 << 10),
+    GNCIF_DATE_YDM	= (1 << 11)
 } GncImportFormat;
 
 
@@ -49,12 +50,12 @@
 
 
 GncImportFormat gnc_import_choose_fmt(const char* msg, GncImportFormat fmts,
-				      gpointer user_data);
+                                      gpointer user_data);
 
 gboolean gnc_import_parse_numeric(const char* str, GncImportFormat fmt,
-				  gnc_numeric *val);
+                                  gnc_numeric *val);
 gboolean gnc_import_parse_date(const char *date, GncImportFormat fmt,
-			       Timespec *val);
+                               Timespec *val);
 
 /* Set and clear flags in bit-flags */
 #define import_set_flag(i,f) (i |= f)

Modified: gnucash/trunk/src/import-export/import-settings.c
===================================================================
--- gnucash/trunk/src/import-export/import-settings.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-settings.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,7 +20,7 @@
     @{ */
 /**@internal
    @file import-settings.c
-   @brief User preference handling for 
+   @brief User preference handling for
    transaction matching (for both the gui and the backend)
    @author Copyright (C) 2002 Benoit Grégoire
 */
@@ -45,129 +45,131 @@
  *               Structures passed between the functions             *
 \********************************************************************/
 
-struct _genimportsettings {
+struct _genimportsettings
+{
 
-  gboolean action_skip_enabled;
-  gboolean action_edit_enabled;
-  gboolean action_add_enabled;
-  gboolean action_clear_enabled;
-  
-  /**Transaction who's best match probability is equal or higher than
-     this will reconcile their best match by default */
-  int clear_threshold;
-  /**Transaction who's best match probability is below or equal to 
-     this will be added as new by default */
-  int add_threshold;
-  /**Transaction's match probability must be at least this much to be 
-     displayed in the match list.  Dont set this to 0 except for 
-     debugging purposes, otherwise all transactions of every accounts 
-     will be shown in the list */
-  int display_threshold;
-  /** The allowed amount range for fuzzy amount matching, 
-      in the users default commodity.*/
-  double fuzzy_amount;
-  gint match_date_hardlimit;
+    gboolean action_skip_enabled;
+    gboolean action_edit_enabled;
+    gboolean action_add_enabled;
+    gboolean action_clear_enabled;
+
+    /**Transaction who's best match probability is equal or higher than
+       this will reconcile their best match by default */
+    int clear_threshold;
+    /**Transaction who's best match probability is below or equal to
+       this will be added as new by default */
+    int add_threshold;
+    /**Transaction's match probability must be at least this much to be
+       displayed in the match list.  Dont set this to 0 except for
+       debugging purposes, otherwise all transactions of every accounts
+       will be shown in the list */
+    int display_threshold;
+    /** The allowed amount range for fuzzy amount matching,
+        in the users default commodity.*/
+    double fuzzy_amount;
+    gint match_date_hardlimit;
 };
 
 
 /************************************************************************
- *   Getter/Setter Functions for the Data Types. 
+ *   Getter/Setter Functions for the Data Types.
  ************************************************************************/
 /* Constructor */
 GNCImportSettings *
 gnc_import_Settings_new (void)
 {
-  GNCImportSettings * settings;
-  
-  settings = g_new0 ( GNCImportSettings, 1);
+    GNCImportSettings * settings;
 
-  
-  settings->action_skip_enabled = 
-    gnc_gconf_get_bool(GCONF_SECTION, "enable_skip", NULL);
-  settings->action_edit_enabled =
-    gnc_gconf_get_bool(GCONF_SECTION, "enable_edit", NULL);
-  settings->action_add_enabled=DEFAULT_ACTION_ADD_ENABLED;
-  settings->action_clear_enabled=DEFAULT_ACTION_CLEAR_ENABLED;
-  settings->clear_threshold=
-    gnc_gconf_get_float(GCONF_SECTION, "auto_clear_threshold", NULL);
-  settings->add_threshold=
-    gnc_gconf_get_float(GCONF_SECTION, "auto_add_threshold", NULL);
-  settings->display_threshold =
-    gnc_gconf_get_float(GCONF_SECTION, "match_threshold", NULL);
+    settings = g_new0 ( GNCImportSettings, 1);
 
-  settings->fuzzy_amount =
-    gnc_gconf_get_float(GCONF_SECTION, "atm_fee_threshold", NULL);
 
-  settings->match_date_hardlimit = 42; /* 6 weeks */
-  return settings;
+    settings->action_skip_enabled =
+        gnc_gconf_get_bool(GCONF_SECTION, "enable_skip", NULL);
+    settings->action_edit_enabled =
+        gnc_gconf_get_bool(GCONF_SECTION, "enable_edit", NULL);
+    settings->action_add_enabled = DEFAULT_ACTION_ADD_ENABLED;
+    settings->action_clear_enabled = DEFAULT_ACTION_CLEAR_ENABLED;
+    settings->clear_threshold =
+        gnc_gconf_get_float(GCONF_SECTION, "auto_clear_threshold", NULL);
+    settings->add_threshold =
+        gnc_gconf_get_float(GCONF_SECTION, "auto_add_threshold", NULL);
+    settings->display_threshold =
+        gnc_gconf_get_float(GCONF_SECTION, "match_threshold", NULL);
+
+    settings->fuzzy_amount =
+        gnc_gconf_get_float(GCONF_SECTION, "atm_fee_threshold", NULL);
+
+    settings->match_date_hardlimit = 42; /* 6 weeks */
+    return settings;
 }
 
 /* Destructor */
 void gnc_import_Settings_delete (GNCImportSettings *settings)
 {
-  if (settings) {
-    g_free(settings);
-  }
+    if (settings)
+    {
+        g_free(settings);
+    }
 }
 
-double 
+double
 gnc_import_Settings_get_fuzzy_amount (GNCImportSettings *settings)
 {
-  g_assert (settings);
-  return settings->fuzzy_amount;
+    g_assert (settings);
+    return settings->fuzzy_amount;
 };
 
 gboolean gnc_import_Settings_get_action_skip_enabled (GNCImportSettings *settings)
 {
-  g_assert (settings);
-  return settings->action_skip_enabled;
+    g_assert (settings);
+    return settings->action_skip_enabled;
 };
 
 gboolean gnc_import_Settings_get_action_add_enabled (GNCImportSettings *settings)
 {
-  g_assert (settings);
-  return settings->action_add_enabled;
+    g_assert (settings);
+    return settings->action_add_enabled;
 };
 
 gboolean gnc_import_Settings_get_action_edit_enabled (GNCImportSettings *settings)
 {
-  g_assert (settings);
-  return settings->action_edit_enabled;
+    g_assert (settings);
+    return settings->action_edit_enabled;
 };
 
 gboolean gnc_import_Settings_get_action_clear_enabled (GNCImportSettings *settings)
 {
-  g_assert (settings);
-  return settings->action_clear_enabled;
+    g_assert (settings);
+    return settings->action_clear_enabled;
 };
 
 gint gnc_import_Settings_get_clear_threshold (GNCImportSettings *settings)
 {
-  g_assert (settings);
-  return settings->clear_threshold;
+    g_assert (settings);
+    return settings->clear_threshold;
 };
 
 gint gnc_import_Settings_get_add_threshold (GNCImportSettings *settings)
 {
-  g_assert (settings);
-  return settings->add_threshold;
+    g_assert (settings);
+    return settings->add_threshold;
 };
 
 gint gnc_import_Settings_get_display_threshold (GNCImportSettings *settings)
 {
-  g_assert (settings);
-  return settings->display_threshold;
+    g_assert (settings);
+    return settings->display_threshold;
 };
 
 void gnc_import_Settings_set_match_date_hardlimit (GNCImportSettings *s, gint m)
-{ 
-  g_assert(s);
-  s->match_date_hardlimit = m;
+{
+    g_assert(s);
+    s->match_date_hardlimit = m;
 }
 gint gnc_import_Settings_get_match_date_hardlimit (const GNCImportSettings *s)
 {
-  g_assert(s);
-  return s->match_date_hardlimit;
+    g_assert(s);
+    return s->match_date_hardlimit;
 }
 
 /**@}*/

Modified: gnucash/trunk/src/import-export/import-settings.h
===================================================================
--- gnucash/trunk/src/import-export/import-settings.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-settings.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -20,18 +20,18 @@
     @{ */
 /**@file import-settings.h
    \brief Import preference handling.
-   *User preference interface for 
+   *User preference interface for
    transaction matching (for both the gui and the backend)
    \author Copyright (C) 2002 Benoit Grégoire
 */
- 
+
 #ifndef GNC_GEN_SETTINGS_H
 #define GNC_GEN_SETTINGS_H
 
 typedef struct _genimportsettings GNCImportSettings;
 
 /************************************************************************
- *   Getter/Setter Functions for the Data Types. 
+ *   Getter/Setter Functions for the Data Types.
  ************************************************************************/
 
 
@@ -39,7 +39,7 @@
 /** Allocates a new GNCImportSettings object, and initialize it with
  *    the appropriate user prefs.
  */
-GNCImportSettings * 
+GNCImportSettings *
 gnc_import_Settings_new (void);
 
 /** Destructor */
@@ -50,10 +50,10 @@
 /*@{*/
 
 /** Return the allowed amount range for fuzzy amount matching.
-    @return The allowed amount range for fuzzy amount matching, 
+    @return The allowed amount range for fuzzy amount matching,
     in the users default commodity.
 */
-double 
+double
 gnc_import_Settings_get_fuzzy_amount (GNCImportSettings *settings);
 
 /** Return the selected action is enable state.
@@ -91,7 +91,7 @@
  * ignored altogether. For use cases without paper checks (e.g. HBCI),
  * values like 14 (days) might be appropriate, whereas for use cases
  * with paper checks (e.g. OFX, QIF), values like 42 (days) seem more
- * appropriate. 
+ * appropriate.
  */
 void gnc_import_Settings_set_match_date_hardlimit (GNCImportSettings *settings, gint match_date_hardlimit);
 /** Returns the hard-limiting number of days that a matching split may differ. */

Modified: gnucash/trunk/src/import-export/import-utilities.c
===================================================================
--- gnucash/trunk/src/import-export/import-utilities.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-utilities.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -42,61 +42,61 @@
 
 const gchar * gnc_import_get_acc_online_id(Account * account)
 {
-  kvp_frame * frame;
-  frame = xaccAccountGetSlots(account);
-  return kvp_frame_get_string(frame, "online_id");
+    kvp_frame * frame;
+    frame = xaccAccountGetSlots(account);
+    return kvp_frame_get_string(frame, "online_id");
 }
 
 void gnc_import_set_acc_online_id(Account * account,
-				  const gchar * string_value)
+                                  const gchar * string_value)
 {
-  kvp_frame * frame;
-  frame = xaccAccountGetSlots(account);
-  kvp_frame_set_str(frame, "online_id", string_value);
+    kvp_frame * frame;
+    frame = xaccAccountGetSlots(account);
+    kvp_frame_set_str(frame, "online_id", string_value);
 }
 
 const gchar * gnc_import_get_trans_online_id(Transaction * transaction)
 {
-  kvp_frame * frame;
-  frame = xaccTransGetSlots(transaction);
-  return kvp_frame_get_string(frame, "online_id");
+    kvp_frame * frame;
+    frame = xaccTransGetSlots(transaction);
+    return kvp_frame_get_string(frame, "online_id");
 }
 
 void gnc_import_set_trans_online_id(Transaction * transaction,
-				    const gchar * string_value)
+                                    const gchar * string_value)
 {
-  kvp_frame * frame;
-  frame = xaccTransGetSlots(transaction);
-  kvp_frame_set_str (frame, "online_id", string_value);
+    kvp_frame * frame;
+    frame = xaccTransGetSlots(transaction);
+    kvp_frame_set_str (frame, "online_id", string_value);
 }
 
 gboolean gnc_import_trans_has_online_id(Transaction * transaction)
 {
-	const gchar * online_id;
-	online_id = gnc_import_get_trans_online_id(transaction);
-	return (online_id != NULL && strlen(online_id) > 0);
+    const gchar * online_id;
+    online_id = gnc_import_get_trans_online_id(transaction);
+    return (online_id != NULL && strlen(online_id) > 0);
 }
 
 const gchar * gnc_import_get_split_online_id(Split * split)
 {
-  kvp_frame * frame;
-  frame = xaccSplitGetSlots(split);
-  return kvp_frame_get_string(frame, "online_id");
+    kvp_frame * frame;
+    frame = xaccSplitGetSlots(split);
+    return kvp_frame_get_string(frame, "online_id");
 }
 
 void gnc_import_set_split_online_id(Split * split,
-				    const gchar * string_value)
+                                    const gchar * string_value)
 {
-  kvp_frame * frame;
-  frame = xaccSplitGetSlots(split);
-  kvp_frame_set_str (frame, "online_id", string_value);
+    kvp_frame * frame;
+    frame = xaccSplitGetSlots(split);
+    kvp_frame_set_str (frame, "online_id", string_value);
 }
 
 gboolean gnc_import_split_has_online_id(Split * split)
 {
-	const gchar * online_id;
-	online_id = gnc_import_get_split_online_id(split);
-	return (online_id != NULL && strlen(online_id) > 0);
+    const gchar * online_id;
+    online_id = gnc_import_get_split_online_id(split);
+    return (online_id != NULL && strlen(online_id) > 0);
 }
 
 /* @} */

Modified: gnucash/trunk/src/import-export/import-utilities.h
===================================================================
--- gnucash/trunk/src/import-export/import-utilities.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/import-utilities.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -28,34 +28,34 @@
 #include "Account.h"
 
 /** @name Setter-getters
-    Setter and getter functions for the online_id kvp_frame for 
+    Setter and getter functions for the online_id kvp_frame for
     Accounts.
 	@{
-*/ 
+*/
 const gchar * gnc_import_get_acc_online_id(Account * account);
-void gnc_import_set_acc_online_id(Account * account, 
-				  const gchar * string_value);
+void gnc_import_set_acc_online_id(Account * account,
+                                  const gchar * string_value);
 /** @} */
 /** @name Setter-getters
-    Setter and getter functions for the online_id kvp_frame for 
+    Setter and getter functions for the online_id kvp_frame for
     Transactions.
 	@{
-*/ 
+*/
 const gchar * gnc_import_get_trans_online_id(Transaction * transaction);
-void gnc_import_set_trans_online_id(Transaction * transaction, 
-				    const gchar * string_value);
+void gnc_import_set_trans_online_id(Transaction * transaction,
+                                    const gchar * string_value);
 /** @} */
 
 gboolean gnc_import_trans_has_online_id(Transaction * transaction);
 
 /** @name Setter-getters
-    Setter and getter functions for the online_id kvp_frame for 
+    Setter and getter functions for the online_id kvp_frame for
     Splits.
 	@{
-*/ 
+*/
 const gchar * gnc_import_get_split_online_id(Split * split);
 void gnc_import_set_split_online_id(Split * split,
-				    const gchar * string_value);
+                                    const gchar * string_value);
 /** @} */
 
 gboolean gnc_import_split_has_online_id(Split * split);

Modified: gnucash/trunk/src/import-export/log-replay/gnc-log-replay.c
===================================================================
--- gnucash/trunk/src/import-export/log-replay/gnc-log-replay.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/log-replay/gnc-log-replay.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -64,40 +64,40 @@
 #define STRING_FIELD_SIZE 256
 typedef struct _split_record
 {
-  enum _enum_action {LOG_BEGIN_EDIT, LOG_ROLLBACK, LOG_COMMIT, LOG_DELETE} log_action;
-  int log_action_present;
-  GUID trans_guid;
-  int trans_guid_present;
-  GUID split_guid;
-  int  split_guid_present;
-  Timespec log_date;
-  int log_date_present;
-  Timespec date_entered;
-  int date_entered_present;
-  Timespec date_posted;
-  int date_posted_present;
-  GUID acc_guid;
-  int acc_guid_present;
-  char acc_name[STRING_FIELD_SIZE];
-  int acc_name_present;
-  char trans_num[STRING_FIELD_SIZE];
-  int trans_num_present;
-  char trans_descr[STRING_FIELD_SIZE];
-  int trans_descr_present;
-  char trans_notes[STRING_FIELD_SIZE];
-  int trans_notes_present;
-  char split_memo[STRING_FIELD_SIZE];
-  int split_memo_present;
-  char split_action[STRING_FIELD_SIZE];
-  int split_action_present;
-  char split_reconcile;
-  int split_reconcile_present;
-  gnc_numeric amount;
-  int amount_present;
-  gnc_numeric value;
-  int value_present;
-  Timespec date_reconciled;
-  int date_reconciled_present;
+    enum _enum_action {LOG_BEGIN_EDIT, LOG_ROLLBACK, LOG_COMMIT, LOG_DELETE} log_action;
+    int log_action_present;
+    GUID trans_guid;
+    int trans_guid_present;
+    GUID split_guid;
+    int  split_guid_present;
+    Timespec log_date;
+    int log_date_present;
+    Timespec date_entered;
+    int date_entered_present;
+    Timespec date_posted;
+    int date_posted_present;
+    GUID acc_guid;
+    int acc_guid_present;
+    char acc_name[STRING_FIELD_SIZE];
+    int acc_name_present;
+    char trans_num[STRING_FIELD_SIZE];
+    int trans_num_present;
+    char trans_descr[STRING_FIELD_SIZE];
+    int trans_descr_present;
+    char trans_notes[STRING_FIELD_SIZE];
+    int trans_notes_present;
+    char split_memo[STRING_FIELD_SIZE];
+    int split_memo_present;
+    char split_action[STRING_FIELD_SIZE];
+    int split_action_present;
+    char split_reconcile;
+    int split_reconcile_present;
+    gnc_numeric amount;
+    int amount_present;
+    gnc_numeric value;
+    int value_present;
+    Timespec date_reconciled;
+    int date_reconciled_present;
 } split_record;
 /********************************************************************\
  * gnc_file_log_replay_import
@@ -110,478 +110,505 @@
    It will also return a 0 length string instead of NULL when it reaches the end of s
 */
 static char * my_strtok (s, delim)
-     char *s;
-     const char *delim;
+char *s;
+const char *delim;
 {
-  char *token;
-  /*DEBUG("strtok(): Start...");*/
-  if (s == NULL)
-    s = olds;
+    char *token;
+    /*DEBUG("strtok(): Start...");*/
+    if (s == NULL)
+        s = olds;
 
-  /* Scan leading delimiters.  */
-  /*s += strspn (s, delim);*/ /*Don't do it, or we will loose count.*/
-  if (*s == '\0')
+    /* Scan leading delimiters.  */
+    /*s += strspn (s, delim);*/ /*Don't do it, or we will loose count.*/
+    if (*s == '\0')
     {
-      olds = s;
-      return s;
+        olds = s;
+        return s;
     }
 
-  /* Find the end of the token.  */
-  token = s;
-  s = strpbrk (token, delim);
-  if (s == NULL)
+    /* Find the end of the token.  */
+    token = s;
+    s = strpbrk (token, delim);
+    if (s == NULL)
     {
-      /* This token finishes the string.  */
-      olds = strchr (token, '\0');
+        /* This token finishes the string.  */
+        olds = strchr (token, '\0');
     }
-  else
+    else
     {
-      /* Terminate the token and make OLDS point past it.  */
-      *s = '\0';
-      olds = s + 1;
+        /* Terminate the token and make OLDS point past it.  */
+        *s = '\0';
+        olds = s + 1;
     }
-  return token;
+    return token;
 }
 
 static split_record interpret_split_record( char *record_line)
 {
-  char * tok_ptr;
-  split_record record;
-  memset(&record,0,sizeof(record));
-  DEBUG("interpret_split_record(): Start...");
-  if(strlen(tok_ptr = my_strtok(record_line,"\t"))!=0)
-    {  
-      switch(tok_ptr[0])
-	{
-	case 'B': record.log_action=LOG_BEGIN_EDIT;
-	  break;
-	case 'D': record.log_action=LOG_DELETE;
-	  break;
-	case 'C': record.log_action=LOG_COMMIT;
-	  break;
-	case 'R': record.log_action=LOG_ROLLBACK;
-	  break;
-	}
-      record.log_action_present=TRUE;
+    char * tok_ptr;
+    split_record record;
+    memset(&record, 0, sizeof(record));
+    DEBUG("interpret_split_record(): Start...");
+    if (strlen(tok_ptr = my_strtok(record_line, "\t")) != 0)
+    {
+        switch (tok_ptr[0])
+        {
+        case 'B':
+            record.log_action = LOG_BEGIN_EDIT;
+            break;
+        case 'D':
+            record.log_action = LOG_DELETE;
+            break;
+        case 'C':
+            record.log_action = LOG_COMMIT;
+            break;
+        case 'R':
+            record.log_action = LOG_ROLLBACK;
+            break;
+        }
+        record.log_action_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      string_to_guid(tok_ptr, &(record.trans_guid));
-      record.trans_guid_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        string_to_guid(tok_ptr, &(record.trans_guid));
+        record.trans_guid_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      string_to_guid(tok_ptr, &(record.split_guid));
-      record.split_guid_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        string_to_guid(tok_ptr, &(record.split_guid));
+        record.split_guid_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      record.log_date = gnc_iso8601_to_timespec_gmt(tok_ptr);
-      record.log_date_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        record.log_date = gnc_iso8601_to_timespec_gmt(tok_ptr);
+        record.log_date_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      record.date_entered = gnc_iso8601_to_timespec_gmt(tok_ptr);
-      record.date_entered_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        record.date_entered = gnc_iso8601_to_timespec_gmt(tok_ptr);
+        record.date_entered_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      record.date_posted = gnc_iso8601_to_timespec_gmt(tok_ptr);
-      record.date_posted_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        record.date_posted = gnc_iso8601_to_timespec_gmt(tok_ptr);
+        record.date_posted_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      string_to_guid(tok_ptr, &(record.acc_guid));
-      record.acc_guid_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        string_to_guid(tok_ptr, &(record.acc_guid));
+        record.acc_guid_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      strncpy(record.acc_name,tok_ptr,STRING_FIELD_SIZE-1);
-      record.acc_name_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        strncpy(record.acc_name, tok_ptr, STRING_FIELD_SIZE - 1);
+        record.acc_name_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      strncpy(record.trans_num,tok_ptr,STRING_FIELD_SIZE-1);
-      record.trans_num_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        strncpy(record.trans_num, tok_ptr, STRING_FIELD_SIZE - 1);
+        record.trans_num_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      strncpy(record.trans_descr,tok_ptr,STRING_FIELD_SIZE-1);
-      record.trans_descr_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        strncpy(record.trans_descr, tok_ptr, STRING_FIELD_SIZE - 1);
+        record.trans_descr_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      strncpy(record.trans_notes,tok_ptr,STRING_FIELD_SIZE-1);
-      record.trans_notes_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        strncpy(record.trans_notes, tok_ptr, STRING_FIELD_SIZE - 1);
+        record.trans_notes_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      strncpy(record.split_memo,tok_ptr,STRING_FIELD_SIZE-1);
-      record.split_memo_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        strncpy(record.split_memo, tok_ptr, STRING_FIELD_SIZE - 1);
+        record.split_memo_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      strncpy(record.split_action,tok_ptr,STRING_FIELD_SIZE-1);
-      record.split_action_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        strncpy(record.split_action, tok_ptr, STRING_FIELD_SIZE - 1);
+        record.split_action_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      record.split_reconcile = tok_ptr[0];
-      record.split_reconcile_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        record.split_reconcile = tok_ptr[0];
+        record.split_reconcile_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      string_to_gnc_numeric(tok_ptr, &(record.amount));
-      record.amount_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        string_to_gnc_numeric(tok_ptr, &(record.amount));
+        record.amount_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      string_to_gnc_numeric(tok_ptr, &(record.value));
-      record.value_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        string_to_gnc_numeric(tok_ptr, &(record.value));
+        record.value_present = TRUE;
     }
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      record.date_reconciled = gnc_iso8601_to_timespec_gmt(tok_ptr);
-      record.date_reconciled_present=TRUE;
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        record.date_reconciled = gnc_iso8601_to_timespec_gmt(tok_ptr);
+        record.date_reconciled_present = TRUE;
     }
 
-  if(strlen(tok_ptr = my_strtok(NULL,"\t"))!=0)
-    {  
-      PERR("interpret_split_record():  Expected number of fields exceeded!");
+    if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
+    {
+        PERR("interpret_split_record():  Expected number of fields exceeded!");
     }
-  DEBUG("interpret_split_record(): End");
-  return record;
+    DEBUG("interpret_split_record(): End");
+    return record;
 }
 
 static void dump_split_record(split_record record)
 {
-  char * string_ptr = NULL;
-  char string_buf[256];
+    char * string_ptr = NULL;
+    char string_buf[256];
 
-  DEBUG("dump_split_record(): Start...");
-  if(record.log_action_present)
+    DEBUG("dump_split_record(): Start...");
+    if (record.log_action_present)
     {
-      switch(record.log_action)
-	{
-	case LOG_BEGIN_EDIT: DEBUG("Log action: LOG_BEGIN_EDIT");
-	  break;
-	case LOG_DELETE: DEBUG("Log action: LOG_DELETE");
-	  break;
-	case LOG_COMMIT: DEBUG("Log action: LOG_COMMIT");
-	  break;
-	case LOG_ROLLBACK: DEBUG("Log action: LOG_ROLLBACK");
-	  break;
-	}
+        switch (record.log_action)
+        {
+        case LOG_BEGIN_EDIT:
+            DEBUG("Log action: LOG_BEGIN_EDIT");
+            break;
+        case LOG_DELETE:
+            DEBUG("Log action: LOG_DELETE");
+            break;
+        case LOG_COMMIT:
+            DEBUG("Log action: LOG_COMMIT");
+            break;
+        case LOG_ROLLBACK:
+            DEBUG("Log action: LOG_ROLLBACK");
+            break;
+        }
     }
-  if(record.trans_guid_present)
+    if (record.trans_guid_present)
     {
-      DEBUG("Transaction GUID: %s", guid_to_string (&(record.trans_guid)));
+        DEBUG("Transaction GUID: %s", guid_to_string (&(record.trans_guid)));
     }
-  if(record.split_guid_present)
+    if (record.split_guid_present)
     {
-      DEBUG("Split GUID: %s", guid_to_string (&(record.split_guid)));
+        DEBUG("Split GUID: %s", guid_to_string (&(record.split_guid)));
     }
-  if(record.log_date_present)
+    if (record.log_date_present)
     {
-      gnc_timespec_to_iso8601_buff (record.log_date, string_buf);
-      DEBUG("Log entry date: %s", string_buf);
+        gnc_timespec_to_iso8601_buff (record.log_date, string_buf);
+        DEBUG("Log entry date: %s", string_buf);
     }
-  if(record.date_entered_present)
+    if (record.date_entered_present)
     {
-      gnc_timespec_to_iso8601_buff (record.date_entered, string_buf);
-      DEBUG("Date entered: %s", string_buf);
+        gnc_timespec_to_iso8601_buff (record.date_entered, string_buf);
+        DEBUG("Date entered: %s", string_buf);
     }
-  if(record.date_posted_present)
+    if (record.date_posted_present)
     {
-      gnc_timespec_to_iso8601_buff (record.date_posted, string_buf);
-      DEBUG("Date posted: %s", string_buf);
+        gnc_timespec_to_iso8601_buff (record.date_posted, string_buf);
+        DEBUG("Date posted: %s", string_buf);
     }
-  if(record.acc_guid_present)
+    if (record.acc_guid_present)
     {
-      DEBUG("Account GUID: %s", guid_to_string (&(record.acc_guid)));
+        DEBUG("Account GUID: %s", guid_to_string (&(record.acc_guid)));
     }
-  if(record.acc_name_present)
+    if (record.acc_name_present)
     {
-      DEBUG("Account name: %s", record.acc_name);
+        DEBUG("Account name: %s", record.acc_name);
     }
-  if(record.trans_num_present)
+    if (record.trans_num_present)
     {
-      DEBUG("Transaction number: %s", record.trans_num);
+        DEBUG("Transaction number: %s", record.trans_num);
     }
-  if(record.trans_descr_present)
+    if (record.trans_descr_present)
     {
-      DEBUG("Transaction description: %s", record.trans_descr);
+        DEBUG("Transaction description: %s", record.trans_descr);
     }
-  if(record.trans_notes_present)
+    if (record.trans_notes_present)
     {
-      DEBUG("Transaction notes: %s", record.trans_notes);
+        DEBUG("Transaction notes: %s", record.trans_notes);
     }
-  if(record.split_memo_present)
+    if (record.split_memo_present)
     {
-      DEBUG("Split memo: %s", record.split_memo);
+        DEBUG("Split memo: %s", record.split_memo);
     }
-  if(record.split_action_present)
+    if (record.split_action_present)
     {
-      DEBUG("Split action: %s", record.split_action);
+        DEBUG("Split action: %s", record.split_action);
     }
-  if(record.split_reconcile_present)
+    if (record.split_reconcile_present)
     {
-      DEBUG("Split reconcile: %c", record.split_reconcile);
+        DEBUG("Split reconcile: %c", record.split_reconcile);
     }
-  if(record.amount_present)
+    if (record.amount_present)
     {
-      string_ptr = gnc_numeric_to_string(record.amount);
-      DEBUG("Record amount: %s", string_ptr);
-      g_free(string_ptr);
+        string_ptr = gnc_numeric_to_string(record.amount);
+        DEBUG("Record amount: %s", string_ptr);
+        g_free(string_ptr);
     }
-  if(record.value_present)
+    if (record.value_present)
     {
-      string_ptr = gnc_numeric_to_string(record.value);
-      DEBUG("Record value: %s", string_ptr);
-      g_free(string_ptr);
+        string_ptr = gnc_numeric_to_string(record.value);
+        DEBUG("Record value: %s", string_ptr);
+        g_free(string_ptr);
     }
-  if(record.date_reconciled_present)
+    if (record.date_reconciled_present)
     {
-      gnc_timespec_to_iso8601_buff (record.date_reconciled, string_buf);
-      DEBUG("Reconciled date: %s", string_buf);
+        gnc_timespec_to_iso8601_buff (record.date_reconciled, string_buf);
+        DEBUG("Reconciled date: %s", string_buf);
     }
 }
 
 /* File pointer must already be at the begining of a record */
 static void  process_trans_record(  FILE *log_file)
 {
-  char read_buf[2048];
-  char *read_retval;
-  const char * record_end_str = "===== END";
-  int first_record=TRUE;
-  int record_ended = FALSE;
-  int split_num = 0;
-  split_record record;
-  Transaction * trans = NULL;
-  Split * split = NULL;
-  Account * acct = NULL;
-  QofBook * book = gnc_get_current_book();
+    char read_buf[2048];
+    char *read_retval;
+    const char * record_end_str = "===== END";
+    int first_record = TRUE;
+    int record_ended = FALSE;
+    int split_num = 0;
+    split_record record;
+    Transaction * trans = NULL;
+    Split * split = NULL;
+    Account * acct = NULL;
+    QofBook * book = gnc_get_current_book();
 
-  DEBUG("process_trans_record(): Begin...\n");
+    DEBUG("process_trans_record(): Begin...\n");
 
-  while( record_ended == FALSE)
+    while ( record_ended == FALSE)
     {
-      read_retval = fgets(read_buf,sizeof(read_buf),log_file);
-      if(read_retval!=NULL && strncmp(record_end_str,read_buf,strlen(record_end_str))!=0)/* If we are not at the end of the record */
-	{
-	  split_num++;
-	  /*DEBUG("process_trans_record(): Line read: %s%s",read_buf ,"\n");*/
-	  record = interpret_split_record( read_buf);
-	  dump_split_record( record);
-	  if(record.log_action_present)
-	    {
-	      switch(record.log_action)
-		{
-		case LOG_BEGIN_EDIT: DEBUG("process_trans_record():Ignoring log action: LOG_BEGIN_EDIT"); /*Do nothing, there is no point*/
-		  break;
-		case LOG_ROLLBACK: DEBUG("process_trans_record():Ignoring log action: LOG_ROLLBACK");/*Do nothing, since we didn't do the begin_edit either*/
-		  break;
-		case LOG_DELETE: DEBUG("process_trans_record(): Playing back LOG_DELETE");
-		  if((trans=xaccTransLookup (&(record.trans_guid), book))!=NULL
-		     && first_record==TRUE)
-		    {
-		      xaccTransBeginEdit(trans);
-		      xaccTransDestroy(trans);
-		    }
-		  else if(first_record==TRUE)
-		    {
-		      PERR("The transaction to delete was not found!");
-		    }
-		  break;
-		case LOG_COMMIT: DEBUG("process_trans_record(): Playing back LOG_COMMIT");
-		  if(record.trans_guid_present == TRUE 
-		     && (trans=xaccTransLookupDirect (record.trans_guid, book)) != NULL
-		     && first_record == TRUE)
-		    {
-		      DEBUG("process_trans_record(): Transaction to be edited was found");/*Destroy the current transaction, we will create a new one to replace it*/
-		      xaccTransBeginEdit(trans);
-		      xaccTransDestroy(trans);
-		      xaccTransCommitEdit(trans);
-		    }
+        read_retval = fgets(read_buf, sizeof(read_buf), log_file);
+        if (read_retval != NULL && strncmp(record_end_str, read_buf, strlen(record_end_str)) != 0) /* If we are not at the end of the record */
+        {
+            split_num++;
+            /*DEBUG("process_trans_record(): Line read: %s%s",read_buf ,"\n");*/
+            record = interpret_split_record( read_buf);
+            dump_split_record( record);
+            if (record.log_action_present)
+            {
+                switch (record.log_action)
+                {
+                case LOG_BEGIN_EDIT:
+                    DEBUG("process_trans_record():Ignoring log action: LOG_BEGIN_EDIT"); /*Do nothing, there is no point*/
+                    break;
+                case LOG_ROLLBACK:
+                    DEBUG("process_trans_record():Ignoring log action: LOG_ROLLBACK");/*Do nothing, since we didn't do the begin_edit either*/
+                    break;
+                case LOG_DELETE:
+                    DEBUG("process_trans_record(): Playing back LOG_DELETE");
+                    if ((trans = xaccTransLookup (&(record.trans_guid), book)) != NULL
+                            && first_record == TRUE)
+                    {
+                        xaccTransBeginEdit(trans);
+                        xaccTransDestroy(trans);
+                    }
+                    else if (first_record == TRUE)
+                    {
+                        PERR("The transaction to delete was not found!");
+                    }
+                    break;
+                case LOG_COMMIT:
+                    DEBUG("process_trans_record(): Playing back LOG_COMMIT");
+                    if (record.trans_guid_present == TRUE
+                            && (trans = xaccTransLookupDirect (record.trans_guid, book)) != NULL
+                            && first_record == TRUE)
+                    {
+                        DEBUG("process_trans_record(): Transaction to be edited was found");/*Destroy the current transaction, we will create a new one to replace it*/
+                        xaccTransBeginEdit(trans);
+                        xaccTransDestroy(trans);
+                        xaccTransCommitEdit(trans);
+                    }
 
-		  if(record.trans_guid_present == TRUE 
-		     && first_record==TRUE)
-		    {
-		      DEBUG("process_trans_record(): Creating the new transaction");
-		      trans = xaccMallocTransaction (book);
-		      xaccTransBeginEdit(trans);
-		      xaccTransSetGUID (trans, &(record.trans_guid));
-		      /*Fill the transaction info*/
-		      if(record.date_entered_present)
-			{
-			  xaccTransSetDateEnteredTS(trans,&(record.date_entered));
-			}
-		      if(record.date_posted_present)
-			{
-			  xaccTransSetDatePostedTS(trans,&(record.date_posted));
-			}
-		      if(record.trans_num_present)
-			{
-			  xaccTransSetNum(trans,record.trans_num);
-			}
-		      if(record.trans_descr_present)
-			{
-			  xaccTransSetDescription(trans,record.trans_descr);
-			}
-		      if(record.trans_notes_present)
-			{
-			  xaccTransSetNotes(trans,record.trans_notes);
-			}
-		    }
-		  if(record.split_guid_present == TRUE) /*Fill the split info*/
-		    {
-		      split=xaccMallocSplit(book);
-		      xaccSplitSetGUID (split, &(record.split_guid));
-		      if(record.acc_guid_present)
-			{
-			  acct = xaccAccountLookupDirect(record.acc_guid,book);
-			  xaccAccountInsertSplit(acct,split);
-			}
-		      xaccTransAppendSplit(trans,split);
+                    if (record.trans_guid_present == TRUE
+                            && first_record == TRUE)
+                    {
+                        DEBUG("process_trans_record(): Creating the new transaction");
+                        trans = xaccMallocTransaction (book);
+                        xaccTransBeginEdit(trans);
+                        xaccTransSetGUID (trans, &(record.trans_guid));
+                        /*Fill the transaction info*/
+                        if (record.date_entered_present)
+                        {
+                            xaccTransSetDateEnteredTS(trans, &(record.date_entered));
+                        }
+                        if (record.date_posted_present)
+                        {
+                            xaccTransSetDatePostedTS(trans, &(record.date_posted));
+                        }
+                        if (record.trans_num_present)
+                        {
+                            xaccTransSetNum(trans, record.trans_num);
+                        }
+                        if (record.trans_descr_present)
+                        {
+                            xaccTransSetDescription(trans, record.trans_descr);
+                        }
+                        if (record.trans_notes_present)
+                        {
+                            xaccTransSetNotes(trans, record.trans_notes);
+                        }
+                    }
+                    if (record.split_guid_present == TRUE) /*Fill the split info*/
+                    {
+                        split = xaccMallocSplit(book);
+                        xaccSplitSetGUID (split, &(record.split_guid));
+                        if (record.acc_guid_present)
+                        {
+                            acct = xaccAccountLookupDirect(record.acc_guid, book);
+                            xaccAccountInsertSplit(acct, split);
+                        }
+                        xaccTransAppendSplit(trans, split);
 
-		      if(record.split_memo_present)
-			{
-			  xaccSplitSetMemo(split,record.split_memo);
-			}
-		      if(record.split_action_present)
-			{
-			  xaccSplitSetAction(split,record.split_action);
-			}
-		      if(record.date_reconciled_present)
-			{
-			  xaccSplitSetDateReconciledTS (split, &(record.date_reconciled));
-			}
-		      if(record.split_reconcile_present)
-			{
-			  xaccSplitSetReconcile(split, record.split_reconcile);
-			}
+                        if (record.split_memo_present)
+                        {
+                            xaccSplitSetMemo(split, record.split_memo);
+                        }
+                        if (record.split_action_present)
+                        {
+                            xaccSplitSetAction(split, record.split_action);
+                        }
+                        if (record.date_reconciled_present)
+                        {
+                            xaccSplitSetDateReconciledTS (split, &(record.date_reconciled));
+                        }
+                        if (record.split_reconcile_present)
+                        {
+                            xaccSplitSetReconcile(split, record.split_reconcile);
+                        }
 
-		      if(record.amount_present)
-			{
-			  xaccSplitSetAmount(split, record.amount);
-			}
-		      if(record.value_present)
-			{
-			  xaccSplitSetValue(split, record.value);
-			}
-		    }
-		  first_record=FALSE;
-		  break;
-		}
-	    }
-	  else
-	    {
-	      PERR("Corrupted record");
-	    }
-	}
-      else /* The record ended */
-	{
-	  record_ended = TRUE;
-	  DEBUG("process_trans_record(): Record ended\n");
-	  if(trans!=NULL)/*If we played with a transaction, commit it here*/
-	    {
-	      xaccTransScrubCurrencyFromSplits(trans);
-	      xaccTransCommitEdit(trans);
-	    }
-	}
+                        if (record.amount_present)
+                        {
+                            xaccSplitSetAmount(split, record.amount);
+                        }
+                        if (record.value_present)
+                        {
+                            xaccSplitSetValue(split, record.value);
+                        }
+                    }
+                    first_record = FALSE;
+                    break;
+                }
+            }
+            else
+            {
+                PERR("Corrupted record");
+            }
+        }
+        else /* The record ended */
+        {
+            record_ended = TRUE;
+            DEBUG("process_trans_record(): Record ended\n");
+            if (trans != NULL) /*If we played with a transaction, commit it here*/
+            {
+                xaccTransScrubCurrencyFromSplits(trans);
+                xaccTransCommitEdit(trans);
+            }
+        }
     }
 }
 
 void gnc_file_log_replay (void)
 {
-  char *selected_filename;
-  char *default_dir;
-  char read_buf[256];
-  char *read_retval;
-  GtkFileFilter *filter;
-  FILE *log_file;
-  char * record_start_str = "===== START";
-  /* NOTE: This string must match src/engine/TransLog.c (sans newline) */
-  char * expected_header_orig = "mod\ttrans_guid\tsplit_guid\ttime_now\t"
-  	"date_entered\tdate_posted\tacc_guid\tacc_name\tnum\tdescription\t"
-  	"notes\tmemo\taction\treconciled\tamount\tvalue\tdate_reconciled";
-  static char *expected_header = NULL;
+    char *selected_filename;
+    char *default_dir;
+    char read_buf[256];
+    char *read_retval;
+    GtkFileFilter *filter;
+    FILE *log_file;
+    char * record_start_str = "===== START";
+    /* NOTE: This string must match src/engine/TransLog.c (sans newline) */
+    char * expected_header_orig = "mod\ttrans_guid\tsplit_guid\ttime_now\t"
+                                  "date_entered\tdate_posted\tacc_guid\tacc_name\tnum\tdescription\t"
+                                  "notes\tmemo\taction\treconciled\tamount\tvalue\tdate_reconciled";
+    static char *expected_header = NULL;
 
-  /* Use g_strdup_printf so we don't get accidental tab -> space conversion */
-  if (!expected_header)
-    expected_header = g_strdup(expected_header_orig);
+    /* Use g_strdup_printf so we don't get accidental tab -> space conversion */
+    if (!expected_header)
+        expected_header = g_strdup(expected_header_orig);
 
-  qof_log_set_level(GNC_MOD_IMPORT, QOF_LOG_DEBUG);
-  ENTER(" ");
+    qof_log_set_level(GNC_MOD_IMPORT, QOF_LOG_DEBUG);
+    ENTER(" ");
 
-  default_dir = gnc_get_default_directory(GCONF_SECTION);
+    default_dir = gnc_get_default_directory(GCONF_SECTION);
 
-  filter = gtk_file_filter_new();
-  gtk_file_filter_set_name(filter, "*.log");
-  gtk_file_filter_add_pattern(filter, "*.[Ll][Oo][Gg]");
-  selected_filename = gnc_file_dialog(_("Select a .log file to replay"),
-				      g_list_prepend(NULL, filter),
-				      default_dir,
-				      GNC_FILE_DIALOG_OPEN);
-  g_free(default_dir);
+    filter = gtk_file_filter_new();
+    gtk_file_filter_set_name(filter, "*.log");
+    gtk_file_filter_add_pattern(filter, "*.[Ll][Oo][Gg]");
+    selected_filename = gnc_file_dialog(_("Select a .log file to replay"),
+                                        g_list_prepend(NULL, filter),
+                                        default_dir,
+                                        GNC_FILE_DIALOG_OPEN);
+    g_free(default_dir);
 
-  if(selected_filename!=NULL)
+    if (selected_filename != NULL)
     {
-      /* Remember the directory as the default. */
-      default_dir = g_path_get_dirname(selected_filename);
-      gnc_set_default_directory(GCONF_SECTION, default_dir);
-      g_free(default_dir);
+        /* Remember the directory as the default. */
+        default_dir = g_path_get_dirname(selected_filename);
+        gnc_set_default_directory(GCONF_SECTION, default_dir);
+        g_free(default_dir);
 
-      /*strncpy(file,selected_filename, 255);*/
-      DEBUG("Filename found: %s",selected_filename);
-      if (xaccFileIsCurrentLog(selected_filename)) {
-	g_warning("Cannot open the current log file: %s", selected_filename);
-	gnc_error_dialog(NULL,
-			 /* Translators: %s is the file name. */
-			 _("Cannot open the current log file: %s"),
-			 selected_filename);
-      } else {
-	DEBUG("Opening selected file");
-	log_file = g_fopen(selected_filename, "r");
-	if(!log_file || ferror(log_file)!=0) {
-	  int err = errno;
-	  perror("File open failed");
-	  gnc_error_dialog(NULL,
-			   /* Translation note:
-			    * First argument is the filename,
-			    * second argument is the error.
-			    */
-			   _("Failed to open log file: %s: %s"),
-			   selected_filename,
-			   strerror(err));
-	} else {
-	  if((read_retval = fgets(read_buf,sizeof(read_buf),log_file)) == NULL) {
-	      DEBUG("Read error or EOF");
-	      gnc_info_dialog(NULL, "%s",
-			      _("The log file you selected was empty."));
-	  } else {
-	    if(strncmp(expected_header,read_buf,strlen(expected_header))!=0) {
-		PERR("File header not recognised:\n%s",read_buf);
-		PERR("Expected:\n%s",expected_header);
-		gnc_error_dialog(NULL, "%s",
-				 _("The log file you selected cannot be read.  "
-				   "The file header was not recognized."));
-	    } else {
-	      do {
-		read_retval = fgets(read_buf,sizeof(read_buf),log_file);
-		/*DEBUG("Chunk read: %s",read_retval);*/
-		if(strncmp(record_start_str,read_buf,strlen(record_start_str))==0) {/* If a record started */
-		  process_trans_record(log_file);
-		}
-	      }while(feof(log_file)==0);
-	    }
-	  }
-	  fclose(log_file);
-	}
-      }
-      g_free(selected_filename);
+        /*strncpy(file,selected_filename, 255);*/
+        DEBUG("Filename found: %s", selected_filename);
+        if (xaccFileIsCurrentLog(selected_filename))
+        {
+            g_warning("Cannot open the current log file: %s", selected_filename);
+            gnc_error_dialog(NULL,
+                             /* Translators: %s is the file name. */
+                             _("Cannot open the current log file: %s"),
+                             selected_filename);
+        }
+        else
+        {
+            DEBUG("Opening selected file");
+            log_file = g_fopen(selected_filename, "r");
+            if (!log_file || ferror(log_file) != 0)
+            {
+                int err = errno;
+                perror("File open failed");
+                gnc_error_dialog(NULL,
+                                 /* Translation note:
+                                  * First argument is the filename,
+                                  * second argument is the error.
+                                  */
+                                 _("Failed to open log file: %s: %s"),
+                                 selected_filename,
+                                 strerror(err));
+            }
+            else
+            {
+                if ((read_retval = fgets(read_buf, sizeof(read_buf), log_file)) == NULL)
+                {
+                    DEBUG("Read error or EOF");
+                    gnc_info_dialog(NULL, "%s",
+                                    _("The log file you selected was empty."));
+                }
+                else
+                {
+                    if (strncmp(expected_header, read_buf, strlen(expected_header)) != 0)
+                    {
+                        PERR("File header not recognised:\n%s", read_buf);
+                        PERR("Expected:\n%s", expected_header);
+                        gnc_error_dialog(NULL, "%s",
+                                         _("The log file you selected cannot be read.  "
+                                           "The file header was not recognized."));
+                    }
+                    else
+                    {
+                        do
+                        {
+                            read_retval = fgets(read_buf, sizeof(read_buf), log_file);
+                            /*DEBUG("Chunk read: %s",read_retval);*/
+                            if (strncmp(record_start_str, read_buf, strlen(record_start_str)) == 0) /* If a record started */
+                            {
+                                process_trans_record(log_file);
+                            }
+                        }
+                        while (feof(log_file) == 0);
+                    }
+                }
+                fclose(log_file);
+            }
+        }
+        g_free(selected_filename);
     }
-  LEAVE("");
+    LEAVE("");
 }
 
 

Modified: gnucash/trunk/src/import-export/log-replay/gnc-log-replay.h
===================================================================
--- gnucash/trunk/src/import-export/log-replay/gnc-log-replay.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/log-replay/gnc-log-replay.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -16,12 +16,12 @@
  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 \********************************************************************/
- /** @file
-     @brief .log replay module interface
-     *
-     gnc-log-replay.h
-     @author Copyright (c) 2003 Benoit Grégoire <bock at step.polymtl.ca>
- */
+/** @file
+    @brief .log replay module interface
+    *
+    gnc-log-replay.h
+    @author Copyright (c) 2003 Benoit Grégoire <bock at step.polymtl.ca>
+*/
 #ifndef OFX_IMPORT_H
 #define OFX_IMPORT_H
 

Modified: gnucash/trunk/src/import-export/log-replay/gnc-plugin-log-replay.c
===================================================================
--- gnucash/trunk/src/import-export/log-replay/gnc-plugin-log-replay.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/log-replay/gnc-plugin-log-replay.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-log-replay.c -- 
+/*
+ * gnc-plugin-log-replay.c --
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
  * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
  *
@@ -41,16 +41,19 @@
 #define PLUGIN_ACTIONS_NAME "gnc-plugin-log-replay-actions"
 #define PLUGIN_UI_FILENAME  "gnc-plugin-log-replay-ui.xml"
 
-static GtkActionEntry gnc_plugin_actions [] = {
-	{ "LogReplayAction", GTK_STOCK_CONVERT, N_("_Replay GnuCash .log file..."), NULL,
-	  N_("Replay a GnuCash log file after a crash.  This cannot be undone."),
-	  G_CALLBACK (gnc_plugin_log_replay_cmd_new_log_replay) },
+static GtkActionEntry gnc_plugin_actions [] =
+{
+    {
+        "LogReplayAction", GTK_STOCK_CONVERT, N_("_Replay GnuCash .log file..."), NULL,
+        N_("Replay a GnuCash log file after a crash.  This cannot be undone."),
+        G_CALLBACK (gnc_plugin_log_replay_cmd_new_log_replay)
+    },
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
 
 typedef struct GncPluginLogreplayPrivate
 {
-	gpointer dummy;
+    gpointer dummy;
 } GncPluginLogreplayPrivate;
 
 #define GNC_PLUGIN_LOG_REPLAY_GET_PRIVATE(o)  \
@@ -61,55 +64,57 @@
 GType
 gnc_plugin_log_replay_get_type (void)
 {
-	static GType gnc_plugin_log_replay_type = 0;
+    static GType gnc_plugin_log_replay_type = 0;
 
-	if (gnc_plugin_log_replay_type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (GncPluginLogreplayClass),
-			NULL,		/* base_init */
-			NULL,		/* base_finalize */
-			(GClassInitFunc) gnc_plugin_log_replay_class_init,
-			NULL,		/* class_finalize */
-			NULL,		/* class_data */
-			sizeof (GncPluginLogreplay),
-			0,		/* n_preallocs */
-			(GInstanceInitFunc) gnc_plugin_log_replay_init,
-		};
+    if (gnc_plugin_log_replay_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginLogreplayClass),
+            NULL,		/* base_init */
+            NULL,		/* base_finalize */
+            (GClassInitFunc) gnc_plugin_log_replay_class_init,
+            NULL,		/* class_finalize */
+            NULL,		/* class_data */
+            sizeof (GncPluginLogreplay),
+            0,		/* n_preallocs */
+            (GInstanceInitFunc) gnc_plugin_log_replay_init,
+        };
 
-		gnc_plugin_log_replay_type = g_type_register_static (GNC_TYPE_PLUGIN,
-								     "GncPluginLogreplay",
-								     &our_info, 0);
-	}
+        gnc_plugin_log_replay_type = g_type_register_static (GNC_TYPE_PLUGIN,
+                                     "GncPluginLogreplay",
+                                     &our_info, 0);
+    }
 
-	return gnc_plugin_log_replay_type;
+    return gnc_plugin_log_replay_type;
 }
 
 GncPlugin *
 gnc_plugin_log_replay_new (void)
 {
-	return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_LOG_REPLAY, NULL));
+    return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_LOG_REPLAY, NULL));
 }
 
 static void
 gnc_plugin_log_replay_class_init (GncPluginLogreplayClass *klass)
 {
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-	GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
 
-	parent_class = g_type_class_peek_parent (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-	object_class->finalize = gnc_plugin_log_replay_finalize;
+    object_class->finalize = gnc_plugin_log_replay_finalize;
 
-	/* plugin info */
-	plugin_class->plugin_name  = GNC_PLUGIN_LOG_REPLAY_NAME;
+    /* plugin info */
+    plugin_class->plugin_name  = GNC_PLUGIN_LOG_REPLAY_NAME;
 
-	/* widget addition/removal */
-	plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
-	plugin_class->actions      = gnc_plugin_actions;
-	plugin_class->n_actions    = gnc_plugin_n_actions;
-	plugin_class->ui_filename  = PLUGIN_UI_FILENAME;
+    /* widget addition/removal */
+    plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
+    plugin_class->actions      = gnc_plugin_actions;
+    plugin_class->n_actions    = gnc_plugin_n_actions;
+    plugin_class->ui_filename  = PLUGIN_UI_FILENAME;
 
-	g_type_class_add_private(klass, sizeof(GncPluginLogreplayPrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginLogreplayPrivate));
 }
 
 static void
@@ -120,15 +125,15 @@
 static void
 gnc_plugin_log_replay_finalize (GObject *object)
 {
-	GncPluginLogreplay *plugin;
-	GncPluginLogreplayPrivate *priv;
+    GncPluginLogreplay *plugin;
+    GncPluginLogreplayPrivate *priv;
 
-	g_return_if_fail (GNC_IS_PLUGIN_LOG_REPLAY (object));
+    g_return_if_fail (GNC_IS_PLUGIN_LOG_REPLAY (object));
 
-	plugin = GNC_PLUGIN_LOG_REPLAY (object);
-	priv = GNC_PLUGIN_LOG_REPLAY_GET_PRIVATE(plugin);
+    plugin = GNC_PLUGIN_LOG_REPLAY (object);
+    priv = GNC_PLUGIN_LOG_REPLAY_GET_PRIVATE(plugin);
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 /************************************************************
@@ -141,9 +146,9 @@
 
 static void
 gnc_plugin_log_replay_cmd_new_log_replay (GtkAction *action,
-					  GncMainWindowActionData *data)
+        GncMainWindowActionData *data)
 {
-	gnc_file_log_replay ();
+    gnc_file_log_replay ();
 }
 
 /************************************************************
@@ -153,7 +158,7 @@
 void
 gnc_plugin_log_replay_create_plugin (void)
 {
-  GncPlugin *plugin = gnc_plugin_log_replay_new ();
+    GncPlugin *plugin = gnc_plugin_log_replay_new ();
 
-  gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
+    gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
 }

Modified: gnucash/trunk/src/import-export/log-replay/gnc-plugin-log-replay.h
===================================================================
--- gnucash/trunk/src/import-export/log-replay/gnc-plugin-log-replay.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/log-replay/gnc-plugin-log-replay.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-log-replay.h -- 
+/*
+ * gnc-plugin-log-replay.h --
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -40,12 +40,14 @@
 #define GNC_PLUGIN_LOG_REPLAY_NAME "gnc-plugin-log-replay"
 
 /* typedefs & structures */
-typedef struct {
-	GncPlugin gnc_plugin;
+typedef struct
+{
+    GncPlugin gnc_plugin;
 } GncPluginLogreplay;
 
-typedef struct {
-	GncPluginClass gnc_plugin;
+typedef struct
+{
+    GncPluginClass gnc_plugin;
 } GncPluginLogreplayClass;
 
 /* function prototypes */

Modified: gnucash/trunk/src/import-export/log-replay/gncmod-log-replay.c
===================================================================
--- gnucash/trunk/src/import-export/log-replay/gncmod-log-replay.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/log-replay/gncmod-log-replay.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -18,11 +18,11 @@
 \********************************************************************/
 /** @addtogroup Import_Export
     @{ */
- /**@internal
- @file gncmod-log-replay.c
- @brief module definition/initialization for the log replay module
- @author Copyright (c) 2003 Benoit Grégoire bock at step.polymtl.ca
- */
+/**@internal
+ at file gncmod-log-replay.c
+ at brief module definition/initialization for the log replay module
+ at author Copyright (c) 2003 Benoit Grégoire bock at step.polymtl.ca
+*/
 #include "config.h"
 
 #include <gmodule.h>
@@ -50,44 +50,44 @@
 char *
 libgncmod_log_replay_gnc_module_path(void)
 {
-  return g_strdup("gnucash/import-export/log-replay");
+    return g_strdup("gnucash/import-export/log-replay");
 }
 
 char *
 libgncmod_log_replay_gnc_module_description(void)
 {
-  return g_strdup("C code for log file replay");
+    return g_strdup("C code for log file replay");
 }
 
 int
 libgncmod_log_replay_gnc_module_init(int refcount)
 {
-  if(!gnc_module_load("gnucash/engine", 0))
-  {
-    return FALSE;
-  }
-  if(!gnc_module_load("gnucash/app-utils", 0))
-  {
-    return FALSE;
-  }
-  if(!gnc_module_load("gnucash/gnome-utils", 0))
-  {
-    return FALSE;
-  }
-    if(!gnc_module_load("gnucash/import-export", 0))
-  {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/import-export", 0))
+    {
+        return FALSE;
+    }
 
-  /* Add menu items with C callbacks */
-  gnc_plugin_log_replay_create_plugin();
+    /* Add menu items with C callbacks */
+    gnc_plugin_log_replay_create_plugin();
 
-  return TRUE;
+    return TRUE;
 }
 
 int
 libgncmod_log_replay_gnc_module_end(int refcount)
 {
-  return TRUE;
+    return TRUE;
 }
 /** @}*/

Modified: gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c
===================================================================
--- gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -76,476 +76,540 @@
 
 int ofx_proc_security_cb(const struct OfxSecurityData data, void * security_user_data)
 {
-  char * tmp_cusip=NULL;
-  char * tmp_default_fullname=NULL;
-  char * tmp_default_mnemonic=NULL;
- 
-  if(data.unique_id_valid==true)
+    char * tmp_cusip = NULL;
+    char * tmp_default_fullname = NULL;
+    char * tmp_default_mnemonic = NULL;
+
+    if (data.unique_id_valid == true)
     {
-      tmp_cusip=(char *)data.unique_id;
+        tmp_cusip = (char *)data.unique_id;
     }
-  if(data.secname_valid==true)
+    if (data.secname_valid == true)
     {
-      tmp_default_fullname=(char *)data.secname;
+        tmp_default_fullname = (char *)data.secname;
     }
-  if(data.ticker_valid==true)
+    if (data.ticker_valid == true)
     {
-      tmp_default_mnemonic=(char *)data.ticker;
+        tmp_default_mnemonic = (char *)data.ticker;
     }
-  
-  gnc_import_select_commodity(tmp_cusip,
-	        	      true,
-			      tmp_default_fullname,
-			      tmp_default_mnemonic);
-  return 0;
+
+    gnc_import_select_commodity(tmp_cusip,
+                                true,
+                                tmp_default_fullname,
+                                tmp_default_mnemonic);
+    return 0;
 }
 
 int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_user_data)
 {
-  char dest_string[255];
-  time_t current_time; 
-  Account *account;
-  Account *investment_account=NULL;
-  Account *income_account=NULL;
-  kvp_frame * acc_frame;
-  kvp_value * kvp_val;
-  const GUID * income_acc_guid;
-  gchar *investment_account_text;
-  gnc_commodity *currency=NULL;
-  gnc_commodity *investment_commodity=NULL;
-  gnc_numeric gnc_amount, gnc_units;
-  QofBook *book;
-  Transaction *transaction;
-  Split *split;
-  gchar *notes, *tmp;
-  
-  g_assert(gnc_ofx_importer_gui);
+    char dest_string[255];
+    time_t current_time;
+    Account *account;
+    Account *investment_account = NULL;
+    Account *income_account = NULL;
+    kvp_frame * acc_frame;
+    kvp_value * kvp_val;
+    const GUID * income_acc_guid;
+    gchar *investment_account_text;
+    gnc_commodity *currency = NULL;
+    gnc_commodity *investment_commodity = NULL;
+    gnc_numeric gnc_amount, gnc_units;
+    QofBook *book;
+    Transaction *transaction;
+    Split *split;
+    gchar *notes, *tmp;
 
-  if(data.account_id_valid==true){
-    account = gnc_import_select_account(NULL, data.account_id, 0, NULL, NULL,
-					ACCT_TYPE_NONE, NULL, NULL);
-    if(account!=NULL)
-      {
-	/********** Validate the input strings to ensure utf8 ********************/
-	if (data.name_valid)
-	  gnc_utf8_strip_invalid(data.name);
-	if (data.memo_valid)
-	  gnc_utf8_strip_invalid(data.memo);
-	if (data.check_number_valid)
-	  gnc_utf8_strip_invalid(data.check_number);
-	if (data.reference_number_valid)
-	  gnc_utf8_strip_invalid(data.reference_number);
+    g_assert(gnc_ofx_importer_gui);
 
-	/********** Create the transaction and setup transaction data ************/
-	book = gnc_account_get_book(account);
-	transaction = xaccMallocTransaction(book);
-	xaccTransBeginEdit(transaction);
-	
-	if(data.date_initiated_valid==true){
-	  xaccTransSetDateSecs(transaction, data.date_initiated);
-	}
-	else if(data.date_posted_valid==true){
-	  xaccTransSetDateSecs(transaction, data.date_posted);
-	}
-	
-	if(data.date_posted_valid==true){
-	  xaccTransSetDatePostedSecs(transaction, data.date_posted);
-	}
-	
-	current_time = time(NULL);
-	xaccTransSetDateEnteredSecs(transaction, mktime(localtime(&current_time)));
-	
-	if(data.check_number_valid==true){
-	  xaccTransSetNum(transaction, data.check_number);
-	}
-	else if(data.reference_number_valid==true){
-	  xaccTransSetNum(transaction, data.reference_number);
-	}
-	/* Put transaction name in Description, or memo if name unavailable */ 
-	if(data.name_valid==true){
-	  xaccTransSetDescription(transaction, data.name);
-	}
-	else if(data.memo_valid==true){
-	  xaccTransSetDescription(transaction, data.memo);
-	}
-	
-	/* Put everything else in the Notes field */
-	notes=g_strdup_printf("OFX ext. info: ");
-	
-	if(data.transactiontype_valid==true){
-	  switch(data.transactiontype){
-	  case OFX_CREDIT: strncpy(dest_string, "Generic credit", sizeof(dest_string));
-	    break;
-	  case OFX_DEBIT: strncpy(dest_string, "Generic debit", sizeof(dest_string));
-	    break;
-	  case OFX_INT: strncpy(dest_string, "Interest earned or paid (Note: Depends on signage of amount)", sizeof(dest_string));
-	    break;
-	  case OFX_DIV: strncpy(dest_string, "Dividend", sizeof(dest_string));
-	    break;
-	  case OFX_FEE: strncpy(dest_string, "FI fee", sizeof(dest_string));
-	    break;
-	  case OFX_SRVCHG: strncpy(dest_string, "Service charge", sizeof(dest_string));
-	    break;
-	  case OFX_DEP: strncpy(dest_string, "Deposit", sizeof(dest_string));
-	    break;
-	  case OFX_ATM: strncpy(dest_string, "ATM debit or credit (Note: Depends on signage of amount)", sizeof(dest_string));
-	    break;
-	  case OFX_POS: strncpy(dest_string, "Point of sale debit or credit (Note: Depends on signage of amount)", sizeof(dest_string));
-	    break;
-	  case OFX_XFER: strncpy(dest_string, "Transfer", sizeof(dest_string));
-	    break;
-	  case OFX_CHECK: strncpy(dest_string, "Check", sizeof(dest_string));
-	    break;
-	  case OFX_PAYMENT: strncpy(dest_string, "Electronic payment", sizeof(dest_string));
-	    break;
-	  case OFX_CASH: strncpy(dest_string, "Cash withdrawal", sizeof(dest_string));
-	    break;
-	  case OFX_DIRECTDEP: strncpy(dest_string, "Direct deposit", sizeof(dest_string));
-	    break;
-	  case OFX_DIRECTDEBIT: strncpy(dest_string, "Merchant initiated debit", sizeof(dest_string));
-	    break;
-	  case OFX_REPEATPMT: strncpy(dest_string, "Repeating payment/standing order", sizeof(dest_string));
-	    break;
-	  case OFX_OTHER: strncpy(dest_string, "Other", sizeof(dest_string));
-	    break;
-	  default : strncpy(dest_string, "Unknown transaction type", sizeof(dest_string));
-	    break;
-	  }
-	  tmp=notes;
-	  notes=g_strdup_printf("%s%s%s",tmp,"|Trans type:", dest_string);
-	  g_free(tmp);
-	}
-	
-	if(data.invtransactiontype_valid==true){
-	  switch(data.invtransactiontype){
-	  case OFX_BUYDEBT: strncpy(dest_string, "BUYDEBT (Buy debt security)", sizeof(dest_string));
-	    break;
-	  case OFX_BUYMF: strncpy(dest_string, "BUYMF (Buy mutual fund)", sizeof(dest_string));
-	    break;
-	  case OFX_BUYOPT: strncpy(dest_string, "BUYOPT (Buy option)", sizeof(dest_string));
-	    break;
-	  case OFX_BUYOTHER: strncpy(dest_string, "BUYOTHER (Buy other security type)", sizeof(dest_string));
-	    break;
-	  case OFX_BUYSTOCK: strncpy(dest_string, "BUYSTOCK (Buy stock))", sizeof(dest_string));
-	    break;
-	  case OFX_CLOSUREOPT: strncpy(dest_string, "CLOSUREOPT (Close a position for an option)", sizeof(dest_string));
-	    break;
-	  case OFX_INCOME: strncpy(dest_string, "INCOME (Investment income is realized as cash into the investment account)", sizeof(dest_string));
-	    break;
-	  case OFX_INVEXPENSE: strncpy(dest_string, "INVEXPENSE (Misc investment expense that is associated with a specific security)", sizeof(dest_string));
-	    break;
-	  case OFX_JRNLFUND: strncpy(dest_string, "JRNLFUND (Journaling cash holdings between subaccounts within the same investment account)", sizeof(dest_string));
-	    break;
-	  case OFX_MARGININTEREST: strncpy(dest_string, "MARGININTEREST (Margin interest expense)", sizeof(dest_string));
-	    break;
-	  case OFX_REINVEST: strncpy(dest_string, "REINVEST (Reinvestment of income)", sizeof(dest_string));
-	    break;
-	  case OFX_RETOFCAP: strncpy(dest_string, "RETOFCAP (Return of capital)", sizeof(dest_string));
-	    break;
-	  case OFX_SELLDEBT: strncpy(dest_string, "SELLDEBT (Sell debt security.  Used when debt is sold, called, or reached maturity)", sizeof(dest_string));
-	    break;
-	  case OFX_SELLMF: strncpy(dest_string, "SELLMF (Sell mutual fund)", sizeof(dest_string));
-	    break;
-	  case OFX_SELLOPT: strncpy(dest_string, "SELLOPT (Sell option)", sizeof(dest_string));
-	    break;
-	  case OFX_SELLOTHER: strncpy(dest_string, "SELLOTHER (Sell other type of security)", sizeof(dest_string));
-	    break;
-	  case OFX_SELLSTOCK: strncpy(dest_string, "SELLSTOCK (Sell stock)", sizeof(dest_string));
-	    break;
-	  case OFX_SPLIT: strncpy(dest_string, "SPLIT (Stock or mutial fund split)", sizeof(dest_string));
-	    break;
-	  case OFX_TRANSFER: strncpy(dest_string, "TRANSFER (Transfer holdings in and out of the investment account)", sizeof(dest_string));
-	    break;
-	  default: strncpy(dest_string, "ERROR, this investment transaction type is unknown.  This is a bug in ofxdump", sizeof(dest_string));
-	    break;
-	  }
-	  tmp=notes;
-	  notes=g_strdup_printf("%s%s%s",tmp,"|Investment Trans type:", dest_string);
-	  g_free(tmp);
-	}
-	if(data.memo_valid==true&&data.name_valid==true){/* Copy only if memo wasn't put in Description */
-	  tmp=notes;
-	  notes=g_strdup_printf("%s%s%s",tmp, "|Memo:", data.memo);
-	  g_free(tmp);
-	}
-	if(data.date_funds_available_valid==true){
-	  Timespec ts;
-	  timespecFromTime_t(&ts, data.date_funds_available);
-	  gnc_timespec_to_iso8601_buff (ts, dest_string);
-	  tmp=notes;
-	  notes=g_strdup_printf("%s%s%s",tmp,"|Date funds available:", dest_string);
-	  g_free(tmp);
-	}
-	if(data.server_transaction_id_valid==true){
-	  tmp=notes;
-	  notes=g_strdup_printf("%s%s%s",tmp, "|Server trans ID (conf. number):", data.server_transaction_id);
-	  g_free(tmp);
-	}
-	if(data.standard_industrial_code_valid==true){
-	  tmp=notes;
-	  notes=g_strdup_printf("%s%s%ld",tmp, "|Standard Industrial Code:",data.standard_industrial_code);
-	  g_free(tmp);
-	  
-	}
-	if(data.payee_id_valid==true){
-	  tmp=notes;
-	  notes=g_strdup_printf("%s%s%s",tmp,"|Payee ID:", data.payee_id);
-	  g_free(tmp);
-	}
-	
-	PERR("WRITEME: GnuCash ofx_proc_transaction():Add PAYEE and ADRESS here once supported by libofx!\n");
-	
-	/* Ideally, gnucash should process the corrected transactions */
-	if(data.fi_id_corrected_valid==true){
-	  PERR("WRITEME: GnuCash ofx_proc_transaction(): WARNING: This transaction corrected a previous transaction, but we created a new one instead!\n");
-	  tmp=notes;
-	  notes=g_strdup_printf("%s%s%s%s",tmp,"|This corrects transaction #",data.fi_id_corrected,"but GnuCash didn't process the correction!");
-	  g_free(tmp);
-	}
-	xaccTransSetNotes(transaction, notes);
-	g_free(notes);
-	if ( data.account_ptr && data.account_ptr->currency_valid )
-	  {
-	    DEBUG("Currency from libofx: %s",data.account_ptr->currency);
-	    currency = gnc_commodity_table_lookup( gnc_get_current_commodities (),
-						   GNC_COMMODITY_NS_CURRENCY,
-						   data.account_ptr->currency);
-	  }
-	else
-	  {
-	    DEBUG("Currency from libofx unavailable, defaulting to account's default");
-	    currency = xaccAccountGetCommodity(account);
-	  }
+    if (data.account_id_valid == true)
+    {
+        account = gnc_import_select_account(NULL, data.account_id, 0, NULL, NULL,
+                                            ACCT_TYPE_NONE, NULL, NULL);
+        if (account != NULL)
+        {
+            /********** Validate the input strings to ensure utf8 ********************/
+            if (data.name_valid)
+                gnc_utf8_strip_invalid(data.name);
+            if (data.memo_valid)
+                gnc_utf8_strip_invalid(data.memo);
+            if (data.check_number_valid)
+                gnc_utf8_strip_invalid(data.check_number);
+            if (data.reference_number_valid)
+                gnc_utf8_strip_invalid(data.reference_number);
 
-	xaccTransSetCurrency(transaction,currency);
-	if(data.amount_valid==true)
-	  {
-	    if(data.invtransactiontype_valid==false)
-	      {
-		/*************Process a normal transaction ***************************/ 
-		DEBUG("Adding split; Ordinary banking transaction, money flows from or into the source account"); 
-		split=xaccMallocSplit(book);
-		xaccTransAppendSplit(transaction,split);
-		xaccAccountInsertSplit(account,split);
+            /********** Create the transaction and setup transaction data ************/
+            book = gnc_account_get_book(account);
+            transaction = xaccMallocTransaction(book);
+            xaccTransBeginEdit(transaction);
 
-		gnc_amount = double_to_gnc_numeric (data.amount,
-						    gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)),
-						    GNC_RND_ROUND);
-		xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction));
-		
-		/* Also put the ofx transaction's memo in the split's memo field */ 
-		if(data.memo_valid==true){
-		  xaccSplitSetMemo(split, data.memo);
-		}
-		if(data.fi_id_valid==true){
-		  gnc_import_set_split_online_id(split, data.fi_id);
-		}
-	      }
-	    else if(data.unique_id_valid == true
-		    && data.security_data_valid
-		    && data.security_data_ptr != NULL
-		    && data.security_data_ptr->secname_valid == true)
-	      {
-		/************************ Process an investment transaction ******************************/
-		/* Note that the ACCT_TYPE_STOCK account type should be replaced with something
-		   derived from data.invtranstype*/
-		investment_commodity = gnc_import_select_commodity(data.unique_id,
-								   0,
-								   NULL,
-								   NULL);
-		if(investment_commodity!=NULL)
-		  {
-		    investment_account_text = g_strdup_printf( /* This string is a default account
+            if (data.date_initiated_valid == true)
+            {
+                xaccTransSetDateSecs(transaction, data.date_initiated);
+            }
+            else if (data.date_posted_valid == true)
+            {
+                xaccTransSetDateSecs(transaction, data.date_posted);
+            }
+
+            if (data.date_posted_valid == true)
+            {
+                xaccTransSetDatePostedSecs(transaction, data.date_posted);
+            }
+
+            current_time = time(NULL);
+            xaccTransSetDateEnteredSecs(transaction, mktime(localtime(&current_time)));
+
+            if (data.check_number_valid == true)
+            {
+                xaccTransSetNum(transaction, data.check_number);
+            }
+            else if (data.reference_number_valid == true)
+            {
+                xaccTransSetNum(transaction, data.reference_number);
+            }
+            /* Put transaction name in Description, or memo if name unavailable */
+            if (data.name_valid == true)
+            {
+                xaccTransSetDescription(transaction, data.name);
+            }
+            else if (data.memo_valid == true)
+            {
+                xaccTransSetDescription(transaction, data.memo);
+            }
+
+            /* Put everything else in the Notes field */
+            notes = g_strdup_printf("OFX ext. info: ");
+
+            if (data.transactiontype_valid == true)
+            {
+                switch (data.transactiontype)
+                {
+                case OFX_CREDIT:
+                    strncpy(dest_string, "Generic credit", sizeof(dest_string));
+                    break;
+                case OFX_DEBIT:
+                    strncpy(dest_string, "Generic debit", sizeof(dest_string));
+                    break;
+                case OFX_INT:
+                    strncpy(dest_string, "Interest earned or paid (Note: Depends on signage of amount)", sizeof(dest_string));
+                    break;
+                case OFX_DIV:
+                    strncpy(dest_string, "Dividend", sizeof(dest_string));
+                    break;
+                case OFX_FEE:
+                    strncpy(dest_string, "FI fee", sizeof(dest_string));
+                    break;
+                case OFX_SRVCHG:
+                    strncpy(dest_string, "Service charge", sizeof(dest_string));
+                    break;
+                case OFX_DEP:
+                    strncpy(dest_string, "Deposit", sizeof(dest_string));
+                    break;
+                case OFX_ATM:
+                    strncpy(dest_string, "ATM debit or credit (Note: Depends on signage of amount)", sizeof(dest_string));
+                    break;
+                case OFX_POS:
+                    strncpy(dest_string, "Point of sale debit or credit (Note: Depends on signage of amount)", sizeof(dest_string));
+                    break;
+                case OFX_XFER:
+                    strncpy(dest_string, "Transfer", sizeof(dest_string));
+                    break;
+                case OFX_CHECK:
+                    strncpy(dest_string, "Check", sizeof(dest_string));
+                    break;
+                case OFX_PAYMENT:
+                    strncpy(dest_string, "Electronic payment", sizeof(dest_string));
+                    break;
+                case OFX_CASH:
+                    strncpy(dest_string, "Cash withdrawal", sizeof(dest_string));
+                    break;
+                case OFX_DIRECTDEP:
+                    strncpy(dest_string, "Direct deposit", sizeof(dest_string));
+                    break;
+                case OFX_DIRECTDEBIT:
+                    strncpy(dest_string, "Merchant initiated debit", sizeof(dest_string));
+                    break;
+                case OFX_REPEATPMT:
+                    strncpy(dest_string, "Repeating payment/standing order", sizeof(dest_string));
+                    break;
+                case OFX_OTHER:
+                    strncpy(dest_string, "Other", sizeof(dest_string));
+                    break;
+                default :
+                    strncpy(dest_string, "Unknown transaction type", sizeof(dest_string));
+                    break;
+                }
+                tmp = notes;
+                notes = g_strdup_printf("%s%s%s", tmp, "|Trans type:", dest_string);
+                g_free(tmp);
+            }
+
+            if (data.invtransactiontype_valid == true)
+            {
+                switch (data.invtransactiontype)
+                {
+                case OFX_BUYDEBT:
+                    strncpy(dest_string, "BUYDEBT (Buy debt security)", sizeof(dest_string));
+                    break;
+                case OFX_BUYMF:
+                    strncpy(dest_string, "BUYMF (Buy mutual fund)", sizeof(dest_string));
+                    break;
+                case OFX_BUYOPT:
+                    strncpy(dest_string, "BUYOPT (Buy option)", sizeof(dest_string));
+                    break;
+                case OFX_BUYOTHER:
+                    strncpy(dest_string, "BUYOTHER (Buy other security type)", sizeof(dest_string));
+                    break;
+                case OFX_BUYSTOCK:
+                    strncpy(dest_string, "BUYSTOCK (Buy stock))", sizeof(dest_string));
+                    break;
+                case OFX_CLOSUREOPT:
+                    strncpy(dest_string, "CLOSUREOPT (Close a position for an option)", sizeof(dest_string));
+                    break;
+                case OFX_INCOME:
+                    strncpy(dest_string, "INCOME (Investment income is realized as cash into the investment account)", sizeof(dest_string));
+                    break;
+                case OFX_INVEXPENSE:
+                    strncpy(dest_string, "INVEXPENSE (Misc investment expense that is associated with a specific security)", sizeof(dest_string));
+                    break;
+                case OFX_JRNLFUND:
+                    strncpy(dest_string, "JRNLFUND (Journaling cash holdings between subaccounts within the same investment account)", sizeof(dest_string));
+                    break;
+                case OFX_MARGININTEREST:
+                    strncpy(dest_string, "MARGININTEREST (Margin interest expense)", sizeof(dest_string));
+                    break;
+                case OFX_REINVEST:
+                    strncpy(dest_string, "REINVEST (Reinvestment of income)", sizeof(dest_string));
+                    break;
+                case OFX_RETOFCAP:
+                    strncpy(dest_string, "RETOFCAP (Return of capital)", sizeof(dest_string));
+                    break;
+                case OFX_SELLDEBT:
+                    strncpy(dest_string, "SELLDEBT (Sell debt security.  Used when debt is sold, called, or reached maturity)", sizeof(dest_string));
+                    break;
+                case OFX_SELLMF:
+                    strncpy(dest_string, "SELLMF (Sell mutual fund)", sizeof(dest_string));
+                    break;
+                case OFX_SELLOPT:
+                    strncpy(dest_string, "SELLOPT (Sell option)", sizeof(dest_string));
+                    break;
+                case OFX_SELLOTHER:
+                    strncpy(dest_string, "SELLOTHER (Sell other type of security)", sizeof(dest_string));
+                    break;
+                case OFX_SELLSTOCK:
+                    strncpy(dest_string, "SELLSTOCK (Sell stock)", sizeof(dest_string));
+                    break;
+                case OFX_SPLIT:
+                    strncpy(dest_string, "SPLIT (Stock or mutial fund split)", sizeof(dest_string));
+                    break;
+                case OFX_TRANSFER:
+                    strncpy(dest_string, "TRANSFER (Transfer holdings in and out of the investment account)", sizeof(dest_string));
+                    break;
+                default:
+                    strncpy(dest_string, "ERROR, this investment transaction type is unknown.  This is a bug in ofxdump", sizeof(dest_string));
+                    break;
+                }
+                tmp = notes;
+                notes = g_strdup_printf("%s%s%s", tmp, "|Investment Trans type:", dest_string);
+                g_free(tmp);
+            }
+            if (data.memo_valid == true && data.name_valid == true) /* Copy only if memo wasn't put in Description */
+            {
+                tmp = notes;
+                notes = g_strdup_printf("%s%s%s", tmp, "|Memo:", data.memo);
+                g_free(tmp);
+            }
+            if (data.date_funds_available_valid == true)
+            {
+                Timespec ts;
+                timespecFromTime_t(&ts, data.date_funds_available);
+                gnc_timespec_to_iso8601_buff (ts, dest_string);
+                tmp = notes;
+                notes = g_strdup_printf("%s%s%s", tmp, "|Date funds available:", dest_string);
+                g_free(tmp);
+            }
+            if (data.server_transaction_id_valid == true)
+            {
+                tmp = notes;
+                notes = g_strdup_printf("%s%s%s", tmp, "|Server trans ID (conf. number):", data.server_transaction_id);
+                g_free(tmp);
+            }
+            if (data.standard_industrial_code_valid == true)
+            {
+                tmp = notes;
+                notes = g_strdup_printf("%s%s%ld", tmp, "|Standard Industrial Code:", data.standard_industrial_code);
+                g_free(tmp);
+
+            }
+            if (data.payee_id_valid == true)
+            {
+                tmp = notes;
+                notes = g_strdup_printf("%s%s%s", tmp, "|Payee ID:", data.payee_id);
+                g_free(tmp);
+            }
+
+            PERR("WRITEME: GnuCash ofx_proc_transaction():Add PAYEE and ADRESS here once supported by libofx!\n");
+
+            /* Ideally, gnucash should process the corrected transactions */
+            if (data.fi_id_corrected_valid == true)
+            {
+                PERR("WRITEME: GnuCash ofx_proc_transaction(): WARNING: This transaction corrected a previous transaction, but we created a new one instead!\n");
+                tmp = notes;
+                notes = g_strdup_printf("%s%s%s%s", tmp, "|This corrects transaction #", data.fi_id_corrected, "but GnuCash didn't process the correction!");
+                g_free(tmp);
+            }
+            xaccTransSetNotes(transaction, notes);
+            g_free(notes);
+            if ( data.account_ptr && data.account_ptr->currency_valid )
+            {
+                DEBUG("Currency from libofx: %s", data.account_ptr->currency);
+                currency = gnc_commodity_table_lookup( gnc_get_current_commodities (),
+                                                       GNC_COMMODITY_NS_CURRENCY,
+                                                       data.account_ptr->currency);
+            }
+            else
+            {
+                DEBUG("Currency from libofx unavailable, defaulting to account's default");
+                currency = xaccAccountGetCommodity(account);
+            }
+
+            xaccTransSetCurrency(transaction, currency);
+            if (data.amount_valid == true)
+            {
+                if (data.invtransactiontype_valid == false)
+                {
+                    /*************Process a normal transaction ***************************/
+                    DEBUG("Adding split; Ordinary banking transaction, money flows from or into the source account");
+                    split = xaccMallocSplit(book);
+                    xaccTransAppendSplit(transaction, split);
+                    xaccAccountInsertSplit(account, split);
+
+                    gnc_amount = double_to_gnc_numeric (data.amount,
+                                                        gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)),
+                                                        GNC_RND_ROUND);
+                    xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction));
+
+                    /* Also put the ofx transaction's memo in the split's memo field */
+                    if (data.memo_valid == true)
+                    {
+                        xaccSplitSetMemo(split, data.memo);
+                    }
+                    if (data.fi_id_valid == true)
+                    {
+                        gnc_import_set_split_online_id(split, data.fi_id);
+                    }
+                }
+                else if (data.unique_id_valid == true
+                         && data.security_data_valid
+                         && data.security_data_ptr != NULL
+                         && data.security_data_ptr->secname_valid == true)
+                {
+                    /************************ Process an investment transaction ******************************/
+                    /* Note that the ACCT_TYPE_STOCK account type should be replaced with something
+                       derived from data.invtranstype*/
+                    investment_commodity = gnc_import_select_commodity(data.unique_id,
+                                           0,
+                                           NULL,
+                                           NULL);
+                    if (investment_commodity != NULL)
+                    {
+                        investment_account_text = g_strdup_printf( /* This string is a default account
 								  name. It MUST NOT contain the
 								  character ':' anywhere in it or
 								  in any translations.  */
-							      _("Stock account for security \"%s\""),
-							      data.security_data_ptr->secname);
-		    investment_account = gnc_import_select_account(NULL,
-								   data.unique_id,
-								   1,
-								   investment_account_text, 
-								   investment_commodity,
-								   ACCT_TYPE_STOCK,
-								   NULL,
-								   NULL);
-		    g_free (investment_account_text);
-		    investment_account_text = NULL;
-		    if(investment_account!=NULL&&
-		       data.unitprice_valid==true&&
-		       data.units_valid==true&&
-		       ( data.invtransactiontype!=OFX_INCOME ) )
-		      {
-			DEBUG("Adding investment split; Money flows from or into the stock account"); 
-			split=xaccMallocSplit(book);
-			xaccTransAppendSplit(transaction,split);
-			xaccAccountInsertSplit(investment_account,split);
+                                                      _("Stock account for security \"%s\""),
+                                                      data.security_data_ptr->secname);
+                        investment_account = gnc_import_select_account(NULL,
+                                             data.unique_id,
+                                             1,
+                                             investment_account_text,
+                                             investment_commodity,
+                                             ACCT_TYPE_STOCK,
+                                             NULL,
+                                             NULL);
+                        g_free (investment_account_text);
+                        investment_account_text = NULL;
+                        if (investment_account != NULL &&
+                                data.unitprice_valid == true &&
+                                data.units_valid == true &&
+                                ( data.invtransactiontype != OFX_INCOME ) )
+                        {
+                            DEBUG("Adding investment split; Money flows from or into the stock account");
+                            split = xaccMallocSplit(book);
+                            xaccTransAppendSplit(transaction, split);
+                            xaccAccountInsertSplit(investment_account, split);
 
-			gnc_amount = double_to_gnc_numeric (ofx_get_investment_amount(data),
-							    gnc_commodity_get_fraction(investment_commodity),
-							    GNC_RND_ROUND);
-			gnc_units = double_to_gnc_numeric (data.units,
-							   gnc_commodity_get_fraction(investment_commodity),
-							   GNC_RND_ROUND);
-			xaccSplitSetAmount(split, gnc_units);
-			xaccSplitSetValue(split, gnc_amount);
-			
-			if(data.security_data_ptr->memo_valid==true)
-			  {
-			    xaccSplitSetMemo(split, data.security_data_ptr->memo);
-			  }
-			if(data.fi_id_valid==true)
-			  {
-			    gnc_import_set_split_online_id(split, data.fi_id);
-			  }
-		      }
-		    else
-		      {
-			PERR("The investment account, units or unitprice was not found for the investment transaction");
-		      }
-		  }
-		else
-		  {
-		    PERR("Commodity not found for the investment transaction");
-		  }
-		
-		if(data.invtransactiontype_valid==true)
-		  {
-		    if(data.invtransactiontype==OFX_REINVEST||data.invtransactiontype==OFX_INCOME)
-		      {
-			DEBUG("Now let's find an account for the destination split");
-			
-			acc_frame=xaccAccountGetSlots(investment_account);
-			kvp_val = kvp_frame_get_slot(acc_frame, 
-						     "ofx/associated-income-account");
-			if (kvp_val != NULL)
-			  {
-			    income_account = xaccAccountLookup(kvp_value_get_guid(kvp_val),book); 
-			  }
-			if(income_account==NULL)
-			  {
-			    DEBUG("Couldn't find an associated income account");
-			    investment_account_text = g_strdup_printf( /* This string is a default account
+                            gnc_amount = double_to_gnc_numeric (ofx_get_investment_amount(data),
+                                                                gnc_commodity_get_fraction(investment_commodity),
+                                                                GNC_RND_ROUND);
+                            gnc_units = double_to_gnc_numeric (data.units,
+                                                               gnc_commodity_get_fraction(investment_commodity),
+                                                               GNC_RND_ROUND);
+                            xaccSplitSetAmount(split, gnc_units);
+                            xaccSplitSetValue(split, gnc_amount);
+
+                            if (data.security_data_ptr->memo_valid == true)
+                            {
+                                xaccSplitSetMemo(split, data.security_data_ptr->memo);
+                            }
+                            if (data.fi_id_valid == true)
+                            {
+                                gnc_import_set_split_online_id(split, data.fi_id);
+                            }
+                        }
+                        else
+                        {
+                            PERR("The investment account, units or unitprice was not found for the investment transaction");
+                        }
+                    }
+                    else
+                    {
+                        PERR("Commodity not found for the investment transaction");
+                    }
+
+                    if (data.invtransactiontype_valid == true)
+                    {
+                        if (data.invtransactiontype == OFX_REINVEST || data.invtransactiontype == OFX_INCOME)
+                        {
+                            DEBUG("Now let's find an account for the destination split");
+
+                            acc_frame = xaccAccountGetSlots(investment_account);
+                            kvp_val = kvp_frame_get_slot(acc_frame,
+                                                         "ofx/associated-income-account");
+                            if (kvp_val != NULL)
+                            {
+                                income_account = xaccAccountLookup(kvp_value_get_guid(kvp_val), book);
+                            }
+                            if (income_account == NULL)
+                            {
+                                DEBUG("Couldn't find an associated income account");
+                                investment_account_text = g_strdup_printf( /* This string is a default account
 									  name. It MUST NOT contain the
 									  character ':' anywhere in it or
 									  in any translations.  */
-								      _("Income account for security \"%s\""),
-								      data.security_data_ptr->secname);
-			    income_account=gnc_import_select_account(NULL,
-								     NULL,
-								     1,
-								     investment_account_text, 
-								     currency,
-								     ACCT_TYPE_INCOME,
-								     NULL,
-								     NULL);
-			    income_acc_guid = xaccAccountGetGUID(income_account);
-			    kvp_val = kvp_value_new_guid(income_acc_guid);
-			    if( acc_frame==NULL)
-			      {
-				DEBUG("The kvp_frame was NULL, allocating new one");
-				acc_frame = kvp_frame_new();
-			      }
-			    kvp_frame_set_slot_nc(acc_frame, "ofx/associated-income-account",
-						  kvp_val);
-			    DEBUG("KVP written");
-			    
-			  }
-			else
-			  {
-			    DEBUG("Found at least one associated income account");
-			  }
-		      }
-		    if(income_account!=NULL&&
-		       data.invtransactiontype==OFX_REINVEST)
-		      {
-			DEBUG("Adding investment split; Money flows from the income account"); 
-			split=xaccMallocSplit(book);
-			xaccTransAppendSplit(transaction,split);
-			xaccAccountInsertSplit(income_account,split);
+                                                              _("Income account for security \"%s\""),
+                                                              data.security_data_ptr->secname);
+                                income_account = gnc_import_select_account(NULL,
+                                                 NULL,
+                                                 1,
+                                                 investment_account_text,
+                                                 currency,
+                                                 ACCT_TYPE_INCOME,
+                                                 NULL,
+                                                 NULL);
+                                income_acc_guid = xaccAccountGetGUID(income_account);
+                                kvp_val = kvp_value_new_guid(income_acc_guid);
+                                if ( acc_frame == NULL)
+                                {
+                                    DEBUG("The kvp_frame was NULL, allocating new one");
+                                    acc_frame = kvp_frame_new();
+                                }
+                                kvp_frame_set_slot_nc(acc_frame, "ofx/associated-income-account",
+                                                      kvp_val);
+                                DEBUG("KVP written");
 
-			gnc_amount = double_to_gnc_numeric (data.amount,
-							    gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)),
-							    GNC_RND_ROUND);
-			xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction));
-		    
-			/* Also put the ofx transaction name in the splits memo field, or ofx memo if name is unavailable */ 
-			if(data.name_valid==true){
-			  xaccSplitSetMemo(split, data.name);
-			}
-			else if(data.memo_valid==true){
-			  xaccSplitSetMemo(split, data.memo);
-			}    
-		      }
-		    if(income_account!=NULL&&
-			data.invtransactiontype==OFX_INCOME)
-		      {
-			DEBUG("Adding investment split; Money flows from the income account"); 
-			split=xaccMallocSplit(book);
-			xaccTransAppendSplit(transaction,split);
-			xaccAccountInsertSplit(income_account,split);
+                            }
+                            else
+                            {
+                                DEBUG("Found at least one associated income account");
+                            }
+                        }
+                        if (income_account != NULL &&
+                                data.invtransactiontype == OFX_REINVEST)
+                        {
+                            DEBUG("Adding investment split; Money flows from the income account");
+                            split = xaccMallocSplit(book);
+                            xaccTransAppendSplit(transaction, split);
+                            xaccAccountInsertSplit(income_account, split);
 
-			gnc_amount = double_to_gnc_numeric (-data.amount,/*OFX_INCOME amounts come in as positive numbers*/
-							    gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)),
-							    GNC_RND_ROUND);
-			xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction));
-		    
-			/* Also put the ofx transaction name in the splits memo field, or ofx memo if name is unavailable */ 
-			if(data.name_valid==true){
-			  xaccSplitSetMemo(split, data.name);
-			}
-			else if(data.memo_valid==true){
-			  xaccSplitSetMemo(split, data.memo);
-			}    
-		      }
-		
+                            gnc_amount = double_to_gnc_numeric (data.amount,
+                                                                gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)),
+                                                                GNC_RND_ROUND);
+                            xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction));
 
-		    if(data.invtransactiontype!=OFX_REINVEST)
-		      {
-			DEBUG("Adding investment split; Money flows from or to the cash account");
-			split=xaccMallocSplit(book);
-			xaccTransAppendSplit(transaction,split);
-			xaccAccountInsertSplit(account,split);
+                            /* Also put the ofx transaction name in the splits memo field, or ofx memo if name is unavailable */
+                            if (data.name_valid == true)
+                            {
+                                xaccSplitSetMemo(split, data.name);
+                            }
+                            else if (data.memo_valid == true)
+                            {
+                                xaccSplitSetMemo(split, data.memo);
+                            }
+                        }
+                        if (income_account != NULL &&
+                                data.invtransactiontype == OFX_INCOME)
+                        {
+                            DEBUG("Adding investment split; Money flows from the income account");
+                            split = xaccMallocSplit(book);
+                            xaccTransAppendSplit(transaction, split);
+                            xaccAccountInsertSplit(income_account, split);
 
-			gnc_amount = double_to_gnc_numeric (-ofx_get_investment_amount(data),
-							    gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)),
-							    GNC_RND_ROUND);
-			xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction));
-		    
-			/* Also put the ofx transaction name in the splits memo field, or ofx memo if name is unavailable */ 
-			if(data.name_valid==true){
-			  xaccSplitSetMemo(split, data.name);
-			}
-			else if(data.memo_valid==true){
-			  xaccSplitSetMemo(split, data.memo);
-			}
-		    
-		      }
-		  }
-	      }
+                            gnc_amount = double_to_gnc_numeric (-data.amount,/*OFX_INCOME amounts come in as positive numbers*/
+                                                                gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)),
+                                                                GNC_RND_ROUND);
+                            xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction));
 
-	    /* Use new importer GUI. */
-	    DEBUG("%d splits sent to the importer gui",xaccTransCountSplits(transaction));
-	    gnc_gen_trans_list_add_trans (gnc_ofx_importer_gui, transaction);
-	  }
-	else
-	  {
-	    PERR("The transaction doesn't have a valid amount");
-	    xaccTransDestroy(transaction);
-	    xaccTransCommitEdit(transaction);
-	  }
-	
-      }
+                            /* Also put the ofx transaction name in the splits memo field, or ofx memo if name is unavailable */
+                            if (data.name_valid == true)
+                            {
+                                xaccSplitSetMemo(split, data.name);
+                            }
+                            else if (data.memo_valid == true)
+                            {
+                                xaccSplitSetMemo(split, data.memo);
+                            }
+                        }
+
+
+                        if (data.invtransactiontype != OFX_REINVEST)
+                        {
+                            DEBUG("Adding investment split; Money flows from or to the cash account");
+                            split = xaccMallocSplit(book);
+                            xaccTransAppendSplit(transaction, split);
+                            xaccAccountInsertSplit(account, split);
+
+                            gnc_amount = double_to_gnc_numeric (-ofx_get_investment_amount(data),
+                                                                gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)),
+                                                                GNC_RND_ROUND);
+                            xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction));
+
+                            /* Also put the ofx transaction name in the splits memo field, or ofx memo if name is unavailable */
+                            if (data.name_valid == true)
+                            {
+                                xaccSplitSetMemo(split, data.name);
+                            }
+                            else if (data.memo_valid == true)
+                            {
+                                xaccSplitSetMemo(split, data.memo);
+                            }
+
+                        }
+                    }
+                }
+
+                /* Use new importer GUI. */
+                DEBUG("%d splits sent to the importer gui", xaccTransCountSplits(transaction));
+                gnc_gen_trans_list_add_trans (gnc_ofx_importer_gui, transaction);
+            }
+            else
+            {
+                PERR("The transaction doesn't have a valid amount");
+                xaccTransDestroy(transaction);
+                xaccTransCommitEdit(transaction);
+            }
+
+        }
+        else
+        {
+            PERR("Unable to find the account!");
+        }
+    }
     else
-      {
-	PERR("Unable to find the account!");
-      }
-  }
-  else
     {
-      PERR("account ID for this transaction is unavailable!");
+        PERR("account ID for this transaction is unavailable!");
     }
-  return 0;
+    return 0;
 }//end ofx_proc_transaction()
 
 /*
@@ -557,165 +621,170 @@
 
 int ofx_proc_account_cb(struct OfxAccountData data, void * account_user_data)
 {
-  Account *selected_account;
-  gnc_commodity_table * commodity_table;
-  gnc_commodity * default_commodity;
-  GNCAccountType default_type=ACCT_TYPE_NONE;
-  gchar * account_description;
-  const gchar * account_type_name = _("Unknown OFX account");
+    Account *selected_account;
+    gnc_commodity_table * commodity_table;
+    gnc_commodity * default_commodity;
+    GNCAccountType default_type = ACCT_TYPE_NONE;
+    gchar * account_description;
+    const gchar * account_type_name = _("Unknown OFX account");
 
-  if(data.account_id_valid==true){
-    commodity_table = gnc_get_current_commodities ();
-    if( data.currency_valid == true)
-      {
-	DEBUG("Currency from libofx: %s",data.currency);
-	default_commodity = gnc_commodity_table_lookup(commodity_table,
-						       GNC_COMMODITY_NS_CURRENCY,
-						       data.currency);
-      }
-    else
-      {
-	default_commodity = NULL;
-      }
-    
-    if(data.account_type_valid==true){
-      switch(data.account_type){
-      case OFX_CHECKING : 
-	default_type=ACCT_TYPE_BANK;
-	account_type_name = _("Unknown OFX checking account");
-	break;
-      case OFX_SAVINGS : 
-	default_type=ACCT_TYPE_BANK;
-	account_type_name = _("Unknown OFX savings account");
-	break;
-      case OFX_MONEYMRKT : 
-	default_type=ACCT_TYPE_MONEYMRKT;
-	account_type_name = _("Unknown OFX money market account");
-	break;
-      case OFX_CREDITLINE : 
-	default_type=ACCT_TYPE_CREDITLINE;
-	account_type_name = _("Unknown OFX credit line account");
-	break;
-      case OFX_CMA : 
-	default_type=ACCT_TYPE_NONE;
-	account_type_name = _("Unknown OFX CMA account");
-	break;
-      case OFX_CREDITCARD : 
-	default_type=ACCT_TYPE_CREDIT;
-	account_type_name = _("Unknown OFX credit card account");
-	break;
-      case OFX_INVESTMENT :
-	default_type=ACCT_TYPE_BANK;
-	account_type_name = _("Unknown OFX investment account");
-	break;
-      default: PERR("WRITEME: ofx_proc_account() This is an unknown account type!");
-      }
-    }
+    if (data.account_id_valid == true)
+    {
+        commodity_table = gnc_get_current_commodities ();
+        if ( data.currency_valid == true)
+        {
+            DEBUG("Currency from libofx: %s", data.currency);
+            default_commodity = gnc_commodity_table_lookup(commodity_table,
+                                GNC_COMMODITY_NS_CURRENCY,
+                                data.currency);
+        }
+        else
+        {
+            default_commodity = NULL;
+        }
 
-    gnc_utf8_strip_invalid(data.account_name);
-    account_description = g_strdup_printf( /* This string is a default account
+        if (data.account_type_valid == true)
+        {
+            switch (data.account_type)
+            {
+            case OFX_CHECKING :
+                default_type = ACCT_TYPE_BANK;
+                account_type_name = _("Unknown OFX checking account");
+                break;
+            case OFX_SAVINGS :
+                default_type = ACCT_TYPE_BANK;
+                account_type_name = _("Unknown OFX savings account");
+                break;
+            case OFX_MONEYMRKT :
+                default_type = ACCT_TYPE_MONEYMRKT;
+                account_type_name = _("Unknown OFX money market account");
+                break;
+            case OFX_CREDITLINE :
+                default_type = ACCT_TYPE_CREDITLINE;
+                account_type_name = _("Unknown OFX credit line account");
+                break;
+            case OFX_CMA :
+                default_type = ACCT_TYPE_NONE;
+                account_type_name = _("Unknown OFX CMA account");
+                break;
+            case OFX_CREDITCARD :
+                default_type = ACCT_TYPE_CREDIT;
+                account_type_name = _("Unknown OFX credit card account");
+                break;
+            case OFX_INVESTMENT :
+                default_type = ACCT_TYPE_BANK;
+                account_type_name = _("Unknown OFX investment account");
+                break;
+            default:
+                PERR("WRITEME: ofx_proc_account() This is an unknown account type!");
+            }
+        }
+
+        gnc_utf8_strip_invalid(data.account_name);
+        account_description = g_strdup_printf( /* This string is a default account
 					      name. It MUST NOT contain the
 					      character ':' anywhere in it or
 					      in any translation.  */
-					  "%s \"%s\"",
-					  account_type_name,
-					  data.account_name);
-    selected_account = gnc_import_select_account(NULL,
-						 data.account_id, 1,
-						 account_description, default_commodity,
-						 default_type, NULL, NULL);
-    g_free(account_description);
-  }
-  else
+                                  "%s \"%s\"",
+                                  account_type_name,
+                                  data.account_name);
+        selected_account = gnc_import_select_account(NULL,
+                           data.account_id, 1,
+                           account_description, default_commodity,
+                           default_type, NULL, NULL);
+        g_free(account_description);
+    }
+    else
     {
-      PERR("account online ID not available");
+        PERR("account online ID not available");
     }
 
-  return 0;
+    return 0;
 }
 
 double ofx_get_investment_amount(struct OfxTransactionData data)
 {
-  switch(data.invtransactiontype){
-  case OFX_BUYDEBT: 
-  case OFX_BUYMF:
-  case OFX_BUYOPT:
-  case OFX_BUYOTHER:
-  case OFX_BUYSTOCK:
-    return fabs(data.amount);
-  case OFX_SELLDEBT:
-  case OFX_SELLMF:
-  case OFX_SELLOPT:
-  case OFX_SELLOTHER:
-  case OFX_SELLSTOCK:
-    return -1*fabs(data.amount);
-  default:
-    return -1*data.amount;
-  }
+    switch (data.invtransactiontype)
+    {
+    case OFX_BUYDEBT:
+    case OFX_BUYMF:
+    case OFX_BUYOPT:
+    case OFX_BUYOTHER:
+    case OFX_BUYSTOCK:
+        return fabs(data.amount);
+    case OFX_SELLDEBT:
+    case OFX_SELLMF:
+    case OFX_SELLOPT:
+    case OFX_SELLOTHER:
+    case OFX_SELLSTOCK:
+        return -1 * fabs(data.amount);
+    default:
+        return -1 * data.amount;
+    }
 }
 
 void gnc_file_ofx_import (void)
 {
-  extern int ofx_PARSER_msg;
-  extern int ofx_DEBUG_msg;
-  extern int ofx_WARNING_msg;
-  extern int ofx_ERROR_msg;
-  extern int ofx_INFO_msg;
-  extern int ofx_STATUS_msg;
-  char *selected_filename;
-  char *default_dir;
-  LibofxContextPtr libofx_context = libofx_get_new_context();
+    extern int ofx_PARSER_msg;
+    extern int ofx_DEBUG_msg;
+    extern int ofx_WARNING_msg;
+    extern int ofx_ERROR_msg;
+    extern int ofx_INFO_msg;
+    extern int ofx_STATUS_msg;
+    char *selected_filename;
+    char *default_dir;
+    LibofxContextPtr libofx_context = libofx_get_new_context();
 
-  ofx_PARSER_msg = false;
-  ofx_DEBUG_msg = false;
-  ofx_WARNING_msg = true;
-  ofx_ERROR_msg = true;
-  ofx_INFO_msg = true;
-  ofx_STATUS_msg = false;
+    ofx_PARSER_msg = false;
+    ofx_DEBUG_msg = false;
+    ofx_WARNING_msg = true;
+    ofx_ERROR_msg = true;
+    ofx_INFO_msg = true;
+    ofx_STATUS_msg = false;
 
-  DEBUG("gnc_file_ofx_import(): Begin...\n");
+    DEBUG("gnc_file_ofx_import(): Begin...\n");
 
-  default_dir = gnc_get_default_directory(GCONF_SECTION);
-  selected_filename = gnc_file_dialog(_("Select an OFX/QFX file to process"),
-				      NULL,
-				      default_dir,
-				      GNC_FILE_DIALOG_IMPORT);
-  g_free(default_dir);
+    default_dir = gnc_get_default_directory(GCONF_SECTION);
+    selected_filename = gnc_file_dialog(_("Select an OFX/QFX file to process"),
+                                        NULL,
+                                        default_dir,
+                                        GNC_FILE_DIALOG_IMPORT);
+    g_free(default_dir);
 
-  if(selected_filename!=NULL)
+    if (selected_filename != NULL)
     {
 #ifdef G_OS_WIN32
-      gchar *conv_name;
+        gchar *conv_name;
 #endif
 
-      /* Remember the directory as the default. */
-      default_dir = g_path_get_dirname(selected_filename);
-      gnc_set_default_directory(GCONF_SECTION, default_dir);
-      g_free(default_dir);
+        /* Remember the directory as the default. */
+        default_dir = g_path_get_dirname(selected_filename);
+        gnc_set_default_directory(GCONF_SECTION, default_dir);
+        g_free(default_dir);
 
-      /*strncpy(file,selected_filename, 255);*/
-      DEBUG("Filename found: %s",selected_filename);
+        /*strncpy(file,selected_filename, 255);*/
+        DEBUG("Filename found: %s", selected_filename);
 
-      /* Create the Generic transaction importer GUI. */
-      gnc_ofx_importer_gui = gnc_gen_trans_list_new(NULL, NULL, FALSE, 42);
+        /* Create the Generic transaction importer GUI. */
+        gnc_ofx_importer_gui = gnc_gen_trans_list_new(NULL, NULL, FALSE, 42);
 
-      /* Initialize libofx */
+        /* Initialize libofx */
 
-      /*ofx_set_statement_cb(libofx_context, ofx_proc_statement_cb, 0);*/
-      ofx_set_account_cb(libofx_context, ofx_proc_account_cb, 0);
-      ofx_set_transaction_cb(libofx_context, ofx_proc_transaction_cb, 0);
-      ofx_set_security_cb(libofx_context, ofx_proc_security_cb, 0);
-      /*ofx_set_status_cb(libofx_context, ofx_proc_status_cb, 0);*/
+        /*ofx_set_statement_cb(libofx_context, ofx_proc_statement_cb, 0);*/
+        ofx_set_account_cb(libofx_context, ofx_proc_account_cb, 0);
+        ofx_set_transaction_cb(libofx_context, ofx_proc_transaction_cb, 0);
+        ofx_set_security_cb(libofx_context, ofx_proc_security_cb, 0);
+        /*ofx_set_status_cb(libofx_context, ofx_proc_status_cb, 0);*/
 
 #ifdef G_OS_WIN32
-      conv_name = g_win32_locale_filename_from_utf8(selected_filename);
-      g_free(selected_filename);
-      selected_filename = conv_name;
+        conv_name = g_win32_locale_filename_from_utf8(selected_filename);
+        g_free(selected_filename);
+        selected_filename = conv_name;
 #endif
 
-      DEBUG("Opening selected file");
-      libofx_proc_file(libofx_context, selected_filename, AUTODETECT);
-      g_free(selected_filename);
+        DEBUG("Opening selected file");
+        libofx_proc_file(libofx_context, selected_filename, AUTODETECT);
+        g_free(selected_filename);
     }
 
 }

Modified: gnucash/trunk/src/import-export/ofx/gnc-ofx-import.h
===================================================================
--- gnucash/trunk/src/import-export/ofx/gnc-ofx-import.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/ofx/gnc-ofx-import.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -16,12 +16,12 @@
  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 \********************************************************************/
- /** @file
-     @brief Ofx import module interface
-     *
-     gnc-ofx-import.h
-     @author Copyright (c) 2002 Benoit Grégoire <bock at step.polymtl.ca>
- */
+/** @file
+    @brief Ofx import module interface
+    *
+    gnc-ofx-import.h
+    @author Copyright (c) 2002 Benoit Grégoire <bock at step.polymtl.ca>
+*/
 #ifndef OFX_IMPORT_H
 #define OFX_IMPORT_H
 

Modified: gnucash/trunk/src/import-export/ofx/gnc-plugin-ofx.c
===================================================================
--- gnucash/trunk/src/import-export/ofx/gnc-plugin-ofx.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/ofx/gnc-plugin-ofx.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-ofx.c -- 
+/*
+ * gnc-plugin-ofx.c --
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -40,16 +40,19 @@
 #define PLUGIN_ACTIONS_NAME "gnc-plugin-ofx-actions"
 #define PLUGIN_UI_FILENAME  "gnc-plugin-ofx-ui.xml"
 
-static GtkActionEntry gnc_plugin_actions [] = {
-  { "OfxImportAction", GTK_STOCK_CONVERT, N_("Import _OFX/QFX..."), NULL,
-    N_("Process an OFX/QFX response file"),
-    G_CALLBACK (gnc_plugin_ofx_cmd_import) },
+static GtkActionEntry gnc_plugin_actions [] =
+{
+    {
+        "OfxImportAction", GTK_STOCK_CONVERT, N_("Import _OFX/QFX..."), NULL,
+        N_("Process an OFX/QFX response file"),
+        G_CALLBACK (gnc_plugin_ofx_cmd_import)
+    },
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
 
 typedef struct GncPluginOfxPrivate
 {
-  gpointer dummy;
+    gpointer dummy;
 } GncPluginOfxPrivate;
 
 #define GNC_PLUGIN_OFX_GET_PRIVATE(o)  \
@@ -60,55 +63,57 @@
 GType
 gnc_plugin_ofx_get_type (void)
 {
-  static GType gnc_plugin_ofx_type = 0;
+    static GType gnc_plugin_ofx_type = 0;
 
-  if (gnc_plugin_ofx_type == 0) {
-    static const GTypeInfo our_info = {
-		sizeof (GncPluginOfxClass),
-		NULL,		/* base_init */
-		NULL,		/* base_finalize */
-		(GClassInitFunc) gnc_plugin_ofx_class_init,
-		NULL,		/* class_finalize */
-		NULL,		/* class_data */
-		sizeof (GncPluginOfx),
-		0,		/* n_preallocs */
-		(GInstanceInitFunc) gnc_plugin_ofx_init,
-    };
+    if (gnc_plugin_ofx_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginOfxClass),
+            NULL,		/* base_init */
+            NULL,		/* base_finalize */
+            (GClassInitFunc) gnc_plugin_ofx_class_init,
+            NULL,		/* class_finalize */
+            NULL,		/* class_data */
+            sizeof (GncPluginOfx),
+            0,		/* n_preallocs */
+            (GInstanceInitFunc) gnc_plugin_ofx_init,
+        };
 
-    gnc_plugin_ofx_type = g_type_register_static (GNC_TYPE_PLUGIN,
-						  "GncPluginOfx",
-						  &our_info, 0);
-  }
+        gnc_plugin_ofx_type = g_type_register_static (GNC_TYPE_PLUGIN,
+                              "GncPluginOfx",
+                              &our_info, 0);
+    }
 
-  return gnc_plugin_ofx_type;
+    return gnc_plugin_ofx_type;
 }
 
 GncPlugin *
 gnc_plugin_ofx_new (void)
 {
-  return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_OFX, NULL));
+    return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_OFX, NULL));
 }
 
 static void
 gnc_plugin_ofx_class_init (GncPluginOfxClass *klass)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
 
-  parent_class = g_type_class_peek_parent (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-  object_class->finalize = gnc_plugin_ofx_finalize;
+    object_class->finalize = gnc_plugin_ofx_finalize;
 
-  /* plugin info */
-  plugin_class->plugin_name  = GNC_PLUGIN_OFX_NAME;
+    /* plugin info */
+    plugin_class->plugin_name  = GNC_PLUGIN_OFX_NAME;
 
-  /* widget addition/removal */
-  plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
-  plugin_class->actions      = gnc_plugin_actions;
-  plugin_class->n_actions    = gnc_plugin_n_actions;
-  plugin_class->ui_filename  = PLUGIN_UI_FILENAME;
+    /* widget addition/removal */
+    plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
+    plugin_class->actions      = gnc_plugin_actions;
+    plugin_class->n_actions    = gnc_plugin_n_actions;
+    plugin_class->ui_filename  = PLUGIN_UI_FILENAME;
 
-  g_type_class_add_private(klass, sizeof(GncPluginOfxPrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginOfxPrivate));
 }
 
 static void
@@ -119,15 +124,15 @@
 static void
 gnc_plugin_ofx_finalize (GObject *object)
 {
-  GncPluginOfx *plugin;
-  GncPluginOfxPrivate *priv;
+    GncPluginOfx *plugin;
+    GncPluginOfxPrivate *priv;
 
-  g_return_if_fail (GNC_IS_PLUGIN_OFX (object));
+    g_return_if_fail (GNC_IS_PLUGIN_OFX (object));
 
-  plugin = GNC_PLUGIN_OFX (object);
-  priv = GNC_PLUGIN_OFX_GET_PRIVATE(plugin);
+    plugin = GNC_PLUGIN_OFX (object);
+    priv = GNC_PLUGIN_OFX_GET_PRIVATE(plugin);
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 /************************************************************
@@ -140,9 +145,9 @@
 
 static void
 gnc_plugin_ofx_cmd_import (GtkAction *action,
-			   GncMainWindowActionData *data)
+                           GncMainWindowActionData *data)
 {
-  gnc_file_ofx_import ();
+    gnc_file_ofx_import ();
 }
 
 
@@ -153,7 +158,7 @@
 void
 gnc_plugin_ofx_create_plugin (void)
 {
-  GncPlugin *plugin = gnc_plugin_ofx_new ();
+    GncPlugin *plugin = gnc_plugin_ofx_new ();
 
-  gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
+    gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
 }

Modified: gnucash/trunk/src/import-export/ofx/gnc-plugin-ofx.h
===================================================================
--- gnucash/trunk/src/import-export/ofx/gnc-plugin-ofx.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/ofx/gnc-plugin-ofx.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-ofx.h -- 
+/*
+ * gnc-plugin-ofx.h --
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -40,12 +40,14 @@
 #define GNC_PLUGIN_OFX_NAME "gnc-plugin-ofx"
 
 /* typedefs & structures */
-typedef struct {
-	GncPlugin gnc_plugin;
+typedef struct
+{
+    GncPlugin gnc_plugin;
 } GncPluginOfx;
 
-typedef struct {
-	GncPluginClass gnc_plugin;
+typedef struct
+{
+    GncPluginClass gnc_plugin;
 } GncPluginOfxClass;
 
 /* function prototypes */

Modified: gnucash/trunk/src/import-export/ofx/gncmod-ofx-import.c
===================================================================
--- gnucash/trunk/src/import-export/ofx/gncmod-ofx-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/ofx/gncmod-ofx-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -18,11 +18,11 @@
 \********************************************************************/
 /** @addtogroup Import_Export
     @{ */
- /**@internal
- @file gncmod-ofx-import.c
- @brief module definition/initialization for the ofx importer
- @author Copyright (c) 2002 Benoit Grégoire bock at step.polymtl.ca
- */
+/**@internal
+ at file gncmod-ofx-import.c
+ at brief module definition/initialization for the ofx importer
+ at author Copyright (c) 2002 Benoit Grégoire bock at step.polymtl.ca
+*/
 #include "config.h"
 
 #include <gmodule.h>
@@ -49,44 +49,44 @@
 char *
 libgncmod_ofx_gnc_module_path(void)
 {
-  return g_strdup("gnucash/import-export/ofx");
+    return g_strdup("gnucash/import-export/ofx");
 }
 
 char *
 libgncmod_ofx_gnc_module_description(void)
 {
-  return g_strdup("Gnome GUI and C code for OFX importer using libofx");
+    return g_strdup("Gnome GUI and C code for OFX importer using libofx");
 }
 
 int
 libgncmod_ofx_gnc_module_init(int refcount)
 {
-  if(!gnc_module_load("gnucash/engine", 0))
-  {
-    return FALSE;
-  }
-  if(!gnc_module_load("gnucash/app-utils", 0))
-  {
-    return FALSE;
-  }
-  if(!gnc_module_load("gnucash/gnome-utils", 0))
-  {
-    return FALSE;
-  }
-    if(!gnc_module_load("gnucash/import-export", 0))
-  {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
+    if (!gnc_module_load("gnucash/import-export", 0))
+    {
+        return FALSE;
+    }
 
-  /* Add menu items with C callbacks */
-  gnc_plugin_ofx_create_plugin();
+    /* Add menu items with C callbacks */
+    gnc_plugin_ofx_create_plugin();
 
-  return TRUE;
+    return TRUE;
 }
 
 int
 libgncmod_ofx_gnc_module_end(int refcount)
 {
-  return TRUE;
+    return TRUE;
 }
 /** @}*/

Modified: gnucash/trunk/src/import-export/ofx/test/test-link.c
===================================================================
--- gnucash/trunk/src/import-export/ofx/test/test-link.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/ofx/test/test-link.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,7 +1,7 @@
 #include <libofx/libofx.h>
 int
-main(int argc, char ** argv) 
+main(int argc, char ** argv)
 {
-  return 0;
+    return 0;
 }
 

Modified: gnucash/trunk/src/import-export/qif/qif-context.c
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-context.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-context.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -36,120 +36,124 @@
 QifContext
 qif_context_new(void)
 {
-  QifContext ctx = g_new0(struct _QifContext, 1);
+    QifContext ctx = g_new0(struct _QifContext, 1);
 
-  ctx->object_lists = g_hash_table_new(g_str_hash, g_str_equal);
-  ctx->object_maps = g_hash_table_new(g_str_hash, g_str_equal);
+    ctx->object_lists = g_hash_table_new(g_str_hash, g_str_equal);
+    ctx->object_maps = g_hash_table_new(g_str_hash, g_str_equal);
 
-  return ctx;
+    return ctx;
 }
 
 void
 qif_context_destroy(QifContext ctx)
 {
-  GList *node, *temp;
-  QifContext fctx;
+    GList *node, *temp;
+    QifContext fctx;
 
-  if (!ctx) return;
+    if (!ctx) return;
 
-  /* First, try to destroy all the children contexts */
-  for (node = ctx->files; node; node = temp) {
-    fctx = node->data;
-    temp = node->next;
-    qif_context_destroy(fctx);
-  }
-  
-  /* ok, at this point we're actually destroying this context. */
+    /* First, try to destroy all the children contexts */
+    for (node = ctx->files; node; node = temp)
+    {
+        fctx = node->data;
+        temp = node->next;
+        qif_context_destroy(fctx);
+    }
 
-  /* force the end of record */
-  if (ctx->handler && ctx->handler->end)
-    ctx->handler->end(ctx);
+    /* ok, at this point we're actually destroying this context. */
 
-  /* destroy the state objects */
-  qif_object_list_destroy(ctx);
-  qif_object_map_destroy(ctx);
+    /* force the end of record */
+    if (ctx->handler && ctx->handler->end)
+        ctx->handler->end(ctx);
 
-  /* Remove us from our parent context */
-  if (ctx->parent)
-    ctx->parent->files = g_list_remove(ctx->parent->files, ctx);
+    /* destroy the state objects */
+    qif_object_list_destroy(ctx);
+    qif_object_map_destroy(ctx);
 
-  g_free(ctx->filename);
+    /* Remove us from our parent context */
+    if (ctx->parent)
+        ctx->parent->files = g_list_remove(ctx->parent->files, ctx);
 
-  g_assert(ctx->files == NULL);
-  g_free(ctx);
+    g_free(ctx->filename);
+
+    g_assert(ctx->files == NULL);
+    g_free(ctx);
 }
 
 static GList *
 qif_context_get_foo_helper(QifContext ctx, GFunc get_helper)
 {
-  GHashTable *ht;
-  GList *node, *list = NULL;
-  QifContext fctx;
+    GHashTable *ht;
+    GList *node, *list = NULL;
+    QifContext fctx;
 
-  g_return_val_if_fail(ctx, NULL);
-  g_return_val_if_fail(ctx->parsed, NULL);
-  g_return_val_if_fail(get_helper, NULL);
+    g_return_val_if_fail(ctx, NULL);
+    g_return_val_if_fail(ctx->parsed, NULL);
+    g_return_val_if_fail(get_helper, NULL);
 
-  ht = g_hash_table_new(g_direct_hash, g_direct_equal);
+    ht = g_hash_table_new(g_direct_hash, g_direct_equal);
 
-  for (node = ctx->files; node; node = node->next) {
-    fctx = node->data;
-    qif_object_list_foreach(fctx, QIF_O_TXN, get_helper, ht);
-  }
+    for (node = ctx->files; node; node = node->next)
+    {
+        fctx = node->data;
+        qif_object_list_foreach(fctx, QIF_O_TXN, get_helper, ht);
+    }
 
-  g_hash_table_foreach(ht, qif_object_map_get_helper, &list);
-  g_hash_table_destroy(ht);
+    g_hash_table_foreach(ht, qif_object_map_get_helper, &list);
+    g_hash_table_destroy(ht);
 
-  return list;
+    return list;
 }
 
 static void
 qif_get_accts_helper(gpointer obj, gpointer htp)
 {
-  QifTxn txn = obj;
-  QifSplit split;
-  GHashTable *ht = htp;
-  GList *node;
+    QifTxn txn = obj;
+    QifSplit split;
+    GHashTable *ht = htp;
+    GList *node;
 
-  if (txn->from_acct)
-    g_hash_table_insert(ht, txn->from_acct, txn->from_acct);
+    if (txn->from_acct)
+        g_hash_table_insert(ht, txn->from_acct, txn->from_acct);
 
-  /* The default_split is using the from_acct, so we can ignore it */
+    /* The default_split is using the from_acct, so we can ignore it */
 
-  for (node = txn->splits; node; node = node->next) {
-    split = node->data;
-    if (split->cat.obj && split->cat_is_acct)
-      g_hash_table_insert(ht, split->cat.acct, split->cat.acct);
-  }
+    for (node = txn->splits; node; node = node->next)
+    {
+        split = node->data;
+        if (split->cat.obj && split->cat_is_acct)
+            g_hash_table_insert(ht, split->cat.acct, split->cat.acct);
+    }
 }
 
 GList *
 qif_context_get_accounts(QifContext ctx)
 {
-  return qif_context_get_foo_helper(ctx, qif_get_accts_helper);
+    return qif_context_get_foo_helper(ctx, qif_get_accts_helper);
 }
 
 static void
 qif_get_cats_helper(gpointer obj, gpointer htp)
 {
-  QifTxn txn = obj;
-  QifSplit split;
-  GHashTable *ht = htp;
-  GList *node;
+    QifTxn txn = obj;
+    QifSplit split;
+    GHashTable *ht = htp;
+    GList *node;
 
-  /* default_split uses from_acct, so no categories */
+    /* default_split uses from_acct, so no categories */
 
-  for (node = txn->splits; node; node = node->next) {
-    split = node->data;
-    if (split->cat.obj && !split->cat_is_acct)
-      g_hash_table_insert(ht, split->cat.cat, split->cat.cat);
-  }
+    for (node = txn->splits; node; node = node->next)
+    {
+        split = node->data;
+        if (split->cat.obj && !split->cat_is_acct)
+            g_hash_table_insert(ht, split->cat.cat, split->cat.cat);
+    }
 }
 
 GList *
 qif_context_get_categories(QifContext ctx)
 {
-  return qif_context_get_foo_helper(ctx, qif_get_cats_helper);
+    return qif_context_get_foo_helper(ctx, qif_get_cats_helper);
 }
 
 /*****************************************************************************/
@@ -161,84 +165,85 @@
 gint
 qif_object_map_count(QifContext ctx, const char *type)
 {
-  GHashTable *ht;
+    GHashTable *ht;
 
-  g_return_val_if_fail(ctx, 0);
-  g_return_val_if_fail(ctx->object_maps, 0);
-  g_return_val_if_fail(type, 0);
+    g_return_val_if_fail(ctx, 0);
+    g_return_val_if_fail(ctx->object_maps, 0);
+    g_return_val_if_fail(type, 0);
 
-  ht = g_hash_table_lookup(ctx->object_maps, type);
-  if (!ht)
-    return 0;
+    ht = g_hash_table_lookup(ctx->object_maps, type);
+    if (!ht)
+        return 0;
 
-  return g_hash_table_size(ht);
+    return g_hash_table_size(ht);
 }
 
 void
 qif_object_map_foreach(QifContext ctx, const char *type, GHFunc func, gpointer arg)
 {
-  GHashTable *ht;
+    GHashTable *ht;
 
-  g_return_if_fail(ctx);
-  g_return_if_fail(ctx->object_maps);
-  g_return_if_fail(type);
+    g_return_if_fail(ctx);
+    g_return_if_fail(ctx->object_maps);
+    g_return_if_fail(type);
 
-  ht = g_hash_table_lookup(ctx->object_maps, type);
-  if (ht)
-    g_hash_table_foreach(ht, func, arg);
+    ht = g_hash_table_lookup(ctx->object_maps, type);
+    if (ht)
+        g_hash_table_foreach(ht, func, arg);
 }
 
 void
 qif_object_map_insert(QifContext ctx, const char *key, QifObject obj)
 {
-  GHashTable *ht;
+    GHashTable *ht;
 
-  g_return_if_fail(ctx);
-  g_return_if_fail(ctx->object_maps);
-  g_return_if_fail(key);
-  g_return_if_fail(obj);
-  g_return_if_fail(obj->type);
+    g_return_if_fail(ctx);
+    g_return_if_fail(ctx->object_maps);
+    g_return_if_fail(key);
+    g_return_if_fail(obj);
+    g_return_if_fail(obj->type);
 
-  ht = g_hash_table_lookup(ctx->object_maps, obj->type);
-  if (!ht) {
-    ht = g_hash_table_new(g_str_hash, g_str_equal);
-    g_assert(ht);
-    g_hash_table_insert(ctx->object_maps, (gpointer)obj->type, ht);
-  }
+    ht = g_hash_table_lookup(ctx->object_maps, obj->type);
+    if (!ht)
+    {
+        ht = g_hash_table_new(g_str_hash, g_str_equal);
+        g_assert(ht);
+        g_hash_table_insert(ctx->object_maps, (gpointer)obj->type, ht);
+    }
 
-  g_hash_table_insert(ht, (gpointer)key, obj);
+    g_hash_table_insert(ht, (gpointer)key, obj);
 }
 
 void
 qif_object_map_remove(QifContext ctx, const char *type, const char *key)
 {
-  GHashTable *ht;
+    GHashTable *ht;
 
-  g_return_if_fail(ctx);
-  g_return_if_fail(ctx->object_maps);
-  g_return_if_fail(type);
-  g_return_if_fail(key);
+    g_return_if_fail(ctx);
+    g_return_if_fail(ctx->object_maps);
+    g_return_if_fail(type);
+    g_return_if_fail(key);
 
-  ht = g_hash_table_lookup(ctx->object_maps, type);
-  if (!ht) return;
+    ht = g_hash_table_lookup(ctx->object_maps, type);
+    if (!ht) return;
 
-  g_hash_table_remove(ht, key);
+    g_hash_table_remove(ht, key);
 }
 
 QifObject
 qif_object_map_lookup(QifContext ctx, const char *type, const char *key)
 {
-  GHashTable *ht;
+    GHashTable *ht;
 
-  g_return_val_if_fail(ctx, NULL);
-  g_return_val_if_fail(ctx->object_maps, NULL);
-  g_return_val_if_fail(type, NULL);
-  g_return_val_if_fail(key, NULL);
+    g_return_val_if_fail(ctx, NULL);
+    g_return_val_if_fail(ctx->object_maps, NULL);
+    g_return_val_if_fail(type, NULL);
+    g_return_val_if_fail(key, NULL);
 
-  ht = g_hash_table_lookup(ctx->object_maps, type);
-  if (!ht) return NULL;
+    ht = g_hash_table_lookup(ctx->object_maps, type);
+    if (!ht) return NULL;
 
-  return g_hash_table_lookup(ht, key);
+    return g_hash_table_lookup(ht, key);
 }
 
 /* This GList _SHOULD_ be freed by the caller */
@@ -246,56 +251,56 @@
 static void
 qif_object_map_get_helper(gpointer key, gpointer value, gpointer arg)
 {
-  GList **listp = arg;
-  g_return_if_fail(listp);
+    GList **listp = arg;
+    g_return_if_fail(listp);
 
-  *listp = g_list_prepend(*listp, value);
+    *listp = g_list_prepend(*listp, value);
 }
 
 GList *
 qif_object_map_get(QifContext ctx, const char *type)
 {
-  GHashTable *ht;
-  GList *list = NULL;
+    GHashTable *ht;
+    GList *list = NULL;
 
-  g_return_val_if_fail(ctx, NULL);
-  g_return_val_if_fail(ctx->object_maps, NULL);
-  g_return_val_if_fail(type, NULL);
+    g_return_val_if_fail(ctx, NULL);
+    g_return_val_if_fail(ctx->object_maps, NULL);
+    g_return_val_if_fail(type, NULL);
 
-  ht = g_hash_table_lookup(ctx->object_maps, type);
-  if (!ht)
-    return NULL;
+    ht = g_hash_table_lookup(ctx->object_maps, type);
+    if (!ht)
+        return NULL;
 
-  g_hash_table_foreach(ht, qif_object_map_get_helper, &list);
+    g_hash_table_foreach(ht, qif_object_map_get_helper, &list);
 
-  return list;
+    return list;
 }
 
 static gboolean
 qif_object_map_remove_each(gpointer key, gpointer value, gpointer arg)
 {
-  QifObject obj = value;
-  obj->destroy(obj);
-  return TRUE;
+    QifObject obj = value;
+    obj->destroy(obj);
+    return TRUE;
 }
 
 static gboolean
 qif_object_map_remove_all(gpointer key, gpointer value, gpointer arg)
 {
-  GHashTable *ht = value;
+    GHashTable *ht = value;
 
-  g_hash_table_foreach_remove(ht, qif_object_map_remove_each, NULL);
-  g_hash_table_destroy(ht);
-  return TRUE;
+    g_hash_table_foreach_remove(ht, qif_object_map_remove_each, NULL);
+    g_hash_table_destroy(ht);
+    return TRUE;
 }
 
 void qif_object_map_destroy(QifContext ctx)
 {
-  g_return_if_fail(ctx);
-  g_return_if_fail(ctx->object_maps);
+    g_return_if_fail(ctx);
+    g_return_if_fail(ctx->object_maps);
 
-  g_hash_table_foreach_remove(ctx->object_maps, qif_object_map_remove_all, NULL);
-  g_hash_table_destroy(ctx->object_maps);
+    g_hash_table_foreach_remove(ctx->object_maps, qif_object_map_remove_all, NULL);
+    g_hash_table_destroy(ctx->object_maps);
 }
 
 /*****************************************************************************/
@@ -307,105 +312,106 @@
 void
 qif_object_list_reverse(QifContext ctx, const char *type)
 {
-  GList *list;
+    GList *list;
 
-  g_return_if_fail(ctx);
-  g_return_if_fail(ctx->object_lists);
-  g_return_if_fail(type);
+    g_return_if_fail(ctx);
+    g_return_if_fail(ctx->object_lists);
+    g_return_if_fail(type);
 
-  list = qif_object_list_get(ctx, type);
-  list = g_list_reverse(list);
-  g_hash_table_insert(ctx->object_lists, (gpointer)type, list);
+    list = qif_object_list_get(ctx, type);
+    list = g_list_reverse(list);
+    g_hash_table_insert(ctx->object_lists, (gpointer)type, list);
 }
 
 gint
 qif_object_list_count(QifContext ctx, const char *type)
 {
-  GList *list;
+    GList *list;
 
-  g_return_val_if_fail(ctx, 0);
-  g_return_val_if_fail(ctx->object_lists, 0);
-  g_return_val_if_fail(type, 0);
+    g_return_val_if_fail(ctx, 0);
+    g_return_val_if_fail(ctx->object_lists, 0);
+    g_return_val_if_fail(type, 0);
 
-  list = g_hash_table_lookup(ctx->object_lists, type);
-  return g_list_length(list);
+    list = g_hash_table_lookup(ctx->object_lists, type);
+    return g_list_length(list);
 }
 
 void
 qif_object_list_foreach(QifContext ctx, const char *type, GFunc func, gpointer arg)
 {
-  GList *list;
+    GList *list;
 
-  g_return_if_fail(ctx);
-  g_return_if_fail(ctx->object_lists);
-  g_return_if_fail(type);
+    g_return_if_fail(ctx);
+    g_return_if_fail(ctx->object_lists);
+    g_return_if_fail(type);
 
-  list = qif_object_list_get(ctx, type);
-  g_list_foreach(list, func, arg);
+    list = qif_object_list_get(ctx, type);
+    g_list_foreach(list, func, arg);
 }
 
 void
 qif_object_list_insert(QifContext ctx, QifObject obj)
 {
-  GList *list;
+    GList *list;
 
-  g_return_if_fail(ctx);
-  g_return_if_fail(ctx->object_lists);
-  g_return_if_fail(obj);
-  g_return_if_fail(obj->type && *obj->type);
+    g_return_if_fail(ctx);
+    g_return_if_fail(ctx->object_lists);
+    g_return_if_fail(obj);
+    g_return_if_fail(obj->type && *obj->type);
 
-  list = g_hash_table_lookup(ctx->object_lists, obj->type);
-  list = g_list_prepend(list, obj);
-  g_hash_table_insert(ctx->object_lists, (gpointer)obj->type, list);
+    list = g_hash_table_lookup(ctx->object_lists, obj->type);
+    list = g_list_prepend(list, obj);
+    g_hash_table_insert(ctx->object_lists, (gpointer)obj->type, list);
 }
 
 void
 qif_object_list_remove(QifContext ctx, QifObject obj)
 {
-  GList *list;
+    GList *list;
 
-  g_return_if_fail(ctx);
-  g_return_if_fail(ctx->object_lists);
-  g_return_if_fail(obj);
-  g_return_if_fail(obj->type && *obj->type);
+    g_return_if_fail(ctx);
+    g_return_if_fail(ctx->object_lists);
+    g_return_if_fail(obj);
+    g_return_if_fail(obj->type && *obj->type);
 
-  list = g_hash_table_lookup(ctx->object_lists, obj->type);
-  list = g_list_remove(list, obj);
-  g_hash_table_insert(ctx->object_lists, (gpointer)obj->type, list);
+    list = g_hash_table_lookup(ctx->object_lists, obj->type);
+    list = g_list_remove(list, obj);
+    g_hash_table_insert(ctx->object_lists, (gpointer)obj->type, list);
 }
 
 GList *
 qif_object_list_get(QifContext ctx, const char *type)
 {
-  g_return_val_if_fail(ctx, NULL);
-  g_return_val_if_fail(ctx->object_lists, NULL);
-  g_return_val_if_fail(type, NULL);
+    g_return_val_if_fail(ctx, NULL);
+    g_return_val_if_fail(ctx->object_lists, NULL);
+    g_return_val_if_fail(type, NULL);
 
-  return g_hash_table_lookup(ctx->object_lists, type);
+    return g_hash_table_lookup(ctx->object_lists, type);
 }
 
 static gboolean
 qif_object_list_remove_all(gpointer key, gpointer value, gpointer arg)
 {
-  GList *list = value;
-  GList *node;
-  QifObject obj;
+    GList *list = value;
+    GList *node;
+    QifObject obj;
 
-  for (node = list; node; node = node->next) {
-    obj = node->data;
-    obj->destroy(obj);
-  }
+    for (node = list; node; node = node->next)
+    {
+        obj = node->data;
+        obj->destroy(obj);
+    }
 
-  g_list_free(list);
-  return TRUE;
+    g_list_free(list);
+    return TRUE;
 }
 
 void
 qif_object_list_destroy(QifContext ctx)
 {
-  g_return_if_fail(ctx);
-  g_return_if_fail(ctx->object_lists);
+    g_return_if_fail(ctx);
+    g_return_if_fail(ctx->object_lists);
 
-  g_hash_table_foreach_remove(ctx->object_lists, qif_object_list_remove_all, NULL);
-  g_hash_table_destroy(ctx->object_lists);
+    g_hash_table_foreach_remove(ctx->object_lists, qif_object_list_remove_all, NULL);
+    g_hash_table_destroy(ctx->object_lists);
 }

Modified: gnucash/trunk/src/import-export/qif/qif-defaults.c
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-defaults.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-defaults.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -48,105 +48,105 @@
 static void
 acct_type_init(void)
 {
-  stock_list = qif_parse_acct_type("__stock__", -1);
-  ext_stock_list = qif_parse_acct_type("__extstock__", -1);
-  income_list = qif_parse_acct_type("__income__", -1);
-  expense_list = qif_parse_acct_type("__expense__", -1);
-  equity_list = qif_parse_acct_type("__equity__", -1);
+    stock_list = qif_parse_acct_type("__stock__", -1);
+    ext_stock_list = qif_parse_acct_type("__extstock__", -1);
+    income_list = qif_parse_acct_type("__income__", -1);
+    expense_list = qif_parse_acct_type("__expense__", -1);
+    equity_list = qif_parse_acct_type("__equity__", -1);
 }
 
 QifAccount qif_default_equity_acct(QifContext ctx)
 {
-  char *name = g_strdup(_("Retained Earnings"));
-  RETURN_ACCT(ctx, name, equity_list);
+    char *name = g_strdup(_("Retained Earnings"));
+    RETURN_ACCT(ctx, name, equity_list);
 }
 
 QifAccount qif_default_margin_interest_acct(QifContext ctx)
 {
-  char *name = g_strdup_printf("%s%s%s", _("Margin Interest"),
-			       gnc_get_account_separator_string(),
-			       ctx->current_acct->name);
-  RETURN_ACCT(ctx, name, expense_list);
+    char *name = g_strdup_printf("%s%s%s", _("Margin Interest"),
+                                 gnc_get_account_separator_string(),
+                                 ctx->current_acct->name);
+    RETURN_ACCT(ctx, name, expense_list);
 }
 
 QifAccount qif_default_commission_acct(QifContext ctx)
 {
-  char *name = g_strdup_printf("%s%s%s", _("Commissions"),
-			       gnc_get_account_separator_string(),
-			       ctx->current_acct->name);
-  RETURN_ACCT(ctx, name, expense_list);
+    char *name = g_strdup_printf("%s%s%s", _("Commissions"),
+                                 gnc_get_account_separator_string(),
+                                 ctx->current_acct->name);
+    RETURN_ACCT(ctx, name, expense_list);
 }
 
 QifAccount qif_default_stock_acct(QifContext ctx, const char *security)
 {
-  char *name = g_strdup_printf("%s%s%s", ctx->current_acct->name,
-			       gnc_get_account_separator_string(),
-			       security);
-  RETURN_ACCT(ctx, name, stock_list);
+    char *name = g_strdup_printf("%s%s%s", ctx->current_acct->name,
+                                 gnc_get_account_separator_string(),
+                                 security);
+    RETURN_ACCT(ctx, name, stock_list);
 }
 
 QifAccount qif_default_cglong_acct(QifContext ctx, const char *security)
 {
-  char *name = g_strdup_printf("%s%s%s%s%s", _("Cap. gain (long)"),
-			       gnc_get_account_separator_string(),
-			       ctx->current_acct->name,
-			       gnc_get_account_separator_string(),
-			       security);
-  RETURN_ACCT(ctx, name, income_list);
+    char *name = g_strdup_printf("%s%s%s%s%s", _("Cap. gain (long)"),
+                                 gnc_get_account_separator_string(),
+                                 ctx->current_acct->name,
+                                 gnc_get_account_separator_string(),
+                                 security);
+    RETURN_ACCT(ctx, name, income_list);
 }
 
 QifAccount qif_default_cgmid_acct(QifContext ctx, const char *security)
 {
-  char *name = g_strdup_printf("%s%s%s%s%s", _("Cap. gain (mid)"),
-			       gnc_get_account_separator_string(),
-			       ctx->current_acct->name,
-			       gnc_get_account_separator_string(),
-			       security);
-  RETURN_ACCT(ctx, name, income_list);
+    char *name = g_strdup_printf("%s%s%s%s%s", _("Cap. gain (mid)"),
+                                 gnc_get_account_separator_string(),
+                                 ctx->current_acct->name,
+                                 gnc_get_account_separator_string(),
+                                 security);
+    RETURN_ACCT(ctx, name, income_list);
 }
 
 QifAccount qif_default_cgshort_acct(QifContext ctx, const char *security)
 {
-  char *name = g_strdup_printf("%s%s%s%s%s", _("Cap. gain (short)"),
-			       gnc_get_account_separator_string(),
-			       ctx->current_acct->name,
-			       gnc_get_account_separator_string(),
-			       security);
-  RETURN_ACCT(ctx, name, income_list);
+    char *name = g_strdup_printf("%s%s%s%s%s", _("Cap. gain (short)"),
+                                 gnc_get_account_separator_string(),
+                                 ctx->current_acct->name,
+                                 gnc_get_account_separator_string(),
+                                 security);
+    RETURN_ACCT(ctx, name, income_list);
 }
 
 QifAccount qif_default_dividend_acct(QifContext ctx, const char *security)
 {
-  char *name = g_strdup_printf("%s%s%s%s%s", _("Dividends"),
-			       gnc_get_account_separator_string(),
-			       ctx->current_acct->name,
-			       gnc_get_account_separator_string(),
-			       security);
-  RETURN_ACCT(ctx, name, income_list);
+    char *name = g_strdup_printf("%s%s%s%s%s", _("Dividends"),
+                                 gnc_get_account_separator_string(),
+                                 ctx->current_acct->name,
+                                 gnc_get_account_separator_string(),
+                                 security);
+    RETURN_ACCT(ctx, name, income_list);
 }
 
 QifAccount qif_default_interest_acct(QifContext ctx, const char *security)
 {
-  char *name = g_strdup_printf("%s%s%s%s%s", _("Interest"),
-			       gnc_get_account_separator_string(),
-			       ctx->current_acct->name,
-			       gnc_get_account_separator_string(),
-			       security);
-  RETURN_ACCT(ctx, name, income_list);
+    char *name = g_strdup_printf("%s%s%s%s%s", _("Interest"),
+                                 gnc_get_account_separator_string(),
+                                 ctx->current_acct->name,
+                                 gnc_get_account_separator_string(),
+                                 security);
+    RETURN_ACCT(ctx, name, income_list);
 }
 
 QifAccount qif_default_capital_return_acct(QifContext ctx, const char *security)
 {
-  char *name = g_strdup_printf("%s%s%s%s%s", _("Cap Return"),
-			       gnc_get_account_separator_string(),
-			       ctx->current_acct->name,
-			       gnc_get_account_separator_string(),
-			       security);
-  RETURN_ACCT(ctx, name, income_list);
+    char *name = g_strdup_printf("%s%s%s%s%s", _("Cap Return"),
+                                 gnc_get_account_separator_string(),
+                                 ctx->current_acct->name,
+                                 gnc_get_account_separator_string(),
+                                 security);
+    RETURN_ACCT(ctx, name, income_list);
 }
 
 QifAccount qif_default_equity_holding(QifContext ctx, const char *security)
 {
-  return qif_default_equity_acct(ctx);
+    return qif_default_equity_acct(ctx);
 }
 

Modified: gnucash/trunk/src/import-export/qif/qif-file.c
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-file.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-file.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -42,30 +42,31 @@
 static QifLine
 qif_make_line(const char* buf, gint lineno)
 {
-  QifLine line;
-  g_return_val_if_fail(buf && *buf, NULL);
-  
-  line = g_new0(struct _QifLine, 1);
-  line->type = *buf;
-  line->lineno = lineno;
-  line->line = g_strdup(buf+1);
+    QifLine line;
+    g_return_val_if_fail(buf && *buf, NULL);
 
-  return line;
+    line = g_new0(struct _QifLine, 1);
+    line->type = *buf;
+    line->lineno = lineno;
+    line->line = g_strdup(buf + 1);
+
+    return line;
 }
 
 void
 qif_record_destroy(GList *record)
 {
-  GList *node;
-  QifLine line;
+    GList *node;
+    QifLine line;
 
-  for (node = record; node; node = node->next) {
-    line = node->data;
-    g_free(line->line);
-    g_free(line);
-  }
+    for (node = record; node; node = node->next)
+    {
+        line = node->data;
+        g_free(line->line);
+        g_free(line);
+    }
 
-  g_list_free(record);
+    g_list_free(record);
 }
 
 /* This returns a record, which is a bunch of QifLines, ending
@@ -76,61 +77,65 @@
 static GList *
 qif_make_record(QifContext ctx, char *buf, size_t bufsiz, gboolean *found_bangtype)
 {
-  GList *record = NULL;
-  QifLine line;
+    GList *record = NULL;
+    QifLine line;
 
-  g_return_val_if_fail(ctx, NULL);
-  g_return_val_if_fail(buf, NULL);
-  g_return_val_if_fail(found_bangtype, NULL);
+    g_return_val_if_fail(ctx, NULL);
+    g_return_val_if_fail(buf, NULL);
+    g_return_val_if_fail(found_bangtype, NULL);
 
-  *found_bangtype = FALSE;
+    *found_bangtype = FALSE;
 
-  while (fgets(buf, bufsiz, ctx->fp) != NULL) {
+    while (fgets(buf, bufsiz, ctx->fp) != NULL)
+    {
 
-    /* increment the line number */
-    ctx->lineno++;
+        /* increment the line number */
+        ctx->lineno++;
 
-    /* strip start/end whitespace */
-    g_strstrip(buf);
+        /* strip start/end whitespace */
+        g_strstrip(buf);
 
-    /* if there is nothing left in the string, ignore it */
-    if (strlen(buf) == 0)
-      continue;
+        /* if there is nothing left in the string, ignore it */
+        if (strlen(buf) == 0)
+            continue;
 
-    /* If this is a bangline, then set the flag, clear our state, and return NULL */
-    if (*buf == '!') {
-      *found_bangtype = TRUE;
-      break;
-    }
+        /* If this is a bangline, then set the flag, clear our state, and return NULL */
+        if (*buf == '!')
+        {
+            *found_bangtype = TRUE;
+            break;
+        }
 
-    /* See if this is an End of Record marker */
-    if (*buf == '^') {
-      /* Yep.  If we've got a record then break and return ... */
-      if (record)
-	break;
-      /* ... otherwise just continue reading (i.e. ignore empty records) */
-      else
-	continue;
-    }
+        /* See if this is an End of Record marker */
+        if (*buf == '^')
+        {
+            /* Yep.  If we've got a record then break and return ... */
+            if (record)
+                break;
+            /* ... otherwise just continue reading (i.e. ignore empty records) */
+            else
+                continue;
+        }
 
-    /* otherwise, add the line to the list */
-    line = qif_make_line(buf, ctx->lineno);
-    if (line)
-      record = g_list_prepend(record, line);
+        /* otherwise, add the line to the list */
+        line = qif_make_line(buf, ctx->lineno);
+        if (line)
+            record = g_list_prepend(record, line);
 
-    /* and continue... */
-  }
+        /* and continue... */
+    }
 
-  /* If we found a bangtype, destroy anything we've collected */
-  if (*found_bangtype) {
-    if (record)
-      PERR("error loading file: incomplete record at line %d", ctx->lineno);
+    /* If we found a bangtype, destroy anything we've collected */
+    if (*found_bangtype)
+    {
+        if (record)
+            PERR("error loading file: incomplete record at line %d", ctx->lineno);
 
-    qif_record_destroy(record);
-    record = NULL;
-  }
+        qif_record_destroy(record);
+        record = NULL;
+    }
 
-  return g_list_reverse(record);
+    return g_list_reverse(record);
 }
 
 /* read a qif file and parse it, line by line
@@ -139,173 +144,183 @@
 static QifError
 qif_read_file(QifContext ctx, FILE *f)
 {
-  char buf[BUFSIZ];
-  GList *record;
-  gboolean found_bang;
-  QifError err = QIF_E_OK;
+    char buf[BUFSIZ];
+    GList *record;
+    gboolean found_bang;
+    QifError err = QIF_E_OK;
 
-  g_return_val_if_fail(ctx, QIF_E_BADARGS);
-  g_return_val_if_fail(f, QIF_E_BADARGS);
+    g_return_val_if_fail(ctx, QIF_E_BADARGS);
+    g_return_val_if_fail(f, QIF_E_BADARGS);
 
-  ctx->fp = f;
-  ctx->lineno = -1;
+    ctx->fp = f;
+    ctx->lineno = -1;
 
-  do {
-    found_bang = FALSE;
-    record = qif_make_record(ctx, buf, sizeof(buf), &found_bang);
+    do
+    {
+        found_bang = FALSE;
+        record = qif_make_record(ctx, buf, sizeof(buf), &found_bang);
 
-    /* If we got a record, process it */
-    if (record) {
-      if (!ctx->handler || !ctx->handler->parse_record) {
-	PERR("Trying to process QIF record without a handler at %d", ctx->lineno);
-      } else {
-	err = ctx->handler->parse_record(ctx, record);
-      }
+        /* If we got a record, process it */
+        if (record)
+        {
+            if (!ctx->handler || !ctx->handler->parse_record)
+            {
+                PERR("Trying to process QIF record without a handler at %d", ctx->lineno);
+            }
+            else
+            {
+                err = ctx->handler->parse_record(ctx, record);
+            }
 
-      /* Now destroy it; we don't need it anymore */
-      qif_record_destroy(record);
-    }
+            /* Now destroy it; we don't need it anymore */
+            qif_record_destroy(record);
+        }
 
-    /* if we found a bangtype, process that */
-    if (found_bang) {
-      g_assert(*buf == '!');
+        /* if we found a bangtype, process that */
+        if (found_bang)
+        {
+            g_assert(*buf == '!');
 
-      /* First, process the end of the last handler.  This could possibly
-       * merge items into the context or perform some other operation
-       */
-      if (ctx->handler && ctx->handler->end) {
-	err = ctx->handler->end(ctx);
-	if (err != QIF_E_OK)
-	  break;
-      }
+            /* First, process the end of the last handler.  This could possibly
+             * merge items into the context or perform some other operation
+             */
+            if (ctx->handler && ctx->handler->end)
+            {
+                err = ctx->handler->end(ctx);
+                if (err != QIF_E_OK)
+                    break;
+            }
 
-      /* Now process the bangtype (stored in buf) to set the new handler */
-      qif_parse_bangtype(ctx, buf);
+            /* Now process the bangtype (stored in buf) to set the new handler */
+            qif_parse_bangtype(ctx, buf);
+        }
+
     }
+    while ((record || found_bang) && err == QIF_E_OK);
 
-  } while ((record || found_bang) && err == QIF_E_OK);
+    /* Make sure to run any end processor */
+    if (err == QIF_E_OK && ctx->handler && ctx->handler->end)
+        err = ctx->handler->end(ctx);
 
-  /* Make sure to run any end processor */
-  if (err == QIF_E_OK && ctx->handler && ctx->handler->end)
-    err = ctx->handler->end(ctx);
+    if (err == QIF_E_OK)
+        qif_object_list_reverse(ctx, QIF_O_TXN);
 
-  if (err == QIF_E_OK)
-    qif_object_list_reverse(ctx, QIF_O_TXN);
-
-  return err;
+    return err;
 }
 
 static QifError
 qif_import_file(QifContext ctx, const char *filename)
 {
-  QifError err;
-  FILE *fp;
+    QifError err;
+    FILE *fp;
 
-  g_return_val_if_fail(ctx, QIF_E_BADARGS);
-  g_return_val_if_fail(filename, QIF_E_BADARGS);
-  g_return_val_if_fail(*filename, QIF_E_BADARGS);
+    g_return_val_if_fail(ctx, QIF_E_BADARGS);
+    g_return_val_if_fail(filename, QIF_E_BADARGS);
+    g_return_val_if_fail(*filename, QIF_E_BADARGS);
 
-  /* Open the file */
-  fp = g_fopen(filename, "r");
-  if (fp == NULL)
-    return QIF_E_NOFILE;
+    /* Open the file */
+    fp = g_fopen(filename, "r");
+    if (fp == NULL)
+        return QIF_E_NOFILE;
 
-  ctx->filename = g_strdup(filename);
+    ctx->filename = g_strdup(filename);
 
-  /* read the file */
-  err = qif_read_file(ctx, fp);
+    /* read the file */
+    err = qif_read_file(ctx, fp);
 
-  /* close the file */
-  fclose(fp);
+    /* close the file */
+    fclose(fp);
 
-  return err;
+    return err;
 }
 
 
 QifContext
 qif_file_new(QifContext ctx, const char *filename)
 {
-  QifContext fctx;
+    QifContext fctx;
 
-  g_return_val_if_fail(ctx, NULL);
-  g_return_val_if_fail(filename, NULL);
+    g_return_val_if_fail(ctx, NULL);
+    g_return_val_if_fail(filename, NULL);
 
-  fctx = qif_context_new();
+    fctx = qif_context_new();
 
-  /* we should assume that we've got a bank account... just in case.. */
-  qif_parse_bangtype(fctx, "!type:bank");
+    /* we should assume that we've got a bank account... just in case.. */
+    qif_parse_bangtype(fctx, "!type:bank");
 
-  /* Open the file */
-  if (qif_import_file(fctx, filename) != QIF_E_OK) {
-    qif_context_destroy(fctx);
-    fctx = NULL;
-  }
+    /* Open the file */
+    if (qif_import_file(fctx, filename) != QIF_E_OK)
+    {
+        qif_context_destroy(fctx);
+        fctx = NULL;
+    }
 
-  /* Return the new context */
-  if (fctx) {
-    ctx->files = g_list_prepend(ctx->files, fctx);
-    fctx->parent = ctx;
+    /* Return the new context */
+    if (fctx)
+    {
+        ctx->files = g_list_prepend(ctx->files, fctx);
+        fctx->parent = ctx;
 
-    /* Make sure the file gets merged into the parent */
-    ctx->parsed = FALSE;
-  }
+        /* Make sure the file gets merged into the parent */
+        ctx->parsed = FALSE;
+    }
 
-  return fctx;
+    return fctx;
 }
 
 QifError
 qif_file_parse(QifContext ctx, gpointer ui_args)
 {
-  g_return_val_if_fail(ctx, QIF_E_BADARGS);
-  g_return_val_if_fail(!qif_file_needs_account(ctx), QIF_E_BADSTATE);
+    g_return_val_if_fail(ctx, QIF_E_BADARGS);
+    g_return_val_if_fail(!qif_file_needs_account(ctx), QIF_E_BADSTATE);
 
-  qif_parse_all(ctx, ui_args);
-  ctx->parsed = TRUE;
+    qif_parse_all(ctx, ui_args);
+    ctx->parsed = TRUE;
 
-  return QIF_E_OK;
+    return QIF_E_OK;
 }
 
 gboolean
 qif_file_needs_account(QifContext ctx)
 {
-  g_return_val_if_fail(ctx, FALSE);
+    g_return_val_if_fail(ctx, FALSE);
 
-  return ((ctx->parse_flags & QIF_F_TXN_NEEDS_ACCT) ||
-	  (ctx->parse_flags & QIF_F_ITXN_NEEDS_ACCT));
+    return ((ctx->parse_flags & QIF_F_TXN_NEEDS_ACCT) ||
+            (ctx->parse_flags & QIF_F_ITXN_NEEDS_ACCT));
 }
 
 const char *
 qif_file_filename(QifContext ctx)
 {
-  g_return_val_if_fail(ctx, NULL);
-  return ctx->filename;
+    g_return_val_if_fail(ctx, NULL);
+    return ctx->filename;
 }
 
 static void
 set_txn_acct(gpointer obj, gpointer arg)
 {
-  QifTxn txn = obj;
-  QifAccount acct = arg;
+    QifTxn txn = obj;
+    QifAccount acct = arg;
 
-  if (!txn->from_acct)
-    txn->from_acct = acct;
+    if (!txn->from_acct)
+        txn->from_acct = acct;
 }
 
 void
 qif_file_set_default_account(QifContext ctx, const char *acct_name)
 {
-  QifAccount acct;
+    QifAccount acct;
 
-  g_return_if_fail(ctx);
-  g_return_if_fail(acct_name);
+    g_return_if_fail(ctx);
+    g_return_if_fail(acct_name);
 
-  if (! qif_file_needs_account(ctx)) return;
+    if (! qif_file_needs_account(ctx)) return;
 
-  acct = find_or_make_acct(ctx, g_strdup(acct_name),
-			   qif_parse_acct_type_guess(ctx->parse_type));
+    acct = find_or_make_acct(ctx, g_strdup(acct_name),
+                             qif_parse_acct_type_guess(ctx->parse_type));
 
-  qif_object_list_foreach(ctx, QIF_O_TXN, set_txn_acct, acct);
+    qif_object_list_foreach(ctx, QIF_O_TXN, set_txn_acct, acct);
 
-  qif_clear_flag(ctx->parse_flags, QIF_F_TXN_NEEDS_ACCT);
-  qif_clear_flag(ctx->parse_flags, QIF_F_ITXN_NEEDS_ACCT);
+    qif_clear_flag(ctx->parse_flags, QIF_F_TXN_NEEDS_ACCT);
+    qif_clear_flag(ctx->parse_flags, QIF_F_ITXN_NEEDS_ACCT);
 }

Modified: gnucash/trunk/src/import-export/qif/qif-file.h
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-file.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-file.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,10 +24,11 @@
 #ifndef QIF_FILE_H
 #define QIF_FILE_H
 
-struct _QifLine {
-  char		type;
-  gint		lineno;
-  char *	line;
+struct _QifLine
+{
+    char		type;
+    gint		lineno;
+    char *	line;
 };
 
 void qif_record_destroy(GList *record);

Modified: gnucash/trunk/src/import-export/qif/qif-import-p.h
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-import-p.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-import-p.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -31,48 +31,50 @@
 
 #include <stdio.h>
 
-struct _QifHandler {
-  void		(*init)(QifContext ctx);
-  QifError	(*parse_record)(QifContext ctx, GList *record);
-  QifError	(*end)(QifContext ctx);
+struct _QifHandler
+{
+    void		(*init)(QifContext ctx);
+    QifError	(*parse_record)(QifContext ctx, GList *record);
+    QifError	(*end)(QifContext ctx);
 };
 
-struct _QifContext {
-  /* The parent context */
-  QifContext	parent;
+struct _QifContext
+{
+    /* The parent context */
+    QifContext	parent;
 
-  /* file information */
-  char *	filename;
-  FILE *	fp;
-  gint		lineno;
+    /* file information */
+    char *	filename;
+    FILE *	fp;
+    gint		lineno;
 
-  /* This describes what we are parsing right now */
-  QifType	parse_type;
-  QifHandler	handler;
-  gpointer	parse_state;
+    /* This describes what we are parsing right now */
+    QifType	parse_type;
+    QifHandler	handler;
+    gpointer	parse_state;
 
-  /* A bunch of flags for the current handler */
-  gint		parse_flags;
-  gboolean	parsed;
+    /* A bunch of flags for the current handler */
+    gint		parse_flags;
+    gboolean	parsed;
 
-  /* The current and "opening balance" account */
-  QifAccount	current_acct;
-  QifAccount	opening_bal_acct;
+    /* The current and "opening balance" account */
+    QifAccount	current_acct;
+    QifAccount	opening_bal_acct;
 
-  /* HashTable of Maps of data objects */
-  GHashTable *	object_maps;
+    /* HashTable of Maps of data objects */
+    GHashTable *	object_maps;
 
-  /* HashTable of Lists of data objects */
-  GHashTable *	object_lists;
+    /* HashTable of Lists of data objects */
+    GHashTable *	object_lists;
 
-  /* List of files */
-  GList *files;
+    /* List of files */
+    GList *files;
 };
 
 /* Object Maps */
 gint qif_object_map_count(QifContext ctx, const char *type);
 void qif_object_map_foreach(QifContext ctx, const char *type,
-			    GHFunc func, gpointer arg);
+                            GHFunc func, gpointer arg);
 void qif_object_map_insert(QifContext ctx, const char *key, QifObject obj);
 void qif_object_map_remove(QifContext ctx, const char *type, const char *key);
 QifObject qif_object_map_lookup(QifContext ctx, const char *type, const char *key);
@@ -84,7 +86,7 @@
 void qif_object_list_reverse(QifContext ctx, const char *type);
 gint qif_object_list_count(QifContext ctx, const char *type);
 void qif_object_list_foreach(QifContext ctx, const char *type,
-			     GFunc func, gpointer arg);
+                             GFunc func, gpointer arg);
 void qif_object_list_insert(QifContext ctx, QifObject obj);
 void qif_object_list_remove(QifContext ctx, QifObject obj);
 void qif_object_list_destroy(QifContext ctx);

Modified: gnucash/trunk/src/import-export/qif/qif-import.h
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-import.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-import.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -28,20 +28,21 @@
 #include <stdio.h>
 #include "qof.h"
 
-typedef enum {
-  QIF_TYPE_BANK = 1,
-  QIF_TYPE_CASH,
-  QIF_TYPE_CCARD,
-  QIF_TYPE_INVST,
-  QIF_TYPE_PORT,
-  QIF_TYPE_OTH_A,
-  QIF_TYPE_OTH_L,
-  QIF_TYPE_CLASS,
-  QIF_TYPE_CAT,
-  QIF_TYPE_SECURITY,
-  QIF_ACCOUNT,
-  QIF_AUTOSWITCH,
-  QIF_CLEAR_AUTOSWITCH
+typedef enum
+{
+    QIF_TYPE_BANK = 1,
+    QIF_TYPE_CASH,
+    QIF_TYPE_CCARD,
+    QIF_TYPE_INVST,
+    QIF_TYPE_PORT,
+    QIF_TYPE_OTH_A,
+    QIF_TYPE_OTH_L,
+    QIF_TYPE_CLASS,
+    QIF_TYPE_CAT,
+    QIF_TYPE_SECURITY,
+    QIF_ACCOUNT,
+    QIF_AUTOSWITCH,
+    QIF_CLEAR_AUTOSWITCH
 } QifType;
 
 /* Make sure this patches */
@@ -57,66 +58,69 @@
 #define QIF_F_ITXN_NEEDS_ACCT	(1 << 2)
 
 /* Qif Reconciled Flag */
-typedef enum {
-  QIF_R_NO = 0,
-  QIF_R_CLEARED,
-  QIF_R_RECONCILED,
-  QIF_R_BUDGETED,
+typedef enum
+{
+    QIF_R_NO = 0,
+    QIF_R_CLEARED,
+    QIF_R_RECONCILED,
+    QIF_R_BUDGETED,
 } QifRecnFlag;
 
 /* Qif Errors */
 
-typedef enum {
-  QIF_E_OK = 0,
-  QIF_E_INTERNAL,
-  QIF_E_BADSTATE,
-  QIF_E_BADARGS,
-  QIF_E_NOFILE,
+typedef enum
+{
+    QIF_E_OK = 0,
+    QIF_E_INTERNAL,
+    QIF_E_BADSTATE,
+    QIF_E_BADARGS,
+    QIF_E_NOFILE,
 } QifError;
 
 
 /* Qif (investment?) Actions */
-typedef enum {
-  QIF_A_NONE = 0,
-  QIF_A_BUY,
-  QIF_A_BUYX,
-  QIF_A_CGLONG,
-  QIF_A_CGLONGX,
-  QIF_A_CGMID,
-  QIF_A_CGMIDX,
-  QIF_A_CGSHORT,
-  QIF_A_CGSHORTX,
-  QIF_A_DIV,
-  QIF_A_DIVX,
-  QIF_A_EXERCISE,
-  QIF_A_EXERCISEX,
-  QIF_A_EXPIRE,
-  QIF_A_GRANT,
-  QIF_A_INTINC,
-  QIF_A_INTINCX,
-  QIF_A_MARGINT,
-  QIF_A_MARGINTX,
-  QIF_A_MISCEXP,
-  QIF_A_MISCEXPX,
-  QIF_A_MISCINC,
-  QIF_A_MISCINCX,
-  QIF_A_REINVDIV,
-  QIF_A_REINVINT,
-  QIF_A_REINVLG,
-  QIF_A_REINVMD,
-  QIF_A_REINVSG,
-  QIF_A_REINVSH,
-  QIF_A_REMINDER,
-  QIF_A_RTRNCAP,
-  QIF_A_RTRNCAPX,
-  QIF_A_SELL,
-  QIF_A_SELLX,
-  QIF_A_SHRSIN,
-  QIF_A_SHRSOUT,
-  QIF_A_STKSPLIT,
-  QIF_A_VEST,
-  QIF_A_XIN,
-  QIF_A_XOUT,
+typedef enum
+{
+    QIF_A_NONE = 0,
+    QIF_A_BUY,
+    QIF_A_BUYX,
+    QIF_A_CGLONG,
+    QIF_A_CGLONGX,
+    QIF_A_CGMID,
+    QIF_A_CGMIDX,
+    QIF_A_CGSHORT,
+    QIF_A_CGSHORTX,
+    QIF_A_DIV,
+    QIF_A_DIVX,
+    QIF_A_EXERCISE,
+    QIF_A_EXERCISEX,
+    QIF_A_EXPIRE,
+    QIF_A_GRANT,
+    QIF_A_INTINC,
+    QIF_A_INTINCX,
+    QIF_A_MARGINT,
+    QIF_A_MARGINTX,
+    QIF_A_MISCEXP,
+    QIF_A_MISCEXPX,
+    QIF_A_MISCINC,
+    QIF_A_MISCINCX,
+    QIF_A_REINVDIV,
+    QIF_A_REINVINT,
+    QIF_A_REINVLG,
+    QIF_A_REINVMD,
+    QIF_A_REINVSG,
+    QIF_A_REINVSH,
+    QIF_A_REMINDER,
+    QIF_A_RTRNCAP,
+    QIF_A_RTRNCAPX,
+    QIF_A_SELL,
+    QIF_A_SELLX,
+    QIF_A_SHRSIN,
+    QIF_A_SHRSOUT,
+    QIF_A_STKSPLIT,
+    QIF_A_VEST,
+    QIF_A_XIN,
+    QIF_A_XOUT,
 } QifAction;
 
 /* Public API Functions */

Modified: gnucash/trunk/src/import-export/qif/qif-objects-p.h
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-objects-p.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-objects-p.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -30,132 +30,141 @@
 #include "qif-import.h"
 #include "qif-objects.h"
 
-struct _QifAccount {
-  struct _QifObject obj;
+struct _QifAccount
+{
+    struct _QifObject obj;
 
-  char *	name;
-  char *	desc;
+    char *	name;
+    char *	desc;
 
-  char *	limitstr;
-  gnc_numeric	limit;
+    char *	limitstr;
+    gnc_numeric	limit;
 
-  char *	budgetstr;
-  gnc_numeric	budget;
+    char *	budgetstr;
+    gnc_numeric	budget;
 
-  GList *	type_list;
+    GList *	type_list;
 
 };
 
-struct _QifCategory {
-  struct _QifObject obj;
+struct _QifCategory
+{
+    struct _QifObject obj;
 
-  char *	name;
-  char *	desc;
-  char *	taxclass;
+    char *	name;
+    char *	desc;
+    char *	taxclass;
 
-  gboolean	taxable;
-  gboolean	expense;
-  gboolean	income;
+    gboolean	taxable;
+    gboolean	expense;
+    gboolean	income;
 
-  char *	budgetstr;
-  gnc_numeric	budget;
+    char *	budgetstr;
+    gnc_numeric	budget;
 
 };
 
-struct _QifClass {
-  struct _QifObject obj;
+struct _QifClass
+{
+    struct _QifObject obj;
 
-  char *	name;
-  char *	desc;
-  char *	taxdesig;
+    char *	name;
+    char *	desc;
+    char *	taxdesig;
 
 };
 
-struct _QifSecurity {
-  struct _QifObject obj;
+struct _QifSecurity
+{
+    struct _QifObject obj;
 
-  char *	name;
-  char *	symbol;
-  char *	type;
+    char *	name;
+    char *	symbol;
+    char *	type;
 
 };
 
-struct _QifTxn {
-  struct _QifObject obj;
+struct _QifTxn
+{
+    struct _QifObject obj;
 
-  QifType	txn_type;
+    QifType	txn_type;
 
-  char *	datestr;
-  Timespec	date;
+    char *	datestr;
+    Timespec	date;
 
-  char *	payee;
-  char *	address;
-  char *	num;
+    char *	payee;
+    char *	address;
+    char *	num;
 
-  QifRecnFlag	cleared;
+    QifRecnFlag	cleared;
 
-  /* Investment info */
-  QifInvstTxn	invst_info;
+    /* Investment info */
+    QifInvstTxn	invst_info;
 
-  /* The default_split is the default (forward) part of the QIF transaction */
-  QifSplit	default_split;
+    /* The default_split is the default (forward) part of the QIF transaction */
+    QifSplit	default_split;
 
-  /* The current_split (if any) defines the current "qif split" we are handling */
-  QifSplit	current_split;
+    /* The current_split (if any) defines the current "qif split" we are handling */
+    QifSplit	current_split;
 
-  /* The "from" account */
-  QifAccount	from_acct;
+    /* The "from" account */
+    QifAccount	from_acct;
 
-  /* The list of splits for this txn */
-  GList *	splits;
+    /* The list of splits for this txn */
+    GList *	splits;
 
 };
 
-struct _QifSplit {
-  char *	memo;
+struct _QifSplit
+{
+    char *	memo;
 
-  char *	amountstr;
-  gnc_numeric	amount;
-  gnc_numeric	value;
+    char *	amountstr;
+    gnc_numeric	amount;
+    gnc_numeric	value;
 
-  char *	catstr;
+    char *	catstr;
 
-  /* parsed category/account info */
+    /* parsed category/account info */
 
-  union {
-    QifObject	obj;
-    QifCategory	cat;
-    QifAccount	acct;
-  } cat;
-  gboolean	cat_is_acct;
-  QifClass	cat_class;
+    union
+    {
+        QifObject	obj;
+        QifCategory	cat;
+        QifAccount	acct;
+    } cat;
+    gboolean	cat_is_acct;
+    QifClass	cat_class;
 
 };
 
-struct _QifInvstTxn {
-  QifAction	action;
+struct _QifInvstTxn
+{
+    QifAction	action;
 
-  gnc_numeric	amount;
-  gnc_numeric	d_amount;
-  gnc_numeric	price;
-  gnc_numeric	shares;
-  gnc_numeric	commission;
+    gnc_numeric	amount;
+    gnc_numeric	d_amount;
+    gnc_numeric	price;
+    gnc_numeric	shares;
+    gnc_numeric	commission;
 
-  char *	amountstr;
-  char *	d_amountstr;
-  char *	pricestr;
-  char *	sharesstr;
-  char *	commissionstr;
+    char *	amountstr;
+    char *	d_amountstr;
+    char *	pricestr;
+    char *	sharesstr;
+    char *	commissionstr;
 
-  char *	security;
-  char *	catstr;
+    char *	security;
+    char *	catstr;
 
-  union {
-    QifObject	obj;
-    QifCategory	cat;
-    QifAccount	acct;
-  } far_cat;
-  gboolean	far_cat_is_acct;
+    union
+    {
+        QifObject	obj;
+        QifCategory	cat;
+        QifAccount	acct;
+    } far_cat;
+    gboolean	far_cat_is_acct;
 };
 
 /* to be run after parsing all the dates and amounts */

Modified: gnucash/trunk/src/import-export/qif/qif-objects.c
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-objects.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-objects.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -65,30 +65,30 @@
 static void
 qif_account_destroy(QifObject obj)
 {
-  QifAccount acct = (QifAccount) obj;
+    QifAccount acct = (QifAccount) obj;
 
-  g_free(acct->name);
-  g_free(acct->desc);
-  g_free(acct->limitstr);
-  g_free(acct->budgetstr);
+    g_free(acct->name);
+    g_free(acct->desc);
+    g_free(acct->limitstr);
+    g_free(acct->budgetstr);
 
-  g_free(acct);
+    g_free(acct);
 };
 
 static QifAccount
 qif_account_new(void)
 {
-  QifObject obj;
-  QifAccount acct;
+    QifObject obj;
+    QifAccount acct;
 
-  obj = qif_object_new(struct _QifAccount, QIF_O_ACCOUNT, qif_account_destroy);
+    obj = qif_object_new(struct _QifAccount, QIF_O_ACCOUNT, qif_account_destroy);
 
-  acct = (QifAccount)obj;
-  acct->type_list = qif_parse_acct_type("bank", -1);
+    acct = (QifAccount)obj;
+    acct->type_list = qif_parse_acct_type("bank", -1);
 
-  acct->limit = gnc_numeric_zero();
-  acct->budget = gnc_numeric_zero();
-  return acct;
+    acct->limit = gnc_numeric_zero();
+    acct->budget = gnc_numeric_zero();
+    return acct;
 }
 
 /*
@@ -100,105 +100,110 @@
 QifAccount
 qif_account_merge(QifContext ctx, QifAccount acct)
 {
-  QifAccount acct2 = 
-    (QifAccount)qif_object_map_lookup(ctx, acct->obj.type, acct->name);
+    QifAccount acct2 =
+        (QifAccount)qif_object_map_lookup(ctx, acct->obj.type, acct->name);
 
-  if (!acct2) {
-    qif_object_map_insert(ctx, acct->obj.type, (QifObject)acct);
-    return acct;
-  }
+    if (!acct2)
+    {
+        qif_object_map_insert(ctx, acct->obj.type, (QifObject)acct);
+        return acct;
+    }
 
-  /* obviously the name is the same, so don't worry about that */
+    /* obviously the name is the same, so don't worry about that */
 
-  if (!acct2->desc && acct->desc)
-    acct2->desc = g_strdup(acct->desc);
+    if (!acct2->desc && acct->desc)
+        acct2->desc = g_strdup(acct->desc);
 
-  if (!acct2->type_list && acct->type_list)
-    acct2->type_list = acct->type_list;
+    if (!acct2->type_list && acct->type_list)
+        acct2->type_list = acct->type_list;
 
-  if (!acct2->limitstr && acct->limitstr) {
-    acct2->limitstr = g_strdup(acct->limitstr);
-    acct2->limit = acct->limit;
-  }
+    if (!acct2->limitstr && acct->limitstr)
+    {
+        acct2->limitstr = g_strdup(acct->limitstr);
+        acct2->limit = acct->limit;
+    }
 
-  if (!acct2->budgetstr && acct->budgetstr) {
-    acct2->budgetstr = g_strdup(acct->budgetstr);
-    acct2->budget = acct->budget;
-  }
+    if (!acct2->budgetstr && acct->budgetstr)
+    {
+        acct2->budgetstr = g_strdup(acct->budgetstr);
+        acct2->budget = acct->budget;
+    }
 
-  return acct2;
+    return acct2;
 }
 
 static QifError
 qif_account_parse(QifContext ctx, GList *record)
 {
-  QifAccount acct, temp;
-  QifLine line;
+    QifAccount acct, temp;
+    QifLine line;
 
-  g_return_val_if_fail(ctx, QIF_E_INTERNAL);
-  g_return_val_if_fail(record, QIF_E_BADSTATE);
+    g_return_val_if_fail(ctx, QIF_E_INTERNAL);
+    g_return_val_if_fail(record, QIF_E_BADSTATE);
 
-  acct = qif_account_new();
+    acct = qif_account_new();
 
-  for (; record; record = record->next) {
-    line = record->data;
+    for (; record; record = record->next)
+    {
+        line = record->data;
 
-    switch (line->type) {
-    case 'N':			/* N : account name */
-      qif_save_str(acct->name);
-      break;
-    case 'D': 			/* D : account description */
-      qif_save_str(acct->desc);
-      break;
-    case 'T':			/* T : account type */
-      acct->type_list = qif_parse_acct_type(line->line, line->lineno);
-      break;
-    case 'L':			/* L : account limit */
-      qif_save_str(acct->limitstr);
-      break;
-    case 'B':			/* B : account budget */
-      qif_save_str(acct->budgetstr);
-      break;
-    default:
-      PERR("Unknown QIF account data at line %d: %s", line->lineno, line->line);
+        switch (line->type)
+        {
+        case 'N':			/* N : account name */
+            qif_save_str(acct->name);
+            break;
+        case 'D': 			/* D : account description */
+            qif_save_str(acct->desc);
+            break;
+        case 'T':			/* T : account type */
+            acct->type_list = qif_parse_acct_type(line->line, line->lineno);
+            break;
+        case 'L':			/* L : account limit */
+            qif_save_str(acct->limitstr);
+            break;
+        case 'B':			/* B : account budget */
+            qif_save_str(acct->budgetstr);
+            break;
+        default:
+            PERR("Unknown QIF account data at line %d: %s", line->lineno, line->line);
+        }
     }
-  }
 
-  /* Merge the account into the context */
-  temp = qif_account_merge(ctx, acct);
-  if (! (ctx->parse_flags & QIF_F_IGNORE_ACCOUNTS))
-    ctx->current_acct = temp;
-  if (temp != acct)
-    qif_account_destroy((QifObject)acct);
+    /* Merge the account into the context */
+    temp = qif_account_merge(ctx, acct);
+    if (! (ctx->parse_flags & QIF_F_IGNORE_ACCOUNTS))
+        ctx->current_acct = temp;
+    if (temp != acct)
+        qif_account_destroy((QifObject)acct);
 
-  return QIF_E_OK;
+    return QIF_E_OK;
 }
 
 /* QIF Category */
 static void
 qif_cat_destroy(QifObject obj)
 {
-  QifCategory cat = (QifCategory) obj;
+    QifCategory cat = (QifCategory) obj;
 
-  g_free(cat->name);
-  g_free(cat->desc);
-  g_free(cat->taxclass);
-  g_free(cat->budgetstr);
+    g_free(cat->name);
+    g_free(cat->desc);
+    g_free(cat->taxclass);
+    g_free(cat->budgetstr);
 
-  g_free(cat);
+    g_free(cat);
 }
 
 static QifCategory
 qif_cat_new(void)
 {
-  QifObject obj;
-  QifCategory cat;
+    QifObject obj;
+    QifCategory cat;
 
-  obj = qif_object_new(struct _QifCategory, QIF_O_CATEGORY, qif_cat_destroy);
-  cat = (QifCategory)obj;
-  cat->budget = gnc_numeric_zero();
+    obj = qif_object_new(struct _QifCategory, QIF_O_CATEGORY, qif_cat_destroy);
+    cat = (QifCategory)obj;
+    cat->budget = gnc_numeric_zero();
 
-  return cat;
+    return cat;
 }
 
 /*
@@ -210,102 +215,106 @@
 QifCategory
 qif_cat_merge(QifContext ctx, QifCategory cat)
 {
-  QifCategory cat2 = 
-    (QifCategory)qif_object_map_lookup(ctx, cat->obj.type, cat->name);
+    QifCategory cat2 =
+        (QifCategory)qif_object_map_lookup(ctx, cat->obj.type, cat->name);
 
-  if (!cat2) {
-    qif_object_map_insert(ctx, cat->obj.type, (QifObject)cat);
-    return cat;
-  }
+    if (!cat2)
+    {
+        qif_object_map_insert(ctx, cat->obj.type, (QifObject)cat);
+        return cat;
+    }
 
-  /* obviously the name is the same, so don't worry about that */
+    /* obviously the name is the same, so don't worry about that */
 
-  if (!cat2->desc && cat->desc)
-    cat2->desc = g_strdup(cat->desc);
+    if (!cat2->desc && cat->desc)
+        cat2->desc = g_strdup(cat->desc);
 
-  if (!cat2->taxclass && cat->taxclass)
-    cat2->taxclass = g_strdup(cat->taxclass);
+    if (!cat2->taxclass && cat->taxclass)
+        cat2->taxclass = g_strdup(cat->taxclass);
 
-  cat2->taxable = (cat2->taxable || cat->taxable);
-  cat2->expense = (cat2->expense || cat->expense);
-  cat2->income = (cat2->income || cat->income);
+    cat2->taxable = (cat2->taxable || cat->taxable);
+    cat2->expense = (cat2->expense || cat->expense);
+    cat2->income = (cat2->income || cat->income);
 
-  if (!cat2->budgetstr && cat->budgetstr) {
-    cat2->budgetstr = g_strdup(cat->budgetstr);
-    cat2->budget = cat->budget;
-  }
+    if (!cat2->budgetstr && cat->budgetstr)
+    {
+        cat2->budgetstr = g_strdup(cat->budgetstr);
+        cat2->budget = cat->budget;
+    }
 
-  return cat2;
+    return cat2;
 }
 
 static QifError
 qif_cat_parse(QifContext ctx, GList *record)
 {
-  QifCategory cat;
-  QifLine line;
+    QifCategory cat;
+    QifLine line;
 
-  g_return_val_if_fail(ctx, QIF_E_INTERNAL);
-  g_return_val_if_fail(record, QIF_E_BADSTATE);
+    g_return_val_if_fail(ctx, QIF_E_INTERNAL);
+    g_return_val_if_fail(record, QIF_E_BADSTATE);
 
-  cat = qif_cat_new();
+    cat = qif_cat_new();
 
-  for (; record; record = record->next) {
-    line = record->data;
+    for (; record; record = record->next)
+    {
+        line = record->data;
 
-    switch (line->type) {
-    case 'N':			/* N : category name */
-      qif_save_str(cat->name);
-      break;
-    case 'D':			/* D : category description */
-      qif_save_str(cat->desc);
-      break;
-    case 'T':			/* T : category is taxable? */
-      cat->taxable = TRUE;
-      break;
-    case 'E':			/* E : category is expense? */
-      cat->expense = TRUE;
-      break;
-    case 'I':			/* I : category is income? */
-      cat->income = TRUE;
-      break;
-    case 'R':			/* R : category taxclass XXX */
-      /* XXX: a number? */
-      qif_save_str(cat->taxclass);
-      break;
-    case 'B':			/* B : category budget */
-      qif_save_str(cat->budgetstr);
-      break;
-    default:
-      PERR("Unknown QIF category data at line %d: %s", line->lineno, line->line);
+        switch (line->type)
+        {
+        case 'N':			/* N : category name */
+            qif_save_str(cat->name);
+            break;
+        case 'D':			/* D : category description */
+            qif_save_str(cat->desc);
+            break;
+        case 'T':			/* T : category is taxable? */
+            cat->taxable = TRUE;
+            break;
+        case 'E':			/* E : category is expense? */
+            cat->expense = TRUE;
+            break;
+        case 'I':			/* I : category is income? */
+            cat->income = TRUE;
+            break;
+        case 'R':			/* R : category taxclass XXX */
+            /* XXX: a number? */
+            qif_save_str(cat->taxclass);
+            break;
+        case 'B':			/* B : category budget */
+            qif_save_str(cat->budgetstr);
+            break;
+        default:
+            PERR("Unknown QIF category data at line %d: %s", line->lineno, line->line);
+        }
     }
-  }
 
-  if (qif_cat_merge(ctx, cat) != cat)
-    qif_cat_destroy((QifObject)cat);
+    if (qif_cat_merge(ctx, cat) != cat)
+        qif_cat_destroy((QifObject)cat);
 
-  return QIF_E_OK;
+    return QIF_E_OK;
 }
 
 /* QIF Class */
 static void
 qif_class_destroy(QifObject obj)
 {
-  QifClass qclass = (QifClass) obj;
+    QifClass qclass = (QifClass) obj;
 
-  g_free(qclass->name);
-  g_free(qclass->desc);
-  g_free(qclass->taxdesig);
+    g_free(qclass->name);
+    g_free(qclass->desc);
+    g_free(qclass->taxdesig);
 
-  g_free(qclass);
+    g_free(qclass);
 }
 
 static QifClass
 qif_class_new()
 {
-  QifObject obj;
+    QifObject obj;
 
-  obj = qif_object_new(struct _QifClass, QIF_O_CLASS, qif_class_destroy);
-  return (QifClass)obj;
+    obj = qif_object_new(struct _QifClass, QIF_O_CLASS, qif_class_destroy);
+    return (QifClass)obj;
 }
 
 /*
@@ -317,80 +326,83 @@
 QifClass
 qif_class_merge(QifContext ctx, QifClass qclass)
 {
-  QifClass qclass2 = 
-    (QifClass)qif_object_map_lookup(ctx, qclass->obj.type, qclass->name);
+    QifClass qclass2 =
+        (QifClass)qif_object_map_lookup(ctx, qclass->obj.type, qclass->name);
 
-  if (!qclass2) {
-    qif_object_map_insert(ctx, qclass->obj.type, (QifObject)qclass);
-    return qclass;
-  }
+    if (!qclass2)
+    {
+        qif_object_map_insert(ctx, qclass->obj.type, (QifObject)qclass);
+        return qclass;
+    }
 
-  /* obviously the name is the same, so don't worry about that */
+    /* obviously the name is the same, so don't worry about that */
 
-  if (!qclass2->desc && qclass->desc)
-    qclass2->desc = g_strdup(qclass->desc);
+    if (!qclass2->desc && qclass->desc)
+        qclass2->desc = g_strdup(qclass->desc);
 
-  if (!qclass2->taxdesig && qclass->taxdesig)
-    qclass2->taxdesig = g_strdup(qclass->taxdesig);
+    if (!qclass2->taxdesig && qclass->taxdesig)
+        qclass2->taxdesig = g_strdup(qclass->taxdesig);
 
-  return qclass2;
+    return qclass2;
 }
 
 static QifError
 qif_class_parse(QifContext ctx, GList *record)
 {
-  QifClass qclass;
-  QifLine line;
+    QifClass qclass;
+    QifLine line;
 
-  g_return_val_if_fail(ctx, QIF_E_INTERNAL);
-  g_return_val_if_fail(record, QIF_E_BADSTATE);
+    g_return_val_if_fail(ctx, QIF_E_INTERNAL);
+    g_return_val_if_fail(record, QIF_E_BADSTATE);
 
-  qclass = qif_class_new();
+    qclass = qif_class_new();
 
-  for (; record; record = record->next) {
-    line = record->data;
+    for (; record; record = record->next)
+    {
+        line = record->data;
 
-    switch (line->type) {
-    case 'N':			/* N : class name */
-      qif_save_str(qclass->name);
-      break;
-    case 'D':			/* D : class description */
-      qif_save_str(qclass->desc);
-      break;
-    case 'R':			/* R : Tax designator */
-      qif_save_str(qclass->taxdesig);
-      break;
-    default:
-      PERR("Unknown QIF class data at line %d: %s", line->lineno, line->line);
+        switch (line->type)
+        {
+        case 'N':			/* N : class name */
+            qif_save_str(qclass->name);
+            break;
+        case 'D':			/* D : class description */
+            qif_save_str(qclass->desc);
+            break;
+        case 'R':			/* R : Tax designator */
+            qif_save_str(qclass->taxdesig);
+            break;
+        default:
+            PERR("Unknown QIF class data at line %d: %s", line->lineno, line->line);
+        }
     }
-  }
 
-  if (qif_class_merge(ctx, qclass) != qclass)
-    qif_class_destroy((QifObject)qclass);
+    if (qif_class_merge(ctx, qclass) != qclass)
+        qif_class_destroy((QifObject)qclass);
 
-  return QIF_E_OK;
+    return QIF_E_OK;
 }
 
 /* QIF Security Symbol */
 static void
 qif_security_destroy(QifObject obj)
 {
-  QifSecurity security = (QifSecurity) obj;
+    QifSecurity security = (QifSecurity) obj;
 
-  g_free(security->name);
-  g_free(security->symbol);
-  g_free(security->type);
+    g_free(security->name);
+    g_free(security->symbol);
+    g_free(security->type);
 
-  g_free(security);
+    g_free(security);
 }
 
 static QifSecurity
 qif_security_new()
 {
-  QifObject obj;
+    QifObject obj;
 
-  obj = qif_object_new(struct _QifSecurity, QIF_O_SECURITY, qif_security_destroy);
-  return (QifSecurity)obj;
+    obj = qif_object_new(struct _QifSecurity, QIF_O_SECURITY, qif_security_destroy);
+    return (QifSecurity)obj;
 }
 
 /*
@@ -402,58 +414,61 @@
 QifSecurity
 qif_security_merge(QifContext ctx, QifSecurity security)
 {
-  QifSecurity security2 = 
-    (QifSecurity)qif_object_map_lookup(ctx, security->obj.type, security->name);
+    QifSecurity security2 =
+        (QifSecurity)qif_object_map_lookup(ctx, security->obj.type, security->name);
 
-  if (!security2) {
-    qif_object_map_insert(ctx, security->obj.type, (QifObject)security);
-    return security;
-  }
+    if (!security2)
+    {
+        qif_object_map_insert(ctx, security->obj.type, (QifObject)security);
+        return security;
+    }
 
-  /* obviously the name is the same, so don't worry about that */
+    /* obviously the name is the same, so don't worry about that */
 
-  if (!security2->symbol && security->symbol)
-    security2->symbol = g_strdup(security->symbol);
+    if (!security2->symbol && security->symbol)
+        security2->symbol = g_strdup(security->symbol);
 
-  if (!security2->type && security->type)
-    security2->type = g_strdup(security->type);
+    if (!security2->type && security->type)
+        security2->type = g_strdup(security->type);
 
-  return security2;
+    return security2;
 }
 
 static QifError
 qif_security_parse(QifContext ctx, GList *record)
 {
-  QifSecurity security;
-  QifLine line;
+    QifSecurity security;
+    QifLine line;
 
-  g_return_val_if_fail(ctx, QIF_E_INTERNAL);
-  g_return_val_if_fail(record, QIF_E_BADSTATE);
+    g_return_val_if_fail(ctx, QIF_E_INTERNAL);
+    g_return_val_if_fail(record, QIF_E_BADSTATE);
 
-  security = qif_security_new();
+    security = qif_security_new();
 
-  for (; record; record = record->next) {
-    line = record->data;
+    for (; record; record = record->next)
+    {
+        line = record->data;
 
-    switch (line->type) {
-    case 'N':			/* N : security name */
-      qif_save_str(security->name);
-      break;
-    case 'S':			/* S : security symbol */
-      qif_save_str(security->symbol);
-      break;
-    case 'T':			/* T : security type */
-      qif_save_str(security->type);
-      break;
-    default:
-      PERR("Unknown QIF security data at line %d: %s", line->lineno, line->line);
+        switch (line->type)
+        {
+        case 'N':			/* N : security name */
+            qif_save_str(security->name);
+            break;
+        case 'S':			/* S : security symbol */
+            qif_save_str(security->symbol);
+            break;
+        case 'T':			/* T : security type */
+            qif_save_str(security->type);
+            break;
+        default:
+            PERR("Unknown QIF security data at line %d: %s", line->lineno, line->line);
+        }
     }
-  }
 
-  if (qif_security_merge(ctx, security) != security)
-    qif_security_destroy((QifObject)security);
+    if (qif_security_merge(ctx, security) != security)
+        qif_security_destroy((QifObject)security);
 
-  return QIF_E_OK;
+    return QIF_E_OK;
 }
 
 /********************* TXN *********************/
@@ -461,38 +476,38 @@
 static QifSplit
 qif_split_new()
 {
-  QifSplit split = g_new0(struct _QifSplit, 1);
+    QifSplit split = g_new0(struct _QifSplit, 1);
 
-  /* Initialize to 'zero' (even though they are not valid) */
-  split->amount = gnc_numeric_zero();
-  split->value = gnc_numeric_zero();
+    /* Initialize to 'zero' (even though they are not valid) */
+    split->amount = gnc_numeric_zero();
+    split->value = gnc_numeric_zero();
 
-  return split;
+    return split;
 }
 
 static void
 qif_split_destroy(QifSplit split)
 {
-  if (!split) return;
+    if (!split) return;
 
-  g_free(split->memo);
-  g_free(split->catstr);
-  g_free(split->amountstr);
+    g_free(split->memo);
+    g_free(split->catstr);
+    g_free(split->amountstr);
 
-  g_free(split);
+    g_free(split);
 }
 
 static QifSplit
 qif_split_copy(QifSplit split)
 {
-  QifSplit s = qif_split_new();
+    QifSplit s = qif_split_new();
 
-  memcpy(s, split, sizeof(*s));
-  if (s->memo) s->memo = g_strdup(s->memo);
-  if (s->amountstr) s->amountstr = g_strdup(s->amountstr);
-  if (s->catstr) s->memo = g_strdup(s->catstr);
+    memcpy(s, split, sizeof(*s));
+    if (s->memo) s->memo = g_strdup(s->memo);
+    if (s->amountstr) s->amountstr = g_strdup(s->amountstr);
+    if (s->catstr) s->memo = g_strdup(s->catstr);
 
-  return s;
+    return s;
 }
 
 /* Forward declarations */
@@ -503,102 +518,107 @@
 static void
 qif_split_parse_category(QifContext ctx, QifSplit split)
 {
-  char *cat = NULL;
-  char *cat_class = NULL;
-  char *miscx_cat = NULL;
-  char *miscx_class = NULL;
+    char *cat = NULL;
+    char *cat_class = NULL;
+    char *miscx_cat = NULL;
+    char *miscx_class = NULL;
 
-  gboolean miscx_is_acct;
+    gboolean miscx_is_acct;
 
-  static GList *types = NULL;
+    static GList *types = NULL;
 
-  g_return_if_fail(ctx);
-  g_return_if_fail(split);
-  g_return_if_fail(split->cat.cat == NULL && split->cat_class == NULL);
+    g_return_if_fail(ctx);
+    g_return_if_fail(split);
+    g_return_if_fail(split->cat.cat == NULL && split->cat_class == NULL);
 
-  if (qif_parse_split_category(split->catstr,
-			       &cat, &split->cat_is_acct, &cat_class,
-			       &miscx_cat, &miscx_is_acct, &miscx_class)) {
-    g_assert(cat);
+    if (qif_parse_split_category(split->catstr,
+                                 &cat, &split->cat_is_acct, &cat_class,
+                                 &miscx_cat, &miscx_is_acct, &miscx_class))
+    {
+        g_assert(cat);
 
-    if (split->cat_is_acct) {
-      if (types == NULL)
-	types = qif_parse_acct_type("__any_bank__", -1);
+        if (split->cat_is_acct)
+        {
+            if (types == NULL)
+                types = qif_parse_acct_type("__any_bank__", -1);
 
-      split->cat.acct = find_or_make_acct(ctx, cat, types);
+            split->cat.acct = find_or_make_acct(ctx, cat, types);
 
-    } else
-      split->cat.cat = find_or_make_cat(ctx, cat);
-    
-    if (cat_class)
-      split->cat_class = find_or_make_class(ctx, cat_class);
+        }
+        else
+            split->cat.cat = find_or_make_cat(ctx, cat);
 
-    /* miscx isn't used in a normal transaction, so just ignore it */
-    if (miscx_cat)
-      g_free(miscx_cat);
-    if (miscx_class)
-      g_free(miscx_class);
-    
-  } else
-    PERR("Problem parsing split category: %s", split->catstr);
+        if (cat_class)
+            split->cat_class = find_or_make_class(ctx, cat_class);
+
+        /* miscx isn't used in a normal transaction, so just ignore it */
+        if (miscx_cat)
+            g_free(miscx_cat);
+        if (miscx_class)
+            g_free(miscx_class);
+
+    }
+    else
+        PERR("Problem parsing split category: %s", split->catstr);
 }
 
 static void
 qif_txn_destroy(QifObject obj)
 {
-  QifTxn txn = (QifTxn) obj;
-  GList *node;
-  QifSplit split;
+    QifTxn txn = (QifTxn) obj;
+    GList *node;
+    QifSplit split;
 
-  g_free(txn->datestr);
-  g_free(txn->payee);
-  g_free(txn->address);
-  g_free(txn->num);
+    g_free(txn->datestr);
+    g_free(txn->payee);
+    g_free(txn->address);
+    g_free(txn->num);
 
-  if (txn->invst_info)
-    qif_txn_invst_destroy(txn->invst_info);
+    if (txn->invst_info)
+        qif_txn_invst_destroy(txn->invst_info);
 
-  for (node = txn->splits; node; node = node->next) {
-    split = node->data;
-    if (split == txn->default_split)
-      txn->default_split = NULL;
-    if (split == txn->current_split)
-      txn->current_split = NULL;
+    for (node = txn->splits; node; node = node->next)
+    {
+        split = node->data;
+        if (split == txn->default_split)
+            txn->default_split = NULL;
+        if (split == txn->current_split)
+            txn->current_split = NULL;
 
-    qif_split_destroy(split);
-  }
+        qif_split_destroy(split);
+    }
 
-  g_list_free(txn->splits);
-  qif_split_destroy(txn->default_split);
-  qif_split_destroy(txn->current_split);
+    g_list_free(txn->splits);
+    qif_split_destroy(txn->default_split);
+    qif_split_destroy(txn->current_split);
 
-  g_free(txn);    
+    g_free(txn);
 }
 
 static QifTxn
 qif_txn_new(void)
 {
-  QifObject obj;
-  QifTxn txn;
+    QifObject obj;
+    QifTxn txn;
 
-  obj = qif_object_new(struct _QifTxn, "qif-txn", qif_txn_destroy);
-  txn = (QifTxn) obj;
-  txn->default_split = qif_split_new();
+    obj = qif_object_new(struct _QifTxn, "qif-txn", qif_txn_destroy);
+    txn = (QifTxn) obj;
+    txn->default_split = qif_split_new();
 
-  return txn;
+    return txn;
 }
 
 static void
 qif_txn_init(QifContext ctx)
 {
-  qif_clear_flag(ctx->parse_flags, QIF_F_IGNORE_ACCOUNTS);
-  ctx->parse_state = NULL;
+    qif_clear_flag(ctx->parse_flags, QIF_F_IGNORE_ACCOUNTS);
+    ctx->parse_state = NULL;
 }
 
 static gboolean
 qif_is_bad_numeric_string(const char* line)
 {
-  return (strncmp(line, "...", 3) == 0);
+    return (strncmp(line, "...", 3) == 0);
 }
 
 /*
@@ -611,59 +631,63 @@
  * and some others use this transaction instead of an Account record
  * to specify "this" account (the from-account for all following
  * transactions), so we have to allow for that.
- * 
+ *
  * Even if the payee isn't "Opening Balance", we if we have no default
  * from-account by this time we need to set one.  In that case we set
  * the default account based on the file name.
- * 
- * If we DO know the account already, and this is a tranfer to it, 
- * it's also an opening balance regardless of the payee. 
  *
+ * If we DO know the account already, and this is a tranfer to it,
+ * it's also an opening balance regardless of the payee.
+ *
  * In the end make sure that the context 'current account' is set.
  */
 static void
 qif_process_opening_balance_txn(QifContext ctx, QifTxn txn)
 {
-  QifSplit split = txn->default_split;
-  QifAccount cur_acct = NULL;	/* We know that ctx->current_acct is NULL */
+    QifSplit split = txn->default_split;
+    QifAccount cur_acct = NULL;	/* We know that ctx->current_acct is NULL */
 
-  g_return_if_fail(txn->invst_info == NULL);
+    g_return_if_fail(txn->invst_info == NULL);
 
-  if ((!cur_acct && txn->payee &&
-       (!strcasecmp(txn->payee, "Opening Balance") ||
-	!strcasecmp(txn->payee, "Initial Balance")) && split->cat_is_acct) ||
-      (cur_acct &&
-       ((split->cat_is_acct && !strcasecmp(split->cat.acct->name, cur_acct->name))
-	||
-	(!split->cat_is_acct && !strcasecmp(split->cat.cat->name, cur_acct->name))))
-      ) {
+    if ((!cur_acct && txn->payee &&
+            (!strcasecmp(txn->payee, "Opening Balance") ||
+             !strcasecmp(txn->payee, "Initial Balance")) && split->cat_is_acct) ||
+            (cur_acct &&
+             ((split->cat_is_acct && !strcasecmp(split->cat.acct->name, cur_acct->name))
+              ||
+              (!split->cat_is_acct && !strcasecmp(split->cat.cat->name, cur_acct->name))))
+       )
+    {
 
-    /* This is an explicit "Opening Balance" transactions.  We need to
-     * change the "from account" to point to the equity account that
-     * the opening balance comes from...
-     */
-    if (split->cat_is_acct)
-      cur_acct = split->cat.acct;
-    else {
-      g_assert(split->cat.cat);
-      cur_acct = find_or_make_acct(ctx, g_strdup(split->cat.cat->name),
-				   qif_parse_acct_type_guess(txn->txn_type));
-      split->cat_is_acct = TRUE;
+        /* This is an explicit "Opening Balance" transactions.  We need to
+         * change the "from account" to point to the equity account that
+         * the opening balance comes from...
+         */
+        if (split->cat_is_acct)
+            cur_acct = split->cat.acct;
+        else
+        {
+            g_assert(split->cat.cat);
+            cur_acct = find_or_make_acct(ctx, g_strdup(split->cat.cat->name),
+                                         qif_parse_acct_type_guess(txn->txn_type));
+            split->cat_is_acct = TRUE;
+        }
+        split->cat.acct = qif_default_equity_acct(ctx);
     }
-    split->cat.acct = qif_default_equity_acct(ctx);
-  }
 
-  /*
-   * If we found an opening balance account then set up the context.
-   * If we didn't actually succeed in finding an account then
-   * set a flag so we can go back later and look for it.
-   */
+    /*
+     * If we found an opening balance account then set up the context.
+     * If we didn't actually succeed in finding an account then
+     * set a flag so we can go back later and look for it.
+     */
 
-  if (cur_acct) {
-    ctx->opening_bal_acct = cur_acct;
-    ctx->current_acct = cur_acct;
-  } else
-    qif_set_flag(ctx->parse_flags, QIF_F_TXN_NEEDS_ACCT);
+    if (cur_acct)
+    {
+        ctx->opening_bal_acct = cur_acct;
+        ctx->current_acct = cur_acct;
+    }
+    else
+        qif_set_flag(ctx->parse_flags, QIF_F_TXN_NEEDS_ACCT);
 }
 
 /* process all the splits in the transaction -- if this is a "split
@@ -675,171 +699,184 @@
 static void
 qif_txn_fix_amounts(QifTxn txn, gnc_numeric amount)
 {
-  gnc_numeric sum = amount;
-  QifSplit split;
-  GList *node;
+    gnc_numeric sum = amount;
+    QifSplit split;
+    GList *node;
 
-  g_return_if_fail(txn);
+    g_return_if_fail(txn);
 
-  /* No current_split, so this is NOT a split transaction. */
-  if (!txn->current_split) return;
+    /* No current_split, so this is NOT a split transaction. */
+    if (!txn->current_split) return;
 
-  /* Then add in every split in the split-list */
-  for (node = txn->splits; node; node = node->next) {
-    split = node->data;
-    sum = gnc_numeric_add(sum, split->amount, GNC_DENOM_AUTO, GNC_DENOM_LCD);
-  }
+    /* Then add in every split in the split-list */
+    for (node = txn->splits; node; node = node->next)
+    {
+        split = node->data;
+        sum = gnc_numeric_add(sum, split->amount, GNC_DENOM_AUTO, GNC_DENOM_LCD);
+    }
 
-  /* if the sum is not zero then reverse all the amounts in the split list */
-  if (!gnc_numeric_zero_p(sum))
-    for (node = txn->splits; node; node = node->next) {
-      split = node->data;
-      split->amount = gnc_numeric_neg(split->amount);
-    }
+    /* if the sum is not zero then reverse all the amounts in the split list */
+    if (!gnc_numeric_zero_p(sum))
+        for (node = txn->splits; node; node = node->next)
+        {
+            split = node->data;
+            split->amount = gnc_numeric_neg(split->amount);
+        }
 }
 
 static QifError
 qif_txn_parse(QifContext ctx, GList *record)
 {
-  QifTxn txn;
-  QifLine line;
-  GList *node;
-  QifSplit split;
+    QifTxn txn;
+    QifLine line;
+    GList *node;
+    QifSplit split;
 
-  g_return_val_if_fail(ctx, QIF_E_INTERNAL);
-  g_return_val_if_fail(record, QIF_E_BADSTATE);
+    g_return_val_if_fail(ctx, QIF_E_INTERNAL);
+    g_return_val_if_fail(record, QIF_E_BADSTATE);
 
-  txn = qif_txn_new();
-  txn->txn_type = ctx->parse_type;
+    txn = qif_txn_new();
+    txn->txn_type = ctx->parse_type;
 
-  for (; record; record = record->next) {
-    line = record->data;
+    for (; record; record = record->next)
+    {
+        line = record->data;
 
-    switch (line->type) {
-    case 'D':			/* D : transaction date */
-      qif_save_str(txn->datestr);
-      break;
-    case 'P':			/* P : payee */
-      qif_save_str(txn->payee);
-      break;
-    case 'A':			/* A : address */
-      /* multiple 'A' lines are appended together with newlines */
-      if (txn->address) {
-	char *tmp = txn->address;
-	txn->address = g_strconcat(tmp, "\n", line->line, NULL);
-	g_free(tmp);
-      } else
-	qif_save_str(txn->address);
-      break;
-    case 'N':			/* N : check/transaction number */
-      qif_save_str(txn->num);
-      break;
-    case 'C':			/* C : transaction cleared flag */
-      txn->cleared = qif_parse_cleared(line);
-      break;
-    case 'L':			/* L : default split category */
-      if (!txn->current_split) qif_save_str(txn->default_split->catstr);
-      break;
-    case 'M':			/* M : default split memo */
-      if (!txn->current_split) qif_save_str(txn->default_split->memo);
-      break;
-    case 'T':			/* T : total transaction amount */
-      if (!txn->current_split && !qif_is_bad_numeric_string(line->line))
-	qif_save_str(txn->default_split->amountstr);
-      break;
-    case 'S':			/* S : split category */
-      /* This implies a quicken-style "split transaction", so we're mostly
-       * going to ignore the default_split except for internal verification.
-       */
-      txn->current_split = qif_split_new();
-      txn->splits = g_list_prepend(txn->splits, txn->current_split);
-      qif_save_str(txn->current_split->catstr);
-      break;
-    case 'E':			/* E : split memo */
-      if (txn->current_split)
-	qif_save_str(txn->current_split->memo);
-      break;
-    case '$':			/* split amount */
-      if (txn->current_split && !qif_is_bad_numeric_string(line->line))
-	qif_save_str(txn->current_split->amountstr);
-      break;
-    default:
-      PERR("Unknown QIF transaction data at line %d: %s", line->lineno, line->line);
+        switch (line->type)
+        {
+        case 'D':			/* D : transaction date */
+            qif_save_str(txn->datestr);
+            break;
+        case 'P':			/* P : payee */
+            qif_save_str(txn->payee);
+            break;
+        case 'A':			/* A : address */
+            /* multiple 'A' lines are appended together with newlines */
+            if (txn->address)
+            {
+                char *tmp = txn->address;
+                txn->address = g_strconcat(tmp, "\n", line->line, NULL);
+                g_free(tmp);
+            }
+            else
+                qif_save_str(txn->address);
+            break;
+        case 'N':			/* N : check/transaction number */
+            qif_save_str(txn->num);
+            break;
+        case 'C':			/* C : transaction cleared flag */
+            txn->cleared = qif_parse_cleared(line);
+            break;
+        case 'L':			/* L : default split category */
+            if (!txn->current_split) qif_save_str(txn->default_split->catstr);
+            break;
+        case 'M':			/* M : default split memo */
+            if (!txn->current_split) qif_save_str(txn->default_split->memo);
+            break;
+        case 'T':			/* T : total transaction amount */
+            if (!txn->current_split && !qif_is_bad_numeric_string(line->line))
+                qif_save_str(txn->default_split->amountstr);
+            break;
+        case 'S':			/* S : split category */
+            /* This implies a quicken-style "split transaction", so we're mostly
+             * going to ignore the default_split except for internal verification.
+             */
+            txn->current_split = qif_split_new();
+            txn->splits = g_list_prepend(txn->splits, txn->current_split);
+            qif_save_str(txn->current_split->catstr);
+            break;
+        case 'E':			/* E : split memo */
+            if (txn->current_split)
+                qif_save_str(txn->current_split->memo);
+            break;
+        case '$':			/* split amount */
+            if (txn->current_split && !qif_is_bad_numeric_string(line->line))
+                qif_save_str(txn->current_split->amountstr);
+            break;
+        default:
+            PERR("Unknown QIF transaction data at line %d: %s", line->lineno, line->line);
+        }
     }
-  }
 
-  /* If we have no date string then there is no reason to do anything else */
-  if (txn->datestr) {
-    /* We delay processing the date and amount strings until later.. */
+    /* If we have no date string then there is no reason to do anything else */
+    if (txn->datestr)
+    {
+        /* We delay processing the date and amount strings until later.. */
 
-    /* parse the category on each split */
-    for (node = txn->splits; node; node = node->next) {
-      split = node->data;
-      if (split->catstr)
-	qif_split_parse_category(ctx, split);
-    }
-    /* ... including the default split */
-    if (txn->default_split->catstr)
-      qif_split_parse_category(ctx, txn->default_split);
+        /* parse the category on each split */
+        for (node = txn->splits; node; node = node->next)
+        {
+            split = node->data;
+            if (split->catstr)
+                qif_split_parse_category(ctx, split);
+        }
+        /* ... including the default split */
+        if (txn->default_split->catstr)
+            qif_split_parse_category(ctx, txn->default_split);
 
-    /* if we don't have an account, then deal with the opening balance */
-    if (!ctx->current_acct)
-      qif_process_opening_balance_txn(ctx, txn);
+        /* if we don't have an account, then deal with the opening balance */
+        if (!ctx->current_acct)
+            qif_process_opening_balance_txn(ctx, txn);
 
-    /* Set the transaction's from account */
-    txn->from_acct = ctx->current_acct;
+        /* Set the transaction's from account */
+        txn->from_acct = ctx->current_acct;
 
-    /* And add it to the process list */
-    ctx->parse_state = g_list_prepend(ctx->parse_state, txn);
+        /* And add it to the process list */
+        ctx->parse_state = g_list_prepend(ctx->parse_state, txn);
 
-  } else
-    /* no date?  Ignore this txn */
-    qif_txn_destroy((QifObject)txn);
+    }
+    else
+        /* no date?  Ignore this txn */
+        qif_txn_destroy((QifObject)txn);
 
-  return QIF_E_OK;
+    return QIF_E_OK;
 }
 
 /* after we parse the amounts, fix up the transaction splits */
 void
 qif_txn_setup_splits(QifTxn txn)
 {
-  QifSplit split, this_split;
-  GList *node;
-  gnc_numeric total;
+    QifSplit split, this_split;
+    GList *node;
+    gnc_numeric total;
 
-  if (txn->splits) {
-    /* We have a bunch of "far" splits -- maybe fix up the totals.. */
-    qif_txn_fix_amounts(txn, txn->default_split->amount);
-    
-    /* Re-Compute the total for the "near" (default) split */
-    total = gnc_numeric_zero();
-    for (node = txn->splits; node; node = node->next) {
-      split = node->data;
-      split->value = split->amount;
-      total = gnc_numeric_add(total, split->amount, 0, GNC_DENOM_LCD);
-    }
+    if (txn->splits)
+    {
+        /* We have a bunch of "far" splits -- maybe fix up the totals.. */
+        qif_txn_fix_amounts(txn, txn->default_split->amount);
 
-    /* And re-set the default-split amount */
-    txn->default_split->amount = gnc_numeric_neg(total);
+        /* Re-Compute the total for the "near" (default) split */
+        total = gnc_numeric_zero();
+        for (node = txn->splits; node; node = node->next)
+        {
+            split = node->data;
+            split->value = split->amount;
+            total = gnc_numeric_add(total, split->amount, 0, GNC_DENOM_LCD);
+        }
 
-  } else {
-    /* not a split txn.  Compute the "far" split by copying the "near"
-     *  split and then moving the 'near' split to the far split.
-     */
+        /* And re-set the default-split amount */
+        txn->default_split->amount = gnc_numeric_neg(total);
 
-    /* First make a copy of this transaction and move the copy to the 'near' */
-    split = txn->default_split;
-    this_split = qif_split_copy(split);
-    txn->default_split = this_split;
+    }
+    else
+    {
+        /* not a split txn.  Compute the "far" split by copying the "near"
+         *  split and then moving the 'near' split to the far split.
+         */
 
-    /* then adjust the 'far' txn */
-    split->amount = gnc_numeric_neg(split->amount);
-    split->value = split->amount;
-    txn->splits = g_list_prepend(txn->splits, split);
-  }
+        /* First make a copy of this transaction and move the copy to the 'near' */
+        split = txn->default_split;
+        this_split = qif_split_copy(split);
+        txn->default_split = this_split;
 
-  /* Set the default-split value from the default-split amount */
-  txn->default_split->value = txn->default_split->amount;
+        /* then adjust the 'far' txn */
+        split->amount = gnc_numeric_neg(split->amount);
+        split->value = split->amount;
+        txn->splits = g_list_prepend(txn->splits, split);
+    }
+
+    /* Set the default-split value from the default-split amount */
+    txn->default_split->value = txn->default_split->amount;
 }
 
 /* This is called when we're done processing an account.  We want
@@ -848,393 +885,469 @@
 static QifError
 qif_txn_end_acct(QifContext ctx)
 {
-  GList *node;
-  QifTxn txn;
-  gboolean txn_needs_acct;
+    GList *node;
+    QifTxn txn;
+    gboolean txn_needs_acct;
 
-  g_return_val_if_fail(ctx, QIF_E_INTERNAL);
+    g_return_val_if_fail(ctx, QIF_E_INTERNAL);
 
-  /* Return now if there is nothing to do. */
-  if (!ctx->parse_state) return QIF_E_OK;
+    /* Return now if there is nothing to do. */
+    if (!ctx->parse_state) return QIF_E_OK;
 
-  /* Walk through the list of transactions.  First check if it
-   * needs a from-account; then add it to the context.
-   */
+    /* Walk through the list of transactions.  First check if it
+     * needs a from-account; then add it to the context.
+     */
 
-  txn_needs_acct = (ctx->parse_flags & QIF_F_TXN_NEEDS_ACCT);
+    txn_needs_acct = (ctx->parse_flags & QIF_F_TXN_NEEDS_ACCT);
 
-  /* Invert the list so we're working in the right order */
-  ctx->parse_state = g_list_reverse(ctx->parse_state);
+    /* Invert the list so we're working in the right order */
+    ctx->parse_state = g_list_reverse(ctx->parse_state);
 
-  for (node = ctx->parse_state; node; node = node->next) {
-    txn = node->data;
+    for (node = ctx->parse_state; node; node = node->next)
+    {
+        txn = node->data;
 
-    /* If we need a from account, then set it.. */
-    if (txn_needs_acct && ctx->opening_bal_acct && !txn->from_acct)
-      txn->from_acct = ctx->opening_bal_acct;
+        /* If we need a from account, then set it.. */
+        if (txn_needs_acct && ctx->opening_bal_acct && !txn->from_acct)
+            txn->from_acct = ctx->opening_bal_acct;
 
-    /* merge the txn into the context (prepends to the list) */
-    qif_object_list_insert(ctx, (QifObject)txn);
-  }
+        /* merge the txn into the context (prepends to the list) */
+        qif_object_list_insert(ctx, (QifObject)txn);
+    }
 
-  if (txn_needs_acct && ctx->opening_bal_acct)
-    qif_clear_flag(ctx->parse_flags, QIF_F_TXN_NEEDS_ACCT);
+    if (txn_needs_acct && ctx->opening_bal_acct)
+        qif_clear_flag(ctx->parse_flags, QIF_F_TXN_NEEDS_ACCT);
 
-  /* clean up our state */
-  g_list_free(ctx->parse_state);
-  ctx->parse_state = NULL;
+    /* clean up our state */
+    g_list_free(ctx->parse_state);
+    ctx->parse_state = NULL;
 
-  return QIF_E_OK;
+    return QIF_E_OK;
 }
 
 /* Extra info in an Investment Transaction */
 static QifInvstTxn
 qif_invst_txn_new(void)
 {
-  QifInvstTxn itxn = g_new0(struct _QifInvstTxn, 1);
+    QifInvstTxn itxn = g_new0(struct _QifInvstTxn, 1);
 
-  itxn->amount = gnc_numeric_zero();
-  itxn->d_amount = gnc_numeric_zero();
-  itxn->price = gnc_numeric_zero();
-  itxn->shares = gnc_numeric_zero();
-  itxn->commission = gnc_numeric_zero();
+    itxn->amount = gnc_numeric_zero();
+    itxn->d_amount = gnc_numeric_zero();
+    itxn->price = gnc_numeric_zero();
+    itxn->shares = gnc_numeric_zero();
+    itxn->commission = gnc_numeric_zero();
 
-  return itxn;
+    return itxn;
 }
 
 static void
 qif_txn_invst_destroy(QifInvstTxn itxn)
 {
-  if (!itxn) return;
+    if (!itxn) return;
 
-  g_free(itxn->amountstr);
-  g_free(itxn->d_amountstr);
-  g_free(itxn->pricestr);
-  g_free(itxn->sharesstr);
-  g_free(itxn->commissionstr);
-  g_free(itxn->security);
+    g_free(itxn->amountstr);
+    g_free(itxn->d_amountstr);
+    g_free(itxn->pricestr);
+    g_free(itxn->sharesstr);
+    g_free(itxn->commissionstr);
+    g_free(itxn->security);
 
-  g_free(itxn->catstr);
+    g_free(itxn->catstr);
 
-  g_free(itxn);
+    g_free(itxn);
 }
 
 static QifError
 qif_txn_invst_parse(QifContext ctx, GList *record)
 {
-  QifTxn txn;
-  QifInvstTxn itxn;
-  QifLine line;
+    QifTxn txn;
+    QifInvstTxn itxn;
+    QifLine line;
 
-  g_return_val_if_fail(ctx, QIF_E_INTERNAL);
-  g_return_val_if_fail(record, QIF_E_BADSTATE);
+    g_return_val_if_fail(ctx, QIF_E_INTERNAL);
+    g_return_val_if_fail(record, QIF_E_BADSTATE);
 
-  txn = qif_txn_new();
-  txn->txn_type = ctx->parse_type;
-  itxn = qif_invst_txn_new();
-  txn->invst_info = itxn;
+    txn = qif_txn_new();
+    txn->txn_type = ctx->parse_type;
+    itxn = qif_invst_txn_new();
+    txn->invst_info = itxn;
 
-  for (; record; record = record->next) {
-    line = record->data;
+    for (; record; record = record->next)
+    {
+        line = record->data;
 
-    switch (line->type) {
-    case 'D':			/* D : transaction date */
-      qif_save_str(txn->datestr);
-      break;
-    case 'P':			/* P : txn payee */
-      qif_save_str(txn->payee);
-      break;
-    case 'N':			/* N : action */
-      itxn->action = qif_parse_action(line);
-      break;
-    case 'C':			/* C : cleared flag */
-      txn->cleared = qif_parse_cleared(line);
-      break;
-    case 'M':			/* M : memo */
-      if (!txn->current_split)
-	qif_save_str(txn->default_split->memo);
-      break;
-    case 'T':			/* T : total amount */
-      if (!qif_is_bad_numeric_string(line->line))
-	qif_save_str(itxn->amountstr);
-      break;
-    case '$':			/* $ : transfer amount */
-      if (!qif_is_bad_numeric_string(line->line))
-	qif_save_str(itxn->d_amountstr);
-      break;
-    case 'I':			/* I : share price */
-      qif_save_str(itxn->pricestr);
-      break;
-    case 'Q':			/* Q : number of shares */
-      qif_save_str(itxn->sharesstr);
-      break;
-    case 'Y':			/* Y : name of security */
-      qif_save_str(itxn->security);
-      break;
-    case 'O':			/* O : commission */
-      qif_save_str(itxn->commissionstr);
-      break;
-    case 'L':			/* L : category */
-      qif_save_str(itxn->catstr);
-      break;
-    default:
-      PERR("Unknown QIF Investment transaction data at line %d: %s",
-	   line->lineno, line->line);
+        switch (line->type)
+        {
+        case 'D':			/* D : transaction date */
+            qif_save_str(txn->datestr);
+            break;
+        case 'P':			/* P : txn payee */
+            qif_save_str(txn->payee);
+            break;
+        case 'N':			/* N : action */
+            itxn->action = qif_parse_action(line);
+            break;
+        case 'C':			/* C : cleared flag */
+            txn->cleared = qif_parse_cleared(line);
+            break;
+        case 'M':			/* M : memo */
+            if (!txn->current_split)
+                qif_save_str(txn->default_split->memo);
+            break;
+        case 'T':			/* T : total amount */
+            if (!qif_is_bad_numeric_string(line->line))
+                qif_save_str(itxn->amountstr);
+            break;
+        case '$':			/* $ : transfer amount */
+            if (!qif_is_bad_numeric_string(line->line))
+                qif_save_str(itxn->d_amountstr);
+            break;
+        case 'I':			/* I : share price */
+            qif_save_str(itxn->pricestr);
+            break;
+        case 'Q':			/* Q : number of shares */
+            qif_save_str(itxn->sharesstr);
+            break;
+        case 'Y':			/* Y : name of security */
+            qif_save_str(itxn->security);
+            break;
+        case 'O':			/* O : commission */
+            qif_save_str(itxn->commissionstr);
+            break;
+        case 'L':			/* L : category */
+            qif_save_str(itxn->catstr);
+            break;
+        default:
+            PERR("Unknown QIF Investment transaction data at line %d: %s",
+                 line->lineno, line->line);
+        }
     }
-  }
 
-  /* If we have no date string then there is no reason to do anything else */
-  if (txn->datestr && itxn->action != QIF_A_NONE) {
-    
-    /* Make sure we've got a security name */
-    if (!itxn->security)
-      itxn->security = g_strdup("");	/* XXX */
+    /* If we have no date string then there is no reason to do anything else */
+    if (txn->datestr && itxn->action != QIF_A_NONE)
+    {
 
-    /* if we don't have a from account, then mark the fact that
-     * we'll need one later.
-     */
-    if (ctx->current_acct)
-      txn->from_acct = ctx->current_acct;
-    else
-      qif_set_flag(ctx->parse_flags, QIF_F_ITXN_NEEDS_ACCT);
+        /* Make sure we've got a security name */
+        if (!itxn->security)
+            itxn->security = g_strdup("");	/* XXX */
 
-    /* Add this transaction to the parse state for later processing */
-    ctx->parse_state = g_list_prepend(ctx->parse_state, txn);
+        /* if we don't have a from account, then mark the fact that
+         * we'll need one later.
+         */
+        if (ctx->current_acct)
+            txn->from_acct = ctx->current_acct;
+        else
+            qif_set_flag(ctx->parse_flags, QIF_F_ITXN_NEEDS_ACCT);
 
-  } else {
-    /* no date?  Just destroy it */
-    qif_txn_destroy((QifObject)txn);
-  }
+        /* Add this transaction to the parse state for later processing */
+        ctx->parse_state = g_list_prepend(ctx->parse_state, txn);
 
-  return QIF_E_OK;
+    }
+    else
+    {
+        /* no date?  Just destroy it */
+        qif_txn_destroy((QifObject)txn);
+    }
+
+    return QIF_E_OK;
 }
 
 
 void
 qif_invst_txn_setup_splits(QifContext ctx, QifTxn txn)
 {
-  QifInvstTxn itxn;
-  QifSplit near_split, far_split, comm_split;
-  QifAccount from_acct;
+    QifInvstTxn itxn;
+    QifSplit near_split, far_split, comm_split;
+    QifAccount from_acct;
 
-  char *cat = NULL;
-  char *cat_class = NULL;
-  gboolean cat_is_acct = FALSE;
-  char *miscx = NULL;
-  char *miscx_class = NULL;
-  gboolean miscx_is_acct = FALSE;
+    char *cat = NULL;
+    char *cat_class = NULL;
+    gboolean cat_is_acct = FALSE;
+    char *miscx = NULL;
+    char *miscx_class = NULL;
+    gboolean miscx_is_acct = FALSE;
 
-  /* Cached account-type lists */
-  static GList *bank_list = NULL;
+    /* Cached account-type lists */
+    static GList *bank_list = NULL;
 
-  gnc_numeric split_value;
+    gnc_numeric split_value;
 
-  g_return_if_fail(ctx);
-  g_return_if_fail(txn);
-  g_return_if_fail(txn->invst_info);
+    g_return_if_fail(ctx);
+    g_return_if_fail(txn);
+    g_return_if_fail(txn->invst_info);
 
-  itxn = txn->invst_info;
+    itxn = txn->invst_info;
 
-  /* Compute the share value, because we'll probably need it */
-  split_value = gnc_numeric_mul(itxn->shares, itxn->price, 0, GNC_DENOM_REDUCE);
+    /* Compute the share value, because we'll probably need it */
+    split_value = gnc_numeric_mul(itxn->shares, itxn->price, 0, GNC_DENOM_REDUCE);
 
-  /* Make sure that "amount" is a valid "transaction amount" */
-  if (!itxn->amountstr && itxn->d_amountstr)
-    itxn->amount = itxn->d_amount;
+    /* Make sure that "amount" is a valid "transaction amount" */
+    if (!itxn->amountstr && itxn->d_amountstr)
+        itxn->amount = itxn->d_amount;
 
-  /* near and far splits..  for simplicity */
-  near_split = txn->default_split;
-  far_split = qif_split_new();
-  from_acct = txn->from_acct;
+    /* near and far splits..  for simplicity */
+    near_split = txn->default_split;
+    far_split = qif_split_new();
+    from_acct = txn->from_acct;
 
-  /* Parse the category string */
-  if (!qif_parse_split_category(itxn->catstr,
-				&cat, &cat_is_acct, &cat_class,
-				&miscx, &miscx_is_acct, &miscx_class))
-    PERR("Failure parsing category: %s", itxn->catstr);
+    /* Parse the category string */
+    if (!qif_parse_split_category(itxn->catstr,
+                                  &cat, &cat_is_acct, &cat_class,
+                                  &miscx, &miscx_is_acct, &miscx_class))
+        PERR("Failure parsing category: %s", itxn->catstr);
 
-  /* Make sure we've got a cached list */
-  if (bank_list == NULL)
-    bank_list = qif_parse_acct_type("__any_bank__", -1);
+    /* Make sure we've got a cached list */
+    if (bank_list == NULL)
+        bank_list = qif_parse_acct_type("__any_bank__", -1);
 
-  /* find the NEAR account */
+    /* find the NEAR account */
 
-  switch (itxn->action) {
-  case QIF_A_BUY: case QIF_A_BUYX: case QIF_A_REINVDIV: case QIF_A_REINVINT:
-  case QIF_A_REINVLG: case QIF_A_REINVMD: case QIF_A_REINVSG: case QIF_A_REINVSH:
-  case QIF_A_SELL: case QIF_A_SELLX: case QIF_A_SHRSIN: case QIF_A_SHRSOUT:
-  case QIF_A_STKSPLIT:
-    txn->from_acct = qif_default_stock_acct(ctx, itxn->security);
-    break;
+    switch (itxn->action)
+    {
+    case QIF_A_BUY:
+    case QIF_A_BUYX:
+    case QIF_A_REINVDIV:
+    case QIF_A_REINVINT:
+    case QIF_A_REINVLG:
+    case QIF_A_REINVMD:
+    case QIF_A_REINVSG:
+    case QIF_A_REINVSH:
+    case QIF_A_SELL:
+    case QIF_A_SELLX:
+    case QIF_A_SHRSIN:
+    case QIF_A_SHRSOUT:
+    case QIF_A_STKSPLIT:
+        txn->from_acct = qif_default_stock_acct(ctx, itxn->security);
+        break;
 
-  case QIF_A_CGLONG: case QIF_A_CGMID: case QIF_A_CGSHORT: case QIF_A_DIV:
-  case QIF_A_INTINC: case QIF_A_MARGINT: case QIF_A_MISCEXP: case QIF_A_MISCINC:
-  case QIF_A_RTRNCAP: case QIF_A_XIN: case QIF_A_XOUT:
-    txn->from_acct = from_acct;
-    break;
+    case QIF_A_CGLONG:
+    case QIF_A_CGMID:
+    case QIF_A_CGSHORT:
+    case QIF_A_DIV:
+    case QIF_A_INTINC:
+    case QIF_A_MARGINT:
+    case QIF_A_MISCEXP:
+    case QIF_A_MISCINC:
+    case QIF_A_RTRNCAP:
+    case QIF_A_XIN:
+    case QIF_A_XOUT:
+        txn->from_acct = from_acct;
+        break;
 
-  case QIF_A_CGLONGX: case QIF_A_CGMIDX: case QIF_A_CGSHORTX: case QIF_A_DIVX:
-  case QIF_A_INTINCX: case QIF_A_MARGINTX: case QIF_A_RTRNCAPX:
-    txn->from_acct = find_or_make_acct(ctx, cat, bank_list);
-    cat = NULL;
-    break;
+    case QIF_A_CGLONGX:
+    case QIF_A_CGMIDX:
+    case QIF_A_CGSHORTX:
+    case QIF_A_DIVX:
+    case QIF_A_INTINCX:
+    case QIF_A_MARGINTX:
+    case QIF_A_RTRNCAPX:
+        txn->from_acct = find_or_make_acct(ctx, cat, bank_list);
+        cat = NULL;
+        break;
 
-  case QIF_A_MISCEXPX: case QIF_A_MISCINCX:
-    txn->from_acct = find_or_make_acct(ctx, miscx, bank_list);
-    miscx = NULL;
-    break;
+    case QIF_A_MISCEXPX:
+    case QIF_A_MISCINCX:
+        txn->from_acct = find_or_make_acct(ctx, miscx, bank_list);
+        miscx = NULL;
+        break;
 
-  default:
-    PERR("Unhandled Action: %d", itxn->action);
-    break;
-  }
+    default:
+        PERR("Unhandled Action: %d", itxn->action);
+        break;
+    }
 
-  /* find the FAR account */
+    /* find the FAR account */
 
-  itxn->far_cat_is_acct = TRUE;
-  switch (itxn->action) {
-  case QIF_A_BUY: case QIF_A_SELL:
-    itxn->far_cat.acct = from_acct;
-    break;
+    itxn->far_cat_is_acct = TRUE;
+    switch (itxn->action)
+    {
+    case QIF_A_BUY:
+    case QIF_A_SELL:
+        itxn->far_cat.acct = from_acct;
+        break;
 
-  case QIF_A_BUYX: case QIF_A_MISCEXP: case QIF_A_MISCEXPX: case QIF_A_MISCINC:
-  case QIF_A_MISCINCX: case QIF_A_SELLX: case QIF_A_XIN: case QIF_A_XOUT:
-    itxn->far_cat.cat = find_or_make_cat(ctx, cat);
-    itxn->far_cat_is_acct = FALSE;
-    cat = NULL;
-    break;
+    case QIF_A_BUYX:
+    case QIF_A_MISCEXP:
+    case QIF_A_MISCEXPX:
+    case QIF_A_MISCINC:
+    case QIF_A_MISCINCX:
+    case QIF_A_SELLX:
+    case QIF_A_XIN:
+    case QIF_A_XOUT:
+        itxn->far_cat.cat = find_or_make_cat(ctx, cat);
+        itxn->far_cat_is_acct = FALSE;
+        cat = NULL;
+        break;
 
-  case QIF_A_CGLONG: case QIF_A_CGLONGX: case QIF_A_REINVLG:
-    itxn->far_cat.acct = qif_default_cglong_acct(ctx, itxn->security);
-    break;
+    case QIF_A_CGLONG:
+    case QIF_A_CGLONGX:
+    case QIF_A_REINVLG:
+        itxn->far_cat.acct = qif_default_cglong_acct(ctx, itxn->security);
+        break;
 
-  case QIF_A_CGMID: case QIF_A_CGMIDX: case QIF_A_REINVMD:
-    itxn->far_cat.acct = qif_default_cgmid_acct(ctx, itxn->security);
-    break;
+    case QIF_A_CGMID:
+    case QIF_A_CGMIDX:
+    case QIF_A_REINVMD:
+        itxn->far_cat.acct = qif_default_cgmid_acct(ctx, itxn->security);
+        break;
 
-  case QIF_A_CGSHORT: case QIF_A_CGSHORTX: case QIF_A_REINVSG: case QIF_A_REINVSH:
-    itxn->far_cat.acct = qif_default_cgshort_acct(ctx, itxn->security);
-    break;
+    case QIF_A_CGSHORT:
+    case QIF_A_CGSHORTX:
+    case QIF_A_REINVSG:
+    case QIF_A_REINVSH:
+        itxn->far_cat.acct = qif_default_cgshort_acct(ctx, itxn->security);
+        break;
 
-  case QIF_A_DIV: case QIF_A_DIVX: case QIF_A_REINVDIV:
-    itxn->far_cat.acct = qif_default_dividend_acct(ctx, itxn->security);
-    break;
+    case QIF_A_DIV:
+    case QIF_A_DIVX:
+    case QIF_A_REINVDIV:
+        itxn->far_cat.acct = qif_default_dividend_acct(ctx, itxn->security);
+        break;
 
-  case QIF_A_INTINC: case QIF_A_INTINCX: case QIF_A_REINVINT:
-    itxn->far_cat.acct = qif_default_interest_acct(ctx, itxn->security);
-    break;
+    case QIF_A_INTINC:
+    case QIF_A_INTINCX:
+    case QIF_A_REINVINT:
+        itxn->far_cat.acct = qif_default_interest_acct(ctx, itxn->security);
+        break;
 
-  case QIF_A_MARGINT: case QIF_A_MARGINTX:
-    itxn->far_cat.acct = qif_default_margin_interest_acct(ctx);
-    break;
+    case QIF_A_MARGINT:
+    case QIF_A_MARGINTX:
+        itxn->far_cat.acct = qif_default_margin_interest_acct(ctx);
+        break;
 
-  case QIF_A_RTRNCAP: case QIF_A_RTRNCAPX:
-    itxn->far_cat.acct = qif_default_capital_return_acct(ctx, itxn->security);
-    break;
+    case QIF_A_RTRNCAP:
+    case QIF_A_RTRNCAPX:
+        itxn->far_cat.acct = qif_default_capital_return_acct(ctx, itxn->security);
+        break;
 
-  case QIF_A_SHRSIN: case QIF_A_SHRSOUT:
-    itxn->far_cat.acct = qif_default_equity_holding(ctx, itxn->security);
-    break;
+    case QIF_A_SHRSIN:
+    case QIF_A_SHRSOUT:
+        itxn->far_cat.acct = qif_default_equity_holding(ctx, itxn->security);
+        break;
 
-  case QIF_A_STKSPLIT:
-    itxn->far_cat.acct = qif_default_stock_acct(ctx, itxn->security);
-    break;
+    case QIF_A_STKSPLIT:
+        itxn->far_cat.acct = qif_default_stock_acct(ctx, itxn->security);
+        break;
 
-  default:
-    break;
-  }
+    default:
+        break;
+    }
 
-  /* If we dont have a far acct (or far category) then reset the flag */
-  if (!itxn->far_cat.obj)
-    itxn->far_cat_is_acct = FALSE;
+    /* If we dont have a far acct (or far category) then reset the flag */
+    if (!itxn->far_cat.obj)
+        itxn->far_cat_is_acct = FALSE;
 
-  /* And now fill in the "near" and "far" splits.  In particular we need
-   *
-   *	NEAR:	txn->from_acct, near_split->amount, value
-   *	FAR:	cat, far_split->amount, value
-   */
-  switch (itxn->action) {
-  case QIF_A_BUY: case QIF_A_BUYX: case QIF_A_REINVDIV: case QIF_A_REINVINT:
-  case QIF_A_REINVLG: case QIF_A_REINVMD: case QIF_A_REINVSG: case QIF_A_REINVSH:
-  case QIF_A_SHRSIN:
-    near_split->amount = itxn->shares;
-    near_split->value = split_value;
-    far_split->amount = far_split->value = gnc_numeric_neg(itxn->amount);
-    break;
+    /* And now fill in the "near" and "far" splits.  In particular we need
+     *
+     *	NEAR:	txn->from_acct, near_split->amount, value
+     *	FAR:	cat, far_split->amount, value
+     */
+    switch (itxn->action)
+    {
+    case QIF_A_BUY:
+    case QIF_A_BUYX:
+    case QIF_A_REINVDIV:
+    case QIF_A_REINVINT:
+    case QIF_A_REINVLG:
+    case QIF_A_REINVMD:
+    case QIF_A_REINVSG:
+    case QIF_A_REINVSH:
+    case QIF_A_SHRSIN:
+        near_split->amount = itxn->shares;
+        near_split->value = split_value;
+        far_split->amount = far_split->value = gnc_numeric_neg(itxn->amount);
+        break;
 
-  case QIF_A_SELL: case QIF_A_SELLX: case QIF_A_SHRSOUT:
-    near_split->amount = gnc_numeric_neg(itxn->shares);
-    near_split->value = gnc_numeric_neg(split_value);
-    far_split->amount = far_split->value = itxn->amount;
-    break;
+    case QIF_A_SELL:
+    case QIF_A_SELLX:
+    case QIF_A_SHRSOUT:
+        near_split->amount = gnc_numeric_neg(itxn->shares);
+        near_split->value = gnc_numeric_neg(split_value);
+        far_split->amount = far_split->value = itxn->amount;
+        break;
 
-  case QIF_A_CGLONG: case QIF_A_CGLONGX: case QIF_A_CGMID: case QIF_A_CGMIDX:
-  case QIF_A_CGSHORT: case QIF_A_CGSHORTX: case QIF_A_DIV: case QIF_A_DIVX:
-  case QIF_A_INTINC: case QIF_A_INTINCX: case QIF_A_MISCINC: case QIF_A_MISCINCX:
-  case QIF_A_RTRNCAP: case QIF_A_RTRNCAPX: case QIF_A_XIN:
-    near_split->amount = near_split->value = itxn->amount;
-    far_split->amount = far_split->value = gnc_numeric_neg(itxn->amount);
-    break;
+    case QIF_A_CGLONG:
+    case QIF_A_CGLONGX:
+    case QIF_A_CGMID:
+    case QIF_A_CGMIDX:
+    case QIF_A_CGSHORT:
+    case QIF_A_CGSHORTX:
+    case QIF_A_DIV:
+    case QIF_A_DIVX:
+    case QIF_A_INTINC:
+    case QIF_A_INTINCX:
+    case QIF_A_MISCINC:
+    case QIF_A_MISCINCX:
+    case QIF_A_RTRNCAP:
+    case QIF_A_RTRNCAPX:
+    case QIF_A_XIN:
+        near_split->amount = near_split->value = itxn->amount;
+        far_split->amount = far_split->value = gnc_numeric_neg(itxn->amount);
+        break;
 
-  case QIF_A_MARGINT: case QIF_A_MARGINTX: case QIF_A_MISCEXP:
-  case QIF_A_MISCEXPX: case QIF_A_XOUT:
-    near_split->amount = near_split->value = gnc_numeric_neg(itxn->amount);
-    far_split->amount = far_split->value = itxn->amount;
-    break;
+    case QIF_A_MARGINT:
+    case QIF_A_MARGINTX:
+    case QIF_A_MISCEXP:
+    case QIF_A_MISCEXPX:
+    case QIF_A_XOUT:
+        near_split->amount = near_split->value = gnc_numeric_neg(itxn->amount);
+        far_split->amount = far_split->value = itxn->amount;
+        break;
 
-  case QIF_A_STKSPLIT:
-    /* QIF just specifies the split ratio, not the number of shares
-     * in and out, so we have to fetch the number of shares from the
-     * security account..  FEH!
-     */
+    case QIF_A_STKSPLIT:
+        /* QIF just specifies the split ratio, not the number of shares
+         * in and out, so we have to fetch the number of shares from the
+         * security account..  FEH!
+         */
 
-    near_split->value = gnc_numeric_neg(split_value);
-    far_split->value = split_value;
+        near_split->value = gnc_numeric_neg(split_value);
+        far_split->value = split_value;
 
-    /* XXX: FIXME: compute in-shares/out-shares based on ratio here:
-     *
-     * splitratio = num-shares / 10;
-     * in_shares = gnc_account_get_balance(near_acct);
-     * out_shares = in_shares * splitratio;
-     *
-     * near_split->amount = out_shares;
-     * far_split->amount = gnc_numeric_neg(in_shares);
-     *
-     * We know (later) that near_split == txn->default_split and
-     * far_split == txn->splits->data, so we'll just special-case this
-     * kind of txn when we convert to GNC later.
-     */
+        /* XXX: FIXME: compute in-shares/out-shares based on ratio here:
+         *
+         * splitratio = num-shares / 10;
+         * in_shares = gnc_account_get_balance(near_acct);
+         * out_shares = in_shares * splitratio;
+         *
+         * near_split->amount = out_shares;
+         * far_split->amount = gnc_numeric_neg(in_shares);
+         *
+         * We know (later) that near_split == txn->default_split and
+         * far_split == txn->splits->data, so we'll just special-case this
+         * kind of txn when we convert to GNC later.
+         */
 
-    break;
+        break;
 
-  default:
-    break;
-  }
+    default:
+        break;
+    }
 
-  /* Just make sure to set that it's an account, not a category */
-  far_split->cat.obj = itxn->far_cat.obj;
-  if (itxn->far_cat_is_acct)
-    far_split->cat_is_acct = TRUE;
+    /* Just make sure to set that it's an account, not a category */
+    far_split->cat.obj = itxn->far_cat.obj;
+    if (itxn->far_cat_is_acct)
+        far_split->cat_is_acct = TRUE;
 
-  /* make the commission split if we need it, then add it to the split-list  */
-  if (itxn->commissionstr) {
-    comm_split = qif_split_new();
-    comm_split->cat.acct = qif_default_commission_acct(ctx);
-    comm_split->cat_is_acct = TRUE;
-    comm_split->amount = itxn->commission;
-    comm_split->value = itxn->commission;
+    /* make the commission split if we need it, then add it to the split-list  */
+    if (itxn->commissionstr)
+    {
+        comm_split = qif_split_new();
+        comm_split->cat.acct = qif_default_commission_acct(ctx);
+        comm_split->cat_is_acct = TRUE;
+        comm_split->amount = itxn->commission;
+        comm_split->value = itxn->commission;
 
-    txn->splits = g_list_prepend(txn->splits, comm_split);
-  }
+        txn->splits = g_list_prepend(txn->splits, comm_split);
+    }
 
-  /* Push the "far split" into the txn split-list */
-  txn->splits = g_list_prepend(txn->splits, far_split);
+    /* Push the "far split" into the txn split-list */
+    txn->splits = g_list_prepend(txn->splits, far_split);
 
-  /* Free parsed strings.. */
-  g_free(cat);
-  g_free(cat_class);
-  g_free(miscx);
-  g_free(miscx_class);
+    /* Free parsed strings.. */
+    g_free(cat);
+    g_free(cat_class);
+    g_free(miscx);
+    g_free(miscx_class);
 }
 
 
@@ -1242,13 +1355,13 @@
 static void
 qif_autoswitch_set(QifContext ctx)
 {
-  qif_set_flag(ctx->parse_flags, QIF_F_IGNORE_ACCOUNTS);
+    qif_set_flag(ctx->parse_flags, QIF_F_IGNORE_ACCOUNTS);
 }
 
 static void
 qif_autoswitch_clear(QifContext ctx)
 {
-  qif_clear_flag(ctx->parse_flags, QIF_F_IGNORE_ACCOUNTS);
+    qif_clear_flag(ctx->parse_flags, QIF_F_IGNORE_ACCOUNTS);
 }
 
 /********************************************************************************
@@ -1258,55 +1371,58 @@
 QifAccount
 find_or_make_acct(QifContext ctx, char *name, GList *types)
 {
-  QifAccount res;
+    QifAccount res;
 
-  res = (QifAccount)qif_object_map_lookup(ctx, QIF_O_ACCOUNT, name);
-  if (res)
-    g_free(name);
-  else {
-    res = qif_account_new();
-    res->name = name;
-    res->type_list = types;
+    res = (QifAccount)qif_object_map_lookup(ctx, QIF_O_ACCOUNT, name);
+    if (res)
+        g_free(name);
+    else
+    {
+        res = qif_account_new();
+        res->name = name;
+        res->type_list = types;
 
-    qif_object_map_insert(ctx, name, (QifObject)res);
-  }
+        qif_object_map_insert(ctx, name, (QifObject)res);
+    }
 
-  return res;
+    return res;
 }
 
 QifCategory
 find_or_make_cat(QifContext ctx, char *name)
 {
-  QifCategory res;
+    QifCategory res;
 
-  res = (QifCategory)qif_object_map_lookup(ctx, QIF_O_CATEGORY, name);
-  if (res)
-    g_free(name);
-  else {
-    res = qif_cat_new();
+    res = (QifCategory)qif_object_map_lookup(ctx, QIF_O_CATEGORY, name);
+    if (res)
+        g_free(name);
+    else
+    {
+        res = qif_cat_new();
 
-    res->name = name;
-  
-    qif_object_map_insert(ctx, name, (QifObject)res);
-  }
+        res->name = name;
 
-  return res;
+        qif_object_map_insert(ctx, name, (QifObject)res);
+    }
+
+    return res;
 }
 
 QifClass
 find_or_make_class(QifContext ctx, char *name)
 {
-  QifClass res;
+    QifClass res;
 
-  res = (QifClass)qif_object_map_lookup(ctx, QIF_O_CLASS, name);
-  if (res)
-    g_free(name);
-  else {
-    res = qif_class_new();
-    res->name = name;
-    qif_object_map_insert(ctx, name, (QifObject)res);
-  }
-  return res;
+    res = (QifClass)qif_object_map_lookup(ctx, QIF_O_CLASS, name);
+    if (res)
+        g_free(name);
+    else
+    {
+        res = qif_class_new();
+        res->name = name;
+        qif_object_map_insert(ctx, name, (QifObject)res);
+    }
+    return res;
 }
 
 /*****************************************************************************/
@@ -1317,31 +1433,36 @@
 void
 qif_object_init(void)
 {
-  int i;
-  static struct {
-    QifType		type;
-    struct _QifHandler	handler;
-  } handlers[] = {
-    { QIF_TYPE_BANK, { qif_txn_init, qif_txn_parse, qif_txn_end_acct } },
-    { QIF_TYPE_CASH, { qif_txn_init, qif_txn_parse, qif_txn_end_acct } },
-    { QIF_TYPE_CCARD, { qif_txn_init, qif_txn_parse, qif_txn_end_acct } },
-    { QIF_TYPE_INVST, { qif_txn_init, qif_txn_invst_parse, qif_txn_end_acct } },
-    { QIF_TYPE_PORT, { qif_txn_init, qif_txn_invst_parse, qif_txn_end_acct } },
-    { QIF_TYPE_OTH_A, { qif_txn_init, qif_txn_parse, qif_txn_end_acct } },
-    { QIF_TYPE_OTH_L, { qif_txn_init, qif_txn_parse, qif_txn_end_acct } },
-    { QIF_TYPE_CLASS, { NULL, qif_class_parse, NULL } },
-    { QIF_TYPE_CAT, { NULL, qif_cat_parse, NULL } },
-    { QIF_TYPE_SECURITY, { NULL, qif_security_parse, NULL } },
-    { QIF_ACCOUNT, { NULL, qif_account_parse, NULL } },
-    { QIF_AUTOSWITCH, { qif_autoswitch_set, NULL, NULL } },
-    { QIF_CLEAR_AUTOSWITCH, { qif_autoswitch_clear, NULL, NULL } },
-    { 0, {NULL, NULL, NULL} }
-  };
+    int i;
+    static struct
+    {
+        QifType		type;
+        struct _QifHandler	handler;
+    } handlers[] =
+    {
+        { QIF_TYPE_BANK, { qif_txn_init, qif_txn_parse, qif_txn_end_acct } },
+        { QIF_TYPE_CASH, { qif_txn_init, qif_txn_parse, qif_txn_end_acct } },
+        { QIF_TYPE_CCARD, { qif_txn_init, qif_txn_parse, qif_txn_end_acct } },
+        { QIF_TYPE_INVST, { qif_txn_init, qif_txn_invst_parse, qif_txn_end_acct } },
+        { QIF_TYPE_PORT, { qif_txn_init, qif_txn_invst_parse, qif_txn_end_acct } },
+        { QIF_TYPE_OTH_A, { qif_txn_init, qif_txn_parse, qif_txn_end_acct } },
+        { QIF_TYPE_OTH_L, { qif_txn_init, qif_txn_parse, qif_txn_end_acct } },
+        { QIF_TYPE_CLASS, { NULL, qif_class_parse, NULL } },
+        { QIF_TYPE_CAT, { NULL, qif_cat_parse, NULL } },
+        { QIF_TYPE_SECURITY, { NULL, qif_security_parse, NULL } },
+        { QIF_ACCOUNT, { NULL, qif_account_parse, NULL } },
+        { QIF_AUTOSWITCH, { qif_autoswitch_set, NULL, NULL } },
+        { QIF_CLEAR_AUTOSWITCH, { qif_autoswitch_clear, NULL, NULL } },
+        { 0, {NULL, NULL, NULL} }
+    };
 
-  for (i = 0; handlers[i].type > 0; i++) {
-    if (handlers[i].type <= 0) {
-      PERR("Invalid type?!?  (%d @ %d)", handlers[i].type, i);
-    } else
-      qif_register_handler(handlers[i].type, &(handlers[i].handler));
-  }
+    for (i = 0; handlers[i].type > 0; i++)
+    {
+        if (handlers[i].type <= 0)
+        {
+            PERR("Invalid type?!?  (%d @ %d)", handlers[i].type, i);
+        }
+        else
+            qif_register_handler(handlers[i].type, &(handlers[i].handler));
+    }
 }

Modified: gnucash/trunk/src/import-export/qif/qif-objects.h
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-objects.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-objects.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -28,11 +28,12 @@
 typedef struct _QifObject *QifObject;
 typedef struct _QifData *QifData;
 
-struct _QifObject {
-  const char*	type;
-  void		(*destroy)(QifObject);
+struct _QifObject
+{
+    const char*	type;
+    void		(*destroy)(QifObject);
 
-  /* QIF Objects contain data beyond this point.. */
+    /* QIF Objects contain data beyond this point.. */
 };
 
 #define QIF_O_ACCOUNT	"qif-acct"

Modified: gnucash/trunk/src/import-export/qif/qif-parse.c
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-parse.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-parse.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -68,21 +68,22 @@
 void
 qif_register_handler(QifType type, QifHandler handler)
 {
-  if (type <= 0 || type > QIF_TYPE_MAX) {
-    PERR("Invalid type: %d", type);
-    return;
-  }
-  qif_handlers[type] = handler;
+    if (type <= 0 || type > QIF_TYPE_MAX)
+    {
+        PERR("Invalid type: %d", type);
+        return;
+    }
+    qif_handlers[type] = handler;
 }
 
 static void
 compile_regex()
 {
-  regcomp(&category_regex,
-      "^ *(\\[)?([^]/|]*)(]?)(/([^|]*))?(\\|(\\[)?([^]/]*)(]?)(/(.*))?)? *$",
-          REG_EXTENDED);
+    regcomp(&category_regex,
+            "^ *(\\[)?([^]/|]*)(]?)(/([^|]*))?(\\|(\\[)?([^]/]*)(]?)(/(.*))?)? *$",
+            REG_EXTENDED);
 
-  qifp_regex_compiled = TRUE;
+    qifp_regex_compiled = TRUE;
 }
 
 #define QIF_ADD_TYPE(ts,t) \
@@ -92,26 +93,26 @@
 static void
 build_bangtype_map()
 {
-  g_return_if_fail(!qif_bangtype_map);
+    g_return_if_fail(!qif_bangtype_map);
 
-  qif_bangtype_map = g_hash_table_new(g_str_hash, g_str_equal);
-  g_assert(qif_bangtype_map);
+    qif_bangtype_map = g_hash_table_new(g_str_hash, g_str_equal);
+    g_assert(qif_bangtype_map);
 
-  /* Translators FIXME: It is unclear whether these strings should
-     really be translated, and if yes, into which translation. */
-  QIF_ADD_TYPE(N_("type:bank"), QIF_TYPE_BANK);
-  QIF_ADD_TYPE(N_("type:cash"), QIF_TYPE_CASH);
-  QIF_ADD_TYPE(N_("type:ccard"), QIF_TYPE_CCARD);
-  QIF_ADD_TYPE(N_("type:invst"), QIF_TYPE_INVST);
-  QIF_ADD_TYPE(N_("type:port"), QIF_TYPE_PORT);
-  QIF_ADD_TYPE(N_("type:oth a"), QIF_TYPE_OTH_A);
-  QIF_ADD_TYPE(N_("type:oth l"), QIF_TYPE_OTH_L);
-  QIF_ADD_TYPE(N_("type:class"), QIF_TYPE_CLASS);
-  QIF_ADD_TYPE(N_("type:cat"), QIF_TYPE_CAT);
-  QIF_ADD_TYPE(N_("type:security"), QIF_TYPE_SECURITY);
-  QIF_ADD_TYPE(N_("account"), QIF_ACCOUNT);
-  QIF_ADD_TYPE(N_("option:autoswitch"), QIF_AUTOSWITCH);
-  QIF_ADD_TYPE(N_("clear:autoswitch"), QIF_CLEAR_AUTOSWITCH);
+    /* Translators FIXME: It is unclear whether these strings should
+       really be translated, and if yes, into which translation. */
+    QIF_ADD_TYPE(N_("type:bank"), QIF_TYPE_BANK);
+    QIF_ADD_TYPE(N_("type:cash"), QIF_TYPE_CASH);
+    QIF_ADD_TYPE(N_("type:ccard"), QIF_TYPE_CCARD);
+    QIF_ADD_TYPE(N_("type:invst"), QIF_TYPE_INVST);
+    QIF_ADD_TYPE(N_("type:port"), QIF_TYPE_PORT);
+    QIF_ADD_TYPE(N_("type:oth a"), QIF_TYPE_OTH_A);
+    QIF_ADD_TYPE(N_("type:oth l"), QIF_TYPE_OTH_L);
+    QIF_ADD_TYPE(N_("type:class"), QIF_TYPE_CLASS);
+    QIF_ADD_TYPE(N_("type:cat"), QIF_TYPE_CAT);
+    QIF_ADD_TYPE(N_("type:security"), QIF_TYPE_SECURITY);
+    QIF_ADD_TYPE(N_("account"), QIF_ACCOUNT);
+    QIF_ADD_TYPE(N_("option:autoswitch"), QIF_AUTOSWITCH);
+    QIF_ADD_TYPE(N_("clear:autoswitch"), QIF_CLEAR_AUTOSWITCH);
 }
 #undef QIF_ADD_TYPE
 
@@ -121,129 +122,130 @@
 static void
 build_action_map()
 {
-  g_return_if_fail(!qif_action_map);
+    g_return_if_fail(!qif_action_map);
 
-  qif_action_map = g_hash_table_new(g_str_hash, g_str_equal);
-  g_assert(qif_action_map);
+    qif_action_map = g_hash_table_new(g_str_hash, g_str_equal);
+    g_assert(qif_action_map);
 
-  QIF_ADD_ACT("buy", QIF_A_BUY);
-  QIF_ADD_ACT("cvrshrt", QIF_A_BUY);
-  QIF_ADD_ACT("kauf", QIF_A_BUY);
-  QIF_ADD_ACT("buyx", QIF_A_BUYX);
-  QIF_ADD_ACT("cvrshrtx", QIF_A_BUYX);
-  QIF_ADD_ACT("kaufx", QIF_A_BUYX);
-  QIF_ADD_ACT("cglong", QIF_A_CGLONG);
-  QIF_ADD_ACT("kapgew", QIF_A_CGLONG); /* Kapitalgewinnsteuer */
-  QIF_ADD_ACT("cglongx", QIF_A_CGLONG);
-  QIF_ADD_ACT("kapgewx", QIF_A_CGLONG);
-  QIF_ADD_ACT("cgmid", QIF_A_CGMID);
-  QIF_ADD_ACT("cgmidx", QIF_A_CGMIDX);
-  QIF_ADD_ACT("cgshort", QIF_A_CGSHORT);
-  QIF_ADD_ACT("k.gewsp", QIF_A_CGSHORT);
-  QIF_ADD_ACT("cgshortx", QIF_A_CGSHORTX);
-  QIF_ADD_ACT("k.gewspx", QIF_A_CGSHORTX);
-  QIF_ADD_ACT("div", QIF_A_DIV); /* dividende */
-  QIF_ADD_ACT("divx", QIF_A_DIVX);
-  //QIF_ADD_ACT("exercise", QIF_A_EXERCISE);
-  //QIF_ADD_ACT("exercisex", QIF_A_EXERCISEX);
-  //QIF_ADD_ACT("expire", QIF_A_EXPIRE);
-  //QIF_ADD_ACT("grant", QIF_A_GRANT);
-  QIF_ADD_ACT("int", QIF_A_INTINC);
-  QIF_ADD_ACT("intinc", QIF_A_INTINC);
-  QIF_ADD_ACT("aktzu", QIF_A_INTINC); /* zinsen */
-  QIF_ADD_ACT("intx", QIF_A_INTINCX);
-  QIF_ADD_ACT("intincx", QIF_A_INTINCX);
-  QIF_ADD_ACT("margint", QIF_A_MARGINT);
-  QIF_ADD_ACT("margintx", QIF_A_MARGINTX);
-  QIF_ADD_ACT("miscexp", QIF_A_MISCEXP);
-  QIF_ADD_ACT("miscexpx", QIF_A_MISCEXPX);
-  QIF_ADD_ACT("miscinc", QIF_A_MISCINC);
-  QIF_ADD_ACT("cash", QIF_A_MISCINC);
-  QIF_ADD_ACT("miscincx", QIF_A_MISCINCX);
-  QIF_ADD_ACT("reinvdiv", QIF_A_REINVDIV);
-  QIF_ADD_ACT("reinvint", QIF_A_REINVINT);
-  QIF_ADD_ACT("reinvzin", QIF_A_REINVINT);
-  QIF_ADD_ACT("reinvlg", QIF_A_REINVLG);
-  QIF_ADD_ACT("reinvkur", QIF_A_REINVLG);
-  QIF_ADD_ACT("reinvmd", QIF_A_REINVMD);
-  QIF_ADD_ACT("reinvsg", QIF_A_REINVSG);
-  QIF_ADD_ACT("reinvksp", QIF_A_REINVSG);
-  QIF_ADD_ACT("reinvsh", QIF_A_REINVSH);
-  QIF_ADD_ACT("reminder", QIF_A_REMINDER);
-  QIF_ADD_ACT("erinnerg", QIF_A_REMINDER);
-  QIF_ADD_ACT("rtrncap", QIF_A_RTRNCAP);
-  QIF_ADD_ACT("rtrncapx", QIF_A_RTRNCAPX);
-  QIF_ADD_ACT("sell", QIF_A_SELL);
-  QIF_ADD_ACT("shtsell", QIF_A_SELL);
-  QIF_ADD_ACT("verkauf", QIF_A_SELL); /* verkaufen */
-  QIF_ADD_ACT("sellx", QIF_A_SELLX);
-  QIF_ADD_ACT("shtsellx", QIF_A_SELLX);
-  QIF_ADD_ACT("verkaufx", QIF_A_SELLX); /* verkaufen */
-  QIF_ADD_ACT("shrsin", QIF_A_SHRSIN);
-  QIF_ADD_ACT("aktzu", QIF_A_SHRSIN);
-  QIF_ADD_ACT("shrsout", QIF_A_SHRSOUT);
-  QIF_ADD_ACT("aktab", QIF_A_SHRSOUT);
-  QIF_ADD_ACT("stksplit", QIF_A_STKSPLIT);
-  QIF_ADD_ACT("aktsplit", QIF_A_STKSPLIT);
-  //QIF_ADD_ACT("vest", QIF_A_VEST);
-  QIF_ADD_ACT("xin", QIF_A_XIN);
-  QIF_ADD_ACT("contribx", QIF_A_XIN);
-  QIF_ADD_ACT("xout", QIF_A_XOUT);
-  QIF_ADD_ACT("withdrwx", QIF_A_XOUT);
+    QIF_ADD_ACT("buy", QIF_A_BUY);
+    QIF_ADD_ACT("cvrshrt", QIF_A_BUY);
+    QIF_ADD_ACT("kauf", QIF_A_BUY);
+    QIF_ADD_ACT("buyx", QIF_A_BUYX);
+    QIF_ADD_ACT("cvrshrtx", QIF_A_BUYX);
+    QIF_ADD_ACT("kaufx", QIF_A_BUYX);
+    QIF_ADD_ACT("cglong", QIF_A_CGLONG);
+    QIF_ADD_ACT("kapgew", QIF_A_CGLONG); /* Kapitalgewinnsteuer */
+    QIF_ADD_ACT("cglongx", QIF_A_CGLONG);
+    QIF_ADD_ACT("kapgewx", QIF_A_CGLONG);
+    QIF_ADD_ACT("cgmid", QIF_A_CGMID);
+    QIF_ADD_ACT("cgmidx", QIF_A_CGMIDX);
+    QIF_ADD_ACT("cgshort", QIF_A_CGSHORT);
+    QIF_ADD_ACT("k.gewsp", QIF_A_CGSHORT);
+    QIF_ADD_ACT("cgshortx", QIF_A_CGSHORTX);
+    QIF_ADD_ACT("k.gewspx", QIF_A_CGSHORTX);
+    QIF_ADD_ACT("div", QIF_A_DIV); /* dividende */
+    QIF_ADD_ACT("divx", QIF_A_DIVX);
+    //QIF_ADD_ACT("exercise", QIF_A_EXERCISE);
+    //QIF_ADD_ACT("exercisex", QIF_A_EXERCISEX);
+    //QIF_ADD_ACT("expire", QIF_A_EXPIRE);
+    //QIF_ADD_ACT("grant", QIF_A_GRANT);
+    QIF_ADD_ACT("int", QIF_A_INTINC);
+    QIF_ADD_ACT("intinc", QIF_A_INTINC);
+    QIF_ADD_ACT("aktzu", QIF_A_INTINC); /* zinsen */
+    QIF_ADD_ACT("intx", QIF_A_INTINCX);
+    QIF_ADD_ACT("intincx", QIF_A_INTINCX);
+    QIF_ADD_ACT("margint", QIF_A_MARGINT);
+    QIF_ADD_ACT("margintx", QIF_A_MARGINTX);
+    QIF_ADD_ACT("miscexp", QIF_A_MISCEXP);
+    QIF_ADD_ACT("miscexpx", QIF_A_MISCEXPX);
+    QIF_ADD_ACT("miscinc", QIF_A_MISCINC);
+    QIF_ADD_ACT("cash", QIF_A_MISCINC);
+    QIF_ADD_ACT("miscincx", QIF_A_MISCINCX);
+    QIF_ADD_ACT("reinvdiv", QIF_A_REINVDIV);
+    QIF_ADD_ACT("reinvint", QIF_A_REINVINT);
+    QIF_ADD_ACT("reinvzin", QIF_A_REINVINT);
+    QIF_ADD_ACT("reinvlg", QIF_A_REINVLG);
+    QIF_ADD_ACT("reinvkur", QIF_A_REINVLG);
+    QIF_ADD_ACT("reinvmd", QIF_A_REINVMD);
+    QIF_ADD_ACT("reinvsg", QIF_A_REINVSG);
+    QIF_ADD_ACT("reinvksp", QIF_A_REINVSG);
+    QIF_ADD_ACT("reinvsh", QIF_A_REINVSH);
+    QIF_ADD_ACT("reminder", QIF_A_REMINDER);
+    QIF_ADD_ACT("erinnerg", QIF_A_REMINDER);
+    QIF_ADD_ACT("rtrncap", QIF_A_RTRNCAP);
+    QIF_ADD_ACT("rtrncapx", QIF_A_RTRNCAPX);
+    QIF_ADD_ACT("sell", QIF_A_SELL);
+    QIF_ADD_ACT("shtsell", QIF_A_SELL);
+    QIF_ADD_ACT("verkauf", QIF_A_SELL); /* verkaufen */
+    QIF_ADD_ACT("sellx", QIF_A_SELLX);
+    QIF_ADD_ACT("shtsellx", QIF_A_SELLX);
+    QIF_ADD_ACT("verkaufx", QIF_A_SELLX); /* verkaufen */
+    QIF_ADD_ACT("shrsin", QIF_A_SHRSIN);
+    QIF_ADD_ACT("aktzu", QIF_A_SHRSIN);
+    QIF_ADD_ACT("shrsout", QIF_A_SHRSOUT);
+    QIF_ADD_ACT("aktab", QIF_A_SHRSOUT);
+    QIF_ADD_ACT("stksplit", QIF_A_STKSPLIT);
+    QIF_ADD_ACT("aktsplit", QIF_A_STKSPLIT);
+    //QIF_ADD_ACT("vest", QIF_A_VEST);
+    QIF_ADD_ACT("xin", QIF_A_XIN);
+    QIF_ADD_ACT("contribx", QIF_A_XIN);
+    QIF_ADD_ACT("xout", QIF_A_XOUT);
+    QIF_ADD_ACT("withdrwx", QIF_A_XOUT);
 }
 #undef QIF_ADD_ACT
 
 static GList *
 make_list(int count, ...)
 {
-  GList *result = NULL;
-  GNCAccountType type;
-  va_list ap;
+    GList *result = NULL;
+    GNCAccountType type;
+    va_list ap;
 
-  va_start (ap, count);
-  while (count--) {
-    type = va_arg (ap, GNCAccountType);
-    result = g_list_prepend (result, GINT_TO_POINTER(type));
-  }
-  va_end (ap);
+    va_start (ap, count);
+    while (count--)
+    {
+        type = va_arg (ap, GNCAccountType);
+        result = g_list_prepend (result, GINT_TO_POINTER(type));
+    }
+    va_end (ap);
 
 
-  return g_list_reverse(result);
+    return g_list_reverse(result);
 }
 
 #define QIF_ADD_ATYPE(a,t) g_hash_table_insert(qif_atype_map, a, t);
 static void
 build_atype_map()
 {
-  g_return_if_fail(!qif_atype_map);
+    g_return_if_fail(!qif_atype_map);
 
-  qif_atype_map = g_hash_table_new(g_str_hash, g_str_equal);
-  g_assert(qif_atype_map);
+    qif_atype_map = g_hash_table_new(g_str_hash, g_str_equal);
+    g_assert(qif_atype_map);
 
-  QIF_ADD_ATYPE("bank", make_list(1, ACCT_TYPE_BANK));
-  QIF_ADD_ATYPE("port", make_list(1, ACCT_TYPE_BANK));
-  QIF_ADD_ATYPE("cash", make_list(1, ACCT_TYPE_CASH));
-  QIF_ADD_ATYPE("ccard", make_list(1, ACCT_TYPE_CREDIT));
-  QIF_ADD_ATYPE("invst", make_list(3, ACCT_TYPE_BANK, ACCT_TYPE_STOCK,
-				   ACCT_TYPE_MUTUAL));
-  QIF_ADD_ATYPE("oth a", make_list(3, ACCT_TYPE_ASSET, ACCT_TYPE_BANK,
-				   ACCT_TYPE_CASH));
-  QIF_ADD_ATYPE("oth l", make_list(2, ACCT_TYPE_LIABILITY, ACCT_TYPE_CREDIT));
-  QIF_ADD_ATYPE("mutual", make_list(3, ACCT_TYPE_BANK, ACCT_TYPE_MUTUAL,
-				    ACCT_TYPE_STOCK));
+    QIF_ADD_ATYPE("bank", make_list(1, ACCT_TYPE_BANK));
+    QIF_ADD_ATYPE("port", make_list(1, ACCT_TYPE_BANK));
+    QIF_ADD_ATYPE("cash", make_list(1, ACCT_TYPE_CASH));
+    QIF_ADD_ATYPE("ccard", make_list(1, ACCT_TYPE_CREDIT));
+    QIF_ADD_ATYPE("invst", make_list(3, ACCT_TYPE_BANK, ACCT_TYPE_STOCK,
+                                     ACCT_TYPE_MUTUAL));
+    QIF_ADD_ATYPE("oth a", make_list(3, ACCT_TYPE_ASSET, ACCT_TYPE_BANK,
+                                     ACCT_TYPE_CASH));
+    QIF_ADD_ATYPE("oth l", make_list(2, ACCT_TYPE_LIABILITY, ACCT_TYPE_CREDIT));
+    QIF_ADD_ATYPE("mutual", make_list(3, ACCT_TYPE_BANK, ACCT_TYPE_MUTUAL,
+                                      ACCT_TYPE_STOCK));
 
-  /* Internal types */
-  QIF_ADD_ATYPE("__any_bank__", make_list(5, ACCT_TYPE_BANK, ACCT_TYPE_CREDIT,
-					  ACCT_TYPE_CASH, ACCT_TYPE_ASSET,
-                                          ACCT_TYPE_LIABILITY));
-  QIF_ADD_ATYPE("__all__", make_list(7, ACCT_TYPE_BANK, ACCT_TYPE_CREDIT,
-				     ACCT_TYPE_CASH, ACCT_TYPE_ASSET,
-				     ACCT_TYPE_LIABILITY, ACCT_TYPE_STOCK,
-				     ACCT_TYPE_MUTUAL));
-  QIF_ADD_ATYPE("__stock__", make_list(2, ACCT_TYPE_STOCK, ACCT_TYPE_MUTUAL));
-  QIF_ADD_ATYPE("__income__", make_list(1, ACCT_TYPE_INCOME));
-  QIF_ADD_ATYPE("__expense__", make_list(1, ACCT_TYPE_EXPENSE));
-  QIF_ADD_ATYPE("__equity__", make_list(1, ACCT_TYPE_EQUITY));
+    /* Internal types */
+    QIF_ADD_ATYPE("__any_bank__", make_list(5, ACCT_TYPE_BANK, ACCT_TYPE_CREDIT,
+                                            ACCT_TYPE_CASH, ACCT_TYPE_ASSET,
+                                            ACCT_TYPE_LIABILITY));
+    QIF_ADD_ATYPE("__all__", make_list(7, ACCT_TYPE_BANK, ACCT_TYPE_CREDIT,
+                                       ACCT_TYPE_CASH, ACCT_TYPE_ASSET,
+                                       ACCT_TYPE_LIABILITY, ACCT_TYPE_STOCK,
+                                       ACCT_TYPE_MUTUAL));
+    QIF_ADD_ATYPE("__stock__", make_list(2, ACCT_TYPE_STOCK, ACCT_TYPE_MUTUAL));
+    QIF_ADD_ATYPE("__income__", make_list(1, ACCT_TYPE_INCOME));
+    QIF_ADD_ATYPE("__expense__", make_list(1, ACCT_TYPE_EXPENSE));
+    QIF_ADD_ATYPE("__equity__", make_list(1, ACCT_TYPE_EQUITY));
 }
 #undef QIF_ADD_ATYPE
 
@@ -256,43 +258,44 @@
 void
 qif_parse_bangtype(QifContext ctx, const char *line)
 {
-  QifType type;
-  char *bangtype;
-  gpointer result;
+    QifType type;
+    char *bangtype;
+    gpointer result;
 
-  g_return_if_fail(line && *line == '!');
+    g_return_if_fail(line && *line == '!');
 
-  if (!qif_bangtype_map)
-    build_bangtype_map();
+    if (!qif_bangtype_map)
+        build_bangtype_map();
 
-  /* Make a local copy so we can manipulate it.
-   * - strip off leading/trailing whitespace
-   * - make it all lower case
-   */
-  bangtype = g_utf8_strdown(line+1, -1);
-  g_strstrip(bangtype);
+    /* Make a local copy so we can manipulate it.
+     * - strip off leading/trailing whitespace
+     * - make it all lower case
+     */
+    bangtype = g_utf8_strdown(line + 1, -1);
+    g_strstrip(bangtype);
 
-  /* In some cases we get "!Type Bank" -- change the space to a colon */
-  if (!strncmp(bangtype, "type ", 5))
-    bangtype[5] = ':';
+    /* In some cases we get "!Type Bank" -- change the space to a colon */
+    if (!strncmp(bangtype, "type ", 5))
+        bangtype[5] = ':';
 
-  /* Lookup the bangtype in the map and then destroy the local copy */
-  result = g_hash_table_lookup(qif_bangtype_map, bangtype);
-  g_free(bangtype);
+    /* Lookup the bangtype in the map and then destroy the local copy */
+    result = g_hash_table_lookup(qif_bangtype_map, bangtype);
+    g_free(bangtype);
 
-  if (!result) {
-    PWARN("Unknown bang-type at line %d: %s.  Ignored", ctx->lineno, line);
-    return;
-  }
-  type = GPOINTER_TO_INT(result);
+    if (!result)
+    {
+        PWARN("Unknown bang-type at line %d: %s.  Ignored", ctx->lineno, line);
+        return;
+    }
+    type = GPOINTER_TO_INT(result);
 
-  /* Set the current context parse type and handler */
-  ctx->parse_type = type;
-  ctx->handler = qif_handlers[type];
+    /* Set the current context parse type and handler */
+    ctx->parse_type = type;
+    ctx->handler = qif_handlers[type];
 
-  /* now initialize this new parse type (if there's an init function) */
-  if (ctx->handler && ctx->handler->init)
-    ctx->handler->init(ctx);
+    /* now initialize this new parse type (if there's an init function) */
+    if (ctx->handler && ctx->handler->init)
+        ctx->handler->init(ctx);
 }
 
 /* returns TRUE if successful, FALSE if there is a problem */
@@ -302,195 +305,217 @@
                          char** miscx_cat, gboolean *miscx_cat_is_acct,
                          char **miscx_class)
 {
-  /* This is a pretty f**ked up string.  Basically it looks like:
-   *  ([)cat-or-acct(])(/(class))(|([)cat-of-acct(])(/ext))
-   *
-   * where data in parens is "optional" (depending on the context).
-   *
-   * examples from reality:
-   *
-   * category
-   * category:subcategory
-   * category/class
-   * category:subcat/class
-   * [account]
-   * [account]/class
-   *
-   * cat/cat-class|miscx-cat/miscx-class
-   */
+    /* This is a pretty f**ked up string.  Basically it looks like:
+     *  ([)cat-or-acct(])(/(class))(|([)cat-of-acct(])(/ext))
+     *
+     * where data in parens is "optional" (depending on the context).
+     *
+     * examples from reality:
+     *
+     * category
+     * category:subcategory
+     * category/class
+     * category:subcat/class
+     * [account]
+     * [account]/class
+     *
+     * cat/cat-class|miscx-cat/miscx-class
+     */
 
-  regmatch_t pmatch[12];
+    regmatch_t pmatch[12];
 
-  g_return_val_if_fail(cat && cat_is_acct && cat_class &&
-                       miscx_cat && miscx_cat_is_acct && miscx_class, FALSE);
+    g_return_val_if_fail(cat && cat_is_acct && cat_class &&
+                         miscx_cat && miscx_cat_is_acct && miscx_class, FALSE);
 
 
-  if (!qifp_regex_compiled)
-    compile_regex();
+    if (!qifp_regex_compiled)
+        compile_regex();
 
-  if (regexec(&category_regex, str, 12, pmatch, 0) != 0) {
-    PERR("category match failed");
-    return FALSE;
-  }
+    if (regexec(&category_regex, str, 12, pmatch, 0) != 0)
+    {
+        PERR("category match failed");
+        return FALSE;
+    }
 
-  /*
-   * what the substrings mean:
-   * 1 the opening [ for a transfer
-   * 2 the category
-   * 3 the closing ]
-   * 4 the class /
-   * 5 the class 
-   * 6 the miscx expression (whole thing)
-   * 7 the opening [ 
-   * 8 the miscx category
-   * 9 the closing ]
-   * 10 the class /
-   * 11 the class 
-   */
+    /*
+     * what the substrings mean:
+     * 1 the opening [ for a transfer
+     * 2 the category
+     * 3 the closing ]
+     * 4 the class /
+     * 5 the class
+     * 6 the miscx expression (whole thing)
+     * 7 the opening [
+     * 8 the miscx category
+     * 9 the closing ]
+     * 10 the class /
+     * 11 the class
+     */
 
-  if (pmatch[2].rm_so == -1) {
-    PERR("no category match found!");
-    return FALSE;
-  }
+    if (pmatch[2].rm_so == -1)
+    {
+        PERR("no category match found!");
+        return FALSE;
+    }
 
-  /* catgory name */
-  *cat = g_strndup(str+pmatch[2].rm_so, pmatch[2].rm_eo - pmatch[2].rm_so);
-  /* category is account? */
-  *cat_is_acct = (pmatch[1].rm_so != -1 && pmatch[3].rm_so != -1);
-  /* category class */
-  *cat_class = (pmatch[4].rm_so != -1 ?
-                g_strndup(str+pmatch[5].rm_so, pmatch[5].rm_eo - pmatch[5].rm_so) :
-                NULL);
+    /* catgory name */
+    *cat = g_strndup(str + pmatch[2].rm_so, pmatch[2].rm_eo - pmatch[2].rm_so);
+    /* category is account? */
+    *cat_is_acct = (pmatch[1].rm_so != -1 && pmatch[3].rm_so != -1);
+    /* category class */
+    *cat_class = (pmatch[4].rm_so != -1 ?
+                  g_strndup(str + pmatch[5].rm_so, pmatch[5].rm_eo - pmatch[5].rm_so) :
+                  NULL);
 
-  /* miscx category name */
-  *miscx_cat = (pmatch[6].rm_so != -1 ?
-                g_strndup(str+pmatch[8].rm_so, pmatch[8].rm_eo - pmatch[8].rm_so) :
-                NULL);
-  /* miscx cat is acct */
-  *miscx_cat_is_acct  = (pmatch[7].rm_so != -1 && pmatch[9].rm_so != -1);
-  /* miscx class */
-  *miscx_class = (pmatch[10].rm_so != -1 ?
-                  g_strndup(str+pmatch[11].rm_so,
-                            pmatch[11].rm_eo - pmatch[11].rm_so) : NULL);
+    /* miscx category name */
+    *miscx_cat = (pmatch[6].rm_so != -1 ?
+                  g_strndup(str + pmatch[8].rm_so, pmatch[8].rm_eo - pmatch[8].rm_so) :
+                  NULL);
+    /* miscx cat is acct */
+    *miscx_cat_is_acct  = (pmatch[7].rm_so != -1 && pmatch[9].rm_so != -1);
+    /* miscx class */
+    *miscx_class = (pmatch[10].rm_so != -1 ?
+                    g_strndup(str + pmatch[11].rm_so,
+                              pmatch[11].rm_eo - pmatch[11].rm_so) : NULL);
 
-  return TRUE;
+    return TRUE;
 }
 
 /*
  * qif_parse_cleared -- parse the 'C'leared field of a QIF Transaction.
  * returns the QIF reconciled flag.
  *
- * * means cleared, x or X means reconciled, and ! or ? mean some 
- * budget related stuff I don't understand. 
+ * * means cleared, x or X means reconciled, and ! or ? mean some
+ * budget related stuff I don't understand.
  */
 QifRecnFlag
 qif_parse_cleared(QifLine line)
 {
-  g_return_val_if_fail(line, QIF_R_NO);
-  g_return_val_if_fail(line->line, QIF_R_NO);
+    g_return_val_if_fail(line, QIF_R_NO);
+    g_return_val_if_fail(line->line, QIF_R_NO);
 
-  switch (*line->line) {
-  case '*':
-    return QIF_R_CLEARED;
-  case 'x':
-  case 'X':
-    return QIF_R_RECONCILED;
-  case '?':
-  case '!':
-    return QIF_R_BUDGETED;
-  default:
-    PERR("Unknown QIF Cleared flag at line %d: %s", line->lineno, line->line);
-    return QIF_R_NO;
-  }
+    switch (*line->line)
+    {
+    case '*':
+        return QIF_R_CLEARED;
+    case 'x':
+    case 'X':
+        return QIF_R_RECONCILED;
+    case '?':
+    case '!':
+        return QIF_R_BUDGETED;
+    default:
+        PERR("Unknown QIF Cleared flag at line %d: %s", line->lineno, line->line);
+        return QIF_R_NO;
+    }
 }
 
 QifAction qif_parse_action(QifLine line)
 {
-  QifAction qaction;
-  gpointer result;
-  char *action;
+    QifAction qaction;
+    gpointer result;
+    char *action;
 
-  g_return_val_if_fail(line, QIF_A_NONE);
-  g_return_val_if_fail(line->line, QIF_A_NONE);
+    g_return_val_if_fail(line, QIF_A_NONE);
+    g_return_val_if_fail(line->line, QIF_A_NONE);
 
-  if (!qif_action_map)
-    build_action_map();
+    if (!qif_action_map)
+        build_action_map();
 
-  /* Duplicate the action and force it to lower case and strip any spaces */
-  action = g_utf8_strdown(line->line, -1);
-  g_strstrip(action);
+    /* Duplicate the action and force it to lower case and strip any spaces */
+    action = g_utf8_strdown(line->line, -1);
+    g_strstrip(action);
 
-  result = g_hash_table_lookup(qif_action_map, action);
-  g_free(action);
+    result = g_hash_table_lookup(qif_action_map, action);
+    g_free(action);
 
-  if (!result) {
-    /* XXX: pop up a dialog? */
-    PWARN("Unknown Action at line %d: %s.  Some transactions may be discarded",
-          line->lineno, line->line);
-    return QIF_A_NONE;
-  }
+    if (!result)
+    {
+        /* XXX: pop up a dialog? */
+        PWARN("Unknown Action at line %d: %s.  Some transactions may be discarded",
+              line->lineno, line->line);
+        return QIF_A_NONE;
+    }
 
-  qaction = GPOINTER_TO_INT(result);
-  return qaction;
+    qaction = GPOINTER_TO_INT(result);
+    return qaction;
 }
 
 GList * qif_parse_acct_type(const char *str, gint lineno)
 {
-  GList *result;
-  char *type;
+    GList *result;
+    char *type;
 
-  if (!qif_atype_map)
-    build_atype_map();
+    if (!qif_atype_map)
+        build_atype_map();
 
-  /* Duplicate the type and force it to lower case and strip any spaces */
-  type = g_utf8_strdown(str, -1);
-  g_strstrip(type);
+    /* Duplicate the type and force it to lower case and strip any spaces */
+    type = g_utf8_strdown(str, -1);
+    g_strstrip(type);
 
-  result = g_hash_table_lookup(qif_atype_map, type);
-  g_free(type);
+    result = g_hash_table_lookup(qif_atype_map, type);
+    g_free(type);
 
-  if (!result) {
-    PWARN("Unknown account type at line %d: %s. ", lineno, str);
-    result = g_hash_table_lookup(qif_atype_map, "bank");
-    g_return_val_if_fail(result, NULL);
-  }
+    if (!result)
+    {
+        PWARN("Unknown account type at line %d: %s. ", lineno, str);
+        result = g_hash_table_lookup(qif_atype_map, "bank");
+        g_return_val_if_fail(result, NULL);
+    }
 
-  return result;
+    return result;
 }
 
 GList * qif_parse_acct_type_guess(QifType type)
 {
-  const char *atype = NULL;
+    const char *atype = NULL;
 
-  switch (type) {
-  case QIF_TYPE_BANK: atype = "bank"; break;
-  case QIF_TYPE_CASH: atype = "cash"; break;
-  case QIF_TYPE_CCARD: atype = "ccard"; break;
-  case QIF_TYPE_INVST: atype = "invst"; break;
-  case QIF_TYPE_PORT: atype = "port"; break;
-  case QIF_TYPE_OTH_A: atype = "oth a"; break;
-  case QIF_TYPE_OTH_L: atype = "oth l"; break;
-  default: return NULL;
-  }
+    switch (type)
+    {
+    case QIF_TYPE_BANK:
+        atype = "bank";
+        break;
+    case QIF_TYPE_CASH:
+        atype = "cash";
+        break;
+    case QIF_TYPE_CCARD:
+        atype = "ccard";
+        break;
+    case QIF_TYPE_INVST:
+        atype = "invst";
+        break;
+    case QIF_TYPE_PORT:
+        atype = "port";
+        break;
+    case QIF_TYPE_OTH_A:
+        atype = "oth a";
+        break;
+    case QIF_TYPE_OTH_L:
+        atype = "oth l";
+        break;
+    default:
+        return NULL;
+    }
 
-  return qif_parse_acct_type(atype, -1);
+    return qif_parse_acct_type(atype, -1);
 }
 
 /***********************************************************************
  * Parsing numbers and dates...
  */
 
-typedef struct _parse_helper {
-  QifContext                ctx;
+typedef struct _parse_helper
+{
+    QifContext                ctx;
 
-  GncImportFormat        budget;
-  GncImportFormat        limit;
-  GncImportFormat        amount;
-  GncImportFormat        d_amount;
-  GncImportFormat        price;
-  GncImportFormat        shares;
-  GncImportFormat        commission;
-  GncImportFormat        date;
+    GncImportFormat        budget;
+    GncImportFormat        limit;
+    GncImportFormat        amount;
+    GncImportFormat        d_amount;
+    GncImportFormat        price;
+    GncImportFormat        shares;
+    GncImportFormat        commission;
+    GncImportFormat        date;
 } *parse_helper_t;
 
 #define QIF_PARSE_CHECK_NUMBER(str,help) { \
@@ -503,382 +528,408 @@
 static void
 qif_parse_check_account(gpointer key, gpointer val, gpointer data)
 {
-  parse_helper_t helper = data;
-  QifAccount acct = val;
+    parse_helper_t helper = data;
+    QifAccount acct = val;
 
-  QIF_PARSE_CHECK_NUMBER(acct->limitstr, helper->limit);
-  QIF_PARSE_CHECK_NUMBER(acct->budgetstr, helper->budget);
+    QIF_PARSE_CHECK_NUMBER(acct->limitstr, helper->limit);
+    QIF_PARSE_CHECK_NUMBER(acct->budgetstr, helper->budget);
 }
 
 static void
 qif_parse_parse_account(gpointer key, gpointer val, gpointer data)
 {
-  parse_helper_t helper = data;
-  QifAccount acct = val;
+    parse_helper_t helper = data;
+    QifAccount acct = val;
 
-  QIF_PARSE_PARSE_NUMBER(acct->limitstr, helper->limit, &acct->limit);
-  QIF_PARSE_PARSE_NUMBER(acct->budgetstr, helper->budget, &acct->budget);
+    QIF_PARSE_PARSE_NUMBER(acct->limitstr, helper->limit, &acct->limit);
+    QIF_PARSE_PARSE_NUMBER(acct->budgetstr, helper->budget, &acct->budget);
 }
 
 static void
 qif_parse_check_category(gpointer key, gpointer val, gpointer data)
 {
-  parse_helper_t helper = data;
-  QifCategory cat = val;
+    parse_helper_t helper = data;
+    QifCategory cat = val;
 
-  QIF_PARSE_CHECK_NUMBER(cat->budgetstr, helper->budget);
+    QIF_PARSE_CHECK_NUMBER(cat->budgetstr, helper->budget);
 }
 
 static void
 qif_parse_parse_category(gpointer key, gpointer val, gpointer data)
 {
-  parse_helper_t helper = data;
-  QifCategory cat = val;
+    parse_helper_t helper = data;
+    QifCategory cat = val;
 
-  QIF_PARSE_PARSE_NUMBER(cat->budgetstr, helper->budget, &cat->budget);
+    QIF_PARSE_PARSE_NUMBER(cat->budgetstr, helper->budget, &cat->budget);
 }
 
 static void
 qif_parse_check_txn(gpointer val, gpointer data)
 {
-  parse_helper_t helper = data;
-  QifTxn txn = val;
-  QifSplit split;
-  QifInvstTxn itxn;
-  GList *node;
+    parse_helper_t helper = data;
+    QifTxn txn = val;
+    QifSplit split;
+    QifInvstTxn itxn;
+    GList *node;
 
-  /* Check the date */
-  helper->date = gnc_import_test_date(txn->datestr, helper->date);
+    /* Check the date */
+    helper->date = gnc_import_test_date(txn->datestr, helper->date);
 
-  /* If this is an investment transaction, then all the info is in
-   * the invst_info.  Otherwise it's all in the splits.
-   */
-  itxn = txn->invst_info;
-  if (itxn) {
-    QIF_PARSE_CHECK_NUMBER(itxn->amountstr, helper->amount);
-    QIF_PARSE_CHECK_NUMBER(itxn->d_amountstr, helper->d_amount);
-    QIF_PARSE_CHECK_NUMBER(itxn->pricestr, helper->price);
-    QIF_PARSE_CHECK_NUMBER(itxn->sharesstr, helper->shares);
-    QIF_PARSE_CHECK_NUMBER(itxn->commissionstr, helper->commission);
+    /* If this is an investment transaction, then all the info is in
+     * the invst_info.  Otherwise it's all in the splits.
+     */
+    itxn = txn->invst_info;
+    if (itxn)
+    {
+        QIF_PARSE_CHECK_NUMBER(itxn->amountstr, helper->amount);
+        QIF_PARSE_CHECK_NUMBER(itxn->d_amountstr, helper->d_amount);
+        QIF_PARSE_CHECK_NUMBER(itxn->pricestr, helper->price);
+        QIF_PARSE_CHECK_NUMBER(itxn->sharesstr, helper->shares);
+        QIF_PARSE_CHECK_NUMBER(itxn->commissionstr, helper->commission);
 
-  } else {
-    split = txn->default_split;
-    node = txn->splits;
-    do {
-      QIF_PARSE_CHECK_NUMBER(split->amountstr, helper->amount);
+    }
+    else
+    {
+        split = txn->default_split;
+        node = txn->splits;
+        do
+        {
+            QIF_PARSE_CHECK_NUMBER(split->amountstr, helper->amount);
 
-      if (node) {
-        split = node->data;
-        node = node->next;
-      } else
-        split = NULL;
-    } while (split);
-  }
+            if (node)
+            {
+                split = node->data;
+                node = node->next;
+            }
+            else
+                split = NULL;
+        }
+        while (split);
+    }
 }
 
 static void
 qif_parse_parse_txn(gpointer val, gpointer data)
 {
-  parse_helper_t helper = data;
-  QifTxn txn = val;
-  QifSplit split;
-  QifInvstTxn itxn;
-  GList *node;
+    parse_helper_t helper = data;
+    QifTxn txn = val;
+    QifSplit split;
+    QifInvstTxn itxn;
+    GList *node;
 
-  /* Parse the date */
-  gnc_import_parse_date(txn->datestr, helper->date, &txn->date);
+    /* Parse the date */
+    gnc_import_parse_date(txn->datestr, helper->date, &txn->date);
 
-  /* If this is an investment transaction, then all the info is in
-   * the invst_info.  Otherwise it's all in the splits.
-   */
-  itxn = txn->invst_info;
-  if (itxn) {
-    QIF_PARSE_PARSE_NUMBER(itxn->amountstr, helper->amount, &itxn->amount);
-    QIF_PARSE_PARSE_NUMBER(itxn->d_amountstr, helper->d_amount, &itxn->d_amount);
-    QIF_PARSE_PARSE_NUMBER(itxn->pricestr, helper->price, &itxn->price);
-    QIF_PARSE_PARSE_NUMBER(itxn->sharesstr, helper->shares, &itxn->shares);
-    QIF_PARSE_PARSE_NUMBER(itxn->commissionstr, helper->commission,
-                           &itxn->commission);
+    /* If this is an investment transaction, then all the info is in
+     * the invst_info.  Otherwise it's all in the splits.
+     */
+    itxn = txn->invst_info;
+    if (itxn)
+    {
+        QIF_PARSE_PARSE_NUMBER(itxn->amountstr, helper->amount, &itxn->amount);
+        QIF_PARSE_PARSE_NUMBER(itxn->d_amountstr, helper->d_amount, &itxn->d_amount);
+        QIF_PARSE_PARSE_NUMBER(itxn->pricestr, helper->price, &itxn->price);
+        QIF_PARSE_PARSE_NUMBER(itxn->sharesstr, helper->shares, &itxn->shares);
+        QIF_PARSE_PARSE_NUMBER(itxn->commissionstr, helper->commission,
+                               &itxn->commission);
 
-    qif_invst_txn_setup_splits(helper->ctx, txn);
+        qif_invst_txn_setup_splits(helper->ctx, txn);
 
-  } else {
-    split = txn->default_split;
-    node = txn->splits;
-    do {
-      QIF_PARSE_PARSE_NUMBER(split->amountstr, helper->amount, &split->amount);
+    }
+    else
+    {
+        split = txn->default_split;
+        node = txn->splits;
+        do
+        {
+            QIF_PARSE_PARSE_NUMBER(split->amountstr, helper->amount, &split->amount);
 
-      if (node) {
-        split = node->data;
-        node = node->next;
-      } else
-        split = NULL;
-    } while (split);
+            if (node)
+            {
+                split = node->data;
+                node = node->next;
+            }
+            else
+                split = NULL;
+        }
+        while (split);
 
-    qif_txn_setup_splits(txn);
-  }
+        qif_txn_setup_splits(txn);
+    }
 }
 
 void
 qif_parse_all(QifContext ctx, gpointer arg)
 {
-  struct _parse_helper helper;
+    struct _parse_helper helper;
 
-  helper.ctx = ctx;
+    helper.ctx = ctx;
 
-  /* PARSE ACCOUNTS */
+    /* PARSE ACCOUNTS */
 
-  /* First, figure out the formats */
-  helper.limit = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
-  helper.budget = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
-  qif_object_map_foreach(ctx, QIF_O_ACCOUNT, qif_parse_check_account, &helper);
+    /* First, figure out the formats */
+    helper.limit = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
+    helper.budget = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
+    qif_object_map_foreach(ctx, QIF_O_ACCOUNT, qif_parse_check_account, &helper);
 
-  /* Make sure it's not ambiguous */
-  if (helper.limit & (helper.limit - 1)) helper.limit = GNCIF_NUM_PERIOD;
-  if (helper.budget & (helper.budget - 1)) helper.budget = GNCIF_NUM_PERIOD;
+    /* Make sure it's not ambiguous */
+    if (helper.limit & (helper.limit - 1)) helper.limit = GNCIF_NUM_PERIOD;
+    if (helper.budget & (helper.budget - 1)) helper.budget = GNCIF_NUM_PERIOD;
 
-  /* Now convert the numbers */
-  qif_object_map_foreach(ctx, QIF_O_ACCOUNT, qif_parse_parse_account, &helper);
+    /* Now convert the numbers */
+    qif_object_map_foreach(ctx, QIF_O_ACCOUNT, qif_parse_parse_account, &helper);
 
-  /* PARSE CATEGORIES */
+    /* PARSE CATEGORIES */
 
-  helper.budget = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
-  qif_object_map_foreach(ctx, QIF_O_CATEGORY, qif_parse_check_category, &helper);
+    helper.budget = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
+    qif_object_map_foreach(ctx, QIF_O_CATEGORY, qif_parse_check_category, &helper);
 
-  /* make sure it's not ambiguous */
-  if (helper.budget & (helper.budget - 1)) helper.budget = GNCIF_NUM_PERIOD;
+    /* make sure it's not ambiguous */
+    if (helper.budget & (helper.budget - 1)) helper.budget = GNCIF_NUM_PERIOD;
 
-  /* Now convert the numbers */
-  qif_object_map_foreach(ctx, QIF_O_CATEGORY, qif_parse_parse_category, &helper);
+    /* Now convert the numbers */
+    qif_object_map_foreach(ctx, QIF_O_CATEGORY, qif_parse_parse_category, &helper);
 
-  /* PARSE TRANSACTIONS */
-  helper.amount = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
-  helper.d_amount = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
-  helper.price = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
-  helper.shares = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
-  helper.commission = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
-  helper.date = GNCIF_DATE_MDY | GNCIF_DATE_DMY | GNCIF_DATE_YMD | GNCIF_DATE_YDM;
+    /* PARSE TRANSACTIONS */
+    helper.amount = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
+    helper.d_amount = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
+    helper.price = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
+    helper.shares = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
+    helper.commission = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA;
+    helper.date = GNCIF_DATE_MDY | GNCIF_DATE_DMY | GNCIF_DATE_YMD | GNCIF_DATE_YDM;
 
-  qif_object_list_foreach(ctx, QIF_O_TXN, qif_parse_check_txn, &helper);
+    qif_object_list_foreach(ctx, QIF_O_TXN, qif_parse_check_txn, &helper);
 
-  /* check/fix ambiguities */
-  if (helper.amount & (helper.amount - 1)) helper.amount = GNCIF_NUM_PERIOD;
-  if (helper.d_amount & (helper.d_amount - 1)) helper.d_amount = GNCIF_NUM_PERIOD;
-  if (helper.price & (helper.price - 1)) helper.price = GNCIF_NUM_PERIOD;
-  if (helper.shares & (helper.shares - 1)) helper.shares = GNCIF_NUM_PERIOD;
-  if (helper.commission & (helper.commission - 1))
-    helper.commission = GNCIF_NUM_PERIOD;
+    /* check/fix ambiguities */
+    if (helper.amount & (helper.amount - 1)) helper.amount = GNCIF_NUM_PERIOD;
+    if (helper.d_amount & (helper.d_amount - 1)) helper.d_amount = GNCIF_NUM_PERIOD;
+    if (helper.price & (helper.price - 1)) helper.price = GNCIF_NUM_PERIOD;
+    if (helper.shares & (helper.shares - 1)) helper.shares = GNCIF_NUM_PERIOD;
+    if (helper.commission & (helper.commission - 1))
+        helper.commission = GNCIF_NUM_PERIOD;
 
-  if (helper.date & (helper.date - 1)) {
-    helper.date = gnc_import_choose_fmt(_("The Date format is ambiguous.  "
-                                          "Please choose the correct format."),
-                                        helper.date, arg);
-  }
+    if (helper.date & (helper.date - 1))
+    {
+        helper.date = gnc_import_choose_fmt(_("The Date format is ambiguous.  "
+                                              "Please choose the correct format."),
+                                            helper.date, arg);
+    }
 
-  /* now parse it.. */
-  qif_object_list_foreach(ctx, QIF_O_TXN, qif_parse_parse_txn, &helper);
+    /* now parse it.. */
+    qif_object_list_foreach(ctx, QIF_O_TXN, qif_parse_parse_txn, &helper);
 }
 
-typedef struct {
-  QifContext        ctx;
-  GList *        list;
-  const char*        type;
+typedef struct
+{
+    QifContext        ctx;
+    GList *        list;
+    const char*        type;
 } qif_merge_t;
 
 static void
 qif_merge_accts(gpointer key, gpointer value, gpointer data)
 {
-  qif_merge_t *merge = data;
-  QifAccount acct = value;
+    qif_merge_t *merge = data;
+    QifAccount acct = value;
 
-  /* Merge into the context.  Remember items moved into the parent */
-  if (qif_account_merge(merge->ctx, acct) == acct)
-    merge->list = g_list_prepend(merge->list, acct->name);
+    /* Merge into the context.  Remember items moved into the parent */
+    if (qif_account_merge(merge->ctx, acct) == acct)
+        merge->list = g_list_prepend(merge->list, acct->name);
 }
 
 static void
 qif_merge_cats(gpointer key, gpointer value, gpointer data)
 {
-  qif_merge_t *merge = data;
-  QifCategory cat = value;
+    qif_merge_t *merge = data;
+    QifCategory cat = value;
 
-  /* Merge into the context.  Remember items moved into the parent */
-  if (qif_cat_merge(merge->ctx, cat) == cat)
-    merge->list = g_list_prepend(merge->list, cat->name);
+    /* Merge into the context.  Remember items moved into the parent */
+    if (qif_cat_merge(merge->ctx, cat) == cat)
+        merge->list = g_list_prepend(merge->list, cat->name);
 }
 
 static void
 qif_merge_classes(gpointer key, gpointer value, gpointer data)
 {
-  qif_merge_t *merge = data;
-  QifClass qclass = value;
+    qif_merge_t *merge = data;
+    QifClass qclass = value;
 
-  /* Merge into the context.  Remember items moved into the parent */
-  if (qif_class_merge(merge->ctx, qclass) == qclass)
-    merge->list = g_list_prepend(merge->list, qclass->name);
+    /* Merge into the context.  Remember items moved into the parent */
+    if (qif_class_merge(merge->ctx, qclass) == qclass)
+        merge->list = g_list_prepend(merge->list, qclass->name);
 }
 
 static void
 qif_merge_secs(gpointer key, gpointer value, gpointer data)
 {
-  qif_merge_t *merge = data;
-  QifSecurity sec = value;
+    qif_merge_t *merge = data;
+    QifSecurity sec = value;
 
-  /* Merge into the context.  Remember items moved into the parent */
-  if (qif_security_merge(merge->ctx, sec) == sec)
-    merge->list = g_list_prepend(merge->list, sec->name);
+    /* Merge into the context.  Remember items moved into the parent */
+    if (qif_security_merge(merge->ctx, sec) == sec)
+        merge->list = g_list_prepend(merge->list, sec->name);
 }
 
 static void
 qif_merge_del(gpointer obj, gpointer data)
 {
-  qif_merge_t *merge = data;
-  const char *name = obj;
+    qif_merge_t *merge = data;
+    const char *name = obj;
 
-  qif_object_map_remove(merge->ctx, merge->type, name);
+    qif_object_map_remove(merge->ctx, merge->type, name);
 }
 
 static void
 qif_massage_split(QifSplit split, QifContext ctx)
 {
-  const char *type = QIF_O_CATEGORY;
-  char *name;
+    const char *type = QIF_O_CATEGORY;
+    char *name;
 
-  if (split->cat.obj) {
-    if (split->cat_is_acct) {
-      type = QIF_O_ACCOUNT;
-      name = split->cat.acct->name;
-    } else
-      name = split->cat.cat->name;
+    if (split->cat.obj)
+    {
+        if (split->cat_is_acct)
+        {
+            type = QIF_O_ACCOUNT;
+            name = split->cat.acct->name;
+        }
+        else
+            name = split->cat.cat->name;
 
-    split->cat.obj = qif_object_map_lookup(ctx, type, name);
-  }
+        split->cat.obj = qif_object_map_lookup(ctx, type, name);
+    }
 
-  if (split->cat_class) {
-    split->cat_class = (QifClass) qif_object_map_lookup(ctx, QIF_O_CLASS,
-                                                        split->cat_class->name);
-  }
+    if (split->cat_class)
+    {
+        split->cat_class = (QifClass) qif_object_map_lookup(ctx, QIF_O_CLASS,
+                           split->cat_class->name);
+    }
 }
 
 static void
 qif_massage_itxn(QifInvstTxn itxn, QifContext ctx)
 {
-  const char *type = QIF_O_CATEGORY;
-  char *name;
+    const char *type = QIF_O_CATEGORY;
+    char *name;
 
-  if (itxn->far_cat.obj) {
-    if (itxn->far_cat_is_acct) {
-      type = QIF_O_ACCOUNT;
-      name = itxn->far_cat.acct->name;
-    } else
-      name = itxn->far_cat.cat->name;
+    if (itxn->far_cat.obj)
+    {
+        if (itxn->far_cat_is_acct)
+        {
+            type = QIF_O_ACCOUNT;
+            name = itxn->far_cat.acct->name;
+        }
+        else
+            name = itxn->far_cat.cat->name;
 
-    itxn->far_cat.obj = qif_object_map_lookup(ctx, type, name);
-  }
+        itxn->far_cat.obj = qif_object_map_lookup(ctx, type, name);
+    }
 }
 
 static void
 qif_massage_txn(gpointer obj, gpointer data)
 {
-  QifTxn txn = obj;
-  QifContext ctx = data;
-  QifSplit split;
-  GList *node;
+    QifTxn txn = obj;
+    QifContext ctx = data;
+    QifSplit split;
+    GList *node;
 
-  if (txn->from_acct)
-    txn->from_acct = (QifAccount) qif_object_map_lookup(ctx, QIF_O_ACCOUNT,
-                                                        txn->from_acct->name);
+    if (txn->from_acct)
+        txn->from_acct = (QifAccount) qif_object_map_lookup(ctx, QIF_O_ACCOUNT,
+                         txn->from_acct->name);
 
-  if (txn->invst_info)
-    qif_massage_itxn(txn->invst_info, ctx);
+    if (txn->invst_info)
+        qif_massage_itxn(txn->invst_info, ctx);
 
-  if (txn->default_split)
-    qif_massage_split(txn->default_split, ctx);
+    if (txn->default_split)
+        qif_massage_split(txn->default_split, ctx);
 
-  for (node = txn->splits; node; node = node->next) {
-    split = node->data;
-    qif_massage_split(split, ctx);
-  }
+    for (node = txn->splits; node; node = node->next)
+    {
+        split = node->data;
+        qif_massage_split(split, ctx);
+    }
 }
 
 void
 qif_parse_merge_files(QifContext ctx)
 {
-  GList *node;
-  GList *accts = NULL;
-  GList *cats = NULL;
-  GList *classes = NULL;
-  GList *securities = NULL;
-  QifContext fctx;
+    GList *node;
+    GList *accts = NULL;
+    GList *cats = NULL;
+    GList *classes = NULL;
+    GList *securities = NULL;
+    QifContext fctx;
 
-  qif_merge_t merge;
+    qif_merge_t merge;
 
-  g_return_if_fail(ctx);
+    g_return_if_fail(ctx);
 
-  /* Make sure each of the "file" contexts have been parsed.
-   * note that we don't care about OUR context -- we can run this
-   * process multiple times safely.
-   */
-  for (node = ctx->files; node; node = node->next) {
-    fctx = node->data;
-    g_return_if_fail(fctx->parsed);
-  }
+    /* Make sure each of the "file" contexts have been parsed.
+     * note that we don't care about OUR context -- we can run this
+     * process multiple times safely.
+     */
+    for (node = ctx->files; node; node = node->next)
+    {
+        fctx = node->data;
+        g_return_if_fail(fctx->parsed);
+    }
 
 
-  /* Iterate over each file.  Merge the Accounts, Categories, Classes,
-   * Securities, and Transactions into the top-level context.  Be sure
-   * to re-point all Transaction/Split category/class/account pointers
-   * to the new top-level item.  Then be sure to remove the
-   * "duplicated" items so we don't double-free (as we don't refcount,
-   * either).
-   */
-  for (node = ctx->files; node; node = node->next) {
-    fctx = node->data;
+    /* Iterate over each file.  Merge the Accounts, Categories, Classes,
+     * Securities, and Transactions into the top-level context.  Be sure
+     * to re-point all Transaction/Split category/class/account pointers
+     * to the new top-level item.  Then be sure to remove the
+     * "duplicated" items so we don't double-free (as we don't refcount,
+     * either).
+     */
+    for (node = ctx->files; node; node = node->next)
+    {
+        fctx = node->data;
 
-    /* Merge accts, categories, classes, and securities */
+        /* Merge accts, categories, classes, and securities */
 
-    merge.ctx = ctx;
-    merge.list = NULL;
-    qif_object_map_foreach(fctx, QIF_O_ACCOUNT, qif_merge_accts, &merge);
-    accts = merge.list;
+        merge.ctx = ctx;
+        merge.list = NULL;
+        qif_object_map_foreach(fctx, QIF_O_ACCOUNT, qif_merge_accts, &merge);
+        accts = merge.list;
 
-    merge.list = NULL;
-    qif_object_map_foreach(fctx, QIF_O_CATEGORY, qif_merge_cats, &merge);
-    cats = merge.list;
+        merge.list = NULL;
+        qif_object_map_foreach(fctx, QIF_O_CATEGORY, qif_merge_cats, &merge);
+        cats = merge.list;
 
-    merge.list = NULL;
-    qif_object_map_foreach(fctx, QIF_O_CLASS, qif_merge_classes, &merge);
-    classes = merge.list;
+        merge.list = NULL;
+        qif_object_map_foreach(fctx, QIF_O_CLASS, qif_merge_classes, &merge);
+        classes = merge.list;
 
-    merge.list = NULL;
-    qif_object_map_foreach(fctx, QIF_O_SECURITY, qif_merge_secs, &merge);
-    securities = merge.list;
+        merge.list = NULL;
+        qif_object_map_foreach(fctx, QIF_O_SECURITY, qif_merge_secs, &merge);
+        securities = merge.list;
 
 
-    /* repoint the transactions to the merged context data */
-    qif_object_list_foreach(fctx, QIF_O_TXN, qif_massage_txn, ctx);
+        /* repoint the transactions to the merged context data */
+        qif_object_list_foreach(fctx, QIF_O_TXN, qif_massage_txn, ctx);
 
 
-    /* then remove from the file context objects referenced in the top context */
-    merge.ctx = fctx;
-    merge.type = QIF_O_ACCOUNT;
-    g_list_foreach(accts, qif_merge_del, &merge);
-    g_list_free(accts);
+        /* then remove from the file context objects referenced in the top context */
+        merge.ctx = fctx;
+        merge.type = QIF_O_ACCOUNT;
+        g_list_foreach(accts, qif_merge_del, &merge);
+        g_list_free(accts);
 
-    merge.type = QIF_O_CATEGORY;
-    g_list_foreach(cats, qif_merge_del, &merge);
-    g_list_free(cats);
+        merge.type = QIF_O_CATEGORY;
+        g_list_foreach(cats, qif_merge_del, &merge);
+        g_list_free(cats);
 
-    merge.type = QIF_O_CLASS;
-    g_list_foreach(classes, qif_merge_del, &merge);
-    g_list_free(classes);
+        merge.type = QIF_O_CLASS;
+        g_list_foreach(classes, qif_merge_del, &merge);
+        g_list_free(classes);
 
-    merge.type = QIF_O_SECURITY;
-    g_list_foreach(securities, qif_merge_del, &merge);
-    g_list_free(securities);
+        merge.type = QIF_O_SECURITY;
+        g_list_foreach(securities, qif_merge_del, &merge);
+        g_list_free(securities);
 
-  }
+    }
 
-  /* We've been parsed */
-  ctx->parsed = TRUE;
+    /* We've been parsed */
+    ctx->parsed = TRUE;
 }

Modified: gnucash/trunk/src/import-export/qif/qif-parse.h
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-parse.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/qif-parse.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -32,9 +32,9 @@
 
 gboolean
 qif_parse_split_category(const char* str,
-			 char** cat, gboolean *cat_is_acct, char** cat_class,
-			 char** miscx_cat, gboolean *miscx_cat_is_acct,
-			 char **miscx_class);
+                         char** cat, gboolean *cat_is_acct, char** cat_class,
+                         char** miscx_cat, gboolean *miscx_cat_is_acct,
+                         char **miscx_class);
 
 gboolean qif_parse_numeric(QifLine line, gnc_numeric *num);
 QifRecnFlag qif_parse_cleared(QifLine line);

Modified: gnucash/trunk/src/import-export/qif/test/test-link.c
===================================================================
--- gnucash/trunk/src/import-export/qif/test/test-link.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/test/test-link.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -3,6 +3,6 @@
 int
 main(int argc, char *argv[])
 {
-  qif_context_new();
-  return 0;
+    qif_context_new();
+    return 0;
 }

Modified: gnucash/trunk/src/import-export/qif/test/test-qif.c
===================================================================
--- gnucash/trunk/src/import-export/qif/test/test-qif.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif/test/test-qif.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -36,74 +36,75 @@
 
 static QifContext
 test_qif_load_file(QifContext ctx, const char *filename,
-		   gint txn_count, gint acct_count, gboolean needs_acct)
+                   gint txn_count, gint acct_count, gboolean needs_acct)
 {
-  QifContext file;
+    QifContext file;
 
-  printf("qif loading \"%s\"...\n", filename);
-  file = qif_file_new(ctx, filename);
-  do_test(file != NULL, "failed to read file");
-  if (!file) return NULL;
+    printf("qif loading \"%s\"...\n", filename);
+    file = qif_file_new(ctx, filename);
+    do_test(file != NULL, "failed to read file");
+    if (!file) return NULL;
 
-  do_test(qif_object_list_count(file, QIF_O_TXN) == txn_count,
-	  "Transaction count didn't match");
-  do_test(qif_object_map_count(file, QIF_O_ACCOUNT) == acct_count,
-	  "Account count didn't match");
-  do_test(qif_file_needs_account(file) == needs_acct,
-	  "Needs account flad didn't match");
+    do_test(qif_object_list_count(file, QIF_O_TXN) == txn_count,
+            "Transaction count didn't match");
+    do_test(qif_object_map_count(file, QIF_O_ACCOUNT) == acct_count,
+            "Account count didn't match");
+    do_test(qif_file_needs_account(file) == needs_acct,
+            "Needs account flad didn't match");
 
-  return file;
+    return file;
 }
 
 static void
 test_qif(void)
 {
-  QifContext ctx, file;
-  char *filename;
-  const char *location = g_getenv("GNC_TEST_FILES");
-  int i;
+    QifContext ctx, file;
+    char *filename;
+    const char *location = g_getenv("GNC_TEST_FILES");
+    int i;
 
-  ctx = qif_context_new();
-  do_test(ctx != NULL, "failed to create the qif context");
-  if (!ctx) return;
+    ctx = qif_context_new();
+    do_test(ctx != NULL, "failed to create the qif context");
+    if (!ctx) return;
 
-  if (!location)
-    location = "test-files";
+    if (!location)
+        location = "test-files";
 
-  for (i = 0; i < 1; i++) {
-    filename = g_strdup_printf("%s/%s", location, "test-1-bank-txn.qif");
-    file = test_qif_load_file(ctx, filename, 1, 0, TRUE);
-    g_free(filename);
-    if (!file) continue;
+    for (i = 0; i < 1; i++)
+    {
+        filename = g_strdup_printf("%s/%s", location, "test-1-bank-txn.qif");
+        file = test_qif_load_file(ctx, filename, 1, 0, TRUE);
+        g_free(filename);
+        if (!file) continue;
 
-    if (qif_file_needs_account(file))
-      qif_file_set_default_account(file, "test-1-bank-txn");
+        if (qif_file_needs_account(file))
+            qif_file_set_default_account(file, "test-1-bank-txn");
 
-    do_test(qif_file_needs_account(file) == FALSE,
-	    "'Needs account' flag not cleared properly");
+        do_test(qif_file_needs_account(file) == FALSE,
+                "'Needs account' flag not cleared properly");
 
-    do_test(qif_file_parse(file, NULL) == QIF_E_OK,
-	    "file failed to parse.");
-  }  
+        do_test(qif_file_parse(file, NULL) == QIF_E_OK,
+                "file failed to parse.");
+    }
 
-  qif_context_destroy(ctx);
+    qif_context_destroy(ctx);
 
-  success("QIF test successful");
+    success("QIF test successful");
 }
 
 static void
 main_helper(void *closure, int argc, char **argv)
 {
-  qif_object_init();		/* XXX:FIXME */
-  test_qif();
-  print_test_results();
-  exit(get_rv());
+    qif_object_init();		/* XXX:FIXME */
+    test_qif();
+    print_test_results();
+    exit(get_rv());
 }
 
 int
 main(int argc, char **argv)
 {
-  scm_boot_guile(argc, argv, main_helper, NULL);
-  return 0;
+    scm_boot_guile(argc, argv, main_helper, NULL);
+    return 0;
 }
 

Modified: gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -35,19 +35,21 @@
 #include "gnc-gui-query.h"
 #include "gnc-ui-util.h"
 
-enum account_cols {
-  ACCOUNT_COL_NAME = 0,
-  ACCOUNT_COL_FULLNAME,
-  ACCOUNT_COL_CHECK,
-  NUM_ACCOUNT_COLS
+enum account_cols
+{
+    ACCOUNT_COL_NAME = 0,
+    ACCOUNT_COL_FULLNAME,
+    ACCOUNT_COL_CHECK,
+    NUM_ACCOUNT_COLS
 };
 
-struct _accountpickerdialog {
-  GtkWidget       * dialog;
-  GtkTreeView     * treeview;
-  QIFImportWindow * qif_wind;
-  SCM             map_entry;
-  gchar           * selected_name;
+struct _accountpickerdialog
+{
+    GtkWidget       * dialog;
+    GtkTreeView     * treeview;
+    QIFImportWindow * qif_wind;
+    SCM             map_entry;
+    gchar           * selected_name;
 };
 
 
@@ -69,68 +71,76 @@
                     const char *search_name,
                     GtkTreeRowReference **reference)
 {
-  GtkTreeIter  iter;
-  const char   * compname;
-  char         * acctname;
-  gboolean     leafnode;
-  SCM          current;
-  gboolean     checked;
+    GtkTreeIter  iter;
+    const char   * compname;
+    char         * acctname;
+    gboolean     leafnode;
+    SCM          current;
+    gboolean     checked;
 
-  while(!scm_is_null(accts)) {
-    current = SCM_CAR(accts);
+    while (!scm_is_null(accts))
+    {
+        current = SCM_CAR(accts);
 
-    if(scm_is_null(current)) {
-      g_critical("QIF import: BUG DETECTED in acct_tree_add_accts!");
-      accts = SCM_CDR(accts);
-      continue;
-    }
+        if (scm_is_null(current))
+        {
+            g_critical("QIF import: BUG DETECTED in acct_tree_add_accts!");
+            accts = SCM_CDR(accts);
+            continue;
+        }
 
-    if (scm_is_string(SCM_CAR(current)))
-      compname = scm_to_locale_string(SCM_CAR(current));
-    else
-      compname = "";
+        if (scm_is_string(SCM_CAR(current)))
+            compname = scm_to_locale_string(SCM_CAR(current));
+        else
+            compname = "";
 
-    if (!scm_is_null(SCM_CADDR(current))) {
-      leafnode = FALSE;
-    }
-    else {
-      leafnode = TRUE;
-    }
+        if (!scm_is_null(SCM_CADDR(current)))
+        {
+            leafnode = FALSE;
+        }
+        else
+        {
+            leafnode = TRUE;
+        }
 
-    /* compute full name */
-    if (base_name && *base_name) {
-      acctname = g_strjoin(gnc_get_account_separator_string(),
-                           base_name, compname, (char *)NULL);
-    }
-    else {
-      acctname = g_strdup(compname);
-    }
+        /* compute full name */
+        if (base_name && *base_name)
+        {
+            acctname = g_strjoin(gnc_get_account_separator_string(),
+                                 base_name, compname, (char *)NULL);
+        }
+        else
+        {
+            acctname = g_strdup(compname);
+        }
 
-    checked = (SCM_CADR(current) == SCM_BOOL_T);
+        checked = (SCM_CADR(current) == SCM_BOOL_T);
 
-    gtk_tree_store_append(store, &iter, parent);
-    gtk_tree_store_set(store, &iter,
-                       ACCOUNT_COL_NAME, compname,
-                       ACCOUNT_COL_FULLNAME, acctname,
-                       ACCOUNT_COL_CHECK, checked,
-                       -1);
+        gtk_tree_store_append(store, &iter, parent);
+        gtk_tree_store_set(store, &iter,
+                           ACCOUNT_COL_NAME, compname,
+                           ACCOUNT_COL_FULLNAME, acctname,
+                           ACCOUNT_COL_CHECK, checked,
+                           -1);
 
-    if (reference && !*reference &&
-        search_name && (g_utf8_collate(search_name, acctname) == 0)) {
-      GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
-      *reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
-      gtk_tree_path_free(path);
-    }
+        if (reference && !*reference &&
+                search_name && (g_utf8_collate(search_name, acctname) == 0))
+        {
+            GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+            *reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
+            gtk_tree_path_free(path);
+        }
 
-    if(!leafnode) {
-      acct_tree_add_accts(SCM_CADDR(current), store, &iter, acctname,
-                          search_name, reference);
-    }
+        if (!leafnode)
+        {
+            acct_tree_add_accts(SCM_CADDR(current), store, &iter, acctname,
+                                search_name, reference);
+        }
 
-    g_free(acctname);
+        g_free(acctname);
 
-    accts = SCM_CDR(accts);
-  }
+        accts = SCM_CDR(accts);
+    }
 }
 
 
@@ -143,40 +153,42 @@
 static void
 build_acct_tree(QIFAccountPickerDialog * picker, QIFImportWindow * import)
 {
-  SCM  get_accts = scm_c_eval_string("qif-import:get-all-accts");
-  SCM  acct_tree;
-  GtkTreeStore *store;
-  GtkTreePath *path;
-  GtkTreeSelection* selection;
-  GtkTreeRowReference *reference = NULL;
-  gchar *name_to_select;
+    SCM  get_accts = scm_c_eval_string("qif-import:get-all-accts");
+    SCM  acct_tree;
+    GtkTreeStore *store;
+    GtkTreePath *path;
+    GtkTreeSelection* selection;
+    GtkTreeRowReference *reference = NULL;
+    gchar *name_to_select;
 
-  g_return_if_fail(picker && import);
+    g_return_if_fail(picker && import);
 
-  /* Get an account tree with all existing and to-be-imported accounts. */
-  acct_tree = scm_call_1(get_accts,
-                         gnc_ui_qif_import_druid_get_mappings(import));
+    /* Get an account tree with all existing and to-be-imported accounts. */
+    acct_tree = scm_call_1(get_accts,
+                           gnc_ui_qif_import_druid_get_mappings(import));
 
-  /* Rebuild the store.
-   * NOTE: It is necessary to save a copy of the name to select, because
-   *       when the store is cleared, everything becomes unselected. */
-  name_to_select = g_strdup(picker->selected_name);
-  store = GTK_TREE_STORE(gtk_tree_view_get_model(picker->treeview));
-  gtk_tree_store_clear(store);
-  acct_tree_add_accts(acct_tree, store, NULL, NULL, name_to_select, &reference);
-  g_free(name_to_select);
+    /* Rebuild the store.
+     * NOTE: It is necessary to save a copy of the name to select, because
+     *       when the store is cleared, everything becomes unselected. */
+    name_to_select = g_strdup(picker->selected_name);
+    store = GTK_TREE_STORE(gtk_tree_view_get_model(picker->treeview));
+    gtk_tree_store_clear(store);
+    acct_tree_add_accts(acct_tree, store, NULL, NULL, name_to_select, &reference);
+    g_free(name_to_select);
 
-  /* Select and display the indicated account (if it was found). */
-  if (reference) {
-    selection = gtk_tree_view_get_selection(picker->treeview);
-    path = gtk_tree_row_reference_get_path(reference);
-    if (path) {
-      gtk_tree_view_expand_to_path(picker->treeview, path);
-      gtk_tree_selection_select_path(selection, path);
-      gtk_tree_path_free(path);
+    /* Select and display the indicated account (if it was found). */
+    if (reference)
+    {
+        selection = gtk_tree_view_get_selection(picker->treeview);
+        path = gtk_tree_row_reference_get_path(reference);
+        if (path)
+        {
+            gtk_tree_view_expand_to_path(picker->treeview, path);
+            gtk_tree_selection_select_path(selection, path);
+            gtk_tree_path_free(path);
+        }
+        gtk_tree_row_reference_free(reference);
     }
-    gtk_tree_row_reference_free(reference);
-  }
 }
 
 
@@ -190,95 +202,99 @@
 static void
 gnc_ui_qif_account_picker_new_cb(GtkButton * w, gpointer user_data)
 {
-  QIFAccountPickerDialog * wind = user_data;
-  SCM name_setter = scm_c_eval_string("qif-map-entry:set-gnc-name!");
-  const gchar *name;
-  int response;
-  gchar *fullname;
-  GtkWidget *dlg, *entry;
+    QIFAccountPickerDialog * wind = user_data;
+    SCM name_setter = scm_c_eval_string("qif-map-entry:set-gnc-name!");
+    const gchar *name;
+    int response;
+    gchar *fullname;
+    GtkWidget *dlg, *entry;
 
-  /* Create a dialog to get the new account name. */
-  dlg = gtk_message_dialog_new(GTK_WINDOW(wind->dialog),
-                               GTK_DIALOG_DESTROY_WITH_PARENT,
-                               GTK_MESSAGE_QUESTION,
-                               GTK_BUTTONS_OK_CANCEL,
-                               "%s", _("Enter a name for the account"));
-  gtk_dialog_set_default_response(GTK_DIALOG(dlg), GTK_RESPONSE_OK);
-  entry = gtk_entry_new();
-  gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
-  gtk_entry_set_max_length(GTK_ENTRY(entry), 250);
-  gtk_widget_show(entry);
-  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dlg)->vbox), entry);
+    /* Create a dialog to get the new account name. */
+    dlg = gtk_message_dialog_new(GTK_WINDOW(wind->dialog),
+                                 GTK_DIALOG_DESTROY_WITH_PARENT,
+                                 GTK_MESSAGE_QUESTION,
+                                 GTK_BUTTONS_OK_CANCEL,
+                                 "%s", _("Enter a name for the account"));
+    gtk_dialog_set_default_response(GTK_DIALOG(dlg), GTK_RESPONSE_OK);
+    entry = gtk_entry_new();
+    gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
+    gtk_entry_set_max_length(GTK_ENTRY(entry), 250);
+    gtk_widget_show(entry);
+    gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dlg)->vbox), entry);
 
-  /* Run the dialog to get the new account name. */
-  response = gtk_dialog_run(GTK_DIALOG(dlg));
-  name = gtk_entry_get_text(GTK_ENTRY(entry));
+    /* Run the dialog to get the new account name. */
+    response = gtk_dialog_run(GTK_DIALOG(dlg));
+    name = gtk_entry_get_text(GTK_ENTRY(entry));
 
-  /* Did the user enter a name and click OK? */
-  if (response == GTK_RESPONSE_OK && name && *name) {
-    /* If an account is selected, this will be a new subaccount. */
-    if(wind->selected_name && *(wind->selected_name))
-      /* We have the short name; determine the full name. */
-      fullname = g_strjoin(gnc_get_account_separator_string(),
-                           wind->selected_name, name, (char *)NULL);
-    else
-      fullname = g_strdup(name);
+    /* Did the user enter a name and click OK? */
+    if (response == GTK_RESPONSE_OK && name && *name)
+    {
+        /* If an account is selected, this will be a new subaccount. */
+        if (wind->selected_name && *(wind->selected_name))
+            /* We have the short name; determine the full name. */
+            fullname = g_strjoin(gnc_get_account_separator_string(),
+                                 wind->selected_name, name, (char *)NULL);
+        else
+            fullname = g_strdup(name);
 
-    /* Save the full name and update the map entry. */
-    g_free(wind->selected_name);
-    wind->selected_name = fullname;
-    scm_call_2(name_setter, wind->map_entry, scm_makfrom0str(fullname));
-  }
-  gtk_widget_destroy(dlg);
+        /* Save the full name and update the map entry. */
+        g_free(wind->selected_name);
+        wind->selected_name = fullname;
+        scm_call_2(name_setter, wind->map_entry, scm_makfrom0str(fullname));
+    }
+    gtk_widget_destroy(dlg);
 
-  /* Refresh the tree display and give it the focus. */
-  build_acct_tree(wind, wind->qif_wind);
-  gtk_widget_grab_focus(GTK_WIDGET(wind->treeview));
+    /* Refresh the tree display and give it the focus. */
+    build_acct_tree(wind, wind->qif_wind);
+    gtk_widget_grab_focus(GTK_WIDGET(wind->treeview));
 }
 
 static void
 gnc_ui_qif_account_picker_changed_cb(GtkTreeSelection *selection,
                                      gpointer          user_data)
 {
-  QIFAccountPickerDialog * wind = user_data;
-  SCM name_setter = scm_c_eval_string("qif-map-entry:set-gnc-name!");
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    QIFAccountPickerDialog * wind = user_data;
+    SCM name_setter = scm_c_eval_string("qif-map-entry:set-gnc-name!");
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  g_free(wind->selected_name);
-  if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
-    gtk_tree_model_get(model, &iter,
-                       ACCOUNT_COL_FULLNAME, &wind->selected_name,
-                       -1);
-    scm_call_2(name_setter, wind->map_entry,
-               scm_makfrom0str(wind->selected_name));
-  } else {
-    wind->selected_name = NULL;
-  }
+    g_free(wind->selected_name);
+    if (gtk_tree_selection_get_selected(selection, &model, &iter))
+    {
+        gtk_tree_model_get(model, &iter,
+                           ACCOUNT_COL_FULLNAME, &wind->selected_name,
+                           -1);
+        scm_call_2(name_setter, wind->map_entry,
+                   scm_makfrom0str(wind->selected_name));
+    }
+    else
+    {
+        wind->selected_name = NULL;
+    }
 }
 
 static void
 gnc_ui_qif_account_picker_row_activated_cb(GtkTreeView *view,
-                                           GtkTreePath *path,
-                                           GtkTreeViewColumn *column,
-                                           gpointer user_data)
+        GtkTreePath *path,
+        GtkTreeViewColumn *column,
+        gpointer user_data)
 {
-  QIFAccountPickerDialog *wind = user_data;
-  g_return_if_fail(wind);
+    QIFAccountPickerDialog *wind = user_data;
+    g_return_if_fail(wind);
 
-  gtk_dialog_response(GTK_DIALOG(wind->dialog), GTK_RESPONSE_OK);
+    gtk_dialog_response(GTK_DIALOG(wind->dialog), GTK_RESPONSE_OK);
 }
 
 static int
 gnc_ui_qif_account_picker_map_cb(GtkWidget * w, gpointer user_data)
 {
-  QIFAccountPickerDialog * wind = user_data;
+    QIFAccountPickerDialog * wind = user_data;
 
-  /* update the tree display with all the existing accounts plus all
-   * the ones the QIF importer thinks it will be creating.  this will
-   * also select the map_entry line. */
-  build_acct_tree(wind, wind->qif_wind);
-  return FALSE;
+    /* update the tree display with all the existing accounts plus all
+     * the ones the QIF importer thinks it will be creating.  this will
+     * also select the map_entry line. */
+    build_acct_tree(wind, wind->qif_wind);
+    return FALSE;
 }
 
 
@@ -294,98 +310,100 @@
 gboolean
 qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
 {
-  QIFAccountPickerDialog * wind;
-  SCM gnc_name     = scm_c_eval_string("qif-map-entry:gnc-name");
-  SCM set_gnc_name = scm_c_eval_string("qif-map-entry:set-gnc-name!");
-  SCM orig_acct    = scm_call_1(gnc_name, map_entry);
-  int response;
-  GladeXML *xml;
-  GtkWidget *button;
+    QIFAccountPickerDialog * wind;
+    SCM gnc_name     = scm_c_eval_string("qif-map-entry:gnc-name");
+    SCM set_gnc_name = scm_c_eval_string("qif-map-entry:set-gnc-name!");
+    SCM orig_acct    = scm_call_1(gnc_name, map_entry);
+    int response;
+    GladeXML *xml;
+    GtkWidget *button;
 
-  wind = g_new0(QIFAccountPickerDialog, 1);
+    wind = g_new0(QIFAccountPickerDialog, 1);
 
-  /* Save the map entry. */
-  wind->map_entry = map_entry;
-  scm_gc_protect_object(wind->map_entry);
+    /* Save the map entry. */
+    wind->map_entry = map_entry;
+    scm_gc_protect_object(wind->map_entry);
 
-  /* Set the initial account to be selected. */
-  wind->selected_name = g_strdup(scm_to_locale_string(orig_acct));
+    /* Set the initial account to be selected. */
+    wind->selected_name = g_strdup(scm_to_locale_string(orig_acct));
 
 
-  xml = gnc_glade_xml_new("qif.glade", "QIF Import Account Picker");
+    xml = gnc_glade_xml_new("qif.glade", "QIF Import Account Picker");
 
-  glade_xml_signal_connect_data(xml,
-                                "gnc_ui_qif_account_picker_new_cb",
-                                G_CALLBACK(gnc_ui_qif_account_picker_new_cb),
-                                wind);
+    glade_xml_signal_connect_data(xml,
+                                  "gnc_ui_qif_account_picker_new_cb",
+                                  G_CALLBACK(gnc_ui_qif_account_picker_new_cb),
+                                  wind);
 
-  wind->dialog     = glade_xml_get_widget(xml, "QIF Import Account Picker");
-  wind->treeview   = GTK_TREE_VIEW(glade_xml_get_widget(xml, "account_tree"));
-  wind->qif_wind   = qif_wind;
+    wind->dialog     = glade_xml_get_widget(xml, "QIF Import Account Picker");
+    wind->treeview   = GTK_TREE_VIEW(glade_xml_get_widget(xml, "account_tree"));
+    wind->qif_wind   = qif_wind;
 
 
-  {
-    GtkTreeStore *store;
-    GtkCellRenderer *renderer;
-    GtkTreeViewColumn *column;
-    GtkTreeSelection *selection;
+    {
+        GtkTreeStore *store;
+        GtkCellRenderer *renderer;
+        GtkTreeViewColumn *column;
+        GtkTreeSelection *selection;
 
-    store = gtk_tree_store_new(NUM_ACCOUNT_COLS, G_TYPE_STRING, G_TYPE_STRING,
-                               G_TYPE_BOOLEAN);
-    gtk_tree_view_set_model(wind->treeview, GTK_TREE_MODEL(store));
-    g_object_unref(store);
+        store = gtk_tree_store_new(NUM_ACCOUNT_COLS, G_TYPE_STRING, G_TYPE_STRING,
+                                   G_TYPE_BOOLEAN);
+        gtk_tree_view_set_model(wind->treeview, GTK_TREE_MODEL(store));
+        g_object_unref(store);
 
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Account"),
-                                                      renderer,
-                                                      "text",
-                                                      ACCOUNT_COL_NAME,
-                                                      NULL);
-    g_object_set(column, "expand", TRUE, NULL);
-    gtk_tree_view_append_column(wind->treeview, column);
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes(_("Account"),
+                 renderer,
+                 "text",
+                 ACCOUNT_COL_NAME,
+                 NULL);
+        g_object_set(column, "expand", TRUE, NULL);
+        gtk_tree_view_append_column(wind->treeview, column);
 
-    renderer = gtk_cell_renderer_toggle_new();
-    g_object_set(renderer, "activatable", FALSE, NULL);
-    column = gtk_tree_view_column_new_with_attributes(_("New?"),
-                                                      renderer,
-                                                      "active",
-                                                      ACCOUNT_COL_CHECK,
-                                                      NULL);
-    gtk_tree_view_append_column(wind->treeview, column);
+        renderer = gtk_cell_renderer_toggle_new();
+        g_object_set(renderer, "activatable", FALSE, NULL);
+        column = gtk_tree_view_column_new_with_attributes(_("New?"),
+                 renderer,
+                 "active",
+                 ACCOUNT_COL_CHECK,
+                 NULL);
+        gtk_tree_view_append_column(wind->treeview, column);
 
-    selection = gtk_tree_view_get_selection(wind->treeview);
-    g_signal_connect(selection, "changed",
-                     G_CALLBACK(gnc_ui_qif_account_picker_changed_cb), wind);
-    g_signal_connect(wind->treeview, "row-activated",
-                     G_CALLBACK(gnc_ui_qif_account_picker_row_activated_cb),
-                     wind);
-  }
-
-  g_signal_connect_after(wind->dialog, "map",
-                         G_CALLBACK(gnc_ui_qif_account_picker_map_cb),
+        selection = gtk_tree_view_get_selection(wind->treeview);
+        g_signal_connect(selection, "changed",
+                         G_CALLBACK(gnc_ui_qif_account_picker_changed_cb), wind);
+        g_signal_connect(wind->treeview, "row-activated",
+                         G_CALLBACK(gnc_ui_qif_account_picker_row_activated_cb),
                          wind);
+    }
 
-  button = glade_xml_get_widget(xml, "newbutton");
-  gtk_button_set_use_stock(GTK_BUTTON(button), TRUE);
+    g_signal_connect_after(wind->dialog, "map",
+                           G_CALLBACK(gnc_ui_qif_account_picker_map_cb),
+                           wind);
 
-  /* this is to get the checkmarks set up right.. it will get called
-   * again after the window is mapped. */
-  build_acct_tree(wind, wind->qif_wind);
+    button = glade_xml_get_widget(xml, "newbutton");
+    gtk_button_set_use_stock(GTK_BUTTON(button), TRUE);
 
-  do {
-    response = gtk_dialog_run(GTK_DIALOG(wind->dialog));
-  } while (response == GNC_RESPONSE_NEW);
-  gtk_widget_destroy(wind->dialog);
+    /* this is to get the checkmarks set up right.. it will get called
+     * again after the window is mapped. */
+    build_acct_tree(wind, wind->qif_wind);
 
-  scm_gc_unprotect_object(wind->map_entry);
-  g_free(wind->selected_name);
-  g_free(wind);
+    do
+    {
+        response = gtk_dialog_run(GTK_DIALOG(wind->dialog));
+    }
+    while (response == GNC_RESPONSE_NEW);
+    gtk_widget_destroy(wind->dialog);
 
-  if (response == GTK_RESPONSE_OK)
-    return TRUE;
+    scm_gc_unprotect_object(wind->map_entry);
+    g_free(wind->selected_name);
+    g_free(wind);
 
-  /* Restore the original mapping. */
-  scm_call_2(set_gnc_name, map_entry, orig_acct);
+    if (response == GTK_RESPONSE_OK)
+        return TRUE;
 
-  return FALSE;
+    /* Restore the original mapping. */
+    scm_call_2(set_gnc_name, map_entry, orig_acct);
+
+    return FALSE;
 }

Modified: gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/druid-qif-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif-import/druid-qif-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -62,118 +62,123 @@
 
 #define PREV_ROW "prev_row"
 
-enum filename_cols {
-  FILENAME_COL_INDEX = 0,
-  FILENAME_COL_NAME,
-  NUM_FILENAME_COLS
+enum filename_cols
+{
+    FILENAME_COL_INDEX = 0,
+    FILENAME_COL_NAME,
+    NUM_FILENAME_COLS
 };
 
-enum account_cols {
-  ACCOUNT_COL_INDEX = 0,
-  ACCOUNT_COL_QIF_NAME,
-  ACCOUNT_COL_GNC_NAME,
-  ACCOUNT_COL_NEW,
-  ACCOUNT_COL_ELLIPSIZE,
-  NUM_ACCOUNT_COLS
+enum account_cols
+{
+    ACCOUNT_COL_INDEX = 0,
+    ACCOUNT_COL_QIF_NAME,
+    ACCOUNT_COL_GNC_NAME,
+    ACCOUNT_COL_NEW,
+    ACCOUNT_COL_ELLIPSIZE,
+    NUM_ACCOUNT_COLS
 };
 
-enum qif_trans_cols {
-  QIF_TRANS_COL_INDEX = 0,
-  QIF_TRANS_COL_DATE,
-  QIF_TRANS_COL_DESCRIPTION,
-  QIF_TRANS_COL_AMOUNT,
-  QIF_TRANS_COL_CHECKED,
-  NUM_QIF_TRANS_COLS
+enum qif_trans_cols
+{
+    QIF_TRANS_COL_INDEX = 0,
+    QIF_TRANS_COL_DATE,
+    QIF_TRANS_COL_DESCRIPTION,
+    QIF_TRANS_COL_AMOUNT,
+    QIF_TRANS_COL_CHECKED,
+    NUM_QIF_TRANS_COLS
 };
 
-struct _qifimportwindow {
-  GtkWidget * window;
-  GtkWidget * druid;
+struct _qifimportwindow
+{
+    GtkWidget * window;
+    GtkWidget * druid;
 
-  /* Widgets on the file selection page. */
-  GtkWidget * filename_entry;
+    /* Widgets on the file selection page. */
+    GtkWidget * filename_entry;
 
-  /* File loading progress page. */
-  GtkWidget * load_pause;
-  GtkWidget * load_log;
-  GNCProgressDialog *load_progress;
+    /* File loading progress page. */
+    GtkWidget * load_pause;
+    GtkWidget * load_log;
+    GNCProgressDialog *load_progress;
 
-  /* Widgets on the default account page. */
-  GtkWidget * acct_entry;
+    /* Widgets on the default account page. */
+    GtkWidget * acct_entry;
 
-  /* Widgets on the date format page. */
-  GtkWidget * date_format_combo;
+    /* Widgets on the date format page. */
+    GtkWidget * date_format_combo;
 
-  /* Widgets on the files loaded page. */
-  GtkWidget * selected_file_view;
+    /* Widgets on the files loaded page. */
+    GtkWidget * selected_file_view;
 
-  /* Widgets on the account matching page. */
-  GtkWidget * acct_view;
-  GtkWidget * acct_view_count;
-  GtkWidget * acct_view_btn;
+    /* Widgets on the account matching page. */
+    GtkWidget * acct_view;
+    GtkWidget * acct_view_count;
+    GtkWidget * acct_view_btn;
 
-  /* Widgets on the category matching page. */
-  GtkWidget * cat_view;
-  GtkWidget * cat_view_count;
-  GtkWidget * cat_view_btn;
+    /* Widgets on the category matching page. */
+    GtkWidget * cat_view;
+    GtkWidget * cat_view_count;
+    GtkWidget * cat_view_btn;
 
-  /* Widgets on the memo matching page. */
-  GtkWidget * memo_view;
-  GtkWidget * memo_view_count;
-  GtkWidget * memo_view_btn;
+    /* Widgets on the memo matching page. */
+    GtkWidget * memo_view;
+    GtkWidget * memo_view_count;
+    GtkWidget * memo_view_btn;
 
-  /* Widgets on the currency page. */
-  GtkWidget * currency_picker;
+    /* Widgets on the currency page. */
+    GtkWidget * currency_picker;
 
-  /* Conversion progress page. */
-  GtkWidget * convert_pause;
-  GtkWidget * convert_log;
-  GNCProgressDialog *convert_progress;
+    /* Conversion progress page. */
+    GtkWidget * convert_pause;
+    GtkWidget * convert_log;
+    GNCProgressDialog *convert_progress;
 
-  /* Widgets on the duplicates page. */
-  GtkWidget * new_transaction_view;
-  GtkWidget * old_transaction_view;
+    /* Widgets on the duplicates page. */
+    GtkWidget * new_transaction_view;
+    GtkWidget * old_transaction_view;
 
-  GList     * pre_comm_pages;
-  GList     * commodity_pages;
-  GList     * post_comm_pages;
-  GList     * doc_pages;
+    GList     * pre_comm_pages;
+    GList     * commodity_pages;
+    GList     * post_comm_pages;
+    GList     * doc_pages;
 
-  gboolean  show_doc_pages;
-  gboolean  ask_date_format;
-  gboolean  busy;
+    gboolean  show_doc_pages;
+    gboolean  ask_date_format;
+    gboolean  busy;
 
-  SCM       imported_files;
-  SCM       selected_file;
+    SCM       imported_files;
+    SCM       selected_file;
 
-  SCM       acct_map_info;
-  SCM       acct_display_info;
+    SCM       acct_map_info;
+    SCM       acct_display_info;
 
-  SCM       cat_map_info;
-  SCM       cat_display_info;
+    SCM       cat_map_info;
+    SCM       cat_display_info;
 
-  SCM       memo_map_info;
-  SCM       memo_display_info;
+    SCM       memo_map_info;
+    SCM       memo_display_info;
 
-  SCM       gnc_acct_info;
-  SCM       security_hash;
-  SCM       security_prefs;
-  SCM       new_securities;
-  GList   * new_namespaces;
-  SCM       ticker_map;
+    SCM       gnc_acct_info;
+    SCM       security_hash;
+    SCM       security_prefs;
+    SCM       new_securities;
+    GList   * new_namespaces;
+    SCM       ticker_map;
 
-  SCM       imported_account_tree;
-  SCM       match_transactions;
-  int       selected_transaction;
+    SCM       imported_account_tree;
+    SCM       match_transactions;
+    int       selected_transaction;
 };
 
-struct _qifdruidpage {
-  GtkWidget     *page;
-  GtkWidget     *namespace_combo;
-  GtkWidget     *name_entry;
-  GtkWidget     *mnemonic_entry;
-  gnc_commodity *commodity;
-  SCM            hash_key;
+struct _qifdruidpage
+{
+    GtkWidget     *page;
+    GtkWidget     *namespace_combo;
+    GtkWidget     *name_entry;
+    GtkWidget     *mnemonic_entry;
+    gnc_commodity *commodity;
+    SCM            hash_key;
 };
 
 typedef struct _qifdruidpage QIFDruidPage;
@@ -189,7 +194,7 @@
 static GnomeDruidPage *
 get_named_page(QIFImportWindow * w, const char * name)
 {
-  return GNOME_DRUID_PAGE(gnc_glade_lookup_widget(w->window, name));
+    return GNOME_DRUID_PAGE(gnc_glade_lookup_widget(w->window, name));
 }
 
 
@@ -208,58 +213,60 @@
                            GtkWidget *view, SCM map_info, SCM * display_info)
 {
 
-  SCM  get_qif_name = scm_c_eval_string("qif-map-entry:qif-name");
-  SCM  get_gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
-  SCM  get_new      = scm_c_eval_string("qif-map-entry:new-acct?");
-  SCM  accts_left;
-  const gchar *qif_name, *gnc_name;
-  gboolean checked;
-  gint row = 0;
-  gint prev_row;
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GtkTreePath *path;
-  GtkTreeSelection *selection;
+    SCM  get_qif_name = scm_c_eval_string("qif-map-entry:qif-name");
+    SCM  get_gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
+    SCM  get_new      = scm_c_eval_string("qif-map-entry:new-acct?");
+    SCM  accts_left;
+    const gchar *qif_name, *gnc_name;
+    gboolean checked;
+    gint row = 0;
+    gint prev_row;
+    GtkListStore *store;
+    GtkTreeIter iter;
+    GtkTreePath *path;
+    GtkTreeSelection *selection;
 
-  store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(view)));
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(view)));
 
-  /* now get the list of strings to display in the gtk_list_store widget */
-  accts_left = scm_call_3(make_display,
-                          wind->imported_files,
-                          map_info,
-                          wind->gnc_acct_info);
+    /* now get the list of strings to display in the gtk_list_store widget */
+    accts_left = scm_call_3(make_display,
+                            wind->imported_files,
+                            map_info,
+                            wind->gnc_acct_info);
 
-  scm_gc_unprotect_object(*display_info);
-  *display_info = accts_left;
-  scm_gc_protect_object(*display_info);
+    scm_gc_unprotect_object(*display_info);
+    *display_info = accts_left;
+    scm_gc_protect_object(*display_info);
 
-  /* clear the list */
-  gtk_list_store_clear(store);
+    /* clear the list */
+    gtk_list_store_clear(store);
 
-  while(!scm_is_null(accts_left)) {
-    qif_name = scm_to_locale_string(scm_call_1(get_qif_name, SCM_CAR(accts_left)));
-    gnc_name = scm_to_locale_string(scm_call_1(get_gnc_name, SCM_CAR(accts_left)));
-    checked  = (scm_call_1(get_new, SCM_CAR(accts_left)) == SCM_BOOL_T);
+    while (!scm_is_null(accts_left))
+    {
+        qif_name = scm_to_locale_string(scm_call_1(get_qif_name, SCM_CAR(accts_left)));
+        gnc_name = scm_to_locale_string(scm_call_1(get_gnc_name, SCM_CAR(accts_left)));
+        checked  = (scm_call_1(get_new, SCM_CAR(accts_left)) == SCM_BOOL_T);
 
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       ACCOUNT_COL_INDEX,     row++,
-                       ACCOUNT_COL_QIF_NAME,  qif_name,
-                       ACCOUNT_COL_GNC_NAME,  gnc_name,
-                       ACCOUNT_COL_NEW,       checked,
-                       ACCOUNT_COL_ELLIPSIZE, PANGO_ELLIPSIZE_START,
-                       -1);
-    accts_left = SCM_CDR(accts_left);
-  }
+        gtk_list_store_append(store, &iter);
+        gtk_list_store_set(store, &iter,
+                           ACCOUNT_COL_INDEX,     row++,
+                           ACCOUNT_COL_QIF_NAME,  qif_name,
+                           ACCOUNT_COL_GNC_NAME,  gnc_name,
+                           ACCOUNT_COL_NEW,       checked,
+                           ACCOUNT_COL_ELLIPSIZE, PANGO_ELLIPSIZE_START,
+                           -1);
+        accts_left = SCM_CDR(accts_left);
+    }
 
-  /* move to the old selected row */
-  prev_row = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(store), PREV_ROW));
-  if (prev_row != -1) {
-    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-    path = gtk_tree_path_new_from_indices(prev_row, -1);
-    gtk_tree_selection_select_path(selection, path);
-    gtk_tree_path_free(path);
-  }
+    /* move to the old selected row */
+    prev_row = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(store), PREV_ROW));
+    if (prev_row != -1)
+    {
+        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
+        path = gtk_tree_path_new_from_indices(prev_row, -1);
+        gtk_tree_selection_select_path(selection, path);
+        gtk_tree_path_free(path);
+    }
 }
 
 
@@ -273,10 +280,10 @@
 update_account_page(QIFImportWindow * wind)
 {
 
-  SCM  make_account_display = scm_c_eval_string("qif-dialog:make-account-display");
+    SCM  make_account_display = scm_c_eval_string("qif-dialog:make-account-display");
 
-  update_account_picker_page(wind, make_account_display, wind->acct_view,
-                             wind->acct_map_info, &(wind->acct_display_info));
+    update_account_picker_page(wind, make_account_display, wind->acct_view,
+                               wind->acct_map_info, &(wind->acct_display_info));
 }
 
 
@@ -289,10 +296,10 @@
 static void
 update_category_page(QIFImportWindow * wind)
 {
-  SCM  make_category_display = scm_c_eval_string("qif-dialog:make-category-display");
+    SCM  make_category_display = scm_c_eval_string("qif-dialog:make-category-display");
 
-  update_account_picker_page(wind, make_category_display, wind->cat_view,
-                             wind->cat_map_info, &(wind->cat_display_info));
+    update_account_picker_page(wind, make_category_display, wind->cat_view,
+                               wind->cat_map_info, &(wind->cat_display_info));
 }
 
 
@@ -305,10 +312,10 @@
 static void
 update_memo_page(QIFImportWindow * wind)
 {
-  SCM  make_memo_display = scm_c_eval_string("qif-dialog:make-memo-display");
+    SCM  make_memo_display = scm_c_eval_string("qif-dialog:make-memo-display");
 
-  update_account_picker_page(wind, make_memo_display, wind->memo_view,
-                             wind->memo_map_info, &(wind->memo_display_info));
+    update_account_picker_page(wind, make_memo_display, wind->memo_view,
+                               wind->memo_map_info, &(wind->memo_display_info));
 }
 
 
@@ -321,25 +328,25 @@
 static void
 gnc_ui_qif_import_commodity_destroy(QIFImportWindow * wind)
 {
-  GList          *pageptr;
-  GnomeDruidPage *gtkpage;
-  QIFDruidPage   *page;
+    GList          *pageptr;
+    GnomeDruidPage *gtkpage;
+    QIFDruidPage   *page;
 
-  for (pageptr = wind->commodity_pages; pageptr; pageptr=pageptr->next)
-  {
-    gtkpage   = GNOME_DRUID_PAGE(pageptr->data);
-    page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
+    for (pageptr = wind->commodity_pages; pageptr; pageptr = pageptr->next)
+    {
+        gtkpage   = GNOME_DRUID_PAGE(pageptr->data);
+        page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
 
-    /* Unprotect the Scheme hash key. */
-    scm_gc_unprotect_object(page->hash_key);
+        /* Unprotect the Scheme hash key. */
+        scm_gc_unprotect_object(page->hash_key);
 
-    /* Free the memory allocated for the page's struct. */
-    g_free(page);
-  }
+        /* Free the memory allocated for the page's struct. */
+        g_free(page);
+    }
 
-  /* Free the list of pages. */
-  g_list_free(wind->commodity_pages);
-  wind->commodity_pages = NULL;
+    /* Free the list of pages. */
+    g_list_free(wind->commodity_pages);
+    wind->commodity_pages = NULL;
 }
 
 
@@ -351,36 +358,36 @@
 void
 gnc_ui_qif_import_druid_destroy(QIFImportWindow * wind)
 {
-  if (!wind)
-    return;
+    if (!wind)
+        return;
 
-  /* Destroy the progress dialog helpers. */
-  gnc_progress_dialog_destroy(wind->load_progress);
+    /* Destroy the progress dialog helpers. */
+    gnc_progress_dialog_destroy(wind->load_progress);
 
-  /* Destroy any commodity pages. */
-  gnc_ui_qif_import_commodity_destroy(wind);
+    /* Destroy any commodity pages. */
+    gnc_ui_qif_import_commodity_destroy(wind);
 
-  gnc_unregister_gui_component_by_data(DRUID_QIF_IMPORT_CM_CLASS, wind);
+    gnc_unregister_gui_component_by_data(DRUID_QIF_IMPORT_CM_CLASS, wind);
 
-  gtk_widget_destroy(wind->window);
+    gtk_widget_destroy(wind->window);
 
-  scm_gc_unprotect_object(wind->imported_files);
-  scm_gc_unprotect_object(wind->selected_file);
-  scm_gc_unprotect_object(wind->gnc_acct_info);
-  scm_gc_unprotect_object(wind->cat_display_info);
-  scm_gc_unprotect_object(wind->cat_map_info);
-  scm_gc_unprotect_object(wind->memo_display_info);
-  scm_gc_unprotect_object(wind->memo_map_info);
-  scm_gc_unprotect_object(wind->acct_display_info);
-  scm_gc_unprotect_object(wind->acct_map_info);
-  scm_gc_unprotect_object(wind->security_hash);
-  scm_gc_unprotect_object(wind->security_prefs);
-  scm_gc_unprotect_object(wind->new_securities);
-  scm_gc_unprotect_object(wind->ticker_map);
-  scm_gc_unprotect_object(wind->imported_account_tree);
-  scm_gc_unprotect_object(wind->match_transactions);
+    scm_gc_unprotect_object(wind->imported_files);
+    scm_gc_unprotect_object(wind->selected_file);
+    scm_gc_unprotect_object(wind->gnc_acct_info);
+    scm_gc_unprotect_object(wind->cat_display_info);
+    scm_gc_unprotect_object(wind->cat_map_info);
+    scm_gc_unprotect_object(wind->memo_display_info);
+    scm_gc_unprotect_object(wind->memo_map_info);
+    scm_gc_unprotect_object(wind->acct_display_info);
+    scm_gc_unprotect_object(wind->acct_map_info);
+    scm_gc_unprotect_object(wind->security_hash);
+    scm_gc_unprotect_object(wind->security_prefs);
+    scm_gc_unprotect_object(wind->new_securities);
+    scm_gc_unprotect_object(wind->ticker_map);
+    scm_gc_unprotect_object(wind->imported_account_tree);
+    scm_gc_unprotect_object(wind->match_transactions);
 
-  g_free(wind);
+    g_free(wind);
 }
 
 
@@ -395,61 +402,71 @@
 static GtkWidget *
 get_next_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
 {
-  GList     * current = NULL;
-  GList     * next;
-  int       where = 0;
+    GList     * current = NULL;
+    GList     * next;
+    int       where = 0;
 
-  /* Figure out which stage of the druid we're in. */
-  if ((current = g_list_find(wind->pre_comm_pages, page)) == NULL) {
-    if ((current = g_list_find(wind->commodity_pages, page)) == NULL) {
-      if ((current = g_list_find(wind->post_comm_pages, page)) == NULL) {
-        /* Where are we? */
-        g_critical("QIF import: BUG DETECTED in get_next_druid_page! I'm lost!");
-        return FALSE;
-      }
-      else {
-        where = 3;
-      }
+    /* Figure out which stage of the druid we're in. */
+    if ((current = g_list_find(wind->pre_comm_pages, page)) == NULL)
+    {
+        if ((current = g_list_find(wind->commodity_pages, page)) == NULL)
+        {
+            if ((current = g_list_find(wind->post_comm_pages, page)) == NULL)
+            {
+                /* Where are we? */
+                g_critical("QIF import: BUG DETECTED in get_next_druid_page! I'm lost!");
+                return FALSE;
+            }
+            else
+            {
+                where = 3;
+            }
+        }
+        else
+        {
+            where = 2;
+        }
     }
-    else {
-      where = 2;
+    else
+    {
+        where = 1;
     }
-  }
-  else {
-    where = 1;
-  }
 
-  next = current->next;
-  while (!next ||
-         (!wind->show_doc_pages && g_list_find(wind->doc_pages, next->data)) ||
-         (wind->new_securities == SCM_BOOL_F &&
-          GNOME_DRUID_PAGE(next->data) == get_named_page(wind, "commodity_doc_page"))) {
-    if (next && next->next) {
-      next = next->next;
+    next = current->next;
+    while (!next ||
+            (!wind->show_doc_pages && g_list_find(wind->doc_pages, next->data)) ||
+            (wind->new_securities == SCM_BOOL_F &&
+             GNOME_DRUID_PAGE(next->data) == get_named_page(wind, "commodity_doc_page")))
+    {
+        if (next && next->next)
+        {
+            next = next->next;
+        }
+        else
+        {
+            where ++;
+            switch (where)
+            {
+            case 2:
+                next = wind->commodity_pages;
+                break;
+            case 3:
+                next = wind->post_comm_pages;
+                break;
+            default:
+                g_critical("QIF import: BUG DETECTED in get_next_druid_page!");
+                next = NULL;
+                if (where > 3)
+                    return NULL;
+                break;
+            }
+        }
     }
-    else {
-      where ++;
-      switch(where) {
-      case 2:
-        next = wind->commodity_pages;
-        break;
-      case 3:
-        next = wind->post_comm_pages;
-        break;
-      default:
-        g_critical("QIF import: BUG DETECTED in get_next_druid_page!");
-        next = NULL;
-        if (where > 3)
-          return NULL;
-        break;
-      }
-    }
-  }
 
-  if (next)
-    return (GtkWidget *)next->data;
+    if (next)
+        return (GtkWidget *)next->data;
 
-  return NULL;
+    return NULL;
 }
 
 
@@ -464,81 +481,93 @@
 static GtkWidget *
 get_prev_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
 {
-  GList     * current = NULL;
-  GList     * prev;
-  int       where = 0;
+    GList     * current = NULL;
+    GList     * prev;
+    int       where = 0;
 
-  /* Figure out which stage of the druid we're in. */
-  if ((current = g_list_find(wind->pre_comm_pages, page)) == NULL) {
-    if ((current = g_list_find(wind->commodity_pages, page)) == NULL) {
-      if ((current = g_list_find(wind->post_comm_pages, page)) == NULL) {
-        /* Where are we? */
-        g_critical("QIF import: BUG DETECTED in get_prev_druid_page! I'm lost!");
-        return NULL;
-      }
-      else {
-        where = 3;
-      }
+    /* Figure out which stage of the druid we're in. */
+    if ((current = g_list_find(wind->pre_comm_pages, page)) == NULL)
+    {
+        if ((current = g_list_find(wind->commodity_pages, page)) == NULL)
+        {
+            if ((current = g_list_find(wind->post_comm_pages, page)) == NULL)
+            {
+                /* Where are we? */
+                g_critical("QIF import: BUG DETECTED in get_prev_druid_page! I'm lost!");
+                return NULL;
+            }
+            else
+            {
+                where = 3;
+            }
+        }
+        else
+        {
+            where = 2;
+        }
     }
-    else {
-      where = 2;
+    else
+    {
+        where = 1;
     }
-  }
-  else {
-    where = 1;
-  }
 
-  /* If no duplicates were found, skip all post-conversion pages. */
-  if (where == 3 && scm_is_null(wind->match_transactions))
-    prev = NULL;
-  else
-    prev = current->prev;
+    /* If no duplicates were found, skip all post-conversion pages. */
+    if (where == 3 && scm_is_null(wind->match_transactions))
+        prev = NULL;
+    else
+        prev = current->prev;
 
-  /* Keep going back through the sets of available pages as long as:
-   * (a) there are no remaining pages in this set, or
-   * (b) the page is a doc page and we're not supposed to show them, or
-   * (c) the page is commodity related and the are no new commodities. */
-  while (!prev ||
-         (!wind->show_doc_pages && g_list_find(wind->doc_pages, prev->data)) ||
-         (wind->new_securities == SCM_BOOL_F &&
-          GNOME_DRUID_PAGE(prev->data) == get_named_page(wind, "commodity_doc_page"))) {
-    /* We're either out of pages for this stage, or we've reached
-     * an optional doc page that shouldn't be shown. */
+    /* Keep going back through the sets of available pages as long as:
+     * (a) there are no remaining pages in this set, or
+     * (b) the page is a doc page and we're not supposed to show them, or
+     * (c) the page is commodity related and the are no new commodities. */
+    while (!prev ||
+            (!wind->show_doc_pages && g_list_find(wind->doc_pages, prev->data)) ||
+            (wind->new_securities == SCM_BOOL_F &&
+             GNOME_DRUID_PAGE(prev->data) == get_named_page(wind, "commodity_doc_page")))
+    {
+        /* We're either out of pages for this stage, or we've reached
+         * an optional doc page that shouldn't be shown. */
 
-    if (prev && prev->prev) {
-      /* Go back another page within the same stage. */
-      prev = prev->prev;
-    }
-    else {
-      /* Start looking at the end of the previous stage. */
-      where --;
-      switch(where) {
-      case 1:
-        prev = g_list_last(wind->pre_comm_pages);
-        break;
-      case 2:
-        if (wind->new_securities != SCM_BOOL_F) {
-          prev = g_list_last(wind->commodity_pages);
+        if (prev && prev->prev)
+        {
+            /* Go back another page within the same stage. */
+            prev = prev->prev;
         }
-        else {
-          prev = g_list_last(wind->pre_comm_pages);
+        else
+        {
+            /* Start looking at the end of the previous stage. */
+            where --;
+            switch (where)
+            {
+            case 1:
+                prev = g_list_last(wind->pre_comm_pages);
+                break;
+            case 2:
+                if (wind->new_securities != SCM_BOOL_F)
+                {
+                    prev = g_list_last(wind->commodity_pages);
+                }
+                else
+                {
+                    prev = g_list_last(wind->pre_comm_pages);
+                }
+                break;
+            default:
+                if (wind->show_doc_pages)
+                    g_critical("QIF import: BUG DETECTED in get_prev_druid_page!");
+                prev = NULL;
+                if (where < 1)
+                    return NULL;
+                break;
+            }
         }
-        break;
-      default:
-        if (wind->show_doc_pages)
-          g_critical("QIF import: BUG DETECTED in get_prev_druid_page!");
-        prev = NULL;
-        if (where < 1)
-          return NULL;
-        break;
-      }
     }
-  }
 
-  if (prev)
-    return (GtkWidget *)prev->data;
+    if (prev)
+        return (GtkWidget *)prev->data;
 
-  return NULL;
+    return NULL;
 }
 
 
@@ -552,17 +581,17 @@
 gnc_ui_qif_import_generic_next_cb(GnomeDruidPage * page, gpointer arg1,
                                   gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
-  GtkWidget * next_page = get_next_druid_page(wind, page);
+    QIFImportWindow * wind = user_data;
+    GtkWidget * next_page = get_next_druid_page(wind, page);
 
-  if (next_page)
-  {
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         GNOME_DRUID_PAGE(next_page));
-    return TRUE;
-  }
+    if (next_page)
+    {
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             GNOME_DRUID_PAGE(next_page));
+        return TRUE;
+    }
 
-  return FALSE;
+    return FALSE;
 }
 
 
@@ -576,17 +605,17 @@
 gnc_ui_qif_import_generic_back_cb(GnomeDruidPage * page, gpointer arg1,
                                   gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
-  GtkWidget * back_page = get_prev_druid_page(wind, page);
+    QIFImportWindow * wind = user_data;
+    GtkWidget * back_page = get_prev_druid_page(wind, page);
 
-  if (back_page)
-  {
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         GNOME_DRUID_PAGE(back_page));
-    return TRUE;
-  }
+    if (back_page)
+    {
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             GNOME_DRUID_PAGE(back_page));
+        return TRUE;
+    }
 
-  return FALSE;
+    return FALSE;
 }
 
 
@@ -602,40 +631,45 @@
 gnc_ui_qif_import_select_file_cb(GtkButton * button,
                                  gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
-  GtkFileFilter *filter;
-  char * new_file_name;
-  char *file_name, *default_dir;
+    QIFImportWindow * wind = user_data;
+    GtkFileFilter *filter;
+    char * new_file_name;
+    char *file_name, *default_dir;
 
-  /* Default to whatever's already present */
-  default_dir = gnc_get_default_directory(GCONF_SECTION);
+    /* Default to whatever's already present */
+    default_dir = gnc_get_default_directory(GCONF_SECTION);
 
-  filter = gtk_file_filter_new();
-  gtk_file_filter_set_name(filter, "*.qif");
-  gtk_file_filter_add_pattern(filter, "*.[Qq][Ii][Ff]");
-  new_file_name = gnc_file_dialog(_("Select QIF File"),
-                                  g_list_prepend (NULL, filter),
-                                  default_dir,
-                                  GNC_FILE_DIALOG_IMPORT);
+    filter = gtk_file_filter_new();
+    gtk_file_filter_set_name(filter, "*.qif");
+    gtk_file_filter_add_pattern(filter, "*.[Qq][Ii][Ff]");
+    new_file_name = gnc_file_dialog(_("Select QIF File"),
+                                    g_list_prepend (NULL, filter),
+                                    default_dir,
+                                    GNC_FILE_DIALOG_IMPORT);
 
-  /* Insure valid data, and something that can be freed. */
-  if (new_file_name == NULL) {
-    file_name = g_strdup(default_dir);
-  } else if (!g_path_is_absolute(new_file_name)) {
-    file_name = g_build_filename(default_dir, new_file_name, NULL);
-    g_free(new_file_name);
-  } else {
-    file_name = new_file_name;
-    /* Update the working directory */
+    /* Insure valid data, and something that can be freed. */
+    if (new_file_name == NULL)
+    {
+        file_name = g_strdup(default_dir);
+    }
+    else if (!g_path_is_absolute(new_file_name))
+    {
+        file_name = g_build_filename(default_dir, new_file_name, NULL);
+        g_free(new_file_name);
+    }
+    else
+    {
+        file_name = new_file_name;
+        /* Update the working directory */
+        g_free(default_dir);
+        default_dir = g_path_get_dirname(file_name);
+        gnc_set_default_directory(GCONF_SECTION, default_dir);
+    }
     g_free(default_dir);
-    default_dir = g_path_get_dirname(file_name);
-    gnc_set_default_directory(GCONF_SECTION, default_dir);
-  }
-  g_free(default_dir);
 
-  /* set the filename entry for what was selected */
-  gtk_entry_set_text(GTK_ENTRY(wind->filename_entry), file_name);
-  g_free(file_name);
+    /* set the filename entry for what was selected */
+    gtk_entry_set_text(GTK_ENTRY(wind->filename_entry), file_name);
+    g_free(file_name);
 }
 
 
@@ -649,18 +683,19 @@
 gnc_ui_qif_import_load_file_back_cb(GnomeDruidPage * page, gpointer arg1,
                                     gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  if (scm_is_list(wind->imported_files) &&
-      (scm_ilength(wind->imported_files) > 0)) {
+    if (scm_is_list(wind->imported_files) &&
+            (scm_ilength(wind->imported_files) > 0))
+    {
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             get_named_page(wind, "loaded_files_page"));
+        return TRUE;
+    }
+
     gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "loaded_files_page"));
+                         get_named_page(wind, "start_page"));
     return TRUE;
-  }
-
-  gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                       get_named_page(wind, "start_page"));
-  return TRUE;
 }
 
 
@@ -675,39 +710,39 @@
                                     gpointer arg1,
                                     gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
-  const gchar * path_to_load;
+    QIFImportWindow * wind = user_data;
+    const gchar * path_to_load;
 
-  /* Get the file name. */
-  path_to_load = gtk_entry_get_text(GTK_ENTRY(wind->filename_entry));
+    /* Get the file name. */
+    path_to_load = gtk_entry_get_text(GTK_ENTRY(wind->filename_entry));
 
-  /* Validate the chosen filename. */
-  if (strlen(path_to_load) == 0)
-    gnc_error_dialog(wind->window, "%s", _("Please select a file to load."));
-  else if (g_access(path_to_load, R_OK) < 0)
-    gnc_error_dialog(wind->window, "%s",
-                     _("File not found or read permission denied. "
-                       "Please select another file."));
-  else
-  {
-    SCM qif_file_loaded = scm_c_eval_string("qif-dialog:qif-file-loaded?");
-
-    /* See if the file is already loaded. */
-    if (scm_call_2(qif_file_loaded,
-                   scm_makfrom0str(path_to_load),
-                   wind->imported_files) == SCM_BOOL_T)
-      gnc_error_dialog(wind->window, "%s",
-                       _("That QIF file is already loaded. "
-                         "Please select another file."));
+    /* Validate the chosen filename. */
+    if (strlen(path_to_load) == 0)
+        gnc_error_dialog(wind->window, "%s", _("Please select a file to load."));
+    else if (g_access(path_to_load, R_OK) < 0)
+        gnc_error_dialog(wind->window, "%s",
+                         _("File not found or read permission denied. "
+                           "Please select another file."));
     else
     {
-      /* Passed all checks; proceed to the next page. */
-      return gnc_ui_qif_import_generic_next_cb(page, arg1, wind);
+        SCM qif_file_loaded = scm_c_eval_string("qif-dialog:qif-file-loaded?");
+
+        /* See if the file is already loaded. */
+        if (scm_call_2(qif_file_loaded,
+                       scm_makfrom0str(path_to_load),
+                       wind->imported_files) == SCM_BOOL_T)
+            gnc_error_dialog(wind->window, "%s",
+                             _("That QIF file is already loaded. "
+                               "Please select another file."));
+        else
+        {
+            /* Passed all checks; proceed to the next page. */
+            return gnc_ui_qif_import_generic_next_cb(page, arg1, wind);
+        }
     }
-  }
 
-  /* Stay on this page. */
-  return TRUE;
+    /* Stay on this page. */
+    return TRUE;
 }
 
 
@@ -719,34 +754,34 @@
 
 static void
 gnc_ui_qif_import_load_progress_prepare_cb(GnomeDruidPage * page,
-                                           gpointer arg1,
-                                           gpointer user_data)
+        gpointer arg1,
+        gpointer user_data)
 {
-  QIFImportWindow   *wind = user_data;
+    QIFImportWindow   *wind = user_data;
 
-  /* Reset the progress display. */
-  gnc_progress_dialog_set_primary(wind->load_progress, "");
-  gnc_progress_dialog_set_secondary(wind->load_progress,
-    _("GnuCash will now load your QIF file. If there are no errors or warnings, you will automatically proceed to the next step. Otherwise, the details will be shown below for your review."));
-  gnc_progress_dialog_set_sub(wind->load_progress, " ");
-  gnc_progress_dialog_reset_value(wind->load_progress);
-  gnc_progress_dialog_reset_log(wind->load_progress);
+    /* Reset the progress display. */
+    gnc_progress_dialog_set_primary(wind->load_progress, "");
+    gnc_progress_dialog_set_secondary(wind->load_progress,
+                                      _("GnuCash will now load your QIF file. If there are no errors or warnings, you will automatically proceed to the next step. Otherwise, the details will be shown below for your review."));
+    gnc_progress_dialog_set_sub(wind->load_progress, " ");
+    gnc_progress_dialog_reset_value(wind->load_progress);
+    gnc_progress_dialog_reset_log(wind->load_progress);
 
-  /* Disable the "Forward" button for now.
-   *
-   * NOTE: Due to bug 91001 in GnomeDruid, gnome_druid_set_buttons_sensitive()
-   *       will not work in prepare callbacks unless they are run AFTER the
-   *       standard one. Make sure the Glade line has the callback set up with
-   *       after=yes. For example:
-   *         <signal name="prepare" handler="my_prepare_cb" after="yes"/>   */
-  gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                    TRUE, FALSE, TRUE, TRUE);
+    /* Disable the "Forward" button for now.
+     *
+     * NOTE: Due to bug 91001 in GnomeDruid, gnome_druid_set_buttons_sensitive()
+     *       will not work in prepare callbacks unless they are run AFTER the
+     *       standard one. Make sure the Glade line has the callback set up with
+     *       after=yes. For example:
+     *         <signal name="prepare" handler="my_prepare_cb" after="yes"/>   */
+    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+                                      TRUE, FALSE, TRUE, TRUE);
 
-  /* Generate a show signal once the page is displayed. This
-   * will kick off our (potentially) long-running operations. */
-  gtk_widget_hide(GTK_WIDGET(page));
-  gtk_widget_set_sensitive(GTK_WIDGET(page), TRUE);
-  gtk_widget_show(GTK_WIDGET(page));
+    /* Generate a show signal once the page is displayed. This
+     * will kick off our (potentially) long-running operations. */
+    gtk_widget_hide(GTK_WIDGET(page));
+    gtk_widget_set_sensitive(GTK_WIDGET(page), TRUE);
+    gtk_widget_show(GTK_WIDGET(page));
 }
 
 
@@ -760,238 +795,238 @@
 gnc_ui_qif_import_load_progress_show_cb(GtkWidget *widget,
                                         gpointer user_data)
 {
-  QIFImportWindow   *wind = user_data;
-  const gchar * path_to_load;
+    QIFImportWindow   *wind = user_data;
+    const gchar * path_to_load;
 
-  SCM make_qif_file   = scm_c_eval_string("make-qif-file");
-  SCM qif_file_load   = scm_c_eval_string("qif-file:read-file");
-  SCM qif_file_parse  = scm_c_eval_string("qif-file:parse-fields");
-  SCM unload_qif_file = scm_c_eval_string("qif-dialog:unload-qif-file");
-  SCM parse_results   = scm_c_eval_string("qif-file:parse-fields-results");
-  SCM scm_qiffile;
-  SCM imported_files = SCM_EOL;
-  SCM load_return, parse_return;
-  SCM progress;
+    SCM make_qif_file   = scm_c_eval_string("make-qif-file");
+    SCM qif_file_load   = scm_c_eval_string("qif-file:read-file");
+    SCM qif_file_parse  = scm_c_eval_string("qif-file:parse-fields");
+    SCM unload_qif_file = scm_c_eval_string("qif-dialog:unload-qif-file");
+    SCM parse_results   = scm_c_eval_string("qif-file:parse-fields-results");
+    SCM scm_qiffile;
+    SCM imported_files = SCM_EOL;
+    SCM load_return, parse_return;
+    SCM progress;
 
-  /* Raise the busy flag so the druid can't be canceled unexpectedly. */
-  wind->busy = TRUE;
-  gtk_widget_set_sensitive(wind->load_pause, TRUE);
+    /* Raise the busy flag so the druid can't be canceled unexpectedly. */
+    wind->busy = TRUE;
+    gtk_widget_set_sensitive(wind->load_pause, TRUE);
 
-  /* Get the file name. */
-  path_to_load = gtk_entry_get_text(GTK_ENTRY(wind->filename_entry));
+    /* Get the file name. */
+    path_to_load = gtk_entry_get_text(GTK_ENTRY(wind->filename_entry));
 
-  /* Create the <qif-file> object. */
-  scm_qiffile          = scm_call_0(make_qif_file);
-  scm_gc_unprotect_object(wind->selected_file);
-  wind->selected_file  = scm_qiffile;
-  scm_gc_protect_object(wind->selected_file);
-  imported_files       = scm_cons(scm_qiffile, wind->imported_files);
+    /* Create the <qif-file> object. */
+    scm_qiffile          = scm_call_0(make_qif_file);
+    scm_gc_unprotect_object(wind->selected_file);
+    wind->selected_file  = scm_qiffile;
+    scm_gc_protect_object(wind->selected_file);
+    imported_files       = scm_cons(scm_qiffile, wind->imported_files);
 
-  /* Create SCM for the progress helper. */
-  progress = SWIG_NewPointerObj(wind->load_progress,
-                                SWIG_TypeQuery("_p__GNCProgressDialog"),
-                                0);
+    /* Create SCM for the progress helper. */
+    progress = SWIG_NewPointerObj(wind->load_progress,
+                                  SWIG_TypeQuery("_p__GNCProgressDialog"),
+                                  0);
 
-  /* Clear any previous pause or cancel state. */
-  scm_c_eval_string("(qif-import:reset-cancel-pause)");
+    /* Clear any previous pause or cancel state. */
+    scm_c_eval_string("(qif-import:reset-cancel-pause)");
 
 
-  /*
-   * Load the file.
-   *
-   * The loader returns:
-   *  success:   ()
-   *  failure:   (#f error-message)
-   *  warning:   (#t error-message)
-   *  cancel:    #t
-   *  exception: #f
-   */
+    /*
+     * Load the file.
+     *
+     * The loader returns:
+     *  success:   ()
+     *  failure:   (#f error-message)
+     *  warning:   (#t error-message)
+     *  cancel:    #t
+     *  exception: #f
+     */
 
-  /* This step will fill 70% of the bar. */
-  gnc_progress_dialog_push(wind->load_progress, 0.7);
-  load_return = scm_call_4(qif_file_load,
-                           SCM_CAR(imported_files),
-                           scm_makfrom0str(path_to_load),
-                           wind->ticker_map,
-                           progress);
-  gnc_progress_dialog_pop(wind->load_progress);
-  if (load_return == SCM_BOOL_T)
-  {
-    /* Canceled by the user. */
+    /* This step will fill 70% of the bar. */
+    gnc_progress_dialog_push(wind->load_progress, 0.7);
+    load_return = scm_call_4(qif_file_load,
+                             SCM_CAR(imported_files),
+                             scm_makfrom0str(path_to_load),
+                             wind->ticker_map,
+                             progress);
+    gnc_progress_dialog_pop(wind->load_progress);
+    if (load_return == SCM_BOOL_T)
+    {
+        /* Canceled by the user. */
 
-    /* Disable the pause button. */
-    gtk_widget_set_sensitive(wind->load_pause, FALSE);
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->load_pause, FALSE);
 
-    /* Inform the user. */
-    gnc_progress_dialog_set_sub(wind->load_progress, _("Canceled"));
+        /* Inform the user. */
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Canceled"));
 
-    wind->busy = FALSE;
-    return;
-  }
-  else if (load_return == SCM_BOOL_F || !scm_is_list(load_return))
-  {
-    /* A bug was detected. */
+        wind->busy = FALSE;
+        return;
+    }
+    else if (load_return == SCM_BOOL_F || !scm_is_list(load_return))
+    {
+        /* A bug was detected. */
 
-    /* Disable the pause button. */
-    gtk_widget_set_sensitive(wind->load_pause, FALSE);
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->load_pause, FALSE);
 
-    /* Inform the user. */
-    gnc_progress_dialog_append_log(wind->load_progress,
-                     _( "An error occurred while loading the QIF file."));
-    gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
-    gnc_progress_dialog_reset_value(wind->load_progress);
-    gnc_error_dialog(wind->window, "%s",
-                     _( "An error occurred while loading the QIF file."));
-    /* FIXME: How should we request that the user report this problem? */
+        /* Inform the user. */
+        gnc_progress_dialog_append_log(wind->load_progress,
+                                       _( "An error occurred while loading the QIF file."));
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
+        gnc_progress_dialog_reset_value(wind->load_progress);
+        gnc_error_dialog(wind->window, "%s",
+                         _( "An error occurred while loading the QIF file."));
+        /* FIXME: How should we request that the user report this problem? */
 
-    wind->busy = FALSE;
-    return;
-  }
-  else if (!scm_is_null(load_return))
-  {
-    const gchar *str = scm_to_locale_string(SCM_CADR(load_return));
-
-    if (SCM_CAR(load_return) == SCM_BOOL_F)
+        wind->busy = FALSE;
+        return;
+    }
+    else if (!scm_is_null(load_return))
     {
-      imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
-      scm_gc_unprotect_object(wind->imported_files);
-      wind->imported_files = imported_files;
-      scm_gc_protect_object(wind->imported_files);
+        const gchar *str = scm_to_locale_string(SCM_CADR(load_return));
 
-      gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
-      gnc_progress_dialog_reset_value(wind->load_progress);
+        if (SCM_CAR(load_return) == SCM_BOOL_F)
+        {
+            imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
+            scm_gc_unprotect_object(wind->imported_files);
+            wind->imported_files = imported_files;
+            scm_gc_protect_object(wind->imported_files);
 
-      gtk_widget_set_sensitive(wind->load_pause, FALSE);
-      wind->busy = FALSE;
-      return;
+            gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
+            gnc_progress_dialog_reset_value(wind->load_progress);
+
+            gtk_widget_set_sensitive(wind->load_pause, FALSE);
+            wind->busy = FALSE;
+            return;
+        }
     }
-  }
 
 
-  /*
-   * Parse the fields.
-   *
-   * The parser returns:
-   *   success:   ()
-   *   failure:   (#f . ((type . error) ...))
-   *   warning:   (#t . ((type . error) ...))
-   *   cancel:    #t
-   *   exception: #f
-   */
+    /*
+     * Parse the fields.
+     *
+     * The parser returns:
+     *   success:   ()
+     *   failure:   (#f . ((type . error) ...))
+     *   warning:   (#t . ((type . error) ...))
+     *   cancel:    #t
+     *   exception: #f
+     */
 
-  /* This step will fill the remainder of the bar. */
-  gnc_progress_dialog_push(wind->load_progress, 1);
-  parse_return = scm_call_2(qif_file_parse, SCM_CAR(imported_files), progress);
-  gnc_progress_dialog_pop(wind->load_progress);
-  wind->ask_date_format = FALSE;
-  if (parse_return == SCM_BOOL_T)
-  {
-    /* Canceled by the user. */
+    /* This step will fill the remainder of the bar. */
+    gnc_progress_dialog_push(wind->load_progress, 1);
+    parse_return = scm_call_2(qif_file_parse, SCM_CAR(imported_files), progress);
+    gnc_progress_dialog_pop(wind->load_progress);
+    wind->ask_date_format = FALSE;
+    if (parse_return == SCM_BOOL_T)
+    {
+        /* Canceled by the user. */
 
-    /* Disable the pause button. */
-    gtk_widget_set_sensitive(wind->load_pause, FALSE);
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->load_pause, FALSE);
 
-    /* Unload the file. */
-    gnc_progress_dialog_set_sub(wind->load_progress, _("Cleaning up"));
-    imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
+        /* Unload the file. */
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Cleaning up"));
+        imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
 
-    /* Inform the user. */
-    gnc_progress_dialog_set_sub(wind->load_progress, _("Canceled"));
+        /* Inform the user. */
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Canceled"));
 
-    wind->busy = FALSE;
-    return;
-  }
-  else if (parse_return == SCM_BOOL_F || !scm_is_list(parse_return))
-  {
-    /* A bug was detected. */
+        wind->busy = FALSE;
+        return;
+    }
+    else if (parse_return == SCM_BOOL_F || !scm_is_list(parse_return))
+    {
+        /* A bug was detected. */
 
-    /* Disable the pause button. */
-    gtk_widget_set_sensitive(wind->load_pause, FALSE);
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->load_pause, FALSE);
 
-    /* Unload the file. */
-    gnc_progress_dialog_set_sub(wind->load_progress, _("Cleaning up"));
-    imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
+        /* Unload the file. */
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Cleaning up"));
+        imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
 
-    /* Inform the user. */
-    gnc_progress_dialog_append_log(wind->load_progress,
-                     _( "A bug was detected while parsing the QIF file."));
-    gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
-    gnc_progress_dialog_reset_value(wind->load_progress);
-    gnc_error_dialog(wind->window, "%s",
-                     _( "A bug was detected while parsing the QIF file."));
-    /* FIXME: How should we request that the user report this problem? */
+        /* Inform the user. */
+        gnc_progress_dialog_append_log(wind->load_progress,
+                                       _( "A bug was detected while parsing the QIF file."));
+        gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
+        gnc_progress_dialog_reset_value(wind->load_progress);
+        gnc_error_dialog(wind->window, "%s",
+                         _( "A bug was detected while parsing the QIF file."));
+        /* FIXME: How should we request that the user report this problem? */
 
-    wind->busy = FALSE;
-    return;
-  }
-  else if (!scm_is_null(parse_return))
-  {
-    /* Are there only warnings? */
-    if (SCM_CAR(parse_return) == SCM_BOOL_T)
+        wind->busy = FALSE;
+        return;
+    }
+    else if (!scm_is_null(parse_return))
     {
-      SCM date_formats;
+        /* Are there only warnings? */
+        if (SCM_CAR(parse_return) == SCM_BOOL_T)
+        {
+            SCM date_formats;
 
-      /* A warning means that (potentially) the date format is
-       * ambiguous.  So search the results for the "date" type and if
-       * it's found, set up the format selector page. */
-      if ((date_formats = scm_call_2(parse_results,
-                                     SCM_CDR(parse_return),
-                                     scm_str2symbol("date"))) != SCM_BOOL_F)
-      {
-        gint n_items;
+            /* A warning means that (potentially) the date format is
+             * ambiguous.  So search the results for the "date" type and if
+             * it's found, set up the format selector page. */
+            if ((date_formats = scm_call_2(parse_results,
+                                           SCM_CDR(parse_return),
+                                           scm_str2symbol("date"))) != SCM_BOOL_F)
+            {
+                gint n_items;
 
-        /* Clear the date format combo box. */
-        gtk_combo_box_set_active(GTK_COMBO_BOX(wind->date_format_combo), -1);
-        n_items = gtk_tree_model_iter_n_children(
-          gtk_combo_box_get_model(GTK_COMBO_BOX(wind->date_format_combo)),
-                                  NULL);
-        while (n_items-- > 0)
-          gtk_combo_box_remove_text(GTK_COMBO_BOX(wind->date_format_combo), 0);
+                /* Clear the date format combo box. */
+                gtk_combo_box_set_active(GTK_COMBO_BOX(wind->date_format_combo), -1);
+                n_items = gtk_tree_model_iter_n_children(
+                              gtk_combo_box_get_model(GTK_COMBO_BOX(wind->date_format_combo)),
+                              NULL);
+                while (n_items-- > 0)
+                    gtk_combo_box_remove_text(GTK_COMBO_BOX(wind->date_format_combo), 0);
 
-        /* Add the formats for the user to select from. */
-        while(scm_is_list(date_formats) && !scm_is_null(date_formats))
+                /* Add the formats for the user to select from. */
+                while (scm_is_list(date_formats) && !scm_is_null(date_formats))
+                {
+                    gtk_combo_box_append_text(GTK_COMBO_BOX(wind->date_format_combo),
+                                              SCM_SYMBOL_CHARS(SCM_CAR(date_formats)));
+                    date_formats = SCM_CDR(date_formats);
+                }
+                gtk_combo_box_set_active(GTK_COMBO_BOX(wind->date_format_combo), 0);
+
+                wind->ask_date_format = TRUE;
+            }
+        }
+        else
         {
-          gtk_combo_box_append_text(GTK_COMBO_BOX(wind->date_format_combo),
-                                    SCM_SYMBOL_CHARS(SCM_CAR(date_formats)));
-          date_formats = SCM_CDR(date_formats);
+            /* Parsing failed. */
+            imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
+            gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
+            gnc_progress_dialog_reset_value(wind->load_progress);
+
+            gtk_widget_set_sensitive(wind->load_pause, FALSE);
+            wind->busy = FALSE;
+            return;
         }
-        gtk_combo_box_set_active(GTK_COMBO_BOX(wind->date_format_combo), 0);
-
-        wind->ask_date_format = TRUE;
-      }
     }
-    else
-    {
-      /* Parsing failed. */
-      imported_files = scm_call_2(unload_qif_file, scm_qiffile, imported_files);
-      gnc_progress_dialog_set_sub(wind->load_progress, _("Failed"));
-      gnc_progress_dialog_reset_value(wind->load_progress);
 
-      gtk_widget_set_sensitive(wind->load_pause, FALSE);
-      wind->busy = FALSE;
-      return;
-    }
-  }
+    /* The file was loaded successfully. */
+    gnc_progress_dialog_set_sub(wind->load_progress, _("Loading completed"));
+    gnc_progress_dialog_set_value(wind->load_progress, 1);
 
-  /* The file was loaded successfully. */
-  gnc_progress_dialog_set_sub(wind->load_progress, _("Loading completed"));
-  gnc_progress_dialog_set_value(wind->load_progress, 1);
+    scm_gc_unprotect_object(wind->imported_files);
+    wind->imported_files = imported_files;
+    scm_gc_protect_object(wind->imported_files);
 
-  scm_gc_unprotect_object(wind->imported_files);
-  wind->imported_files = imported_files;
-  scm_gc_protect_object(wind->imported_files);
+    /* Enable all buttons. */
+    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+                                      TRUE, TRUE, TRUE, TRUE);
 
-  /* Enable all buttons. */
-  gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                    TRUE, TRUE, TRUE, TRUE);
+    /* If the log is empty, move on to the next page automatically. */
+    if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(wind->load_log))) == 0)
+        gnome_druid_page_next(GNOME_DRUID_PAGE(widget));
 
-  /* If the log is empty, move on to the next page automatically. */
-  if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(wind->load_log))) == 0)
-    gnome_druid_page_next(GNOME_DRUID_PAGE(widget));
-
-  gtk_widget_set_sensitive(wind->load_pause, FALSE);
-  wind->busy = FALSE;
-  return;
+    gtk_widget_set_sensitive(wind->load_pause, FALSE);
+    wind->busy = FALSE;
+    return;
 }
 
 
@@ -1003,36 +1038,36 @@
 
 static void
 gnc_ui_qif_import_load_progress_pause_cb(GtkButton * button,
-                                         gpointer user_data)
+        gpointer user_data)
 {
-  QIFImportWindow *wind = user_data;
-  SCM toggle_pause      = scm_c_eval_string("qif-import:toggle-pause");
-  SCM progress;
+    QIFImportWindow *wind = user_data;
+    SCM toggle_pause      = scm_c_eval_string("qif-import:toggle-pause");
+    SCM progress;
 
-  if (!wind->busy)
-    return;
+    if (!wind->busy)
+        return;
 
-  /* Create SCM for the progress helper. */
-  progress = SWIG_NewPointerObj(wind->load_progress,
-                                SWIG_TypeQuery("_p__GNCProgressDialog"),
-                                0);
+    /* Create SCM for the progress helper. */
+    progress = SWIG_NewPointerObj(wind->load_progress,
+                                  SWIG_TypeQuery("_p__GNCProgressDialog"),
+                                  0);
 
-  /* Pause (or resume) the currently running operation. */
-  scm_call_1(toggle_pause, progress);
+    /* Pause (or resume) the currently running operation. */
+    scm_call_1(toggle_pause, progress);
 
-  /* Swap the button label between pause and resume. */
-  if (strcmp(gtk_button_get_label(button), _("_Resume")))
-  {
-    gtk_button_set_use_stock(button, FALSE);
-    gtk_button_set_use_underline(button, TRUE);
-    gtk_button_set_label(button, _("_Resume"));
-  }
-  else
-  {
-    gtk_button_set_use_stock(button, TRUE);
-    gtk_button_set_use_underline(button, FALSE);
-    gtk_button_set_label(button, "gtk-media-pause");
-  }
+    /* Swap the button label between pause and resume. */
+    if (strcmp(gtk_button_get_label(button), _("_Resume")))
+    {
+        gtk_button_set_use_stock(button, FALSE);
+        gtk_button_set_use_underline(button, TRUE);
+        gtk_button_set_label(button, _("_Resume"));
+    }
+    else
+    {
+        gtk_button_set_use_stock(button, TRUE);
+        gtk_button_set_use_underline(button, FALSE);
+        gtk_button_set_label(button, "gtk-media-pause");
+    }
 }
 
 
@@ -1047,34 +1082,34 @@
                                         gpointer arg1,
                                         gpointer user_data)
 {
-  QIFImportWindow *wind = user_data;
-  SCM check_from_acct   = scm_c_eval_string("qif-file:check-from-acct");
+    QIFImportWindow *wind = user_data;
+    SCM check_from_acct   = scm_c_eval_string("qif-file:check-from-acct");
 
-  if (wind->ask_date_format)
-  {
-    /* We need to get a date format, so go to the next page. */
-    return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
-  }
-  else if (scm_call_1(check_from_acct, wind->selected_file) != SCM_BOOL_T)
-  {
-    SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname");
-    const gchar * default_acctname;
+    if (wind->ask_date_format)
+    {
+        /* We need to get a date format, so go to the next page. */
+        return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
+    }
+    else if (scm_call_1(check_from_acct, wind->selected_file) != SCM_BOOL_T)
+    {
+        SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname");
+        const gchar * default_acctname;
 
-    /* Go to the "ask account name" page. */
-    default_acctname = scm_to_locale_string(scm_call_1(default_acct,
-                                                   wind->selected_file));
-    gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
+        /* Go to the "ask account name" page. */
+        default_acctname = scm_to_locale_string(scm_call_1(default_acct,
+                                                wind->selected_file));
+        gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
 
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             get_named_page(wind, "account_name_page"));
+        return TRUE;
+    }
+
+    /* Skip ahead to the "loaded files" page. */
     gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "account_name_page"));
+                         get_named_page(wind, "loaded_files_page"));
+
     return TRUE;
-  }
-
-  /* Skip ahead to the "loaded files" page. */
-  gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                       get_named_page(wind, "loaded_files_page"));
-
-  return TRUE;
 }
 
 
@@ -1088,17 +1123,17 @@
 static gboolean
 load_progress_back_timeout_cb(gpointer data)
 {
-  QIFImportWindow *wind = data;
+    QIFImportWindow *wind = data;
 
-  if (wind->busy)
-    /* Wait for timer to go off again. */
-    return TRUE;
+    if (wind->busy)
+        /* Wait for timer to go off again. */
+        return TRUE;
 
-  /* The busy flag was lowered. Go back to the previous page. */
-  gnome_druid_page_back(get_named_page(wind, "load_progress_page"));
+    /* The busy flag was lowered. Go back to the previous page. */
+    gnome_druid_page_back(get_named_page(wind, "load_progress_page"));
 
-  /* Cancel the timer. */
-  return FALSE;
+    /* Cancel the timer. */
+    return FALSE;
 }
 
 
@@ -1113,20 +1148,20 @@
                                         gpointer arg1,
                                         gpointer user_data)
 {
-  QIFImportWindow *wind = user_data;
+    QIFImportWindow *wind = user_data;
 
-  if (wind->busy)
-  {
-    /* Cancel any long-running Scheme operation. */
-    scm_c_eval_string("(qif-import:cancel)");
+    if (wind->busy)
+    {
+        /* Cancel any long-running Scheme operation. */
+        scm_c_eval_string("(qif-import:cancel)");
 
-    /* Wait for the busy flag to be lowered. */
-    g_timeout_add(200, load_progress_back_timeout_cb, user_data);
+        /* Wait for the busy flag to be lowered. */
+        g_timeout_add(200, load_progress_back_timeout_cb, user_data);
 
-    return TRUE;
-  }
+        return TRUE;
+    }
 
-  return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
+    return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
 }
 
 
@@ -1135,47 +1170,47 @@
                                       gpointer arg1,
                                       gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  SCM  reparse_dates   = scm_c_eval_string("qif-file:reparse-dates");
-  SCM  check_from_acct = scm_c_eval_string("qif-file:check-from-acct");
-  SCM  format_sym;
-  gchar *text;
+    SCM  reparse_dates   = scm_c_eval_string("qif-file:reparse-dates");
+    SCM  check_from_acct = scm_c_eval_string("qif-file:check-from-acct");
+    SCM  format_sym;
+    gchar *text;
 
-  /* Get the selected date format. */
-  text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(wind->date_format_combo));
-  if (!text)
-  {
-    g_critical("QIF import: BUG DETECTED in gnc_ui_qif_import_date_format_next_cb. Format is NULL.");
-    return TRUE;
-  }
-  format_sym = scm_str2symbol(text);
-  g_free(text);
+    /* Get the selected date format. */
+    text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(wind->date_format_combo));
+    if (!text)
+    {
+        g_critical("QIF import: BUG DETECTED in gnc_ui_qif_import_date_format_next_cb. Format is NULL.");
+        return TRUE;
+    }
+    format_sym = scm_str2symbol(text);
+    g_free(text);
 
-  /* Reparse the dates using the selected format. */
-  scm_call_2(reparse_dates, wind->selected_file, format_sym);
+    /* Reparse the dates using the selected format. */
+    scm_call_2(reparse_dates, wind->selected_file, format_sym);
 
-  /* Determine the next page to display. */
-  if (scm_call_1(check_from_acct, wind->selected_file) != SCM_BOOL_T)
-  {
-    /* There is an account name missing. Ask the user to provide one. */
-    SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname");
-    const gchar * default_acctname;
+    /* Determine the next page to display. */
+    if (scm_call_1(check_from_acct, wind->selected_file) != SCM_BOOL_T)
+    {
+        /* There is an account name missing. Ask the user to provide one. */
+        SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname");
+        const gchar * default_acctname;
 
-    default_acctname = scm_to_locale_string(scm_call_1(default_acct,
-                                                   wind->selected_file));
-    gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
+        default_acctname = scm_to_locale_string(scm_call_1(default_acct,
+                                                wind->selected_file));
+        gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
 
-    return FALSE;
-  }
-  else
-  {
-    /* Skip ahead to the "loaded files" page. */
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "loaded_files_page"));
+        return FALSE;
+    }
+    else
+    {
+        /* Skip ahead to the "loaded files" page. */
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             get_named_page(wind, "loaded_files_page"));
 
-    return TRUE;
-  }
+        return TRUE;
+    }
 }
 
 
@@ -1189,50 +1224,54 @@
 update_file_page(QIFImportWindow * wind)
 {
 
-  SCM       loaded_file_list = wind->imported_files;
-  SCM       scm_qiffile = SCM_BOOL_F;
-  SCM       qif_file_path;
-  int       row = 0;
-  const char  * row_text;
-  GtkTreeView *view;
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GtkTreePath *path;
-  GtkTreeRowReference *reference = NULL;
+    SCM       loaded_file_list = wind->imported_files;
+    SCM       scm_qiffile = SCM_BOOL_F;
+    SCM       qif_file_path;
+    int       row = 0;
+    const char  * row_text;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkTreeIter iter;
+    GtkTreePath *path;
+    GtkTreeRowReference *reference = NULL;
 
-  /* clear the list */
-  view = GTK_TREE_VIEW(wind->selected_file_view);
-  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
-  gtk_list_store_clear(store);
-  qif_file_path = scm_c_eval_string("qif-file:path");
+    /* clear the list */
+    view = GTK_TREE_VIEW(wind->selected_file_view);
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+    gtk_list_store_clear(store);
+    qif_file_path = scm_c_eval_string("qif-file:path");
 
-  while(!scm_is_null(loaded_file_list)) {
-    scm_qiffile = SCM_CAR(loaded_file_list);
-    row_text    = scm_to_locale_string(scm_call_1(qif_file_path, scm_qiffile));
+    while (!scm_is_null(loaded_file_list))
+    {
+        scm_qiffile = SCM_CAR(loaded_file_list);
+        row_text    = scm_to_locale_string(scm_call_1(qif_file_path, scm_qiffile));
 
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       FILENAME_COL_INDEX, row++,
-                       FILENAME_COL_NAME, row_text,
-                       -1);
-    if (scm_qiffile == wind->selected_file) {
-      path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
-      reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
-      gtk_tree_path_free(path);
+        gtk_list_store_append(store, &iter);
+        gtk_list_store_set(store, &iter,
+                           FILENAME_COL_INDEX, row++,
+                           FILENAME_COL_NAME, row_text,
+                           -1);
+        if (scm_qiffile == wind->selected_file)
+        {
+            path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+            reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
+            gtk_tree_path_free(path);
+        }
+
+        loaded_file_list = SCM_CDR(loaded_file_list);
     }
 
-    loaded_file_list = SCM_CDR(loaded_file_list);
-  }
-
-  if (reference) {
-    GtkTreeSelection* selection = gtk_tree_view_get_selection(view);
-    path = gtk_tree_row_reference_get_path(reference);
-    if (path) {
-      gtk_tree_selection_select_path(selection, path);
-      gtk_tree_path_free(path);
+    if (reference)
+    {
+        GtkTreeSelection* selection = gtk_tree_view_get_selection(view);
+        path = gtk_tree_row_reference_get_path(reference);
+        if (path)
+        {
+            gtk_tree_selection_select_path(selection, path);
+            gtk_tree_path_free(path);
+        }
+        gtk_tree_row_reference_free(reference);
     }
-    gtk_tree_row_reference_free(reference);
-  }
 }
 
 
@@ -1245,33 +1284,37 @@
 gnc_ui_qif_import_select_loaded_file_cb(GtkTreeSelection *selection,
                                         gpointer          user_data)
 {
-  QIFImportWindow * wind = user_data;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  gint row;
-  GtkWidget *button;
+    QIFImportWindow * wind = user_data;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    gint row;
+    GtkWidget *button;
 
-  button = gnc_glade_lookup_widget(wind->window, "unload_file_button");
-  if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
-    gtk_tree_model_get(model, &iter, FILENAME_COL_INDEX, &row, -1);
-    if (scm_is_list(wind->imported_files) &&
-       (scm_ilength(wind->imported_files) > row)) {
-      scm_gc_unprotect_object(wind->selected_file);
-      wind->selected_file = scm_list_ref(wind->imported_files,
-                                         scm_int2num(row));
-      scm_gc_protect_object(wind->selected_file);
-      g_object_set(button, "sensitive", TRUE, (gchar*)NULL);
-      gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                        TRUE, TRUE, TRUE, TRUE);
+    button = gnc_glade_lookup_widget(wind->window, "unload_file_button");
+    if (gtk_tree_selection_get_selected(selection, &model, &iter))
+    {
+        gtk_tree_model_get(model, &iter, FILENAME_COL_INDEX, &row, -1);
+        if (scm_is_list(wind->imported_files) &&
+                (scm_ilength(wind->imported_files) > row))
+        {
+            scm_gc_unprotect_object(wind->selected_file);
+            wind->selected_file = scm_list_ref(wind->imported_files,
+                                               scm_int2num(row));
+            scm_gc_protect_object(wind->selected_file);
+            g_object_set(button, "sensitive", TRUE, (gchar*)NULL);
+            gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+                                              TRUE, TRUE, TRUE, TRUE);
+        }
     }
-  } else {
-    scm_gc_unprotect_object(wind->selected_file);
-    wind->selected_file = SCM_BOOL_F;
-    scm_gc_protect_object(wind->selected_file);
-      g_object_set(button, "sensitive", FALSE, (gchar*)NULL);
-    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                      FALSE, TRUE, TRUE, TRUE);
-  }
+    else
+    {
+        scm_gc_unprotect_object(wind->selected_file);
+        wind->selected_file = SCM_BOOL_F;
+        scm_gc_protect_object(wind->selected_file);
+        g_object_set(button, "sensitive", FALSE, (gchar*)NULL);
+        gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+                                          FALSE, TRUE, TRUE, TRUE);
+    }
 }
 
 
@@ -1283,14 +1326,14 @@
 
 static void
 gnc_ui_qif_import_loaded_files_prepare_cb(GnomeDruidPage * page,
-                                          gpointer arg1,
-                                          gpointer user_data)
+        gpointer arg1,
+        gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                    FALSE, TRUE, TRUE, TRUE);
-  update_file_page(wind);
+    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+                                      FALSE, TRUE, TRUE, TRUE);
+    update_file_page(wind);
 }
 
 
@@ -1304,12 +1347,12 @@
 gnc_ui_qif_import_load_another_cb(GtkButton * button,
                                   gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                       get_named_page(wind, "load_file_page"));
-  gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                    TRUE, TRUE, TRUE, TRUE);
+    gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                         get_named_page(wind, "load_file_page"));
+    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+                                      TRUE, TRUE, TRUE, TRUE);
 }
 
 
@@ -1323,25 +1366,26 @@
 gnc_ui_qif_import_unload_file_cb(GtkButton * button,
                                  gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  SCM unload_qif_file = scm_c_eval_string("qif-dialog:unload-qif-file");
-  SCM imported_files;
+    SCM unload_qif_file = scm_c_eval_string("qif-dialog:unload-qif-file");
+    SCM imported_files;
 
-  if (wind->selected_file != SCM_BOOL_F) {
-    imported_files =
-      scm_call_2(unload_qif_file, wind->selected_file, wind->imported_files);
+    if (wind->selected_file != SCM_BOOL_F)
+    {
+        imported_files =
+            scm_call_2(unload_qif_file, wind->selected_file, wind->imported_files);
 
-    scm_gc_unprotect_object(wind->imported_files);
-    wind->imported_files = imported_files;
-    scm_gc_protect_object(wind->imported_files);
+        scm_gc_unprotect_object(wind->imported_files);
+        wind->imported_files = imported_files;
+        scm_gc_protect_object(wind->imported_files);
 
-    scm_gc_unprotect_object(wind->selected_file);
-    wind->selected_file = SCM_BOOL_F;
-    scm_gc_protect_object(wind->selected_file);
+        scm_gc_unprotect_object(wind->selected_file);
+        wind->selected_file = SCM_BOOL_F;
+        scm_gc_protect_object(wind->selected_file);
 
-    update_file_page(wind);
-  }
+        update_file_page(wind);
+    }
 }
 
 
@@ -1356,16 +1400,16 @@
                                        gpointer arg1,
                                        gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  /* Prepare the matching pages. */
-  gnc_set_busy_cursor(NULL, TRUE);
-  update_account_page(wind);
-  update_category_page(wind);
-  update_memo_page(wind);
-  gnc_unset_busy_cursor(NULL);
+    /* Prepare the matching pages. */
+    gnc_set_busy_cursor(NULL, TRUE);
+    update_account_page(wind);
+    update_category_page(wind);
+    update_memo_page(wind);
+    gnc_unset_busy_cursor(NULL);
 
-  return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
+    return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
 }
 
 
@@ -1380,21 +1424,23 @@
                                        gpointer arg1,
                                        gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
-  const gchar * acct_name = gtk_entry_get_text(GTK_ENTRY(wind->acct_entry));
-  SCM    fix_default = scm_c_eval_string("qif-import:fix-from-acct");
-  SCM    scm_name;
+    QIFImportWindow * wind = user_data;
+    const gchar * acct_name = gtk_entry_get_text(GTK_ENTRY(wind->acct_entry));
+    SCM    fix_default = scm_c_eval_string("qif-import:fix-from-acct");
+    SCM    scm_name;
 
-  g_return_val_if_fail(wind->selected_file != SCM_BOOL_F, FALSE);
-  if (!acct_name || acct_name[0] == 0) {
-    gnc_warning_dialog(wind->window, "%s", _("You must enter an account name."));
-    return TRUE;
-  }
-  else {
-    scm_name = scm_makfrom0str(acct_name);
-    scm_call_2(fix_default, wind->selected_file, scm_name);
-    return FALSE;
-  }
+    g_return_val_if_fail(wind->selected_file != SCM_BOOL_F, FALSE);
+    if (!acct_name || acct_name[0] == 0)
+    {
+        gnc_warning_dialog(wind->window, "%s", _("You must enter an account name."));
+        return TRUE;
+    }
+    else
+    {
+        scm_name = scm_makfrom0str(acct_name);
+        scm_call_2(fix_default, wind->selected_file, scm_name);
+        return FALSE;
+    }
 }
 
 /********************************************************************
@@ -1409,25 +1455,25 @@
                                        gpointer arg1,
                                        gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
-  SCM unload = scm_c_eval_string("qif-dialog:unload-qif-file");
-  SCM files_list;
+    QIFImportWindow * wind = user_data;
+    SCM unload = scm_c_eval_string("qif-dialog:unload-qif-file");
+    SCM files_list;
 
-  files_list = scm_call_2(unload, wind->selected_file, wind->imported_files);
+    files_list = scm_call_2(unload, wind->selected_file, wind->imported_files);
 
-  scm_gc_unprotect_object(wind->imported_files);
-  wind->imported_files = files_list;
-  scm_gc_protect_object(wind->imported_files);
+    scm_gc_unprotect_object(wind->imported_files);
+    wind->imported_files = files_list;
+    scm_gc_protect_object(wind->imported_files);
 
-  scm_gc_unprotect_object(wind->selected_file);
-  wind->selected_file = SCM_BOOL_F;
-  scm_gc_protect_object(wind->selected_file);
+    scm_gc_unprotect_object(wind->selected_file);
+    wind->selected_file = SCM_BOOL_F;
+    scm_gc_protect_object(wind->selected_file);
 
-  gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                       get_named_page(wind, "load_file_page"));
-  gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                    TRUE, TRUE, TRUE, TRUE);
-  return TRUE;
+    gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                         get_named_page(wind, "load_file_page"));
+    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+                                      TRUE, TRUE, TRUE, TRUE);
+    return TRUE;
 }
 
 
@@ -1441,59 +1487,59 @@
                            GCallback select_cb,
                            gpointer user_data)
 {
-  GtkTreeView *view = GTK_TREE_VIEW(widget);
-  GtkTreeSelection *selection = gtk_tree_view_get_selection(view);
-  GtkListStore *store;
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
+    GtkTreeView *view = GTK_TREE_VIEW(widget);
+    GtkTreeSelection *selection = gtk_tree_view_get_selection(view);
+    GtkListStore *store;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
 
-  store = gtk_list_store_new(NUM_ACCOUNT_COLS, G_TYPE_INT, G_TYPE_STRING,
-                             G_TYPE_STRING, G_TYPE_BOOLEAN,
-                             PANGO_TYPE_ELLIPSIZE_MODE);
-  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    store = gtk_list_store_new(NUM_ACCOUNT_COLS, G_TYPE_INT, G_TYPE_STRING,
+                               G_TYPE_STRING, G_TYPE_BOOLEAN,
+                               PANGO_TYPE_ELLIPSIZE_MODE);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(col_name,
-                                                    renderer,
-                                                    "text",
-                                                    ACCOUNT_COL_QIF_NAME,
-                                                    "ellipsize",
-                                                    ACCOUNT_COL_ELLIPSIZE,
-                                                    NULL);
-  g_object_set(column, "expand", TRUE, NULL);
-  gtk_tree_view_column_set_resizable(column, TRUE);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(col_name,
+             renderer,
+             "text",
+             ACCOUNT_COL_QIF_NAME,
+             "ellipsize",
+             ACCOUNT_COL_ELLIPSIZE,
+             NULL);
+    g_object_set(column, "expand", TRUE, NULL);
+    gtk_tree_view_column_set_resizable(column, TRUE);
+    gtk_tree_view_append_column(view, column);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("GnuCash account name"),
-                                                    renderer,
-                                                    "text",
-                                                    ACCOUNT_COL_GNC_NAME,
-                                                    "ellipsize",
-                                                    ACCOUNT_COL_ELLIPSIZE,
-                                                    NULL);
-  g_object_set(column, "expand", TRUE, NULL);
-  gtk_tree_view_column_set_resizable(column, TRUE);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("GnuCash account name"),
+             renderer,
+             "text",
+             ACCOUNT_COL_GNC_NAME,
+             "ellipsize",
+             ACCOUNT_COL_ELLIPSIZE,
+             NULL);
+    g_object_set(column, "expand", TRUE, NULL);
+    gtk_tree_view_column_set_resizable(column, TRUE);
+    gtk_tree_view_append_column(view, column);
 
-  renderer = gtk_cell_renderer_toggle_new();
-  g_object_set(renderer, "activatable", FALSE, NULL);
-  column = gtk_tree_view_column_new_with_attributes(_("New?"),
-                                                    renderer,
-                                                    "active",
-                                                    ACCOUNT_COL_NEW,
-                                                    NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_toggle_new();
+    g_object_set(renderer, "activatable", FALSE, NULL);
+    column = gtk_tree_view_column_new_with_attributes(_("New?"),
+             renderer,
+             "active",
+             ACCOUNT_COL_NEW,
+             NULL);
+    gtk_tree_view_append_column(view, column);
 
-  g_object_set_data(G_OBJECT(store), PREV_ROW, GINT_TO_POINTER(-1));
+    g_object_set_data(G_OBJECT(store), PREV_ROW, GINT_TO_POINTER(-1));
 
-  /* Connect the signal handlers. */
-  g_signal_connect(view, "row-activated", G_CALLBACK(activate_cb), user_data);
-  g_signal_connect(selection, "changed", G_CALLBACK(select_cb), user_data);
+    /* Connect the signal handlers. */
+    g_signal_connect(view, "row-activated", G_CALLBACK(activate_cb), user_data);
+    g_signal_connect(selection, "changed", G_CALLBACK(select_cb), user_data);
 
-  /* Allow multiple rows to be selected. */
-  gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
+    /* Allow multiple rows to be selected. */
+    gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
 }
 
 
@@ -1511,74 +1557,74 @@
 static void
 rematch_line(QIFImportWindow *wind, GtkTreeSelection *selection,
              SCM display_info, SCM map_info,
-            void (*update_page)(QIFImportWindow *))
+             void (*update_page)(QIFImportWindow *))
 {
-  SCM           get_qif_name = scm_c_eval_string("qif-map-entry:qif-name");
-  SCM           get_gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
-  SCM           set_gnc_name = scm_c_eval_string("qif-map-entry:set-gnc-name!");
-  SCM           map_entry;
-  SCM           gnc_name;
-  GList        *pathlist;
-  GList        *current;
-  GtkTreeModel *model;
-  GtkTreeIter   iter;
-  gint          row;
+    SCM           get_qif_name = scm_c_eval_string("qif-map-entry:qif-name");
+    SCM           get_gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
+    SCM           set_gnc_name = scm_c_eval_string("qif-map-entry:set-gnc-name!");
+    SCM           map_entry;
+    SCM           gnc_name;
+    GList        *pathlist;
+    GList        *current;
+    GtkTreeModel *model;
+    GtkTreeIter   iter;
+    gint          row;
 
-  /* Get a list of selected rows. */
-  pathlist = gtk_tree_selection_get_selected_rows(selection, &model);
-  if (!pathlist)
-    return;
+    /* Get a list of selected rows. */
+    pathlist = gtk_tree_selection_get_selected_rows(selection, &model);
+    if (!pathlist)
+        return;
 
 
-  /*
-   * Update the first selected row.
-   */
+    /*
+     * Update the first selected row.
+     */
 
-  /* Get the row number of the first selected row. */
-  if (!gtk_tree_model_get_iter(model, &iter, (GtkTreePath *) pathlist->data))
-    return;
-  gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
+    /* Get the row number of the first selected row. */
+    if (!gtk_tree_model_get_iter(model, &iter, (GtkTreePath *) pathlist->data))
+        return;
+    gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
 
-  /* Save the row number. */
-  g_object_set_data(G_OBJECT(model), PREV_ROW, GINT_TO_POINTER(row));
-  if (row == -1)
-    return;
+    /* Save the row number. */
+    g_object_set_data(G_OBJECT(model), PREV_ROW, GINT_TO_POINTER(row));
+    if (row == -1)
+        return;
 
-  /* Find the <qif-map-entry> corresponding to the selected row. */
-  map_entry = scm_list_ref(display_info, scm_int2num(row));
+    /* Find the <qif-map-entry> corresponding to the selected row. */
+    map_entry = scm_list_ref(display_info, scm_int2num(row));
 
-  /* Call the account picker to update it. */
-  if (!qif_account_picker_dialog(wind, map_entry))
-    return;
-  gnc_name = scm_call_1(get_gnc_name, map_entry);
+    /* Call the account picker to update it. */
+    if (!qif_account_picker_dialog(wind, map_entry))
+        return;
+    gnc_name = scm_call_1(get_gnc_name, map_entry);
 
-  /* Update the mapping hash table. */
-  scm_hash_set_x(map_info, scm_call_1(get_qif_name, map_entry), map_entry);
+    /* Update the mapping hash table. */
+    scm_hash_set_x(map_info, scm_call_1(get_qif_name, map_entry), map_entry);
 
 
-  /*
-   * Map all other selected rows to the same GnuCash account.
-   */
-  for (current = pathlist->next; current; current = current->next)
-  {
-      /* Get the row number. */
-      gtk_tree_model_get_iter(model, &iter, (GtkTreePath *) current->data);
-      gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
+    /*
+     * Map all other selected rows to the same GnuCash account.
+     */
+    for (current = pathlist->next; current; current = current->next)
+    {
+        /* Get the row number. */
+        gtk_tree_model_get_iter(model, &iter, (GtkTreePath *) current->data);
+        gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
 
-      /* Update the <qif-map-entry> for the selected row. */
-      map_entry = scm_list_ref(display_info, scm_int2num(row));
-      scm_call_2(set_gnc_name, map_entry, gnc_name);
+        /* Update the <qif-map-entry> for the selected row. */
+        map_entry = scm_list_ref(display_info, scm_int2num(row));
+        scm_call_2(set_gnc_name, map_entry, gnc_name);
 
-      /* Update the mapping hash table. */
-      scm_hash_set_x(map_info, scm_call_1(get_qif_name, map_entry), map_entry);
-  }
+        /* Update the mapping hash table. */
+        scm_hash_set_x(map_info, scm_call_1(get_qif_name, map_entry), map_entry);
+    }
 
-  /* Free the path list. */
-  g_list_foreach(pathlist, (GFunc) gtk_tree_path_free, NULL);
-  g_list_free(pathlist);
+    /* Free the path list. */
+    g_list_foreach(pathlist, (GFunc) gtk_tree_path_free, NULL);
+    g_list_free(pathlist);
 
-  /* Update the display. */
-  update_page(wind);
+    /* Update the display. */
+    update_page(wind);
 }
 
 
@@ -1594,13 +1640,13 @@
                                       GtkTreeViewColumn *column,
                                       gpointer user_data)
 {
-  QIFImportWindow  *wind = user_data;
+    QIFImportWindow  *wind = user_data;
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  rematch_line(wind, gtk_tree_view_get_selection(view),
-               wind->acct_display_info, wind->acct_map_info,
-               update_account_page);
+    rematch_line(wind, gtk_tree_view_get_selection(view),
+                 wind->acct_display_info, wind->acct_map_info,
+                 update_account_page);
 }
 
 
@@ -1616,28 +1662,28 @@
 gnc_ui_qif_import_account_select_cb(GtkTreeSelection *selection,
                                     gpointer user_data)
 {
-  QIFImportWindow  *wind = user_data;
-  gint              count = gtk_tree_selection_count_selected_rows(selection);
-  gchar            *count_str;
+    QIFImportWindow  *wind = user_data;
+    gint              count = gtk_tree_selection_count_selected_rows(selection);
+    gchar            *count_str;
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  /* Update the "items selected" count. */
-  if (wind->acct_view_count)
-  {
-    count_str = g_strdup_printf("%d", count);
-    gtk_label_set_text(GTK_LABEL(wind->acct_view_count), count_str);
-    g_free(count_str);
-  }
+    /* Update the "items selected" count. */
+    if (wind->acct_view_count)
+    {
+        count_str = g_strdup_printf("%d", count);
+        gtk_label_set_text(GTK_LABEL(wind->acct_view_count), count_str);
+        g_free(count_str);
+    }
 
-  /* Enable/disable the Change button. */
-  if (wind->acct_view_btn)
-  {
-    if (count)
-      gtk_widget_set_sensitive(wind->acct_view_btn, TRUE);
-    else
-      gtk_widget_set_sensitive(wind->acct_view_btn, FALSE);
-  }
+    /* Enable/disable the Change button. */
+    if (wind->acct_view_btn)
+    {
+        if (count)
+            gtk_widget_set_sensitive(wind->acct_view_btn, TRUE);
+        else
+            gtk_widget_set_sensitive(wind->acct_view_btn, FALSE);
+    }
 }
 
 
@@ -1653,14 +1699,14 @@
                                        GtkTreeViewColumn *column,
                                        gpointer user_data)
 {
-  QIFImportWindow *wind = user_data;
-  GtkTreeSelection *selection;
+    QIFImportWindow *wind = user_data;
+    GtkTreeSelection *selection;
 
-  g_return_if_fail(view && wind);
-  selection = gtk_tree_view_get_selection(view);
+    g_return_if_fail(view && wind);
+    selection = gtk_tree_view_get_selection(view);
 
-  rematch_line(wind, selection, wind->cat_display_info, wind->cat_map_info,
-               update_category_page);
+    rematch_line(wind, selection, wind->cat_display_info, wind->cat_map_info,
+                 update_category_page);
 }
 
 
@@ -1676,28 +1722,28 @@
 gnc_ui_qif_import_category_select_cb(GtkTreeSelection *selection,
                                      gpointer user_data)
 {
-  QIFImportWindow  *wind = user_data;
-  gint              count = gtk_tree_selection_count_selected_rows(selection);
-  gchar            *count_str;
+    QIFImportWindow  *wind = user_data;
+    gint              count = gtk_tree_selection_count_selected_rows(selection);
+    gchar            *count_str;
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  /* Update the "items selected" count. */
-  if (wind->cat_view_count)
-  {
-    count_str = g_strdup_printf("%d", count);
-    gtk_label_set_text(GTK_LABEL(wind->cat_view_count), count_str);
-    g_free(count_str);
-  }
+    /* Update the "items selected" count. */
+    if (wind->cat_view_count)
+    {
+        count_str = g_strdup_printf("%d", count);
+        gtk_label_set_text(GTK_LABEL(wind->cat_view_count), count_str);
+        g_free(count_str);
+    }
 
-  /* Enable/disable the Change button. */
-  if (wind->cat_view_btn)
-  {
-    if (count)
-      gtk_widget_set_sensitive(wind->cat_view_btn, TRUE);
-    else
-      gtk_widget_set_sensitive(wind->cat_view_btn, FALSE);
-  }
+    /* Enable/disable the Change button. */
+    if (wind->cat_view_btn)
+    {
+        if (count)
+            gtk_widget_set_sensitive(wind->cat_view_btn, TRUE);
+        else
+            gtk_widget_set_sensitive(wind->cat_view_btn, FALSE);
+    }
 }
 
 
@@ -1713,14 +1759,14 @@
                                    GtkTreeViewColumn *column,
                                    gpointer user_data)
 {
-  QIFImportWindow *wind = user_data;
-  GtkTreeSelection *selection;
+    QIFImportWindow *wind = user_data;
+    GtkTreeSelection *selection;
 
-  g_return_if_fail(view && wind);
-  selection = gtk_tree_view_get_selection(view);
+    g_return_if_fail(view && wind);
+    selection = gtk_tree_view_get_selection(view);
 
-  rematch_line(wind, selection, wind->memo_display_info, wind->memo_map_info,
-               update_memo_page);
+    rematch_line(wind, selection, wind->memo_display_info, wind->memo_map_info,
+                 update_memo_page);
 }
 
 
@@ -1736,28 +1782,28 @@
 gnc_ui_qif_import_memo_select_cb(GtkTreeSelection *selection,
                                  gpointer user_data)
 {
-  QIFImportWindow  *wind = user_data;
-  gint              count = gtk_tree_selection_count_selected_rows(selection);
-  gchar            *count_str;
+    QIFImportWindow  *wind = user_data;
+    gint              count = gtk_tree_selection_count_selected_rows(selection);
+    gchar            *count_str;
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  /* Update the "items selected" count. */
-  if (wind->memo_view_count)
-  {
-    count_str = g_strdup_printf("%d", count);
-    gtk_label_set_text(GTK_LABEL(wind->memo_view_count), count_str);
-    g_free(count_str);
-  }
+    /* Update the "items selected" count. */
+    if (wind->memo_view_count)
+    {
+        count_str = g_strdup_printf("%d", count);
+        gtk_label_set_text(GTK_LABEL(wind->memo_view_count), count_str);
+        g_free(count_str);
+    }
 
-  /* Enable/disable the Change button. */
-  if (wind->memo_view_btn)
-  {
-    if (count)
-      gtk_widget_set_sensitive(wind->memo_view_btn, TRUE);
-    else
-      gtk_widget_set_sensitive(wind->memo_view_btn, FALSE);
-  }
+    /* Enable/disable the Change button. */
+    if (wind->memo_view_btn)
+    {
+        if (count)
+            gtk_widget_set_sensitive(wind->memo_view_btn, TRUE);
+        else
+            gtk_widget_set_sensitive(wind->memo_view_btn, FALSE);
+    }
 }
 
 
@@ -1772,15 +1818,15 @@
 static void
 gnc_ui_qif_import_account_rematch_cb(GtkButton *button, gpointer user_data)
 {
-  QIFImportWindow  *wind = user_data;
+    QIFImportWindow  *wind = user_data;
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  rematch_line(wind,
-               gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->acct_view)),
-               wind->acct_display_info,
-               wind->acct_map_info,
-               update_account_page);
+    rematch_line(wind,
+                 gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->acct_view)),
+                 wind->acct_display_info,
+                 wind->acct_map_info,
+                 update_account_page);
 }
 
 
@@ -1796,28 +1842,28 @@
                                   gpointer arg1,
                                   gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  /* If there are category mappings then proceed as usual. */
-  if (scm_is_list(wind->cat_display_info) && !scm_is_null(wind->cat_display_info))
-    return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
+    /* If there are category mappings then proceed as usual. */
+    if (scm_is_list(wind->cat_display_info) && !scm_is_null(wind->cat_display_info))
+        return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
 
-  /* If there are memo mappings then skip to that step. */
-  if (scm_is_list(wind->memo_display_info) && !scm_is_null(wind->memo_display_info))
-  {
-    if (wind->show_doc_pages)
-      gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                           get_named_page(wind, "memo_doc_page"));
-    else
-      gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                           get_named_page(wind, "memo_match_page"));
+    /* If there are memo mappings then skip to that step. */
+    if (scm_is_list(wind->memo_display_info) && !scm_is_null(wind->memo_display_info))
+    {
+        if (wind->show_doc_pages)
+            gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                                 get_named_page(wind, "memo_doc_page"));
+        else
+            gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                                 get_named_page(wind, "memo_match_page"));
+        return TRUE;
+    }
+
+    /* Skip ahead to the currency page. */
+    gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                         get_named_page(wind, "currency_page"));
     return TRUE;
-  }
-
-  /* Skip ahead to the currency page. */
-  gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                       get_named_page(wind, "currency_page"));
-  return TRUE;
 }
 
 
@@ -1832,15 +1878,15 @@
 static void
 gnc_ui_qif_import_category_rematch_cb(GtkButton *button, gpointer user_data)
 {
-  QIFImportWindow  *wind = user_data;
+    QIFImportWindow  *wind = user_data;
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  rematch_line(wind,
-               gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->cat_view)),
-               wind->cat_display_info,
-               wind->cat_map_info,
-               update_category_page);
+    rematch_line(wind,
+                 gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->cat_view)),
+                 wind->cat_display_info,
+                 wind->cat_map_info,
+                 update_category_page);
 }
 
 
@@ -1856,17 +1902,17 @@
                                    gpointer arg1,
                                    gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  /* If there aren't any payee/memo mappings then skip that step. */
-  if (!scm_is_list(wind->memo_display_info) || scm_is_null(wind->memo_display_info))
-  {
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "currency_page"));
-    return TRUE;
-  }
+    /* If there aren't any payee/memo mappings then skip that step. */
+    if (!scm_is_list(wind->memo_display_info) || scm_is_null(wind->memo_display_info))
+    {
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             get_named_page(wind, "currency_page"));
+        return TRUE;
+    }
 
-  return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
+    return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
 }
 
 
@@ -1881,15 +1927,15 @@
 static void
 gnc_ui_qif_import_memo_rematch_cb(GtkButton *button, gpointer user_data)
 {
-  QIFImportWindow  *wind = user_data;
+    QIFImportWindow  *wind = user_data;
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  rematch_line(wind,
-               gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->memo_view)),
-               wind->memo_display_info,
-               wind->memo_map_info,
-               update_memo_page);
+    rematch_line(wind,
+                 gtk_tree_view_get_selection(GTK_TREE_VIEW(wind->memo_view)),
+                 wind->memo_display_info,
+                 wind->memo_map_info,
+                 update_memo_page);
 }
 
 
@@ -1903,18 +1949,18 @@
 gnc_ui_qif_import_memo_doc_back_cb(GnomeDruidPage * page, gpointer arg1,
                                    gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  /* If there are no categories to show, go to account matching. */
-  if (!scm_is_list(wind->cat_display_info) || scm_is_null(wind->cat_display_info))
-  {
+    /* If there are no categories to show, go to account matching. */
+    if (!scm_is_list(wind->cat_display_info) || scm_is_null(wind->cat_display_info))
+    {
 
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "account_match_page"));
-    return TRUE;
-  }
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             get_named_page(wind, "account_match_page"));
+        return TRUE;
+    }
 
-  return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
+    return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
 }
 
 
@@ -1928,20 +1974,20 @@
 gnc_ui_qif_import_memo_back_cb(GnomeDruidPage * page, gpointer arg1,
                                gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  /* If documentation is off and there are no categories to show,
-   * skip directly to account matching. */
-  if (!wind->show_doc_pages &&
-      (!scm_is_list(wind->cat_display_info) || scm_is_null(wind->cat_display_info)))
-  {
+    /* If documentation is off and there are no categories to show,
+     * skip directly to account matching. */
+    if (!wind->show_doc_pages &&
+            (!scm_is_list(wind->cat_display_info) || scm_is_null(wind->cat_display_info)))
+    {
 
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "account_match_page"));
-    return TRUE;
-  }
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             get_named_page(wind, "account_match_page"));
+        return TRUE;
+    }
 
-  return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
+    return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
 }
 
 
@@ -1957,34 +2003,34 @@
 static gboolean
 gnc_ui_qif_import_new_securities(QIFImportWindow * wind)
 {
-  SCM updates;
-  SCM update_securities = scm_c_eval_string("qif-import:update-security-hash");
+    SCM updates;
+    SCM update_securities = scm_c_eval_string("qif-import:update-security-hash");
 
-  /* Get a list of any new QIF securities since the previous call. */
-  updates = scm_call_4(update_securities,
-                       wind->security_hash,
-                       wind->ticker_map,
-                       wind->acct_map_info,
-                       wind->security_prefs);
-  if (updates != SCM_BOOL_F)
-  {
-    /* A list of new QIF securities was returned. Save it. */
-    scm_gc_unprotect_object(wind->new_securities);
-    if (wind->new_securities != SCM_BOOL_F)
-      /* There is an existing list, so append the new list. */
-      wind->new_securities = scm_append(scm_list_2(wind->new_securities,
-                                                   updates));
-    else
-      wind->new_securities = updates;
-    scm_gc_protect_object(wind->new_securities);
+    /* Get a list of any new QIF securities since the previous call. */
+    updates = scm_call_4(update_securities,
+                         wind->security_hash,
+                         wind->ticker_map,
+                         wind->acct_map_info,
+                         wind->security_prefs);
+    if (updates != SCM_BOOL_F)
+    {
+        /* A list of new QIF securities was returned. Save it. */
+        scm_gc_unprotect_object(wind->new_securities);
+        if (wind->new_securities != SCM_BOOL_F)
+            /* There is an existing list, so append the new list. */
+            wind->new_securities = scm_append(scm_list_2(wind->new_securities,
+                                              updates));
+        else
+            wind->new_securities = updates;
+        scm_gc_protect_object(wind->new_securities);
 
-    return TRUE;
-  }
+        return TRUE;
+    }
 
-  if (wind->new_securities != SCM_BOOL_F)
-    return TRUE;
+    if (wind->new_securities != SCM_BOOL_F)
+        return TRUE;
 
-  return FALSE;
+    return FALSE;
 }
 
 
@@ -2000,28 +2046,28 @@
                                    gpointer arg1,
                                    gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  /* If there are payee/memo mappings to display, go there. */
-  if (scm_is_list(wind->memo_display_info) && !scm_is_null(wind->memo_display_info))
-  {
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "memo_match_page"));
-    return TRUE;
-  }
+    /* If there are payee/memo mappings to display, go there. */
+    if (scm_is_list(wind->memo_display_info) && !scm_is_null(wind->memo_display_info))
+    {
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             get_named_page(wind, "memo_match_page"));
+        return TRUE;
+    }
 
-  /* If there are category mappings to display, go there. */
-  if (scm_is_list(wind->cat_display_info) && !scm_is_null(wind->cat_display_info))
-  {
+    /* If there are category mappings to display, go there. */
+    if (scm_is_list(wind->cat_display_info) && !scm_is_null(wind->cat_display_info))
+    {
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             get_named_page(wind, "category_match_page"));
+        return TRUE;
+    }
+
+    /* Go to account matching. */
     gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "category_match_page"));
+                         get_named_page(wind, "account_match_page"));
     return TRUE;
-  }
-
-  /* Go to account matching. */
-  gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                       get_named_page(wind, "account_match_page"));
-  return TRUE;
 }
 
 
@@ -2030,23 +2076,23 @@
                                   gpointer arg1,
                                   gpointer user_data)
 {
-  QIFImportWindow *wind = user_data;
-  QIFDruidPage    *qpage = g_object_get_data(G_OBJECT(page), "page_struct");
-  gchar           *ns;
+    QIFImportWindow *wind = user_data;
+    QIFDruidPage    *qpage = g_object_get_data(G_OBJECT(page), "page_struct");
+    gchar           *ns;
 
-  /* Get any entered namespace. */
-  ns = gtk_combo_box_get_active_text(GTK_COMBO_BOX(qpage->namespace_combo));
+    /* Get any entered namespace. */
+    ns = gtk_combo_box_get_active_text(GTK_COMBO_BOX(qpage->namespace_combo));
 
-  /* Update the namespaces available to select. */
-  if (!ns || !ns[0])
-    gnc_ui_update_namespace_picker(
-      qpage->namespace_combo,
-      gnc_commodity_get_namespace(qpage->commodity),
-      DIAG_COMM_ALL);
-  else
-    gnc_ui_update_namespace_picker(qpage->namespace_combo, ns, DIAG_COMM_ALL);
+    /* Update the namespaces available to select. */
+    if (!ns || !ns[0])
+        gnc_ui_update_namespace_picker(
+            qpage->namespace_combo,
+            gnc_commodity_get_namespace(qpage->commodity),
+            DIAG_COMM_ALL);
+    else
+        gnc_ui_update_namespace_picker(qpage->namespace_combo, ns, DIAG_COMM_ALL);
 
-  g_free(ns);
+    g_free(ns);
 }
 
 
@@ -2055,78 +2101,81 @@
                                gpointer arg1,
                                gpointer user_data)
 {
-  QIFImportWindow *wind = user_data;
-  QIFDruidPage    *qpage = g_object_get_data(G_OBJECT(page), "page_struct");
+    QIFImportWindow *wind = user_data;
+    QIFDruidPage    *qpage = g_object_get_data(G_OBJECT(page), "page_struct");
 
-  QofBook                 *book;
-  gnc_commodity_table     *table;
-  gnc_commodity_namespace *newns;
+    QofBook                 *book;
+    gnc_commodity_table     *table;
+    gnc_commodity_namespace *newns;
 
-  gchar       *namespace = gnc_ui_namespace_picker_ns(qpage->namespace_combo);
-  const gchar *name      = gtk_entry_get_text(GTK_ENTRY(qpage->name_entry));
-  const gchar *mnemonic  = gtk_entry_get_text(GTK_ENTRY(qpage->mnemonic_entry));
+    gchar       *namespace = gnc_ui_namespace_picker_ns(qpage->namespace_combo);
+    const gchar *name      = gtk_entry_get_text(GTK_ENTRY(qpage->name_entry));
+    const gchar *mnemonic  = gtk_entry_get_text(GTK_ENTRY(qpage->mnemonic_entry));
 
-  if (!name || (name[0] == 0)) {
-    gnc_warning_dialog(wind->window, "%s",
-     _("Enter a name or short description, such as \"Red Hat Stock\"."));
-    g_free(namespace);
-    return TRUE;
-  }
-  else if (!mnemonic || (mnemonic[0] == 0)) {
-    gnc_warning_dialog(wind->window, "%s",
-     _("Enter the ticker symbol or other well known abbreviation, such as"
-       " \"RHT\". If there isn't one, or you don't know it, create your own."));
-    g_free(namespace);
-    return TRUE;
-  }
-  else if (!namespace || (namespace[0] == 0)) {
-    gnc_warning_dialog(wind->window, "%s",
-     _("Select the exchange on which the symbol is traded, or select the"
-       " type of investment (such as FUND for mutual funds.) If you don't"
-       " see your exchange or an appropriate investment type, you can"
-       " enter a new one."));
-    if (namespace)
-      g_free(namespace);
-    return TRUE;
-  }
+    if (!name || (name[0] == 0))
+    {
+        gnc_warning_dialog(wind->window, "%s",
+                           _("Enter a name or short description, such as \"Red Hat Stock\"."));
+        g_free(namespace);
+        return TRUE;
+    }
+    else if (!mnemonic || (mnemonic[0] == 0))
+    {
+        gnc_warning_dialog(wind->window, "%s",
+                           _("Enter the ticker symbol or other well known abbreviation, such as"
+                             " \"RHT\". If there isn't one, or you don't know it, create your own."));
+        g_free(namespace);
+        return TRUE;
+    }
+    else if (!namespace || (namespace[0] == 0))
+    {
+        gnc_warning_dialog(wind->window, "%s",
+                           _("Select the exchange on which the symbol is traded, or select the"
+                             " type of investment (such as FUND for mutual funds.) If you don't"
+                             " see your exchange or an appropriate investment type, you can"
+                             " enter a new one."));
+        if (namespace)
+            g_free(namespace);
+        return TRUE;
+    }
 
-  /* FIXME: Should check whether a commodity with this namespace and
-   *        mnemonic already exists. If so, ask the user whether to use
-   *        the existing one, or go back and change what they've entered.
-   */
+    /* FIXME: Should check whether a commodity with this namespace and
+     *        mnemonic already exists. If so, ask the user whether to use
+     *        the existing one, or go back and change what they've entered.
+     */
 
-  book = gnc_get_current_book();
-  table = gnc_commodity_table_get_table(book);
-  if (gnc_commodity_namespace_is_iso(namespace) &&
-      !gnc_commodity_table_lookup(table, namespace, mnemonic))
-  {
-    gnc_warning_dialog(wind->window, "%s",
-                       _("You must enter an existing national "
-                         "currency or enter a different type."));
+    book = gnc_get_current_book();
+    table = gnc_commodity_table_get_table(book);
+    if (gnc_commodity_namespace_is_iso(namespace) &&
+            !gnc_commodity_table_lookup(table, namespace, mnemonic))
+    {
+        gnc_warning_dialog(wind->window, "%s",
+                           _("You must enter an existing national "
+                             "currency or enter a different type."));
 
-    g_free(namespace);
-    return TRUE;
-  }
+        g_free(namespace);
+        return TRUE;
+    }
 
-  /* Is the namespace a new one? */
-  if (!gnc_commodity_table_has_namespace(table, namespace))
-  {
-    /* Register it so that it will appear as an option on other pages. */
-    newns = gnc_commodity_table_add_namespace(table, namespace, book);
+    /* Is the namespace a new one? */
+    if (!gnc_commodity_table_has_namespace(table, namespace))
+    {
+        /* Register it so that it will appear as an option on other pages. */
+        newns = gnc_commodity_table_add_namespace(table, namespace, book);
 
-    /* Remember it so it can be removed if the import gets canceled. */
-    if (newns)
-      wind->new_namespaces = g_list_prepend(wind->new_namespaces, namespace);
+        /* Remember it so it can be removed if the import gets canceled. */
+        if (newns)
+            wind->new_namespaces = g_list_prepend(wind->new_namespaces, namespace);
+        else
+        {
+            g_warning("QIF import: Couldn't create namespace %s", namespace);
+            g_free(namespace);
+        }
+    }
     else
-    {
-      g_warning("QIF import: Couldn't create namespace %s", namespace);
-      g_free(namespace);
-    }
-  }
-  else
-    g_free(namespace);
+        g_free(namespace);
 
-  return FALSE;
+    return FALSE;
 }
 
 
@@ -2134,124 +2183,124 @@
 new_security_page(SCM security_hash_key, gnc_commodity *comm)
 {
 
-  QIFDruidPage *retval = g_new0(QIFDruidPage, 1);
-  GtkWidget    *table;
-  GtkWidget    *label;
-  gchar        *title = NULL;
-  const char   *str;
-  GnomeDruidPageStandard *page;
-  char         *name_tooltip =
-   _("Enter a name or short description, such as \"Red Hat Stock\".");
-  char         *mnemonic_tooltip =
-   _("Enter the ticker symbol or other well known abbreviation, such as"
-     " \"RHT\". If there isn't one, or you don't know it, create your own.");
-  char         *namespace_tooltip =
-   _("Select the exchange on which the symbol is traded, or select the"
-     " type of investment (such as FUND for mutual funds.) If you don't"
-     " see your exchange or an appropriate investment type, you can"
-     " enter a new one.");
+    QIFDruidPage *retval = g_new0(QIFDruidPage, 1);
+    GtkWidget    *table;
+    GtkWidget    *label;
+    gchar        *title = NULL;
+    const char   *str;
+    GnomeDruidPageStandard *page;
+    char         *name_tooltip =
+        _("Enter a name or short description, such as \"Red Hat Stock\".");
+    char         *mnemonic_tooltip =
+        _("Enter the ticker symbol or other well known abbreviation, such as"
+          " \"RHT\". If there isn't one, or you don't know it, create your own.");
+    char         *namespace_tooltip =
+        _("Select the exchange on which the symbol is traded, or select the"
+          " type of investment (such as FUND for mutual funds.) If you don't"
+          " see your exchange or an appropriate investment type, you can"
+          " enter a new one.");
 #if GTK_CHECK_VERSION(2, 12, 0)
-  /* Use the GtkTooltip API */
+    /* Use the GtkTooltip API */
 #elif GTK_CHECK_VERSION(2, 6, 0)
-  /* Use the deprecated GtkTooltips API */
-  GtkTooltips  *tooltips = gtk_tooltips_new();
+    /* Use the deprecated GtkTooltips API */
+    GtkTooltips  *tooltips = gtk_tooltips_new();
 #endif
 
-  /* Make the page widget. */
-  retval->page = gnome_druid_page_standard_new_with_vals("", NULL, NULL);
-  g_object_set_data(G_OBJECT(retval->page), "page_struct", retval);
-  page = GNOME_DRUID_PAGE_STANDARD(retval->page);
+    /* Make the page widget. */
+    retval->page = gnome_druid_page_standard_new_with_vals("", NULL, NULL);
+    g_object_set_data(G_OBJECT(retval->page), "page_struct", retval);
+    page = GNOME_DRUID_PAGE_STANDARD(retval->page);
 
-  /* Save the commodity and the hash table key. */
-  retval->commodity = comm;
-  retval->hash_key = security_hash_key;
-  scm_gc_protect_object(retval->hash_key);
+    /* Save the commodity and the hash table key. */
+    retval->commodity = comm;
+    retval->hash_key = security_hash_key;
+    scm_gc_protect_object(retval->hash_key);
 
-  /* Set the page title. */
-  str = gnc_commodity_get_mnemonic(comm);
-  str = str ? str : "";
-  title = g_markup_printf_escaped(_("Enter information about \"%s\""), str);
-  gnome_druid_page_standard_set_title(page, title);
-  g_free(title);
+    /* Set the page title. */
+    str = gnc_commodity_get_mnemonic(comm);
+    str = str ? str : "";
+    title = g_markup_printf_escaped(_("Enter information about \"%s\""), str);
+    gnome_druid_page_standard_set_title(page, title);
+    g_free(title);
 
-  /* Set the page colors. */
-  gnome_druid_page_standard_set_background(page, &std_bg_color);
-  gnome_druid_page_standard_set_logo_background(page, &std_logo_bg_color);
-  gnome_druid_page_standard_set_title_foreground(page, &std_title_color);
+    /* Set the page colors. */
+    gnome_druid_page_standard_set_background(page, &std_bg_color);
+    gnome_druid_page_standard_set_logo_background(page, &std_logo_bg_color);
+    gnome_druid_page_standard_set_title_foreground(page, &std_title_color);
 
-  /*
-   * Add all the widgets to the page.
-   */
-  table = gtk_table_new(3, 2, FALSE);
-  gtk_table_set_row_spacings(GTK_TABLE(table), 6);
-  gtk_table_set_col_spacings(GTK_TABLE(table), 12);
+    /*
+     * Add all the widgets to the page.
+     */
+    table = gtk_table_new(3, 2, FALSE);
+    gtk_table_set_row_spacings(GTK_TABLE(table), 6);
+    gtk_table_set_col_spacings(GTK_TABLE(table), 12);
 
-  /* Name entry */
-  retval->name_entry = gtk_entry_new();
-  gtk_entry_set_text(GTK_ENTRY(retval->name_entry),
-                     gnc_commodity_get_fullname(comm));
-  label = gtk_label_new_with_mnemonic(_("_Name or description:"));
-  gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->name_entry);
-  gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+    /* Name entry */
+    retval->name_entry = gtk_entry_new();
+    gtk_entry_set_text(GTK_ENTRY(retval->name_entry),
+                       gnc_commodity_get_fullname(comm));
+    label = gtk_label_new_with_mnemonic(_("_Name or description:"));
+    gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->name_entry);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 #if GTK_CHECK_VERSION(2, 12, 0)
-  gtk_widget_set_tooltip_text(label, name_tooltip);
-  gtk_widget_set_tooltip_text(retval->name_entry, name_tooltip);
+    gtk_widget_set_tooltip_text(label, name_tooltip);
+    gtk_widget_set_tooltip_text(retval->name_entry, name_tooltip);
 #elif GTK_CHECK_VERSION(2, 6, 0)
-  gtk_tooltips_set_tip(tooltips, label,
-                       name_tooltip, NULL);
-  gtk_tooltips_set_tip(tooltips, retval->name_entry,
-                       name_tooltip, NULL);
+    gtk_tooltips_set_tip(tooltips, label,
+                         name_tooltip, NULL);
+    gtk_tooltips_set_tip(tooltips, retval->name_entry,
+                         name_tooltip, NULL);
 #endif
-  gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
-                   GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-  gtk_table_attach_defaults(GTK_TABLE(table), retval->name_entry,
-                            1, 2, 0, 1);
-  /* Mnemonic entry */
-  retval->mnemonic_entry = gtk_entry_new();
-  gtk_entry_set_text(GTK_ENTRY(retval->mnemonic_entry),
-                     gnc_commodity_get_mnemonic(comm));
-  label = gtk_label_new_with_mnemonic(
-    _("_Ticker symbol or other abbreviation:"));
-  gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->mnemonic_entry);
-  gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+    gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
+                     GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+    gtk_table_attach_defaults(GTK_TABLE(table), retval->name_entry,
+                              1, 2, 0, 1);
+    /* Mnemonic entry */
+    retval->mnemonic_entry = gtk_entry_new();
+    gtk_entry_set_text(GTK_ENTRY(retval->mnemonic_entry),
+                       gnc_commodity_get_mnemonic(comm));
+    label = gtk_label_new_with_mnemonic(
+                _("_Ticker symbol or other abbreviation:"));
+    gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->mnemonic_entry);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 #if GTK_CHECK_VERSION(2, 12, 0)
-  gtk_widget_set_tooltip_text(label, mnemonic_tooltip);
-  gtk_widget_set_tooltip_text(retval->mnemonic_entry, mnemonic_tooltip);
+    gtk_widget_set_tooltip_text(label, mnemonic_tooltip);
+    gtk_widget_set_tooltip_text(retval->mnemonic_entry, mnemonic_tooltip);
 #elif GTK_CHECK_VERSION(2, 6, 0)
-  gtk_tooltips_set_tip(tooltips, label,
-                       mnemonic_tooltip, NULL);
-  gtk_tooltips_set_tip(tooltips, retval->mnemonic_entry,
-                       mnemonic_tooltip, NULL);
+    gtk_tooltips_set_tip(tooltips, label,
+                         mnemonic_tooltip, NULL);
+    gtk_tooltips_set_tip(tooltips, retval->mnemonic_entry,
+                         mnemonic_tooltip, NULL);
 #endif
-  gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
-                   GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-  gtk_table_attach_defaults(GTK_TABLE(table), retval->mnemonic_entry,
-                            1, 2, 1, 2);
+    gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
+                     GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+    gtk_table_attach_defaults(GTK_TABLE(table), retval->mnemonic_entry,
+                              1, 2, 1, 2);
 
-  /* Namespace entry */
-  retval->namespace_combo = gtk_combo_box_entry_new_text();
-  gnc_cbe_add_completion(GTK_COMBO_BOX_ENTRY(retval->namespace_combo));
-  label = gtk_label_new_with_mnemonic(
-    _("_Exchange or abbreviation type:"));
-  gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->namespace_combo);
-  gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+    /* Namespace entry */
+    retval->namespace_combo = gtk_combo_box_entry_new_text();
+    gnc_cbe_add_completion(GTK_COMBO_BOX_ENTRY(retval->namespace_combo));
+    label = gtk_label_new_with_mnemonic(
+                _("_Exchange or abbreviation type:"));
+    gtk_label_set_mnemonic_widget(GTK_LABEL(label), retval->namespace_combo);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 #if GTK_CHECK_VERSION(2, 12, 0)
-  gtk_widget_set_tooltip_text(label, namespace_tooltip);
-  gtk_widget_set_tooltip_text(retval->namespace_combo, namespace_tooltip);
+    gtk_widget_set_tooltip_text(label, namespace_tooltip);
+    gtk_widget_set_tooltip_text(retval->namespace_combo, namespace_tooltip);
 #elif GTK_CHECK_VERSION(2, 6, 0)
-  gtk_tooltips_set_tip(tooltips, label,
-                       namespace_tooltip, NULL);
-  gtk_tooltips_set_tip(tooltips, retval->namespace_combo,
-                       namespace_tooltip, NULL);
+    gtk_tooltips_set_tip(tooltips, label,
+                         namespace_tooltip, NULL);
+    gtk_tooltips_set_tip(tooltips, retval->namespace_combo,
+                         namespace_tooltip, NULL);
 #endif
-  gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
-                   GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-  gtk_table_attach_defaults(GTK_TABLE(table), retval->namespace_combo,
-                            1, 2, 2, 3);
+    gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
+                     GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+    gtk_table_attach_defaults(GTK_TABLE(table), retval->namespace_combo,
+                              1, 2, 2, 3);
 
-  gtk_box_pack_start(GTK_BOX(page->vbox), table, FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(page->vbox), table, FALSE, FALSE, 0);
 
-  return retval;
+    return retval;
 }
 
 
@@ -2264,74 +2313,74 @@
 static void
 prepare_security_pages(QIFImportWindow * wind)
 {
-  SCM   hash_ref  = scm_c_eval_string("hash-ref");
-  SCM   securities;
-  SCM   comm_ptr_token;
+    SCM   hash_ref  = scm_c_eval_string("hash-ref");
+    SCM   securities;
+    SCM   comm_ptr_token;
 
-  GList          * current;
-  gnc_commodity  * commodity;
-  GnomeDruidPage * back_page = get_named_page(wind, "commodity_doc_page");
-  QIFDruidPage   * new_page;
+    GList          * current;
+    gnc_commodity  * commodity;
+    GnomeDruidPage * back_page = get_named_page(wind, "commodity_doc_page");
+    QIFDruidPage   * new_page;
 
-  /*
-   * Make druid pages for each new QIF security.
-   */
-  gnc_set_busy_cursor(NULL, TRUE);
-  securities = wind->new_securities;
-  current = wind->commodity_pages;
-  while (!scm_is_null(securities) && (securities != SCM_BOOL_F))
-  {
-    if (current)
+    /*
+     * Make druid pages for each new QIF security.
+     */
+    gnc_set_busy_cursor(NULL, TRUE);
+    securities = wind->new_securities;
+    current = wind->commodity_pages;
+    while (!scm_is_null(securities) && (securities != SCM_BOOL_F))
     {
-      /* The page has already been made. */
-      back_page = GNOME_DRUID_PAGE(current->data);
-      current = current->next;
-    }
-    else
-    {
-      /* Get the GnuCash commodity corresponding to the new QIF security. */
-      comm_ptr_token = scm_call_2(hash_ref,
-                                  wind->security_hash,
-                                  SCM_CAR(securities));
-      #define FUNC_NAME "new_security_page"
-      commodity = SWIG_MustGetPtr(comm_ptr_token,
-                                  SWIG_TypeQuery("_p_gnc_commodity"), 1, 0);
-      #undef FUNC_NAME
+        if (current)
+        {
+            /* The page has already been made. */
+            back_page = GNOME_DRUID_PAGE(current->data);
+            current = current->next;
+        }
+        else
+        {
+            /* Get the GnuCash commodity corresponding to the new QIF security. */
+            comm_ptr_token = scm_call_2(hash_ref,
+                                        wind->security_hash,
+                                        SCM_CAR(securities));
+#define FUNC_NAME "new_security_page"
+            commodity = SWIG_MustGetPtr(comm_ptr_token,
+                                        SWIG_TypeQuery("_p_gnc_commodity"), 1, 0);
+#undef FUNC_NAME
 
-      /* Build a new security page. */
-      new_page = new_security_page(SCM_CAR(securities), commodity);
+            /* Build a new security page. */
+            new_page = new_security_page(SCM_CAR(securities), commodity);
 
-      /* Connect the signals. */
-      g_signal_connect(new_page->page, "prepare",
-                       G_CALLBACK(gnc_ui_qif_import_comm_prepare_cb),
-                       wind);
+            /* Connect the signals. */
+            g_signal_connect(new_page->page, "prepare",
+                             G_CALLBACK(gnc_ui_qif_import_comm_prepare_cb),
+                             wind);
 
-      g_signal_connect(new_page->page, "back",
-                       G_CALLBACK(gnc_ui_qif_import_generic_back_cb),
-                       wind);
+            g_signal_connect(new_page->page, "back",
+                             G_CALLBACK(gnc_ui_qif_import_generic_back_cb),
+                             wind);
 
-      g_signal_connect(new_page->page, "next",
-                       G_CALLBACK(gnc_ui_qif_import_comm_next_cb),
-                       wind);
+            g_signal_connect(new_page->page, "next",
+                             G_CALLBACK(gnc_ui_qif_import_comm_next_cb),
+                             wind);
 
-      /* Add it to the list of security pages. */
-      wind->commodity_pages = g_list_append(wind->commodity_pages,
-                                            new_page->page);
+            /* Add it to the list of security pages. */
+            wind->commodity_pages = g_list_append(wind->commodity_pages,
+                                                  new_page->page);
 
-      /* Add the new page to the druid. */
-      gnome_druid_insert_page(GNOME_DRUID(wind->druid),
-                              back_page,
-                              GNOME_DRUID_PAGE(new_page->page));
+            /* Add the new page to the druid. */
+            gnome_druid_insert_page(GNOME_DRUID(wind->druid),
+                                    back_page,
+                                    GNOME_DRUID_PAGE(new_page->page));
 
-      back_page = GNOME_DRUID_PAGE(new_page->page);
-      gtk_widget_show_all(new_page->page);
+            back_page = GNOME_DRUID_PAGE(new_page->page);
+            gtk_widget_show_all(new_page->page);
+        }
+
+        securities = SCM_CDR(securities);
     }
+    gnc_unset_busy_cursor(NULL);
 
-    securities = SCM_CDR(securities);
-  }
-  gnc_unset_busy_cursor(NULL);
-
-  gnc_druid_set_colors(GNOME_DRUID(wind->druid));
+    gnc_druid_set_colors(GNOME_DRUID(wind->druid));
 }
 
 
@@ -2344,13 +2393,13 @@
                                    gpointer arg1,
                                    gpointer user_data)
 {
-  QIFImportWindow * wind = user_data;
+    QIFImportWindow * wind = user_data;
 
-  /* If there are new securities, prepare the security pages. */
-  if (gnc_ui_qif_import_new_securities(wind))
-    prepare_security_pages(wind);
+    /* If there are new securities, prepare the security pages. */
+    if (gnc_ui_qif_import_new_securities(wind))
+        prepare_security_pages(wind);
 
-  return gnc_ui_qif_import_generic_next_cb(page, arg1, wind);
+    return gnc_ui_qif_import_generic_next_cb(page, arg1, wind);
 }
 
 
@@ -2364,44 +2413,44 @@
 static void
 gnc_ui_qif_import_commodity_update(QIFImportWindow * wind)
 {
-  GList          *pageptr;
-  GnomeDruidPage *gtkpage;
-  QIFDruidPage   *page;
-  const gchar    *mnemonic = NULL;
-  gchar          *namespace = NULL;
-  const gchar    *fullname = NULL;
-  gnc_commodity  *tab_commodity;
+    GList          *pageptr;
+    GnomeDruidPage *gtkpage;
+    QIFDruidPage   *page;
+    const gchar    *mnemonic = NULL;
+    gchar          *namespace = NULL;
+    const gchar    *fullname = NULL;
+    gnc_commodity  *tab_commodity;
 
-  for (pageptr = wind->commodity_pages; pageptr; pageptr=pageptr->next)
-  {
-    gtkpage   = GNOME_DRUID_PAGE(pageptr->data);
-    page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
+    for (pageptr = wind->commodity_pages; pageptr; pageptr = pageptr->next)
+    {
+        gtkpage   = GNOME_DRUID_PAGE(pageptr->data);
+        page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
 
-    /* Get any changes from the commodity page. */
-    mnemonic  = gtk_entry_get_text(GTK_ENTRY(page->mnemonic_entry));
-    namespace = gnc_ui_namespace_picker_ns(page->namespace_combo);
-    fullname  = gtk_entry_get_text(GTK_ENTRY(page->name_entry));
+        /* Get any changes from the commodity page. */
+        mnemonic  = gtk_entry_get_text(GTK_ENTRY(page->mnemonic_entry));
+        namespace = gnc_ui_namespace_picker_ns(page->namespace_combo);
+        fullname  = gtk_entry_get_text(GTK_ENTRY(page->name_entry));
 
-    /* Update the commodity with the new values. */
-    gnc_commodity_set_namespace(page->commodity, namespace);
-    gnc_commodity_set_fullname(page->commodity, fullname);
-    gnc_commodity_set_mnemonic(page->commodity, mnemonic);
+        /* Update the commodity with the new values. */
+        gnc_commodity_set_namespace(page->commodity, namespace);
+        gnc_commodity_set_fullname(page->commodity, fullname);
+        gnc_commodity_set_mnemonic(page->commodity, mnemonic);
 
-    /* Add the commodity to the commodity table (if it isn't a duplicate). */
-    tab_commodity = gnc_commodity_table_lookup(gnc_get_current_commodities(),
-                                               namespace, mnemonic);
-    if (!tab_commodity || tab_commodity == page->commodity)
-      tab_commodity = gnc_commodity_table_insert(gnc_get_current_commodities(),
-                                                 page->commodity);
+        /* Add the commodity to the commodity table (if it isn't a duplicate). */
+        tab_commodity = gnc_commodity_table_lookup(gnc_get_current_commodities(),
+                        namespace, mnemonic);
+        if (!tab_commodity || tab_commodity == page->commodity)
+            tab_commodity = gnc_commodity_table_insert(gnc_get_current_commodities(),
+                            page->commodity);
 
-    /* Update the security hash table. */
-    scm_hash_set_x(wind->security_hash,
-                   page->hash_key,
-                   SWIG_NewPointerObj(tab_commodity,
-                                      SWIG_TypeQuery("_p_gnc_commodity"), 0));
+        /* Update the security hash table. */
+        scm_hash_set_x(wind->security_hash,
+                       page->hash_key,
+                       SWIG_NewPointerObj(tab_commodity,
+                                          SWIG_TypeQuery("_p_gnc_commodity"), 0));
 
-    g_free(namespace);
-  }
+        g_free(namespace);
+    }
 }
 
 
@@ -2414,62 +2463,62 @@
 static void
 gnc_ui_qif_import_prepare_duplicates(QIFImportWindow * wind)
 {
-  GtkTreeView      *view;
-  GtkListStore     *store;
-  SCM               duplicates;
-  SCM               current_xtn;
-  Transaction      *gnc_xtn;
-  Split            *gnc_split;
-  GtkTreeIter       iter;
-  GtkTreeSelection *selection;
-  GtkTreePath      *path;
-  const gchar      *amount_str;
-  int               rownum = 0;
+    GtkTreeView      *view;
+    GtkListStore     *store;
+    SCM               duplicates;
+    SCM               current_xtn;
+    Transaction      *gnc_xtn;
+    Split            *gnc_split;
+    GtkTreeIter       iter;
+    GtkTreeSelection *selection;
+    GtkTreePath      *path;
+    const gchar      *amount_str;
+    int               rownum = 0;
 
-  view = GTK_TREE_VIEW(wind->new_transaction_view);
-  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
-  gtk_list_store_clear(store);
+    view = GTK_TREE_VIEW(wind->new_transaction_view);
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+    gtk_list_store_clear(store);
 
-  if (!scm_is_list(wind->match_transactions))
-    return;
+    if (!scm_is_list(wind->match_transactions))
+        return;
 
-  /* Loop through the list of new, potentially duplicate transactions. */
-  duplicates = wind->match_transactions;
-  while (!scm_is_null(duplicates))
-  {
-    current_xtn = SCM_CAAR(duplicates);
-    #define FUNC_NAME "xaccTransCountSplits"
-    gnc_xtn     = SWIG_MustGetPtr(current_xtn,
-                                  SWIG_TypeQuery("_p_Transaction"), 1, 0);
-    #undef FUNC_NAME
-    if (xaccTransCountSplits(gnc_xtn) > 2)
-      amount_str = _("(split)");
-    else
+    /* Loop through the list of new, potentially duplicate transactions. */
+    duplicates = wind->match_transactions;
+    while (!scm_is_null(duplicates))
     {
-      gnc_split = xaccTransGetSplit(gnc_xtn, 0);
-      amount_str =
-        xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
-                        gnc_account_print_info
-                        (xaccSplitGetAccount(gnc_split), TRUE));
-    }
+        current_xtn = SCM_CAAR(duplicates);
+#define FUNC_NAME "xaccTransCountSplits"
+        gnc_xtn     = SWIG_MustGetPtr(current_xtn,
+                                      SWIG_TypeQuery("_p_Transaction"), 1, 0);
+#undef FUNC_NAME
+        if (xaccTransCountSplits(gnc_xtn) > 2)
+            amount_str = _("(split)");
+        else
+        {
+            gnc_split = xaccTransGetSplit(gnc_xtn, 0);
+            amount_str =
+                xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
+                                gnc_account_print_info
+                                (xaccSplitGetAccount(gnc_split), TRUE));
+        }
 
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set
-      (store, &iter,
-       QIF_TRANS_COL_INDEX, rownum++,
-       QIF_TRANS_COL_DATE,
-       gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
-       QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
-       QIF_TRANS_COL_AMOUNT, amount_str,
-       -1);
+        gtk_list_store_append(store, &iter);
+        gtk_list_store_set
+        (store, &iter,
+         QIF_TRANS_COL_INDEX, rownum++,
+         QIF_TRANS_COL_DATE,
+         gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
+         QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
+         QIF_TRANS_COL_AMOUNT, amount_str,
+         -1);
 
-    duplicates = SCM_CDR(duplicates);
-  }
+        duplicates = SCM_CDR(duplicates);
+    }
 
-  selection = gtk_tree_view_get_selection(view);
-  path = gtk_tree_path_new_from_indices(0, -1);
-  gtk_tree_selection_select_path(selection, path);
-  gtk_tree_path_free(path);
+    selection = gtk_tree_view_get_selection(view);
+    path = gtk_tree_path_new_from_indices(0, -1);
+    gtk_tree_selection_select_path(selection, path);
+    gtk_tree_path_free(path);
 }
 
 
@@ -2483,25 +2532,25 @@
 static void
 gnc_ui_qif_import_convert_undo(QIFImportWindow * wind)
 {
-  SCM undo = scm_c_eval_string("qif-import:qif-to-gnc-undo");
+    SCM undo = scm_c_eval_string("qif-import:qif-to-gnc-undo");
 
-  gnc_set_busy_cursor(NULL, TRUE);
+    gnc_set_busy_cursor(NULL, TRUE);
 
-  /* Undo the conversion. */
-  scm_call_1(undo, wind->imported_account_tree);
+    /* Undo the conversion. */
+    scm_call_1(undo, wind->imported_account_tree);
 
-  /* There's no imported account tree any more. */
-  scm_gc_unprotect_object(wind->imported_account_tree);
-  wind->imported_account_tree = SCM_BOOL_F;
-  scm_gc_protect_object(wind->imported_account_tree);
+    /* There's no imported account tree any more. */
+    scm_gc_unprotect_object(wind->imported_account_tree);
+    wind->imported_account_tree = SCM_BOOL_F;
+    scm_gc_protect_object(wind->imported_account_tree);
 
 
-  /* Get rid of the list of matched transactions. */
-  scm_gc_unprotect_object(wind->match_transactions);
-  wind->match_transactions = SCM_BOOL_F;
-  scm_gc_protect_object(wind->match_transactions);
+    /* Get rid of the list of matched transactions. */
+    scm_gc_unprotect_object(wind->match_transactions);
+    wind->match_transactions = SCM_BOOL_F;
+    scm_gc_protect_object(wind->match_transactions);
 
-  gnc_unset_busy_cursor(NULL);
+    gnc_unset_busy_cursor(NULL);
 }
 
 
@@ -2513,34 +2562,34 @@
 
 static void
 gnc_ui_qif_import_convert_progress_prepare_cb(GnomeDruidPage * page,
-                                              gpointer arg1,
-                                              gpointer user_data)
+        gpointer arg1,
+        gpointer user_data)
 {
-  QIFImportWindow   *wind = user_data;
+    QIFImportWindow   *wind = user_data;
 
-  /* Reset the progress display. */
-  gnc_progress_dialog_set_primary(wind->convert_progress, "");
-  gnc_progress_dialog_set_secondary(wind->convert_progress,
-    _("GnuCash is now importing your QIF data. If there are no errors or warnings, you will automatically proceed to the next step. Otherwise, the details will be shown below for your review."));
-  gnc_progress_dialog_set_sub(wind->convert_progress, " ");
-  gnc_progress_dialog_reset_value(wind->convert_progress);
-  gnc_progress_dialog_reset_log(wind->convert_progress);
+    /* Reset the progress display. */
+    gnc_progress_dialog_set_primary(wind->convert_progress, "");
+    gnc_progress_dialog_set_secondary(wind->convert_progress,
+                                      _("GnuCash is now importing your QIF data. If there are no errors or warnings, you will automatically proceed to the next step. Otherwise, the details will be shown below for your review."));
+    gnc_progress_dialog_set_sub(wind->convert_progress, " ");
+    gnc_progress_dialog_reset_value(wind->convert_progress);
+    gnc_progress_dialog_reset_log(wind->convert_progress);
 
-  /* Disable the "Forward" button for now.
-   *
-   * NOTE: Due to bug 91001 in GnomeDruid, gnome_druid_set_buttons_sensitive()
-   *       will not work in prepare callbacks unless they are run AFTER the
-   *       standard one. Make sure the Glade line has the callback set up with
-   *       after=yes. For example:
-   *         <signal name="prepare" handler="my_prepare_cb" after="yes"/>   */
-  gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                    TRUE, FALSE, TRUE, TRUE);
+    /* Disable the "Forward" button for now.
+     *
+     * NOTE: Due to bug 91001 in GnomeDruid, gnome_druid_set_buttons_sensitive()
+     *       will not work in prepare callbacks unless they are run AFTER the
+     *       standard one. Make sure the Glade line has the callback set up with
+     *       after=yes. For example:
+     *         <signal name="prepare" handler="my_prepare_cb" after="yes"/>   */
+    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+                                      TRUE, FALSE, TRUE, TRUE);
 
-  /* Generate a show signal once the page is displayed. This
-   * will kick off our (potentially) long-running operations. */
-  gtk_widget_hide(GTK_WIDGET(page));
-  gtk_widget_set_sensitive(GTK_WIDGET(page), TRUE);
-  gtk_widget_show(GTK_WIDGET(page));
+    /* Generate a show signal once the page is displayed. This
+     * will kick off our (potentially) long-running operations. */
+    gtk_widget_hide(GTK_WIDGET(page));
+    gtk_widget_set_sensitive(GTK_WIDGET(page), TRUE);
+    gtk_widget_show(GTK_WIDGET(page));
 }
 
 
@@ -2552,186 +2601,186 @@
 
 static void
 gnc_ui_qif_import_convert_progress_show_cb(GtkWidget *widget,
-                                           gpointer user_data)
+        gpointer user_data)
 {
-  QIFImportWindow   *wind = user_data;
-  SCM qif_to_gnc      = scm_c_eval_string("qif-import:qif-to-gnc");
-  SCM find_duplicates = scm_c_eval_string("gnc:account-tree-find-duplicates");
-  SCM retval;
+    QIFImportWindow   *wind = user_data;
+    SCM qif_to_gnc      = scm_c_eval_string("qif-import:qif-to-gnc");
+    SCM find_duplicates = scm_c_eval_string("gnc:account-tree-find-duplicates");
+    SCM retval;
 
-  /* SCM for the progress dialog. */
-  SCM progress = SWIG_NewPointerObj(wind->convert_progress,
-                                    SWIG_TypeQuery("_p__GNCProgressDialog"),
-                                    0);
+    /* SCM for the progress dialog. */
+    SCM progress = SWIG_NewPointerObj(wind->convert_progress,
+                                      SWIG_TypeQuery("_p__GNCProgressDialog"),
+                                      0);
 
-  /* The default currency. */
-  gchar *currname =
-    gtk_combo_box_get_active_text(GTK_COMBO_BOX(wind->currency_picker));
+    /* The default currency. */
+    gchar *currname =
+        gtk_combo_box_get_active_text(GTK_COMBO_BOX(wind->currency_picker));
 
-  /* Raise the busy flag so the druid can't be canceled unexpectedly. */
-  wind->busy = TRUE;
-  gtk_widget_set_sensitive(wind->convert_pause, TRUE);
+    /* Raise the busy flag so the druid can't be canceled unexpectedly. */
+    wind->busy = TRUE;
+    gtk_widget_set_sensitive(wind->convert_pause, TRUE);
 
-  /* Clear any previous pause or cancel state. */
-  scm_c_eval_string("(qif-import:reset-cancel-pause)");
+    /* Clear any previous pause or cancel state. */
+    scm_c_eval_string("(qif-import:reset-cancel-pause)");
 
-  /* Update the commodities. */
-  gnc_ui_qif_import_commodity_update(wind);
+    /* Update the commodities. */
+    gnc_ui_qif_import_commodity_update(wind);
 
 
-  /*
-   * Convert the QIF data into GnuCash data.
-   *
-   * A Scheme function does all the work.  The return value is the
-   * root account of an account tree containing all the new accounts
-   * and transactions. Upon failure, #f is returned. If the user
-   * cancels, #t is returned.
-   */
+    /*
+     * Convert the QIF data into GnuCash data.
+     *
+     * A Scheme function does all the work.  The return value is the
+     * root account of an account tree containing all the new accounts
+     * and transactions. Upon failure, #f is returned. If the user
+     * cancels, #t is returned.
+     */
 
-  /* This step will fill 70% of the bar. */
-  gnc_progress_dialog_push(wind->convert_progress, 0.7);
-  retval = scm_apply(qif_to_gnc,
-                     SCM_LIST7(wind->imported_files,
-                               wind->acct_map_info,
-                               wind->cat_map_info,
-                               wind->memo_map_info,
-                               wind->security_hash,
-                               scm_makfrom0str(currname),
-                               progress),
-                     SCM_EOL);
-  gnc_progress_dialog_pop(wind->convert_progress);
-  g_free(currname);
+    /* This step will fill 70% of the bar. */
+    gnc_progress_dialog_push(wind->convert_progress, 0.7);
+    retval = scm_apply(qif_to_gnc,
+                       SCM_LIST7(wind->imported_files,
+                                 wind->acct_map_info,
+                                 wind->cat_map_info,
+                                 wind->memo_map_info,
+                                 wind->security_hash,
+                                 scm_makfrom0str(currname),
+                                 progress),
+                       SCM_EOL);
+    gnc_progress_dialog_pop(wind->convert_progress);
+    g_free(currname);
 
-  if (retval == SCM_BOOL_T)
-  {
-    /* Canceled by the user. */
+    if (retval == SCM_BOOL_T)
+    {
+        /* Canceled by the user. */
 
-    /* Disable the pause button. */
-    gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
 
-    /* Remove any converted data. */
-    gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
-    gnc_ui_qif_import_convert_undo(wind);
+        /* Remove any converted data. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
+        gnc_ui_qif_import_convert_undo(wind);
 
-    /* Inform the user. */
-    gnc_progress_dialog_set_sub(wind->convert_progress, _("Canceled"));
-    gnc_progress_dialog_reset_value(wind->convert_progress);
+        /* Inform the user. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Canceled"));
+        gnc_progress_dialog_reset_value(wind->convert_progress);
 
-    wind->busy = FALSE;
-    return;
-  }
-  else if (retval == SCM_BOOL_F)
-  {
-    /* An bug was encountered during conversion. */
+        wind->busy = FALSE;
+        return;
+    }
+    else if (retval == SCM_BOOL_F)
+    {
+        /* An bug was encountered during conversion. */
 
-    /* Disable the pause button. */
-    gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
 
-    /* Remove any converted data. */
-    gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
-    gnc_ui_qif_import_convert_undo(wind);
+        /* Remove any converted data. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
+        gnc_ui_qif_import_convert_undo(wind);
 
-    /* Inform the user. */
-    gnc_progress_dialog_append_log(wind->convert_progress,
-                     _( "A bug was detected while converting the QIF data."));
-    gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
-    gnc_progress_dialog_reset_value(wind->convert_progress);
-    gnc_error_dialog(wind->window, "%s",
-                     _( "A bug was detected while converting the QIF data."));
-    /* FIXME: How should we request that the user report this problem? */
+        /* Inform the user. */
+        gnc_progress_dialog_append_log(wind->convert_progress,
+                                       _( "A bug was detected while converting the QIF data."));
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
+        gnc_progress_dialog_reset_value(wind->convert_progress);
+        gnc_error_dialog(wind->window, "%s",
+                         _( "A bug was detected while converting the QIF data."));
+        /* FIXME: How should we request that the user report this problem? */
 
-    wind->busy = FALSE;
-    return;
-  }
-  else if (scm_is_symbol(retval))
-  {
-    /* An error was encountered during conversion. */
+        wind->busy = FALSE;
+        return;
+    }
+    else if (scm_is_symbol(retval))
+    {
+        /* An error was encountered during conversion. */
 
-    /* Disable the pause button. */
-    gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+        /* Disable the pause button. */
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
 
-    /* Remove any converted data. */
-    gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
-    gnc_ui_qif_import_convert_undo(wind);
+        /* Remove any converted data. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
+        gnc_ui_qif_import_convert_undo(wind);
 
-    /* Inform the user. */
-    gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
-    gnc_progress_dialog_reset_value(wind->convert_progress);
+        /* Inform the user. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
+        gnc_progress_dialog_reset_value(wind->convert_progress);
 
-    wind->busy = FALSE;
-    return;
-  }
+        wind->busy = FALSE;
+        return;
+    }
 
 
-  /* Save the imported account tree. */
-  scm_gc_unprotect_object(wind->imported_account_tree);
-  wind->imported_account_tree = retval;
-  scm_gc_protect_object(wind->imported_account_tree);
+    /* Save the imported account tree. */
+    scm_gc_unprotect_object(wind->imported_account_tree);
+    wind->imported_account_tree = retval;
+    scm_gc_protect_object(wind->imported_account_tree);
 
 
-  /*
-   * Detect potentially duplicated transactions.
-   */
+    /*
+     * Detect potentially duplicated transactions.
+     */
 
-  /* This step will fill the remainder of the bar. */
-  gnc_progress_dialog_push(wind->convert_progress, 1);
-  retval = scm_call_3(find_duplicates,
-                      scm_c_eval_string("(gnc-get-current-root-account)"),
-                      wind->imported_account_tree, progress);
-  gnc_progress_dialog_pop(wind->convert_progress);
+    /* This step will fill the remainder of the bar. */
+    gnc_progress_dialog_push(wind->convert_progress, 1);
+    retval = scm_call_3(find_duplicates,
+                        scm_c_eval_string("(gnc-get-current-root-account)"),
+                        wind->imported_account_tree, progress);
+    gnc_progress_dialog_pop(wind->convert_progress);
 
-  /* Save the results. */
-  scm_gc_unprotect_object(wind->match_transactions);
-  wind->match_transactions = retval;
-  scm_gc_protect_object(wind->match_transactions);
+    /* Save the results. */
+    scm_gc_unprotect_object(wind->match_transactions);
+    wind->match_transactions = retval;
+    scm_gc_protect_object(wind->match_transactions);
 
-  if (retval == SCM_BOOL_T)
-  {
-    /* Canceled by the user. */
-    gtk_widget_set_sensitive(wind->convert_pause, FALSE);
-    gnc_progress_dialog_set_sub(wind->convert_progress, _("Canceling"));
-    wind->busy = FALSE;
-    return;
-  }
-  else if (retval == SCM_BOOL_F)
-  {
-    /* An error occurred during duplicate checking. */
+    if (retval == SCM_BOOL_T)
+    {
+        /* Canceled by the user. */
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Canceling"));
+        wind->busy = FALSE;
+        return;
+    }
+    else if (retval == SCM_BOOL_F)
+    {
+        /* An error occurred during duplicate checking. */
 
-    /* Remove any converted data. */
-    gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
-    gnc_ui_qif_import_convert_undo(wind);
+        /* Remove any converted data. */
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Cleaning up"));
+        gnc_ui_qif_import_convert_undo(wind);
 
-    /* Inform the user. */
-    gnc_progress_dialog_append_log(wind->convert_progress,
-                     _( "A bug was detected while detecting duplicates."));
-    gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
-    gnc_progress_dialog_reset_value(wind->convert_progress);
-    gnc_error_dialog(wind->window, "%s",
-                     _( "A bug was detected while detecting duplicates."));
-    /* FIXME: How should we request that the user report this problem? */
+        /* Inform the user. */
+        gnc_progress_dialog_append_log(wind->convert_progress,
+                                       _( "A bug was detected while detecting duplicates."));
+        gnc_progress_dialog_set_sub(wind->convert_progress, _("Failed"));
+        gnc_progress_dialog_reset_value(wind->convert_progress);
+        gnc_error_dialog(wind->window, "%s",
+                         _( "A bug was detected while detecting duplicates."));
+        /* FIXME: How should we request that the user report this problem? */
 
-    gtk_widget_set_sensitive(wind->convert_pause, FALSE);
-    wind->busy = FALSE;
-    return;
-  }
+        gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+        wind->busy = FALSE;
+        return;
+    }
 
 
-  /* The conversion completed successfully. */
-  gnc_progress_dialog_set_sub(wind->convert_progress,
-                              _("Conversion completed"));
-  gnc_progress_dialog_set_value(wind->convert_progress, 1);
+    /* The conversion completed successfully. */
+    gnc_progress_dialog_set_sub(wind->convert_progress,
+                                _("Conversion completed"));
+    gnc_progress_dialog_set_value(wind->convert_progress, 1);
 
-  /* Enable all buttons. */
-  gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
-                                    TRUE, TRUE, TRUE, TRUE);
+    /* Enable all buttons. */
+    gnome_druid_set_buttons_sensitive(GNOME_DRUID(wind->druid),
+                                      TRUE, TRUE, TRUE, TRUE);
 
-  /* If the log is empty, move on to the next page automatically. */
-  if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(wind->convert_log))) == 0)
-    gnome_druid_page_next(GNOME_DRUID_PAGE(widget));
+    /* If the log is empty, move on to the next page automatically. */
+    if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(wind->convert_log))) == 0)
+        gnome_druid_page_next(GNOME_DRUID_PAGE(widget));
 
-  gtk_widget_set_sensitive(wind->convert_pause, FALSE);
-  wind->busy = FALSE;
-  return;
+    gtk_widget_set_sensitive(wind->convert_pause, FALSE);
+    wind->busy = FALSE;
+    return;
 }
 
 
@@ -2743,36 +2792,36 @@
 
 static void
 gnc_ui_qif_import_convert_progress_pause_cb(GtkButton * button,
-                                            gpointer user_data)
+        gpointer user_data)
 {
-  QIFImportWindow *wind = user_data;
-  SCM toggle_pause      = scm_c_eval_string("qif-import:toggle-pause");
-  SCM progress;
+    QIFImportWindow *wind = user_data;
+    SCM toggle_pause      = scm_c_eval_string("qif-import:toggle-pause");
+    SCM progress;
 
-  if (!wind->busy)
-    return;
+    if (!wind->busy)
+        return;
 
-  /* Create SCM for the progress helper. */
-  progress = SWIG_NewPointerObj(wind->convert_progress,
-                                SWIG_TypeQuery("_p__GNCProgressDialog"),
-                                0);
+    /* Create SCM for the progress helper. */
+    progress = SWIG_NewPointerObj(wind->convert_progress,
+                                  SWIG_TypeQuery("_p__GNCProgressDialog"),
+                                  0);
 
-  /* Pause (or resume) the currently running operation. */
-  scm_call_1(toggle_pause, progress);
+    /* Pause (or resume) the currently running operation. */
+    scm_call_1(toggle_pause, progress);
 
-  /* Swap the button label between pause and resume. */
-  if (strcmp(gtk_button_get_label(button), _("_Resume")))
-  {
-    gtk_button_set_use_stock(button, FALSE);
-    gtk_button_set_use_underline(button, TRUE);
-    gtk_button_set_label(button, _("_Resume"));
-  }
-  else
-  {
-    gtk_button_set_use_stock(button, TRUE);
-    gtk_button_set_use_underline(button, FALSE);
-    gtk_button_set_label(button, "gtk-media-pause");
-  }
+    /* Swap the button label between pause and resume. */
+    if (strcmp(gtk_button_get_label(button), _("_Resume")))
+    {
+        gtk_button_set_use_stock(button, FALSE);
+        gtk_button_set_use_underline(button, TRUE);
+        gtk_button_set_label(button, _("_Resume"));
+    }
+    else
+    {
+        gtk_button_set_use_stock(button, TRUE);
+        gtk_button_set_use_underline(button, FALSE);
+        gtk_button_set_label(button, "gtk-media-pause");
+    }
 }
 
 
@@ -2784,24 +2833,24 @@
 
 static gboolean
 gnc_ui_qif_import_convert_progress_next_cb(GnomeDruidPage * page,
-                                           gpointer arg1,
-                                           gpointer user_data)
+        gpointer arg1,
+        gpointer user_data)
 {
-  QIFImportWindow *wind = user_data;
+    QIFImportWindow *wind = user_data;
 
-  if (scm_is_null(wind->match_transactions))
-  {
-    /* No potential duplicates, so skip to the last page. */
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "end_page"));
-    return TRUE;
-  }
+    if (scm_is_null(wind->match_transactions))
+    {
+        /* No potential duplicates, so skip to the last page. */
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             get_named_page(wind, "end_page"));
+        return TRUE;
+    }
 
-  /* Prepare the duplicates page. */
-  gnc_ui_qif_import_prepare_duplicates(wind);
+    /* Prepare the duplicates page. */
+    gnc_ui_qif_import_prepare_duplicates(wind);
 
-  /* Display the next page. */
-  return gnc_ui_qif_import_generic_next_cb(page, arg1, wind);
+    /* Display the next page. */
+    return gnc_ui_qif_import_generic_next_cb(page, arg1, wind);
 }
 
 
@@ -2815,17 +2864,17 @@
 static gboolean
 convert_progress_back_timeout_cb(gpointer data)
 {
-  QIFImportWindow *wind = data;
+    QIFImportWindow *wind = data;
 
-  if (wind->busy)
-    /* Wait for timer to go off again. */
-    return TRUE;
+    if (wind->busy)
+        /* Wait for timer to go off again. */
+        return TRUE;
 
-  /* The busy flag was lowered. Go back to the previous page. */
-  gnome_druid_page_back(get_named_page(wind, "convert_progress_page"));
+    /* The busy flag was lowered. Go back to the previous page. */
+    gnome_druid_page_back(get_named_page(wind, "convert_progress_page"));
 
-  /* Cancel the timer. */
-  return FALSE;
+    /* Cancel the timer. */
+    return FALSE;
 }
 
 
@@ -2837,134 +2886,138 @@
 
 static gboolean
 gnc_ui_qif_import_convert_progress_back_cb(GnomeDruidPage * page,
-                                           gpointer arg1,
-                                           gpointer user_data)
+        gpointer arg1,
+        gpointer user_data)
 {
-  QIFImportWindow *wind = user_data;
+    QIFImportWindow *wind = user_data;
 
-  if (wind->busy)
-  {
-    /* Cancel any long-running Scheme operation. */
-    scm_c_eval_string("(qif-import:cancel)");
+    if (wind->busy)
+    {
+        /* Cancel any long-running Scheme operation. */
+        scm_c_eval_string("(qif-import:cancel)");
 
-    /* Wait for the busy flag to be lowered. */
-    g_timeout_add(200, convert_progress_back_timeout_cb, user_data);
+        /* Wait for the busy flag to be lowered. */
+        g_timeout_add(200, convert_progress_back_timeout_cb, user_data);
 
-    return TRUE;
-  }
+        return TRUE;
+    }
 
-  return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
+    return gnc_ui_qif_import_generic_back_cb(page, arg1, user_data);
 }
 
 
 static void
 refresh_old_transactions(QIFImportWindow * wind, int selection)
 {
-  SCM          possible_matches;
-  SCM          current_xtn;
-  SCM          selected;
-  Transaction  * gnc_xtn;
-  Split        * gnc_split;
-  const gchar  * amount_str;
-  int          rownum = 0;
-  GtkTreeView *view;
-  GtkListStore *store;
-  GtkTreeIter iter;
+    SCM          possible_matches;
+    SCM          current_xtn;
+    SCM          selected;
+    Transaction  * gnc_xtn;
+    Split        * gnc_split;
+    const gchar  * amount_str;
+    int          rownum = 0;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkTreeIter iter;
 
-  view = GTK_TREE_VIEW(wind->old_transaction_view);
-  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
-  gtk_list_store_clear(store);
+    view = GTK_TREE_VIEW(wind->old_transaction_view);
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+    gtk_list_store_clear(store);
 
-  if (wind->match_transactions != SCM_BOOL_F) {
-    possible_matches = SCM_CDR(scm_list_ref(wind->match_transactions,
-                                  scm_int2num(wind->selected_transaction)));
-    scm_call_2(scm_c_eval_string("qif-import:refresh-match-selection"),
-               possible_matches, scm_int2num(selection));
+    if (wind->match_transactions != SCM_BOOL_F)
+    {
+        possible_matches = SCM_CDR(scm_list_ref(wind->match_transactions,
+                                                scm_int2num(wind->selected_transaction)));
+        scm_call_2(scm_c_eval_string("qif-import:refresh-match-selection"),
+                   possible_matches, scm_int2num(selection));
 
-    while(!scm_is_null(possible_matches)) {
-      current_xtn = SCM_CAR(possible_matches);
-      #define FUNC_NAME "xaccTransCountSplits"
-      gnc_xtn     = SWIG_MustGetPtr(SCM_CAR(current_xtn),
-                                    SWIG_TypeQuery("_p_Transaction"), 1, 0);
-      #undef FUNC_NAME
-      selected    = SCM_CDR(current_xtn);
+        while (!scm_is_null(possible_matches))
+        {
+            current_xtn = SCM_CAR(possible_matches);
+#define FUNC_NAME "xaccTransCountSplits"
+            gnc_xtn     = SWIG_MustGetPtr(SCM_CAR(current_xtn),
+                                          SWIG_TypeQuery("_p_Transaction"), 1, 0);
+#undef FUNC_NAME
+            selected    = SCM_CDR(current_xtn);
 
-      if (xaccTransCountSplits(gnc_xtn) > 2) {
-        amount_str = _("(split)");
-      }
-      else {
-        gnc_split = xaccTransGetSplit(gnc_xtn, 0);
-        amount_str =
-          xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
-                          gnc_account_print_info
-                          (xaccSplitGetAccount(gnc_split), TRUE));
-      }
+            if (xaccTransCountSplits(gnc_xtn) > 2)
+            {
+                amount_str = _("(split)");
+            }
+            else
+            {
+                gnc_split = xaccTransGetSplit(gnc_xtn, 0);
+                amount_str =
+                    xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
+                                    gnc_account_print_info
+                                    (xaccSplitGetAccount(gnc_split), TRUE));
+            }
 
-      gtk_list_store_append(store, &iter);
-      gtk_list_store_set
-        (store, &iter,
-         QIF_TRANS_COL_INDEX, rownum++,
-         QIF_TRANS_COL_DATE, gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
-         QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
-         QIF_TRANS_COL_AMOUNT, amount_str,
-         QIF_TRANS_COL_CHECKED, selected != SCM_BOOL_F,
-         -1);
+            gtk_list_store_append(store, &iter);
+            gtk_list_store_set
+            (store, &iter,
+             QIF_TRANS_COL_INDEX, rownum++,
+             QIF_TRANS_COL_DATE, gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
+             QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
+             QIF_TRANS_COL_AMOUNT, amount_str,
+             QIF_TRANS_COL_CHECKED, selected != SCM_BOOL_F,
+             -1);
 
-      possible_matches = SCM_CDR(possible_matches);
+            possible_matches = SCM_CDR(possible_matches);
+        }
     }
-  }
 }
 
 static void
 gnc_ui_qif_import_duplicate_new_select_cb(GtkTreeSelection *selection,
-                                          QIFImportWindow  *wind)
+        QIFImportWindow  *wind)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  if (gtk_tree_selection_get_selected(selection, &model, &iter))
-    gtk_tree_model_get(model, &iter,
-                       QIF_TRANS_COL_INDEX, &wind->selected_transaction,
-                       -1);
-  refresh_old_transactions(wind, -1);
+    if (gtk_tree_selection_get_selected(selection, &model, &iter))
+        gtk_tree_model_get(model, &iter,
+                           QIF_TRANS_COL_INDEX, &wind->selected_transaction,
+                           -1);
+    refresh_old_transactions(wind, -1);
 }
 
 static gboolean
 reset_ignore_old_select(gboolean *ignore)
 {
-  *ignore = FALSE;
-  return FALSE;
+    *ignore = FALSE;
+    return FALSE;
 }
 
 static void
 gnc_ui_qif_import_duplicate_old_select_cb(GtkTreeSelection *selection,
-                                          QIFImportWindow  *wind)
+        QIFImportWindow  *wind)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  gint row;
-  static gboolean ignore_old_select = FALSE;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    gint row;
+    static gboolean ignore_old_select = FALSE;
 
-  /* Get the current selection then clear it.  We're about to clear
-   * the entire list store and rebuild it so this prevents errors. */
-  if (!gtk_tree_selection_get_selected(selection, &model, &iter))
-    return;
-  gtk_tree_selection_unselect_all(selection);
+    /* Get the current selection then clear it.  We're about to clear
+     * the entire list store and rebuild it so this prevents errors. */
+    if (!gtk_tree_selection_get_selected(selection, &model, &iter))
+        return;
+    gtk_tree_selection_unselect_all(selection);
 
-  /* Getting a weird double call the first time a line is clicked.
-   * Once via gtk_tree_view_button_press and then again via
-   * gtk_tree_view_grab_focus. */
-  if (ignore_old_select)
-    return;
-  ignore_old_select = TRUE;
-  g_idle_add((GSourceFunc)reset_ignore_old_select, &ignore_old_select);
+    /* Getting a weird double call the first time a line is clicked.
+     * Once via gtk_tree_view_button_press and then again via
+     * gtk_tree_view_grab_focus. */
+    if (ignore_old_select)
+        return;
+    ignore_old_select = TRUE;
+    g_idle_add((GSourceFunc)reset_ignore_old_select, &ignore_old_select);
 
-  /* Get the row the user clicked on and update the scheme
-   * code/rebuild the list store.  */
-  gtk_tree_model_get(model, &iter,
-                     QIF_TRANS_COL_INDEX, &row,
-                     -1);
-  refresh_old_transactions(wind, row);
+    /* Get the row the user clicked on and update the scheme
+     * code/rebuild the list store.  */
+    gtk_tree_model_get(model, &iter,
+                       QIF_TRANS_COL_INDEX, &row,
+                       -1);
+    refresh_old_transactions(wind, row);
 }
 
 
@@ -2979,10 +3032,10 @@
 static void
 gnc_ui_qif_import_check_acct_tree(GncPluginPage *page, gpointer user_data)
 {
-  gboolean *found = user_data;
+    gboolean *found = user_data;
 
-  if (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page) && found)
-    *found = TRUE;
+    if (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page) && found)
+        *found = TRUE;
 }
 
 
@@ -2997,49 +3050,49 @@
                             gpointer arg1,
                             gpointer user_data)
 {
-  SCM save_map_prefs = scm_c_eval_string("qif-import:save-map-prefs");
-  SCM cat_and_merge = scm_c_eval_string("gnc:account-tree-catenate-and-merge");
-  SCM prune_xtns = scm_c_eval_string("gnc:prune-matching-transactions");
-  SCM scm_result;
+    SCM save_map_prefs = scm_c_eval_string("qif-import:save-map-prefs");
+    SCM cat_and_merge = scm_c_eval_string("gnc:account-tree-catenate-and-merge");
+    SCM prune_xtns = scm_c_eval_string("gnc:prune-matching-transactions");
+    SCM scm_result;
 
-  QIFImportWindow * wind = user_data;
-  GncPluginPage *page;
-  gboolean acct_tree_found = FALSE;
+    QIFImportWindow * wind = user_data;
+    GncPluginPage *page;
+    gboolean acct_tree_found = FALSE;
 
-  gnc_suspend_gui_refresh();
+    gnc_suspend_gui_refresh();
 
-  /* Prune any imported transactions that were determined to be duplicates. */
-  if (wind->match_transactions != SCM_BOOL_F)
-    scm_call_1(prune_xtns, wind->match_transactions);
+    /* Prune any imported transactions that were determined to be duplicates. */
+    if (wind->match_transactions != SCM_BOOL_F)
+        scm_call_1(prune_xtns, wind->match_transactions);
 
-  /* Merge the imported account tree with the existing one. */
-  if (wind->imported_account_tree != SCM_BOOL_F)
-    scm_call_2(cat_and_merge,
-               scm_c_eval_string("(gnc-get-current-root-account)"),
-               wind->imported_account_tree);
+    /* Merge the imported account tree with the existing one. */
+    if (wind->imported_account_tree != SCM_BOOL_F)
+        scm_call_2(cat_and_merge,
+                   scm_c_eval_string("(gnc-get-current-root-account)"),
+                   wind->imported_account_tree);
 
-  gnc_resume_gui_refresh();
+    gnc_resume_gui_refresh();
 
-  /* Save the user's mapping preferences. */
-  scm_result = scm_apply(save_map_prefs,
-                         SCM_LIST5(wind->acct_map_info, wind->cat_map_info,
-                                   wind->memo_map_info, wind->security_hash,
-                                   wind->security_prefs),
-                         SCM_EOL);
-  if (scm_result == SCM_BOOL_F)
-    gnc_warning_dialog(wind->window, "%s",
-            _("GnuCash was unable to save your mapping preferences."));
+    /* Save the user's mapping preferences. */
+    scm_result = scm_apply(save_map_prefs,
+                           SCM_LIST5(wind->acct_map_info, wind->cat_map_info,
+                                     wind->memo_map_info, wind->security_hash,
+                                     wind->security_prefs),
+                           SCM_EOL);
+    if (scm_result == SCM_BOOL_F)
+        gnc_warning_dialog(wind->window, "%s",
+                           _("GnuCash was unable to save your mapping preferences."));
 
-  /* Open an account tab in the main window if one doesn't exist already. */
-  gnc_main_window_foreach_page(gnc_ui_qif_import_check_acct_tree,
-                               &acct_tree_found);
-  if (!acct_tree_found)
-  {
-    page = gnc_plugin_page_account_tree_new();
-    gnc_main_window_open_page(NULL, page);
-  }
+    /* Open an account tab in the main window if one doesn't exist already. */
+    gnc_main_window_foreach_page(gnc_ui_qif_import_check_acct_tree,
+                                 &acct_tree_found);
+    if (!acct_tree_found)
+    {
+        page = gnc_plugin_page_account_tree_new();
+        gnc_main_window_open_page(NULL, page);
+    }
 
-  gnc_ui_qif_import_druid_destroy(wind);
+    gnc_ui_qif_import_druid_destroy(wind);
 }
 
 
@@ -3052,40 +3105,40 @@
 static void
 do_cancel(QIFImportWindow * wind)
 {
-  GList               *pageptr;
-  GnomeDruidPage      *gtkpage;
-  QIFDruidPage        *page;
-  gnc_commodity_table *table;
+    GList               *pageptr;
+    GnomeDruidPage      *gtkpage;
+    QIFDruidPage        *page;
+    gnc_commodity_table *table;
 
-  gnc_set_busy_cursor(NULL, TRUE);
+    gnc_set_busy_cursor(NULL, TRUE);
 
-  /* Remove any converted data. */
-  gnc_ui_qif_import_convert_undo(wind);
+    /* Remove any converted data. */
+    gnc_ui_qif_import_convert_undo(wind);
 
-  /* Remove any commodities created for druid pages. */
-  for (pageptr = wind->commodity_pages; pageptr; pageptr=pageptr->next)
-  {
-    gtkpage   = GNOME_DRUID_PAGE(pageptr->data);
-    page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
-    gnc_commodity_destroy(page->commodity);
-  }
+    /* Remove any commodities created for druid pages. */
+    for (pageptr = wind->commodity_pages; pageptr; pageptr = pageptr->next)
+    {
+        gtkpage   = GNOME_DRUID_PAGE(pageptr->data);
+        page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
+        gnc_commodity_destroy(page->commodity);
+    }
 
-  /* Remove any namespaces created by the user. */
-  table = gnc_get_current_commodities();
-  while (wind->new_namespaces)
-  {
-    gnc_commodity_table_delete_namespace(table, (gchar *) wind->new_namespaces->data);
+    /* Remove any namespaces created by the user. */
+    table = gnc_get_current_commodities();
+    while (wind->new_namespaces)
+    {
+        gnc_commodity_table_delete_namespace(table, (gchar *) wind->new_namespaces->data);
 
-    /* Free the data and the list element. */
-    g_free(wind->new_namespaces->data);
-    wind->new_namespaces = g_list_delete_link(wind->new_namespaces,
-                                              wind->new_namespaces);
-  }
+        /* Free the data and the list element. */
+        g_free(wind->new_namespaces->data);
+        wind->new_namespaces = g_list_delete_link(wind->new_namespaces,
+                               wind->new_namespaces);
+    }
 
-  gnc_unset_busy_cursor(NULL);
+    gnc_unset_busy_cursor(NULL);
 
-  /* Destroy the druid. */
-  gnc_ui_qif_import_druid_destroy(wind);
+    /* Destroy the druid. */
+    gnc_ui_qif_import_druid_destroy(wind);
 }
 
 
@@ -3099,17 +3152,17 @@
 static gboolean
 cancel_timeout_cb(gpointer data)
 {
-  QIFImportWindow *wind = data;
+    QIFImportWindow *wind = data;
 
-  if (wind->busy)
-    /* Wait for timer to go off again. */
-    return TRUE;
+    if (wind->busy)
+        /* Wait for timer to go off again. */
+        return TRUE;
 
-  /* The busy flag was lowered. Perform the cancel. */
-  do_cancel(wind);
+    /* The busy flag was lowered. Perform the cancel. */
+    do_cancel(wind);
 
-  /* Cancel the timer. */
-  return FALSE;
+    /* Cancel the timer. */
+    return FALSE;
 }
 
 
@@ -3122,27 +3175,27 @@
 static void
 gnc_ui_qif_import_cancel_cb(GnomeDruid * druid, gpointer user_data)
 {
-  QIFImportWindow     *wind = user_data;
+    QIFImportWindow     *wind = user_data;
 
-  if (wind->busy)
-  {
-    /* Cancel any long-running Scheme operation. */
-    scm_c_eval_string("(qif-import:cancel)");
+    if (wind->busy)
+    {
+        /* Cancel any long-running Scheme operation. */
+        scm_c_eval_string("(qif-import:cancel)");
 
-    /* Wait for the busy flag to be lowered. */
-    g_timeout_add(200, cancel_timeout_cb, user_data);
-  }
-  else
-    do_cancel(wind);
+        /* Wait for the busy flag to be lowered. */
+        g_timeout_add(200, cancel_timeout_cb, user_data);
+    }
+    else
+        do_cancel(wind);
 }
 
 
 SCM
 gnc_ui_qif_import_druid_get_mappings(QIFImportWindow * w)
 {
-  return SCM_LIST3(w->acct_map_info,
-                   w->cat_map_info,
-                   w->memo_map_info);
+    return SCM_LIST3(w->acct_map_info,
+                     w->cat_map_info,
+                     w->memo_map_info);
 }
 
 
@@ -3163,23 +3216,24 @@
 static void
 get_preferences(QIFImportWindow *wind)
 {
-  GError * err = NULL;
+    GError * err = NULL;
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  /* Get the user's preference for showing documentation pages. */
-  wind->show_doc_pages =
-    gnc_gconf_get_bool(GCONF_SECTION, GCONF_NAME_SHOW_DOC, &err);
-  if (err != NULL) {
-    g_warning("QIF import: gnc_gconf_get_bool error: %s", err->message);
-    g_error_free(err);
+    /* Get the user's preference for showing documentation pages. */
+    wind->show_doc_pages =
+        gnc_gconf_get_bool(GCONF_SECTION, GCONF_NAME_SHOW_DOC, &err);
+    if (err != NULL)
+    {
+        g_warning("QIF import: gnc_gconf_get_bool error: %s", err->message);
+        g_error_free(err);
 
-    /* Show documentation pages by default. */
-    g_warning("QIF import: Couldn't get %s setting from gconf.",
-              GCONF_NAME_SHOW_DOC);
-    g_warning("QIF import: Documentation pages will be shown by default.");
-    wind->show_doc_pages = TRUE;
-  }
+        /* Show documentation pages by default. */
+        g_warning("QIF import: Couldn't get %s setting from gconf.",
+                  GCONF_NAME_SHOW_DOC);
+        g_warning("QIF import: Documentation pages will be shown by default.");
+        wind->show_doc_pages = TRUE;
+    }
 }
 
 
@@ -3192,60 +3246,60 @@
 static void
 initialize_scheme(QIFImportWindow *wind)
 {
-  SCM  load_map_prefs;
-  SCM  mapping_info;
-  SCM  create_ticker_map;
+    SCM  load_map_prefs;
+    SCM  mapping_info;
+    SCM  create_ticker_map;
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  /* Initialize Scheme variables. */
-  wind->imported_files        = SCM_EOL;
-  wind->selected_file         = SCM_BOOL_F;
-  wind->gnc_acct_info         = SCM_BOOL_F;
-  wind->cat_display_info      = SCM_BOOL_F;
-  wind->cat_map_info          = SCM_BOOL_F;
-  wind->acct_display_info     = SCM_BOOL_F;
-  wind->acct_map_info         = SCM_BOOL_F;
-  wind->memo_display_info     = SCM_BOOL_F;
-  wind->memo_map_info         = SCM_BOOL_F;
-  wind->security_hash         = SCM_BOOL_F;
-  wind->security_prefs        = SCM_BOOL_F;
-  wind->new_securities        = SCM_BOOL_F;
-  wind->ticker_map            = SCM_BOOL_F;
-  wind->imported_account_tree = SCM_BOOL_F;
-  wind->match_transactions    = SCM_BOOL_F;
+    /* Initialize Scheme variables. */
+    wind->imported_files        = SCM_EOL;
+    wind->selected_file         = SCM_BOOL_F;
+    wind->gnc_acct_info         = SCM_BOOL_F;
+    wind->cat_display_info      = SCM_BOOL_F;
+    wind->cat_map_info          = SCM_BOOL_F;
+    wind->acct_display_info     = SCM_BOOL_F;
+    wind->acct_map_info         = SCM_BOOL_F;
+    wind->memo_display_info     = SCM_BOOL_F;
+    wind->memo_map_info         = SCM_BOOL_F;
+    wind->security_hash         = SCM_BOOL_F;
+    wind->security_prefs        = SCM_BOOL_F;
+    wind->new_securities        = SCM_BOOL_F;
+    wind->ticker_map            = SCM_BOOL_F;
+    wind->imported_account_tree = SCM_BOOL_F;
+    wind->match_transactions    = SCM_BOOL_F;
 
-  /* Get the saved state of mappings from Quicken accounts and
-   * categories to GnuCash accounts. */
-  load_map_prefs = scm_c_eval_string("qif-import:load-map-prefs");
-  mapping_info = scm_call_0(load_map_prefs);
-  wind->gnc_acct_info         = scm_list_ref(mapping_info, scm_int2num(0));
-  wind->acct_map_info         = scm_list_ref(mapping_info, scm_int2num(1));
-  wind->cat_map_info          = scm_list_ref(mapping_info, scm_int2num(2));
-  wind->memo_map_info         = scm_list_ref(mapping_info, scm_int2num(3));
-  wind->security_hash         = scm_list_ref(mapping_info, scm_int2num(4));
-  wind->security_prefs        = scm_list_ref(mapping_info, scm_int2num(5));
+    /* Get the saved state of mappings from Quicken accounts and
+     * categories to GnuCash accounts. */
+    load_map_prefs = scm_c_eval_string("qif-import:load-map-prefs");
+    mapping_info = scm_call_0(load_map_prefs);
+    wind->gnc_acct_info         = scm_list_ref(mapping_info, scm_int2num(0));
+    wind->acct_map_info         = scm_list_ref(mapping_info, scm_int2num(1));
+    wind->cat_map_info          = scm_list_ref(mapping_info, scm_int2num(2));
+    wind->memo_map_info         = scm_list_ref(mapping_info, scm_int2num(3));
+    wind->security_hash         = scm_list_ref(mapping_info, scm_int2num(4));
+    wind->security_prefs        = scm_list_ref(mapping_info, scm_int2num(5));
 
-  /* Get the initial ticker map. */
-  create_ticker_map = scm_c_eval_string("make-ticker-map");
-  wind->ticker_map            = scm_call_0(create_ticker_map);
+    /* Get the initial ticker map. */
+    create_ticker_map = scm_c_eval_string("make-ticker-map");
+    wind->ticker_map            = scm_call_0(create_ticker_map);
 
-  /* Protect our data from garbage collection. */
-  scm_gc_protect_object(wind->imported_files);
-  scm_gc_protect_object(wind->selected_file);
-  scm_gc_protect_object(wind->gnc_acct_info);
-  scm_gc_protect_object(wind->cat_display_info);
-  scm_gc_protect_object(wind->cat_map_info);
-  scm_gc_protect_object(wind->memo_display_info);
-  scm_gc_protect_object(wind->memo_map_info);
-  scm_gc_protect_object(wind->acct_display_info);
-  scm_gc_protect_object(wind->acct_map_info);
-  scm_gc_protect_object(wind->security_hash);
-  scm_gc_protect_object(wind->security_prefs);
-  scm_gc_protect_object(wind->new_securities);
-  scm_gc_protect_object(wind->ticker_map);
-  scm_gc_protect_object(wind->imported_account_tree);
-  scm_gc_protect_object(wind->match_transactions);
+    /* Protect our data from garbage collection. */
+    scm_gc_protect_object(wind->imported_files);
+    scm_gc_protect_object(wind->selected_file);
+    scm_gc_protect_object(wind->gnc_acct_info);
+    scm_gc_protect_object(wind->cat_display_info);
+    scm_gc_protect_object(wind->cat_map_info);
+    scm_gc_protect_object(wind->memo_display_info);
+    scm_gc_protect_object(wind->memo_map_info);
+    scm_gc_protect_object(wind->acct_display_info);
+    scm_gc_protect_object(wind->acct_map_info);
+    scm_gc_protect_object(wind->security_hash);
+    scm_gc_protect_object(wind->security_prefs);
+    scm_gc_protect_object(wind->new_securities);
+    scm_gc_protect_object(wind->ticker_map);
+    scm_gc_protect_object(wind->imported_account_tree);
+    scm_gc_protect_object(wind->match_transactions);
 }
 
 
@@ -3258,54 +3312,60 @@
 static void
 build_page_lists(QIFImportWindow *wind, GladeXML *xml)
 {
-  int  i;
+    int  i;
 
-  /* Pages that may appear prior to security-related pages. */
-  char * pre_page_names[NUM_PRE_PAGES] = {
-    "start_page", "load_file_page", "load_progress_page",
-    "date_format_page", "account_name_page",
-    "loaded_files_page", "account_doc_page", "account_match_page",
-    "category_doc_page", "category_match_page", "memo_doc_page",
-    "memo_match_page", "currency_page", "commodity_doc_page"
-  };
+    /* Pages that may appear prior to security-related pages. */
+    char * pre_page_names[NUM_PRE_PAGES] =
+    {
+        "start_page", "load_file_page", "load_progress_page",
+        "date_format_page", "account_name_page",
+        "loaded_files_page", "account_doc_page", "account_match_page",
+        "category_doc_page", "category_match_page", "memo_doc_page",
+        "memo_match_page", "currency_page", "commodity_doc_page"
+    };
 
-  /* Pages that may appear after security-related pages. */
-  char * post_page_names[NUM_POST_PAGES] = {
-    "convert_progress_page", "match_doc_page", "match_duplicates_page",
-    "end_page"
-  };
+    /* Pages that may appear after security-related pages. */
+    char * post_page_names[NUM_POST_PAGES] =
+    {
+        "convert_progress_page", "match_doc_page", "match_duplicates_page",
+        "end_page"
+    };
 
-  /* Optional pages that only show documention. */
-  char * doc_page_names[NUM_DOC_PAGES] = {
-    "start_page", "account_doc_page", "category_doc_page",
-    "commodity_doc_page", "memo_doc_page", "match_doc_page"
-  };
+    /* Optional pages that only show documention. */
+    char * doc_page_names[NUM_DOC_PAGES] =
+    {
+        "start_page", "account_doc_page", "category_doc_page",
+        "commodity_doc_page", "memo_doc_page", "match_doc_page"
+    };
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  wind->pre_comm_pages   = NULL;
-  wind->post_comm_pages  = NULL;
-  wind->doc_pages        = NULL;
-  wind->commodity_pages = NULL;
+    wind->pre_comm_pages   = NULL;
+    wind->post_comm_pages  = NULL;
+    wind->doc_pages        = NULL;
+    wind->commodity_pages = NULL;
 
-  g_return_if_fail(xml);
+    g_return_if_fail(xml);
 
-  /* Build the page lists. */
-  for(i = 0; i < NUM_PRE_PAGES; i++) {
-    wind->pre_comm_pages =
-      g_list_append(wind->pre_comm_pages,
-                    glade_xml_get_widget(xml, pre_page_names[i]));
-  }
-  for(i = 0; i < NUM_POST_PAGES; i++) {
-    wind->post_comm_pages =
-      g_list_append(wind->post_comm_pages,
-                    glade_xml_get_widget(xml, post_page_names[i]));
-  }
-  for(i = 0; i < NUM_DOC_PAGES; i++) {
-    wind->doc_pages =
-      g_list_append(wind->doc_pages,
-                    glade_xml_get_widget(xml, doc_page_names[i]));
-  }
+    /* Build the page lists. */
+    for (i = 0; i < NUM_PRE_PAGES; i++)
+    {
+        wind->pre_comm_pages =
+            g_list_append(wind->pre_comm_pages,
+                          glade_xml_get_widget(xml, pre_page_names[i]));
+    }
+    for (i = 0; i < NUM_POST_PAGES; i++)
+    {
+        wind->post_comm_pages =
+            g_list_append(wind->post_comm_pages,
+                          glade_xml_get_widget(xml, post_page_names[i]));
+    }
+    for (i = 0; i < NUM_DOC_PAGES; i++)
+    {
+        wind->doc_pages =
+            g_list_append(wind->doc_pages,
+                          glade_xml_get_widget(xml, doc_page_names[i]));
+    }
 }
 
 
@@ -3318,45 +3378,45 @@
 static void
 get_glade_widgets(QIFImportWindow *wind, GladeXML *xml)
 {
-  g_return_if_fail(wind);
-  g_return_if_fail(xml);
+    g_return_if_fail(wind);
+    g_return_if_fail(xml);
 
-  wind->window            = glade_xml_get_widget(xml, "QIF Import Druid");
-  wind->druid             = glade_xml_get_widget(xml, "qif_import_druid");
-  wind->filename_entry    = glade_xml_get_widget(xml, "qif_filename_entry");
-  wind->load_pause        = glade_xml_get_widget(xml, "load_progress_pause");
-  wind->load_log          = glade_xml_get_widget(xml, "load_progress_log");
-  wind->load_progress     = gnc_progress_dialog_custom(
-    GTK_LABEL(glade_xml_get_widget(xml, "load_progress_primary")),
-    GTK_LABEL(glade_xml_get_widget(xml, "load_progress_secondary")),
-    GTK_PROGRESS_BAR(glade_xml_get_widget(xml, "load_progress_bar")),
-    GTK_LABEL(glade_xml_get_widget(xml, "load_progress_sub")),
-    GTK_TEXT_VIEW(wind->load_log));
-  wind->acct_entry        = glade_xml_get_widget(xml, "qif_account_entry");
-  wind->date_format_combo = glade_xml_get_widget(xml, "date_format_combobox");
-  wind->selected_file_view = glade_xml_get_widget(xml, "selected_file_view");
-  wind->currency_picker   = glade_xml_get_widget(xml, "currency_comboboxentry");
-  wind->acct_view         = glade_xml_get_widget(xml, "account_page_view");
-  wind->acct_view_count   = glade_xml_get_widget(xml, "account_page_count");
-  wind->acct_view_btn     = glade_xml_get_widget(xml, "account_page_change");
-  wind->cat_view          = glade_xml_get_widget(xml, "category_page_view");
-  wind->cat_view_count    = glade_xml_get_widget(xml, "category_page_count");
-  wind->cat_view_btn      = glade_xml_get_widget(xml, "category_page_change");
-  wind->memo_view         = glade_xml_get_widget(xml, "memo_page_view");
-  wind->memo_view_count   = glade_xml_get_widget(xml, "memo_page_count");
-  wind->memo_view_btn     = glade_xml_get_widget(xml, "memo_page_change");
-  wind->convert_pause     = glade_xml_get_widget(xml, "convert_progress_pause");
-  wind->convert_log       = glade_xml_get_widget(xml, "convert_progress_log");
-  wind->convert_progress  = gnc_progress_dialog_custom(
-    GTK_LABEL(glade_xml_get_widget(xml, "convert_progress_primary")),
-    GTK_LABEL(glade_xml_get_widget(xml, "convert_progress_secondary")),
-    GTK_PROGRESS_BAR(glade_xml_get_widget(xml, "convert_progress_bar")),
-    GTK_LABEL(glade_xml_get_widget(xml, "convert_progress_sub")),
-    GTK_TEXT_VIEW(wind->convert_log));
-  wind->new_transaction_view =
-    glade_xml_get_widget(xml, "new_transaction_view");
-  wind->old_transaction_view =
-    glade_xml_get_widget(xml, "old_transaction_view");
+    wind->window            = glade_xml_get_widget(xml, "QIF Import Druid");
+    wind->druid             = glade_xml_get_widget(xml, "qif_import_druid");
+    wind->filename_entry    = glade_xml_get_widget(xml, "qif_filename_entry");
+    wind->load_pause        = glade_xml_get_widget(xml, "load_progress_pause");
+    wind->load_log          = glade_xml_get_widget(xml, "load_progress_log");
+    wind->load_progress     = gnc_progress_dialog_custom(
+                                  GTK_LABEL(glade_xml_get_widget(xml, "load_progress_primary")),
+                                  GTK_LABEL(glade_xml_get_widget(xml, "load_progress_secondary")),
+                                  GTK_PROGRESS_BAR(glade_xml_get_widget(xml, "load_progress_bar")),
+                                  GTK_LABEL(glade_xml_get_widget(xml, "load_progress_sub")),
+                                  GTK_TEXT_VIEW(wind->load_log));
+    wind->acct_entry        = glade_xml_get_widget(xml, "qif_account_entry");
+    wind->date_format_combo = glade_xml_get_widget(xml, "date_format_combobox");
+    wind->selected_file_view = glade_xml_get_widget(xml, "selected_file_view");
+    wind->currency_picker   = glade_xml_get_widget(xml, "currency_comboboxentry");
+    wind->acct_view         = glade_xml_get_widget(xml, "account_page_view");
+    wind->acct_view_count   = glade_xml_get_widget(xml, "account_page_count");
+    wind->acct_view_btn     = glade_xml_get_widget(xml, "account_page_change");
+    wind->cat_view          = glade_xml_get_widget(xml, "category_page_view");
+    wind->cat_view_count    = glade_xml_get_widget(xml, "category_page_count");
+    wind->cat_view_btn      = glade_xml_get_widget(xml, "category_page_change");
+    wind->memo_view         = glade_xml_get_widget(xml, "memo_page_view");
+    wind->memo_view_count   = glade_xml_get_widget(xml, "memo_page_count");
+    wind->memo_view_btn     = glade_xml_get_widget(xml, "memo_page_change");
+    wind->convert_pause     = glade_xml_get_widget(xml, "convert_progress_pause");
+    wind->convert_log       = glade_xml_get_widget(xml, "convert_progress_log");
+    wind->convert_progress  = gnc_progress_dialog_custom(
+                                  GTK_LABEL(glade_xml_get_widget(xml, "convert_progress_primary")),
+                                  GTK_LABEL(glade_xml_get_widget(xml, "convert_progress_secondary")),
+                                  GTK_PROGRESS_BAR(glade_xml_get_widget(xml, "convert_progress_bar")),
+                                  GTK_LABEL(glade_xml_get_widget(xml, "convert_progress_sub")),
+                                  GTK_TEXT_VIEW(wind->convert_log));
+    wind->new_transaction_view =
+        glade_xml_get_widget(xml, "new_transaction_view");
+    wind->old_transaction_view =
+        glade_xml_get_widget(xml, "old_transaction_view");
 }
 
 
@@ -3369,141 +3429,141 @@
 static void
 connect_glade_signals(QIFImportWindow *wind, GladeXML *xml)
 {
-  g_return_if_fail(wind);
-  g_return_if_fail(xml);
+    g_return_if_fail(wind);
+    g_return_if_fail(xml);
 
-  /*
-   * Connect all glade-defined signals to their handlers.
-   */
-  glade_xml_signal_connect_data
+    /*
+     * Connect all glade-defined signals to their handlers.
+     */
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_cancel_cb",
      G_CALLBACK(gnc_ui_qif_import_cancel_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_generic_next_cb",
      G_CALLBACK(gnc_ui_qif_import_generic_next_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_generic_back_cb",
      G_CALLBACK(gnc_ui_qif_import_generic_back_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_select_file_cb",
      G_CALLBACK(gnc_ui_qif_import_select_file_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_load_file_back_cb",
      G_CALLBACK(gnc_ui_qif_import_load_file_back_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_load_file_next_cb",
      G_CALLBACK(gnc_ui_qif_import_load_file_next_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_load_progress_prepare_cb",
      G_CALLBACK(gnc_ui_qif_import_load_progress_prepare_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_load_progress_show_cb",
      G_CALLBACK(gnc_ui_qif_import_load_progress_show_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_load_progress_pause_cb",
      G_CALLBACK(gnc_ui_qif_import_load_progress_pause_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_load_progress_next_cb",
      G_CALLBACK(gnc_ui_qif_import_load_progress_next_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_load_progress_back_cb",
      G_CALLBACK(gnc_ui_qif_import_load_progress_back_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_date_format_next_cb",
      G_CALLBACK(gnc_ui_qif_import_date_format_next_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_loaded_files_prepare_cb",
      G_CALLBACK(gnc_ui_qif_import_loaded_files_prepare_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_load_another_cb",
      G_CALLBACK(gnc_ui_qif_import_load_another_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_unload_file_cb",
      G_CALLBACK(gnc_ui_qif_import_unload_file_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_loaded_files_next_cb",
      G_CALLBACK(gnc_ui_qif_import_loaded_files_next_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_default_acct_next_cb",
      G_CALLBACK(gnc_ui_qif_import_default_acct_next_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_default_acct_back_cb",
      G_CALLBACK(gnc_ui_qif_import_default_acct_back_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_account_rematch_cb",
      G_CALLBACK(gnc_ui_qif_import_account_rematch_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_account_next_cb",
      G_CALLBACK(gnc_ui_qif_import_account_next_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_category_rematch_cb",
      G_CALLBACK(gnc_ui_qif_import_category_rematch_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_category_next_cb",
      G_CALLBACK(gnc_ui_qif_import_category_next_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_memo_doc_back_cb",
      G_CALLBACK(gnc_ui_qif_import_memo_doc_back_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_memo_rematch_cb",
      G_CALLBACK(gnc_ui_qif_import_memo_rematch_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_memo_back_cb",
      G_CALLBACK(gnc_ui_qif_import_memo_back_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_currency_back_cb",
      G_CALLBACK(gnc_ui_qif_import_currency_back_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_currency_next_cb",
      G_CALLBACK(gnc_ui_qif_import_currency_next_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_convert_progress_prepare_cb",
      G_CALLBACK(gnc_ui_qif_import_convert_progress_prepare_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_convert_progress_show_cb",
      G_CALLBACK(gnc_ui_qif_import_convert_progress_show_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_convert_progress_pause_cb",
      G_CALLBACK(gnc_ui_qif_import_convert_progress_pause_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_convert_progress_next_cb",
      G_CALLBACK(gnc_ui_qif_import_convert_progress_next_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_convert_progress_back_cb",
      G_CALLBACK(gnc_ui_qif_import_convert_progress_back_cb), wind);
 
-  glade_xml_signal_connect_data
+    glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_finish_cb",
      G_CALLBACK(gnc_ui_qif_import_finish_cb), wind);
 }
@@ -3518,133 +3578,133 @@
 static void
 build_views(QIFImportWindow *wind)
 {
-  GtkTreeView *view;
-  GtkListStore *store;
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
-  GtkTreeSelection *selection;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+    GtkTreeSelection *selection;
 
-  g_return_if_fail(wind);
+    g_return_if_fail(wind);
 
-  /* Set up the selected file view */
-  view = GTK_TREE_VIEW(wind->selected_file_view);
-  store = gtk_list_store_new(NUM_FILENAME_COLS, G_TYPE_INT, G_TYPE_STRING);
-  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    /* Set up the selected file view */
+    view = GTK_TREE_VIEW(wind->selected_file_view);
+    store = gtk_list_store_new(NUM_FILENAME_COLS, G_TYPE_INT, G_TYPE_STRING);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes("unused",
-                                                    renderer,
-                                                    "text",
-                                                    FILENAME_COL_NAME,
-                                                    NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes("unused",
+             renderer,
+             "text",
+             FILENAME_COL_NAME,
+             NULL);
+    gtk_tree_view_append_column(view, column);
 
-  selection = gtk_tree_view_get_selection(view);
-  g_signal_connect(selection, "changed",
-                   G_CALLBACK(gnc_ui_qif_import_select_loaded_file_cb),
-                   wind);
+    selection = gtk_tree_view_get_selection(view);
+    g_signal_connect(selection, "changed",
+                     G_CALLBACK(gnc_ui_qif_import_select_loaded_file_cb),
+                     wind);
 
-  /* Set up the QIF account to GnuCash account matcher. */
-  create_account_picker_view(wind->acct_view, _("QIF account name"),
-                             G_CALLBACK(gnc_ui_qif_import_account_activate_cb),
-                             G_CALLBACK(gnc_ui_qif_import_account_select_cb),
-                             wind);
+    /* Set up the QIF account to GnuCash account matcher. */
+    create_account_picker_view(wind->acct_view, _("QIF account name"),
+                               G_CALLBACK(gnc_ui_qif_import_account_activate_cb),
+                               G_CALLBACK(gnc_ui_qif_import_account_select_cb),
+                               wind);
 
-  /* Set up the QIF category to GnuCash account matcher. */
-  create_account_picker_view(wind->cat_view,  _("QIF category name"),
-                             G_CALLBACK(gnc_ui_qif_import_category_activate_cb),
-                             G_CALLBACK(gnc_ui_qif_import_category_select_cb),
-                             wind);
+    /* Set up the QIF category to GnuCash account matcher. */
+    create_account_picker_view(wind->cat_view,  _("QIF category name"),
+                               G_CALLBACK(gnc_ui_qif_import_category_activate_cb),
+                               G_CALLBACK(gnc_ui_qif_import_category_select_cb),
+                               wind);
 
-  /* Set up the QIF payee/memo to GnuCash account matcher. */
-  create_account_picker_view(wind->memo_view, _("QIF payee/memo"),
-                             G_CALLBACK(gnc_ui_qif_import_memo_activate_cb),
-                             G_CALLBACK(gnc_ui_qif_import_memo_select_cb),
-                             wind);
+    /* Set up the QIF payee/memo to GnuCash account matcher. */
+    create_account_picker_view(wind->memo_view, _("QIF payee/memo"),
+                               G_CALLBACK(gnc_ui_qif_import_memo_activate_cb),
+                               G_CALLBACK(gnc_ui_qif_import_memo_select_cb),
+                               wind);
 
-  /* Set up the new transaction view */
-  view = GTK_TREE_VIEW(wind->new_transaction_view);
-  store = gtk_list_store_new(NUM_QIF_TRANS_COLS, G_TYPE_INT, G_TYPE_STRING,
-                             G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
-  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    /* Set up the new transaction view */
+    view = GTK_TREE_VIEW(wind->new_transaction_view);
+    store = gtk_list_store_new(NUM_QIF_TRANS_COLS, G_TYPE_INT, G_TYPE_STRING,
+                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Date"),
-                                                    renderer,
-                                                    "text",
-                                                    QIF_TRANS_COL_DATE,
-                                                    NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Date"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_DATE,
+             NULL);
+    gtk_tree_view_append_column(view, column);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Description"),
-                                                    renderer,
-                                                    "text",
-                                                    QIF_TRANS_COL_DESCRIPTION,
-                                                    NULL);
-  gtk_tree_view_append_column(view, column);
-  gtk_tree_view_column_set_expand(column, TRUE);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Description"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_DESCRIPTION,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+    gtk_tree_view_column_set_expand(column, TRUE);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Amount"),
-                                                    renderer,
-                                                    "text",
-                                                    QIF_TRANS_COL_AMOUNT,
-                                                    NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Amount"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_AMOUNT,
+             NULL);
+    gtk_tree_view_append_column(view, column);
 
-  selection = gtk_tree_view_get_selection(view);
-  g_signal_connect(selection, "changed",
-                   G_CALLBACK(gnc_ui_qif_import_duplicate_new_select_cb),
-                   wind);
+    selection = gtk_tree_view_get_selection(view);
+    g_signal_connect(selection, "changed",
+                     G_CALLBACK(gnc_ui_qif_import_duplicate_new_select_cb),
+                     wind);
 
 
-  /* Set up the old transaction view */
-  view = GTK_TREE_VIEW(wind->old_transaction_view);
-  store = gtk_list_store_new(NUM_QIF_TRANS_COLS, G_TYPE_INT, G_TYPE_STRING,
-                             G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
-  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    /* Set up the old transaction view */
+    view = GTK_TREE_VIEW(wind->old_transaction_view);
+    store = gtk_list_store_new(NUM_QIF_TRANS_COLS, G_TYPE_INT, G_TYPE_STRING,
+                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Date"),
-                                                    renderer,
-                                                    "text",
-                                                    QIF_TRANS_COL_DATE,
-                                                    NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Date"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_DATE,
+             NULL);
+    gtk_tree_view_append_column(view, column);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Description"),
-                                                    renderer,
-                                                    "text",
-                                                    QIF_TRANS_COL_DESCRIPTION,
-                                                    NULL);
-  gtk_tree_view_append_column(view, column);
-  gtk_tree_view_column_set_expand(column, TRUE);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Description"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_DESCRIPTION,
+             NULL);
+    gtk_tree_view_append_column(view, column);
+    gtk_tree_view_column_set_expand(column, TRUE);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Amount"),
-                                                    renderer,
-                                                    "text",
-                                                    QIF_TRANS_COL_AMOUNT,
-                                                    NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Amount"),
+             renderer,
+             "text",
+             QIF_TRANS_COL_AMOUNT,
+             NULL);
+    gtk_tree_view_append_column(view, column);
 
-  renderer = gtk_cell_renderer_toggle_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Match?"),
-                                                    renderer,
-                                                    "active",
-                                                    QIF_TRANS_COL_CHECKED,
-                                                    NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_toggle_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Match?"),
+             renderer,
+             "active",
+             QIF_TRANS_COL_CHECKED,
+             NULL);
+    gtk_tree_view_append_column(view, column);
 
-  selection = gtk_tree_view_get_selection(view);
-  g_signal_connect(selection, "changed",
-                   G_CALLBACK(gnc_ui_qif_import_duplicate_old_select_cb),
-                   wind);
+    selection = gtk_tree_view_get_selection(view);
+    g_signal_connect(selection, "changed",
+                     G_CALLBACK(gnc_ui_qif_import_duplicate_old_select_cb),
+                     wind);
 }
 
 
@@ -3657,55 +3717,55 @@
 QIFImportWindow *
 gnc_ui_qif_import_druid_make(void)
 {
-  QIFImportWindow * wind;
-  GladeXML        * xml;
+    QIFImportWindow * wind;
+    GladeXML        * xml;
 
-  /* Allocate space for the druid and load its design. */
-  wind = g_new0(QIFImportWindow, 1);
-  xml = gnc_glade_xml_new("qif.glade", "QIF Import Druid");
+    /* Allocate space for the druid and load its design. */
+    wind = g_new0(QIFImportWindow, 1);
+    xml = gnc_glade_xml_new("qif.glade", "QIF Import Druid");
 
-  wind->new_namespaces       = NULL;
-  wind->selected_transaction = 0;
-  wind->busy                 = FALSE;
+    wind->new_namespaces       = NULL;
+    wind->selected_transaction = 0;
+    wind->busy                 = FALSE;
 
-  /* Get all user preferences related to QIF importing. */
-  get_preferences(wind);
+    /* Get all user preferences related to QIF importing. */
+    get_preferences(wind);
 
-  /* Set up the Scheme side of things. */
-  initialize_scheme(wind);
+    /* Set up the Scheme side of things. */
+    initialize_scheme(wind);
 
-  /* Build lists of the druid pages. */
-  build_page_lists(wind, xml);
+    /* Build lists of the druid pages. */
+    build_page_lists(wind, xml);
 
-  /* Get all interesting glade-defined widgets. */
-  get_glade_widgets(wind, xml);
+    /* Get all interesting glade-defined widgets. */
+    get_glade_widgets(wind, xml);
 
-  /* Connect all glade-defined signals to their handlers. */
-  connect_glade_signals(wind, xml);
+    /* Connect all glade-defined signals to their handlers. */
+    connect_glade_signals(wind, xml);
 
-  /* Build the details of all GtkTreeView widgets. */
-  build_views(wind);
+    /* Build the details of all GtkTreeView widgets. */
+    build_views(wind);
 
-  /* Set a default currency for new accounts */
-  gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(wind->currency_picker));
-  gnc_ui_update_commodity_picker(wind->currency_picker,
-                                 GNC_COMMODITY_NS_CURRENCY,
-                                 gnc_commodity_get_printname(
-                                   gnc_default_currency()));
+    /* Set a default currency for new accounts */
+    gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(wind->currency_picker));
+    gnc_ui_update_commodity_picker(wind->currency_picker,
+                                   GNC_COMMODITY_NS_CURRENCY,
+                                   gnc_commodity_get_printname(
+                                       gnc_default_currency()));
 
-  /* If desired, skip the initial documentation pages. */
-  if (!wind->show_doc_pages)
-    gnome_druid_set_page(GNOME_DRUID(wind->druid),
-                         get_named_page(wind, "load_file_page"));
+    /* If desired, skip the initial documentation pages. */
+    if (!wind->show_doc_pages)
+        gnome_druid_set_page(GNOME_DRUID(wind->druid),
+                             get_named_page(wind, "load_file_page"));
 
-  gnc_druid_set_colors(GNOME_DRUID(wind->druid));
+    gnc_druid_set_colors(GNOME_DRUID(wind->druid));
 
-  gnc_register_gui_component(DRUID_QIF_IMPORT_CM_CLASS, NULL, NULL, wind);
+    gnc_register_gui_component(DRUID_QIF_IMPORT_CM_CLASS, NULL, NULL, wind);
 
-  gtk_widget_show_all(wind->window);
-  gtk_window_present(GTK_WINDOW(wind->window));
+    gtk_widget_show_all(wind->window);
+    gtk_window_present(GTK_WINDOW(wind->window));
 
-  return wind;
+    return wind;
 }
 
 
@@ -3713,21 +3773,21 @@
 show_handler(const char *class, gint component_id,
              gpointer user_data, gpointer iter_data)
 {
-  QIFImportWindow *qif_win = user_data;
+    QIFImportWindow *qif_win = user_data;
 
-  if (!qif_win)
-    return(FALSE);
-  gtk_window_present(GTK_WINDOW(qif_win->window));
-  return(TRUE);
+    if (!qif_win)
+        return(FALSE);
+    gtk_window_present(GTK_WINDOW(qif_win->window));
+    return(TRUE);
 }
 
 void
 gnc_file_qif_import(void)
 {
-  if (gnc_forall_gui_components(DRUID_QIF_IMPORT_CM_CLASS,
-                                show_handler, NULL))
-    return;
+    if (gnc_forall_gui_components(DRUID_QIF_IMPORT_CM_CLASS,
+                                  show_handler, NULL))
+        return;
 
-  /* pop up the QIF File Import dialog box */
-  gnc_ui_qif_import_druid_make();
+    /* pop up the QIF File Import dialog box */
+    gnc_ui_qif_import_druid_make();
 }

Modified: gnucash/trunk/src/import-export/qif-import/gnc-druid-test.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gnc-druid-test.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif-import/gnc-druid-test.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -9,153 +9,154 @@
 
 #include <stdio.h>
 
-typedef struct _GncDruidTest {
-  GList *files;
+typedef struct _GncDruidTest
+{
+    GList *files;
 } GncDruidTest;
 
 static GList *
 gnc_dt_test_get_files(gpointer ctx)
 {
-  GncDruidTest *gdt = ctx;
-  return gdt->files;
+    GncDruidTest *gdt = ctx;
+    return gdt->files;
 }
 
 static const gchar *
 gnc_dt_test_get_filename(gpointer ctx, gpointer file)
 {
-  return file;
+    return file;
 }
 
 static void
 gnc_dt_test_remove_file(gpointer ctx, gpointer file)
 {
-  GncDruidTest *gdt = ctx;
-  gdt->files = g_list_remove(gdt->files, file);
-  g_free(file);
+    GncDruidTest *gdt = ctx;
+    gdt->files = g_list_remove(gdt->files, file);
+    g_free(file);
 }
 
 static gboolean
 gnc_dt_test_add_file(GNCDruidCB *cb)
 {
-  GNCDruidProviderFileCB *cb_f = GNC_DRUID_PROVIDER_FILE_CB(cb);
-  GncDruidTest *gdt = cb->druid_ctx->be_ctx;
+    GNCDruidProviderFileCB *cb_f = GNC_DRUID_PROVIDER_FILE_CB(cb);
+    GncDruidTest *gdt = cb->druid_ctx->be_ctx;
 
-  gdt->files = g_list_prepend(gdt->files, g_strdup(cb_f->filename));
-  cb_f->this_file = gdt->files->data;
-  return TRUE;
+    gdt->files = g_list_prepend(gdt->files, g_strdup(cb_f->filename));
+    cb_f->this_file = gdt->files->data;
+    return TRUE;
 }
 
 static gboolean
 gnc_dt_test_files_done(GNCDruidCB *cb)
 {
-  GncDruidTest *gdt = cb->druid_ctx->be_ctx;
-  fprintf(stderr, "Done adding files: %d files..\n", g_list_length(gdt->files));
-  return TRUE;
+    GncDruidTest *gdt = cb->druid_ctx->be_ctx;
+    fprintf(stderr, "Done adding files: %d files..\n", g_list_length(gdt->files));
+    return TRUE;
 }
 
 static GncImportFormat
 gnc_dt_test_get_formats(GNCImportFormatCB *cb)
 {
-  return GNCIF_DATE_YMD|GNCIF_DATE_YDM;
+    return GNCIF_DATE_YMD | GNCIF_DATE_YDM;
 }
 
 static const gchar *
 gnc_dt_test_get_sample(GNCImportFormatCB *cb)
 {
-  return "2004-10-11";
+    return "2004-10-11";
 }
 
 static gboolean
 gnc_dt_test_formats_done(GNCDruidCB *cb)
 {
-  GNCImportFormatCB *cb_f = GNC_IMPORT_FORMAT_CB(cb);
-  fprintf(stderr, "User selected format: %d\n", cb_f->format);
-  return TRUE;
+    GNCImportFormatCB *cb_f = GNC_IMPORT_FORMAT_CB(cb);
+    fprintf(stderr, "User selected format: %d\n", cb_f->format);
+    return TRUE;
 }
 
 static GList *
 gnc_dt_test_build_providers(void)
 {
-  GList *list = NULL;
-  GNCDruidProviderDescFile *desc_file;
-  GNCDruidProviderDescMultifile *desc_multifile;
+    GList *list = NULL;
+    GNCDruidProviderDescFile *desc_file;
+    GNCDruidProviderDescMultifile *desc_multifile;
 
-  /* Build the provider list in reverse order, because g_list_append is slow */
-  list =
-    g_list_prepend(list,
-		   gnc_druid_provider_desc_edge_new_with_data(GNC_DPE_LAST,
-							      "Test Druid End",
-							      "Click finish to close the druid."));
+    /* Build the provider list in reverse order, because g_list_append is slow */
+    list =
+        g_list_prepend(list,
+                       gnc_druid_provider_desc_edge_new_with_data(GNC_DPE_LAST,
+                               "Test Druid End",
+                               "Click finish to close the druid."));
 
-  desc_file =
-    gnc_druid_provider_desc_file_new_with_data("Test Druid New File",
-					       "Choose a file",
-					       "test-druid-history",
-					       "/tmp",
-					       TRUE,
-					       gnc_dt_test_add_file,
-					       gnc_dt_test_remove_file);
+    desc_file =
+        gnc_druid_provider_desc_file_new_with_data("Test Druid New File",
+                "Choose a file",
+                "test-druid-history",
+                "/tmp",
+                TRUE,
+                gnc_dt_test_add_file,
+                gnc_dt_test_remove_file);
 
-  desc_multifile =
-    gnc_druid_provider_desc_multifile_new_with_data("Test Druid Files",
-						    NULL,
-						    desc_file,
-						    gnc_dt_test_files_done,
-						    gnc_dt_test_get_files,
-						    gnc_dt_test_get_filename);
-  desc_file->multifile_provider = desc_multifile;
+    desc_multifile =
+        gnc_druid_provider_desc_multifile_new_with_data("Test Druid Files",
+                NULL,
+                desc_file,
+                gnc_dt_test_files_done,
+                gnc_dt_test_get_files,
+                gnc_dt_test_get_filename);
+    desc_file->multifile_provider = desc_multifile;
 
-  list = g_list_prepend(list, desc_multifile);
-  list = g_list_prepend(list,
-			gnc_import_desc_format_new_with_data("Formats are Ambiguous",
-							     "Choose your format!",
-							     gnc_dt_test_formats_done,
-							     gnc_dt_test_get_formats,
-							     gnc_dt_test_get_sample));
+    list = g_list_prepend(list, desc_multifile);
+    list = g_list_prepend(list,
+                          gnc_import_desc_format_new_with_data("Formats are Ambiguous",
+                                  "Choose your format!",
+                                  gnc_dt_test_formats_done,
+                                  gnc_dt_test_get_formats,
+                                  gnc_dt_test_get_sample));
 
-  list = g_list_prepend(list, desc_file);
-  list =
-    g_list_prepend(list,
-		   gnc_druid_provider_desc_edge_new_with_data(GNC_DPE_FIRST,
-							      "Test Druid Start",
-							      "This is a test druid.  It doesn't do much."));
-  
-  return list;
+    list = g_list_prepend(list, desc_file);
+    list =
+        g_list_prepend(list,
+                       gnc_druid_provider_desc_edge_new_with_data(GNC_DPE_FIRST,
+                               "Test Druid Start",
+                               "This is a test druid.  It doesn't do much."));
+
+    return list;
 }
 
 static gboolean
 gnc_dt_test_finish_cb(gpointer ctx)
 {
-  fprintf(stderr, "finish callback called...\n");
-  return TRUE;
+    fprintf(stderr, "finish callback called...\n");
+    return TRUE;
 }
 
 static void
 gnc_dt_test_cancel_cb(gpointer ctx)
 {
-  GncDruidTest *gdt = ctx;
-  GList *node;
+    GncDruidTest *gdt = ctx;
+    GList *node;
 
-  fprintf(stderr, "cancel callback called...(%p)\n", gdt);
+    fprintf(stderr, "cancel callback called...(%p)\n", gdt);
 
-  for (node = gdt->files; node; node = node->next)
-    g_free(node->data);
+    for (node = gdt->files; node; node = node->next)
+        g_free(node->data);
 
-  g_list_free(gdt->files);
-  g_free(gdt);
+    g_list_free(gdt->files);
+    g_free(gdt);
 }
 
 GNCDruid *
 gnc_druid_gnome_test(void)
 {
-  GNCDruid * druid;
-  GList *providers;
-  GncDruidTest *gdt = g_new0(GncDruidTest, 1);
+    GNCDruid * druid;
+    GList *providers;
+    GncDruidTest *gdt = g_new0(GncDruidTest, 1);
 
-  providers = gnc_dt_test_build_providers();
+    providers = gnc_dt_test_build_providers();
 
-  druid = gnc_druid_new("This is a test druid title",
-			providers, gdt,
-			gnc_dt_test_finish_cb, gnc_dt_test_cancel_cb);
-  return druid;
+    druid = gnc_druid_new("This is a test druid title",
+                          providers, gdt,
+                          gnc_dt_test_finish_cb, gnc_dt_test_cancel_cb);
+    return druid;
 }

Modified: gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-qif-import.c -- 
+/*
+ * gnc-plugin-qif-import.c --
  * Copyright (C) 2003 Jan Arne Petersen
  * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
  *
@@ -44,20 +44,23 @@
 #define PLUGIN_ACTIONS_NAME "gnc-plugin-qif-import-actions"
 #define PLUGIN_UI_FILENAME  "gnc-plugin-qif-import-ui.xml"
 
-static GtkActionEntry gnc_plugin_actions [] = {
-	{ "QIFImportAction", GTK_STOCK_CONVERT, N_("Import _QIF..."), NULL,
-	  N_("Import a Quicken QIF file"),
-	  G_CALLBACK (gnc_plugin_qif_import_cmd_new_qif_import) },
-/*
-	{ "QIFTestDruid", GTK_STOCK_CONVERT, "_Test Druid...", NULL, 
-	  "Test the new Druid", G_CALLBACK(gnc_plugin_qif_test_druid) },
-*/
+static GtkActionEntry gnc_plugin_actions [] =
+{
+    {
+        "QIFImportAction", GTK_STOCK_CONVERT, N_("Import _QIF..."), NULL,
+        N_("Import a Quicken QIF file"),
+        G_CALLBACK (gnc_plugin_qif_import_cmd_new_qif_import)
+    },
+    /*
+    	{ "QIFTestDruid", GTK_STOCK_CONVERT, "_Test Druid...", NULL,
+    	  "Test the new Druid", G_CALLBACK(gnc_plugin_qif_test_druid) },
+    */
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
 
 typedef struct GncPluginQifImportPrivate
 {
-	gpointer dummy;
+    gpointer dummy;
 } GncPluginQifImportPrivate;
 
 #define GNC_PLUGIN_QIF_IMPORT_GET_PRIVATE(o)  \
@@ -68,55 +71,57 @@
 GType
 gnc_plugin_qif_import_get_type (void)
 {
-	static GType gnc_plugin_qif_import_type = 0;
+    static GType gnc_plugin_qif_import_type = 0;
 
-	if (gnc_plugin_qif_import_type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (GncPluginQifImportClass),
-			NULL,		/* base_init */
-			NULL,		/* base_finalize */
-			(GClassInitFunc) gnc_plugin_qif_import_class_init,
-			NULL,		/* class_finalize */
-			NULL,		/* class_data */
-			sizeof (GncPluginQifImport),
-			0,		/* n_preallocs */
-			(GInstanceInitFunc) gnc_plugin_qif_import_init,
-		};
+    if (gnc_plugin_qif_import_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginQifImportClass),
+            NULL,		/* base_init */
+            NULL,		/* base_finalize */
+            (GClassInitFunc) gnc_plugin_qif_import_class_init,
+            NULL,		/* class_finalize */
+            NULL,		/* class_data */
+            sizeof (GncPluginQifImport),
+            0,		/* n_preallocs */
+            (GInstanceInitFunc) gnc_plugin_qif_import_init,
+        };
 
-		gnc_plugin_qif_import_type = g_type_register_static (GNC_TYPE_PLUGIN,
-								     "GncPluginQifImport",
-								     &our_info, 0);
-	}
+        gnc_plugin_qif_import_type = g_type_register_static (GNC_TYPE_PLUGIN,
+                                     "GncPluginQifImport",
+                                     &our_info, 0);
+    }
 
-	return gnc_plugin_qif_import_type;
+    return gnc_plugin_qif_import_type;
 }
 
 GncPlugin *
 gnc_plugin_qif_import_new (void)
 {
-	return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_QIF_IMPORT, NULL));
+    return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_QIF_IMPORT, NULL));
 }
 
 static void
 gnc_plugin_qif_import_class_init (GncPluginQifImportClass *klass)
 {
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-	GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
 
-	parent_class = g_type_class_peek_parent (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-	object_class->finalize = gnc_plugin_qif_import_finalize;
+    object_class->finalize = gnc_plugin_qif_import_finalize;
 
-	/* plugin info */
-	plugin_class->plugin_name  = GNC_PLUGIN_QIF_IMPORT_NAME;
+    /* plugin info */
+    plugin_class->plugin_name  = GNC_PLUGIN_QIF_IMPORT_NAME;
 
-	/* widget addition/removal */
-	plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
-	plugin_class->actions      = gnc_plugin_actions;
-	plugin_class->n_actions    = gnc_plugin_n_actions;
-	plugin_class->ui_filename  = PLUGIN_UI_FILENAME;
+    /* widget addition/removal */
+    plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
+    plugin_class->actions      = gnc_plugin_actions;
+    plugin_class->n_actions    = gnc_plugin_n_actions;
+    plugin_class->ui_filename  = PLUGIN_UI_FILENAME;
 
-	g_type_class_add_private(klass, sizeof(GncPluginQifImportPrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginQifImportPrivate));
 }
 
 static void
@@ -127,15 +132,15 @@
 static void
 gnc_plugin_qif_import_finalize (GObject *object)
 {
-	GncPluginQifImport *plugin;
-	GncPluginQifImportPrivate *priv;
+    GncPluginQifImport *plugin;
+    GncPluginQifImportPrivate *priv;
 
-	g_return_if_fail (GNC_IS_PLUGIN_QIF_IMPORT (object));
+    g_return_if_fail (GNC_IS_PLUGIN_QIF_IMPORT (object));
 
-	plugin = GNC_PLUGIN_QIF_IMPORT (object);
-	priv = GNC_PLUGIN_QIF_IMPORT_GET_PRIVATE(plugin);
+    plugin = GNC_PLUGIN_QIF_IMPORT (object);
+    priv = GNC_PLUGIN_QIF_IMPORT_GET_PRIVATE(plugin);
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 /************************************************************
@@ -148,9 +153,9 @@
 
 static void
 gnc_plugin_qif_import_cmd_new_qif_import (GtkAction *action,
-					  GncMainWindowActionData *data)
+        GncMainWindowActionData *data)
 {
-	gnc_ui_qif_import_druid_make ();
+    gnc_ui_qif_import_druid_make ();
 }
 
 /*
@@ -168,9 +173,9 @@
 void
 gnc_plugin_qif_import_create_plugin (void)
 {
-	GncPlugin *plugin = gnc_plugin_qif_import_new ();
+    GncPlugin *plugin = gnc_plugin_qif_import_new ();
 
-	gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
-	gnc_preferences_add_to_page ("qif.glade", "prefs_table",
-				     _("Online Banking"));
+    gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
+    gnc_preferences_add_to_page ("qif.glade", "prefs_table",
+                                 _("Online Banking"));
 }

Modified: gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.h
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-qif-import.h -- 
+/*
+ * gnc-plugin-qif-import.h --
  * Copyright (C) 2003 Jan Arne Petersen
  * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
  *
@@ -41,12 +41,14 @@
 #define GNC_PLUGIN_QIF_IMPORT_NAME "gnc-plugin-qif-import"
 
 /* typedefs & structures */
-typedef struct {
-	GncPlugin gnc_plugin;
+typedef struct
+{
+    GncPlugin gnc_plugin;
 } GncPluginQifImport;
 
-typedef struct {
-	GncPluginClass gnc_plugin;
+typedef struct
+{
+    GncPluginClass gnc_plugin;
 } GncPluginQifImportClass;
 
 /* function prototypes */

Modified: gnucash/trunk/src/import-export/qif-import/gncmod-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gncmod-qif-import.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif-import/gncmod-qif-import.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -30,51 +30,51 @@
 char *
 libgncmod_qif_import_gnc_module_path(void)
 {
-  return g_strdup("gnucash/import-export/qif-import");
+    return g_strdup("gnucash/import-export/qif-import");
 }
 
 char *
 libgncmod_qif_import_gnc_module_description(void)
 {
-  return g_strdup("Gnome GUI and Scheme code for QIF importer");
+    return g_strdup("Gnome GUI and Scheme code for QIF importer");
 }
 
 int
 libgncmod_qif_import_gnc_module_init(int refcount)
 {
-  if(!gnc_module_load("gnucash/engine", 0))
-  {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
 
-  if(!gnc_module_load("gnucash/app-utils", 0))
-  {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
 
-  if(!gnc_module_load("gnucash/gnome-utils", 0))
-  {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
 
-  /* If the recount == 0 then register the qif-import-druid for the new-user
-   * dialog.
-   */
-  if (refcount == 0)
-  {
-    gnc_new_user_dialog_register_qif_druid
-      ((void (*)())gnc_ui_qif_import_druid_make);
-  }
+    /* If the recount == 0 then register the qif-import-druid for the new-user
+     * dialog.
+     */
+    if (refcount == 0)
+    {
+        gnc_new_user_dialog_register_qif_druid
+        ((void (*)())gnc_ui_qif_import_druid_make);
+    }
 
-  scm_c_eval_string("(use-modules (gnucash import-export qif-import))");
+    scm_c_eval_string("(use-modules (gnucash import-export qif-import))");
 
-  gnc_plugin_qif_import_create_plugin();
+    gnc_plugin_qif_import_create_plugin();
 
-  return TRUE;
+    return TRUE;
 }
 
 int
 libgncmod_qif_import_gnc_module_end(int refcount)
 {
-  return TRUE;
+    return TRUE;
 }

Modified: gnucash/trunk/src/import-export/qif-import/test/test-link.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/test/test-link.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif-import/test/test-link.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,6 +1,6 @@
 int
-main(int argc, char ** argv) 
+main(int argc, char ** argv)
 {
-  return 0;
+    return 0;
 }
 

Modified: gnucash/trunk/src/import-export/qif-io-core/gncmod-qifiocore.c
===================================================================
--- gnucash/trunk/src/import-export/qif-io-core/gncmod-qifiocore.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/qif-io-core/gncmod-qifiocore.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -23,37 +23,44 @@
 
 
 char *
-libgncmod_qifiocore_gnc_module_path(void) {
-  return g_strdup("gnucash/qif-io/core");
+libgncmod_qifiocore_gnc_module_path(void)
+{
+    return g_strdup("gnucash/qif-io/core");
 }
 
 char *
-libgncmod_qifiocore_gnc_module_description(void) {
-  return g_strdup("Core components of QIF import/export (non-GUI)");
+libgncmod_qifiocore_gnc_module_description(void)
+{
+    return g_strdup("Core components of QIF import/export (non-GUI)");
 }
 
 int
-libgncmod_qifiocore_gnc_module_init(int refcount) {
-  /* load the engine (we depend on it) */
-  if(!gnc_module_load("gnucash/engine", 0)) {
-    return FALSE;
-  }
+libgncmod_qifiocore_gnc_module_init(int refcount)
+{
+    /* load the engine (we depend on it) */
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
 
-  /* load the engine (we depend on it) */
-  if(!gnc_module_load("gnucash/app-utils", 0)) {
-    return FALSE;
-  }
+    /* load the engine (we depend on it) */
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
 
-  /* load the QIF Scheme code */
-  if(scm_c_eval_string("(use-modules (gnucash import-export qif-io-core))") ==
-     SCM_BOOL_F) {
-    return FALSE;
-  }
+    /* load the QIF Scheme code */
+    if (scm_c_eval_string("(use-modules (gnucash import-export qif-io-core))") ==
+            SCM_BOOL_F)
+    {
+        return FALSE;
+    }
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_qifiocore_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_qifiocore_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/import-export/test/test-import-parse.c
===================================================================
--- gnucash/trunk/src/import-export/test/test-import-parse.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/test/test-import-parse.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -31,7 +31,12 @@
 
 #include "test-stuff.h"
 
-typedef struct { int y; int m; int d; } my_ymd_t;
+typedef struct
+{
+    int y;
+    int m;
+    int d;
+} my_ymd_t;
 
 /* make sure the numbers are the same in the two sets of lists */
 const char* period_numbers[] = { " $+2000.00", "-2.00", "1,182,183.1827", NULL };
@@ -41,141 +46,145 @@
 
 /* Make sure the strings and numbers match... */
 const char* dates_ymd[] = { "1999/12/31", "2001-6-17", "20020726",  NULL };
-my_ymd_t dates_ymd_vals[] = { {1999,12,31}, {2001,6,17}, {2002,7,26}, {0,0,0} };
+my_ymd_t dates_ymd_vals[] = { {1999, 12, 31}, {2001, 6, 17}, {2002, 7, 26}, {0, 0, 0} };
 const char* dates_ydm[] = { "1999/31/12", "2001-17-6", "20012311", NULL };
-my_ymd_t dates_ydm_vals[] = { {1999,12,31}, {2001,6,17}, {2001,11,23}, {0,0,0} };
+my_ymd_t dates_ydm_vals[] = { {1999, 12, 31}, {2001, 6, 17}, {2001, 11, 23}, {0, 0, 0} };
 const char* dates_mdy[] = { "1/16/2001", "12-31-1999", "01171983", NULL };
-my_ymd_t dates_mdy_vals[] = { {2001,1,16}, {1999,12,31}, {1983,1,17}, {0,0,0} };
+my_ymd_t dates_mdy_vals[] = { {2001, 1, 16}, {1999, 12, 31}, {1983, 1, 17}, {0, 0, 0} };
 const char* dates_dmy[] = { "16/1/2001", "31-12-1999", "17011976", NULL };
-my_ymd_t dates_dmy_vals[] = { {2001,1,16}, {1999,12,31}, {1976,1,17}, {0,0,0} };
+my_ymd_t dates_dmy_vals[] = { {2001, 1, 16}, {1999, 12, 31}, {1976, 1, 17}, {0, 0, 0} };
 
 const char* dates_yxx[] = { "99/1/6", "1999-12'10", "20010306", NULL };
 const char* dates_xxy[] = { "1/3/99", "12-10'1999", "03062001", NULL };
 
 static void
 run_check(GncImportFormat (*check_fcn)(const char*, GncImportFormat),
-	  const char *numbers[], GncImportFormat formats,
-	  const char* msg, GncImportFormat expected)
+const char *numbers[], GncImportFormat formats,
+const char* msg, GncImportFormat expected)
 {
-  while (*numbers) {
-    do_test(check_fcn(*numbers, formats) == expected, msg);
-    numbers++;
-  }
+    while (*numbers)
+    {
+        do_test(check_fcn(*numbers, formats) == expected, msg);
+        numbers++;
+    }
 }
 
 static void
 test_check_numeric(void)
 {
-  GncImportFormat fmts;
+    GncImportFormat fmts;
 
-  fmts = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA | GNCIF_DATE_MDY;
-  
-  run_check(gnc_import_test_numeric, period_numbers, fmts,
-	    "Period numbers", GNCIF_NUM_PERIOD);
-  run_check(gnc_import_test_numeric, comma_numbers, fmts,
-	    "Comma numbers", GNCIF_NUM_COMMA);
+    fmts = GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA | GNCIF_DATE_MDY;
 
-  run_check(gnc_import_test_numeric, period_numbers_ambig, fmts,
-	    "Ambiguous Period numbers", GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA);
-  run_check(gnc_import_test_numeric, comma_numbers_ambig, fmts,
-	    "Ambiguous Comma numbers", GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA);
+    run_check(gnc_import_test_numeric, period_numbers, fmts,
+    "Period numbers", GNCIF_NUM_PERIOD);
+    run_check(gnc_import_test_numeric, comma_numbers, fmts,
+    "Comma numbers", GNCIF_NUM_COMMA);
+
+    run_check(gnc_import_test_numeric, period_numbers_ambig, fmts,
+    "Ambiguous Period numbers", GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA);
+    run_check(gnc_import_test_numeric, comma_numbers_ambig, fmts,
+    "Ambiguous Comma numbers", GNCIF_NUM_PERIOD | GNCIF_NUM_COMMA);
 }
 
 static void
 test_check_date(void)
 {
-  GncImportFormat fmts;
+    GncImportFormat fmts;
 
-  fmts = GNCIF_DATE_DMY | GNCIF_DATE_MDY | GNCIF_DATE_YMD | GNCIF_DATE_YDM;
+    fmts = GNCIF_DATE_DMY | GNCIF_DATE_MDY | GNCIF_DATE_YMD | GNCIF_DATE_YDM;
 
-  run_check(gnc_import_test_date, dates_ymd, fmts, "y/m/d dates", GNCIF_DATE_YMD);
-  run_check(gnc_import_test_date, dates_ydm, fmts, "y/d/m dates", GNCIF_DATE_YDM);
-  run_check(gnc_import_test_date, dates_mdy, fmts, "m/d/y dates", GNCIF_DATE_MDY);
-  run_check(gnc_import_test_date, dates_dmy, fmts, "d/m/y dates", GNCIF_DATE_DMY);
+    run_check(gnc_import_test_date, dates_ymd, fmts, "y/m/d dates", GNCIF_DATE_YMD);
+    run_check(gnc_import_test_date, dates_ydm, fmts, "y/d/m dates", GNCIF_DATE_YDM);
+    run_check(gnc_import_test_date, dates_mdy, fmts, "m/d/y dates", GNCIF_DATE_MDY);
+    run_check(gnc_import_test_date, dates_dmy, fmts, "d/m/y dates", GNCIF_DATE_DMY);
 
-  run_check(gnc_import_test_date, dates_yxx, fmts, "y/x/x dates",
-	    GNCIF_DATE_YMD | GNCIF_DATE_YDM);
-  run_check(gnc_import_test_date, dates_xxy, fmts, "x/x/y dates",
-	    GNCIF_DATE_DMY | GNCIF_DATE_MDY);
+    run_check(gnc_import_test_date, dates_yxx, fmts, "y/x/x dates",
+    GNCIF_DATE_YMD | GNCIF_DATE_YDM);
+    run_check(gnc_import_test_date, dates_xxy, fmts, "x/x/y dates",
+    GNCIF_DATE_DMY | GNCIF_DATE_MDY);
 }
 
 static void
 test_numbers(const char* pstr, const char* cstr)
 {
-  gnc_numeric pval, cval;
+    gnc_numeric pval, cval;
 
-  do_test(gnc_import_parse_numeric(pstr, GNCIF_NUM_PERIOD, &pval), "Parsing Period");
-  do_test(gnc_import_parse_numeric(cstr, GNCIF_NUM_COMMA, &cval), "Parsing Comma");
+    do_test(gnc_import_parse_numeric(pstr, GNCIF_NUM_PERIOD, &pval), "Parsing Period");
+    do_test(gnc_import_parse_numeric(cstr, GNCIF_NUM_COMMA, &cval), "Parsing Comma");
 
-  do_test(gnc_numeric_equal(pval, cval), "Numbers equal?");
+    do_test(gnc_numeric_equal(pval, cval), "Numbers equal?");
 }
 
 static void
 test_number_strings(const char** pstrs, const char** cstrs)
 {
-  while (*pstrs && *cstrs) {
-    test_numbers(*pstrs, *cstrs);
-    pstrs++;
-    cstrs++;
-  }
+    while (*pstrs && *cstrs)
+    {
+        test_numbers(*pstrs, *cstrs);
+        pstrs++;
+        cstrs++;
+    }
 }
 
 static void
 test_parse_numeric(void)
 {
-  test_number_strings(period_numbers, comma_numbers);
-  test_number_strings(period_numbers_ambig, comma_numbers_ambig);
+    test_number_strings(period_numbers, comma_numbers);
+    test_number_strings(period_numbers_ambig, comma_numbers_ambig);
 }
 
 static void
 test_date(const char* str, GncImportFormat fmt, my_ymd_t date)
 {
-  Timespec ts, ts2;;
+    Timespec ts, ts2;;
 
-  do_test(gnc_import_parse_date(str, fmt, &ts), "Parsing date");
-  ts2 = gnc_dmy2timespec(date.d, date.m, date.y);
-  do_test(timespec_equal(&ts, &ts2), "Date Equal");
+    do_test(gnc_import_parse_date(str, fmt, &ts), "Parsing date");
+    ts2 = gnc_dmy2timespec(date.d, date.m, date.y);
+    do_test(timespec_equal(&ts, &ts2), "Date Equal");
 }
 
 static void
 test_date_list(const char** strs, GncImportFormat fmt, my_ymd_t *dates)
 {
-  while (*strs && (*dates).y) {
-    test_date(*strs, fmt, *dates);
-    strs++; dates++;
-  }
+    while (*strs && (*dates).y)
+    {
+        test_date(*strs, fmt, *dates);
+        strs++;
+        dates++;
+    }
 }
 
 static void
 test_parse_date(void)
 {
-  test_date_list(dates_ymd, GNCIF_DATE_YMD, dates_ymd_vals);
-  test_date_list(dates_ydm, GNCIF_DATE_YDM, dates_ydm_vals);
-  test_date_list(dates_mdy, GNCIF_DATE_MDY, dates_mdy_vals);
-  test_date_list(dates_dmy, GNCIF_DATE_DMY, dates_dmy_vals);
+    test_date_list(dates_ymd, GNCIF_DATE_YMD, dates_ymd_vals);
+    test_date_list(dates_ydm, GNCIF_DATE_YDM, dates_ydm_vals);
+    test_date_list(dates_mdy, GNCIF_DATE_MDY, dates_mdy_vals);
+    test_date_list(dates_dmy, GNCIF_DATE_DMY, dates_dmy_vals);
 }
 
 static void
 test_import_parse(void)
 {
-  test_check_numeric();
-  test_check_date();
-  test_parse_numeric();
-  test_parse_date();
+    test_check_numeric();
+    test_check_date();
+    test_parse_numeric();
+    test_parse_date();
 }
 
 static void
 main_helper(void *closure, int argc, char **argv)
 {
-  gnc_module_load("gnucash/import-export", 0);
-  test_import_parse();
-  print_test_results();
-  exit(get_rv());
+    gnc_module_load("gnucash/import-export", 0);
+    test_import_parse();
+    print_test_results();
+    exit(get_rv());
 }
 
 int
 main(int argc, char **argv)
 {
-  scm_boot_guile(argc, argv, main_helper, NULL);
-  return 0;
+    scm_boot_guile(argc, argv, main_helper, NULL);
+    return 0;
 }

Modified: gnucash/trunk/src/import-export/test/test-link.c
===================================================================
--- gnucash/trunk/src/import-export/test/test-link.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/import-export/test/test-link.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,6 +1,6 @@
 int
-main(int argc, char ** argv) 
+main(int argc, char ** argv)
 {
-  return 0;
+    return 0;
 }
 

Modified: gnucash/trunk/src/libqof/backend/file/qsf-xml-map.c
===================================================================
--- gnucash/trunk/src/libqof/backend/file/qsf-xml-map.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/libqof/backend/file/qsf-xml-map.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -556,7 +556,7 @@
                 object_data = BAD_CAST qsf_else_set_value(param_node, params->qsf_default_hash,
                               (gchar*)output_content, params->map_ns);
                 output_content = BAD_CAST xmlGetProp( (xmlNodePtr) g_hash_table_lookup(
-                                                          params->qsf_default_hash, object_data), BAD_CAST MAP_VALUE_ATTR);
+                        params->qsf_default_hash, object_data), BAD_CAST MAP_VALUE_ATTR);
             }
             if (object_data != NULL)
             {
@@ -677,7 +677,7 @@
                 {
                     output_content = xmlGetProp( (xmlNodePtr) g_hash_table_lookup(
                                                      params->qsf_default_hash, xmlGetProp(param_node,
-                                                                                          BAD_CAST QSF_BOOLEAN_DEFAULT) ), BAD_CAST MAP_VALUE_ATTR);
+                                                             BAD_CAST QSF_BOOLEAN_DEFAULT) ), BAD_CAST MAP_VALUE_ATTR);
                 }
                 /* Is the default set to true? */
                 if ( 0 == qsf_compare_tag_strings(output_content, QSF_XML_BOOLEAN_TEST))

Modified: gnucash/trunk/src/libqof/backend/file/qsf-xml.h
===================================================================
--- gnucash/trunk/src/libqof/backend/file/qsf-xml.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/libqof/backend/file/qsf-xml.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -73,196 +73,196 @@
 #define QSF_DEFAULT_NS	"http://qof.sourceforge.net/" /**< Default namespace for QSF root tag
 
 The map namespace is not included as maps are not currently written out by QOF.
-            */
+        */
 #define QSF_DATE_LENGTH MAX_DATE_LENGTH /**< Max length of QSF_XSD_TIME.
 
-            MAX_DATE_LENGTH itself is defined in gnc-date.h */
+        MAX_DATE_LENGTH itself is defined in gnc-date.h */
 #define QSF_BOOK_TAG	"book"      /**< First level child: book tag - the ::QofBook. */
 #define QSF_BOOK_GUID	"book-guid" /**< QOF GUID tag for the QofBook
-            described by this QSF object file */
+        described by this QSF object file */
 #define QSF_BOOK_COUNT	"count"     /**< Sequential counter of each book in this file */
 #define QSF_OBJECT_TAG	"object"    /**< Second level child: object tag */
 #define QSF_OBJECT_TYPE	"type"      /**< QSF parameter name for object type specifiers */
 #define QSF_OBJECT_COUNT "count"    /**< Sequential counter for each QSF object
-            in this file */
+        in this file */
 #define QSF_XML_VERSION  "1.0"      /**< The current XML version. */
 
-            /** @} */
-            /** @name Representing KVP as XML
+/** @} */
+/** @name Representing KVP as XML
 
-            &lt;kvp type="kvp" path="/from-sched-xaction" value="guid"&gt;c858b9a3235723b55bc1179f0e8c1322&lt;/kvp&gt;
-            A kvp type KVP parameter located at $path containing a GUID $value.
+&lt;kvp type="kvp" path="/from-sched-xaction" value="guid"&gt;c858b9a3235723b55bc1179f0e8c1322&lt;/kvp&gt;
+A kvp type KVP parameter located at $path containing a GUID $value.
 
-            The relevance of type="kvp" won't be evident in GnuCash, they all use "kvp".
+The relevance of type="kvp" won't be evident in GnuCash, they all use "kvp".
 
-            A non-GnuCash example helps:
-            &lt;kvp type="pilot_addr_kvp" path="/user/name" value="guid"&gt;c858b9a3235723b55bc1179f0e8c1322&lt;/kvp&gt;
-            A pilot_addr_kvp type KVP parameter located at /user/name containing a guid value.
-            @{ */
+A non-GnuCash example helps:
+&lt;kvp type="pilot_addr_kvp" path="/user/name" value="guid"&gt;c858b9a3235723b55bc1179f0e8c1322&lt;/kvp&gt;
+A pilot_addr_kvp type KVP parameter located at /user/name containing a guid value.
+@{ */
 
 #define QSF_OBJECT_KVP   "path" /**< The path to this KVP value in the entity frame. */
 #define QSF_OBJECT_VALUE "value" /**< The KVP Value. */
-            /** @} */
-            /** @name QSF Map XML
+/** @} */
+/** @name QSF Map XML
 
-            @{ */
+@{ */
 #define MAP_ROOT_TAG     "qsf-map" /**< Top level root tag for QSF Maps */
 #define MAP_DEFINITION_TAG "definition" /**< Second level container for defined objects 
 
-            Attributes: qof_version - Taken from the QOF_OBJECT_VERSION macro in QOF,
-            At the time of QSF development, QOF_OBJECT_VERSION is defined as 3. All
-            QSF maps and QSF objects must use the same qof_version which in turn must
-            match the QOF_OBJECT_VERSION for the QOF library in use by the calling process.
+        Attributes: qof_version - Taken from the QOF_OBJECT_VERSION macro in QOF,
+        At the time of QSF development, QOF_OBJECT_VERSION is defined as 3. All
+        QSF maps and QSF objects must use the same qof_version which in turn must
+        match the QOF_OBJECT_VERSION for the QOF library in use by the calling process.
 
-            No text content allowed.
-            */
+        No text content allowed.
+        */
 #define MAP_DEFINE_TAG	"define" /**< defines each object supported by this QSF map 
 
-            Attributes: e_type Copied directly from the QofObject definition.
-            Content: The full QofObject description for the defined QOF object.
-                */
+        Attributes: e_type Copied directly from the QofObject definition.
+        Content: The full QofObject description for the defined QOF object.
+            */
 #define MAP_ITERATE_ATTR "foreach" /**< Dictate which object type is the basis
-                for iteration in a hierarchical object set. */
+            for iteration in a hierarchical object set. */
 #define MAP_DEFAULT_TAG	"default"  /**< User editable defaults for data not
-                    available within the available QSF objects.
+                available within the available QSF objects.
 
-                    Some defaults will relate to how to format descriptive dates, whether discount
-                    should be considered, which account to use for certain QSF data from applications
-                        that do not use accounts.
+                Some defaults will relate to how to format descriptive dates, whether discount
+                should be considered, which account to use for certain QSF data from applications
+                    that do not use accounts.
 
-                            Some defaults are pre-defined and cannot be over-written:
-                            - qsf_time_now
-                            - qsf_time_string
+                        Some defaults are pre-defined and cannot be over-written:
+                        - qsf_time_now
+                        - qsf_time_string
 
-                            Attributes (All are mandatory):
+                        Attributes (All are mandatory):
 
-                                \a name The text name for this default. Certain pre-defined defaults exist but
-                                user- or map-defined defaults can have any unique text name. Spaces are \b NOT allowed,
-                                use undersccores instead. The value of name must not duplicate any existing default,
-                                define, object or parameter unless the special type, enum, is used.
+                            \a name The text name for this default. Certain pre-defined defaults exist but
+                            user- or map-defined defaults can have any unique text name. Spaces are \b NOT allowed,
+                            use undersccores instead. The value of name must not duplicate any existing default,
+                            define, object or parameter unless the special type, enum, is used.
 
-                                \a type QOF_TYPE - must be one of the recognised QOF data types for the
-                                    qof_version in use or the special type, enum.
+                            \a type QOF_TYPE - must be one of the recognised QOF data types for the
+                                qof_version in use or the special type, enum.
 
-                                    \a value Text representation of the required value. For numeric, use the format
-                                    [0-9]?/[0-9]?
+                                \a value Text representation of the required value. For numeric, use the format
+                                [0-9]?/[0-9]?
 
-                                        \attention Using boolean defaults
+                                    \attention Using boolean defaults
 
-                                    A boolean default is not output in the QSF directly, instead the value is
-                                        used in the calculations to modify certain values. If the boolean default
-                                                is set to true, the if statement containing the boolean name will be evaluated.
-                                            If the boolean default is set to false, the corresponding else will be evaluted.
-                                                        Make sure your calculations contain an appropriate else statement so that the
-                                                            boolean value can be adjusted without invalidating the map!
+                                A boolean default is not output in the QSF directly, instead the value is
+                                    used in the calculations to modify certain values. If the boolean default
+                                            is set to true, the if statement containing the boolean name will be evaluated.
+                                        If the boolean default is set to false, the corresponding else will be evaluted.
+                                                    Make sure your calculations contain an appropriate else statement so that the
+                                                        boolean value can be adjusted without invalidating the map!
 
-                                                            QSF deals with partial QofBooks - each object is fully described but the
-                                                            book does not have to contain any specific object types or have any
-                                                            particular structure. To merge partial books into usual QofBook data
-                                                            sources, the map must deal with entities that need to be referenced in
-                                                            the target QofBook but which simply do not exist in the QofBook used to generate
-                                                                the QSF. e.g. pilot-link knows nothing of Accounts yet when QSF creates
-                                                                a gncInvoice from qof-datebook, gncInvoice needs to know the GUID of
-                                                                certain accounts in the target QofBook. This is handled in the map
-                                                            by specifying the name of the account as a default for that map. When imported,
-                                                                        the QSF QofBackend looks up the object required using the name of
-                                                                        the parameter to obtain the parameter type. This is the only situation
-                                                                        where QSF converts between QOF data types. A string description of the
-                                                                        required object is converted to the GUID for that specific entity. The
-                                                                            map cannot contain the GUID as it is generic and used by multiple users.
+                                                        QSF deals with partial QofBooks - each object is fully described but the
+                                                        book does not have to contain any specific object types or have any
+                                                        particular structure. To merge partial books into usual QofBook data
+                                                        sources, the map must deal with entities that need to be referenced in
+                                                        the target QofBook but which simply do not exist in the QofBook used to generate
+                                                            the QSF. e.g. pilot-link knows nothing of Accounts yet when QSF creates
+                                                            a gncInvoice from qof-datebook, gncInvoice needs to know the GUID of
+                                                            certain accounts in the target QofBook. This is handled in the map
+                                                        by specifying the name of the account as a default for that map. When imported,
+                                                                    the QSF QofBackend looks up the object required using the name of
+                                                                    the parameter to obtain the parameter type. This is the only situation
+                                                                    where QSF converts between QOF data types. A string description of the
+                                                                    required object is converted to the GUID for that specific entity. The
+                                                                        map cannot contain the GUID as it is generic and used by multiple users.
 
-                                                                            \attention Using enumerators
-                                                                            - enum types are the only defaults that are allowed to use the same name value
-                                                                            more than once.
-                                                                            - enum types are used to increase the readability of a QSF map.
-                                                                            - The enum name acts to group the enum values together - in a similar fashion to
-                                                                            radio buttons in HTML forms.
-                                                                            - enum types are used only where the QOF object itself uses an enum type.
+                                                                        \attention Using enumerators
+                                                                        - enum types are the only defaults that are allowed to use the same name value
+                                                                        more than once.
+                                                                        - enum types are used to increase the readability of a QSF map.
+                                                                        - The enum name acts to group the enum values together - in a similar fashion to
+                                                                        radio buttons in HTML forms.
+                                                                        - enum types are used only where the QOF object itself uses an enum type.
 
-                                                                            e.g. the tax_included enum type allows maps to use the full name of the enum
-                                                                            value GNC_TAXINCLUDED_YES, instead of the cryptic digit value, 1.
+                                                                        e.g. the tax_included enum type allows maps to use the full name of the enum
+                                                                        value GNC_TAXINCLUDED_YES, instead of the cryptic digit value, 1.
 
-                                                                            */
+                                                                        */
 #define MAP_OBJECT_TAG	"object" /**< Contains all the calculations to make one
-                                                                            object from others.
+                                                                        object from others.
 
-                                                                            Note that creating an object for the import application can involve using data
-                                                                                from more than one QSF object, as well as defaults and lookups in the import
-                                                                                application itself. Conditionals, simple arithmetic and date/time formatting
-                                                                                options are also available.
-                                                                                */
+                                                                        Note that creating an object for the import application can involve using data
+                                                                            from more than one QSF object, as well as defaults and lookups in the import
+                                                                            application itself. Conditionals, simple arithmetic and date/time formatting
+                                                                            options are also available.
+                                                                            */
 #define MAP_CALCULATE_TAG	"calculate" /**< One calculation for every parameter
-                                                                                that needs to be set.
+                                                                            that needs to be set.
 
-                                                                                QSF follows the same rule as qof_book_merge. Only if a getter and a setter
-                                                                                    function are defined for a parameter is it available to QSF. If a ::QofAccessFunc
-                                                                                        and ::QofSetterFunc are both defined for any QofObject parameter, that parameter
-                                                                                            \b MUST be calculated in any map that defines that object.
-                                                                                            */
+                                                                            QSF follows the same rule as qof_book_merge. Only if a getter and a setter
+                                                                                function are defined for a parameter is it available to QSF. If a ::QofAccessFunc
+                                                                                    and ::QofSetterFunc are both defined for any QofObject parameter, that parameter
+                                                                                        \b MUST be calculated in any map that defines that object.
+                                                                                        */
 #define MAP_QOF_VERSION	"qof_version" /**< This is the QOF_OBJECT_VERSION from QOF.
 
-                                                                                            QSF maps may need to be updated if QOF itself is upgraded. This setting is coded
-                                                                                                into QOF and maps for one version cannot necessarily be used by other versions.
-                                                                                                    At the first release of QSF, QOF_OBJECT_VERSION = 3.
-                                                                                                            */
+                                                                                        QSF maps may need to be updated if QOF itself is upgraded. This setting is coded
+                                                                                            into QOF and maps for one version cannot necessarily be used by other versions.
+                                                                                                At the first release of QSF, QOF_OBJECT_VERSION = 3.
+                                                                                                        */
 #define MAP_NAME_ATTR	"name" /**< The name of the default setting.
 
-                                                                                                        Use this name to refer to the value of this default in the map calculations.
+                                                                                                    Use this name to refer to the value of this default in the map calculations.
 
-                                                                                                            Make sure that the type of this default matches the type of the parameter being
-                                                                                                                    set by the parent calculation!
-                                                                                                                    */
+                                                                                                        Make sure that the type of this default matches the type of the parameter being
+                                                                                                                set by the parent calculation!
+                                                                                                                */
 #define MAP_TYPE_ATTR	"type" /**< QSF will NOT convert between QOF types.
 
-                                                                                                                    QSF will allow a conditional to use a parameter of one type to determine the
-                                                                                                                    value from a parameter of another type, but the final value assigned \b MUST be
-                                                                                                                    of the same type as the parent calculation.
-                                                                                                                    */
+                                                                                                                QSF will allow a conditional to use a parameter of one type to determine the
+                                                                                                                value from a parameter of another type, but the final value assigned \b MUST be
+                                                                                                                of the same type as the parent calculation.
+                                                                                                                */
 #define MAP_VALUE_ATTR	"value" /**< The value of the tag, used in defaults and
-                                                                                                                    calculations.
+                                                                                                                calculations.
 
-                                                                                                                The value of a default is a string representation of the value to be inserted into
-                                                                                                                    the calculation where the default is used.
+                                                                                                            The value of a default is a string representation of the value to be inserted into
+                                                                                                                the calculation where the default is used.
 
-                                                                                                                            The value of a calculation is the name of the parameter that will be set by that
-                                                                                                                            calculation.
-                                                                                                                            */
+                                                                                                                        The value of a calculation is the name of the parameter that will be set by that
+                                                                                                                        calculation.
+                                                                                                                        */
 #define MAP_OBJECT_ATTR "object" /**< The object to use to provide the data
-                                                                                                                            being set using the map.*/
+                                                                                                                        being set using the map.*/
 #define MAP_E_TYPE	"e_type" /**< Validates the objects defined in the map 
 
-                                                                                                                            The e_type will be used to match incoming QSF objects with the relevant QSF map.
-                                                                                                                            The value of the e_type must be the value of the e_type for that object in the
-                                                                                                                                originating QOF application. The define tag must contain the value of the description
-                                                                                                                                of the same object in the same originating QOF application.
-                                                                                                                                */
-                                                                                                                                /** \todo enum is an attempt to make enumerator values descriptive in the maps
-                                                                                                                                and QSF (possibly). Not working yet. */
+                                                                                                                        The e_type will be used to match incoming QSF objects with the relevant QSF map.
+                                                                                                                        The value of the e_type must be the value of the e_type for that object in the
+                                                                                                                            originating QOF application. The define tag must contain the value of the description
+                                                                                                                            of the same object in the same originating QOF application.
+                                                                                                                            */
+                                                                                                                    /** \todo enum is an attempt to make enumerator values descriptive in the maps
+                                                                                                                    and QSF (possibly). Not working yet. */
 #define MAP_ENUM_TYPE "enum"
 
-                                                                                                                                /** \brief A specific boolean default for this map.
-                                                                                                                                */
+                                                                                                                    /** \brief A specific boolean default for this map.
+                                                                                                                    */
 #define QSF_BOOLEAN_DEFAULT "boolean"
 
 #define QSF_CONDITIONAL "if"  /**< child of calculate.
 
-                                                                                                                                Conditionals can reference objects as if within the original application. In operation,
-                                                                                                                                    the map is overlaid across both sets of defined objects, an import object in the source
-                                                                                                                                    application and an output object for the destination object. The current import and output
-                                                                                                                                        QSF objects are therefore always available to the map.
-                                                                                                                                        Conditionals can reference parameter as well as object values.
-                                                                                                                                        */
+                                                                                                                            Conditionals can reference objects as if within the original application. In operation,
+                                                                                                                                the map is overlaid across both sets of defined objects, an import object in the source
+                                                                                                                                application and an output object for the destination object. The current import and output
+                                                                                                                                    QSF objects are therefore always available to the map.
+                                                                                                                                    Conditionals can reference parameter as well as object values.
+                                                                                                                                    */
 #define QSF_CONDITIONAL_SET "set" /**< Assignment statement
 
-                                                                                                                                        Map assignments can use the native values within the output object. The output object
-                                                                                                                                        must support setting the relevant parameter using the value exactly as given in the map
-                                                                                                                                        because the relevant set() function will be called using this value. This may reduce the
-                                                                                                                                            readability of the map but the relevant application could also be modified to support
-                                                                                                                                            a more readable set function.
-                                                                                                                                            */
+                                                                                                                                    Map assignments can use the native values within the output object. The output object
+                                                                                                                                    must support setting the relevant parameter using the value exactly as given in the map
+                                                                                                                                    because the relevant set() function will be called using this value. This may reduce the
+                                                                                                                                        readability of the map but the relevant application could also be modified to support
+                                                                                                                                        a more readable set function.
+                                                                                                                                        */
 #define QSF_CONDITIONAL_ELSE "else" /**< Alternative
 
-                                                                                                                                    if(){} else{} is also supported. Nesting of conditionals causes problems for
+                                                                                                                                        if(){} else{} is also supported. Nesting of conditionals causes problems for
 validating the final map against any sensible XML Schema and a map that does not
 validate will be rejected. When editing conditionals in a QSF map, ALWAYS
 validate the map using xmllint. If necessary, define a variable at the foot of

Modified: gnucash/trunk/src/libqof/qof/gnc-date.c
===================================================================
--- gnucash/trunk/src/libqof/qof/gnc-date.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/libqof/qof/gnc-date.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -339,7 +339,8 @@
         dateFormat = df;
     }
     else
-    {    /* hack alert - Use a neutral default. */
+    {
+        /* hack alert - Use a neutral default. */
         PERR("non-existent date format set attempted. Setting ISO default");
         prevQofDateFormat = dateFormat;
         dateFormat = QOF_DATE_FORMAT_ISO;
@@ -859,7 +860,8 @@
         if (locale_separator != '\0')
             return locale_separator;
         else
-        { /* Make a guess */
+        {
+            /* Make a guess */
             gchar string[256];
             struct tm tm;
             time_t secs;

Modified: gnucash/trunk/src/libqof/qof/gnc-numeric.c
===================================================================
--- gnucash/trunk/src/libqof/qof/gnc-numeric.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/libqof/qof/gnc-numeric.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -925,7 +925,7 @@
         case GNC_HOW_RND_ROUND_HALF_DOWN:
             if (denom_neg)
             {
-                if ((2 * remainder) > in.denom*denom)
+                if ((2 * remainder) > in.denom * denom)
                 {
                     out.num = out.num + 1;
                 }
@@ -945,7 +945,7 @@
         case GNC_HOW_RND_ROUND_HALF_UP:
             if (denom_neg)
             {
-                if ((2 * remainder) >= in.denom*denom)
+                if ((2 * remainder) >= in.denom * denom)
                 {
                     out.num = out.num + 1;
                 }
@@ -965,11 +965,11 @@
         case GNC_HOW_RND_ROUND:
             if (denom_neg)
             {
-                if ((2 * remainder) > in.denom*denom)
+                if ((2 * remainder) > in.denom * denom)
                 {
                     out.num = out.num + 1;
                 }
-                else if ((2 * remainder) == in.denom*denom)
+                else if ((2 * remainder) == in.denom * denom)
                 {
                     if (out.num % 2)
                     {

Modified: gnucash/trunk/src/libqof/qof/guid.c
===================================================================
--- gnucash/trunk/src/libqof/qof/guid.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/libqof/qof/guid.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -368,17 +368,18 @@
     /* files */
     {
         const char * files[] =
-            { "/etc/passwd",
-              "/proc/loadavg",
-              "/proc/meminfo",
-              "/proc/net/dev",
-              "/proc/rtc",
-              "/proc/self/environ",
-              "/proc/self/stat",
-              "/proc/stat",
-              "/proc/uptime",
-              NULL
-            };
+        {
+            "/etc/passwd",
+            "/proc/loadavg",
+            "/proc/meminfo",
+            "/proc/net/dev",
+            "/proc/rtc",
+            "/proc/self/environ",
+            "/proc/self/stat",
+            "/proc/stat",
+            "/proc/uptime",
+            NULL
+        };
         int i;
 
         for (i = 0; files[i] != NULL; i++)
@@ -546,7 +547,7 @@
     * Something must be broken somewhere, and merely adding more salt
     * is just hiding the problem, not fixing it.
     */
-    init_from_int (433781*counter);
+    init_from_int (433781 * counter);
     init_from_buff (guid->data, GUID_DATA_SIZE);
 
     if (counter == 0)

Modified: gnucash/trunk/src/libqof/qof/kvp_frame.h
===================================================================
--- gnucash/trunk/src/libqof/qof/kvp_frame.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/libqof/qof/kvp_frame.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -681,8 +681,8 @@
    recursive call if desired. */
 void kvp_frame_for_each_slot(KvpFrame *f,
                              void (*proc)(const gchar *key,
-                                          KvpValue *value,
-                                          gpointer data),
+                                     KvpValue *value,
+                                     gpointer data),
                              gpointer data);
 
 /** @} */

Modified: gnucash/trunk/src/libqof/qof/qofbackend.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofbackend.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/libqof/qof/qofbackend.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -332,7 +332,8 @@
         return;
     }
     switch (option.type)
-    { /* set the KvpFrame value into the option */
+    {
+        /* set the KvpFrame value into the option */
     case KVP_TYPE_GINT64   :
     {
         int64 = kvp_value_get_gint64(value);
@@ -389,7 +390,8 @@
     /* manipulate the option */
     helper->fcn (&option, helper->data);
     switch (option.type)
-    { /* set the option value into the KvpFrame */
+    {
+        /* set the option value into the KvpFrame */
     case KVP_TYPE_GINT64   :
     {
         kvp_frame_set_gint64(helper->recursive, key,

Modified: gnucash/trunk/src/libqof/qof/qofbook.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofbook.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/libqof/qof/qofbook.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -262,9 +262,9 @@
 
 void qof_book_kvp_changed (QofBook *book)
 {
-	qof_book_begin_edit(book);
+    qof_book_begin_edit(book);
     qof_book_mark_dirty(book);
-	qof_book_commit_edit(book);
+    qof_book_commit_edit(book);
 }
 
 /* ====================================================================== */
@@ -475,28 +475,28 @@
 {
     qof_book_begin_edit(book);
     kvp_frame_set_string(qof_book_get_slots(book), opt_name, opt_val);
-	qof_book_mark_dirty(book);
+    qof_book_mark_dirty(book);
     qof_book_commit_edit(book);
 }
 
 void
 qof_book_begin_edit (QofBook *book)
 {
-  qof_begin_edit(&book->inst);
+    qof_begin_edit(&book->inst);
 }
 
 static void commit_err (QofInstance *inst, QofBackendError errcode)
 {
-  PERR ("Failed to commit: %d", errcode);
+    PERR ("Failed to commit: %d", errcode);
 //  gnc_engine_signal_commit_error( errcode );
 }
 
 #if 0
 static void lot_free(QofInstance* inst)
 {
-	GNCLot* lot = GNC_LOT(inst);
+    GNCLot* lot = GNC_LOT(inst);
 
-	gnc_lot_free(lot);
+    gnc_lot_free(lot);
 }
 #endif
 
@@ -505,8 +505,8 @@
 void
 qof_book_commit_edit(QofBook *book)
 {
-  if (!qof_commit_edit (QOF_INSTANCE(book))) return;
-  qof_commit_edit_part2 (&book->inst, commit_err, noop, noop/*lot_free*/);
+    if (!qof_commit_edit (QOF_INSTANCE(book))) return;
+    qof_commit_edit_part2 (&book->inst, commit_err, noop, noop/*lot_free*/);
 }
 
 /* QofObject function implementation and registration */

Modified: gnucash/trunk/src/libqof/qof/qofbookmerge.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofbookmerge.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/libqof/qof/qofbookmerge.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -108,7 +108,7 @@
     QofType    mergeType;
     GSList    *paramList;
     gboolean  absolute, mergeError, knowntype, mergeMatch, booleanImport, booleanTarget,
-    (*boolean_getter) (QofInstance*, QofParam*);
+           (*boolean_getter) (QofInstance*, QofParam*);
     Timespec      tsImport, tsTarget,            (*date_getter)    (QofInstance*, QofParam*);
     gnc_numeric   numericImport, numericTarget,  (*numeric_getter) (QofInstance*, QofParam*);
     double        doubleImport, doubleTarget,    (*double_getter)  (QofInstance*, QofParam*);

Modified: gnucash/trunk/src/libqof/qof/qofquerycore.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofquerycore.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/libqof/qof/qofquerycore.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -474,8 +474,8 @@
         compare =
             (gnc_numeric_compare (gnc_numeric_abs
                                   (gnc_numeric_sub (gnc_numeric_abs (obj_val),
-                                                    gnc_numeric_abs (pdata->amount),
-                                                    100000, GNC_HOW_RND_ROUND)),
+                                          gnc_numeric_abs (pdata->amount),
+                                          100000, GNC_HOW_RND_ROUND)),
                                   cmp_val) < 0);
     }
     else
@@ -1738,43 +1738,69 @@
         QueryPredicateEqual    pred_equal;
     } knownTypes[] =
     {
-        { QOF_TYPE_STRING, string_match_predicate, string_compare_func,
+        {
+            QOF_TYPE_STRING, string_match_predicate, string_compare_func,
             string_copy_predicate, string_free_pdata, string_to_string,
-            string_predicate_equal },
-        { QOF_TYPE_DATE, date_match_predicate, date_compare_func,
-          date_copy_predicate, date_free_pdata, date_to_string,
-          date_predicate_equal },
-        { QOF_TYPE_DEBCRED, numeric_match_predicate, numeric_compare_func,
-          numeric_copy_predicate, numeric_free_pdata, debcred_to_string,
-          numeric_predicate_equal },
-        { QOF_TYPE_NUMERIC, numeric_match_predicate, numeric_compare_func,
-          numeric_copy_predicate, numeric_free_pdata, numeric_to_string,
-          numeric_predicate_equal },
-        { QOF_TYPE_GUID, guid_match_predicate, NULL,
-          guid_copy_predicate, guid_free_pdata, NULL,
-          guid_predicate_equal },
-        { QOF_TYPE_INT32, int32_match_predicate, int32_compare_func,
-          int32_copy_predicate, int32_free_pdata, int32_to_string,
-          int32_predicate_equal },
-        { QOF_TYPE_INT64, int64_match_predicate, int64_compare_func,
-          int64_copy_predicate, int64_free_pdata, int64_to_string,
-          int64_predicate_equal },
-        { QOF_TYPE_DOUBLE, double_match_predicate, double_compare_func,
-          double_copy_predicate, double_free_pdata, double_to_string,
-          double_predicate_equal },
-        { QOF_TYPE_BOOLEAN, boolean_match_predicate, boolean_compare_func,
-          boolean_copy_predicate, boolean_free_pdata, boolean_to_string,
-          boolean_predicate_equal },
-        { QOF_TYPE_CHAR, char_match_predicate, char_compare_func,
-          char_copy_predicate, char_free_pdata, char_to_string,
-          char_predicate_equal },
-        { QOF_TYPE_KVP, kvp_match_predicate, NULL, kvp_copy_predicate,
-          kvp_free_pdata, NULL, kvp_predicate_equal },
-        { QOF_TYPE_COLLECT, collect_match_predicate, collect_compare_func,
-          collect_copy_predicate, collect_free_pdata, NULL,
-          collect_predicate_equal },
-        { QOF_TYPE_CHOICE, choice_match_predicate, NULL,
-          choice_copy_predicate, choice_free_pdata, NULL, choice_predicate_equal },
+            string_predicate_equal
+        },
+        {
+            QOF_TYPE_DATE, date_match_predicate, date_compare_func,
+            date_copy_predicate, date_free_pdata, date_to_string,
+            date_predicate_equal
+        },
+        {
+            QOF_TYPE_DEBCRED, numeric_match_predicate, numeric_compare_func,
+            numeric_copy_predicate, numeric_free_pdata, debcred_to_string,
+            numeric_predicate_equal
+        },
+        {
+            QOF_TYPE_NUMERIC, numeric_match_predicate, numeric_compare_func,
+            numeric_copy_predicate, numeric_free_pdata, numeric_to_string,
+            numeric_predicate_equal
+        },
+        {
+            QOF_TYPE_GUID, guid_match_predicate, NULL,
+            guid_copy_predicate, guid_free_pdata, NULL,
+            guid_predicate_equal
+        },
+        {
+            QOF_TYPE_INT32, int32_match_predicate, int32_compare_func,
+            int32_copy_predicate, int32_free_pdata, int32_to_string,
+            int32_predicate_equal
+        },
+        {
+            QOF_TYPE_INT64, int64_match_predicate, int64_compare_func,
+            int64_copy_predicate, int64_free_pdata, int64_to_string,
+            int64_predicate_equal
+        },
+        {
+            QOF_TYPE_DOUBLE, double_match_predicate, double_compare_func,
+            double_copy_predicate, double_free_pdata, double_to_string,
+            double_predicate_equal
+        },
+        {
+            QOF_TYPE_BOOLEAN, boolean_match_predicate, boolean_compare_func,
+            boolean_copy_predicate, boolean_free_pdata, boolean_to_string,
+            boolean_predicate_equal
+        },
+        {
+            QOF_TYPE_CHAR, char_match_predicate, char_compare_func,
+            char_copy_predicate, char_free_pdata, char_to_string,
+            char_predicate_equal
+        },
+        {
+            QOF_TYPE_KVP, kvp_match_predicate, NULL, kvp_copy_predicate,
+            kvp_free_pdata, NULL, kvp_predicate_equal
+        },
+        {
+            QOF_TYPE_COLLECT, collect_match_predicate, collect_compare_func,
+            collect_copy_predicate, collect_free_pdata, NULL,
+            collect_predicate_equal
+        },
+        {
+            QOF_TYPE_CHOICE, choice_match_predicate, NULL,
+            choice_copy_predicate, choice_free_pdata, NULL, choice_predicate_equal
+        },
     };
 
     /* Register the known data types */

Modified: gnucash/trunk/src/register/ledger-core/gncmod-ledger-core.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/gncmod-ledger-core.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/register/ledger-core/gncmod-ledger-core.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -22,31 +22,34 @@
 
 
 char *
-libgncmod_ledger_core_gnc_module_path(void) {
-  return g_strdup("gnucash/register/ledger-core");
+libgncmod_ledger_core_gnc_module_path(void)
+{
+    return g_strdup("gnucash/register/ledger-core");
 }
 
 char *
-libgncmod_ledger_core_gnc_module_description(void) {
-  return g_strdup("Toolkit-independent GUI for financial ledgers");
+libgncmod_ledger_core_gnc_module_description(void)
+{
+    return g_strdup("Toolkit-independent GUI for financial ledgers");
 }
 
 int
-libgncmod_ledger_core_gnc_module_init(int refcount) {
-  if(!gnc_module_load("gnucash/engine", 0))
-  {
-    return FALSE;
-  }
+libgncmod_ledger_core_gnc_module_init(int refcount)
+{
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
 
-  if(!gnc_module_load("gnucash/register/register-core", 0))
-  {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/register/register-core", 0))
+    {
+        return FALSE;
+    }
 
-  if(!gnc_module_load("gnucash/app-utils", 0))
-  {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
 
-  return TRUE;
+    return TRUE;
 }

Modified: gnucash/trunk/src/register/ledger-core/test/test-link-module.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/test/test-link-module.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/register/ledger-core/test/test-link-module.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,6 +1,7 @@
 #include <stdlib.h>
 
 int
-main(int argc, char ** argv) {
-  exit(0);
+main(int argc, char ** argv)
+{
+    exit(0);
 }

Modified: gnucash/trunk/src/register/register-core/gncmod-register-core.c
===================================================================
--- gnucash/trunk/src/register/register-core/gncmod-register-core.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/register/register-core/gncmod-register-core.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,29 +24,31 @@
 
 
 char *
-libgncmod_register_core_gnc_module_path(void) {
-  return g_strdup("gnucash/register/register-core");
+libgncmod_register_core_gnc_module_path(void)
+{
+    return g_strdup("gnucash/register/register-core");
 }
 
 char *
-libgncmod_register_core_gnc_module_description(void) {
-  return g_strdup("Toolkit-independent GUI for ledger-like table displays");
+libgncmod_register_core_gnc_module_description(void)
+{
+    return g_strdup("Toolkit-independent GUI for ledger-like table displays");
 }
 
 int
 libgncmod_register_core_gnc_module_init(int refcount)
 {
-  if(!gnc_module_load("gnucash/engine", 0))
-  {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
 
-  /* FIXME. We need this for the wide-character functions.
-   * When fixing, get rid of gnome-utils includes, too. */
-  if(!gnc_module_load("gnucash/gnome-utils", 0))
-  {
-    return FALSE;
-  }
+    /* FIXME. We need this for the wide-character functions.
+     * When fixing, get rid of gnome-utils includes, too. */
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
 
-  return TRUE;
+    return TRUE;
 }

Modified: gnucash/trunk/src/register/register-gnome/gncmod-register-gnome.c
===================================================================
--- gnucash/trunk/src/register/register-gnome/gncmod-register-gnome.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/register/register-gnome/gncmod-register-gnome.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -31,42 +31,47 @@
 
 
 char *
-libgncmod_register_gnome_gnc_module_path(void) {
-  return g_strdup("gnucash/register/register-gnome");
+libgncmod_register_gnome_gnc_module_path(void)
+{
+    return g_strdup("gnucash/register/register-gnome");
 }
 
 char *
-libgncmod_register_gnome_gnc_module_description(void) {
-  return g_strdup("Gnome GUI for ledger-like table displays");
+libgncmod_register_gnome_gnc_module_description(void)
+{
+    return g_strdup("Gnome GUI for ledger-like table displays");
 }
 
 int
-libgncmod_register_gnome_gnc_module_init(int refcount) {
-  if(!gnc_module_load("gnucash/register/register-core", 0)) {
-    return FALSE;
-  }
+libgncmod_register_gnome_gnc_module_init(int refcount)
+{
+    if (!gnc_module_load("gnucash/register/register-core", 0))
+    {
+        return FALSE;
+    }
 
-  if(!gnc_module_load("gnucash/gnome-utils", 0)) {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
 
-  if (refcount == 0)
-  {
-    gnc_register_add_cell_type (COMBO_CELL_TYPE_NAME, gnc_combo_cell_new);
+    if (refcount == 0)
+    {
+        gnc_register_add_cell_type (COMBO_CELL_TYPE_NAME, gnc_combo_cell_new);
 
-    gnc_register_add_cell_type (DATE_CELL_TYPE_NAME, gnc_date_cell_new);
+        gnc_register_add_cell_type (DATE_CELL_TYPE_NAME, gnc_date_cell_new);
 
-    gnc_register_add_cell_type (PRICE_CELL_TYPE_NAME,
-                                gnc_price_cell_gnome_new);
+        gnc_register_add_cell_type (PRICE_CELL_TYPE_NAME,
+                                    gnc_price_cell_gnome_new);
 
-    gnc_register_add_cell_type (QUICKFILL_CELL_TYPE_NAME,
-                                gnc_quickfill_cell_gnome_new);
+        gnc_register_add_cell_type (QUICKFILL_CELL_TYPE_NAME,
+                                    gnc_quickfill_cell_gnome_new);
 
-    gnc_register_add_cell_type( FORMULA_CELL_TYPE_NAME,
-                                gnc_formula_cell_gnome_new );
+        gnc_register_add_cell_type( FORMULA_CELL_TYPE_NAME,
+                                    gnc_formula_cell_gnome_new );
 
-    gnc_table_gnome_init ();
-  }
+        gnc_table_gnome_init ();
+    }
 
-  return TRUE;
+    return TRUE;
 }

Modified: gnucash/trunk/src/report/locale-specific/us/gncmod-locale-reports-us.c
===================================================================
--- gnucash/trunk/src/report/locale-specific/us/gncmod-locale-reports-us.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/locale-specific/us/gncmod-locale-reports-us.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -28,76 +28,87 @@
 
 
 char *
-libgncmod_locale_reports_us_gnc_module_path(void) {
-  /* const char *thislocale = setlocale(LC_ALL, NULL);
-  if (strncmp(thislocale, "de_DE", 5) == 0)
-    return g_strdup("gnucash/report/locale-specific/de_DE");
-    else */
-  return g_strdup("gnucash/report/locale-specific/us");
+libgncmod_locale_reports_us_gnc_module_path(void)
+{
+    /* const char *thislocale = setlocale(LC_ALL, NULL);
+    if (strncmp(thislocale, "de_DE", 5) == 0)
+      return g_strdup("gnucash/report/locale-specific/de_DE");
+      else */
+    return g_strdup("gnucash/report/locale-specific/us");
 }
 
 char *
-libgncmod_locale_reports_us_gnc_module_description(void) {
-  return g_strdup("US income tax reports and related material");
+libgncmod_locale_reports_us_gnc_module_description(void)
+{
+    return g_strdup("US income tax reports and related material");
 }
 
 int
-libgncmod_locale_reports_us_gnc_module_init(int refcount) {
-  const gchar *tax_module, *report_taxtxf, *report_locale;
-  /* load the tax info */
+libgncmod_locale_reports_us_gnc_module_init(int refcount)
+{
+    const gchar *tax_module, *report_taxtxf, *report_locale;
+    /* load the tax info */
 #ifdef LOCALE_SPECIFIC_TAX
-  /* This is a very simple hack that loads the (new, special) German
-     tax definition file in a German locale, or (default) loads the
-     previous US tax file. */
+    /* This is a very simple hack that loads the (new, special) German
+       tax definition file in a German locale, or (default) loads the
+       previous US tax file. */
 # ifdef G_OS_WIN32
-  gchar *thislocale = g_win32_getlocale();
-  gboolean is_de_DE = (strncmp(thislocale, "de_DE", 5) == 0);
-  g_free(thislocale);
+    gchar *thislocale = g_win32_getlocale();
+    gboolean is_de_DE = (strncmp(thislocale, "de_DE", 5) == 0);
+    g_free(thislocale);
 # else /* !G_OS_WIN32 */
-  const char *thislocale = setlocale(LC_ALL, NULL);
-  gboolean is_de_DE = (strncmp(thislocale, "de_DE", 5) == 0);
+    const char *thislocale = setlocale(LC_ALL, NULL);
+    gboolean is_de_DE = (strncmp(thislocale, "de_DE", 5) == 0);
 # endif /* G_OS_WIN32 */
 #else /* !LOCALE_SPECIFIC_TAX */
-  gboolean is_de_DE = FALSE;
+    gboolean is_de_DE = FALSE;
 #endif /* LOCALE_SPECIFIC_TAX */
-  if (is_de_DE) {
-    tax_module = "gnucash/tax/de_DE";
-    report_taxtxf = "(use-modules (gnucash report taxtxf-de_DE))";
-    report_locale = "(use-modules (gnucash report locale-specific de_DE))";
-  } else {
-    tax_module = "gnucash/tax/us";
-    report_taxtxf = "(use-modules (gnucash report taxtxf))";
-    report_locale = "(use-modules (gnucash report locale-specific us))";
-  }
+    if (is_de_DE)
+    {
+        tax_module = "gnucash/tax/de_DE";
+        report_taxtxf = "(use-modules (gnucash report taxtxf-de_DE))";
+        report_locale = "(use-modules (gnucash report locale-specific de_DE))";
+    }
+    else
+    {
+        tax_module = "gnucash/tax/us";
+        report_taxtxf = "(use-modules (gnucash report taxtxf))";
+        report_locale = "(use-modules (gnucash report locale-specific us))";
+    }
 
-  /* The gchar* cast is only because the function declaration expects
-     a non-const string -- probably an api error. */
-  if(!gnc_module_load((gchar*)tax_module, 0)) {
-    return FALSE;
-  }
+    /* The gchar* cast is only because the function declaration expects
+       a non-const string -- probably an api error. */
+    if (!gnc_module_load((gchar*)tax_module, 0))
+    {
+        return FALSE;
+    }
 
-  /* load the report system */
-  if(!gnc_module_load("gnucash/report/report-system", 0)) {
-    return FALSE;
-  }
+    /* load the report system */
+    if (!gnc_module_load("gnucash/report/report-system", 0))
+    {
+        return FALSE;
+    }
 
-  /* load the report generation scheme code */
-  if(scm_c_eval_string(report_taxtxf)
-     == SCM_BOOL_F) {
-    g_warning("failed to load %s\n", report_taxtxf);
-    return FALSE;
-  }
+    /* load the report generation scheme code */
+    if (scm_c_eval_string(report_taxtxf)
+            == SCM_BOOL_F)
+    {
+        g_warning("failed to load %s\n", report_taxtxf);
+        return FALSE;
+    }
 
-  /* Load the module scheme code */
-  if(scm_c_eval_string(report_locale)
-     == SCM_BOOL_F) {
-    return FALSE;
-  }
+    /* Load the module scheme code */
+    if (scm_c_eval_string(report_locale)
+            == SCM_BOOL_F)
+    {
+        return FALSE;
+    }
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_locale_reports_us_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_locale_reports_us_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/report/locale-specific/us/test/test-link-module.c
===================================================================
--- gnucash/trunk/src/report/locale-specific/us/test/test-link-module.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/locale-specific/us/test/test-link-module.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,6 +1,6 @@
 int
-main(int argc, char ** argv) 
+main(int argc, char ** argv)
 {
-  return 0;
+    return 0;
 }
 

Modified: gnucash/trunk/src/report/report-gnome/dialog-column-view.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-column-view.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-gnome/dialog-column-view.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -35,584 +35,612 @@
 #include "guile-mappings.h"
 #include "gnc-report.h"
 
-enum available_cols {
-  AVAILABLE_COL_NAME = 0,
-  AVAILABLE_COL_ROW,
-  NUM_AVAILABLE_COLS
+enum available_cols
+{
+    AVAILABLE_COL_NAME = 0,
+    AVAILABLE_COL_ROW,
+    NUM_AVAILABLE_COLS
 };
 
-enum contents_cols {
-  CONTENTS_COL_NAME = 0,
-  CONTENTS_COL_ROW,
-  CONTENTS_COL_REPORT_ROWS,
-  CONTENTS_COL_REPORT_COLS,
-  NUM_CONTENTS_COLS
+enum contents_cols
+{
+    CONTENTS_COL_NAME = 0,
+    CONTENTS_COL_ROW,
+    CONTENTS_COL_REPORT_ROWS,
+    CONTENTS_COL_REPORT_COLS,
+    NUM_CONTENTS_COLS
 };
 
-struct gncp_column_view_edit {
-  GNCOptionWin * optwin;
-  GtkTreeView  * available;
-  GtkTreeView  * contents; 
+struct gncp_column_view_edit
+{
+    GNCOptionWin * optwin;
+    GtkTreeView  * available;
+    GtkTreeView  * contents;
 
-  SCM          options; 
-  SCM          view;
-  GNCOptionDB  * odb;
+    SCM          options;
+    SCM          view;
+    GNCOptionDB  * odb;
 
-  SCM       available_list;
-  int       available_selected;
+    SCM       available_list;
+    int       available_selected;
 
-  SCM       contents_list;
-  int       contents_selected;
+    SCM       contents_list;
+    int       contents_selected;
 };
 
 static void gnc_column_view_edit_add_cb(GtkButton * button,
                                         gpointer user_data);
 static void gnc_column_view_edit_remove_cb(GtkButton * button,
-                                           gpointer user_data);
+        gpointer user_data);
 static void gnc_edit_column_view_move_up_cb(GtkButton * button,
-                                            gpointer user_data);
+        gpointer user_data);
 static void gnc_edit_column_view_move_down_cb(GtkButton * button,
-                                              gpointer user_data);
+        gpointer user_data);
 static void gnc_column_view_edit_size_cb(GtkButton * button,
-                                         gpointer user_data);
+        gpointer user_data);
 
 
 static void
 gnc_column_view_set_option(GNCOptionDB * odb, char * section, char * name,
                            SCM new_value)
 {
-  GNCOption *  option = 
-    gnc_option_db_get_option_by_name(odb, section, name);
-  
-  if(option)
-  {
-    gnc_option_db_set_option(odb, section, name, new_value);
+    GNCOption *  option =
+        gnc_option_db_get_option_by_name(odb, section, name);
 
-    /* set_option doesn't do this */
-    gnc_option_set_changed (option, TRUE);
-  }
+    if (option)
+    {
+        gnc_option_db_set_option(odb, section, name, new_value);
+
+        /* set_option doesn't do this */
+        gnc_option_set_changed (option, TRUE);
+    }
 }
 
-static void 
+static void
 gnc_column_view_edit_destroy(gnc_column_view_edit * view)
 {
-  gnc_options_dialog_destroy(view->optwin);
-  scm_gc_unprotect_object(view->options);
-  scm_gc_unprotect_object(view->view);
-  gnc_option_db_destroy(view->odb);
-  g_free(view);
+    gnc_options_dialog_destroy(view->optwin);
+    scm_gc_unprotect_object(view->options);
+    scm_gc_unprotect_object(view->view);
+    gnc_option_db_destroy(view->odb);
+    g_free(view);
 }
 
 static void
 update_display_lists(gnc_column_view_edit * view)
 {
-  SCM   get_names = scm_c_eval_string("gnc:all-report-template-names");
-  SCM   template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
-  SCM   report_menu_name = scm_c_eval_string("gnc:report-menu-name");
-  SCM   names = scm_call_0(get_names);
-  SCM   contents = 
-    gnc_option_db_lookup_option(view->odb, "__general", "report-list",
-                                SCM_BOOL_F);
-  SCM   this_report;
-  SCM   selection;
-  const gchar *name;
-  int   row, i, id;
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GtkTreePath *path;
-  GtkTreeSelection *tree_selection;
+    SCM   get_names = scm_c_eval_string("gnc:all-report-template-names");
+    SCM   template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
+    SCM   report_menu_name = scm_c_eval_string("gnc:report-menu-name");
+    SCM   names = scm_call_0(get_names);
+    SCM   contents =
+        gnc_option_db_lookup_option(view->odb, "__general", "report-list",
+                                    SCM_BOOL_F);
+    SCM   this_report;
+    SCM   selection;
+    const gchar *name;
+    int   row, i, id;
+    GtkListStore *store;
+    GtkTreeIter iter;
+    GtkTreePath *path;
+    GtkTreeSelection *tree_selection;
 
 
-  /* Update the list of available reports (left selection box). */
-  row = view->available_selected;
+    /* Update the list of available reports (left selection box). */
+    row = view->available_selected;
 
-  if(scm_is_list(view->available_list) && !scm_is_null (view->available_list)) {
-    row = MIN (row, scm_ilength (view->available_list) - 1);
-    selection = scm_list_ref (view->available_list, scm_int2num (row));
-  }
-  else {
-    selection = SCM_UNDEFINED;
-  }
+    if (scm_is_list(view->available_list) && !scm_is_null (view->available_list))
+    {
+        row = MIN (row, scm_ilength (view->available_list) - 1);
+        selection = scm_list_ref (view->available_list, scm_int2num (row));
+    }
+    else
+    {
+        selection = SCM_UNDEFINED;
+    }
 
-  scm_gc_unprotect_object(view->available_list);
-  view->available_list = names;
-  scm_gc_protect_object(view->available_list);
+    scm_gc_unprotect_object(view->available_list);
+    view->available_list = names;
+    scm_gc_protect_object(view->available_list);
 
-  store = GTK_LIST_STORE(gtk_tree_view_get_model(view->available));
-  gtk_list_store_clear(store);
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(view->available));
+    gtk_list_store_clear(store);
 
-  if(scm_is_list(names)) {
-    for(i = 0; !scm_is_null(names); names = SCM_CDR(names), i++) {
-      if (scm_is_equal (SCM_CAR(names), selection))
-        row = i;
-      name = _(scm_to_locale_string(scm_call_2(template_menu_name, SCM_CAR(names),
-    		  SCM_BOOL_F)));
-      gtk_list_store_append(store, &iter);
-      gtk_list_store_set(store, &iter,
-			 AVAILABLE_COL_NAME, name,
-			 AVAILABLE_COL_ROW, i,
-			 -1);
+    if (scm_is_list(names))
+    {
+        for (i = 0; !scm_is_null(names); names = SCM_CDR(names), i++)
+        {
+            if (scm_is_equal (SCM_CAR(names), selection))
+                row = i;
+            name = _(scm_to_locale_string(scm_call_2(template_menu_name, SCM_CAR(names),
+                                          SCM_BOOL_F)));
+            gtk_list_store_append(store, &iter);
+            gtk_list_store_set(store, &iter,
+                               AVAILABLE_COL_NAME, name,
+                               AVAILABLE_COL_ROW, i,
+                               -1);
+        }
+
     }
 
-  }
-  
-  tree_selection = gtk_tree_view_get_selection(view->available);
-  path = gtk_tree_path_new_from_indices(row, -1);
-  gtk_tree_selection_select_path(tree_selection, path);
-  gtk_tree_path_free(path);
+    tree_selection = gtk_tree_view_get_selection(view->available);
+    path = gtk_tree_path_new_from_indices(row, -1);
+    gtk_tree_selection_select_path(tree_selection, path);
+    gtk_tree_path_free(path);
 
 
-  /* Update the list of selected reports (right selection box). */
-  row = view->contents_selected;
+    /* Update the list of selected reports (right selection box). */
+    row = view->contents_selected;
 
-  if(scm_is_list(view->contents_list) && !scm_is_null (view->contents_list)) {
-    row = MIN (row, scm_ilength (view->contents_list) - 1);
-    selection = scm_list_ref (view->contents_list, scm_int2num (row));
-  }
-  else {
-    selection = SCM_UNDEFINED;
-  }
+    if (scm_is_list(view->contents_list) && !scm_is_null (view->contents_list))
+    {
+        row = MIN (row, scm_ilength (view->contents_list) - 1);
+        selection = scm_list_ref (view->contents_list, scm_int2num (row));
+    }
+    else
+    {
+        selection = SCM_UNDEFINED;
+    }
 
-  scm_gc_unprotect_object(view->contents_list);
-  view->contents_list = contents;
-  scm_gc_protect_object(view->contents_list);
+    scm_gc_unprotect_object(view->contents_list);
+    view->contents_list = contents;
+    scm_gc_protect_object(view->contents_list);
 
-  store = GTK_LIST_STORE(gtk_tree_view_get_model(view->contents));
-  gtk_list_store_clear(store);
-  if(scm_is_list(contents)) {
-    for(i = 0; !scm_is_null(contents); contents = SCM_CDR(contents), i++) {
-      if (scm_is_equal (SCM_CAR(contents), selection))
-        row = i;
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(view->contents));
+    gtk_list_store_clear(store);
+    if (scm_is_list(contents))
+    {
+        for (i = 0; !scm_is_null(contents); contents = SCM_CDR(contents), i++)
+        {
+            if (scm_is_equal (SCM_CAR(contents), selection))
+                row = i;
 
-      id = scm_num2int(SCM_CAAR(contents), SCM_ARG1, G_STRFUNC);
-      this_report = gnc_report_find(id);
-      name = _(scm_to_locale_string(scm_call_1(report_menu_name, this_report)));
+            id = scm_num2int(SCM_CAAR(contents), SCM_ARG1, G_STRFUNC);
+            this_report = gnc_report_find(id);
+            name = _(scm_to_locale_string(scm_call_1(report_menu_name, this_report)));
 
-      gtk_list_store_append(store, &iter);
-      gtk_list_store_set
-	(store, &iter,
-	 CONTENTS_COL_NAME, name,
-	 CONTENTS_COL_ROW, i,
-	 CONTENTS_COL_REPORT_COLS, scm_num2int(SCM_CADR(SCM_CAR(contents)),
-					       SCM_ARG1, G_STRFUNC),
-	 CONTENTS_COL_REPORT_ROWS, scm_num2int(SCM_CADDR(SCM_CAR(contents)),
-					       SCM_ARG1, G_STRFUNC),
-	 -1);
+            gtk_list_store_append(store, &iter);
+            gtk_list_store_set
+            (store, &iter,
+             CONTENTS_COL_NAME, name,
+             CONTENTS_COL_ROW, i,
+             CONTENTS_COL_REPORT_COLS, scm_num2int(SCM_CADR(SCM_CAR(contents)),
+                                                   SCM_ARG1, G_STRFUNC),
+             CONTENTS_COL_REPORT_ROWS, scm_num2int(SCM_CADDR(SCM_CAR(contents)),
+                                                   SCM_ARG1, G_STRFUNC),
+             -1);
+        }
     }
-  }
-  
-  tree_selection = gtk_tree_view_get_selection(view->contents);
-  path = gtk_tree_path_new_from_indices(row, -1);
-  gtk_tree_selection_select_path(tree_selection, path);
-  //  gtk_tree_view_scroll_to_cell(view->contents, path, NULL, TRUE, 0.5, 0.0);
-  gtk_tree_path_free(path);
+
+    tree_selection = gtk_tree_view_get_selection(view->contents);
+    path = gtk_tree_path_new_from_indices(row, -1);
+    gtk_tree_selection_select_path(tree_selection, path);
+    //  gtk_tree_view_scroll_to_cell(view->contents, path, NULL, TRUE, 0.5, 0.0);
+    gtk_tree_path_free(path);
 }
 
 static void
 gnc_column_view_select_avail_cb(GtkTreeSelection *selection,
-				gnc_column_view_edit *r)
+                                gnc_column_view_edit *r)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  if (gtk_tree_selection_get_selected(selection, &model, &iter))
-    gtk_tree_model_get(model, &iter,
-		       AVAILABLE_COL_ROW, &r->available_selected,
-		       -1);
+    if (gtk_tree_selection_get_selected(selection, &model, &iter))
+        gtk_tree_model_get(model, &iter,
+                           AVAILABLE_COL_ROW, &r->available_selected,
+                           -1);
 }
 
 static void
 gnc_column_view_select_contents_cb(GtkTreeSelection *selection,
-				   gnc_column_view_edit *r)
+                                   gnc_column_view_edit *r)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  if (gtk_tree_selection_get_selected(selection, &model, &iter))
-    gtk_tree_model_get(model, &iter,
-		       AVAILABLE_COL_ROW, &r->contents_selected,
-		       -1);
+    if (gtk_tree_selection_get_selected(selection, &model, &iter))
+        gtk_tree_model_get(model, &iter,
+                           AVAILABLE_COL_ROW, &r->contents_selected,
+                           -1);
 }
 
 static void
 gnc_column_view_edit_apply_cb(GNCOptionWin * w, gpointer user_data)
 {
-  SCM  dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
-  gnc_column_view_edit * win = user_data;
-  
-  if(!win) return;
-  gnc_option_db_commit(win->odb);
-  scm_call_2(dirty_report, win->view, SCM_BOOL_T);
+    SCM  dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
+    gnc_column_view_edit * win = user_data;
+
+    if (!win) return;
+    gnc_option_db_commit(win->odb);
+    scm_call_2(dirty_report, win->view, SCM_BOOL_T);
 }
 
 static void
 gnc_column_view_edit_close_cb(GNCOptionWin * win, gpointer user_data)
 {
-  gnc_column_view_edit * r = user_data;
-  SCM set_editor = scm_c_eval_string("gnc:report-set-editor-widget!");
-  
-  scm_call_2(set_editor, r->view, SCM_BOOL_F);
-  gnc_column_view_edit_destroy(r);
+    gnc_column_view_edit * r = user_data;
+    SCM set_editor = scm_c_eval_string("gnc:report-set-editor-widget!");
+
+    scm_call_2(set_editor, r->view, SCM_BOOL_F);
+    gnc_column_view_edit_destroy(r);
 }
 
 
 /********************************************************************
  * gnc_column_view_edit_options
- * create the editor. 
+ * create the editor.
  ********************************************************************/
 
-GtkWidget * 
+GtkWidget *
 gnc_column_view_edit_options(SCM options, SCM view)
 {
-  SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
-  SCM ptr;
-  GtkWidget * editor;
-  GtkListStore *store;
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
-  GtkTreeSelection *selection;
+    SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
+    SCM ptr;
+    GtkWidget * editor;
+    GtkListStore *store;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+    GtkTreeSelection *selection;
 
-  ptr = scm_call_1(get_editor, view);
-  if(ptr != SCM_BOOL_F) {
+    ptr = scm_call_1(get_editor, view);
+    if (ptr != SCM_BOOL_F)
+    {
 #define FUNC_NAME "gtk_window_present"
-    GtkWindow * w = SWIG_MustGetPtr(ptr, SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
-    gtk_window_present(w);
+        GtkWindow * w = SWIG_MustGetPtr(ptr, SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
+        gtk_window_present(w);
 #undef FUNC_NAME
-    return NULL;
-  }
-  else {
-    gnc_column_view_edit * r = g_new0(gnc_column_view_edit, 1);
-    GladeXML *xml;
+        return NULL;
+    }
+    else
+    {
+        gnc_column_view_edit * r = g_new0(gnc_column_view_edit, 1);
+        GladeXML *xml;
 
-    r->optwin = gnc_options_dialog_new(NULL);
+        r->optwin = gnc_options_dialog_new(NULL);
 
-    /* Hide the generic dialog page list. */
-    {
-      GtkWidget *dialog, *page_list;
+        /* Hide the generic dialog page list. */
+        {
+            GtkWidget *dialog, *page_list;
 
-      dialog = gnc_options_dialog_widget(r->optwin);
-      page_list = gnc_glade_lookup_widget (dialog, "page_list");
-      gtk_widget_hide(page_list);
-    }
+            dialog = gnc_options_dialog_widget(r->optwin);
+            page_list = gnc_glade_lookup_widget (dialog, "page_list");
+            gtk_widget_hide(page_list);
+        }
 
-    xml = gnc_glade_xml_new ("report.glade", "view_contents_table");
+        xml = gnc_glade_xml_new ("report.glade", "view_contents_table");
 
-    glade_xml_signal_connect_data
-      (xml, "gnc_column_view_edit_add_cb",
-       G_CALLBACK (gnc_column_view_edit_add_cb), r);
+        glade_xml_signal_connect_data
+        (xml, "gnc_column_view_edit_add_cb",
+         G_CALLBACK (gnc_column_view_edit_add_cb), r);
 
-    glade_xml_signal_connect_data
-      (xml, "gnc_column_view_edit_remove_cb",
-       G_CALLBACK (gnc_column_view_edit_remove_cb), r);
+        glade_xml_signal_connect_data
+        (xml, "gnc_column_view_edit_remove_cb",
+         G_CALLBACK (gnc_column_view_edit_remove_cb), r);
 
-    glade_xml_signal_connect_data
-      (xml, "gnc_edit_column_view_move_up_cb",
-       G_CALLBACK (gnc_edit_column_view_move_up_cb), r);
+        glade_xml_signal_connect_data
+        (xml, "gnc_edit_column_view_move_up_cb",
+         G_CALLBACK (gnc_edit_column_view_move_up_cb), r);
 
-    glade_xml_signal_connect_data
-      (xml, "gnc_edit_column_view_move_down_cb",
-       G_CALLBACK (gnc_edit_column_view_move_down_cb), r);
+        glade_xml_signal_connect_data
+        (xml, "gnc_edit_column_view_move_down_cb",
+         G_CALLBACK (gnc_edit_column_view_move_down_cb), r);
 
-    glade_xml_signal_connect_data
-      (xml, "gnc_column_view_edit_size_cb",
-       G_CALLBACK (gnc_column_view_edit_size_cb), r);
+        glade_xml_signal_connect_data
+        (xml, "gnc_column_view_edit_size_cb",
+         G_CALLBACK (gnc_column_view_edit_size_cb), r);
 
-    editor       = glade_xml_get_widget (xml, "view_contents_table");
-    r->available = GTK_TREE_VIEW (glade_xml_get_widget (xml, "available_view"));
-    r->contents  = GTK_TREE_VIEW (glade_xml_get_widget (xml, "contents_view"));
-    r->options   = options;
-    r->view      = view;
-    r->available_selected = 0;
-    r->available_list = SCM_EOL;
-    r->contents_selected = 0;
-    r->contents_list = SCM_EOL;
-    r->odb       = gnc_option_db_new(r->options);
+        editor       = glade_xml_get_widget (xml, "view_contents_table");
+        r->available = GTK_TREE_VIEW (glade_xml_get_widget (xml, "available_view"));
+        r->contents  = GTK_TREE_VIEW (glade_xml_get_widget (xml, "contents_view"));
+        r->options   = options;
+        r->view      = view;
+        r->available_selected = 0;
+        r->available_list = SCM_EOL;
+        r->contents_selected = 0;
+        r->contents_list = SCM_EOL;
+        r->odb       = gnc_option_db_new(r->options);
 
-    gnc_options_dialog_build_contents(r->optwin, r->odb);
+        gnc_options_dialog_build_contents(r->optwin, r->odb);
 
-    gtk_notebook_append_page(GTK_NOTEBOOK(gnc_options_dialog_notebook
-                                          (r->optwin)),
-                             editor, 
-                             gtk_label_new(_("Contents")));
+        gtk_notebook_append_page(GTK_NOTEBOOK(gnc_options_dialog_notebook
+                                              (r->optwin)),
+                                 editor,
+                                 gtk_label_new(_("Contents")));
 
-    scm_gc_protect_object(r->options);
-    scm_gc_protect_object(r->view);
-    scm_gc_protect_object(r->available_list);
-    scm_gc_protect_object(r->contents_list);
+        scm_gc_protect_object(r->options);
+        scm_gc_protect_object(r->view);
+        scm_gc_protect_object(r->available_list);
+        scm_gc_protect_object(r->contents_list);
 
-    /* Build the 'available' view */
-    store = gtk_list_store_new (NUM_AVAILABLE_COLS, G_TYPE_STRING, G_TYPE_INT);
-    gtk_tree_view_set_model(r->available, GTK_TREE_MODEL(store));
-    gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store),AVAILABLE_COL_NAME,GTK_SORT_ASCENDING);
-    g_object_unref(store);
+        /* Build the 'available' view */
+        store = gtk_list_store_new (NUM_AVAILABLE_COLS, G_TYPE_STRING, G_TYPE_INT);
+        gtk_tree_view_set_model(r->available, GTK_TREE_MODEL(store));
+        gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), AVAILABLE_COL_NAME, GTK_SORT_ASCENDING);
+        g_object_unref(store);
 
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes("", renderer,
-						      "text", AVAILABLE_COL_NAME,
-						      NULL);
-    gtk_tree_view_append_column(r->available, column);
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes("", renderer,
+                 "text", AVAILABLE_COL_NAME,
+                 NULL);
+        gtk_tree_view_append_column(r->available, column);
 
-    selection = gtk_tree_view_get_selection(r->available);
-    g_signal_connect(selection, "changed",
-		     G_CALLBACK(gnc_column_view_select_avail_cb), r);
+        selection = gtk_tree_view_get_selection(r->available);
+        g_signal_connect(selection, "changed",
+                         G_CALLBACK(gnc_column_view_select_avail_cb), r);
 
-    /* Build the 'contents' view */
-    store = gtk_list_store_new (NUM_CONTENTS_COLS, G_TYPE_STRING, G_TYPE_INT,
-				G_TYPE_INT, G_TYPE_INT);
-    gtk_tree_view_set_model(r->contents, GTK_TREE_MODEL(store));
-    g_object_unref(store);
+        /* Build the 'contents' view */
+        store = gtk_list_store_new (NUM_CONTENTS_COLS, G_TYPE_STRING, G_TYPE_INT,
+                                    G_TYPE_INT, G_TYPE_INT);
+        gtk_tree_view_set_model(r->contents, GTK_TREE_MODEL(store));
+        g_object_unref(store);
 
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Report"), renderer,
-						      "text", CONTENTS_COL_NAME,
-						      NULL);
-    gtk_tree_view_append_column(r->contents, column);
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes(_("Report"), renderer,
+                 "text", CONTENTS_COL_NAME,
+                 NULL);
+        gtk_tree_view_append_column(r->contents, column);
 
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Rows"), renderer,
-						      "text", CONTENTS_COL_REPORT_ROWS,
-						      NULL);
-    gtk_tree_view_append_column(r->contents, column);
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes(_("Rows"), renderer,
+                 "text", CONTENTS_COL_REPORT_ROWS,
+                 NULL);
+        gtk_tree_view_append_column(r->contents, column);
 
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Cols"), renderer,
-                  "text", CONTENTS_COL_REPORT_COLS,
-                  NULL);
-    gtk_tree_view_append_column(r->contents, column);
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes(_("Cols"), renderer,
+                 "text", CONTENTS_COL_REPORT_COLS,
+                 NULL);
+        gtk_tree_view_append_column(r->contents, column);
 
-    selection = gtk_tree_view_get_selection(r->contents);
-    g_signal_connect(selection, "changed",
-		     G_CALLBACK(gnc_column_view_select_contents_cb), r);
+        selection = gtk_tree_view_get_selection(r->contents);
+        g_signal_connect(selection, "changed",
+                         G_CALLBACK(gnc_column_view_select_contents_cb), r);
 
-    update_display_lists(r);
+        update_display_lists(r);
 
-    gnc_options_dialog_set_apply_cb(r->optwin, 
-                                    gnc_column_view_edit_apply_cb, r);
-    gnc_options_dialog_set_close_cb(r->optwin, 
-                                    gnc_column_view_edit_close_cb, r);
+        gnc_options_dialog_set_apply_cb(r->optwin,
+                                        gnc_column_view_edit_apply_cb, r);
+        gnc_options_dialog_set_close_cb(r->optwin,
+                                        gnc_column_view_edit_close_cb, r);
 
-    gtk_widget_show(gnc_options_dialog_widget(r->optwin));
-    return gnc_options_dialog_widget(r->optwin);
-  }
+        gtk_widget_show(gnc_options_dialog_widget(r->optwin));
+        return gnc_options_dialog_widget(r->optwin);
+    }
 }
 
 static void
 gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
 {
-  gnc_column_view_edit * r = user_data;
-  SCM make_report = scm_c_eval_string("gnc:make-report");
-  SCM mark_report = scm_c_eval_string("gnc:report-set-needs-save?!");
-  SCM template_name;
-  SCM new_report;
-  SCM newlist = SCM_EOL;
-  SCM oldlist = r->contents_list;
-  int count;
-  int oldlength, id;
-  
-  if(scm_is_list(r->available_list) && 
-     (scm_ilength(r->available_list) > r->available_selected)) {
-    template_name = scm_list_ref(r->available_list, 
-                                scm_int2num(r->available_selected));
-    new_report = scm_call_1(make_report, template_name);
-    id = scm_num2int(new_report, SCM_ARG1, G_STRFUNC);
-    scm_call_2(mark_report, gnc_report_find(id), SCM_BOOL_T);
-    oldlength = scm_ilength(r->contents_list);
-    
-    if(oldlength > r->contents_selected) {
-      for(count = 0; count < r->contents_selected; count++) {
-        newlist = scm_cons(SCM_CAR(oldlist), newlist);
-        oldlist = SCM_CDR(oldlist);
-      }
-      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));
+    gnc_column_view_edit * r = user_data;
+    SCM make_report = scm_c_eval_string("gnc:make-report");
+    SCM mark_report = scm_c_eval_string("gnc:report-set-needs-save?!");
+    SCM template_name;
+    SCM new_report;
+    SCM newlist = SCM_EOL;
+    SCM oldlist = r->contents_list;
+    int count;
+    int oldlength, id;
+
+    if (scm_is_list(r->available_list) &&
+            (scm_ilength(r->available_list) > r->available_selected))
+    {
+        template_name = scm_list_ref(r->available_list,
+                                     scm_int2num(r->available_selected));
+        new_report = scm_call_1(make_report, template_name);
+        id = scm_num2int(new_report, SCM_ARG1, G_STRFUNC);
+        scm_call_2(mark_report, gnc_report_find(id), SCM_BOOL_T);
+        oldlength = scm_ilength(r->contents_list);
+
+        if (oldlength > r->contents_selected)
+        {
+            for (count = 0; count < r->contents_selected; count++)
+            {
+                newlist = scm_cons(SCM_CAR(oldlist), newlist);
+                oldlist = SCM_CDR(oldlist);
+            }
+            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));
+        }
+        else
+        {
+            newlist = scm_append
+                      (scm_listify(oldlist,
+                                   SCM_LIST1(SCM_LIST4(new_report,
+                                             scm_int2num(1),
+                                             scm_int2num(1),
+                                             SCM_BOOL_F)),
+                                   SCM_UNDEFINED));
+            r->contents_selected = oldlength;
+        }
+
+        scm_gc_unprotect_object(r->contents_list);
+        r->contents_list = newlist;
+        scm_gc_protect_object(r->contents_list);
+
+        gnc_column_view_set_option(r->odb, "__general", "report-list",
+                                   r->contents_list);
+        gnc_options_dialog_changed (r->optwin);
     }
-    else {
-      newlist = scm_append
-	(scm_listify(oldlist, 
-		     SCM_LIST1(SCM_LIST4(new_report,
-					 scm_int2num(1),
-					 scm_int2num(1),
-					 SCM_BOOL_F)),
-		     SCM_UNDEFINED));
-      r->contents_selected = oldlength;
-    }
-    
-    scm_gc_unprotect_object(r->contents_list);
-    r->contents_list = newlist;
-    scm_gc_protect_object(r->contents_list);
-    
-    gnc_column_view_set_option(r->odb, "__general", "report-list",
-                               r->contents_list);
-    gnc_options_dialog_changed (r->optwin);
-  }
 
-  update_display_lists(r);
+    update_display_lists(r);
 }
 
 static void
 gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data)
 {
-  gnc_column_view_edit * r = user_data;
-  SCM newlist = SCM_EOL;
-  SCM oldlist = r->contents_list;
-  int count;
-  int oldlength;
-  
-  if(scm_is_list(r->contents_list)) {
-    oldlength = scm_ilength(r->contents_list);
-    if(oldlength > r->contents_selected) {
-      for(count=0; count < r->contents_selected; count++) {
-        newlist = scm_cons(SCM_CAR(oldlist), newlist);
-        oldlist = SCM_CDR(oldlist);
-      }
-      if(count <= oldlength) {
-        newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
-      }
-    }
-    
-    if(r->contents_selected > 0 && oldlength == r->contents_selected + 1) {
-      r->contents_selected --;
-    }
+    gnc_column_view_edit * r = user_data;
+    SCM newlist = SCM_EOL;
+    SCM oldlist = r->contents_list;
+    int count;
+    int oldlength;
 
-    scm_gc_unprotect_object(r->contents_list);
-    r->contents_list = newlist;
-    scm_gc_protect_object(r->contents_list);
+    if (scm_is_list(r->contents_list))
+    {
+        oldlength = scm_ilength(r->contents_list);
+        if (oldlength > r->contents_selected)
+        {
+            for (count = 0; count < r->contents_selected; count++)
+            {
+                newlist = scm_cons(SCM_CAR(oldlist), newlist);
+                oldlist = SCM_CDR(oldlist);
+            }
+            if (count <= oldlength)
+            {
+                newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
+            }
+        }
 
-    gnc_column_view_set_option(r->odb, "__general", "report-list",
-                               r->contents_list);
+        if (r->contents_selected > 0 && oldlength == r->contents_selected + 1)
+        {
+            r->contents_selected --;
+        }
 
-    gnc_options_dialog_changed (r->optwin);
-  }
+        scm_gc_unprotect_object(r->contents_list);
+        r->contents_list = newlist;
+        scm_gc_protect_object(r->contents_list);
 
-  update_display_lists(r);
+        gnc_column_view_set_option(r->odb, "__general", "report-list",
+                                   r->contents_list);
+
+        gnc_options_dialog_changed (r->optwin);
+    }
+
+    update_display_lists(r);
 }
 
 static void
 gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data)
 {
-  gnc_column_view_edit * r = user_data;
-  SCM oldlist = r->contents_list;
-  SCM newlist = SCM_EOL;
-  SCM temp;
-  int oldlength;
-  int count;
+    gnc_column_view_edit * r = user_data;
+    SCM oldlist = r->contents_list;
+    SCM newlist = SCM_EOL;
+    SCM temp;
+    int oldlength;
+    int count;
 
-  oldlength = scm_ilength(r->contents_list);
-  if((r->contents_selected > 0) && (oldlength > r->contents_selected)) {
-    for(count = 1; count < r->contents_selected; count++) {
-      newlist = scm_cons(SCM_CAR(oldlist), newlist);
-      oldlist = SCM_CDR(oldlist);
-    }
-    temp = SCM_CAR(oldlist);
-    oldlist = SCM_CDR(oldlist);
-    newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
-    newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
+    oldlength = scm_ilength(r->contents_list);
+    if ((r->contents_selected > 0) && (oldlength > r->contents_selected))
+    {
+        for (count = 1; count < r->contents_selected; count++)
+        {
+            newlist = scm_cons(SCM_CAR(oldlist), newlist);
+            oldlist = SCM_CDR(oldlist);
+        }
+        temp = SCM_CAR(oldlist);
+        oldlist = SCM_CDR(oldlist);
+        newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
+        newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
 
-    scm_gc_unprotect_object(r->contents_list);
-    r->contents_list = newlist;
-    scm_gc_protect_object(r->contents_list);
+        scm_gc_unprotect_object(r->contents_list);
+        r->contents_list = newlist;
+        scm_gc_protect_object(r->contents_list);
 
-    r->contents_selected = r->contents_selected - 1;
+        r->contents_selected = r->contents_selected - 1;
 
-    gnc_column_view_set_option(r->odb, "__general", "report-list",
-                               r->contents_list);
-    
-    gnc_options_dialog_changed (r->optwin);
+        gnc_column_view_set_option(r->odb, "__general", "report-list",
+                                   r->contents_list);
 
-    update_display_lists(r);
-  }
+        gnc_options_dialog_changed (r->optwin);
+
+        update_display_lists(r);
+    }
 }
 
 static void
 gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data)
 {
-  gnc_column_view_edit * r = user_data;
-  SCM oldlist = r->contents_list;
-  SCM newlist = SCM_EOL;
-  SCM temp;
-  int oldlength;
-  int count;
+    gnc_column_view_edit * r = user_data;
+    SCM oldlist = r->contents_list;
+    SCM newlist = SCM_EOL;
+    SCM temp;
+    int oldlength;
+    int count;
 
-  oldlength = scm_ilength(r->contents_list);
-  if(oldlength > (r->contents_selected + 1)) {
-    for(count = 0; count < r->contents_selected; count++) {
-      newlist = scm_cons(SCM_CAR(oldlist), newlist);
-      oldlist = SCM_CDR(oldlist);
-    }
-    temp = SCM_CAR(oldlist);
-    oldlist = SCM_CDR(oldlist);
-    newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
-    newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
+    oldlength = scm_ilength(r->contents_list);
+    if (oldlength > (r->contents_selected + 1))
+    {
+        for (count = 0; count < r->contents_selected; count++)
+        {
+            newlist = scm_cons(SCM_CAR(oldlist), newlist);
+            oldlist = SCM_CDR(oldlist);
+        }
+        temp = SCM_CAR(oldlist);
+        oldlist = SCM_CDR(oldlist);
+        newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
+        newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
 
-    scm_gc_unprotect_object(r->contents_list);
-    r->contents_list = newlist;
-    scm_gc_protect_object(r->contents_list);
+        scm_gc_unprotect_object(r->contents_list);
+        r->contents_list = newlist;
+        scm_gc_protect_object(r->contents_list);
 
-    r->contents_selected = r->contents_selected + 1;
+        r->contents_selected = r->contents_selected + 1;
 
-    gnc_column_view_set_option(r->odb, "__general", "report-list",
-                               r->contents_list);    
+        gnc_column_view_set_option(r->odb, "__general", "report-list",
+                                   r->contents_list);
 
-    gnc_options_dialog_changed (r->optwin);
+        gnc_options_dialog_changed (r->optwin);
 
-    update_display_lists(r);
-  }
+        update_display_lists(r);
+    }
 }
 
 static void
 gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data)
 {
-  gnc_column_view_edit * r = user_data;
-  GtkWidget * rowspin;
-  GtkWidget * colspin;
-  GtkWidget * dlg;
-  GladeXML *xml;
-  SCM current;
-  int length;
-  int dlg_ret;
+    gnc_column_view_edit * r = user_data;
+    GtkWidget * rowspin;
+    GtkWidget * colspin;
+    GtkWidget * dlg;
+    GladeXML *xml;
+    SCM current;
+    int length;
+    int dlg_ret;
 
-  xml = gnc_glade_xml_new ("report.glade", "Edit Report Size");
-  dlg = glade_xml_get_widget (xml, "Edit Report Size");
+    xml = gnc_glade_xml_new ("report.glade", "Edit Report Size");
+    dlg = glade_xml_get_widget (xml, "Edit Report Size");
 
-  /* get the spinner widgets */ 
-  rowspin = glade_xml_get_widget (xml, "row_spin");
-  colspin = glade_xml_get_widget (xml, "col_spin");
+    /* get the spinner widgets */
+    rowspin = glade_xml_get_widget (xml, "row_spin");
+    colspin = glade_xml_get_widget (xml, "col_spin");
 
-  length = scm_ilength(r->contents_list);
-  if(length > r->contents_selected) {
-    current = scm_list_ref(r->contents_list, 
-                          scm_int2num(r->contents_selected));
-    gtk_spin_button_set_value(GTK_SPIN_BUTTON(colspin),
-                              (float)scm_num2int(SCM_CADR(current),
-						 SCM_ARG1, G_STRFUNC));
-    gtk_spin_button_set_value(GTK_SPIN_BUTTON(rowspin),
-                              (float)scm_num2int(SCM_CADDR(current),
-						 SCM_ARG1, G_STRFUNC));
-  
-    dlg_ret = gtk_dialog_run(GTK_DIALOG(dlg));
-    gtk_widget_hide(dlg);
+    length = scm_ilength(r->contents_list);
+    if (length > r->contents_selected)
+    {
+        current = scm_list_ref(r->contents_list,
+                               scm_int2num(r->contents_selected));
+        gtk_spin_button_set_value(GTK_SPIN_BUTTON(colspin),
+                                  (float)scm_num2int(SCM_CADR(current),
+                                          SCM_ARG1, G_STRFUNC));
+        gtk_spin_button_set_value(GTK_SPIN_BUTTON(rowspin),
+                                  (float)scm_num2int(SCM_CADDR(current),
+                                          SCM_ARG1, G_STRFUNC));
 
-    if(dlg_ret == GTK_RESPONSE_OK) {
-      current = SCM_LIST4(SCM_CAR(current),
-                          scm_int2num(gtk_spin_button_get_value_as_int
-                                     (GTK_SPIN_BUTTON(colspin))),
-                          scm_int2num(gtk_spin_button_get_value_as_int
-                                     (GTK_SPIN_BUTTON(rowspin))),
-                          SCM_BOOL_F);
-      scm_gc_unprotect_object(r->contents_list);
-      r->contents_list = scm_list_set_x(r->contents_list, 
-                                        scm_int2num(r->contents_selected),
-                                        current);
-      scm_gc_protect_object(r->contents_list);
-      gnc_options_dialog_changed (r->optwin);
-      update_display_lists(r);
+        dlg_ret = gtk_dialog_run(GTK_DIALOG(dlg));
+        gtk_widget_hide(dlg);
+
+        if (dlg_ret == GTK_RESPONSE_OK)
+        {
+            current = SCM_LIST4(SCM_CAR(current),
+                                scm_int2num(gtk_spin_button_get_value_as_int
+                                            (GTK_SPIN_BUTTON(colspin))),
+                                scm_int2num(gtk_spin_button_get_value_as_int
+                                            (GTK_SPIN_BUTTON(rowspin))),
+                                SCM_BOOL_F);
+            scm_gc_unprotect_object(r->contents_list);
+            r->contents_list = scm_list_set_x(r->contents_list,
+                                              scm_int2num(r->contents_selected),
+                                              current);
+            scm_gc_protect_object(r->contents_list);
+            gnc_options_dialog_changed (r->optwin);
+            update_display_lists(r);
+        }
+        gtk_widget_destroy(dlg);
     }
-    gtk_widget_destroy(dlg);
-  }
 }

Modified: gnucash/trunk/src/report/report-gnome/dialog-custom-report.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-custom-report.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-gnome/dialog-custom-report.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -49,41 +49,41 @@
 
 /* convenience for accessing columns in the GtkListStore that holds
    the reports */
-enum 
-  {
+enum
+{
     COL_NAME = 0,
     COL_NUM,
     NUM_COLS
-  };
+};
 
 /* all the pertinent stuff needed to pass around */
-typedef struct _CustomReportDialog 
+typedef struct _CustomReportDialog
 {
-  /* dialog */
-  GtkWidget *dialog;
-  GtkWidget *reportview;
-  GncMainWindow *window;
-  
-  /* data */
-  SCM reportlist;
+    /* dialog */
+    GtkWidget *dialog;
+    GtkWidget *reportview;
+    GncMainWindow *window;
 
+    /* data */
+    SCM reportlist;
+
 } CustomReportDialog;
 
 static void
 custom_report_dialog_close_cb(GtkWidget* widget,
-			      CustomReportDialog *crd) 
+                              CustomReportDialog *crd)
 {
-  gtk_widget_destroy(crd->dialog);
-  g_free(crd);
+    gtk_widget_destroy(crd->dialog);
+    g_free(crd);
 
 }
 
 
 static void
 cancel_custom_report_clicked_cb(GtkWidget* widget,
-				CustomReportDialog *crd) 
+                                CustomReportDialog *crd)
 {
-  custom_report_dialog_close_cb(NULL, crd);
+    custom_report_dialog_close_cb(NULL, crd);
 }
 
 
@@ -95,76 +95,78 @@
  *
  */
 static void
-update_report_list(GtkListStore *store, CustomReportDialog *crd) 
+update_report_list(GtkListStore *store, CustomReportDialog *crd)
 {
 
-  SCM get_names = scm_c_eval_string("gnc:custom-report-template-names");
-  SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
-  SCM names;
-  const gchar *name;
-  int i;
-  GtkTreeIter iter;
-  
-  gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), COL_NAME, GTK_SORT_ASCENDING);
-  
-  crd->reportlist = scm_call_0(get_names);
-  names = crd->reportlist;
+    SCM get_names = scm_c_eval_string("gnc:custom-report-template-names");
+    SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
+    SCM names;
+    const gchar *name;
+    int i;
+    GtkTreeIter iter;
 
-  gtk_list_store_clear(store);
-        
-    if(scm_is_list(names)) {
+    gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), COL_NAME, GTK_SORT_ASCENDING);
 
-      /* for all the names in the list, store them, with a reference,
-	 in the gtkliststore */
-      for (i=0; !scm_is_null(names); i++) {
+    crd->reportlist = scm_call_0(get_names);
+    names = crd->reportlist;
 
-	name = scm_to_locale_string(scm_call_2(template_menu_name, SCM_CAR(names), SCM_BOOL_F));
+    gtk_list_store_clear(store);
 
-	gtk_list_store_append(store, &iter);
-	gtk_list_store_set(store, &iter,
-			   COL_NAME, name,
-			   COL_NUM, i,
-			   -1);
-	names = SCM_CDR(names);
-	
-      }
+    if (scm_is_list(names))
+    {
 
+        /* for all the names in the list, store them, with a reference,
+        	 in the gtkliststore */
+        for (i = 0; !scm_is_null(names); i++)
+        {
+
+            name = scm_to_locale_string(scm_call_2(template_menu_name, SCM_CAR(names), SCM_BOOL_F));
+
+            gtk_list_store_append(store, &iter);
+            gtk_list_store_set(store, &iter,
+                               COL_NAME, name,
+                               COL_NUM, i,
+                               -1);
+            names = SCM_CDR(names);
+
+        }
+
     }
-    
+
 }
 
 
 static GtkTreeModel *
 create_and_fill_report_list(CustomReportDialog *crd)
 {
-  GtkListStore *store;
-  GtkTreeIter iter;
+    GtkListStore *store;
+    GtkTreeIter iter;
 
-  store = gtk_list_store_new(NUM_COLS, G_TYPE_STRING, G_TYPE_INT);
+    store = gtk_list_store_new(NUM_COLS, G_TYPE_STRING, G_TYPE_INT);
 
-  update_report_list(store, crd);
+    update_report_list(store, crd);
 
-  return GTK_TREE_MODEL (store);
+    return GTK_TREE_MODEL (store);
 
 }
 
 static void
-set_reports_model(CustomReportDialog *crd) 
+set_reports_model(CustomReportDialog *crd)
 {
-  GtkCellRenderer *renderer;
-  GtkTreeModel *model;
+    GtkCellRenderer *renderer;
+    GtkTreeModel *model;
 
-  renderer = gtk_cell_renderer_text_new();
+    renderer = gtk_cell_renderer_text_new();
 
-  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (crd->reportview), -1, "Report Name", renderer, "text", COL_NAME, NULL);
+    gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (crd->reportview), -1, "Report Name", renderer, "text", COL_NAME, NULL);
 
-  model = create_and_fill_report_list(crd);
+    model = create_and_fill_report_list(crd);
 
-  gtk_tree_view_set_model (GTK_TREE_VIEW (crd->reportview), model);
+    gtk_tree_view_set_model (GTK_TREE_VIEW (crd->reportview), model);
 
-  g_object_unref(model);
+    g_object_unref(model);
 
-  
+
 }
 
 
@@ -177,28 +179,28 @@
  */
 static void
 custom_report_run_report(SCM guid,
-			 CustomReportDialog *crd)
+                         CustomReportDialog *crd)
 {
 
-  SCM make_report = scm_c_eval_string("gnc:make-report");
-  int report_id;  
-  GncMainWindow *window = crd->window;
-  
-  if(!scm_is_null(guid))
+    SCM make_report = scm_c_eval_string("gnc:make-report");
+    int report_id;
+    GncMainWindow *window = crd->window;
+
+    if (!scm_is_null(guid))
     {
 
-      /* this runs the report */
-      report_id = SCM_INUM(scm_call_1(make_report, guid));
+        /* this runs the report */
+        report_id = SCM_INUM(scm_call_1(make_report, guid));
 
-      /* do this *before* the report because sometimes the report
-	 takes a while... */
-      custom_report_dialog_close_cb(NULL, crd);
-            
-      /* display the report */
-      gnc_main_window_open_report(report_id, window);
-            
+        /* do this *before* the report because sometimes the report
+        	 takes a while... */
+        custom_report_dialog_close_cb(NULL, crd);
+
+        /* display the report */
+        gnc_main_window_open_report(report_id, window);
+
     }
-  
+
 }
 
 /**
@@ -210,37 +212,37 @@
  *
  * const gchar* message -- the message to provide user if there is no
  * actual selection found.
- * 
+ *
  */
 static SCM
 get_custom_report_selection(CustomReportDialog *crd,
-			    const gchar* message)
+                            const gchar* message)
 {
-  GtkTreeSelection *sel;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  SCM guid;
-  
-  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(crd->reportview));
-  
-  if (gtk_tree_selection_get_selected(sel, &model, &iter))
+    GtkTreeSelection *sel;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    SCM guid;
+
+    sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(crd->reportview));
+
+    if (gtk_tree_selection_get_selected(sel, &model, &iter))
     {
-      int num;
+        int num;
 
-      gtk_tree_model_get(model, &iter, COL_NUM, &num, -1);
-      guid = scm_list_ref(crd->reportlist, scm_int2num(num));
+        gtk_tree_model_get(model, &iter, COL_NUM, &num, -1);
+        guid = scm_list_ref(crd->reportlist, scm_int2num(num));
     }
 
-  else 
+    else
     {
-      /* no selection, notify user */
-      gnc_error_dialog(GTK_WIDGET(crd->window), "%s", message);
-      return SCM_EOL;
-      
+        /* no selection, notify user */
+        gnc_error_dialog(GTK_WIDGET(crd->window), "%s", message);
+        return SCM_EOL;
+
     }
-  
-  return guid;
-  
+
+    return guid;
+
 }
 
 /**
@@ -253,27 +255,27 @@
  */
 static void
 on_custom_report_list_view_row_activated(GtkTreeView *view,
-					 GtkTreePath *path,
-					 GtkTreeViewColumn *column,
-					 CustomReportDialog *crd)
+        GtkTreePath *path,
+        GtkTreeViewColumn *column,
+        CustomReportDialog *crd)
 {
 
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  
-  model = gtk_tree_view_get_model(view);
-    
-  if(gtk_tree_model_get_iter(model, &iter, path))
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+
+    model = gtk_tree_view_get_model(view);
+
+    if (gtk_tree_model_get_iter(model, &iter, path))
     {
-      int num;
-      SCM guid;
+        int num;
+        SCM guid;
 
-      gtk_tree_model_get(model, &iter, COL_NUM, &num, -1);
-      
-      guid = scm_list_ref(crd->reportlist, scm_int2num(num));
+        gtk_tree_model_get(model, &iter, COL_NUM, &num, -1);
 
-      custom_report_run_report(guid, crd);
-      
+        guid = scm_list_ref(crd->reportlist, scm_int2num(num));
+
+        custom_report_run_report(guid, crd);
+
     }
 
 }
@@ -287,41 +289,41 @@
  */
 static void
 on_delete_custom_report_clicked(GtkWidget *button,
-				CustomReportDialog *crd) 
+                                CustomReportDialog *crd)
 {
-  GtkTreeSelection *sel;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    GtkTreeSelection *sel;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
-  SCM guid;
-  const gchar* report_name;
-  
-  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(crd->reportview));
-  
-  guid = get_custom_report_selection(crd, _("You must select a report to delete."));
-  report_name = scm_to_locale_string(scm_call_2(template_menu_name, guid, SCM_BOOL_F));
-  
-  /* we must confirm the user wants to delete their precious custom report! */
-  if (!scm_is_null(guid)
-      && gnc_verify_dialog(crd->dialog, FALSE, "Are you sure you want to delete %s?", report_name)) 
+    SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
+    SCM guid;
+    const gchar* report_name;
+
+    sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(crd->reportview));
+
+    guid = get_custom_report_selection(crd, _("You must select a report to delete."));
+    report_name = scm_to_locale_string(scm_call_2(template_menu_name, guid, SCM_BOOL_F));
+
+    /* we must confirm the user wants to delete their precious custom report! */
+    if (!scm_is_null(guid)
+            && gnc_verify_dialog(crd->dialog, FALSE, "Are you sure you want to delete %s?", report_name))
     {
-      SCM del_report = scm_c_eval_string("gnc:delete-report");
-      scm_call_1(del_report, guid);
-      update_report_list(GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(crd->reportview)))
-			 , crd);
+        SCM del_report = scm_c_eval_string("gnc:delete-report");
+        scm_call_1(del_report, guid);
+        update_report_list(GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(crd->reportview)))
+                           , crd);
     }
-   
+
 }
 
 static void
 run_custom_report_clicked_cb (GtkWidget* button,
-			      CustomReportDialog *crd) 
+                              CustomReportDialog *crd)
 {
-  
-  SCM guid = get_custom_report_selection(crd, _("You must select a report to run."));
-  custom_report_run_report(guid, crd);
-  
+
+    SCM guid = get_custom_report_selection(crd, _("You must select a report to run."));
+    custom_report_run_report(guid, crd);
+
 }
 
 
@@ -332,28 +334,28 @@
  * this is the primary driver for the custom report dialog.
  *
  */
-void gnc_ui_custom_report(GncMainWindow * window) 
+void gnc_ui_custom_report(GncMainWindow * window)
 {
 
-  GladeXML* xml;
-  CustomReportDialog *crd;
-  
-  crd = g_new0(CustomReportDialog, 1);
-  
-  xml = gnc_glade_xml_new("custom-report-dialog.glade", "custom_report_dialog");
+    GladeXML* xml;
+    CustomReportDialog *crd;
 
-  crd->dialog = glade_xml_get_widget(xml, "custom_report_dialog");
-  crd->reportview = glade_xml_get_widget(xml, "custom_report_list_view");
-  set_reports_model(crd);
-  crd->window = window;
+    crd = g_new0(CustomReportDialog, 1);
 
-  /* connect the signals */
-  glade_xml_signal_connect_data(xml, "cancel_custom_report_clicked_cb", G_CALLBACK(cancel_custom_report_clicked_cb), crd);
-  glade_xml_signal_connect_data(xml, "custom_report_dialog_close_cb", G_CALLBACK(custom_report_dialog_close_cb), crd);
-  glade_xml_signal_connect_data(xml, "on_custom_report_list_view_row_activated", G_CALLBACK(on_custom_report_list_view_row_activated), crd);
-  glade_xml_signal_connect_data(xml, "on_delete_custom_report_clicked", G_CALLBACK(on_delete_custom_report_clicked), crd);
-  glade_xml_signal_connect_data(xml, "run_custom_report_clicked_cb", G_CALLBACK(run_custom_report_clicked_cb), crd);
-  
-  gtk_widget_show_all(crd->dialog);
-    
+    xml = gnc_glade_xml_new("custom-report-dialog.glade", "custom_report_dialog");
+
+    crd->dialog = glade_xml_get_widget(xml, "custom_report_dialog");
+    crd->reportview = glade_xml_get_widget(xml, "custom_report_list_view");
+    set_reports_model(crd);
+    crd->window = window;
+
+    /* connect the signals */
+    glade_xml_signal_connect_data(xml, "cancel_custom_report_clicked_cb", G_CALLBACK(cancel_custom_report_clicked_cb), crd);
+    glade_xml_signal_connect_data(xml, "custom_report_dialog_close_cb", G_CALLBACK(custom_report_dialog_close_cb), crd);
+    glade_xml_signal_connect_data(xml, "on_custom_report_list_view_row_activated", G_CALLBACK(on_custom_report_list_view_row_activated), crd);
+    glade_xml_signal_connect_data(xml, "on_delete_custom_report_clicked", G_CALLBACK(on_delete_custom_report_clicked), crd);
+    glade_xml_signal_connect_data(xml, "run_custom_report_clicked_cb", G_CALLBACK(run_custom_report_clicked_cb), crd);
+
+    gtk_widget_show_all(crd->dialog);
+
 }

Modified: gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -36,25 +36,28 @@
 
 StyleSheetDialog * gnc_style_sheet_dialog = NULL;
 
-struct _stylesheetdialog {
-  GtkWidget  * toplevel;
-  GtkTreeView   * list_view;
-  GtkListStore  * list_store;
-  GtkWidget  * options_frame;
+struct _stylesheetdialog
+{
+    GtkWidget  * toplevel;
+    GtkTreeView   * list_view;
+    GtkListStore  * list_store;
+    GtkWidget  * options_frame;
 };
 
-typedef struct ss_info {
-  GNCOptionWin  * odialog;
-  GNCOptionDB   * odb;
-  SCM           stylesheet;
-  GtkTreeRowReference *row_ref;
+typedef struct ss_info
+{
+    GNCOptionWin  * odialog;
+    GNCOptionDB   * odb;
+    SCM           stylesheet;
+    GtkTreeRowReference *row_ref;
 } ss_info;
 
-enum {
-  COLUMN_NAME,
-  COLUMN_STYLESHEET,
-  COLUMN_DIALOG,
-  N_COLUMNS
+enum
+{
+    COLUMN_NAME,
+    COLUMN_STYLESHEET,
+    COLUMN_DIALOG,
+    N_COLUMNS
 };
 
 
@@ -76,7 +79,8 @@
     else
         return;
 
-    if (scm_is_true(scm_eq_p(rep_ss, dirty_ss))) {
+    if (scm_is_true(scm_eq_p(rep_ss, dirty_ss)))
+    {
         func = scm_c_eval_string("gnc:report-set-dirty?!");
         /* This makes _me_ feel dirty! */
         if (scm_is_procedure(func))
@@ -88,15 +92,15 @@
 gnc_style_sheet_options_apply_cb(GNCOptionWin * propertybox,
                                  gpointer user_data)
 {
-  ss_info * ssi = (ss_info *)user_data;
-  GHashTable *reports = NULL;
+    ss_info * ssi = (ss_info *)user_data;
+    GHashTable *reports = NULL;
 
-  /* FIXME: shouldn't be global */
-  reports = gnc_reports_get_global();
-  if (reports)
-      g_hash_table_foreach(reports, dirty_same_stylesheet, ssi->stylesheet);
+    /* FIXME: shouldn't be global */
+    reports = gnc_reports_get_global();
+    if (reports)
+        g_hash_table_foreach(reports, dirty_same_stylesheet, ssi->stylesheet);
 
-  gnc_option_db_commit(ssi->odb);
+    gnc_option_db_commit(ssi->odb);
 }
 
 
@@ -104,33 +108,34 @@
 gnc_style_sheet_options_close_cb(GNCOptionWin * propertybox,
                                  gpointer user_data)
 {
-  ss_info * ssi = user_data;
-  GtkTreeIter iter;
+    ss_info * ssi = user_data;
+    GtkTreeIter iter;
 
-  if (gtk_tree_row_reference_valid (ssi->row_ref)) {
-    StyleSheetDialog * ss = gnc_style_sheet_dialog;
-    GtkTreePath *path = gtk_tree_row_reference_get_path (ssi->row_ref);
-    if (gtk_tree_model_get_iter (GTK_TREE_MODEL(ss->list_store), &iter, path))
-      gtk_list_store_set (ss->list_store, &iter,
-			  COLUMN_DIALOG, NULL,
-			  -1);
-    gtk_tree_path_free(path);
-  }
-  gtk_tree_row_reference_free (ssi->row_ref);
-  gnc_options_dialog_destroy(ssi->odialog);
-  gnc_option_db_destroy(ssi->odb);
-  scm_gc_unprotect_object(ssi->stylesheet);
-  g_free(ssi);
+    if (gtk_tree_row_reference_valid (ssi->row_ref))
+    {
+        StyleSheetDialog * ss = gnc_style_sheet_dialog;
+        GtkTreePath *path = gtk_tree_row_reference_get_path (ssi->row_ref);
+        if (gtk_tree_model_get_iter (GTK_TREE_MODEL(ss->list_store), &iter, path))
+            gtk_list_store_set (ss->list_store, &iter,
+                                COLUMN_DIALOG, NULL,
+                                -1);
+        gtk_tree_path_free(path);
+    }
+    gtk_tree_row_reference_free (ssi->row_ref);
+    gnc_options_dialog_destroy(ssi->odialog);
+    gnc_option_db_destroy(ssi->odb);
+    scm_gc_unprotect_object(ssi->stylesheet);
+    g_free(ssi);
 }
 
 
 static ss_info *
 gnc_style_sheet_dialog_create(StyleSheetDialog * ss,
-			      gchar *name,
-			      SCM sheet_info,
-			      GtkTreeRowReference *row_ref)
+                              gchar *name,
+                              SCM sheet_info,
+                              GtkTreeRowReference *row_ref)
 {
-  SCM get_options = scm_c_eval_string("gnc:html-style-sheet-options");
+    SCM get_options = scm_c_eval_string("gnc:html-style-sheet-options");
 
     SCM            scm_options = scm_call_1(get_options, sheet_info);
     ss_info        * ssinfo = g_new0(ss_info, 1);
@@ -149,15 +154,15 @@
 
     gnc_options_dialog_build_contents(ssinfo->odialog,
                                       ssinfo->odb);
-    gnc_options_dialog_set_apply_cb(ssinfo->odialog, 
+    gnc_options_dialog_set_apply_cb(ssinfo->odialog,
                                     gnc_style_sheet_options_apply_cb,
-                                    ssinfo);    
-    gnc_options_dialog_set_close_cb(ssinfo->odialog, 
+                                    ssinfo);
+    gnc_options_dialog_set_close_cb(ssinfo->odialog,
                                     gnc_style_sheet_options_close_cb,
                                     ssinfo);
     window = gnc_options_dialog_widget(ssinfo->odialog);
     gtk_window_set_transient_for(GTK_WINDOW(window),
-				 GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
+                                 GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
     gtk_window_set_destroy_with_parent(GTK_WINDOW(window), TRUE);
     gtk_window_present(GTK_WINDOW(window));
 
@@ -168,53 +173,56 @@
 static SCM
 gnc_style_sheet_new (StyleSheetDialog * ssd)
 {
-  SCM              make_ss   = scm_c_eval_string("gnc:make-html-style-sheet");
-  SCM              templates = scm_c_eval_string("(gnc:get-html-templates)");
-  SCM              t_name = scm_c_eval_string("gnc:html-style-sheet-template-name");
-  SCM              new_ss = SCM_BOOL_F;
-  GtkWidget        * template_combo;
-  GtkTreeModel     * template_model;
-  GtkWidget        * name_entry;
-  gint             dialog_retval;
-  char             * template_str = NULL;
-  const char       * name_str = NULL;
+    SCM              make_ss   = scm_c_eval_string("gnc:make-html-style-sheet");
+    SCM              templates = scm_c_eval_string("(gnc:get-html-templates)");
+    SCM              t_name = scm_c_eval_string("gnc:html-style-sheet-template-name");
+    SCM              new_ss = SCM_BOOL_F;
+    GtkWidget        * template_combo;
+    GtkTreeModel     * template_model;
+    GtkWidget        * name_entry;
+    gint             dialog_retval;
+    char             * template_str = NULL;
+    const char       * name_str = NULL;
 
-  /* get the new name for the style sheet */
-  GladeXML *xml = gnc_glade_xml_new ("report.glade",
-                                     "New Style Sheet Dialog");
-  GtkWidget * dlg = glade_xml_get_widget (xml, "New Style Sheet Dialog");
-  template_combo = glade_xml_get_widget (xml, "template_combobox");
-  name_entry     = glade_xml_get_widget (xml, "name_entry");
+    /* get the new name for the style sheet */
+    GladeXML *xml = gnc_glade_xml_new ("report.glade",
+                                       "New Style Sheet Dialog");
+    GtkWidget * dlg = glade_xml_get_widget (xml, "New Style Sheet Dialog");
+    template_combo = glade_xml_get_widget (xml, "template_combobox");
+    name_entry     = glade_xml_get_widget (xml, "name_entry");
 
-  /* Erase the initial dummy entry. */
-  template_model = gtk_combo_box_get_model(GTK_COMBO_BOX(template_combo));
-  gtk_list_store_clear(GTK_LIST_STORE(template_model));
+    /* Erase the initial dummy entry. */
+    template_model = gtk_combo_box_get_model(GTK_COMBO_BOX(template_combo));
+    gtk_list_store_clear(GTK_LIST_STORE(template_model));
 
-  /* put in the list of style sheet type names */
-  for(; !scm_is_null(templates); templates=SCM_CDR(templates)) {
-    SCM t = SCM_CAR(templates);
-    gtk_combo_box_append_text(GTK_COMBO_BOX(template_combo),
-		    scm_to_locale_string(scm_call_1(t_name, t)));
-  }
-  gtk_combo_box_set_active(GTK_COMBO_BOX(template_combo), 0);
-  
-  /* get the name */
-  gtk_window_set_transient_for (GTK_WINDOW(dlg), GTK_WINDOW(ssd->toplevel));
-  dialog_retval = gtk_dialog_run(GTK_DIALOG(dlg));
+    /* put in the list of style sheet type names */
+    for (; !scm_is_null(templates); templates = SCM_CDR(templates))
+    {
+        SCM t = SCM_CAR(templates);
+        gtk_combo_box_append_text(GTK_COMBO_BOX(template_combo),
+                                  scm_to_locale_string(scm_call_1(t_name, t)));
+    }
+    gtk_combo_box_set_active(GTK_COMBO_BOX(template_combo), 0);
 
-  if(dialog_retval == GTK_RESPONSE_OK) {
-    template_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(template_combo));
-    name_str     = gtk_entry_get_text(GTK_ENTRY(name_entry));
-    if(template_str && name_str) {
-      new_ss = scm_call_2(make_ss, 
-			  scm_makfrom0str(template_str),
-			  scm_makfrom0str(name_str));
+    /* get the name */
+    gtk_window_set_transient_for (GTK_WINDOW(dlg), GTK_WINDOW(ssd->toplevel));
+    dialog_retval = gtk_dialog_run(GTK_DIALOG(dlg));
+
+    if (dialog_retval == GTK_RESPONSE_OK)
+    {
+        template_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(template_combo));
+        name_str     = gtk_entry_get_text(GTK_ENTRY(name_entry));
+        if (template_str && name_str)
+        {
+            new_ss = scm_call_2(make_ss,
+                                scm_makfrom0str(template_str),
+                                scm_makfrom0str(name_str));
+        }
+        g_free(template_str);
     }
-    g_free(template_str);
-  }
 
-  gtk_widget_destroy(dlg);
-  return(new_ss);
+    gtk_widget_destroy(dlg);
+    return(new_ss);
 }
 
 
@@ -223,182 +231,189 @@
  ************************************************************/
 static void
 gnc_style_sheet_select_dialog_add_one(StyleSheetDialog * ss,
-				      SCM sheet_info,
-				      gboolean select)
+                                      SCM sheet_info,
+                                      gboolean select)
 {
-  SCM get_name, scm_name;
-  const gchar *c_name;
-  GtkTreeSelection *selection;
-  GtkTreeIter iter;
+    SCM get_name, scm_name;
+    const gchar *c_name;
+    GtkTreeSelection *selection;
+    GtkTreeIter iter;
 
-  get_name = scm_c_eval_string("gnc:html-style-sheet-name");
-  scm_name = scm_call_1(get_name, sheet_info);
-  c_name = scm_to_locale_string(scm_name);
-  if (!c_name)
-    return;
+    get_name = scm_c_eval_string("gnc:html-style-sheet-name");
+    scm_name = scm_call_1(get_name, sheet_info);
+    c_name = scm_to_locale_string(scm_name);
+    if (!c_name)
+        return;
 
-  /* add the column name */
-  scm_gc_protect_object(sheet_info);
-  gtk_list_store_append (ss->list_store, &iter);
-  gtk_list_store_set (ss->list_store, &iter,
-		      COLUMN_NAME, c_name,
-		      COLUMN_STYLESHEET, sheet_info,
-		      -1);
+    /* add the column name */
+    scm_gc_protect_object(sheet_info);
+    gtk_list_store_append (ss->list_store, &iter);
+    gtk_list_store_set (ss->list_store, &iter,
+                        COLUMN_NAME, c_name,
+                        COLUMN_STYLESHEET, sheet_info,
+                        -1);
 
-  if (select) {
-    selection = gtk_tree_view_get_selection (ss->list_view);
-    gtk_tree_selection_select_iter (selection, &iter);
-  }
+    if (select)
+    {
+        selection = gtk_tree_view_get_selection (ss->list_view);
+        gtk_tree_selection_select_iter (selection, &iter);
+    }
 }
 
 static void
 gnc_style_sheet_select_dialog_fill(StyleSheetDialog * ss)
 {
-  SCM stylesheets = scm_c_eval_string("(gnc:get-html-style-sheets)");
-  SCM sheet_info;
+    SCM stylesheets = scm_c_eval_string("(gnc:get-html-style-sheets)");
+    SCM sheet_info;
 
-  /* pack it full of content */
-  for(; !scm_is_null(stylesheets); stylesheets=SCM_CDR(stylesheets)) {
-    sheet_info = SCM_CAR(stylesheets);
-    gnc_style_sheet_select_dialog_add_one(ss, sheet_info, FALSE);
-  }
+    /* pack it full of content */
+    for (; !scm_is_null(stylesheets); stylesheets = SCM_CDR(stylesheets))
+    {
+        sheet_info = SCM_CAR(stylesheets);
+        gnc_style_sheet_select_dialog_add_one(ss, sheet_info, FALSE);
+    }
 }
 
 static void
 gnc_style_sheet_select_dialog_response_cb (GtkDialog *unused,
-					   gint response,
-					   gpointer user_data)
+        gint response,
+        gpointer user_data)
 {
-  StyleSheetDialog  * ss;
-  GtkTreeSelection  * selection;
-  GtkTreeRowReference * row_ref;
-  GtkTreeModel      * model;
-  GtkTreePath       * path;
-  GtkTreeIter         iter;
-  ss_info           * ssinfo;
-  SCM                 remover;
-  SCM sheet_info;
-  gchar *name;
+    StyleSheetDialog  * ss;
+    GtkTreeSelection  * selection;
+    GtkTreeRowReference * row_ref;
+    GtkTreeModel      * model;
+    GtkTreePath       * path;
+    GtkTreeIter         iter;
+    ss_info           * ssinfo;
+    SCM                 remover;
+    SCM sheet_info;
+    gchar *name;
 
-  ss = (StyleSheetDialog *)user_data;
-  switch (response) {
-   case GNC_RESPONSE_NEW:
-    sheet_info = gnc_style_sheet_new(ss);
-    if (sheet_info == SCM_BOOL_F)
-      break;
-    gnc_style_sheet_select_dialog_add_one(ss, sheet_info, TRUE);
-    /* Fall through */
+    ss = (StyleSheetDialog *)user_data;
+    switch (response)
+    {
+    case GNC_RESPONSE_NEW:
+        sheet_info = gnc_style_sheet_new(ss);
+        if (sheet_info == SCM_BOOL_F)
+            break;
+        gnc_style_sheet_select_dialog_add_one(ss, sheet_info, TRUE);
+        /* Fall through */
 
-   case GNC_RESPONSE_EDIT:
-    selection = gtk_tree_view_get_selection (ss->list_view);
-    if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
-      gtk_tree_model_get (model, &iter,
-			  COLUMN_NAME, &name,
-			  COLUMN_STYLESHEET, &sheet_info,
-			  -1);
-      /* Fire off options dialog here */
-      path = gtk_tree_model_get_path (GTK_TREE_MODEL(ss->list_store), &iter);
-      row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL(ss->list_store), path);
-      ssinfo = gnc_style_sheet_dialog_create(ss, name, sheet_info, row_ref);
-      gtk_list_store_set (ss->list_store, &iter,
-			  COLUMN_DIALOG, ssinfo,
-			  -1);
-      g_free(name);
-    }
-    break;
-    
-   case GNC_RESPONSE_DELETE:
-    selection = gtk_tree_view_get_selection (ss->list_view);
-    if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
-      gtk_tree_model_get (model, &iter,
-			  COLUMN_STYLESHEET, &sheet_info,
-			  COLUMN_DIALOG, &ssinfo,
-			  -1);
-      gtk_list_store_remove (ss->list_store, &iter);
+    case GNC_RESPONSE_EDIT:
+        selection = gtk_tree_view_get_selection (ss->list_view);
+        if (gtk_tree_selection_get_selected (selection, &model, &iter))
+        {
+            gtk_tree_model_get (model, &iter,
+                                COLUMN_NAME, &name,
+                                COLUMN_STYLESHEET, &sheet_info,
+                                -1);
+            /* Fire off options dialog here */
+            path = gtk_tree_model_get_path (GTK_TREE_MODEL(ss->list_store), &iter);
+            row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL(ss->list_store), path);
+            ssinfo = gnc_style_sheet_dialog_create(ss, name, sheet_info, row_ref);
+            gtk_list_store_set (ss->list_store, &iter,
+                                COLUMN_DIALOG, ssinfo,
+                                -1);
+            g_free(name);
+        }
+        break;
 
-      if (ssinfo)
-	gnc_style_sheet_options_close_cb(NULL, ssinfo);
-      remover = scm_c_eval_string("gnc:html-style-sheet-remove");
-      scm_call_1(remover, sheet_info);
-      scm_gc_unprotect_object(sheet_info);
+    case GNC_RESPONSE_DELETE:
+        selection = gtk_tree_view_get_selection (ss->list_view);
+        if (gtk_tree_selection_get_selected (selection, &model, &iter))
+        {
+            gtk_tree_model_get (model, &iter,
+                                COLUMN_STYLESHEET, &sheet_info,
+                                COLUMN_DIALOG, &ssinfo,
+                                -1);
+            gtk_list_store_remove (ss->list_store, &iter);
+
+            if (ssinfo)
+                gnc_style_sheet_options_close_cb(NULL, ssinfo);
+            remover = scm_c_eval_string("gnc:html-style-sheet-remove");
+            scm_call_1(remover, sheet_info);
+            scm_gc_unprotect_object(sheet_info);
+        }
+        break;
+
+    case GTK_RESPONSE_CLOSE:
+    default:
+        gnc_style_sheet_dialog = NULL;
+        gtk_widget_destroy(ss->toplevel);
+        g_free(ss);
+        break;
     }
-    break;
-
-   case GTK_RESPONSE_CLOSE:
-   default:
-    gnc_style_sheet_dialog = NULL;
-    gtk_widget_destroy(ss->toplevel);
-    g_free(ss);
-    break;
-  }
 }
 
 
 static void
 gnc_style_sheet_select_dialog_event_cb (GtkWidget *widget,
-					GdkEvent *event,
-					gpointer user_data)
+                                        GdkEvent *event,
+                                        gpointer user_data)
 {
-  StyleSheetDialog  * ss = user_data;
+    StyleSheetDialog  * ss = user_data;
 
-  g_return_if_fail(event != NULL);
-  g_return_if_fail(ss != NULL);
+    g_return_if_fail(event != NULL);
+    g_return_if_fail(ss != NULL);
 
-  if (event->type != GDK_2BUTTON_PRESS)
-    return;
+    if (event->type != GDK_2BUTTON_PRESS)
+        return;
 
-  /* Synthesize a click of the edit button */
-  gnc_style_sheet_select_dialog_response_cb (NULL, GNC_RESPONSE_EDIT, ss);
+    /* Synthesize a click of the edit button */
+    gnc_style_sheet_select_dialog_response_cb (NULL, GNC_RESPONSE_EDIT, ss);
 }
 
 
 static StyleSheetDialog *
 gnc_style_sheet_select_dialog_create(void)
 {
-  StyleSheetDialog  * ss = g_new0(StyleSheetDialog, 1);
-  GladeXML          * xml;
-  GtkCellRenderer   * renderer;
-  GtkTreeSelection  * selection;
+    StyleSheetDialog  * ss = g_new0(StyleSheetDialog, 1);
+    GladeXML          * xml;
+    GtkCellRenderer   * renderer;
+    GtkTreeSelection  * selection;
 
-  xml = gnc_glade_xml_new ("report.glade", "Select Style Sheet Dialog");
+    xml = gnc_glade_xml_new ("report.glade", "Select Style Sheet Dialog");
 
-  ss->toplevel   = glade_xml_get_widget (xml, "Select Style Sheet Dialog");
+    ss->toplevel   = glade_xml_get_widget (xml, "Select Style Sheet Dialog");
 
-  ss->list_view  = GTK_TREE_VIEW(glade_xml_get_widget (xml, "style_sheet_list_view"));
-  ss->list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER);
-  gtk_tree_view_set_model(ss->list_view, GTK_TREE_MODEL(ss->list_store));
-  g_object_unref(ss->list_store);
-  renderer = gtk_cell_renderer_text_new ();
-  gtk_tree_view_insert_column_with_attributes(ss->list_view, -1,
-					      _("Style Sheet Name"), renderer,
-					      "text", COLUMN_NAME,
-					      NULL);
+    ss->list_view  = GTK_TREE_VIEW(glade_xml_get_widget (xml, "style_sheet_list_view"));
+    ss->list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER);
+    gtk_tree_view_set_model(ss->list_view, GTK_TREE_MODEL(ss->list_store));
+    g_object_unref(ss->list_store);
+    renderer = gtk_cell_renderer_text_new ();
+    gtk_tree_view_insert_column_with_attributes(ss->list_view, -1,
+            _("Style Sheet Name"), renderer,
+            "text", COLUMN_NAME,
+            NULL);
 
-  selection = gtk_tree_view_get_selection (ss->list_view);
-  gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
+    selection = gtk_tree_view_get_selection (ss->list_view);
+    gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
 
-  g_signal_connect(ss->toplevel, "response",
-		   G_CALLBACK(gnc_style_sheet_select_dialog_response_cb), ss); 
-  g_signal_connect(ss->list_view, "event-after",
-		   G_CALLBACK(gnc_style_sheet_select_dialog_event_cb), ss); 
-  
-  gnc_style_sheet_select_dialog_fill(ss);
+    g_signal_connect(ss->toplevel, "response",
+                     G_CALLBACK(gnc_style_sheet_select_dialog_response_cb), ss);
+    g_signal_connect(ss->list_view, "event-after",
+                     G_CALLBACK(gnc_style_sheet_select_dialog_event_cb), ss);
 
-  gtk_widget_show_all(ss->toplevel);
+    gnc_style_sheet_select_dialog_fill(ss);
 
-  return ss;
+    gtk_widget_show_all(ss->toplevel);
+
+    return ss;
 }
 
 
 void
 gnc_style_sheet_dialog_open(void)
 {
-  if(gnc_style_sheet_dialog) {
-    gtk_window_present(GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
-  }
-  else {
-    gnc_style_sheet_dialog = 
-      gnc_style_sheet_select_dialog_create();
-  }
+    if (gnc_style_sheet_dialog)
+    {
+        gtk_window_present(GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
+    }
+    else
+    {
+        gnc_style_sheet_dialog =
+            gnc_style_sheet_select_dialog_create();
+    }
 }
 

Modified: gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -71,53 +71,54 @@
 
 /* NW: you can add GNC_MOD_REPORT to gnc-engine.h
 or simply define it locally. Any unique string with
-a gnucash- prefix will do. Then just set a log level 
+a gnucash- prefix will do. Then just set a log level
 with qof_log_set_level().*/
 static QofLogModule log_module = GNC_MOD_GUI;
 
 static GObjectClass *parent_class = NULL;
 
 // Property-id values.
-enum {
+enum
+{
     PROP_0,
     PROP_REPORT_ID,
-  };
+};
 
 typedef struct GncPluginPageReportPrivate
 {
-        /// The report-id
-        int reportId;
-        gint component_manager_id;
+    /// The report-id
+    int reportId;
+    gint component_manager_id;
 
-        /// The report which this Page is satisifying
-        SCM cur_report;
-        /// The Option DB for this report.
-        GNCOptionDB *cur_odb;
-        SCM option_change_cb_id;
+    /// The report which this Page is satisifying
+    SCM cur_report;
+    /// The Option DB for this report.
+    GNCOptionDB *cur_odb;
+    SCM option_change_cb_id;
 
-        /* initial_report is special; it's the one that's saved and 
-         * restored.  The name_change_callback only gets called when
-         * the initial_report name is changed. */
-        SCM          initial_report; 
-        GNCOptionDB  * initial_odb;
-        SCM          name_change_cb_id;
+    /* initial_report is special; it's the one that's saved and
+     * restored.  The name_change_callback only gets called when
+     * the initial_report name is changed. */
+    SCM          initial_report;
+    GNCOptionDB  * initial_odb;
+    SCM          name_change_cb_id;
 
-        /* keep a list of edited reports so that we can destroy them when
-         * the window is closed. */
-        SCM          edited_reports;
+    /* keep a list of edited reports so that we can destroy them when
+     * the window is closed. */
+    SCM          edited_reports;
 
-        /* This is set to mark the fact that we need to reload the html */
-        gboolean	need_reload;
+    /* This is set to mark the fact that we need to reload the html */
+    gboolean	need_reload;
 
-        /* The page is in the process of reloading the html */
-        gboolean	reloading;
+    /* The page is in the process of reloading the html */
+    gboolean	reloading;
 
-        /// the gnc_html abstraction this PluginPage contains
+    /// the gnc_html abstraction this PluginPage contains
 //        gnc_html *html;
-        GncHtml *html;
+    GncHtml *html;
 
-        /// the container the above HTML widget is in.
-        GtkContainer *container;
+    /// the container the above HTML widget is in.
+    GtkContainer *container;
 } GncPluginPageReportPrivate;
 
 #define GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(o)  \
@@ -142,8 +143,8 @@
 static int gnc_plugin_page_report_check_urltype(URLType t);
 //static void gnc_plugin_page_report_load_cb(gnc_html * html, URLType type,
 static void gnc_plugin_page_report_load_cb(GncHtml * html, URLType type,
-                                      const gchar * location, const gchar * label,
-                                      gpointer data);
+        const gchar * location, const gchar * label,
+        gpointer data);
 static void gnc_plugin_page_report_expose_event_cb(GtkWidget *unused, GdkEventExpose *unused1, gpointer data);
 static void gnc_plugin_page_report_refresh (gpointer data);
 static void gnc_plugin_page_report_set_fwd_button(GncPluginPageReport * page, int enabled);
@@ -170,27 +171,29 @@
 GType
 gnc_plugin_page_report_get_type (void)
 {
-	static GType gnc_plugin_page_report_type = 0;
+    static GType gnc_plugin_page_report_type = 0;
 
-	if (gnc_plugin_page_report_type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (GncPluginPageReportClass),
-			NULL,
-			NULL,
-			(GClassInitFunc) gnc_plugin_page_report_class_init,
-			NULL,
-			NULL,
-			sizeof (GncPluginPageReport),
-			0,
-			(GInstanceInitFunc) gnc_plugin_page_report_init
-		};
-		
-		gnc_plugin_page_report_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
-                                                                      "GncPluginPageReport",
-                                                                      &our_info, 0);
-	}
+    if (gnc_plugin_page_report_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginPageReportClass),
+            NULL,
+            NULL,
+            (GClassInitFunc) gnc_plugin_page_report_class_init,
+            NULL,
+            NULL,
+            sizeof (GncPluginPageReport),
+            0,
+            (GInstanceInitFunc) gnc_plugin_page_report_init
+        };
 
-	return gnc_plugin_page_report_type;
+        gnc_plugin_page_report_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
+                                      "GncPluginPageReport",
+                                      &our_info, 0);
+    }
+
+    return gnc_plugin_page_report_type;
 }
 
 static void
@@ -199,21 +202,21 @@
                                      GValue *value,
                                      GParamSpec *pspec )
 {
-        GncPluginPageReport *rep;
-        GncPluginPageReportPrivate *priv;
+    GncPluginPageReport *rep;
+    GncPluginPageReportPrivate *priv;
 
-        rep = GNC_PLUGIN_PAGE_REPORT( obj );
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(rep);
-        
-        switch ( prop_id )
-        {
-        case PROP_REPORT_ID:
-                g_value_set_int( value, priv->reportId );
-                break;
-        default:
-                PERR( "Unknown property id %d", prop_id );
-                break;
-        }
+    rep = GNC_PLUGIN_PAGE_REPORT( obj );
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(rep);
+
+    switch ( prop_id )
+    {
+    case PROP_REPORT_ID:
+        g_value_set_int( value, priv->reportId );
+        break;
+    default:
+        PERR( "Unknown property id %d", prop_id );
+        break;
+    }
 }
 
 static void
@@ -222,159 +225,159 @@
                                      const GValue *value,
                                      GParamSpec *pspec )
 {
-        GncPluginPageReport *rep;
-        GncPluginPageReportPrivate *priv;
+    GncPluginPageReport *rep;
+    GncPluginPageReportPrivate *priv;
 
-        rep = GNC_PLUGIN_PAGE_REPORT( obj );
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(rep);
+    rep = GNC_PLUGIN_PAGE_REPORT( obj );
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(rep);
 
-        DEBUG( "setting property with id %d / %p to value %d",
-               prop_id, priv, g_value_get_int( value ) );
+    DEBUG( "setting property with id %d / %p to value %d",
+           prop_id, priv, g_value_get_int( value ) );
 
-        switch ( prop_id )
-        {
-        case PROP_REPORT_ID:
-                priv->reportId = g_value_get_int( value );
-                break;
-        default:
-                PERR( "unknown property id %d", prop_id );
-                break;
-        }
-               
+    switch ( prop_id )
+    {
+    case PROP_REPORT_ID:
+        priv->reportId = g_value_get_int( value );
+        break;
+    default:
+        PERR( "unknown property id %d", prop_id );
+        break;
+    }
+
 }
 
 static void
 gnc_plugin_page_report_class_init (GncPluginPageReportClass *klass)
 {
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-	GncPluginPageClass *gnc_plugin_page_class = GNC_PLUGIN_PAGE_CLASS(klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GncPluginPageClass *gnc_plugin_page_class = GNC_PLUGIN_PAGE_CLASS(klass);
 
-	parent_class = g_type_class_peek_parent (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-        object_class->constructor = gnc_plugin_page_report_constructor;
-	object_class->finalize = gnc_plugin_page_report_finalize;
+    object_class->constructor = gnc_plugin_page_report_constructor;
+    object_class->finalize = gnc_plugin_page_report_finalize;
 
-        object_class->set_property = gnc_plugin_page_report_set_property;
-        object_class->get_property = gnc_plugin_page_report_get_property;
+    object_class->set_property = gnc_plugin_page_report_set_property;
+    object_class->get_property = gnc_plugin_page_report_get_property;
 
-        // FIXME: stock reporting icon?
-	//gnc_plugin_page_class->tab_icon        = GNC_STOCK_ACCOUNT;
-	gnc_plugin_page_class->plugin_name     = GNC_PLUGIN_PAGE_REPORT_NAME;
+    // FIXME: stock reporting icon?
+    //gnc_plugin_page_class->tab_icon        = GNC_STOCK_ACCOUNT;
+    gnc_plugin_page_class->plugin_name     = GNC_PLUGIN_PAGE_REPORT_NAME;
 
-	gnc_plugin_page_class->create_widget   = gnc_plugin_page_report_create_widget;
-	gnc_plugin_page_class->destroy_widget  = gnc_plugin_page_report_destroy_widget;
-	gnc_plugin_page_class->save_page       = gnc_plugin_page_report_save_page;
-	gnc_plugin_page_class->recreate_page   = gnc_plugin_page_report_recreate_page;
-	gnc_plugin_page_class->page_name_changed = gnc_plugin_page_report_name_changed;
-	gnc_plugin_page_class->update_edit_menu_actions = gnc_plugin_page_report_update_edit_menu;
-	gnc_plugin_page_class->finish_pending   = gnc_plugin_page_report_finish_pending;
+    gnc_plugin_page_class->create_widget   = gnc_plugin_page_report_create_widget;
+    gnc_plugin_page_class->destroy_widget  = gnc_plugin_page_report_destroy_widget;
+    gnc_plugin_page_class->save_page       = gnc_plugin_page_report_save_page;
+    gnc_plugin_page_class->recreate_page   = gnc_plugin_page_report_recreate_page;
+    gnc_plugin_page_class->page_name_changed = gnc_plugin_page_report_name_changed;
+    gnc_plugin_page_class->update_edit_menu_actions = gnc_plugin_page_report_update_edit_menu;
+    gnc_plugin_page_class->finish_pending   = gnc_plugin_page_report_finish_pending;
 
-	g_type_class_add_private(klass, sizeof(GncPluginPageReportPrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginPageReportPrivate));
 
-        // create the "reportId" property
-        g_object_class_install_property( object_class,
-                                         PROP_REPORT_ID,
-                                         g_param_spec_int( "report-id",
-                                                           _("The numeric ID of the report."),
-                                                           _("The numeric ID of the report."),
-                                                           -1, G_MAXINT, -1, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE ) );
+    // create the "reportId" property
+    g_object_class_install_property( object_class,
+                                     PROP_REPORT_ID,
+                                     g_param_spec_int( "report-id",
+                                             _("The numeric ID of the report."),
+                                             _("The numeric ID of the report."),
+                                             -1, G_MAXINT, -1, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE ) );
 
-/* JSLED: report-selected?
-	plugin_page_signals[ACCOUNT_SELECTED] =
-	  g_signal_new ("account_selected",
-			G_OBJECT_CLASS_TYPE (object_class),
-			G_SIGNAL_RUN_FIRST,
-			G_STRUCT_OFFSET (GncPluginPageReportClass, account_selected),
-			NULL, NULL,
-			g_cclosure_marshal_VOID__POINTER,
-			G_TYPE_NONE, 1,
-			G_TYPE_POINTER);
-*/
+    /* JSLED: report-selected?
+    	plugin_page_signals[ACCOUNT_SELECTED] =
+    	  g_signal_new ("account_selected",
+    			G_OBJECT_CLASS_TYPE (object_class),
+    			G_SIGNAL_RUN_FIRST,
+    			G_STRUCT_OFFSET (GncPluginPageReportClass, account_selected),
+    			NULL, NULL,
+    			g_cclosure_marshal_VOID__POINTER,
+    			G_TYPE_NONE, 1,
+    			G_TYPE_POINTER);
+    */
 }
 
 static void
 gnc_plugin_page_report_finalize (GObject *object)
 {
-	GncPluginPageReport *page;
-	GncPluginPageReportPrivate *priv;
+    GncPluginPageReport *page;
+    GncPluginPageReportPrivate *priv;
 
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE_REPORT (object));
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REPORT (object));
 
-	ENTER("object %p", object);
-	page = GNC_PLUGIN_PAGE_REPORT (object);
-	priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(page);
+    ENTER("object %p", object);
+    page = GNC_PLUGIN_PAGE_REPORT (object);
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(page);
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
-	LEAVE(" ");
+    G_OBJECT_CLASS (parent_class)->finalize (object);
+    LEAVE(" ");
 }
 
 static
 GtkWidget*
 gnc_plugin_page_report_create_widget( GncPluginPage *page )
 {
-        GncPluginPageReport *report;
-        GncPluginPageReportPrivate *priv;
-        GtkWindow *topLvl;
-        URLType type;
-        char * id_name;
-        char * child_name;
-        char * url_location = NULL;
-        char * url_label = NULL;
+    GncPluginPageReport *report;
+    GncPluginPageReportPrivate *priv;
+    GtkWindow *topLvl;
+    URLType type;
+    char * id_name;
+    char * child_name;
+    char * url_location = NULL;
+    char * url_label = NULL;
 
-	ENTER("page %p", page);
+    ENTER("page %p", page);
 
-        report = GNC_PLUGIN_PAGE_REPORT(page);
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    report = GNC_PLUGIN_PAGE_REPORT(page);
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
 
-        topLvl = GTK_WINDOW(gnc_ui_get_toplevel());
+    topLvl = GTK_WINDOW(gnc_ui_get_toplevel());
 //        priv->html = gnc_html_new( topLvl );
-	priv->html = gnc_html_factory_create_html();
-		gnc_html_set_parent( priv->html, topLvl );
+    priv->html = gnc_html_factory_create_html();
+    gnc_html_set_parent( priv->html, topLvl );
 
-        gnc_html_history_set_node_destroy_cb(gnc_html_get_history(priv->html),
-                                             gnc_plugin_page_report_history_destroy_cb,
-                                             (gpointer)priv);
-  
-        priv->container = GTK_CONTAINER(gtk_frame_new(NULL));
-        gtk_frame_set_shadow_type(GTK_FRAME(priv->container), GTK_SHADOW_NONE);
-  
-        gtk_container_add(GTK_CONTAINER(priv->container), 
-                          gnc_html_get_widget(priv->html));
-  
-        priv->component_manager_id =
-          gnc_register_gui_component(WINDOW_REPORT_CM_CLASS, NULL,
-                                     close_handler, page);
-        gnc_gui_component_set_session(priv->component_manager_id,
-                                      gnc_get_current_session());
-  
-        gnc_html_set_urltype_cb(priv->html, gnc_plugin_page_report_check_urltype);
-        gnc_html_set_load_cb(priv->html, gnc_plugin_page_report_load_cb, report);
+    gnc_html_history_set_node_destroy_cb(gnc_html_get_history(priv->html),
+                                         gnc_plugin_page_report_history_destroy_cb,
+                                         (gpointer)priv);
 
-        // FIXME.  This is f^-1(f(x)), isn't it?
-        DEBUG( "id=%d", priv->reportId );
-        id_name = g_strdup_printf("id=%d", priv->reportId );
-        child_name = gnc_build_url( URL_TYPE_REPORT, id_name, NULL );
-        type = gnc_html_parse_url( priv->html, child_name, &url_location, &url_label);
-        DEBUG( "passing id_name=[%s] child_name=[%s] type=[%s], location=[%s], label=[%s]",
-               id_name, child_name ? child_name : "(null)",
-               type ? type : "(null)", url_location ? url_location : "(null)",
-               url_label ? url_label : "(null)" );
+    priv->container = GTK_CONTAINER(gtk_frame_new(NULL));
+    gtk_frame_set_shadow_type(GTK_FRAME(priv->container), GTK_SHADOW_NONE);
 
-		g_free(id_name);
-		g_free(child_name);
-        gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
-        gnc_html_show_url(priv->html, type, url_location, url_label, 0);
-		g_free(url_location);
-        gnc_window_set_progressbar_window( NULL );
+    gtk_container_add(GTK_CONTAINER(priv->container),
+                      gnc_html_get_widget(priv->html));
 
-        g_signal_connect(priv->container, "expose_event",
-			 G_CALLBACK(gnc_plugin_page_report_expose_event_cb), report);
-  
-        gtk_widget_show_all( GTK_WIDGET(priv->container) );
+    priv->component_manager_id =
+        gnc_register_gui_component(WINDOW_REPORT_CM_CLASS, NULL,
+                                   close_handler, page);
+    gnc_gui_component_set_session(priv->component_manager_id,
+                                  gnc_get_current_session());
 
-	LEAVE("container %p", priv->container);
+    gnc_html_set_urltype_cb(priv->html, gnc_plugin_page_report_check_urltype);
+    gnc_html_set_load_cb(priv->html, gnc_plugin_page_report_load_cb, report);
 
-        return GTK_WIDGET( priv->container );
+    // FIXME.  This is f^-1(f(x)), isn't it?
+    DEBUG( "id=%d", priv->reportId );
+    id_name = g_strdup_printf("id=%d", priv->reportId );
+    child_name = gnc_build_url( URL_TYPE_REPORT, id_name, NULL );
+    type = gnc_html_parse_url( priv->html, child_name, &url_location, &url_label);
+    DEBUG( "passing id_name=[%s] child_name=[%s] type=[%s], location=[%s], label=[%s]",
+           id_name, child_name ? child_name : "(null)",
+           type ? type : "(null)", url_location ? url_location : "(null)",
+           url_label ? url_label : "(null)" );
+
+    g_free(id_name);
+    g_free(child_name);
+    gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
+    gnc_html_show_url(priv->html, type, url_location, url_label, 0);
+    g_free(url_location);
+    gnc_window_set_progressbar_window( NULL );
+
+    g_signal_connect(priv->container, "expose_event",
+                     G_CALLBACK(gnc_plugin_page_report_expose_event_cb), report);
+
+    gtk_widget_show_all( GTK_WIDGET(priv->container) );
+
+    LEAVE("container %p", priv->container);
+
+    return GTK_WIDGET( priv->container );
 }
 
 /********************************************************************
@@ -384,11 +387,14 @@
 static int
 gnc_plugin_page_report_check_urltype(URLType t)
 {
-  if (!safe_strcmp (t, URL_TYPE_REPORT)) {
-    return TRUE;
-  } else {
-    return FALSE;
-  }
+    if (!safe_strcmp (t, URL_TYPE_REPORT))
+    {
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 
 /**
@@ -398,139 +404,155 @@
 static void
 gnc_plugin_page_report_setup( GncPluginPage *ppage )
 {
-        GncPluginPageReport *report = GNC_PLUGIN_PAGE_REPORT(ppage);
-        GncPluginPageReportPrivate *priv;
-        SCM  set_needs_save = scm_c_eval_string("gnc:report-set-needs-save?!");
-        SCM  inst_report;
-        int  report_id;
+    GncPluginPageReport *report = GNC_PLUGIN_PAGE_REPORT(ppage);
+    GncPluginPageReportPrivate *priv;
+    SCM  set_needs_save = scm_c_eval_string("gnc:report-set-needs-save?!");
+    SCM  inst_report;
+    int  report_id;
 
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-        priv->cur_report        = SCM_BOOL_F;
-        priv->initial_report    = SCM_BOOL_F;
-        priv->edited_reports    = SCM_EOL;
-        priv->name_change_cb_id = SCM_BOOL_F;
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    priv->cur_report        = SCM_BOOL_F;
+    priv->initial_report    = SCM_BOOL_F;
+    priv->edited_reports    = SCM_EOL;
+    priv->name_change_cb_id = SCM_BOOL_F;
 
-        g_object_get( ppage, "report-id", &report_id, NULL );
+    g_object_get( ppage, "report-id", &report_id, NULL );
 
-        PINFO("report-id: %d\n", report_id);
-        
-        /* get the inst-report from the Scheme-side hash, and get its
-         * options and editor thunk */
-        if ((inst_report = gnc_report_find(report_id)) == SCM_BOOL_F) {
-                return;
-        }
-        
-        if (priv->initial_report == SCM_BOOL_F) {
-                priv->initial_report = inst_report;
-                scm_gc_protect_object(priv->initial_report);
-        }
+    PINFO("report-id: %d\n", report_id);
 
-        // all reports need [to be] saved immediately after they're created.
-        PINFO("set needs save");
-        scm_call_2(set_needs_save, inst_report, SCM_BOOL_T);
+    /* get the inst-report from the Scheme-side hash, and get its
+     * options and editor thunk */
+    if ((inst_report = gnc_report_find(report_id)) == SCM_BOOL_F)
+    {
+        return;
+    }
+
+    if (priv->initial_report == SCM_BOOL_F)
+    {
+        priv->initial_report = inst_report;
+        scm_gc_protect_object(priv->initial_report);
+    }
+
+    // all reports need [to be] saved immediately after they're created.
+    PINFO("set needs save");
+    scm_call_2(set_needs_save, inst_report, SCM_BOOL_T);
 }
 
 /********************************************************************
  * gnc_plugin_page_report_load_cb
- * called after a report is loaded into the gnc_html widget 
+ * called after a report is loaded into the gnc_html widget
  ********************************************************************/
-static void 
-//gnc_plugin_page_report_load_cb(gnc_html * html, URLType type, 
-gnc_plugin_page_report_load_cb(GncHtml * html, URLType type, 
-                               const gchar * location, const gchar * label, 
+static void
+//gnc_plugin_page_report_load_cb(gnc_html * html, URLType type,
+gnc_plugin_page_report_load_cb(GncHtml * html, URLType type,
+                               const gchar * location, const gchar * label,
                                gpointer data)
 {
-        GncPluginPageReport *report = GNC_PLUGIN_PAGE_REPORT(data);
-        GncPluginPageReportPrivate *priv;
-        int  report_id;
-        SCM  get_options    = scm_c_eval_string("gnc:report-options");
-        SCM  set_needs_save = scm_c_eval_string("gnc:report-set-needs-save?!");
-        SCM  inst_report;
+    GncPluginPageReport *report = GNC_PLUGIN_PAGE_REPORT(data);
+    GncPluginPageReportPrivate *priv;
+    int  report_id;
+    SCM  get_options    = scm_c_eval_string("gnc:report-options");
+    SCM  set_needs_save = scm_c_eval_string("gnc:report-set-needs-save?!");
+    SCM  inst_report;
 
-        ENTER( "load_cb: type=[%s], location=[%s], label=[%s]",
-               type ? type : "(null)", location ? location : "(null)",
-               label ? label : "(null)" );
+    ENTER( "load_cb: type=[%s], location=[%s], label=[%s]",
+           type ? type : "(null)", location ? location : "(null)",
+           label ? label : "(null)" );
 
-        /* we get this callback if a new report is requested to be loaded OR
-         * if any URL is clicked.  If an options URL is clicked, we want to
-         * know about it */
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-        if (!safe_strcmp (type, URL_TYPE_REPORT)
+    /* we get this callback if a new report is requested to be loaded OR
+     * if any URL is clicked.  If an options URL is clicked, we want to
+     * know about it */
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    if (!safe_strcmp (type, URL_TYPE_REPORT)
             && location
             && (strlen(location) > 3)
-            && !strncmp("id=", location, 3)) {
-	        report_id = atoi(location+3);
-                DEBUG( "parsed id=%d", report_id );
+            && !strncmp("id=", location, 3))
+    {
+        report_id = atoi(location + 3);
+        DEBUG( "parsed id=%d", report_id );
+    }
+    else if (!safe_strcmp( type, URL_TYPE_OPTIONS)
+             && location
+             && (strlen(location) > 10)
+             && !strncmp("report-id=", location, 10))
+    {
+        report_id = atoi(location + 10);
+        inst_report = gnc_report_find(report_id);
+        if (inst_report != SCM_BOOL_F)
+        {
+            gnc_plugin_page_report_add_edited_report(priv, inst_report);
         }
-        else if (!safe_strcmp( type, URL_TYPE_OPTIONS)
-                 && location
-                 && (strlen(location) > 10)
-                 && !strncmp("report-id=", location, 10)) {
-                report_id = atoi(location+10);
-                inst_report = gnc_report_find(report_id);
-                if (inst_report != SCM_BOOL_F) {
-                        gnc_plugin_page_report_add_edited_report(priv, inst_report);
-                }
-                LEAVE("");
-                return;
-        } else {
-                LEAVE( " unknown URL type [%s] location [%s]", type, location );
-                return;
-        }
-        
-        /* get the inst-report from the hash, and get its
-         * options and editor thunk */
-        if ((inst_report = gnc_report_find(report_id)) == SCM_BOOL_F) {
-                LEAVE( "error getting inst_report" );
-                return;
-        }
+        LEAVE("");
+        return;
+    }
+    else
+    {
+        LEAVE( " unknown URL type [%s] location [%s]", type, location );
+        return;
+    }
 
-        if (priv->initial_report == SCM_BOOL_F) {
-                priv->initial_report = inst_report;
-                scm_gc_protect_object(priv->initial_report);
-                
-                DEBUG("calling set_needs_save for report with id=%d", report_id);
-                scm_call_2(set_needs_save, inst_report, SCM_BOOL_T);
-                
-                priv->initial_odb = gnc_option_db_new(scm_call_1(get_options, inst_report));  
-                priv->name_change_cb_id = 
-                        gnc_option_db_register_change_callback(priv->initial_odb,
-                                                               gnc_plugin_page_report_refresh,
-                                                               priv,
-                                                               "General", "Report name");
-        }
-        
-        if ((priv->cur_report != SCM_BOOL_F) && (priv->cur_odb != NULL)) {
-                gnc_option_db_unregister_change_callback_id(priv->cur_odb,
-                                                            priv->option_change_cb_id);
-                gnc_option_db_destroy(priv->cur_odb);
-                priv->cur_odb = NULL;
-        }
-        
-        if (priv->cur_report != SCM_BOOL_F)
-                scm_gc_unprotect_object(priv->cur_report);
-        priv->cur_report = inst_report;
-        scm_gc_protect_object(priv->cur_report);
-        
-        priv->cur_odb = gnc_option_db_new(scm_call_1(get_options, inst_report));  
-        priv->option_change_cb_id = 
-                gnc_option_db_register_change_callback(priv->cur_odb,
-                                                       gnc_plugin_page_report_option_change_cb,
-                                                       report, NULL, NULL);
-        
-        if (gnc_html_history_forward_p(gnc_html_get_history(priv->html))) {
-                gnc_plugin_page_report_set_fwd_button(report, TRUE); 
-        } else {
-                gnc_plugin_page_report_set_fwd_button(report, FALSE); 
-        }
-        
-        if(gnc_html_history_back_p(gnc_html_get_history(priv->html))) {
-                gnc_plugin_page_report_set_back_button(report, TRUE); 
-        } else {
-                gnc_plugin_page_report_set_back_button(report, FALSE); 
-        }
+    /* get the inst-report from the hash, and get its
+     * options and editor thunk */
+    if ((inst_report = gnc_report_find(report_id)) == SCM_BOOL_F)
+    {
+        LEAVE( "error getting inst_report" );
+        return;
+    }
 
-        LEAVE( "done" );
+    if (priv->initial_report == SCM_BOOL_F)
+    {
+        priv->initial_report = inst_report;
+        scm_gc_protect_object(priv->initial_report);
+
+        DEBUG("calling set_needs_save for report with id=%d", report_id);
+        scm_call_2(set_needs_save, inst_report, SCM_BOOL_T);
+
+        priv->initial_odb = gnc_option_db_new(scm_call_1(get_options, inst_report));
+        priv->name_change_cb_id =
+            gnc_option_db_register_change_callback(priv->initial_odb,
+                    gnc_plugin_page_report_refresh,
+                    priv,
+                    "General", "Report name");
+    }
+
+    if ((priv->cur_report != SCM_BOOL_F) && (priv->cur_odb != NULL))
+    {
+        gnc_option_db_unregister_change_callback_id(priv->cur_odb,
+                priv->option_change_cb_id);
+        gnc_option_db_destroy(priv->cur_odb);
+        priv->cur_odb = NULL;
+    }
+
+    if (priv->cur_report != SCM_BOOL_F)
+        scm_gc_unprotect_object(priv->cur_report);
+    priv->cur_report = inst_report;
+    scm_gc_protect_object(priv->cur_report);
+
+    priv->cur_odb = gnc_option_db_new(scm_call_1(get_options, inst_report));
+    priv->option_change_cb_id =
+        gnc_option_db_register_change_callback(priv->cur_odb,
+                gnc_plugin_page_report_option_change_cb,
+                report, NULL, NULL);
+
+    if (gnc_html_history_forward_p(gnc_html_get_history(priv->html)))
+    {
+        gnc_plugin_page_report_set_fwd_button(report, TRUE);
+    }
+    else
+    {
+        gnc_plugin_page_report_set_fwd_button(report, FALSE);
+    }
+
+    if (gnc_html_history_back_p(gnc_html_get_history(priv->html)))
+    {
+        gnc_plugin_page_report_set_back_button(report, TRUE);
+    }
+    else
+    {
+        gnc_plugin_page_report_set_back_button(report, FALSE);
+    }
+
+    LEAVE( "done" );
 }
 
 
@@ -548,69 +570,73 @@
 static void
 gnc_plugin_page_report_option_change_cb(gpointer data)
 {
-        GncPluginPageReport *report;
-        GncPluginPageReportPrivate *priv;
-        GtkActionGroup *action_group;
-        GtkAction *action;
-        SCM dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
-	const gchar *old_name;
-	gchar *new_name;
+    GncPluginPageReport *report;
+    GncPluginPageReportPrivate *priv;
+    GtkActionGroup *action_group;
+    GtkAction *action;
+    SCM dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
+    const gchar *old_name;
+    gchar *new_name;
 
-	g_return_if_fail(GNC_IS_PLUGIN_PAGE_REPORT(data));
-	report = GNC_PLUGIN_PAGE_REPORT(data);
-	priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REPORT(data));
+    report = GNC_PLUGIN_PAGE_REPORT(data);
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
 
-        DEBUG( "option_change" );
-        if (priv->cur_report == SCM_BOOL_F)
-                return;
-        DEBUG( "set-dirty, queue-draw" );
+    DEBUG( "option_change" );
+    if (priv->cur_report == SCM_BOOL_F)
+        return;
+    DEBUG( "set-dirty, queue-draw" );
 
-	/* Update the page (i.e. the notebook tab and window title) */
-	old_name = gnc_plugin_page_get_page_name(GNC_PLUGIN_PAGE(report));
-	new_name = gnc_option_db_lookup_string_option(priv->cur_odb, "General",
-						      "Report name", NULL);
-	if (strcmp(old_name, new_name) != 0) {
-	  main_window_update_page_name(GNC_PLUGIN_PAGE(report), new_name);
-	  action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(report));
-	  action = gtk_action_group_get_action (action_group, "ReportSaveAction");
-	  gtk_action_set_sensitive(action, TRUE);
-	}
-	g_free(new_name);
+    /* Update the page (i.e. the notebook tab and window title) */
+    old_name = gnc_plugin_page_get_page_name(GNC_PLUGIN_PAGE(report));
+    new_name = gnc_option_db_lookup_string_option(priv->cur_odb, "General",
+               "Report name", NULL);
+    if (strcmp(old_name, new_name) != 0)
+    {
+        main_window_update_page_name(GNC_PLUGIN_PAGE(report), new_name);
+        action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(report));
+        action = gtk_action_group_get_action (action_group, "ReportSaveAction");
+        gtk_action_set_sensitive(action, TRUE);
+    }
+    g_free(new_name);
 
-        /* it's probably already dirty, but make sure */
-        scm_call_2(dirty_report, priv->cur_report, SCM_BOOL_T);
-        
-        /* Now queue the fact that we need to reload this report */
-        priv->need_reload = TRUE;
-        // jsled: this doesn't seem to cause any effect.
-        gtk_widget_queue_draw( GTK_WIDGET(priv->container) );
-        // jsled: this does.
-        gnc_html_reload( priv->html );
+    /* it's probably already dirty, but make sure */
+    scm_call_2(dirty_report, priv->cur_report, SCM_BOOL_T);
+
+    /* Now queue the fact that we need to reload this report */
+    priv->need_reload = TRUE;
+    // jsled: this doesn't seem to cause any effect.
+    gtk_widget_queue_draw( GTK_WIDGET(priv->container) );
+    // jsled: this does.
+    gnc_html_reload( priv->html );
 }
 
 /* FIXME: This function does... nothing.  */
-static void 
-gnc_plugin_page_report_history_destroy_cb(gnc_html_history_node * node, 
-                                          gpointer user_data)
+static void
+gnc_plugin_page_report_history_destroy_cb(gnc_html_history_node * node,
+        gpointer user_data)
 {
-#if 0  
-        static SCM         remover = SCM_BOOL_F;
-        int                report_id;
+#if 0
+    static SCM         remover = SCM_BOOL_F;
+    int                report_id;
 
-        if (remover == SCM_BOOL_F) {
-            remover = scm_c_eval_string("gnc:report-remove-by-id");
-        }
-  
-        if (node
+    if (remover == SCM_BOOL_F)
+    {
+        remover = scm_c_eval_string("gnc:report-remove-by-id");
+    }
+
+    if (node
             && !safe_strcmp (node->type, URL_TYPE_REPORT)\
-            && !strncmp("id=", node->location, 3)) {
-                sscanf(node->location+3, "%d", &report_id);
-                /*    printf("unreffing report %d and children\n", report_id);
-                      scm_call_1(remover, scm_int2num(report_id)); */
-        }
-        else {
-                return;
-        }
+            && !strncmp("id=", node->location, 3))
+    {
+        sscanf(node->location + 3, "%d", &report_id);
+        /*    printf("unreffing report %d and children\n", report_id);
+              scm_call_1(remover, scm_int2num(report_id)); */
+    }
+    else
+    {
+        return;
+    }
 #endif
 }
 
@@ -618,53 +644,54 @@
 static void
 gnc_plugin_page_report_expose_event_cb(GtkWidget *unused, GdkEventExpose *unused1, gpointer data)
 {
-        GncPluginPageReport *page = data;
-        GncPluginPageReportPrivate *priv;
+    GncPluginPageReport *page = data;
+    GncPluginPageReportPrivate *priv;
 
-	g_return_if_fail(GNC_IS_PLUGIN_PAGE_REPORT(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REPORT(page));
 
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(page);
-        ENTER( "report_draw" );
-        if (!priv->need_reload)
-        {
-                LEAVE( "no reload needed" );
-                return;
-        }
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(page);
+    ENTER( "report_draw" );
+    if (!priv->need_reload)
+    {
+        LEAVE( "no reload needed" );
+        return;
+    }
 
-        priv->need_reload = FALSE;
-        gnc_window_set_progressbar_window( GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window) );
-        gnc_html_reload(priv->html);
-        gnc_window_set_progressbar_window( NULL );
-        LEAVE( "reload forced" );
+    priv->need_reload = FALSE;
+    gnc_window_set_progressbar_window( GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window) );
+    gnc_html_reload(priv->html);
+    gnc_window_set_progressbar_window( NULL );
+    LEAVE( "reload forced" );
 }
 
 // @param data is actually GncPluginPageReportPrivate
 static void
 gnc_plugin_page_report_refresh(gpointer data)
 {
-        // FIXME?
-        DEBUG( "report-refresh called" );
-        // something like ... gnc_plugin_page_report_redraw( NULL, (GncPluginPageReportPrivate*)data );
-        return;
+    // FIXME?
+    DEBUG( "report-refresh called" );
+    // something like ... gnc_plugin_page_report_redraw( NULL, (GncPluginPageReportPrivate*)data );
+    return;
 }
 
 static void
 gnc_plugin_page_report_destroy_widget(GncPluginPage *plugin_page)
 {
-        GncPluginPageReportPrivate *priv;
+    GncPluginPageReportPrivate *priv;
 
-        // FIXME: cleanup other resources.
+    // FIXME: cleanup other resources.
 
-        PINFO("destroy widget");
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(plugin_page);
+    PINFO("destroy widget");
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(plugin_page);
 
-        if (priv->component_manager_id) {
-                gnc_unregister_gui_component(priv->component_manager_id);
-                priv->component_manager_id = 0;
-        }
+    if (priv->component_manager_id)
+    {
+        gnc_unregister_gui_component(priv->component_manager_id);
+        priv->component_manager_id = 0;
+    }
 
-        gnc_plugin_page_report_destroy(priv);
-        gnc_report_remove_by_id(priv->reportId);
+    gnc_plugin_page_report_destroy(priv);
+    gnc_report_remove_by_id(priv->reportId);
 }
 
 
@@ -685,66 +712,70 @@
  *  @param group_name The group name to use when saving data. */
 static void
 gnc_plugin_page_report_save_page (GncPluginPage *plugin_page,
-				  GKeyFile *key_file,
-				  const gchar *group_name)
+                                  GKeyFile *key_file,
+                                  const gchar *group_name)
 {
-	GncPluginPageReport *report;
-	GncPluginPageReportPrivate *priv;
-	SCM gen_save_text, scm_text;
-	SCM get_embedded_list, embedded, item, tmp_report;
-	gint count, id;
-	gchar *text, *key_name;
-	
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE_REPORT(plugin_page));
-	g_return_if_fail (key_file != NULL);
-	g_return_if_fail (group_name != NULL);
+    GncPluginPageReport *report;
+    GncPluginPageReportPrivate *priv;
+    SCM gen_save_text, scm_text;
+    SCM get_embedded_list, embedded, item, tmp_report;
+    gint count, id;
+    gchar *text, *key_name;
 
-	ENTER("page %p, key_file %p, group_name %s", plugin_page, key_file,
-	      group_name);
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REPORT(plugin_page));
+    g_return_if_fail (key_file != NULL);
+    g_return_if_fail (group_name != NULL);
 
-	report = GNC_PLUGIN_PAGE_REPORT(plugin_page);
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    ENTER("page %p, key_file %p, group_name %s", plugin_page, key_file,
+          group_name);
 
-        if (!priv || !priv->cur_report || scm_is_null(priv->cur_report) || 
-            SCM_UNBNDP(priv->cur_report) || SCM_BOOL_F == priv->cur_report) {
-            LEAVE("not saving invalid report");
-            return;
+    report = GNC_PLUGIN_PAGE_REPORT(plugin_page);
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+
+    if (!priv || !priv->cur_report || scm_is_null(priv->cur_report) ||
+            SCM_UNBNDP(priv->cur_report) || SCM_BOOL_F == priv->cur_report)
+    {
+        LEAVE("not saving invalid report");
+        return;
+    }
+
+    gen_save_text = scm_c_eval_string("gnc:report-generate-restore-forms");
+    get_embedded_list = scm_c_eval_string("gnc:report-embedded-list");
+    embedded = scm_call_1(get_embedded_list, priv->cur_report);
+    count = scm_ilength(embedded);
+    while (count-- > 0)
+    {
+        item = SCM_CAR(embedded);
+        embedded = SCM_CDR(embedded);
+        if (!scm_is_number(item))
+            continue;
+        id = SCM_INUM(item);
+        tmp_report = gnc_report_find(id);
+        scm_text = scm_call_1(gen_save_text, tmp_report);
+        if (!scm_is_string (scm_text))
+        {
+            DEBUG("child report %d: nothing to save", id);
+            continue;
         }
 
-	gen_save_text = scm_c_eval_string("gnc:report-generate-restore-forms");
-	get_embedded_list = scm_c_eval_string("gnc:report-embedded-list");
-	embedded = scm_call_1(get_embedded_list, priv->cur_report);
-	count = scm_ilength(embedded);
-	while (count-- > 0) {
-	  item = SCM_CAR(embedded);
-	  embedded = SCM_CDR(embedded);
-	  if (!scm_is_number(item))
-	    continue;
-	  id = SCM_INUM(item);
-	  tmp_report = gnc_report_find(id);
-	  scm_text = scm_call_1(gen_save_text, tmp_report);
-	  if (!scm_is_string (scm_text)) {
-	    DEBUG("child report %d: nothing to save", id);
-	    continue;
-	  }
+        key_name = g_strdup_printf(SCHEME_OPTIONS_N, id);
+        text = gnc_guile_strip_comments(scm_to_locale_string(scm_text));
+        g_key_file_set_string(key_file, group_name, key_name, text);
+        g_free(text);
+        g_free(key_name);
+    }
 
-	  key_name = g_strdup_printf(SCHEME_OPTIONS_N, id);
-	  text = gnc_guile_strip_comments(scm_to_locale_string(scm_text));
-	  g_key_file_set_string(key_file, group_name, key_name, text);
-	  g_free(text);
-	  g_free(key_name);
-	}
+    scm_text = scm_call_1(gen_save_text, priv->cur_report);
+    if (!scm_is_string (scm_text))
+    {
+        LEAVE("nothing to save");
+        return;
+    }
 
-        scm_text = scm_call_1(gen_save_text, priv->cur_report);
-	if (!scm_is_string (scm_text)) {
-	  LEAVE("nothing to save");
-	  return;
-	}
-
-	text = gnc_guile_strip_comments(scm_to_locale_string(scm_text));
-	g_key_file_set_string(key_file, group_name, SCHEME_OPTIONS, text);
-	g_free(text);
-	LEAVE(" ");
+    text = gnc_guile_strip_comments(scm_to_locale_string(scm_text));
+    g_key_file_set_string(key_file, group_name, SCHEME_OPTIONS, text);
+    g_free(text);
+    LEAVE(" ");
 }
 
 
@@ -759,75 +790,83 @@
  *  @param group_name The group name to use when restoring data. */
 static GncPluginPage *
 gnc_plugin_page_report_recreate_page (GtkWidget *window,
-				      GKeyFile *key_file,
-				      const gchar *group_name)
+                                      GKeyFile *key_file,
+                                      const gchar *group_name)
 {
-	GncPluginPage *page;
-	gchar **keys;
-	gsize i, num_keys;
-	GError *error = NULL;
-	gchar *option_string;
-	gint report_id;
-	SCM scm_id, final_id = SCM_BOOL_F;
-	SCM report;
-	
-	g_return_val_if_fail(key_file, NULL);
-	g_return_val_if_fail(group_name, NULL);
-	ENTER("key_file %p, group_name %s", key_file, group_name);
+    GncPluginPage *page;
+    gchar **keys;
+    gsize i, num_keys;
+    GError *error = NULL;
+    gchar *option_string;
+    gint report_id;
+    SCM scm_id, final_id = SCM_BOOL_F;
+    SCM report;
 
-	keys = g_key_file_get_keys(key_file, group_name, &num_keys, &error);
-	if (error) {
-	  g_warning("error reading group %s key list: %s",
-		    group_name, error->message);
-	  g_error_free(error);
-	  LEAVE("no keys");
-	  return NULL;
-	}
+    g_return_val_if_fail(key_file, NULL);
+    g_return_val_if_fail(group_name, NULL);
+    ENTER("key_file %p, group_name %s", key_file, group_name);
 
-	for (i = 0; i < num_keys; i++) {
-	  if (strncmp(keys[i], SCHEME_OPTIONS, strlen(SCHEME_OPTIONS)) != 0)
-	    continue;
-	  option_string = g_key_file_get_string(key_file, group_name,
-						keys[i], &error);
-	  if (error) {
-	    g_warning("error reading group %s key %s: %s",
-		      group_name, keys[i], error->message);
-	    g_error_free(error);
-	    LEAVE("bad value");
-	    return NULL;
-	  }
+    keys = g_key_file_get_keys(key_file, group_name, &num_keys, &error);
+    if (error)
+    {
+        g_warning("error reading group %s key list: %s",
+                  group_name, error->message);
+        g_error_free(error);
+        LEAVE("no keys");
+        return NULL;
+    }
 
-	  scm_id = scm_c_eval_string(option_string);
-	  g_free(option_string);
+    for (i = 0; i < num_keys; i++)
+    {
+        if (strncmp(keys[i], SCHEME_OPTIONS, strlen(SCHEME_OPTIONS)) != 0)
+            continue;
+        option_string = g_key_file_get_string(key_file, group_name,
+                                              keys[i], &error);
+        if (error)
+        {
+            g_warning("error reading group %s key %s: %s",
+                      group_name, keys[i], error->message);
+            g_error_free(error);
+            LEAVE("bad value");
+            return NULL;
+        }
 
-	  if (!scm_integer_p(scm_id)) {
-	    DEBUG("report id not an integer for key %s", keys[i]);
-	    return NULL;
-	  }
+        scm_id = scm_c_eval_string(option_string);
+        g_free(option_string);
 
-	  if (final_id == SCM_BOOL_F) {
-	    if (strcmp(keys[i], SCHEME_OPTIONS) == 0) {
-	      final_id = scm_id;
-	    }
-	  }
-	}
+        if (!scm_integer_p(scm_id))
+        {
+            DEBUG("report id not an integer for key %s", keys[i]);
+            return NULL;
+        }
 
-	if (final_id == SCM_BOOL_F) {
-	  LEAVE("report not specified");
-	  return NULL;
-	}
+        if (final_id == SCM_BOOL_F)
+        {
+            if (strcmp(keys[i], SCHEME_OPTIONS) == 0)
+            {
+                final_id = scm_id;
+            }
+        }
+    }
 
-	report_id = scm_num2int(final_id, SCM_ARG1, G_STRFUNC);
-	report = gnc_report_find(report_id);
-	if (!report) {
-	  LEAVE("report doesn't exist");
-	  return NULL;
-	}
+    if (final_id == SCM_BOOL_F)
+    {
+        LEAVE("report not specified");
+        return NULL;
+    }
 
-	page = gnc_plugin_page_report_new( report_id );
+    report_id = scm_num2int(final_id, SCM_ARG1, G_STRFUNC);
+    report = gnc_report_find(report_id);
+    if (!report)
+    {
+        LEAVE("report doesn't exist");
+        return NULL;
+    }
 
-	LEAVE(" ");
-	return page;
+    page = gnc_plugin_page_report_new( report_id );
+
+    LEAVE(" ");
+    return page;
 }
 
 
@@ -837,182 +876,213 @@
  *  regenerate the report.
  *
  *  @internal
- *  
+ *
  *  @param page The page whose name has changed.
  *
  *  @param name The new name for the page. */
 static void
 gnc_plugin_page_report_name_changed (GncPluginPage *page, const gchar *name)
 {
-  GncPluginPageReportPrivate *priv;
-  GtkActionGroup *action_group;
-  GtkAction *action;
-  static gint count = 1, max_count = 10;
-  const gchar *old_name;
+    GncPluginPageReportPrivate *priv;
+    GtkActionGroup *action_group;
+    GtkAction *action;
+    static gint count = 1, max_count = 10;
+    const gchar *old_name;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REPORT(page));
-  g_return_if_fail(name != NULL);
-  g_return_if_fail(count++ <= max_count);
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REPORT(page));
+    g_return_if_fail(name != NULL);
+    g_return_if_fail(count++ <= max_count);
 
-  ENTER("page %p, name %s", page, name);
-  priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(page);
+    ENTER("page %p, name %s", page, name);
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(page);
 
-  /* Is this a redundant call? */
-  old_name = gnc_option_db_lookup_string_option(priv->cur_odb, "General",
-						"Report name", NULL);
-  DEBUG("Comparing old name '%s' to new name '%s'",
-	old_name ? old_name : "(null)", name);
-  if (old_name && (strcmp(old_name, name) == 0)) {
-    LEAVE("no change");
-    return;
-  }
+    /* Is this a redundant call? */
+    old_name = gnc_option_db_lookup_string_option(priv->cur_odb, "General",
+               "Report name", NULL);
+    DEBUG("Comparing old name '%s' to new name '%s'",
+          old_name ? old_name : "(null)", name);
+    if (old_name && (strcmp(old_name, name) == 0))
+    {
+        LEAVE("no change");
+        return;
+    }
 
-  /* Store the new name for the report. */
-  gnc_option_db_set_string_option(priv->cur_odb, "General",
-				  "Report name", name);
+    /* Store the new name for the report. */
+    gnc_option_db_set_string_option(priv->cur_odb, "General",
+                                    "Report name", name);
 
-  /* Have to manually call the option change hook. */
-  gnc_plugin_page_report_option_change_cb(page);
+    /* Have to manually call the option change hook. */
+    gnc_plugin_page_report_option_change_cb(page);
 
-  /* Careful. This is called at report construction time. */
-  action_group = gnc_plugin_page_get_action_group(page);
-  if (action_group) {
-    /* Allow the user to save the report now. */
-    action = gtk_action_group_get_action (action_group, "ReportSaveAction");
-    gtk_action_set_sensitive(action, TRUE);
-  }
-  LEAVE(" ");
+    /* Careful. This is called at report construction time. */
+    action_group = gnc_plugin_page_get_action_group(page);
+    if (action_group)
+    {
+        /* Allow the user to save the report now. */
+        action = gtk_action_group_get_action (action_group, "ReportSaveAction");
+        gtk_action_set_sensitive(action, TRUE);
+    }
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_report_update_edit_menu (GncPluginPage *page, gboolean hide)
 {
-  GtkAction *action;
+    GtkAction *action;
 
-  action = gnc_plugin_page_get_action (page, "EditCopyAction");
-  gtk_action_set_sensitive (action, TRUE);
-  gtk_action_set_visible (action, TRUE);
-  action = gnc_plugin_page_get_action (page, "EditCutAction");
-  gtk_action_set_sensitive (action, FALSE);
-  gtk_action_set_visible (action, !hide);
-  action = gnc_plugin_page_get_action (page, "EditPasteAction");
-  gtk_action_set_sensitive (action, FALSE);
-  gtk_action_set_visible (action, !hide);
+    action = gnc_plugin_page_get_action (page, "EditCopyAction");
+    gtk_action_set_sensitive (action, TRUE);
+    gtk_action_set_visible (action, TRUE);
+    action = gnc_plugin_page_get_action (page, "EditCutAction");
+    gtk_action_set_sensitive (action, FALSE);
+    gtk_action_set_visible (action, !hide);
+    action = gnc_plugin_page_get_action (page, "EditPasteAction");
+    gtk_action_set_sensitive (action, FALSE);
+    gtk_action_set_visible (action, !hide);
 }
 
 static gboolean
 gnc_plugin_page_report_finish_pending (GncPluginPage *page)
 {
-	GncPluginPageReportPrivate *priv;
-	GncPluginPageReport *report;
+    GncPluginPageReportPrivate *priv;
+    GncPluginPageReport *report;
 
-	report = GNC_PLUGIN_PAGE_REPORT(page);
-	priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-	return !priv->reloading;
+    report = GNC_PLUGIN_PAGE_REPORT(page);
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    return !priv->reloading;
 }
 
 
 /********************************************************************
- * gnc_report_window_destroy 
- * free and destroy a window 
+ * gnc_report_window_destroy
+ * free and destroy a window
  ********************************************************************/
 void
 gnc_plugin_page_report_destroy(GncPluginPageReportPrivate * priv)
 {
-        SCM  get_editor = scm_c_eval_string("gnc:report-editor-widget");
-        SCM  set_editor = scm_c_eval_string("gnc:report-set-editor-widget!");
-        SCM  edited, editor; 
+    SCM  get_editor = scm_c_eval_string("gnc:report-editor-widget");
+    SCM  set_editor = scm_c_eval_string("gnc:report-set-editor-widget!");
+    SCM  edited, editor;
 
-        /* close any open editors */
-        for (edited = scm_list_copy(priv->edited_reports); !scm_is_null(edited);
-             edited = SCM_CDR(edited)) {
-                editor = scm_call_1(get_editor, SCM_CAR(edited));
-                scm_call_2(set_editor, SCM_CAR(edited), SCM_BOOL_F);
-                if (editor != SCM_BOOL_F) {
-                    GtkWidget *w = NULL;
-                    #define FUNC_NAME "gtk_widget_destroy"
-                    w = SWIG_MustGetPtr(editor,
-                                        SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
-                    #undef FUNC_NAME
-                    gtk_widget_destroy(GTK_WIDGET(w));
-                }
+    /* close any open editors */
+    for (edited = scm_list_copy(priv->edited_reports); !scm_is_null(edited);
+            edited = SCM_CDR(edited))
+    {
+        editor = scm_call_1(get_editor, SCM_CAR(edited));
+        scm_call_2(set_editor, SCM_CAR(edited), SCM_BOOL_F);
+        if (editor != SCM_BOOL_F)
+        {
+            GtkWidget *w = NULL;
+#define FUNC_NAME "gtk_widget_destroy"
+            w = SWIG_MustGetPtr(editor,
+                                SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
+#undef FUNC_NAME
+            gtk_widget_destroy(GTK_WIDGET(w));
         }
+    }
 
-        if (priv->initial_odb) {
-                gnc_option_db_unregister_change_callback_id(priv->initial_odb, 
-                                                            priv->name_change_cb_id);
-    
-                gnc_option_db_destroy(priv->initial_odb);
-                priv->initial_odb = NULL;
-        }
+    if (priv->initial_odb)
+    {
+        gnc_option_db_unregister_change_callback_id(priv->initial_odb,
+                priv->name_change_cb_id);
 
-        gnc_html_destroy(priv->html);
-  
-        priv->container     = NULL;
-        priv->html          = NULL;
-  
-	if (priv->cur_report != SCM_BOOL_F)
-		scm_gc_unprotect_object(priv->cur_report);
-	if (priv->edited_reports != SCM_EOL)
-	        scm_gc_unprotect_object(priv->edited_reports);
-  }
+        gnc_option_db_destroy(priv->initial_odb);
+        priv->initial_odb = NULL;
+    }
 
+    gnc_html_destroy(priv->html);
+
+    priv->container     = NULL;
+    priv->html          = NULL;
+
+    if (priv->cur_report != SCM_BOOL_F)
+        scm_gc_unprotect_object(priv->cur_report);
+    if (priv->edited_reports != SCM_EOL)
+        scm_gc_unprotect_object(priv->edited_reports);
+}
+
 static GtkActionEntry report_actions[] =
 {
-        { "FilePrintAction", GTK_STOCK_PRINT, N_("_Print Report..."), "<control>p",
-	  N_("Print the current report"),
-          G_CALLBACK(gnc_plugin_page_report_print_cb) },
-        { "EditCutAction", GTK_STOCK_CUT, N_("Cu_t"), NULL,
-          N_("Cut the current selection and copy it to clipboard"),
-          NULL },
-        { "EditCopyAction", GTK_STOCK_COPY, N_("_Copy"), NULL,
-          N_("Copy the current selection to clipboard"),
-          G_CALLBACK(gnc_plugin_page_report_copy_cb) },
-        { "EditPasteAction", GTK_STOCK_PASTE, N_("_Paste"), NULL,
-          N_("Paste the clipboard content at the cursor position"),
-          NULL },
-	{ "ViewRefreshAction", GTK_STOCK_REFRESH, N_("_Refresh"), "<control>r",
-	  N_("Refresh this window"),
-	  G_CALLBACK (gnc_plugin_page_report_reload_cb) },
-        { "ReportSaveAction", GTK_STOCK_SAVE, N_("Add _Report"), "", 
-	  N_("Add the current report to the `Custom' menu for later use. "
-	     "The report will be saved in the file ~/.gnucash/saved-reports-2.4. "
-	     "It will be accessible as menu entry in the report menu at the "
-	     "next startup of GnuCash."),
-          G_CALLBACK(gnc_plugin_page_report_save_cb) },
-        { "ReportExportAction", GTK_STOCK_CONVERT, N_("Export _Report"), NULL,
-	  N_("Export HTML-formatted report to file"),
-          G_CALLBACK(gnc_plugin_page_report_export_cb) },
-        { "ReportOptionsAction", GTK_STOCK_PROPERTIES, N_("_Report Options"), NULL,
-	  N_("Edit report options"),
-          G_CALLBACK(gnc_plugin_page_report_options_cb) },
+    {
+        "FilePrintAction", GTK_STOCK_PRINT, N_("_Print Report..."), "<control>p",
+        N_("Print the current report"),
+        G_CALLBACK(gnc_plugin_page_report_print_cb)
+    },
+    {
+        "EditCutAction", GTK_STOCK_CUT, N_("Cu_t"), NULL,
+        N_("Cut the current selection and copy it to clipboard"),
+        NULL
+    },
+    {
+        "EditCopyAction", GTK_STOCK_COPY, N_("_Copy"), NULL,
+        N_("Copy the current selection to clipboard"),
+        G_CALLBACK(gnc_plugin_page_report_copy_cb)
+    },
+    {
+        "EditPasteAction", GTK_STOCK_PASTE, N_("_Paste"), NULL,
+        N_("Paste the clipboard content at the cursor position"),
+        NULL
+    },
+    {
+        "ViewRefreshAction", GTK_STOCK_REFRESH, N_("_Refresh"), "<control>r",
+        N_("Refresh this window"),
+        G_CALLBACK (gnc_plugin_page_report_reload_cb)
+    },
+    {
+        "ReportSaveAction", GTK_STOCK_SAVE, N_("Add _Report"), "",
+        N_("Add the current report to the `Custom' menu for later use. "
+        "The report will be saved in the file ~/.gnucash/saved-reports-2.4. "
+        "It will be accessible as menu entry in the report menu at the "
+        "next startup of GnuCash."),
+        G_CALLBACK(gnc_plugin_page_report_save_cb)
+    },
+    {
+        "ReportExportAction", GTK_STOCK_CONVERT, N_("Export _Report"), NULL,
+        N_("Export HTML-formatted report to file"),
+        G_CALLBACK(gnc_plugin_page_report_export_cb)
+    },
+    {
+        "ReportOptionsAction", GTK_STOCK_PROPERTIES, N_("_Report Options"), NULL,
+        N_("Edit report options"),
+        G_CALLBACK(gnc_plugin_page_report_options_cb)
+    },
 
-        { "ReportBackAction", GTK_STOCK_GO_BACK, N_("Back"), NULL,
-	  N_("Move back one step in the history"),
-          G_CALLBACK(gnc_plugin_page_report_back_cb) },
-        { "ReportForwAction", GTK_STOCK_GO_FORWARD, N_("Forward"), NULL,
-	  N_("Move forward one step in the history"),
-          G_CALLBACK(gnc_plugin_page_report_forw_cb) },
-        { "ReportReloadAction", GTK_STOCK_REFRESH, N_("Reload"), NULL,
-	  N_("Reload the current page"),
-          G_CALLBACK(gnc_plugin_page_report_reload_cb) },
-        { "ReportStopAction", GTK_STOCK_STOP, N_("Stop"), NULL,
-	  N_("Cancel outstanding HTML requests"),
-          G_CALLBACK(gnc_plugin_page_report_stop_cb) },
+    {
+        "ReportBackAction", GTK_STOCK_GO_BACK, N_("Back"), NULL,
+        N_("Move back one step in the history"),
+        G_CALLBACK(gnc_plugin_page_report_back_cb)
+    },
+    {
+        "ReportForwAction", GTK_STOCK_GO_FORWARD, N_("Forward"), NULL,
+        N_("Move forward one step in the history"),
+        G_CALLBACK(gnc_plugin_page_report_forw_cb)
+    },
+    {
+        "ReportReloadAction", GTK_STOCK_REFRESH, N_("Reload"), NULL,
+        N_("Reload the current page"),
+        G_CALLBACK(gnc_plugin_page_report_reload_cb)
+    },
+    {
+        "ReportStopAction", GTK_STOCK_STOP, N_("Stop"), NULL,
+        N_("Cancel outstanding HTML requests"),
+        G_CALLBACK(gnc_plugin_page_report_stop_cb)
+    },
 };
 static guint num_report_actions = G_N_ELEMENTS( report_actions );
 
 /** Short labels for use on the toolbar buttons. */
-static action_toolbar_labels toolbar_labels[] = {
-  { "FilePrintAction", 	    N_("Print") },
-  { "ReportExportAction",   N_("Export") },
-  { "ReportOptionsAction",  N_("Options") },
-  { NULL, NULL },
+static action_toolbar_labels toolbar_labels[] =
+{
+    { "FilePrintAction", 	    N_("Print") },
+    { "ReportExportAction",   N_("Export") },
+    { "ReportOptionsAction",  N_("Options") },
+    { NULL, NULL },
 };
 
-static const gchar *initially_insensitive_actions[] = {
-  "ReportSaveAction",
-  NULL
+static const gchar *initially_insensitive_actions[] =
+{
+    "ReportSaveAction",
+    NULL
 };
 
 static void
@@ -1023,150 +1093,150 @@
 static GObject*
 gnc_plugin_page_report_constructor(GType this_type, guint n_properties, GObjectConstructParam *properties)
 {
-        GObject *obj;
-        GncPluginPageReportClass *our_class;
-        GObjectClass *parent_class;
-        gint reportId = -42;
-        int i;
+    GObject *obj;
+    GncPluginPageReportClass *our_class;
+    GObjectClass *parent_class;
+    gint reportId = -42;
+    int i;
 
-        our_class = GNC_PLUGIN_PAGE_REPORT_CLASS (
-            g_type_class_peek (GNC_TYPE_PLUGIN_PAGE_REPORT));
-        parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (our_class));
-        obj = parent_class->constructor(this_type, n_properties, properties);
+    our_class = GNC_PLUGIN_PAGE_REPORT_CLASS (
+                    g_type_class_peek (GNC_TYPE_PLUGIN_PAGE_REPORT));
+    parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (our_class));
+    obj = parent_class->constructor(this_type, n_properties, properties);
 
-        for (i = 0; i < n_properties; i++)
+    for (i = 0; i < n_properties; i++)
+    {
+        GObjectConstructParam prop = properties[i];
+        if (strcmp(prop.pspec->name, "report-id") == 0)
         {
-                GObjectConstructParam prop = properties[i];
-                if (strcmp(prop.pspec->name,"report-id") == 0)
-                {
-                        reportId = g_value_get_int(prop.value);
-                }
+            reportId = g_value_get_int(prop.value);
         }
-  
-        gnc_plugin_page_report_constr_init(GNC_PLUGIN_PAGE_REPORT(obj), reportId);
+    }
 
-        return obj;
+    gnc_plugin_page_report_constr_init(GNC_PLUGIN_PAGE_REPORT(obj), reportId);
+
+    return obj;
 }
 
 static void
 gnc_plugin_page_report_constr_init(GncPluginPageReport *plugin_page, gint reportId)
 {
-        GncPluginPageReportPrivate *priv;
-        GtkActionGroup *action_group;
-        GncPluginPage *parent;
-        gboolean use_new;
-	gchar *name;
+    GncPluginPageReportPrivate *priv;
+    GtkActionGroup *action_group;
+    GncPluginPage *parent;
+    gboolean use_new;
+    gchar *name;
 
-        DEBUG( "property reportId=%d", reportId );
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(plugin_page);
-        priv->reportId = reportId;
+    DEBUG( "property reportId=%d", reportId );
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(plugin_page);
+    priv->reportId = reportId;
 
-        gnc_plugin_page_report_setup( GNC_PLUGIN_PAGE(plugin_page) );
+    gnc_plugin_page_report_setup( GNC_PLUGIN_PAGE(plugin_page) );
 
-        /* Init parent declared variables */
-        parent = GNC_PLUGIN_PAGE(plugin_page);
-        use_new = gnc_gconf_get_bool(GCONF_GENERAL_REPORT, KEY_USE_NEW, NULL);
-	name = gnc_report_name( priv->initial_report );
-	g_object_set(G_OBJECT(plugin_page),
-		     "page-name",      name,
-		     "page-uri",       "default:",
-		     "ui-description", "gnc-plugin-page-report-ui.xml",
-		     "use-new-window", use_new,
-		     NULL);
-	g_free(name);
+    /* Init parent declared variables */
+    parent = GNC_PLUGIN_PAGE(plugin_page);
+    use_new = gnc_gconf_get_bool(GCONF_GENERAL_REPORT, KEY_USE_NEW, NULL);
+    name = gnc_report_name( priv->initial_report );
+    g_object_set(G_OBJECT(plugin_page),
+                 "page-name",      name,
+                 "page-uri",       "default:",
+                 "ui-description", "gnc-plugin-page-report-ui.xml",
+                 "use-new-window", use_new,
+                 NULL);
+    g_free(name);
 
-        /* change me when the system supports multiple books */
-        gnc_plugin_page_add_book(parent, gnc_get_current_book());
+    /* change me when the system supports multiple books */
+    gnc_plugin_page_add_book(parent, gnc_get_current_book());
 
-	/* Create menu and toolbar information */
-	action_group =
-	  gnc_plugin_page_create_action_group(parent,
-					      "GncPluginPageReportActions");
-        gtk_action_group_add_actions( action_group,
-                                      report_actions,
-                                      num_report_actions,
-                                      plugin_page );
-	gnc_plugin_update_actions(action_group,
-				  initially_insensitive_actions,
-				  "sensitive", FALSE);
-        gnc_plugin_init_short_names (action_group, toolbar_labels);
+    /* Create menu and toolbar information */
+    action_group =
+        gnc_plugin_page_create_action_group(parent,
+                                            "GncPluginPageReportActions");
+    gtk_action_group_add_actions( action_group,
+                                  report_actions,
+                                  num_report_actions,
+                                  plugin_page );
+    gnc_plugin_update_actions(action_group,
+                              initially_insensitive_actions,
+                              "sensitive", FALSE);
+    gnc_plugin_init_short_names (action_group, toolbar_labels);
 }
 
 GncPluginPage*
 gnc_plugin_page_report_new( int reportId )
 {
-	GncPluginPageReport *plugin_page;
+    GncPluginPageReport *plugin_page;
 
-        DEBUG( "report id = %d", reportId );
-        plugin_page = g_object_new( GNC_TYPE_PLUGIN_PAGE_REPORT,
-                                    "report-id", reportId, NULL );
-        DEBUG( "plugin_page: %p", plugin_page );
-        DEBUG( "set %d on page %p", reportId, plugin_page );
-	return GNC_PLUGIN_PAGE( plugin_page );
+    DEBUG( "report id = %d", reportId );
+    plugin_page = g_object_new( GNC_TYPE_PLUGIN_PAGE_REPORT,
+                                "report-id", reportId, NULL );
+    DEBUG( "plugin_page: %p", plugin_page );
+    DEBUG( "set %d on page %p", reportId, plugin_page );
+    return GNC_PLUGIN_PAGE( plugin_page );
 }
 
 void
 gnc_plugin_page_report_remove_edited_report(GncPluginPageReportPrivate *priv,
-                                            SCM report)
-{ 
-        SCM new_edited = scm_delete(priv->edited_reports, report);
-	if (priv->edited_reports != SCM_EOL)
-	        scm_gc_unprotect_object(priv->edited_reports);
-        priv->edited_reports = new_edited;
-        if (new_edited != SCM_EOL)
-            scm_gc_protect_object(priv->edited_reports);
+        SCM report)
+{
+    SCM new_edited = scm_delete(priv->edited_reports, report);
+    if (priv->edited_reports != SCM_EOL)
+        scm_gc_unprotect_object(priv->edited_reports);
+    priv->edited_reports = new_edited;
+    if (new_edited != SCM_EOL)
+        scm_gc_protect_object(priv->edited_reports);
 }
 
 void
 gnc_plugin_page_report_add_edited_report(GncPluginPageReportPrivate *priv,
-                                         SCM report)
+        SCM report)
 {
-        SCM new_edited = scm_cons(report, priv->edited_reports);
-	if (priv->edited_reports != SCM_EOL)
-	        scm_gc_unprotect_object(priv->edited_reports);
-        priv->edited_reports = new_edited;
-        if (new_edited != SCM_EOL)
-            scm_gc_protect_object(priv->edited_reports);
+    SCM new_edited = scm_cons(report, priv->edited_reports);
+    if (priv->edited_reports != SCM_EOL)
+        scm_gc_unprotect_object(priv->edited_reports);
+    priv->edited_reports = new_edited;
+    if (new_edited != SCM_EOL)
+        scm_gc_protect_object(priv->edited_reports);
 }
 
 void
 gnc_plugin_page_report_raise_editor(SCM report)
 {
-        SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
-        SCM editor = scm_call_1(get_editor, report);
-        #define FUNC_NAME "gtk_window_present"
-        GtkWidget *w = SWIG_MustGetPtr(editor,
-                                       SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
-        #undef FUNC_NAME
-        gtk_window_present(GTK_WINDOW(w));
+    SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
+    SCM editor = scm_call_1(get_editor, report);
+#define FUNC_NAME "gtk_window_present"
+    GtkWidget *w = SWIG_MustGetPtr(editor,
+                                   SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
+#undef FUNC_NAME
+    gtk_window_present(GTK_WINDOW(w));
 }
 
 static void
 close_handler (gpointer user_data)
 {
-        GncPluginPage *plugin_page = GNC_PLUGIN_PAGE(user_data);
-        DEBUG("in close handler\n");
-        gnc_main_window_close_page (plugin_page);
+    GncPluginPage *plugin_page = GNC_PLUGIN_PAGE(user_data);
+    DEBUG("in close handler\n");
+    gnc_main_window_close_page (plugin_page);
 }
 
 static void
 gnc_plugin_page_report_set_fwd_button(GncPluginPageReport *report, int enabled)
 {
-        GtkAction *act;
+    GtkAction *act;
 
-	act = gnc_plugin_page_get_action(GNC_PLUGIN_PAGE(report),
-					    "ReportForwAction" );
-	gtk_action_set_sensitive(act, enabled);
+    act = gnc_plugin_page_get_action(GNC_PLUGIN_PAGE(report),
+                                     "ReportForwAction" );
+    gtk_action_set_sensitive(act, enabled);
 }
 
 static void
 gnc_plugin_page_report_set_back_button(GncPluginPageReport *report, int enabled)
 {
-        GtkAction *act;
+    GtkAction *act;
 
-	act = gnc_plugin_page_get_action(GNC_PLUGIN_PAGE(report),
-					    "ReportBackAction" );
-	gtk_action_set_sensitive(act, enabled);
+    act = gnc_plugin_page_get_action(GNC_PLUGIN_PAGE(report),
+                                     "ReportBackAction" );
+    gtk_action_set_sensitive(act, enabled);
 }
 
 // ------------------------------------------------------------
@@ -1175,69 +1245,71 @@
 static void
 gnc_plugin_page_report_forw_cb( GtkAction *action, GncPluginPageReport *report )
 {
-        GncPluginPageReportPrivate *priv;
-        gnc_html_history_node * node = NULL;
+    GncPluginPageReportPrivate *priv;
+    gnc_html_history_node * node = NULL;
 
-        DEBUG( "forw" );
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-        gnc_html_history_forward(gnc_html_get_history(priv->html));
-        node = gnc_html_history_get_current(gnc_html_get_history(priv->html));
-        if (node) {
-                gnc_html_show_url(priv->html, node->type, node->location, 
-                                  node->label, 0);
-        }
+    DEBUG( "forw" );
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    gnc_html_history_forward(gnc_html_get_history(priv->html));
+    node = gnc_html_history_get_current(gnc_html_get_history(priv->html));
+    if (node)
+    {
+        gnc_html_show_url(priv->html, node->type, node->location,
+                          node->label, 0);
+    }
 }
 
 static void
 gnc_plugin_page_report_back_cb( GtkAction *action, GncPluginPageReport *report )
 {
-        GncPluginPageReportPrivate *priv;
-        gnc_html_history_node * node;
-  
-        DEBUG( "back" );
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-        gnc_html_history_back(gnc_html_get_history(priv->html));
-        node = gnc_html_history_get_current(gnc_html_get_history(priv->html));
-        if(node) {
-                gnc_html_show_url(priv->html, node->type, node->location, 
-                                  node->label, 0);
-        }
+    GncPluginPageReportPrivate *priv;
+    gnc_html_history_node * node;
+
+    DEBUG( "back" );
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    gnc_html_history_back(gnc_html_get_history(priv->html));
+    node = gnc_html_history_get_current(gnc_html_get_history(priv->html));
+    if (node)
+    {
+        gnc_html_show_url(priv->html, node->type, node->location,
+                          node->label, 0);
+    }
 }
 
 static void
 gnc_plugin_page_report_reload_cb( GtkAction *action, GncPluginPageReport *report )
 {
-        GncPluginPageReportPrivate *priv;
-        SCM dirty_report;
+    GncPluginPageReportPrivate *priv;
+    SCM dirty_report;
 
-        DEBUG( "reload" );
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-        if (priv->cur_report == SCM_BOOL_F)
-                return;
+    DEBUG( "reload" );
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    if (priv->cur_report == SCM_BOOL_F)
+        return;
 
-        DEBUG( "reload-redraw" );
-        dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
-        scm_call_2(dirty_report, priv->cur_report, SCM_BOOL_T);
+    DEBUG( "reload-redraw" );
+    dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
+    scm_call_2(dirty_report, priv->cur_report, SCM_BOOL_T);
 
-        priv->need_reload = TRUE;
-        /* now queue the fact that we need to reload this report */
+    priv->need_reload = TRUE;
+    /* now queue the fact that we need to reload this report */
 
-        // this doens't seem to do anything...
-        gtk_widget_queue_draw( GTK_WIDGET(priv->container) );
+    // this doens't seem to do anything...
+    gtk_widget_queue_draw( GTK_WIDGET(priv->container) );
 
-        // this does...
-	priv->reloading = TRUE;
-        gnc_html_reload( priv->html );
-	priv->reloading = FALSE;
+    // this does...
+    priv->reloading = TRUE;
+    gnc_html_reload( priv->html );
+    priv->reloading = FALSE;
 }
 
 static void
 gnc_plugin_page_report_stop_cb( GtkAction *action, GncPluginPageReport *report )
 {
-        GncPluginPageReportPrivate *priv;
+    GncPluginPageReportPrivate *priv;
 
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-        gnc_html_cancel(priv->html);
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    gnc_html_cancel(priv->html);
 }
 
 /* Returns SCM_BOOL_F if cancel. Returns SCM_BOOL_T if html.
@@ -1245,210 +1317,211 @@
 static SCM
 gnc_get_export_type_choice (SCM export_types)
 {
-        GList * choices = NULL;
-        gboolean bad = FALSE;
-        GList * node;
-        int choice;
-        SCM tail;
+    GList * choices = NULL;
+    gboolean bad = FALSE;
+    GList * node;
+    int choice;
+    SCM tail;
 
-        if (!scm_is_list (export_types))
-                return SCM_BOOL_F;
+    if (!scm_is_list (export_types))
+        return SCM_BOOL_F;
 
-        for (tail = export_types; !scm_is_null (tail); tail = SCM_CDR (tail))
+    for (tail = export_types; !scm_is_null (tail); tail = SCM_CDR (tail))
+    {
+        SCM pair = SCM_CAR (tail);
+        const gchar * name;
+        SCM scm;
+
+        if (!scm_is_pair (pair))
         {
-                SCM pair = SCM_CAR (tail);
-                const gchar * name;
-                SCM scm;
+            g_warning ("unexpected list element");
+            bad = TRUE;
+            break;
+        }
 
-                if (!scm_is_pair (pair))
-                {
-                        g_warning ("unexpected list element");
-                        bad = TRUE;
-                        break;
-                }
+        scm = SCM_CAR (pair);
+        if (!scm_is_string (scm))
+        {
+            g_warning ("unexpected pair element");
+            bad = TRUE;
+            break;
+        }
 
-                scm = SCM_CAR (pair);
-                if (!scm_is_string (scm))
-                {
-                        g_warning ("unexpected pair element");
-                        bad = TRUE;
-                        break;
-                }
+        name = scm_to_locale_string (scm);
+        choices = g_list_prepend (choices, g_strdup (name));
+    }
 
-                name = scm_to_locale_string (scm);
-                choices = g_list_prepend (choices, g_strdup (name));
-        }
+    if (!bad)
+    {
+        choices = g_list_reverse (choices);
 
-        if (!bad)
-        {
-                choices = g_list_reverse (choices);
+        choices = g_list_prepend (choices, g_strdup (_("HTML")));
 
-                choices = g_list_prepend (choices, g_strdup (_("HTML")));
+        choice = gnc_choose_radio_option_dialog
+                 (NULL, _("Choose export format"),
+                  _("Choose the export format for this report:"),
+                  NULL, 0, choices);
+    }
+    else
+        choice = -1;
 
-                choice = gnc_choose_radio_option_dialog
-                        (NULL, _("Choose export format"),
-                         _("Choose the export format for this report:"),
-			 NULL, 0, choices);
-        }
-        else
-                choice = -1;
+    for (node = choices; node; node = node->next)
+        g_free (node->data);
+    g_list_free (choices);
 
-        for (node = choices; node; node = node->next)
-                g_free (node->data);
-        g_list_free (choices);
+    if (choice < 0)
+        return SCM_BOOL_F;
 
-        if (choice < 0)
-                return SCM_BOOL_F;
+    if (choice == 0)
+        return SCM_BOOL_T;
 
-        if (choice == 0)
-                return SCM_BOOL_T;
+    choice--;
+    if (choice >= scm_ilength (export_types))
+        return SCM_BOOL_F;
 
-        choice--;
-        if (choice >= scm_ilength (export_types))
-                return SCM_BOOL_F;
-
-        return scm_list_ref (export_types, scm_int2num (choice));
+    return scm_list_ref (export_types, scm_int2num (choice));
 }
 
 static char *
 gnc_get_export_filename (SCM choice)
 {
-        char * filepath;
-        struct stat statbuf;
-        char * title;
-        const gchar * type;
-        int rc;
+    char * filepath;
+    struct stat statbuf;
+    char * title;
+    const gchar * type;
+    int rc;
 
-        if (choice == SCM_BOOL_T)
-                type = _("HTML");
-        else
-        {
-                type = scm_to_locale_string(SCM_CAR (choice));
-        }
+    if (choice == SCM_BOOL_T)
+        type = _("HTML");
+    else
+    {
+        type = scm_to_locale_string(SCM_CAR (choice));
+    }
 
-        /* %s is the type of what is about to be saved, e.g. "HTML". */
-        title = g_strdup_printf (_("Save %s To File"), type);
+    /* %s is the type of what is about to be saved, e.g. "HTML". */
+    title = g_strdup_printf (_("Save %s To File"), type);
 
-        filepath = gnc_file_dialog (title, NULL, NULL, GNC_FILE_DIALOG_EXPORT);
+    filepath = gnc_file_dialog (title, NULL, NULL, GNC_FILE_DIALOG_EXPORT);
 
-        g_free (title);
+    g_free (title);
 
-        if (!filepath)
-                return NULL;
+    if (!filepath)
+        return NULL;
 
-        rc = g_stat (filepath, &statbuf);
+    rc = g_stat (filepath, &statbuf);
 
-        /* Check for an error that isn't a non-existant file. */
-        if (rc != 0 && errno != ENOENT)
-        {
-                /* %s is the strerror(3) string of the error that occurred. */
-                const char *format = _("You cannot save to that filename.\n\n%s");
+    /* Check for an error that isn't a non-existant file. */
+    if (rc != 0 && errno != ENOENT)
+    {
+        /* %s is the strerror(3) string of the error that occurred. */
+        const char *format = _("You cannot save to that filename.\n\n%s");
 
-                gnc_error_dialog (NULL, format, strerror(errno));
-                g_free(filepath);
-                return NULL;
-        }
+        gnc_error_dialog (NULL, format, strerror(errno));
+        g_free(filepath);
+        return NULL;
+    }
 
-        /* Check for a file that isn't a regular file. */
-        if (rc == 0 && !S_ISREG (statbuf.st_mode))
-        {
-                const char *message = _("You cannot save to that file.");
+    /* Check for a file that isn't a regular file. */
+    if (rc == 0 && !S_ISREG (statbuf.st_mode))
+    {
+        const char *message = _("You cannot save to that file.");
 
-                gnc_error_dialog (NULL, "%s", message);
-                g_free(filepath);
-                return NULL;
-        }
+        gnc_error_dialog (NULL, "%s", message);
+        g_free(filepath);
+        return NULL;
+    }
 
-        if (rc == 0)
+    if (rc == 0)
+    {
+        const char *format = _("The file %s already exists. "
+                               "Are you sure you want to overwrite it?");
+
+        if (!gnc_verify_dialog (NULL, FALSE, format, filepath))
         {
-                const char *format = _("The file %s already exists. "
-                                       "Are you sure you want to overwrite it?");
-
-                if (!gnc_verify_dialog (NULL, FALSE, format, filepath)) {
-                        g_free(filepath);
-                        return NULL;
-                }
+            g_free(filepath);
+            return NULL;
         }
+    }
 
-        return filepath;
+    return filepath;
 }
 
 static void
 gnc_plugin_page_report_save_cb( GtkAction *action, GncPluginPageReport *report )
 {
-        GncPluginPageReportPrivate *priv;
-        SCM save_func;
+    GncPluginPageReportPrivate *priv;
+    SCM save_func;
 
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-	if (priv->cur_report == SCM_BOOL_F)
-	  return;
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    if (priv->cur_report == SCM_BOOL_F)
+        return;
 
-	save_func = scm_c_eval_string("gnc:report-save-to-savefile");
-	scm_call_1(save_func, priv->cur_report);
+    save_func = scm_c_eval_string("gnc:report-save-to-savefile");
+    scm_call_1(save_func, priv->cur_report);
 
-	{
-	  GtkActionGroup *action_group =
-	    gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(report));
-	  GtkAction *action =
-	    gtk_action_group_get_action (action_group, "ReportSaveAction");
-	  gtk_action_set_sensitive(action, FALSE);
-	}
+    {
+        GtkActionGroup *action_group =
+            gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(report));
+        GtkAction *action =
+            gtk_action_group_get_action (action_group, "ReportSaveAction");
+        gtk_action_set_sensitive(action, FALSE);
+    }
 }
 
 static void
 gnc_plugin_page_report_export_cb( GtkAction *action, GncPluginPageReport *report )
 {
-        GncPluginPageReportPrivate *priv;
-        char * filepath;
-        SCM export_types;
-        SCM export_thunk;
-        gboolean result;
-        SCM choice;
+    GncPluginPageReportPrivate *priv;
+    char * filepath;
+    SCM export_types;
+    SCM export_thunk;
+    gboolean result;
+    SCM choice;
 
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-        export_types = scm_call_1 (scm_c_eval_string ("gnc:report-export-types"),
-                                   priv->cur_report);
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    export_types = scm_call_1 (scm_c_eval_string ("gnc:report-export-types"),
+                               priv->cur_report);
 
-        export_thunk = scm_call_1 (scm_c_eval_string ("gnc:report-export-thunk"),
-                                   priv->cur_report);
+    export_thunk = scm_call_1 (scm_c_eval_string ("gnc:report-export-thunk"),
+                               priv->cur_report);
 
-        if (scm_is_list (export_types) && scm_is_procedure (export_thunk))
-                choice = gnc_get_export_type_choice (export_types);
-        else
-                choice = SCM_BOOL_T;
+    if (scm_is_list (export_types) && scm_is_procedure (export_thunk))
+        choice = gnc_get_export_type_choice (export_types);
+    else
+        choice = SCM_BOOL_T;
 
-        if (choice == SCM_BOOL_F)
-                return;
+    if (choice == SCM_BOOL_F)
+        return;
 
-        filepath = gnc_get_export_filename (choice);
-        if (!filepath)
-                return;
+    filepath = gnc_get_export_filename (choice);
+    if (!filepath)
+        return;
 
-        if (scm_is_pair (choice))
-        {
-                SCM file_scm;
-                SCM res;
+    if (scm_is_pair (choice))
+    {
+        SCM file_scm;
+        SCM res;
 
-                choice = SCM_CDR (choice);
-                file_scm = scm_makfrom0str (filepath);
+        choice = SCM_CDR (choice);
+        file_scm = scm_makfrom0str (filepath);
 
-                res = scm_call_3 (export_thunk, priv->cur_report, choice, file_scm);
+        res = scm_call_3 (export_thunk, priv->cur_report, choice, file_scm);
 
-                result = (res != SCM_BOOL_F);
-        }
-        else
-                result = gnc_html_export_to_file (priv->html, filepath);
+        result = (res != SCM_BOOL_F);
+    }
+    else
+        result = gnc_html_export_to_file (priv->html, filepath);
 
-        if (!result)
-        {
-                const char *fmt = _("Could not open the file %s. "
-				    "The error is: %s");
-                gnc_error_dialog( NULL, fmt, filepath ? filepath : "(null)",
-                                  strerror (errno) ? strerror (errno) : "" );
-        }
+    if (!result)
+    {
+        const char *fmt = _("Could not open the file %s. "
+                            "The error is: %s");
+        gnc_error_dialog( NULL, fmt, filepath ? filepath : "(null)",
+                          strerror (errno) ? strerror (errno) : "" );
+    }
 
-        g_free(filepath);
-        return;
+    g_free(filepath);
+    return;
 }
 
 static void
@@ -1460,72 +1533,74 @@
 static void
 gnc_plugin_page_report_options_cb( GtkAction *action, GncPluginPageReport *report )
 {
-        GncPluginPageReportPrivate *priv;
-        SCM start_editor = scm_c_eval_string("gnc:report-edit-options");
-        SCM result;
-        
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-        if (priv->cur_report == SCM_BOOL_F)
-                return;
+    GncPluginPageReportPrivate *priv;
+    SCM start_editor = scm_c_eval_string("gnc:report-edit-options");
+    SCM result;
 
-        result = gfec_apply(start_editor, scm_cons(priv->cur_report, SCM_EOL), 
-                            error_handler);
-        if (result == SCM_BOOL_F || result == SCM_UNDEFINED) {
-                gnc_warning_dialog(GTK_WIDGET(gnc_ui_get_toplevel()), "%s", 
-                                   _("There are no options for this report."));
-        }
-        else {
-                gnc_plugin_page_report_add_edited_report(priv, priv->cur_report);
-        }
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    if (priv->cur_report == SCM_BOOL_F)
+        return;
+
+    result = gfec_apply(start_editor, scm_cons(priv->cur_report, SCM_EOL),
+                        error_handler);
+    if (result == SCM_BOOL_F || result == SCM_UNDEFINED)
+    {
+        gnc_warning_dialog(GTK_WIDGET(gnc_ui_get_toplevel()), "%s",
+                           _("There are no options for this report."));
+    }
+    else
+    {
+        gnc_plugin_page_report_add_edited_report(priv, priv->cur_report);
+    }
 }
 
 static void
 gnc_plugin_page_report_print_cb( GtkAction *action, GncPluginPageReport *report )
 {
-        GncPluginPageReportPrivate *priv;
+    GncPluginPageReportPrivate *priv;
 
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-        gnc_html_print(priv->html);
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    gnc_html_print(priv->html);
 }
 
 static void
 gnc_plugin_page_report_copy_cb(GtkAction *action, GncPluginPageReport *report)
 {
-        GncPluginPageReportPrivate *priv;
+    GncPluginPageReportPrivate *priv;
 
-        priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
-        gnc_html_copy_to_clipboard(priv->html);
+    priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+    gnc_html_copy_to_clipboard(priv->html);
 }
 
 /********************************************************************
  * gnc_main_window_open_report()
- * open an report in a top level window from an ID number 
+ * open an report in a top level window from an ID number
  ********************************************************************/
 
 void
 gnc_main_window_open_report(int report_id, GncMainWindow *window)
 {
-        GncPluginPage *reportPage;
+    GncPluginPage *reportPage;
 
-        if (window)
-                g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
+    if (window)
+        g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
 
-        reportPage = gnc_plugin_page_report_new( report_id );
-        gnc_main_window_open_page( window, reportPage );
+    reportPage = gnc_plugin_page_report_new( report_id );
+    gnc_main_window_open_page( window, reportPage );
 }
 
 void
 gnc_main_window_open_report_url(const char * url, GncMainWindow *window)
 {
-        GncPluginPage *reportPage;
+    GncPluginPage *reportPage;
 
-        DEBUG( "report url: [%s]\n", url );
+    DEBUG( "report url: [%s]\n", url );
 
-        if (window)
-                g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
+    if (window)
+        g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
 
-        reportPage = gnc_plugin_page_report_new( 42 /* url? */ );
-        gnc_main_window_open_page( window, reportPage );
+    reportPage = gnc_plugin_page_report_new( 42 /* url? */ );
+    gnc_main_window_open_page( window, reportPage );
 }
 
 /** @} */

Modified: gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.h
===================================================================
--- gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -21,12 +21,12 @@
  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
  * Boston, MA  02110-1301,  USA       gnu at gnu.org
  **/
-  
+
 /** @addtogroup GUI
     @{ */
 /** @addtogroup GuiReport Reports
     @{ */
-/** @file gnc-plugin-page-report.h 
+/** @file gnc-plugin-page-report.h
     @brief  Report page.
     @author Copyright (C) 2004 Joshua Sled <jsled at asynchronous.org>
 */
@@ -50,14 +50,16 @@
 #define GNC_PLUGIN_PAGE_REPORT_NAME "GncPluginPageReport"
 
 /* typedefs & structures */
-typedef struct {
-	GncPluginPage gnc_plugin;
+typedef struct
+{
+    GncPluginPage gnc_plugin;
 } GncPluginPageReport;
 
-typedef struct {
-        GncPluginPageClass gnc_plugin;
+typedef struct
+{
+    GncPluginPageClass gnc_plugin;
 
-	/* callbacks */
+    /* callbacks */
 } GncPluginPageReportClass;
 
 /* function prototypes */

Modified: gnucash/trunk/src/report/report-gnome/gncmod-report-gnome.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/gncmod-report-gnome.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-gnome/gncmod-report-gnome.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -32,51 +32,54 @@
 char *
 libgncmod_report_gnome_gnc_module_path(void)
 {
-  return g_strdup("gnucash/report/report-gnome");
+    return g_strdup("gnucash/report/report-gnome");
 }
 
 char *
 libgncmod_report_gnome_gnc_module_description(void)
 {
-  return g_strdup("Gnome component of GnuCash report generation system");
+    return g_strdup("Gnome component of GnuCash report generation system");
 }
 
 static void
 lmod(char * mn)
 {
-  char * form = g_strdup_printf("(use-modules %s)\n", mn);
-  scm_c_eval_string(form);
-  g_free(form);
+    char * form = g_strdup_printf("(use-modules %s)\n", mn);
+    scm_c_eval_string(form);
+    g_free(form);
 }
 extern SCM scm_init_sw_report_gnome_module(void);
 
 int
 libgncmod_report_gnome_gnc_module_init(int refcount)
 {
-  if(!gnc_module_load("gnucash/app-utils", 0)) {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
 
-  if(!gnc_module_load("gnucash/gnome-utils", 0)) {
-    return FALSE;
-  }
+    if (!gnc_module_load("gnucash/gnome-utils", 0))
+    {
+        return FALSE;
+    }
 
-  if(!gnc_module_load("gnucash/report/report-system", 0)) {
-    return FALSE;
-  }
-  scm_init_sw_report_gnome_module();
+    if (!gnc_module_load("gnucash/report/report-system", 0))
+    {
+        return FALSE;
+    }
+    scm_init_sw_report_gnome_module();
 
-  lmod ("(sw_report_gnome)");
-  lmod ("(gnucash report report-gnome)");
+    lmod ("(sw_report_gnome)");
+    lmod ("(gnucash report report-gnome)");
 
-  if (refcount == 0)
-    gnc_report_init ();
+    if (refcount == 0)
+        gnc_report_init ();
 
-  return TRUE;
+    return TRUE;
 }
 
 int
 libgncmod_report_gnome_gnc_module_end(int refcount)
 {
-  return TRUE;
+    return TRUE;
 }

Modified: gnucash/trunk/src/report/report-gnome/test/test-link-module.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/test/test-link-module.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-gnome/test/test-link-module.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,6 +1,7 @@
 #include <stdlib.h>
 
 int
-main(int argc, char ** argv) {
-  exit(0);
+main(int argc, char ** argv)
+{
+    exit(0);
 }

Modified: gnucash/trunk/src/report/report-gnome/window-report.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/window-report.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-gnome/window-report.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -57,20 +57,21 @@
 void
 reportWindow(int report_id)
 {
-  gnc_set_busy_cursor (NULL, TRUE);
-  gnc_main_window_open_report(report_id, NULL);
-  gnc_unset_busy_cursor (NULL);
+    gnc_set_busy_cursor (NULL, TRUE);
+    gnc_main_window_open_report(report_id, NULL);
+    gnc_unset_busy_cursor (NULL);
 }
 
 /********************************************************************
- * default parameters editor handling 
+ * default parameters editor handling
  ********************************************************************/
 
-struct report_default_params_data {
-  GNCOptionWin * win;
-  GNCOptionDB  * db;
-  SCM          scm_options;
-  SCM          cur_report;
+struct report_default_params_data
+{
+    GNCOptionWin * win;
+    GNCOptionDB  * db;
+    SCM          scm_options;
+    SCM          cur_report;
 };
 
 
@@ -78,106 +79,110 @@
 gnc_options_dialog_apply_cb(GNCOptionWin * propertybox,
                             gpointer user_data)
 {
-  SCM  dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
-  struct report_default_params_data * win = user_data;
-  
-  if(!win) return;
-  gnc_option_db_commit(win->db);
-  scm_call_2(dirty_report, win->cur_report, SCM_BOOL_T);
+    SCM  dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
+    struct report_default_params_data * win = user_data;
+
+    if (!win) return;
+    gnc_option_db_commit(win->db);
+    scm_call_2(dirty_report, win->cur_report, SCM_BOOL_T);
 }
 
 static void
 gnc_options_dialog_help_cb(GNCOptionWin * propertybox,
                            gpointer user_data)
 {
-  GtkWidget *dialog, *parent;
-  struct report_default_params_data * prm = user_data;
+    GtkWidget *dialog, *parent;
+    struct report_default_params_data * prm = user_data;
 
-  parent = gnc_options_dialog_widget(prm->win);
-  dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
-				  GTK_DIALOG_DESTROY_WITH_PARENT,
-				  GTK_MESSAGE_INFO,
-				  GTK_BUTTONS_OK,
-				  "%s",
-				  _("Set the report options you want using this dialog."));
-  g_signal_connect(G_OBJECT(dialog), "response",
-		   (GCallback)gtk_widget_destroy, NULL);
-  gtk_widget_show(dialog);
+    parent = gnc_options_dialog_widget(prm->win);
+    dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
+                                    GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_INFO,
+                                    GTK_BUTTONS_OK,
+                                    "%s",
+                                    _("Set the report options you want using this dialog."));
+    g_signal_connect(G_OBJECT(dialog), "response",
+                     (GCallback)gtk_widget_destroy, NULL);
+    gtk_widget_show(dialog);
 }
 
 static void
 gnc_options_dialog_close_cb(GNCOptionWin * propertybox,
                             gpointer user_data)
 {
-  struct report_default_params_data * win = user_data;
-  SCM    set_editor = scm_c_eval_string("gnc:report-set-editor-widget!");
-  
-  scm_call_2(set_editor, win->cur_report, SCM_BOOL_F);
-  gnc_options_dialog_destroy(win->win);
-  gnc_option_db_destroy(win->db);
-  scm_gc_unprotect_object(win->scm_options);
-  g_free(win);
+    struct report_default_params_data * win = user_data;
+    SCM    set_editor = scm_c_eval_string("gnc:report-set-editor-widget!");
+
+    scm_call_2(set_editor, win->cur_report, SCM_BOOL_F);
+    gnc_options_dialog_destroy(win->win);
+    gnc_option_db_destroy(win->db);
+    scm_gc_unprotect_object(win->scm_options);
+    g_free(win);
 }
 
 
-GtkWidget * 
+GtkWidget *
 gnc_report_window_default_params_editor(SCM options, SCM report)
 {
-  SCM get_editor        = scm_c_eval_string("gnc:report-editor-widget");
-  SCM get_report_type   = scm_c_eval_string("gnc:report-type");
-  SCM get_template      = scm_c_eval_string("gnc:find-report-template");
-  SCM get_template_name = scm_c_eval_string("gnc:report-template-name");
-  SCM ptr;
-  
-  const gchar *title = NULL;
+    SCM get_editor        = scm_c_eval_string("gnc:report-editor-widget");
+    SCM get_report_type   = scm_c_eval_string("gnc:report-type");
+    SCM get_template      = scm_c_eval_string("gnc:find-report-template");
+    SCM get_template_name = scm_c_eval_string("gnc:report-template-name");
+    SCM ptr;
 
-  ptr = scm_call_1(get_editor, report);
-  if(ptr != SCM_BOOL_F) {
-    #define FUNC_NAME "gtk_window_present"
-    GtkWindow * w = SWIG_MustGetPtr(ptr, SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
-    gtk_window_present(w);
-    #undef FUNC_NAME
-    return NULL;
-  }
-  else {
-    struct report_default_params_data * prm = 
-      g_new0(struct report_default_params_data, 1);
-    
-    prm->scm_options = options;
-    prm->cur_report  = report;
-    prm->db          = gnc_option_db_new(prm->scm_options);
+    const gchar *title = NULL;
 
-    /* Get the title of the report's template. */
-    ptr = scm_call_1(get_report_type, report);
-    if (ptr != SCM_BOOL_F) {
-      ptr = scm_call_1(get_template, ptr);
-      if (ptr != SCM_BOOL_F) {
-        ptr = scm_call_1(get_template_name, ptr);
-        if (scm_is_string(ptr))
-          title = scm_to_locale_string(ptr);
-      }
+    ptr = scm_call_1(get_editor, report);
+    if (ptr != SCM_BOOL_F)
+    {
+#define FUNC_NAME "gtk_window_present"
+        GtkWindow * w = SWIG_MustGetPtr(ptr, SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
+        gtk_window_present(w);
+#undef FUNC_NAME
+        return NULL;
     }
+    else
+    {
+        struct report_default_params_data * prm =
+            g_new0(struct report_default_params_data, 1);
 
-    /* Don't forget to translate the window title */
-    prm->win  = gnc_options_dialog_new((gchar*) (title && *title ? _(title) : ""));
-    
-    scm_gc_protect_object(prm->scm_options);
-    scm_gc_protect_object(prm->cur_report);
-    
-    gnc_options_dialog_build_contents(prm->win, prm->db);
-    gnc_option_db_clean(prm->db);
+        prm->scm_options = options;
+        prm->cur_report  = report;
+        prm->db          = gnc_option_db_new(prm->scm_options);
 
-    gnc_options_dialog_set_apply_cb(prm->win, 
-                                    gnc_options_dialog_apply_cb,
-                                    (gpointer)prm);
-    gnc_options_dialog_set_help_cb(prm->win, 
-                                   gnc_options_dialog_help_cb,
-                                   (gpointer)prm);
-    gnc_options_dialog_set_close_cb(prm->win, 
-                                    gnc_options_dialog_close_cb,
-                                    (gpointer)prm);
-    return gnc_options_dialog_widget(prm->win);
-  }
+        /* Get the title of the report's template. */
+        ptr = scm_call_1(get_report_type, report);
+        if (ptr != SCM_BOOL_F)
+        {
+            ptr = scm_call_1(get_template, ptr);
+            if (ptr != SCM_BOOL_F)
+            {
+                ptr = scm_call_1(get_template_name, ptr);
+                if (scm_is_string(ptr))
+                    title = scm_to_locale_string(ptr);
+            }
+        }
+
+        /* Don't forget to translate the window title */
+        prm->win  = gnc_options_dialog_new((gchar*) (title && *title ? _(title) : ""));
+
+        scm_gc_protect_object(prm->scm_options);
+        scm_gc_protect_object(prm->cur_report);
+
+        gnc_options_dialog_build_contents(prm->win, prm->db);
+        gnc_option_db_clean(prm->db);
+
+        gnc_options_dialog_set_apply_cb(prm->win,
+                                        gnc_options_dialog_apply_cb,
+                                        (gpointer)prm);
+        gnc_options_dialog_set_help_cb(prm->win,
+                                       gnc_options_dialog_help_cb,
+                                       (gpointer)prm);
+        gnc_options_dialog_set_close_cb(prm->win,
+                                        gnc_options_dialog_close_cb,
+                                        (gpointer)prm);
+        return gnc_options_dialog_widget(prm->win);
+    }
 }
 
 void
@@ -185,42 +190,43 @@
 {
     SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
     SCM editor = scm_call_1(get_editor, report);
-    #define FUNC_NAME "gtk_window_present"
+#define FUNC_NAME "gtk_window_present"
     GtkWidget *w = SWIG_MustGetPtr(editor,
                                    SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
-    #undef FUNC_NAME
+#undef FUNC_NAME
     gtk_window_present(GTK_WINDOW(w));
 }
 
 static gboolean
 gnc_html_file_stream_cb (const char *location, char ** data, int *len)
 {
-  *len = gncReadFile (location, data);
-  return (*len > 0);
+    *len = gncReadFile (location, data);
+    return (*len > 0);
 }
 
 static gboolean
 gnc_html_report_stream_cb (const char *location, char ** data, int *len)
 {
-  gboolean ok;
+    gboolean ok;
 
-  ok = gnc_run_report_id_string (location, data);
+    ok = gnc_run_report_id_string (location, data);
 
-  if (!ok) {
-    *data = g_strdup_printf ("<html><body><h3>%s</h3>"
-			     "<p>%s</p></body></html>", 
-			     _("Report error"),
-			     _("An error occurred while running the report."));
-    
-    /* Make sure the progress bar is finished, which will also
-       make the GUI sensitive again. Easier to do this via guile
-       because otherwise we would need to link against gnome-utils
-       and a lot more. */
-    scm_c_eval_string("(gnc:report-finished)");
-  }
+    if (!ok)
+    {
+        *data = g_strdup_printf ("<html><body><h3>%s</h3>"
+                                 "<p>%s</p></body></html>",
+                                 _("Report error"),
+                                 _("An error occurred while running the report."));
 
-  *len = strlen(*data);
-  return ok;
+        /* Make sure the progress bar is finished, which will also
+           make the GUI sensitive again. Easier to do this via guile
+           because otherwise we would need to link against gnome-utils
+           and a lot more. */
+        scm_c_eval_string("(gnc:report-finished)");
+    }
+
+    *len = strlen(*data);
+    return ok;
 }
 
 /* TODO: unroll start_editor */
@@ -228,97 +234,97 @@
 gnc_html_options_url_cb (const char *location, const char *label,
                          gboolean new_window, GNCURLResult *result)
 {
-  SCM start_editor = scm_c_eval_string ("gnc:report-edit-options");
-  SCM report;
-  int report_id;
+    SCM start_editor = scm_c_eval_string ("gnc:report-edit-options");
+    SCM report;
+    int report_id;
 
-  g_return_val_if_fail (location != NULL, FALSE);
-  g_return_val_if_fail (result != NULL, FALSE);
+    g_return_val_if_fail (location != NULL, FALSE);
+    g_return_val_if_fail (result != NULL, FALSE);
 
-  result->load_to_stream = FALSE;
+    result->load_to_stream = FALSE;
 
-  /* href="gnc-options:report-id=2676" */
-  if (strncmp ("report-id=", location, 10) == 0)
-  {
-    if (sscanf (location + 10, "%d", &report_id) != 1)
+    /* href="gnc-options:report-id=2676" */
+    if (strncmp ("report-id=", location, 10) == 0)
     {
-      result->error_message =
-        g_strdup_printf (_("Badly formed options URL: %s"), location);
+        if (sscanf (location + 10, "%d", &report_id) != 1)
+        {
+            result->error_message =
+                g_strdup_printf (_("Badly formed options URL: %s"), location);
 
-      return FALSE;
-    }
+            return FALSE;
+        }
 
-    report = gnc_report_find(report_id);
-    if (report == SCM_UNDEFINED ||
-        report == SCM_BOOL_F)
-    {
-      result->error_message =
-        g_strdup_printf (_("Badly-formed report id: %s"), location);
+        report = gnc_report_find(report_id);
+        if (report == SCM_UNDEFINED ||
+                report == SCM_BOOL_F)
+        {
+            result->error_message =
+                g_strdup_printf (_("Badly-formed report id: %s"), location);
 
-      return FALSE;
-    }
+            return FALSE;
+        }
 
-    scm_call_1 (start_editor, report);
+        scm_call_1 (start_editor, report);
 
-    return TRUE;
-  }
-  else
-  {
-    result->error_message =
-      g_strdup_printf (_("Badly formed options URL: %s"), location);
+        return TRUE;
+    }
+    else
+    {
+        result->error_message =
+            g_strdup_printf (_("Badly formed options URL: %s"), location);
 
-    return FALSE;
-  }
+        return FALSE;
+    }
 }
 
 static gboolean
 gnc_html_report_url_cb (const char *location, const char *label,
                         gboolean new_window, GNCURLResult *result)
 {
-  g_return_val_if_fail (location != NULL, FALSE);
-  g_return_val_if_fail (result != NULL, FALSE);
+    g_return_val_if_fail (location != NULL, FALSE);
+    g_return_val_if_fail (result != NULL, FALSE);
 
-  /* make a new window if necessary */ 
-  if (new_window)
-  {
-    char *url;
+    /* make a new window if necessary */
+    if (new_window)
+    {
+        char *url;
 
-    url = gnc_build_url (URL_TYPE_REPORT, location, label);
-    gnc_main_window_open_report_url (url, NULL);
-    g_free (url);
+        url = gnc_build_url (URL_TYPE_REPORT, location, label);
+        gnc_main_window_open_report_url (url, NULL);
+        g_free (url);
 
-    result->load_to_stream = FALSE;
-  }
-  else
-  {
-    result->load_to_stream = TRUE;
-  }
+        result->load_to_stream = FALSE;
+    }
+    else
+    {
+        result->load_to_stream = TRUE;
+    }
 
-  return TRUE;
+    return TRUE;
 }
 
 static gboolean
 gnc_html_help_url_cb (const char *location, const char *label,
                       gboolean new_window, GNCURLResult *result)
 {
-  g_return_val_if_fail (location != NULL, FALSE);
+    g_return_val_if_fail (location != NULL, FALSE);
 
-  gnc_gnome_help (location, label);
-  return TRUE;
+    gnc_gnome_help (location, label);
+    return TRUE;
 }
 
 void
 gnc_report_init (void)
 {
-  /* Reference the report page plugin to ensure it exists in the gtk
-   * type system. */
-  GNC_TYPE_PLUGIN_PAGE_REPORT;
+    /* Reference the report page plugin to ensure it exists in the gtk
+     * type system. */
+    GNC_TYPE_PLUGIN_PAGE_REPORT;
 
-  gnc_html_register_stream_handler (URL_TYPE_HELP, gnc_html_file_stream_cb);
-  gnc_html_register_stream_handler (URL_TYPE_FILE, gnc_html_file_stream_cb);
-  gnc_html_register_stream_handler (URL_TYPE_REPORT, gnc_html_report_stream_cb);
+    gnc_html_register_stream_handler (URL_TYPE_HELP, gnc_html_file_stream_cb);
+    gnc_html_register_stream_handler (URL_TYPE_FILE, gnc_html_file_stream_cb);
+    gnc_html_register_stream_handler (URL_TYPE_REPORT, gnc_html_report_stream_cb);
 
-  gnc_html_register_url_handler (URL_TYPE_OPTIONS, gnc_html_options_url_cb);
-  gnc_html_register_url_handler (URL_TYPE_REPORT, gnc_html_report_url_cb);
-  gnc_html_register_url_handler (URL_TYPE_HELP, gnc_html_help_url_cb);
+    gnc_html_register_url_handler (URL_TYPE_OPTIONS, gnc_html_options_url_cb);
+    gnc_html_register_url_handler (URL_TYPE_REPORT, gnc_html_report_url_cb);
+    gnc_html_register_url_handler (URL_TYPE_HELP, gnc_html_help_url_cb);
 }

Modified: gnucash/trunk/src/report/report-gnome/window-report.h
===================================================================
--- gnucash/trunk/src/report/report-gnome/window-report.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-gnome/window-report.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -27,7 +27,7 @@
 
 //#include "gnc-html.h"
 #include "qof.h"
-  
+
 typedef struct gnc_report_window_s gnc_report_window;
 
 /** PROTOTYPES ******************************************************/

Modified: gnucash/trunk/src/report/report-system/gnc-report.c
===================================================================
--- gnucash/trunk/src/report/report-system/gnc-report.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-system/gnc-report.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -39,14 +39,15 @@
 static void
 gnc_report_init_table(void)
 {
-    if (!reports) {
+    if (!reports)
+    {
         reports = g_hash_table_new_full(
-            g_int_hash, g_int_equal, 
-            g_free, (GDestroyNotify) scm_gc_unprotect_object);
+                      g_int_hash, g_int_equal,
+                      g_free, (GDestroyNotify) scm_gc_unprotect_object);
     }
 }
 
-void 
+void
 gnc_report_remove_by_id(gint id)
 {
     if (reports)
@@ -57,7 +58,8 @@
 {
     gpointer report = NULL;
 
-    if (reports) {
+    if (reports)
+    {
         report = g_hash_table_lookup(reports, &id);
     }
 
@@ -76,29 +78,33 @@
     gnc_report_init_table();
 
     value = scm_call_1(get_id, report);
-    if (scm_is_number(value)) {
-      id = scm_num2int(value, SCM_ARG1, G_STRFUNC);
-      if (!g_hash_table_lookup(reports, &id)) {
-	key = g_new(gint, 1);
-	*key = id;
-	g_hash_table_insert(reports, key, (gpointer)report);
-	scm_gc_protect_object(report);
-	return id;
-      }
-      g_warning("Report specified id of %d is already is use. "
-		"Using generated id.", id);
+    if (scm_is_number(value))
+    {
+        id = scm_num2int(value, SCM_ARG1, G_STRFUNC);
+        if (!g_hash_table_lookup(reports, &id))
+        {
+            key = g_new(gint, 1);
+            *key = id;
+            g_hash_table_insert(reports, key, (gpointer)report);
+            scm_gc_protect_object(report);
+            return id;
+        }
+        g_warning("Report specified id of %d is already is use. "
+                  "Using generated id.", id);
     }
 
     id = report_next_serial_id++;
-    while (id < G_MAXINT) {
-      if (!g_hash_table_lookup(reports, &id)) {
-	key = g_new(gint, 1);
-	*key = id;
-	g_hash_table_insert(reports, key, (gpointer)report);
-	scm_gc_protect_object(report);
-	return id;
-      }
-      id = report_next_serial_id++;
+    while (id < G_MAXINT)
+    {
+        if (!g_hash_table_lookup(reports, &id))
+        {
+            key = g_new(gint, 1);
+            *key = id;
+            g_hash_table_insert(reports, key, (gpointer)report);
+            scm_gc_protect_object(report);
+            return id;
+        }
+        id = report_next_serial_id++;
     }
 
     g_warning("Unable to add report to table. %d reports in use.", G_MAXINT);
@@ -106,7 +112,7 @@
     return G_MAXINT;
 }
 
-static gboolean 
+static gboolean
 yes_remove(gpointer key, gpointer val, gpointer data)
 {
     return TRUE;
@@ -135,57 +141,57 @@
 gboolean
 gnc_run_report (gint report_id, char ** data)
 {
-  const gchar *free_data;
-  SCM scm_text;
-  gchar *str;
+    const gchar *free_data;
+    SCM scm_text;
+    gchar *str;
 
-  g_return_val_if_fail (data != NULL, FALSE);
-  *data = NULL;
+    g_return_val_if_fail (data != NULL, FALSE);
+    *data = NULL;
 
-  str = g_strdup_printf("(gnc:report-run %d)", report_id);
-  scm_text = gfec_eval_string(str, error_handler);
-  g_free(str);
+    str = g_strdup_printf("(gnc:report-run %d)", report_id);
+    scm_text = gfec_eval_string(str, error_handler);
+    g_free(str);
 
-  if (scm_text == SCM_UNDEFINED || !scm_is_string (scm_text))
-    return FALSE;
+    if (scm_text == SCM_UNDEFINED || !scm_is_string (scm_text))
+        return FALSE;
 
-  free_data = scm_to_locale_string (scm_text);
-  *data = g_strdup (free_data);
+    free_data = scm_to_locale_string (scm_text);
+    *data = g_strdup (free_data);
 
-  return TRUE;
+    return TRUE;
 }
 
 gboolean
 gnc_run_report_id_string (const char * id_string, char **data)
 {
-  gint report_id;
+    gint report_id;
 
-  g_return_val_if_fail (id_string != NULL, FALSE);
-  g_return_val_if_fail (data != NULL, FALSE);
-  *data = NULL;
+    g_return_val_if_fail (id_string != NULL, FALSE);
+    g_return_val_if_fail (data != NULL, FALSE);
+    *data = NULL;
 
-  if (strncmp ("id=", id_string, 3) != 0)
-    return FALSE;
+    if (strncmp ("id=", id_string, 3) != 0)
+        return FALSE;
 
-  if (sscanf (id_string + 3, "%d", &report_id) != 1)
-    return FALSE;
+    if (sscanf (id_string + 3, "%d", &report_id) != 1)
+        return FALSE;
 
-  return gnc_run_report (report_id, data);
+    return gnc_run_report (report_id, data);
 }
 
 gchar*
 gnc_report_name( SCM report )
 {
-  SCM    get_name = scm_c_eval_string("gnc:report-name");
-  SCM    value;
-  
-  if (report == SCM_BOOL_F)
-    return NULL;
+    SCM    get_name = scm_c_eval_string("gnc:report-name");
+    SCM    value;
 
-  value = scm_call_1(get_name, report);
-  if (!scm_is_string(value))
-    return NULL;
+    if (report == SCM_BOOL_F)
+        return NULL;
 
-  return g_strdup(scm_to_locale_string(value));
+    value = scm_call_1(get_name, report);
+    if (!scm_is_string(value))
+        return NULL;
+
+    return g_strdup(scm_to_locale_string(value));
 }
 

Modified: gnucash/trunk/src/report/report-system/gncmod-report-system.c
===================================================================
--- gnucash/trunk/src/report/report-system/gncmod-report-system.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-system/gncmod-report-system.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,41 +24,48 @@
 
 
 char *
-libgncmod_report_system_gnc_module_path(void) {
-  return g_strdup("gnucash/report/report-system");
+libgncmod_report_system_gnc_module_path(void)
+{
+    return g_strdup("gnucash/report/report-system");
 }
 
 char *
-libgncmod_report_system_gnc_module_description(void) {
-  return g_strdup("Core components of GnuCash report generation system");
+libgncmod_report_system_gnc_module_description(void)
+{
+    return g_strdup("Core components of GnuCash report generation system");
 }
 
 extern SCM scm_init_sw_report_system_module(void);
 
 int
-libgncmod_report_system_gnc_module_init(int refcount) {
-  /* load the engine (we depend on it) */
-  if(!gnc_module_load("gnucash/engine", 0)) {
-    return FALSE;
-  }
+libgncmod_report_system_gnc_module_init(int refcount)
+{
+    /* load the engine (we depend on it) */
+    if (!gnc_module_load("gnucash/engine", 0))
+    {
+        return FALSE;
+    }
 
-  if(!gnc_module_load("gnucash/app-utils", 0)) {
-    return FALSE;
-  }
-  scm_init_sw_report_system_module();
+    if (!gnc_module_load("gnucash/app-utils", 0))
+    {
+        return FALSE;
+    }
+    scm_init_sw_report_system_module();
 
-  scm_c_eval_string("(use-modules (gnucash report report-system))");
+    scm_c_eval_string("(use-modules (gnucash report report-system))");
 
-  /* if this is the first time the module's being loaded, initialize
-   * the relative date system */
-  if(refcount == 0) {
-    scm_c_eval_string("(gnc:reldate-initialize)");
-  }
+    /* if this is the first time the module's being loaded, initialize
+     * the relative date system */
+    if (refcount == 0)
+    {
+        scm_c_eval_string("(gnc:reldate-initialize)");
+    }
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_report_system_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_report_system_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/report/report-system/test/test-link-module.c
===================================================================
--- gnucash/trunk/src/report/report-system/test/test-link-module.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/report-system/test/test-link-module.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,6 +1,7 @@
 #include <stdlib.h>
 
 int
-main(int argc, char ** argv) {
-  exit(0);
+main(int argc, char ** argv)
+{
+    exit(0);
 }

Modified: gnucash/trunk/src/report/standard-reports/gncmod-standard-reports.c
===================================================================
--- gnucash/trunk/src/report/standard-reports/gncmod-standard-reports.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/standard-reports/gncmod-standard-reports.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,31 +24,37 @@
 
 
 char *
-libgncmod_standard_reports_gnc_module_path(void) {
-  return g_strdup("gnucash/report/standard-reports");
+libgncmod_standard_reports_gnc_module_path(void)
+{
+    return g_strdup("gnucash/report/standard-reports");
 }
 
 char *
-libgncmod_standard_reports_gnc_module_description(void) {
-  return g_strdup("Standard income, asset, balance sheet, etc. reports");
+libgncmod_standard_reports_gnc_module_description(void)
+{
+    return g_strdup("Standard income, asset, balance sheet, etc. reports");
 }
 
 int
-libgncmod_standard_reports_gnc_module_init(int refcount) {
-  /* load the report system */
-  if(!gnc_module_load("gnucash/report/report-system", 0)) {
-    return FALSE;
-  }
+libgncmod_standard_reports_gnc_module_init(int refcount)
+{
+    /* load the report system */
+    if (!gnc_module_load("gnucash/report/report-system", 0))
+    {
+        return FALSE;
+    }
 
-  /* load the report generation scheme code */
-  if(scm_c_eval_string("(use-modules (gnucash report standard-reports))") ==
-     SCM_BOOL_F) {
-    return FALSE;
-  }
-  return TRUE;
+    /* load the report generation scheme code */
+    if (scm_c_eval_string("(use-modules (gnucash report standard-reports))") ==
+            SCM_BOOL_F)
+    {
+        return FALSE;
+    }
+    return TRUE;
 }
 
 int
-libgncmod_standard_reports_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_standard_reports_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.c
===================================================================
--- gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-stylesheets.c -- 
+/*
+ * gnc-plugin-stylesheets.c --
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -38,24 +38,27 @@
 
 /* Command callbacks */
 static void gnc_plugin_stylesheets_cmd_edit_style_sheet (GtkAction *action,
-							 GncMainWindowActionData *data);
+        GncMainWindowActionData *data);
 
 
 #define PLUGIN_ACTIONS_NAME "gnc-plugin-stylesheets-actions"
 #define PLUGIN_UI_FILENAME  "gnc-plugin-stylesheets-ui.xml"
 
-static GtkActionEntry gnc_plugin_actions [] = {
-  /* Menu Items */
-  { "EditStyleSheetsAction", NULL, N_("St_yle Sheets"), NULL,
-    N_("Edit report style sheets."),
-    G_CALLBACK (gnc_plugin_stylesheets_cmd_edit_style_sheet) },
+static GtkActionEntry gnc_plugin_actions [] =
+{
+    /* Menu Items */
+    {
+        "EditStyleSheetsAction", NULL, N_("St_yle Sheets"), NULL,
+        N_("Edit report style sheets."),
+        G_CALLBACK (gnc_plugin_stylesheets_cmd_edit_style_sheet)
+    },
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
 
 
 typedef struct GncPluginStylesheetsPrivate
 {
-  gpointer dummy;
+    gpointer dummy;
 } GncPluginStylesheetsPrivate;
 
 #define GNC_PLUGIN_STYLESHEETS_GET_PRIVATE(o)  \
@@ -70,55 +73,57 @@
 GType
 gnc_plugin_stylesheets_get_type (void)
 {
-  static GType gnc_plugin_stylesheets_type = 0;
+    static GType gnc_plugin_stylesheets_type = 0;
 
-  if (gnc_plugin_stylesheets_type == 0) {
-    static const GTypeInfo our_info = {
-      sizeof (GncPluginStylesheetsClass),
-		NULL,		/* base_init */
-		NULL,		/* base_finalize */
-		(GClassInitFunc) gnc_plugin_stylesheets_class_init,
-		NULL,		/* class_finalize */
-		NULL,		/* class_data */
-		sizeof (GncPluginStylesheets),
-		0,		/* n_preallocs */
-		(GInstanceInitFunc) gnc_plugin_stylesheets_init,
-    };
+    if (gnc_plugin_stylesheets_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginStylesheetsClass),
+            NULL,		/* base_init */
+            NULL,		/* base_finalize */
+            (GClassInitFunc) gnc_plugin_stylesheets_class_init,
+            NULL,		/* class_finalize */
+            NULL,		/* class_data */
+            sizeof (GncPluginStylesheets),
+            0,		/* n_preallocs */
+            (GInstanceInitFunc) gnc_plugin_stylesheets_init,
+        };
 
-    gnc_plugin_stylesheets_type = g_type_register_static (GNC_TYPE_PLUGIN,
-							  "GncPluginStylesheets",
-							  &our_info, 0);
-  }
+        gnc_plugin_stylesheets_type = g_type_register_static (GNC_TYPE_PLUGIN,
+                                      "GncPluginStylesheets",
+                                      &our_info, 0);
+    }
 
-  return gnc_plugin_stylesheets_type;
+    return gnc_plugin_stylesheets_type;
 }
 
 GncPlugin *
 gnc_plugin_stylesheets_new (void)
 {
-  return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_STYLESHEETS, NULL));
+    return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_STYLESHEETS, NULL));
 }
 
 static void
 gnc_plugin_stylesheets_class_init (GncPluginStylesheetsClass *klass)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
 
-  parent_class = g_type_class_peek_parent (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-  object_class->finalize = gnc_plugin_stylesheets_finalize;
+    object_class->finalize = gnc_plugin_stylesheets_finalize;
 
-  /* plugin info */
-  plugin_class->plugin_name  = GNC_PLUGIN_STYLESHEETS_NAME;
+    /* plugin info */
+    plugin_class->plugin_name  = GNC_PLUGIN_STYLESHEETS_NAME;
 
-  /* widget addition/removal */
-  plugin_class->actions_name  	   = PLUGIN_ACTIONS_NAME;
-  plugin_class->actions       	   = gnc_plugin_actions;
-  plugin_class->n_actions     	   = gnc_plugin_n_actions;
-  plugin_class->ui_filename   	   = PLUGIN_UI_FILENAME;
+    /* widget addition/removal */
+    plugin_class->actions_name  	   = PLUGIN_ACTIONS_NAME;
+    plugin_class->actions       	   = gnc_plugin_actions;
+    plugin_class->n_actions     	   = gnc_plugin_n_actions;
+    plugin_class->ui_filename   	   = PLUGIN_UI_FILENAME;
 
-  g_type_class_add_private(klass, sizeof(GncPluginStylesheetsPrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginStylesheetsPrivate));
 }
 
 static void
@@ -129,15 +134,15 @@
 static void
 gnc_plugin_stylesheets_finalize (GObject *object)
 {
-  GncPluginStylesheets *plugin;
-  GncPluginStylesheetsPrivate *priv;
+    GncPluginStylesheets *plugin;
+    GncPluginStylesheetsPrivate *priv;
 
-  g_return_if_fail (GNC_IS_PLUGIN_STYLESHEETS (object));
+    g_return_if_fail (GNC_IS_PLUGIN_STYLESHEETS (object));
 
-  plugin = GNC_PLUGIN_STYLESHEETS (object);
-  priv = GNC_PLUGIN_STYLESHEETS_GET_PRIVATE(plugin);
+    plugin = GNC_PLUGIN_STYLESHEETS (object);
+    priv = GNC_PLUGIN_STYLESHEETS_GET_PRIVATE(plugin);
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 /************************************************************
@@ -146,9 +151,9 @@
 
 static void
 gnc_plugin_stylesheets_cmd_edit_style_sheet (GtkAction *action,
-					     GncMainWindowActionData *data)
+        GncMainWindowActionData *data)
 {
-  gnc_style_sheet_dialog_open();
+    gnc_style_sheet_dialog_open();
 }
 
 /************************************************************
@@ -158,7 +163,7 @@
 void
 gnc_plugin_stylesheets_create_plugin (void)
 {
-  GncPlugin *plugin = gnc_plugin_stylesheets_new ();
+    GncPlugin *plugin = gnc_plugin_stylesheets_new ();
 
-  gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
+    gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
 }

Modified: gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.h
===================================================================
--- gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.h	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.h	2010-02-18 05:31:54 UTC (rev 18675)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-stylesheets.h -- 
+/*
+ * gnc-plugin-stylesheets.h --
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -40,12 +40,14 @@
 #define GNC_PLUGIN_STYLESHEETS_NAME "gnc-plugin-stylesheets"
 
 /* typedefs & structures */
-typedef struct {
-	GncPlugin gnc_plugin;
+typedef struct
+{
+    GncPlugin gnc_plugin;
 } GncPluginStylesheets;
 
-typedef struct {
-	GncPluginClass gnc_plugin;
+typedef struct
+{
+    GncPluginClass gnc_plugin;
 } GncPluginStylesheetsClass;
 
 /* function prototypes */

Modified: gnucash/trunk/src/report/stylesheets/gncmod-stylesheets.c
===================================================================
--- gnucash/trunk/src/report/stylesheets/gncmod-stylesheets.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/stylesheets/gncmod-stylesheets.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -26,35 +26,41 @@
 
 
 char *
-libgncmod_stylesheets_gnc_module_path(void) {
-  return g_strdup("gnucash/report/stylesheets");
+libgncmod_stylesheets_gnc_module_path(void)
+{
+    return g_strdup("gnucash/report/stylesheets");
 }
 
 char *
-libgncmod_stylesheets_gnc_module_description(void) {
-  return g_strdup("Standard report stylesheet definitions");
+libgncmod_stylesheets_gnc_module_description(void)
+{
+    return g_strdup("Standard report stylesheet definitions");
 }
 
 int
-libgncmod_stylesheets_gnc_module_init(int refcount) {
-  /* load the report system */
-  if(!gnc_module_load("gnucash/report/report-system", 0)) {
-    return FALSE;
-  }
+libgncmod_stylesheets_gnc_module_init(int refcount)
+{
+    /* load the report system */
+    if (!gnc_module_load("gnucash/report/report-system", 0))
+    {
+        return FALSE;
+    }
 
-  /* load the report generation scheme code */
-  if(scm_c_eval_string("(use-modules (gnucash report stylesheets))") ==
-     SCM_BOOL_F) {
-    return FALSE;
-  }
+    /* load the report generation scheme code */
+    if (scm_c_eval_string("(use-modules (gnucash report stylesheets))") ==
+            SCM_BOOL_F)
+    {
+        return FALSE;
+    }
 
-  /* Add menu items with C callbacks */
-  gnc_plugin_stylesheets_create_plugin();
+    /* Add menu items with C callbacks */
+    gnc_plugin_stylesheets_create_plugin();
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_stylesheets_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_stylesheets_gnc_module_end(int refcount)
+{
+    return TRUE;
 }

Modified: gnucash/trunk/src/report/utility-reports/gncmod-utility-reports.c
===================================================================
--- gnucash/trunk/src/report/utility-reports/gncmod-utility-reports.c	2010-02-18 05:29:28 UTC (rev 18674)
+++ gnucash/trunk/src/report/utility-reports/gncmod-utility-reports.c	2010-02-18 05:31:54 UTC (rev 18675)
@@ -24,32 +24,38 @@
 
 
 char *
-libgncmod_utility_reports_gnc_module_path(void) {
-  return g_strdup("gnucash/report/utility-reports");
+libgncmod_utility_reports_gnc_module_path(void)
+{
+    return g_strdup("gnucash/report/utility-reports");
 }
 
 char *
-libgncmod_utility_reports_gnc_module_description(void) {
-  return g_strdup("Non-financial (utility) reports");
+libgncmod_utility_reports_gnc_module_description(void)
+{
+    return g_strdup("Non-financial (utility) reports");
 }
 
 int
-libgncmod_utility_reports_gnc_module_init(int refcount) {
-  /* load the report system */
-  if(!gnc_module_load("gnucash/report/report-system", 0)) {
-    return FALSE;
-  }
+libgncmod_utility_reports_gnc_module_init(int refcount)
+{
+    /* load the report system */
+    if (!gnc_module_load("gnucash/report/report-system", 0))
+    {
+        return FALSE;
+    }
 
-  /* load the report generation scheme code */
-  if(scm_c_eval_string("(use-modules (gnucash report utility-reports))") ==
-     SCM_BOOL_F) {
-    return FALSE;
-  }
+    /* load the report generation scheme code */
+    if (scm_c_eval_string("(use-modules (gnucash report utility-reports))") ==
+            SCM_BOOL_F)
+    {
+        return FALSE;
+    }
 
-  return TRUE;
+    return TRUE;
 }
 
 int
-libgncmod_utility_reports_gnc_module_end(int refcount) {
-  return TRUE;
+libgncmod_utility_reports_gnc_module_end(int refcount)
+{
+    return TRUE;
 }



More information about the gnucash-changes mailing list