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

Christian Stimming cstim at code.gnucash.org
Sat Feb 27 11:32:03 EST 2010


Author: cstim
Date: 2010-02-27 11:32:01 -0500 (Sat, 27 Feb 2010)
New Revision: 18746
Trac: http://svn.gnucash.org/trac/changeset/18746

Modified:
   gnucash/trunk/src/gnome/dialog-chart-export.c
   gnucash/trunk/src/gnome/dialog-chart-export.h
   gnucash/trunk/src/gnome/dialog-commodities.c
   gnucash/trunk/src/gnome/dialog-fincalc.c
   gnucash/trunk/src/gnome/dialog-find-transactions.c
   gnucash/trunk/src/gnome/dialog-new-user.c
   gnucash/trunk/src/gnome/dialog-price-edit-db.c
   gnucash/trunk/src/gnome/dialog-price-editor.c
   gnucash/trunk/src/gnome/dialog-print-check.c
   gnucash/trunk/src/gnome/dialog-progress.c
   gnucash/trunk/src/gnome/dialog-progress.h
   gnucash/trunk/src/gnome/dialog-sx-editor.c
   gnucash/trunk/src/gnome/dialog-sx-editor.h
   gnucash/trunk/src/gnome/dialog-sx-from-trans.c
   gnucash/trunk/src/gnome/dialog-sx-since-last-run.c
   gnucash/trunk/src/gnome/dialog-sx-since-last-run.h
   gnucash/trunk/src/gnome/dialog-tax-info.c
   gnucash/trunk/src/gnome/dialog-userpass.c
   gnucash/trunk/src/gnome/druid-acct-period.c
   gnucash/trunk/src/gnome/druid-acct-period.h
   gnucash/trunk/src/gnome/druid-hierarchy.c
   gnucash/trunk/src/gnome/druid-loan.c
   gnucash/trunk/src/gnome/druid-merge.c
   gnucash/trunk/src/gnome/druid-merge.h
   gnucash/trunk/src/gnome/druid-stock-split.c
   gnucash/trunk/src/gnome/druid-stock-split.h
   gnucash/trunk/src/gnome/gnc-plugin-account-tree.c
   gnucash/trunk/src/gnome/gnc-plugin-account-tree.h
   gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c
   gnucash/trunk/src/gnome/gnc-plugin-basic-commands.h
   gnucash/trunk/src/gnome/gnc-plugin-budget.c
   gnucash/trunk/src/gnome/gnc-plugin-budget.h
   gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c
   gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.h
   gnucash/trunk/src/gnome/gnc-plugin-page-budget.c
   gnucash/trunk/src/gnome/gnc-plugin-page-budget.h
   gnucash/trunk/src/gnome/gnc-plugin-page-register.c
   gnucash/trunk/src/gnome/gnc-plugin-page-register.h
   gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c
   gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.h
   gnucash/trunk/src/gnome/gnc-plugin-register.c
   gnucash/trunk/src/gnome/gnc-plugin-register.h
   gnucash/trunk/src/gnome/gnc-split-reg.c
   gnucash/trunk/src/gnome/gnc-split-reg.h
   gnucash/trunk/src/gnome/lot-viewer.c
   gnucash/trunk/src/gnome/reconcile-list.c
   gnucash/trunk/src/gnome/reconcile-list.h
   gnucash/trunk/src/gnome/top-level.c
   gnucash/trunk/src/gnome/window-autoclear.c
   gnucash/trunk/src/gnome/window-reconcile.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 --suffix=none

Modified: gnucash/trunk/src/gnome/dialog-chart-export.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-chart-export.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-chart-export.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -23,7 +23,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #include "config.h"
 
 #include <gtk/gtk.h>
@@ -48,242 +48,253 @@
 
 typedef struct chart_data_s
 {
-	GladeXML *xml;
-	GtkWidget *dialog;
-	GtkWidget *calendar;
-	time_t chart_time_t;
-	QofSession *chart_session;
-	Account *equity_account;
-	GList      *param_ref_list;
-}chart_data;
+    GladeXML *xml;
+    GtkWidget *dialog;
+    GtkWidget *calendar;
+    time_t chart_time_t;
+    QofSession *chart_session;
+    Account *equity_account;
+    GList      *param_ref_list;
+} chart_data;
 
 static void
 chart_collection_cb(QofInstance *ent, gpointer user_data)
 {
-	chart_data *data;
-	Account *acc;
-	gboolean success;
-	const GUID *guid;
-	QofCollection *copy_coll;
-	QofBook *book;
+    chart_data *data;
+    Account *acc;
+    gboolean success;
+    const GUID *guid;
+    QofCollection *copy_coll;
+    QofBook *book;
 
-	g_return_if_fail(user_data != NULL);
-	data = (chart_data*)user_data;
-	acc = (Account*)ent;
-	if(0 == safe_strcmp(EQUITY_ACCOUNT_NAME, xaccAccountGetName(acc)) 
-		&& (xaccAccountGetType(acc) == ACCT_TYPE_EQUITY))
-	{
-		success = qof_instance_copy_to_session(data->chart_session, ent);
-		if(!success) { return; }
-		guid = qof_entity_get_guid(ent);
-		book = qof_session_get_book(data->chart_session);
-		copy_coll = qof_book_get_collection(book, GNC_ID_ACCOUNT);
-		data->equity_account = (Account*)qof_collection_lookup_entity(copy_coll, guid);
-		return;
-	}
+    g_return_if_fail(user_data != NULL);
+    data = (chart_data*)user_data;
+    acc = (Account*)ent;
+    if (0 == safe_strcmp(EQUITY_ACCOUNT_NAME, xaccAccountGetName(acc))
+            && (xaccAccountGetType(acc) == ACCT_TYPE_EQUITY))
+    {
+        success = qof_instance_copy_to_session(data->chart_session, ent);
+        if (!success)
+        {
+            return;
+        }
+        guid = qof_entity_get_guid(ent);
+        book = qof_session_get_book(data->chart_session);
+        copy_coll = qof_book_get_collection(book, GNC_ID_ACCOUNT);
+        data->equity_account = (Account*)qof_collection_lookup_entity(copy_coll, guid);
+        return;
+    }
 }
 
 static void
 chart_reference_cb(QofInstance *ent, gpointer user_data)
 {
-	QofInstanceReference *reference;
-	QofParam     *ref_param;
-	chart_data   *data;
+    QofInstanceReference *reference;
+    QofParam     *ref_param;
+    chart_data   *data;
 
-	g_return_if_fail(user_data != NULL);
-	data = (chart_data*)user_data;
-	while(data->param_ref_list != NULL) {
-		ref_param = data->param_ref_list->data;
-		reference = qof_instance_get_reference_from(ent, ref_param);
-		qof_session_update_reference_list(data->chart_session, reference);
-		data->param_ref_list = data->param_ref_list->next;
-	}
+    g_return_if_fail(user_data != NULL);
+    data = (chart_data*)user_data;
+    while (data->param_ref_list != NULL)
+    {
+        ref_param = data->param_ref_list->data;
+        reference = qof_instance_get_reference_from(ent, ref_param);
+        qof_session_update_reference_list(data->chart_session, reference);
+        data->param_ref_list = data->param_ref_list->next;
+    }
 }
 
 static void
 chart_entity_cb(QofInstance *ent, gpointer user_data)
 {
-	chart_data *data;
-	Account *acc_ent, *equity_account;
-	Transaction *trans;
-	Split *split;
-	gnc_numeric balance;
-	QofBook *book;
-	QofCollection *coll;
-	const GUID *guid;
-	time_t trans_time;
-	GList *ref;
-	QofInstanceReference *ent_ref;
-	
-	g_return_if_fail(user_data != NULL);
-	data = (chart_data*)user_data;
-	trans_time = data->chart_time_t;
-	data->param_ref_list = NULL;
-	guid = qof_entity_get_guid(ent);
-	acc_ent = (Account*)ent;
-	ref = NULL;
-	equity_account = data->equity_account;
-	g_return_if_fail(equity_account != NULL);
-	balance = xaccAccountGetBalanceAsOfDate(acc_ent, data->chart_time_t);
-	qof_instance_copy_to_session(data->chart_session, ent);
-	book = qof_session_get_book(data->chart_session);
-	coll = qof_book_get_collection(book, GNC_ID_ACCOUNT);
-	acc_ent = (Account*)qof_collection_lookup_entity(coll, guid);
-	if(xaccAccountGetCommodity(acc_ent) == NULL)
-	{
-		xaccAccountSetCommodity(acc_ent, gnc_default_currency());
-	}
-	/* can't use gnc_account_create_opening_balance directly - the partial 
-	QofBook doesn't have an AccountGroup that is used to locate the Equity Account. */
-	xaccAccountBeginEdit (acc_ent);
-	xaccAccountBeginEdit (equity_account);
-	trans = xaccMallocTransaction (book);
-	xaccTransBeginEdit (trans);
-	xaccTransSetCurrency (trans, xaccAccountGetCommodity (acc_ent));
-	xaccTransSetDateSecs (trans, trans_time);
-	xaccTransSetDateEnteredSecs (trans, trans_time);
-	xaccTransSetDescription (trans, OPENING_BALANCE_DESC);
-	/* User account split */
-	split = xaccMallocSplit (book);
-	xaccTransAppendSplit (trans, split);
-	xaccAccountInsertSplit (acc_ent, split);
-	xaccSplitSetAmount (split, balance);
-	xaccSplitSetValue (split, balance);
-	ref = qof_class_get_referenceList(GNC_ID_SPLIT);
-	while(ref != NULL) {
-		ent_ref = qof_instance_get_reference_from(QOF_INSTANCE(split), ref->data);
-		qof_session_update_reference_list(data->chart_session, ent_ref);
-		ref = g_list_next(ref);
-	}
-	g_list_free(ref);
-	balance = gnc_numeric_neg (balance);
-	/* Equity account split */
-	split = xaccMallocSplit (book);
-	xaccTransAppendSplit (trans, split);
-	xaccAccountInsertSplit (equity_account, split);
-	xaccSplitSetAmount (split, balance);
-	xaccSplitSetValue (split, balance);
-	xaccTransCommitEdit (trans);
-	xaccAccountCommitEdit (equity_account);
-	xaccAccountCommitEdit (acc_ent);
-	ref = qof_class_get_referenceList(GNC_ID_TRANS);
-	while(ref != NULL) {
-		ent_ref = qof_instance_get_reference_from(QOF_INSTANCE(trans), ref->data);
-		qof_session_update_reference_list(data->chart_session, ent_ref);
-		ref = g_list_next(ref);
-	}
-	g_list_free(ref);
-	ref = qof_class_get_referenceList(GNC_ID_SPLIT);
-	while(ref != NULL) {
-		ent_ref = qof_instance_get_reference_from(QOF_INSTANCE(split), ref->data);
-		qof_session_update_reference_list(data->chart_session, ent_ref);
-		ref = g_list_next(ref);
-	}
-	g_list_free(ref);
+    chart_data *data;
+    Account *acc_ent, *equity_account;
+    Transaction *trans;
+    Split *split;
+    gnc_numeric balance;
+    QofBook *book;
+    QofCollection *coll;
+    const GUID *guid;
+    time_t trans_time;
+    GList *ref;
+    QofInstanceReference *ent_ref;
+
+    g_return_if_fail(user_data != NULL);
+    data = (chart_data*)user_data;
+    trans_time = data->chart_time_t;
+    data->param_ref_list = NULL;
+    guid = qof_entity_get_guid(ent);
+    acc_ent = (Account*)ent;
+    ref = NULL;
+    equity_account = data->equity_account;
+    g_return_if_fail(equity_account != NULL);
+    balance = xaccAccountGetBalanceAsOfDate(acc_ent, data->chart_time_t);
+    qof_instance_copy_to_session(data->chart_session, ent);
+    book = qof_session_get_book(data->chart_session);
+    coll = qof_book_get_collection(book, GNC_ID_ACCOUNT);
+    acc_ent = (Account*)qof_collection_lookup_entity(coll, guid);
+    if (xaccAccountGetCommodity(acc_ent) == NULL)
+    {
+        xaccAccountSetCommodity(acc_ent, gnc_default_currency());
+    }
+    /* can't use gnc_account_create_opening_balance directly - the partial
+    QofBook doesn't have an AccountGroup that is used to locate the Equity Account. */
+    xaccAccountBeginEdit (acc_ent);
+    xaccAccountBeginEdit (equity_account);
+    trans = xaccMallocTransaction (book);
+    xaccTransBeginEdit (trans);
+    xaccTransSetCurrency (trans, xaccAccountGetCommodity (acc_ent));
+    xaccTransSetDateSecs (trans, trans_time);
+    xaccTransSetDateEnteredSecs (trans, trans_time);
+    xaccTransSetDescription (trans, OPENING_BALANCE_DESC);
+    /* User account split */
+    split = xaccMallocSplit (book);
+    xaccTransAppendSplit (trans, split);
+    xaccAccountInsertSplit (acc_ent, split);
+    xaccSplitSetAmount (split, balance);
+    xaccSplitSetValue (split, balance);
+    ref = qof_class_get_referenceList(GNC_ID_SPLIT);
+    while (ref != NULL)
+    {
+        ent_ref = qof_instance_get_reference_from(QOF_INSTANCE(split), ref->data);
+        qof_session_update_reference_list(data->chart_session, ent_ref);
+        ref = g_list_next(ref);
+    }
+    g_list_free(ref);
+    balance = gnc_numeric_neg (balance);
+    /* Equity account split */
+    split = xaccMallocSplit (book);
+    xaccTransAppendSplit (trans, split);
+    xaccAccountInsertSplit (equity_account, split);
+    xaccSplitSetAmount (split, balance);
+    xaccSplitSetValue (split, balance);
+    xaccTransCommitEdit (trans);
+    xaccAccountCommitEdit (equity_account);
+    xaccAccountCommitEdit (acc_ent);
+    ref = qof_class_get_referenceList(GNC_ID_TRANS);
+    while (ref != NULL)
+    {
+        ent_ref = qof_instance_get_reference_from(QOF_INSTANCE(trans), ref->data);
+        qof_session_update_reference_list(data->chart_session, ent_ref);
+        ref = g_list_next(ref);
+    }
+    g_list_free(ref);
+    ref = qof_class_get_referenceList(GNC_ID_SPLIT);
+    while (ref != NULL)
+    {
+        ent_ref = qof_instance_get_reference_from(QOF_INSTANCE(split), ref->data);
+        qof_session_update_reference_list(data->chart_session, ent_ref);
+        ref = g_list_next(ref);
+    }
+    g_list_free(ref);
 }
 
 void
 gnc_main_window_chart_export(void)
 {
-	GladeXML *xml;
-	chart_data *data;
+    GladeXML *xml;
+    chart_data *data;
 
-	xml = gnc_glade_xml_new ("chart-export.glade", "chart-export");
-	data = g_new0(chart_data, 1);
-	data->xml = xml;
-	data->dialog = glade_xml_get_widget(xml, "chart-export");
-	data->calendar = glade_xml_get_widget(xml, "chart-calendar");
-	glade_xml_signal_autoconnect_full(xml,
-					  gnc_glade_autoconnect_full_func,
-					  data);
-	gtk_widget_show(data->dialog);
+    xml = gnc_glade_xml_new ("chart-export.glade", "chart-export");
+    data = g_new0(chart_data, 1);
+    data->xml = xml;
+    data->dialog = glade_xml_get_widget(xml, "chart-export");
+    data->calendar = glade_xml_get_widget(xml, "chart-calendar");
+    glade_xml_signal_autoconnect_full(xml,
+                                      gnc_glade_autoconnect_full_func,
+                                      data);
+    gtk_widget_show(data->dialog);
 }
 
 static void
 on_dateok_clicked (chart_data  *data)
 {
-	guint year, month, day;
-	struct tm *chart_tm;
-	gchar *filename;
-	QofSession *current_session, *chart_session;
-	QofBook *book;
-	QofCollection *coll;
+    guint year, month, day;
+    struct tm *chart_tm;
+    gchar *filename;
+    QofSession *current_session, *chart_session;
+    QofBook *book;
+    QofCollection *coll;
 
-	data->chart_time_t = time(NULL);
-	chart_tm = gmtime(&data->chart_time_t);
-	/* set today - calendar will omit any zero/NULL values */
-	year = chart_tm->tm_year + 1900;
-	month = chart_tm->tm_mon + 1;
-	day = chart_tm->tm_mday;
-	gtk_calendar_get_date(GTK_CALENDAR(data->calendar),
-			      &year, &month, &day);
-	if((year + 1900) != chart_tm->tm_year) { 
-	chart_tm->tm_year = year - 1900;
-	}
-	if(month != chart_tm->tm_mon) { 
-	chart_tm->tm_mon = month;
-	}
-	if(day != chart_tm->tm_yday) { 
-		chart_tm->tm_mday = day; 
-	}
-	data->chart_time_t = mktime(chart_tm);
-	current_session = gnc_get_current_session();
-	book = qof_session_get_book(current_session);
-	chart_session = qof_session_new();
-	filename = gnc_file_dialog(_("Export Chart of Accounts to QSF XML"),
-				   NULL, NULL, GNC_FILE_DIALOG_EXPORT);
-	if (filename)
-	{
-		gnc_set_busy_cursor(NULL, TRUE);
-		qof_event_suspend();
-		qof_session_begin(chart_session, filename, TRUE, TRUE);
-		data->chart_session = chart_session;
-		data->equity_account = NULL;
-		coll = qof_book_get_collection(book, GNC_ID_ACCOUNT);
-		qof_collection_foreach(coll, chart_collection_cb, data);
-		if(data->equity_account == NULL)
-		  {
-			data->equity_account = xaccMallocAccount (qof_session_get_book(chart_session));
-			xaccAccountBeginEdit (data->equity_account);
-			xaccAccountSetName (data->equity_account, EQUITY_ACCOUNT_NAME);
-			xaccAccountSetDescription(data->equity_account, EQUITY_ACCOUNT_NAME);
-			xaccAccountSetType (data->equity_account, ACCT_TYPE_EQUITY);
-			xaccAccountSetCommodity (data->equity_account, gnc_default_currency());
-		  }
-		qof_object_foreach(GNC_ID_ACCOUNT, book, chart_entity_cb, data);
-		data->param_ref_list = qof_class_get_referenceList(GNC_ID_TRANS);
-		qof_object_foreach(GNC_ID_TRANS, book, chart_reference_cb, data);
-		g_list_free(data->param_ref_list);
-		data->param_ref_list = qof_class_get_referenceList(GNC_ID_SPLIT);
-		qof_object_foreach(GNC_ID_SPLIT, book, chart_reference_cb, data);
-		g_list_free(data->param_ref_list);
-		qof_session_save(chart_session, NULL);
-		show_session_error(qof_session_get_error(chart_session),
-				   filename, GNC_FILE_DIALOG_EXPORT);
-		qof_event_resume();
-		gnc_unset_busy_cursor(NULL);
-	}
-	qof_session_end(chart_session);
-	gnc_set_current_session(current_session);
+    data->chart_time_t = time(NULL);
+    chart_tm = gmtime(&data->chart_time_t);
+    /* set today - calendar will omit any zero/NULL values */
+    year = chart_tm->tm_year + 1900;
+    month = chart_tm->tm_mon + 1;
+    day = chart_tm->tm_mday;
+    gtk_calendar_get_date(GTK_CALENDAR(data->calendar),
+                          &year, &month, &day);
+    if ((year + 1900) != chart_tm->tm_year)
+    {
+        chart_tm->tm_year = year - 1900;
+    }
+    if (month != chart_tm->tm_mon)
+    {
+        chart_tm->tm_mon = month;
+    }
+    if (day != chart_tm->tm_yday)
+    {
+        chart_tm->tm_mday = day;
+    }
+    data->chart_time_t = mktime(chart_tm);
+    current_session = gnc_get_current_session();
+    book = qof_session_get_book(current_session);
+    chart_session = qof_session_new();
+    filename = gnc_file_dialog(_("Export Chart of Accounts to QSF XML"),
+                               NULL, NULL, GNC_FILE_DIALOG_EXPORT);
+    if (filename)
+    {
+        gnc_set_busy_cursor(NULL, TRUE);
+        qof_event_suspend();
+        qof_session_begin(chart_session, filename, TRUE, TRUE);
+        data->chart_session = chart_session;
+        data->equity_account = NULL;
+        coll = qof_book_get_collection(book, GNC_ID_ACCOUNT);
+        qof_collection_foreach(coll, chart_collection_cb, data);
+        if (data->equity_account == NULL)
+        {
+            data->equity_account = xaccMallocAccount (qof_session_get_book(chart_session));
+            xaccAccountBeginEdit (data->equity_account);
+            xaccAccountSetName (data->equity_account, EQUITY_ACCOUNT_NAME);
+            xaccAccountSetDescription(data->equity_account, EQUITY_ACCOUNT_NAME);
+            xaccAccountSetType (data->equity_account, ACCT_TYPE_EQUITY);
+            xaccAccountSetCommodity (data->equity_account, gnc_default_currency());
+        }
+        qof_object_foreach(GNC_ID_ACCOUNT, book, chart_entity_cb, data);
+        data->param_ref_list = qof_class_get_referenceList(GNC_ID_TRANS);
+        qof_object_foreach(GNC_ID_TRANS, book, chart_reference_cb, data);
+        g_list_free(data->param_ref_list);
+        data->param_ref_list = qof_class_get_referenceList(GNC_ID_SPLIT);
+        qof_object_foreach(GNC_ID_SPLIT, book, chart_reference_cb, data);
+        g_list_free(data->param_ref_list);
+        qof_session_save(chart_session, NULL);
+        show_session_error(qof_session_get_error(chart_session),
+                           filename, GNC_FILE_DIALOG_EXPORT);
+        qof_event_resume();
+        gnc_unset_busy_cursor(NULL);
+    }
+    qof_session_end(chart_session);
+    gnc_set_current_session(current_session);
 }
 
 void
 chart_export_response_cb (GtkDialog *dialog, gint response, gpointer user_data)
 {
-	chart_data  *data;
-	data = (chart_data*)user_data;
-	switch (response) {
-	  case GTK_RESPONSE_OK:
-	    gtk_widget_hide(data->dialog);
-	    on_dateok_clicked(data);
-	    break;
+    chart_data  *data;
+    data = (chart_data*)user_data;
+    switch (response)
+    {
+    case GTK_RESPONSE_OK:
+        gtk_widget_hide(data->dialog);
+        on_dateok_clicked(data);
+        break;
 
-	  default:
-	    /* do nothing */
-	    break;
-	}
+    default:
+        /* do nothing */
+        break;
+    }
 
-	gtk_widget_destroy(data->dialog);
-	g_object_unref(data->xml);
-	g_free(data);
+    gtk_widget_destroy(data->dialog);
+    g_object_unref(data->xml);
+    g_free(data);
 }

Modified: gnucash/trunk/src/gnome/dialog-chart-export.h
===================================================================
--- gnucash/trunk/src/gnome/dialog-chart-export.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-chart-export.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -22,7 +22,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  *  02110-1301, USA.
  */
- 
+
 #ifndef _DIALOG_CHART_EXPORT_H
 #define _DIALOG_CHART_EXPORT_H
 
@@ -33,7 +33,7 @@
 
 Remember to use qof_instance_copy routines
 like ::qof_instance_copy_to_session so that the QofBook is marked
-as \a partial. 
+as \a partial.
 
 \par guidelines Guidelines for partial book export
 -# When exporting GnuCash accounts into QSF, remember that there is no
@@ -45,7 +45,7 @@
 -# Remember that just because the function does not use books or AccountGroup
    itself, it does \b not follow that other functions called by the routine
    are also suitable. You may have to reimplement the body of certain functions.
--# Commodities are \b not supported. Most Account functions will use the 
+-# Commodities are \b not supported. Most Account functions will use the
    commodity of the account, so be sure to set at least the ::gnc_default_currency().
 
 	@{
@@ -60,7 +60,7 @@
 Write out the Chart of Accounts \b with balances as of a
 specific date, as QSF.
 
-The function iterates over each account in the current book and 
+The function iterates over each account in the current book and
 gets the balance as of the specified date. The account is copied to
 the export session, setting the export session book as partial.
 The function then looks up the new entity in the export session

Modified: gnucash/trunk/src/gnome/dialog-commodities.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-commodities.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-commodities.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -48,16 +48,16 @@
 
 typedef struct
 {
-  GtkWidget * dialog;
-  QofSession *session;
-  QofBook *book;
+    GtkWidget * dialog;
+    QofSession *session;
+    QofBook *book;
 
-  GncTreeViewCommodity * commodity_tree;
-  GtkWidget * edit_button;
-  GtkWidget * remove_button;
-  gboolean    show_currencies;
+    GncTreeViewCommodity * commodity_tree;
+    GtkWidget * edit_button;
+    GtkWidget * remove_button;
+    gboolean    show_currencies;
 
-  gboolean new;
+    gboolean new;
 } CommoditiesDialog;
 
 
@@ -70,355 +70,358 @@
 void
 gnc_commodities_window_destroy_cb (GtkObject *object,   CommoditiesDialog *cd)
 {
-  gnc_unregister_gui_component_by_data (DIALOG_COMMODITIES_CM_CLASS, cd);
+    gnc_unregister_gui_component_by_data (DIALOG_COMMODITIES_CM_CLASS, cd);
 
-  g_free (cd);
+    g_free (cd);
 }
 
 static void
 edit_clicked (CommoditiesDialog *cd)
 {
-  gnc_commodity *commodity;
+    gnc_commodity *commodity;
 
-  commodity = gnc_tree_view_commodity_get_selected_commodity (cd->commodity_tree);
-  if (commodity == NULL)
-    return;
+    commodity = gnc_tree_view_commodity_get_selected_commodity (cd->commodity_tree);
+    if (commodity == NULL)
+        return;
 
-  if (gnc_ui_edit_commodity_modal (commodity, cd->dialog))
-    gnc_gui_refresh_all ();
+    if (gnc_ui_edit_commodity_modal (commodity, cd->dialog))
+        gnc_gui_refresh_all ();
 }
 
 static void
 row_activated_cb (GtkTreeView *view, GtkTreePath *path,
                   GtkTreeViewColumn *column, CommoditiesDialog *cd)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  g_return_if_fail(view);
+    g_return_if_fail(view);
 
-  model = gtk_tree_view_get_model(view);
-  if (gtk_tree_model_get_iter(model, &iter, path))
-  {
-    if (gtk_tree_model_iter_has_child(model, &iter))
+    model = gtk_tree_view_get_model(view);
+    if (gtk_tree_model_get_iter(model, &iter, path))
     {
-      /* There are children, so it's not a commodity.
-       * Just expand or collapse the row. */
-      if (gtk_tree_view_row_expanded(view, path))
-        gtk_tree_view_collapse_row(view, path);
-      else
-        gtk_tree_view_expand_row(view, path, FALSE);
+        if (gtk_tree_model_iter_has_child(model, &iter))
+        {
+            /* There are children, so it's not a commodity.
+             * Just expand or collapse the row. */
+            if (gtk_tree_view_row_expanded(view, path))
+                gtk_tree_view_collapse_row(view, path);
+            else
+                gtk_tree_view_expand_row(view, path, FALSE);
+        }
+        else
+            /* It's a commodity, so click the Edit button. */
+            edit_clicked(cd);
     }
-    else
-      /* It's a commodity, so click the Edit button. */
-      edit_clicked(cd);
-  }
 }
 
 static void
 remove_clicked (CommoditiesDialog *cd)
 {
-  GNCPriceDB *pdb;
-  GList *node;
-  GList *prices;
-  GList *accounts;
-  gboolean do_delete;
-  gboolean can_delete;
-  gnc_commodity *commodity;
-  GtkWidget *dialog;
-  const gchar *message, *warning;
-  gint response;
-  
-  commodity = gnc_tree_view_commodity_get_selected_commodity (cd->commodity_tree);
-  if (commodity == NULL)
-    return;
+    GNCPriceDB *pdb;
+    GList *node;
+    GList *prices;
+    GList *accounts;
+    gboolean do_delete;
+    gboolean can_delete;
+    gnc_commodity *commodity;
+    GtkWidget *dialog;
+    const gchar *message, *warning;
+    gint response;
 
-  accounts = gnc_account_get_descendants (gnc_book_get_root_account(cd->book));
-  can_delete = TRUE;
-  do_delete = FALSE;
+    commodity = gnc_tree_view_commodity_get_selected_commodity (cd->commodity_tree);
+    if (commodity == NULL)
+        return;
 
-  for (node = accounts; node; node = node->next)
-  {
-    Account *account = node->data;
+    accounts = gnc_account_get_descendants (gnc_book_get_root_account(cd->book));
+    can_delete = TRUE;
+    do_delete = FALSE;
 
-    if (commodity == xaccAccountGetCommodity (account))
+    for (node = accounts; node; node = node->next)
     {
-      can_delete = FALSE;
-      break;
+        Account *account = node->data;
+
+        if (commodity == xaccAccountGetCommodity (account))
+        {
+            can_delete = FALSE;
+            break;
+        }
     }
-  }
 
-  /* FIXME check for transaction references */
+    /* FIXME check for transaction references */
 
-  if (!can_delete)
-  {
-    const char *message = _("That commodity is currently used by "
-                            "at least one of your accounts. You may "
-                            "not delete it.");
+    if (!can_delete)
+    {
+        const char *message = _("That commodity is currently used by "
+                                "at least one of your accounts. You may "
+                                "not delete it.");
 
-    gnc_warning_dialog (cd->dialog, "%s", message);
+        gnc_warning_dialog (cd->dialog, "%s", message);
+        g_list_free (accounts);
+        return;
+    }
     g_list_free (accounts);
-    return;
-  }
-  g_list_free (accounts);
 
-  pdb = gnc_pricedb_get_db (cd->book);
-  prices = gnc_pricedb_get_prices(pdb, commodity, NULL);
-  if (prices)
-  {
-    message = _("This commodity has price quotes. Are "
-		"you sure you want to delete the selected "
-		"commodity and its price quotes?");
-    warning = "delete_commodity2";
-  } else {
-    message = _("Are you sure you want to delete the "
-		"selected commodity?");
-    warning = "delete_commodity";
-  }
+    pdb = gnc_pricedb_get_db (cd->book);
+    prices = gnc_pricedb_get_prices(pdb, commodity, NULL);
+    if (prices)
+    {
+        message = _("This commodity has price quotes. Are "
+                    "you sure you want to delete the selected "
+                    "commodity and its price quotes?");
+        warning = "delete_commodity2";
+    }
+    else
+    {
+        message = _("Are you sure you want to delete the "
+                    "selected commodity?");
+        warning = "delete_commodity";
+    }
 
-  dialog = gtk_message_dialog_new(GTK_WINDOW(cd->dialog),
-				  GTK_DIALOG_DESTROY_WITH_PARENT,
-				  GTK_MESSAGE_QUESTION,
-				  GTK_BUTTONS_NONE,
-				  "%s", _("Delete commodity?"));
-  gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-					   "%s", message);
-  gtk_dialog_add_buttons(GTK_DIALOG(dialog),
-			 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-			 GTK_STOCK_DELETE, GTK_RESPONSE_OK,
-			 (gchar *)NULL);
-  response = gnc_dialog_run(GTK_DIALOG(dialog), warning);
-  gtk_widget_destroy(dialog);
+    dialog = gtk_message_dialog_new(GTK_WINDOW(cd->dialog),
+                                    GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_QUESTION,
+                                    GTK_BUTTONS_NONE,
+                                    "%s", _("Delete commodity?"));
+    gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+            "%s", message);
+    gtk_dialog_add_buttons(GTK_DIALOG(dialog),
+                           GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                           GTK_STOCK_DELETE, GTK_RESPONSE_OK,
+                           (gchar *)NULL);
+    response = gnc_dialog_run(GTK_DIALOG(dialog), warning);
+    gtk_widget_destroy(dialog);
 
-  if (response == GTK_RESPONSE_OK)
-  {
-    gnc_commodity_table *ct;
+    if (response == GTK_RESPONSE_OK)
+    {
+        gnc_commodity_table *ct;
 
-    ct = gnc_book_get_commodity_table (cd->book);
-    for (node = prices; node; node = node->next)
-      gnc_pricedb_remove_price(pdb, node->data);
+        ct = gnc_book_get_commodity_table (cd->book);
+        for (node = prices; node; node = node->next)
+            gnc_pricedb_remove_price(pdb, node->data);
 
-    gnc_commodity_table_remove (ct, commodity);
-    gnc_commodity_destroy (commodity);
-    commodity = NULL;
-  }
+        gnc_commodity_table_remove (ct, commodity);
+        gnc_commodity_destroy (commodity);
+        commodity = NULL;
+    }
 
-  gnc_price_list_destroy(prices);
-  gnc_gui_refresh_all ();
+    gnc_price_list_destroy(prices);
+    gnc_gui_refresh_all ();
 }
 
 static void
 add_clicked (CommoditiesDialog *cd)
 {
-  gnc_commodity *commodity;
-  const char *namespace;
+    gnc_commodity *commodity;
+    const char *namespace;
 
-  commodity = gnc_tree_view_commodity_get_selected_commodity (cd->commodity_tree);
-  if (commodity)
-    namespace = gnc_commodity_get_namespace (commodity);
-  else
-    namespace = NULL;
+    commodity = gnc_tree_view_commodity_get_selected_commodity (cd->commodity_tree);
+    if (commodity)
+        namespace = gnc_commodity_get_namespace (commodity);
+    else
+        namespace = NULL;
 
-  commodity = gnc_ui_new_commodity_modal (namespace, cd->dialog);
+    commodity = gnc_ui_new_commodity_modal (namespace, cd->dialog);
 }
 
 void
 gnc_commodities_dialog_response (GtkDialog *dialog,
-				 gint response,
-				 CommoditiesDialog *cd)
+                                 gint response,
+                                 CommoditiesDialog *cd)
 {
-	switch (response) {
-	 case GNC_RESPONSE_NEW:
-	  add_clicked (cd);
-	  return;
+    switch (response)
+    {
+    case GNC_RESPONSE_NEW:
+        add_clicked (cd);
+        return;
 
-	 case GNC_RESPONSE_DELETE:
-	  remove_clicked (cd);
-	  return;
+    case GNC_RESPONSE_DELETE:
+        remove_clicked (cd);
+        return;
 
-	 case GNC_RESPONSE_EDIT:
-	  edit_clicked (cd);
-	  return;
+    case GNC_RESPONSE_EDIT:
+        edit_clicked (cd);
+        return;
 
-	 case GTK_RESPONSE_CLOSE:
-	 default:
-	  gnc_close_gui_component_by_data (DIALOG_COMMODITIES_CM_CLASS, cd);
-	  return;
-	}
+    case GTK_RESPONSE_CLOSE:
+    default:
+        gnc_close_gui_component_by_data (DIALOG_COMMODITIES_CM_CLASS, cd);
+        return;
+    }
 }
 
 static void
 gnc_commodities_dialog_selection_changed (GtkTreeSelection *selection,
-					  CommoditiesDialog *cd)
+        CommoditiesDialog *cd)
 {
-	gboolean remove_ok;
-	gnc_commodity *commodity;
+    gboolean remove_ok;
+    gnc_commodity *commodity;
 
-	commodity = gnc_tree_view_commodity_get_selected_commodity (cd->commodity_tree);
-	remove_ok = commodity && !gnc_commodity_is_iso(commodity);
-	gtk_widget_set_sensitive (cd->edit_button, commodity != NULL);
-	gtk_widget_set_sensitive (cd->remove_button, remove_ok);
+    commodity = gnc_tree_view_commodity_get_selected_commodity (cd->commodity_tree);
+    remove_ok = commodity && !gnc_commodity_is_iso(commodity);
+    gtk_widget_set_sensitive (cd->edit_button, commodity != NULL);
+    gtk_widget_set_sensitive (cd->remove_button, remove_ok);
 }
 
 void
 gnc_commodities_show_currencies_toggled (GtkToggleButton *toggle,
-					 CommoditiesDialog *cd)
+        CommoditiesDialog *cd)
 {
 
-	cd->show_currencies = gtk_toggle_button_get_active (toggle);
-	gnc_tree_view_commodity_refilter (cd->commodity_tree);
+    cd->show_currencies = gtk_toggle_button_get_active (toggle);
+    gnc_tree_view_commodity_refilter (cd->commodity_tree);
 }
 
 static gboolean
 gnc_commodities_dialog_filter_ns_func (gnc_commodity_namespace *namespace,
-				       gpointer data)
+                                       gpointer data)
 {
-	CommoditiesDialog *cd = data;
-	const gchar *name;
-	GList *list;
+    CommoditiesDialog *cd = data;
+    const gchar *name;
+    GList *list;
 
-	/* Never show the template list */
-	name = gnc_commodity_namespace_get_name (namespace);
-	if (safe_strcmp (name, "template") == 0)
-	  return FALSE;
+    /* Never show the template list */
+    name = gnc_commodity_namespace_get_name (namespace);
+    if (safe_strcmp (name, "template") == 0)
+        return FALSE;
 
-	/* Check whether or not to show commodities */
-	if (!cd->show_currencies && gnc_commodity_namespace_is_iso(name))
-	  return FALSE;
+    /* Check whether or not to show commodities */
+    if (!cd->show_currencies && gnc_commodity_namespace_is_iso(name))
+        return FALSE;
 
-	/* Show any other namespace that has commodities */
-	list = gnc_commodity_namespace_get_commodity_list(namespace);
-	return (list != NULL);
+    /* Show any other namespace that has commodities */
+    list = gnc_commodity_namespace_get_commodity_list(namespace);
+    return (list != NULL);
 }
 
 static gboolean
 gnc_commodities_dialog_filter_cm_func (gnc_commodity *commodity,
-				       gpointer data)
+                                       gpointer data)
 {
-	CommoditiesDialog *cd = data;
+    CommoditiesDialog *cd = data;
 
-	if (cd->show_currencies)
-	  return TRUE;
-	return !gnc_commodity_is_iso(commodity);
+    if (cd->show_currencies)
+        return TRUE;
+    return !gnc_commodity_is_iso(commodity);
 }
 
 static void
 gnc_commodities_dialog_create (GtkWidget * parent, CommoditiesDialog *cd)
 {
-  GtkWidget *dialog;
-  GtkWidget *button;
-  GtkWidget *scrolled_window;
-  GladeXML *xml;
-  GtkTreeView *view;
-  GtkTreeSelection *selection;
- 
-  xml = gnc_glade_xml_new ("commodities.glade", "Securities Dialog");
-  dialog = glade_xml_get_widget (xml, "Securities Dialog");
+    GtkWidget *dialog;
+    GtkWidget *button;
+    GtkWidget *scrolled_window;
+    GladeXML *xml;
+    GtkTreeView *view;
+    GtkTreeSelection *selection;
 
-  cd->dialog = dialog;
-  cd->session = gnc_get_current_session();
-  cd->book = qof_session_get_book(cd->session);
-  cd->show_currencies = gnc_gconf_get_bool(GCONF_SECTION, "include_iso", NULL);
-  
-  glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, cd);
+    xml = gnc_glade_xml_new ("commodities.glade", "Securities Dialog");
+    dialog = glade_xml_get_widget (xml, "Securities Dialog");
 
-  /* parent */
-  if (parent != NULL)
-    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+    cd->dialog = dialog;
+    cd->session = gnc_get_current_session();
+    cd->book = qof_session_get_book(cd->session);
+    cd->show_currencies = gnc_gconf_get_bool(GCONF_SECTION, "include_iso", NULL);
 
-  /* buttons */
-  cd->remove_button = glade_xml_get_widget (xml, "remove_button");
-  cd->edit_button = glade_xml_get_widget (xml, "edit_button");
+    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, cd);
 
-  /* commodity tree */
-    
+    /* parent */
+    if (parent != NULL)
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+
+    /* buttons */
+    cd->remove_button = glade_xml_get_widget (xml, "remove_button");
+    cd->edit_button = glade_xml_get_widget (xml, "edit_button");
+
+    /* commodity tree */
+
     scrolled_window = glade_xml_get_widget (xml, "commodity_list_window");
     view = gnc_tree_view_commodity_new(cd->book,
-				       "gconf-section", GCONF_SECTION,
-				       "show-column-menu", TRUE,
-				       NULL);
+                                       "gconf-section", GCONF_SECTION,
+                                       "show-column-menu", TRUE,
+                                       NULL);
     cd->commodity_tree = GNC_TREE_VIEW_COMMODITY(view);
     gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET(view));
     gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(cd->commodity_tree), TRUE);
     gnc_tree_view_commodity_set_filter (cd->commodity_tree,
-					gnc_commodities_dialog_filter_ns_func,
-					gnc_commodities_dialog_filter_cm_func,
-					cd, NULL);
+                                        gnc_commodities_dialog_filter_ns_func,
+                                        gnc_commodities_dialog_filter_cm_func,
+                                        cd, NULL);
     selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
     g_signal_connect (G_OBJECT (selection), "changed",
-		      G_CALLBACK (gnc_commodities_dialog_selection_changed), cd);
+                      G_CALLBACK (gnc_commodities_dialog_selection_changed), cd);
 
     g_signal_connect (G_OBJECT (cd->commodity_tree), "row-activated",
-		      G_CALLBACK (row_activated_cb), cd);
+                      G_CALLBACK (row_activated_cb), cd);
 
     /* Show currency button */
     button = glade_xml_get_widget (xml, "show_currencies_button");
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), cd->show_currencies);
 
-  gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(cd->dialog));
+    gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(cd->dialog));
 }
 
 static void
 close_handler (gpointer user_data)
 {
-  CommoditiesDialog *cd = user_data;
+    CommoditiesDialog *cd = user_data;
 
-  gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(cd->dialog));
+    gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(cd->dialog));
 
-  gnc_gconf_set_bool(GCONF_SECTION, "include_iso", cd->show_currencies, NULL);
+    gnc_gconf_set_bool(GCONF_SECTION, "include_iso", cd->show_currencies, NULL);
 
-  gtk_widget_destroy(cd->dialog);
+    gtk_widget_destroy(cd->dialog);
 }
 
 static void
 refresh_handler (GHashTable *changes, gpointer user_data)
 {
-  CommoditiesDialog *cd = user_data;
+    CommoditiesDialog *cd = user_data;
 
-  g_return_if_fail(cd != NULL);
+    g_return_if_fail(cd != NULL);
 
-  gnc_tree_view_commodity_refilter (cd->commodity_tree);
+    gnc_tree_view_commodity_refilter (cd->commodity_tree);
 }
 
 static gboolean
 show_handler (const char *class, gint component_id,
-	      gpointer user_data, gpointer iter_data)
+              gpointer user_data, gpointer iter_data)
 {
-  CommoditiesDialog *cd = user_data;
+    CommoditiesDialog *cd = user_data;
 
-  if (!cd)
-    return(FALSE);
-  gtk_window_present (GTK_WINDOW(cd->dialog));
-  return(TRUE);
+    if (!cd)
+        return(FALSE);
+    gtk_window_present (GTK_WINDOW(cd->dialog));
+    return(TRUE);
 }
 
 /********************************************************************\
  * gnc_commodities_dialog                                           *
  *   opens up a window to edit price information                    *
- *                                                                  * 
+ *                                                                  *
  * Args:   parent  - the parent of the window to be created         *
  * Return: nothing                                                  *
 \********************************************************************/
 void
 gnc_commodities_dialog (GtkWidget * parent)
 {
-  CommoditiesDialog *cd;
-  gint component_id;
+    CommoditiesDialog *cd;
+    gint component_id;
 
-  if (gnc_forall_gui_components (DIALOG_COMMODITIES_CM_CLASS,
-				 show_handler, NULL))
-      return;
+    if (gnc_forall_gui_components (DIALOG_COMMODITIES_CM_CLASS,
+                                   show_handler, NULL))
+        return;
 
-  cd = g_new0 (CommoditiesDialog, 1);
+    cd = g_new0 (CommoditiesDialog, 1);
 
-  gnc_commodities_dialog_create (parent, cd);
+    gnc_commodities_dialog_create (parent, cd);
 
-  component_id = gnc_register_gui_component (DIALOG_COMMODITIES_CM_CLASS,
-                                             refresh_handler, close_handler,
-                                             cd);
-  gnc_gui_component_set_session (component_id, cd->session);
+    component_id = gnc_register_gui_component (DIALOG_COMMODITIES_CM_CLASS,
+                   refresh_handler, close_handler,
+                   cd);
+    gnc_gui_component_set_session (component_id, cd->session);
 
-  gtk_widget_grab_focus (GTK_WIDGET(cd->commodity_tree));
+    gtk_widget_grab_focus (GTK_WIDGET(cd->commodity_tree));
 
-  gtk_widget_show (cd->dialog);
+    gtk_widget_show (cd->dialog);
 }

Modified: gnucash/trunk/src/gnome/dialog-fincalc.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-fincalc.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-fincalc.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -45,34 +45,34 @@
 
 typedef enum
 {
-  PAYMENT_PERIODS = 0,
-  INTEREST_RATE,
-  PRESENT_VALUE,
-  PERIODIC_PAYMENT,
-  FUTURE_VALUE,
-  NUM_FIN_CALC_VALUES
+    PAYMENT_PERIODS = 0,
+    INTEREST_RATE,
+    PRESENT_VALUE,
+    PERIODIC_PAYMENT,
+    FUTURE_VALUE,
+    NUM_FIN_CALC_VALUES
 } FinCalcValue;
 
 
 /** Datatypes ***********************************************************/
 struct _FinCalcDialog
 {
-  GladeXML *xml;
-  GtkWidget *dialog;
+    GladeXML *xml;
+    GtkWidget *dialog;
 
-  GtkWidget *amounts[NUM_FIN_CALC_VALUES];
+    GtkWidget *amounts[NUM_FIN_CALC_VALUES];
 
-  GtkWidget *calc_button;
+    GtkWidget *calc_button;
 
-  GtkWidget *compounding_combo;
-  GtkWidget *payment_combo;
+    GtkWidget *compounding_combo;
+    GtkWidget *payment_combo;
 
-  GtkWidget *end_of_period_radio;
-  GtkWidget *discrete_compounding_radio;
+    GtkWidget *end_of_period_radio;
+    GtkWidget *discrete_compounding_radio;
 
-  GtkWidget *payment_total_label;
+    GtkWidget *payment_total_label;
 
-  financial_info financial_info;
+    financial_info financial_info;
 };
 
 static unsigned int periods[] =
@@ -82,12 +82,12 @@
     3, /* tri-annual */
     4, /* quarterly */
     6, /* bi-monthly */
-   12, /* monthly */
-   24, /* semi-monthly */
-   26, /* bi-weekly */
-   52, /* weekly */
-  360, /* daily (360) */
-  365, /* daily (365) */
+    12, /* monthly */
+    24, /* semi-monthly */
+    26, /* bi-weekly */
+    52, /* weekly */
+    360, /* daily (360) */
+    365, /* daily (365) */
 };
 
 /* This static indicates the debugging module that this .o belongs to.  */
@@ -108,69 +108,69 @@
 static int
 normalize_period(unsigned int *period)
 {
-  int i;
+    int i;
 
-  g_return_val_if_fail (period, 0);
+    g_return_val_if_fail (period, 0);
 
-  for (i = (sizeof(periods) / sizeof(unsigned int)) - 1; i >= 0; i--)
-    if (*period >= periods[i])
-    {
-      *period = periods[i];
-      return i;
-    }
+    for (i = (sizeof(periods) / sizeof(unsigned int)) - 1; i >= 0; i--)
+        if (*period >= periods[i])
+        {
+            *period = periods[i];
+            return i;
+        }
 
-  *period = periods[0];
+    *period = periods[0];
 
-  return 0;
+    return 0;
 }
 
 /* Copy the values in the financial_info structure to the GUI */
 static void
 fi_to_gui(FinCalcDialog *fcd)
 {
-  const gnc_commodity *commodity;
-  static char string[64];
-  gnc_numeric total;
-  gnc_numeric npp;
-  gnc_numeric pmt;
-  int i;
+    const gnc_commodity *commodity;
+    static char string[64];
+    gnc_numeric total;
+    gnc_numeric npp;
+    gnc_numeric pmt;
+    int i;
 
-  if (fcd == NULL)
-    return;
+    if (fcd == NULL)
+        return;
 
-  npp = gnc_numeric_create (fcd->financial_info.npp, 1);
+    npp = gnc_numeric_create (fcd->financial_info.npp, 1);
 
-  gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT(fcd->amounts[PAYMENT_PERIODS]),
-                              npp);
-  gnc_amount_edit_set_damount (GNC_AMOUNT_EDIT(fcd->amounts[INTEREST_RATE]),
-                               fcd->financial_info.ir);
-  gnc_amount_edit_set_damount (GNC_AMOUNT_EDIT(fcd->amounts[PRESENT_VALUE]),
-                               fcd->financial_info.pv);
-  gnc_amount_edit_set_damount (GNC_AMOUNT_EDIT(fcd->amounts[PERIODIC_PAYMENT]),
-                               fcd->financial_info.pmt);
-  gnc_amount_edit_set_damount (GNC_AMOUNT_EDIT(fcd->amounts[FUTURE_VALUE]),
-                               -fcd->financial_info.fv);
+    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT(fcd->amounts[PAYMENT_PERIODS]),
+                                npp);
+    gnc_amount_edit_set_damount (GNC_AMOUNT_EDIT(fcd->amounts[INTEREST_RATE]),
+                                 fcd->financial_info.ir);
+    gnc_amount_edit_set_damount (GNC_AMOUNT_EDIT(fcd->amounts[PRESENT_VALUE]),
+                                 fcd->financial_info.pv);
+    gnc_amount_edit_set_damount (GNC_AMOUNT_EDIT(fcd->amounts[PERIODIC_PAYMENT]),
+                                 fcd->financial_info.pmt);
+    gnc_amount_edit_set_damount (GNC_AMOUNT_EDIT(fcd->amounts[FUTURE_VALUE]),
+                                 -fcd->financial_info.fv);
 
-  pmt = double_to_gnc_numeric (fcd->financial_info.pmt, 100000, GNC_RND_ROUND);
+    pmt = double_to_gnc_numeric (fcd->financial_info.pmt, 100000, GNC_RND_ROUND);
 
-  commodity = gnc_default_currency ();
+    commodity = gnc_default_currency ();
 
-  total = gnc_numeric_mul (npp, pmt, gnc_commodity_get_fraction (commodity),
-                           GNC_RND_ROUND);
+    total = gnc_numeric_mul (npp, pmt, gnc_commodity_get_fraction (commodity),
+                             GNC_RND_ROUND);
 
-  xaccSPrintAmount (string, total, gnc_default_print_info (FALSE));
-  gtk_label_set_text (GTK_LABEL(fcd->payment_total_label), string);
+    xaccSPrintAmount (string, total, gnc_default_print_info (FALSE));
+    gtk_label_set_text (GTK_LABEL(fcd->payment_total_label), string);
 
-  i = normalize_period(&fcd->financial_info.CF);
-  gtk_combo_box_set_active(GTK_COMBO_BOX(fcd->compounding_combo), i);
+    i = normalize_period(&fcd->financial_info.CF);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(fcd->compounding_combo), i);
 
-  i = normalize_period(&fcd->financial_info.PF);
-  gtk_combo_box_set_active(GTK_COMBO_BOX(fcd->payment_combo), i);
+    i = normalize_period(&fcd->financial_info.PF);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(fcd->payment_combo), i);
 
-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fcd->end_of_period_radio),
-                               !fcd->financial_info.bep);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fcd->end_of_period_radio),
+                                 !fcd->financial_info.bep);
 
-  gtk_toggle_button_set_active
+    gtk_toggle_button_set_active
     (GTK_TOGGLE_BUTTON(fcd->discrete_compounding_radio),
      fcd->financial_info.disc);
 }
@@ -179,124 +179,126 @@
 static void
 gui_to_fi(FinCalcDialog *fcd)
 {
-  GtkToggleButton *toggle;
-  gnc_numeric npp;
-  int i;
+    GtkToggleButton *toggle;
+    gnc_numeric npp;
+    int i;
 
-  if (fcd == NULL)
-    return;
+    if (fcd == NULL)
+        return;
 
-  npp =
-    gnc_amount_edit_get_amount(GNC_AMOUNT_EDIT(fcd->amounts[PAYMENT_PERIODS]));
-  fcd->financial_info.npp = npp.num;
+    npp =
+        gnc_amount_edit_get_amount(GNC_AMOUNT_EDIT(fcd->amounts[PAYMENT_PERIODS]));
+    fcd->financial_info.npp = npp.num;
 
-  fcd->financial_info.ir =
-    gnc_amount_edit_get_damount(GNC_AMOUNT_EDIT(fcd->amounts[INTEREST_RATE]));
+    fcd->financial_info.ir =
+        gnc_amount_edit_get_damount(GNC_AMOUNT_EDIT(fcd->amounts[INTEREST_RATE]));
 
-  fcd->financial_info.pv =
-    gnc_amount_edit_get_damount(GNC_AMOUNT_EDIT(fcd->amounts[PRESENT_VALUE]));
+    fcd->financial_info.pv =
+        gnc_amount_edit_get_damount(GNC_AMOUNT_EDIT(fcd->amounts[PRESENT_VALUE]));
 
-  fcd->financial_info.pmt =
-    gnc_amount_edit_get_damount(GNC_AMOUNT_EDIT(fcd->amounts[PERIODIC_PAYMENT]));
+    fcd->financial_info.pmt =
+        gnc_amount_edit_get_damount(GNC_AMOUNT_EDIT(fcd->amounts[PERIODIC_PAYMENT]));
 
-  fcd->financial_info.fv =
-    gnc_amount_edit_get_damount(GNC_AMOUNT_EDIT(fcd->amounts[FUTURE_VALUE]));
-  fcd->financial_info.fv = -fcd->financial_info.fv;
+    fcd->financial_info.fv =
+        gnc_amount_edit_get_damount(GNC_AMOUNT_EDIT(fcd->amounts[FUTURE_VALUE]));
+    fcd->financial_info.fv = -fcd->financial_info.fv;
 
-  i = gtk_combo_box_get_active(GTK_COMBO_BOX(fcd->compounding_combo));
-  fcd->financial_info.CF = periods[i];
+    i = gtk_combo_box_get_active(GTK_COMBO_BOX(fcd->compounding_combo));
+    fcd->financial_info.CF = periods[i];
 
-  i = gtk_combo_box_get_active(GTK_COMBO_BOX(fcd->payment_combo));
-  fcd->financial_info.PF = periods[i];
+    i = gtk_combo_box_get_active(GTK_COMBO_BOX(fcd->payment_combo));
+    fcd->financial_info.PF = periods[i];
 
-  toggle = GTK_TOGGLE_BUTTON(fcd->end_of_period_radio);
-  fcd->financial_info.bep = !gtk_toggle_button_get_active(toggle);
+    toggle = GTK_TOGGLE_BUTTON(fcd->end_of_period_radio);
+    fcd->financial_info.bep = !gtk_toggle_button_get_active(toggle);
 
-  toggle = GTK_TOGGLE_BUTTON(fcd->discrete_compounding_radio);
-  fcd->financial_info.disc = gtk_toggle_button_get_active(toggle);
+    toggle = GTK_TOGGLE_BUTTON(fcd->discrete_compounding_radio);
+    fcd->financial_info.disc = gtk_toggle_button_get_active(toggle);
 
-  fcd->financial_info.prec = gnc_locale_decimal_places ();
+    fcd->financial_info.prec = gnc_locale_decimal_places ();
 }
 
 /* Set the sensitivity of the calculation buttons based on the argument. */
 void
 fincalc_update_calc_button_cb(GtkWidget *unused, FinCalcDialog *fcd)
 {
-  const gchar *text;
-  gint i;
+    const gchar *text;
+    gint i;
 
-  if (fcd == NULL)
-    return;
+    if (fcd == NULL)
+        return;
 
-  for (i = 0; i < NUM_FIN_CALC_VALUES; i++) {
-    text = gtk_entry_get_text(GTK_ENTRY(fcd->amounts[i]));
-    if ((text == NULL) || (*text == '\0')) {
-      gtk_widget_set_sensitive(GTK_WIDGET(fcd->calc_button), TRUE);
-      return;
+    for (i = 0; i < NUM_FIN_CALC_VALUES; i++)
+    {
+        text = gtk_entry_get_text(GTK_ENTRY(fcd->amounts[i]));
+        if ((text == NULL) || (*text == '\0'))
+        {
+            gtk_widget_set_sensitive(GTK_WIDGET(fcd->calc_button), TRUE);
+            return;
+        }
     }
-  }
 
-  gtk_widget_set_sensitive(GTK_WIDGET(fcd->calc_button), FALSE);
+    gtk_widget_set_sensitive(GTK_WIDGET(fcd->calc_button), FALSE);
 }
 
 /* Free the calc button list and free the FinCalcDialog structure. */
 static void
 fincalc_dialog_destroy(GtkObject *object, gpointer data)
 {
-  FinCalcDialog *fcd = data;
+    FinCalcDialog *fcd = data;
 
-  if (fcd == NULL)
-    return;
+    if (fcd == NULL)
+        return;
 
-  gnc_unregister_gui_component_by_data (DIALOG_FINCALC_CM_CLASS, fcd);
+    gnc_unregister_gui_component_by_data (DIALOG_FINCALC_CM_CLASS, fcd);
 
-  g_object_unref(fcd->xml);
-  g_free(fcd);
+    g_object_unref(fcd->xml);
+    g_free(fcd);
 }
 
 void
 fincalc_compounding_radio_toggled(GtkToggleButton *togglebutton, gpointer data)
 {
-  FinCalcDialog *fcd = data;
-  gboolean sensitive;
+    FinCalcDialog *fcd = data;
+    gboolean sensitive;
 
-  if (fcd == NULL)
-    return;
+    if (fcd == NULL)
+        return;
 
-  fincalc_update_calc_button_cb(GTK_WIDGET(togglebutton), fcd);
+    fincalc_update_calc_button_cb(GTK_WIDGET(togglebutton), fcd);
 
-  sensitive = gtk_toggle_button_get_active (togglebutton);
+    sensitive = gtk_toggle_button_get_active (togglebutton);
 
-  gtk_widget_set_sensitive (fcd->compounding_combo, sensitive);
+    gtk_widget_set_sensitive (fcd->compounding_combo, sensitive);
 }
 
 void
 fincalc_amount_clear_clicked_cb(GtkButton *button, GNCAmountEdit *edit)
 {
-  gtk_entry_set_text(GTK_ENTRY (edit), "");
+    gtk_entry_set_text(GTK_ENTRY (edit), "");
 }
 
 static void
 init_fi(FinCalcDialog *fcd)
 {
-  struct lconv *lc;
+    struct lconv *lc;
 
-  if (fcd == NULL)
-    return;
+    if (fcd == NULL)
+        return;
 
-  lc = gnc_localeconv();
+    lc = gnc_localeconv();
 
-  fcd->financial_info.npp = 12;
-  fcd->financial_info.ir = 8.5;
-  fcd->financial_info.pv = 15000.0;
-  fcd->financial_info.pmt = -400.0;
-  fcd->financial_info.CF = 12;
-  fcd->financial_info.PF = 12;
-  fcd->financial_info.bep = FALSE;
-  fcd->financial_info.disc = TRUE;
-  fcd->financial_info.prec = lc->frac_digits;
+    fcd->financial_info.npp = 12;
+    fcd->financial_info.ir = 8.5;
+    fcd->financial_info.pv = 15000.0;
+    fcd->financial_info.pmt = -400.0;
+    fcd->financial_info.CF = 12;
+    fcd->financial_info.PF = 12;
+    fcd->financial_info.bep = FALSE;
+    fcd->financial_info.disc = TRUE;
+    fcd->financial_info.prec = lc->frac_digits;
 
-  fi_calc_future_value(&fcd->financial_info);
+    fi_calc_future_value(&fcd->financial_info);
 }
 
 /* Determine whether the value can be calculated. If it can, return
@@ -305,188 +307,190 @@
 static const char *
 can_calc_value(FinCalcDialog *fcd, FinCalcValue value, int *error_item)
 {
-  const char *missing = _("This program can only calculate one value at a time. "
-			  "You must enter values for all but one quantity.");
-  const char *bad_exp = _("GnuCash cannot determine the value in one of the fields. "
-			  "You must enter a valid expression.");
-  const char *string;
-  gnc_numeric nvalue;
-  unsigned int i;
+    const char *missing = _("This program can only calculate one value at a time. "
+                            "You must enter values for all but one quantity.");
+    const char *bad_exp = _("GnuCash cannot determine the value in one of the fields. "
+                            "You must enter a valid expression.");
+    const char *string;
+    gnc_numeric nvalue;
+    unsigned int i;
 
-  if (fcd == NULL)
-    return NULL;
+    if (fcd == NULL)
+        return NULL;
 
-  /* Check for missing values */
-  for (i = 0; i < NUM_FIN_CALC_VALUES; i++)
-    if (i != value)
-    {
-      string = gtk_entry_get_text(GTK_ENTRY(fcd->amounts[i]));
-      if ((string == NULL) || (*string == '\0'))
-      {
-        *error_item = i;
-        return missing;
-      }
+    /* Check for missing values */
+    for (i = 0; i < NUM_FIN_CALC_VALUES; i++)
+        if (i != value)
+        {
+            string = gtk_entry_get_text(GTK_ENTRY(fcd->amounts[i]));
+            if ((string == NULL) || (*string == '\0'))
+            {
+                *error_item = i;
+                return missing;
+            }
 
-      if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (fcd->amounts[i])))
-      {
-        *error_item = i;
-        return bad_exp;
-      }
-    }
+            if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (fcd->amounts[i])))
+            {
+                *error_item = i;
+                return bad_exp;
+            }
+        }
 
-  /* Check for zero interest */
-  switch (value)
-  {
+    /* Check for zero interest */
+    switch (value)
+    {
     case PAYMENT_PERIODS:
     case PRESENT_VALUE:
     case PERIODIC_PAYMENT:
     case FUTURE_VALUE:
-      nvalue = gnc_amount_edit_get_amount
-        (GNC_AMOUNT_EDIT (fcd->amounts[INTEREST_RATE]));
-      if (gnc_numeric_zero_p (nvalue))
-      {
-        *error_item = INTEREST_RATE;
-        return _("The interest rate cannot be zero.");
-      }
-      break;
+        nvalue = gnc_amount_edit_get_amount
+                 (GNC_AMOUNT_EDIT (fcd->amounts[INTEREST_RATE]));
+        if (gnc_numeric_zero_p (nvalue))
+        {
+            *error_item = INTEREST_RATE;
+            return _("The interest rate cannot be zero.");
+        }
+        break;
     default:
-      break;
-  }
+        break;
+    }
 
-  /* Check for zero payment periods */
-  switch (value)
-  {
+    /* Check for zero payment periods */
+    switch (value)
+    {
     case INTEREST_RATE:
     case PRESENT_VALUE:
     case PERIODIC_PAYMENT:
     case FUTURE_VALUE:
-      nvalue = gnc_amount_edit_get_amount
-        (GNC_AMOUNT_EDIT(fcd->amounts[PAYMENT_PERIODS]));
-      if (gnc_numeric_zero_p (nvalue))
-      {
-        *error_item = PAYMENT_PERIODS;
-        return _("The number of payments cannot be zero.");
-      }
-      if (gnc_numeric_negative_p (nvalue))
-      {
-        *error_item = PAYMENT_PERIODS;
-        return _("The number of payments cannot be negative.");
-      }
-      break;
+        nvalue = gnc_amount_edit_get_amount
+                 (GNC_AMOUNT_EDIT(fcd->amounts[PAYMENT_PERIODS]));
+        if (gnc_numeric_zero_p (nvalue))
+        {
+            *error_item = PAYMENT_PERIODS;
+            return _("The number of payments cannot be zero.");
+        }
+        if (gnc_numeric_negative_p (nvalue))
+        {
+            *error_item = PAYMENT_PERIODS;
+            return _("The number of payments cannot be negative.");
+        }
+        break;
     default:
-      break;
-  }
+        break;
+    }
 
-  return NULL;
+    return NULL;
 }
 
 static void
 calc_value(FinCalcDialog *fcd, FinCalcValue value)
 {
-  const char *string;
-  int error_item = 0;
+    const char *string;
+    int error_item = 0;
 
-  if (fcd == NULL)
-    return;
+    if (fcd == NULL)
+        return;
 
-  string = can_calc_value(fcd, value, &error_item);
-  if (string != NULL)
-  {
-    GtkWidget *entry;
+    string = can_calc_value(fcd, value, &error_item);
+    if (string != NULL)
+    {
+        GtkWidget *entry;
 
-    gnc_error_dialog(fcd->dialog, "%s", string);
-    if (error_item == 0)
-      entry = fcd->amounts[0];
-    else
-      entry = fcd->amounts[error_item];
-    gtk_widget_grab_focus (entry);
-    return;
-  }
+        gnc_error_dialog(fcd->dialog, "%s", string);
+        if (error_item == 0)
+            entry = fcd->amounts[0];
+        else
+            entry = fcd->amounts[error_item];
+        gtk_widget_grab_focus (entry);
+        return;
+    }
 
-  gui_to_fi(fcd);
+    gui_to_fi(fcd);
 
-  switch (value)
-  {
+    switch (value)
+    {
     case PAYMENT_PERIODS:
-      fi_calc_num_payments(&fcd->financial_info);
-      break;
+        fi_calc_num_payments(&fcd->financial_info);
+        break;
     case INTEREST_RATE:
-      fi_calc_interest(&fcd->financial_info);
-      break;
+        fi_calc_interest(&fcd->financial_info);
+        break;
     case PRESENT_VALUE:
-      fi_calc_present_value(&fcd->financial_info);
-      break;
+        fi_calc_present_value(&fcd->financial_info);
+        break;
     case PERIODIC_PAYMENT:
-      fi_calc_payment(&fcd->financial_info);
-      break;
+        fi_calc_payment(&fcd->financial_info);
+        break;
     case FUTURE_VALUE:
-      fi_calc_future_value(&fcd->financial_info);
-      break;
+        fi_calc_future_value(&fcd->financial_info);
+        break;
     default:
-      PERR("Unknown financial variable");
-      break;
-  }
+        PERR("Unknown financial variable");
+        break;
+    }
 
-  fi_to_gui(fcd);
+    fi_to_gui(fcd);
 
-  gtk_widget_set_sensitive(GTK_WIDGET(fcd->calc_button), FALSE);
+    gtk_widget_set_sensitive(GTK_WIDGET(fcd->calc_button), FALSE);
 }
 
 void
 fincalc_calc_clicked_cb(GtkButton *button, FinCalcDialog *fcd)
 {
-  const gchar *text;
-  gint i;
+    const gchar *text;
+    gint i;
 
-  for (i = 0; i < NUM_FIN_CALC_VALUES; i++) {
-    text = gtk_entry_get_text(GTK_ENTRY(fcd->amounts[i]));
-    if ((text != NULL) && (*text != '\0'))
-      continue;
-    calc_value(fcd, i);
-    return;
-  }
+    for (i = 0; i < NUM_FIN_CALC_VALUES; i++)
+    {
+        text = gtk_entry_get_text(GTK_ENTRY(fcd->amounts[i]));
+        if ((text != NULL) && (*text != '\0'))
+            continue;
+        calc_value(fcd, i);
+        return;
+    }
 }
 
 void fincalc_response_cb (GtkDialog *dialog,
-			  gint response,
-			  FinCalcDialog *fcd)
+                          gint response,
+                          FinCalcDialog *fcd)
 {
-  switch (response) {
+    switch (response)
+    {
     case GTK_RESPONSE_OK:
-      /* Do something here whenever the hidden schedule button is clicked. */
-      /* Fall through */
+        /* Do something here whenever the hidden schedule button is clicked. */
+        /* Fall through */
 
     case GTK_RESPONSE_CLOSE:
-      gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
-      break;
+        gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
+        break;
 
     default:
-      /* Cancel, destroy, etc.  Do nothing. */
-      break;
-  }
+        /* Cancel, destroy, etc.  Do nothing. */
+        break;
+    }
 
-  gnc_close_gui_component_by_data (DIALOG_FINCALC_CM_CLASS, fcd);
+    gnc_close_gui_component_by_data (DIALOG_FINCALC_CM_CLASS, fcd);
 }
 
 
 static void
 close_handler (gpointer user_data)
 {
-  FinCalcDialog *fcd = user_data;
+    FinCalcDialog *fcd = user_data;
 
-  gtk_widget_destroy (fcd->dialog);
+    gtk_widget_destroy (fcd->dialog);
 }
 
 static gboolean
 show_handler (const char *class, gint component_id,
-	      gpointer user_data, gpointer iter_data)
+              gpointer user_data, gpointer iter_data)
 {
-  FinCalcDialog *fcd = user_data;
+    FinCalcDialog *fcd = user_data;
 
-  if (!fcd)
-    return(FALSE);
-  gtk_window_present (GTK_WINDOW(fcd->dialog));
-  return(TRUE);
+    if (!fcd)
+        return(FALSE);
+    gtk_window_present (GTK_WINDOW(fcd->dialog));
+    return(TRUE);
 }
 
 
@@ -504,20 +508,20 @@
  */
 static void
 fincalc_init_gae (GNCAmountEdit *edit,
-		  gint min_places,
-		  gint max_places,
-		  gint fraction)
+                  gint min_places,
+                  gint max_places,
+                  gint fraction)
 {
-  GNCPrintAmountInfo print_info;
+    GNCPrintAmountInfo print_info;
 
-  print_info = gnc_integral_print_info ();
-  print_info.min_decimal_places = min_places;
-  print_info.max_decimal_places = max_places;
+    print_info = gnc_integral_print_info ();
+    print_info.min_decimal_places = min_places;
+    print_info.max_decimal_places = max_places;
 
-  gnc_amount_edit_set_print_info (edit, print_info);
-  gnc_amount_edit_set_fraction (edit, fraction);
-  gnc_amount_edit_set_evaluate_on_enter (edit, TRUE);
-  gtk_entry_set_alignment (GTK_ENTRY(edit), 1.0);
+    gnc_amount_edit_set_print_info (edit, print_info);
+    gnc_amount_edit_set_fraction (edit, fraction);
+    gnc_amount_edit_set_evaluate_on_enter (edit, TRUE);
+    gtk_entry_set_alignment (GTK_ENTRY(edit), 1.0);
 }
 
 /** Initialize an edit field that will display a number in the users
@@ -528,113 +532,113 @@
 static void
 fincalc_init_commodity_gae (GNCAmountEdit *edit)
 {
-  GNCPrintAmountInfo print_info;
-  gnc_commodity *commodity;
-  gint fraction;
+    GNCPrintAmountInfo print_info;
+    gnc_commodity *commodity;
+    gint fraction;
 
-  commodity = gnc_default_currency();
-  fraction = gnc_commodity_get_fraction(commodity);
-  print_info = gnc_commodity_print_info (commodity, FALSE);
+    commodity = gnc_default_currency();
+    fraction = gnc_commodity_get_fraction(commodity);
+    print_info = gnc_commodity_print_info (commodity, FALSE);
 
-  gnc_amount_edit_set_print_info (edit, print_info);
-  gnc_amount_edit_set_fraction (edit, fraction);
-  gnc_amount_edit_set_evaluate_on_enter (edit, TRUE);
-  gtk_entry_set_alignment (GTK_ENTRY(edit), 1.0);
+    gnc_amount_edit_set_print_info (edit, print_info);
+    gnc_amount_edit_set_fraction (edit, fraction);
+    gnc_amount_edit_set_evaluate_on_enter (edit, TRUE);
+    gtk_entry_set_alignment (GTK_ENTRY(edit), 1.0);
 }
 
 void
 gnc_ui_fincalc_dialog_create(void)
 {
-  FinCalcDialog *fcd;
-  GtkWidget *button;
-  GtkWidget *combo;
-  GtkWidget *edit;
-  GladeXML  *xml;
+    FinCalcDialog *fcd;
+    GtkWidget *button;
+    GtkWidget *combo;
+    GtkWidget *edit;
+    GladeXML  *xml;
 
-  if (gnc_forall_gui_components (DIALOG_FINCALC_CM_CLASS,
-				 show_handler, NULL))
-      return;
+    if (gnc_forall_gui_components (DIALOG_FINCALC_CM_CLASS,
+                                   show_handler, NULL))
+        return;
 
 
-  fcd = g_new0(FinCalcDialog, 1);
+    fcd = g_new0(FinCalcDialog, 1);
 
-  xml = gnc_glade_xml_new ("fincalc.glade", "Financial Calculator Dialog");
+    xml = gnc_glade_xml_new ("fincalc.glade", "Financial Calculator Dialog");
 
-  fcd->xml = xml;
-  fcd->dialog = glade_xml_get_widget (xml, "Financial Calculator Dialog");
+    fcd->xml = xml;
+    fcd->dialog = glade_xml_get_widget (xml, "Financial Calculator Dialog");
 
-  gnc_register_gui_component (DIALOG_FINCALC_CM_CLASS,
-                              NULL, close_handler, fcd);
+    gnc_register_gui_component (DIALOG_FINCALC_CM_CLASS,
+                                NULL, close_handler, fcd);
 
-  g_signal_connect (G_OBJECT (fcd->dialog), "destroy",
-                    G_CALLBACK (fincalc_dialog_destroy), fcd);
+    g_signal_connect (G_OBJECT (fcd->dialog), "destroy",
+                      G_CALLBACK (fincalc_dialog_destroy), fcd);
 
 
-  edit = glade_xml_get_widget (xml, "payment_periods_edit");
-  fincalc_init_gae (GNC_AMOUNT_EDIT (edit), 0, 0, 1);
-  fcd->amounts[PAYMENT_PERIODS] = edit;
+    edit = glade_xml_get_widget (xml, "payment_periods_edit");
+    fincalc_init_gae (GNC_AMOUNT_EDIT (edit), 0, 0, 1);
+    fcd->amounts[PAYMENT_PERIODS] = edit;
 
-  edit = glade_xml_get_widget (xml, "interest_rate_edit");
-  fincalc_init_gae (GNC_AMOUNT_EDIT (edit), 2, 5, 100000);
-  fcd->amounts[INTEREST_RATE] = edit;
+    edit = glade_xml_get_widget (xml, "interest_rate_edit");
+    fincalc_init_gae (GNC_AMOUNT_EDIT (edit), 2, 5, 100000);
+    fcd->amounts[INTEREST_RATE] = edit;
 
-  edit = glade_xml_get_widget (xml, "present_value_edit");
-  fincalc_init_commodity_gae (GNC_AMOUNT_EDIT (edit));
-  fcd->amounts[PRESENT_VALUE] = edit;
+    edit = glade_xml_get_widget (xml, "present_value_edit");
+    fincalc_init_commodity_gae (GNC_AMOUNT_EDIT (edit));
+    fcd->amounts[PRESENT_VALUE] = edit;
 
-  edit = glade_xml_get_widget (xml, "period_payment_edit");
-  fincalc_init_commodity_gae (GNC_AMOUNT_EDIT (edit));
-  fcd->amounts[PERIODIC_PAYMENT] = edit;
+    edit = glade_xml_get_widget (xml, "period_payment_edit");
+    fincalc_init_commodity_gae (GNC_AMOUNT_EDIT (edit));
+    fcd->amounts[PERIODIC_PAYMENT] = edit;
 
-  edit = glade_xml_get_widget (xml, "future_value_edit");
-  fincalc_init_commodity_gae (GNC_AMOUNT_EDIT (edit));
-  fcd->amounts[FUTURE_VALUE] = edit;
+    edit = glade_xml_get_widget (xml, "future_value_edit");
+    fincalc_init_commodity_gae (GNC_AMOUNT_EDIT (edit));
+    fcd->amounts[FUTURE_VALUE] = edit;
 
 
-  fcd->calc_button = glade_xml_get_widget (xml, "calc_button");
+    fcd->calc_button = glade_xml_get_widget (xml, "calc_button");
 
 
-  combo = glade_xml_get_widget (xml, "compounding_combo");
-  fcd->compounding_combo = combo;
-  g_signal_connect(fcd->compounding_combo, "changed",
-		   G_CALLBACK (fincalc_update_calc_button_cb), fcd);
+    combo = glade_xml_get_widget (xml, "compounding_combo");
+    fcd->compounding_combo = combo;
+    g_signal_connect(fcd->compounding_combo, "changed",
+                     G_CALLBACK (fincalc_update_calc_button_cb), fcd);
 
-  combo = glade_xml_get_widget (xml, "payment_combo");
-  fcd->payment_combo = combo;
-  g_signal_connect(fcd->compounding_combo, "changed",
-		   G_CALLBACK (fincalc_update_calc_button_cb), fcd);
+    combo = glade_xml_get_widget (xml, "payment_combo");
+    fcd->payment_combo = combo;
+    g_signal_connect(fcd->compounding_combo, "changed",
+                     G_CALLBACK (fincalc_update_calc_button_cb), fcd);
 
-  button = glade_xml_get_widget (xml, "period_payment_radio");
-  fcd->end_of_period_radio = button;
+    button = glade_xml_get_widget (xml, "period_payment_radio");
+    fcd->end_of_period_radio = button;
 
-  button = glade_xml_get_widget (xml, "discrete_compounding_radio");
-  fcd->discrete_compounding_radio = button;
+    button = glade_xml_get_widget (xml, "discrete_compounding_radio");
+    fcd->discrete_compounding_radio = button;
 
-  fcd->payment_total_label = glade_xml_get_widget (xml, "payment_total_label");
+    fcd->payment_total_label = glade_xml_get_widget (xml, "payment_total_label");
 
-  button = glade_xml_get_widget (xml, "schedule_button");
-  gtk_widget_hide (button);
+    button = glade_xml_get_widget (xml, "schedule_button");
+    gtk_widget_hide (button);
 
-  init_fi(fcd);
+    init_fi(fcd);
 
-  fi_to_gui(fcd);
+    fi_to_gui(fcd);
 
-  gtk_widget_grab_focus(fcd->amounts[PAYMENT_PERIODS]);
+    gtk_widget_grab_focus(fcd->amounts[PAYMENT_PERIODS]);
 
-  /* Connect all signals specified in glade. */
-  glade_xml_signal_autoconnect_full( xml,
-                                     gnc_glade_autoconnect_full_func,
-                                     fcd);
+    /* Connect all signals specified in glade. */
+    glade_xml_signal_autoconnect_full( xml,
+                                       gnc_glade_autoconnect_full_func,
+                                       fcd);
 
-  gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(fcd->dialog));
-  gtk_widget_show(fcd->dialog);
+    gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(fcd->dialog));
+    gtk_widget_show(fcd->dialog);
 }
 
 void
 gnc_ui_fincalc_dialog_destroy(FinCalcDialog *fcd)
 {
-  if (fcd == NULL)
-    return;
+    if (fcd == NULL)
+        return;
 
-  gnc_close_gui_component_by_data (DIALOG_FINCALC_CM_CLASS, fcd);
+    gnc_close_gui_component_by_data (DIALOG_FINCALC_CM_CLASS, fcd);
 }

Modified: gnucash/trunk/src/gnome/dialog-find-transactions.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-find-transactions.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-find-transactions.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -40,141 +40,149 @@
 
 #define GCONF_SECTION "dialogs/find"
 
-struct _ftd_data {
-  QueryNew *		q;
-  QueryNew *		ledger_q;
-  GNCSearchWindow *	sw;
+struct _ftd_data
+{
+    QueryNew *		q;
+    QueryNew *		ledger_q;
+    GNCSearchWindow *	sw;
 };
 
 static void
 do_find_cb (QueryNew *query, gpointer user_data, gpointer *result)
 {
-  struct _ftd_data *ftd = user_data;
-  GNCLedgerDisplay *ledger;
-  gboolean new_ledger = FALSE;
-  GncPluginPage *page;
+    struct _ftd_data *ftd = user_data;
+    GNCLedgerDisplay *ledger;
+    gboolean new_ledger = FALSE;
+    GncPluginPage *page;
 
-  ledger = gnc_ledger_display_find_by_query (ftd->ledger_q);
-  if(!ledger) {
-    new_ledger = TRUE;
-    ledger = gnc_ledger_display_query (query, SEARCH_LEDGER,
-                                       REG_STYLE_JOURNAL);
-  }
-  else
-    gnc_ledger_display_set_query (ledger, query);
+    ledger = gnc_ledger_display_find_by_query (ftd->ledger_q);
+    if (!ledger)
+    {
+        new_ledger = TRUE;
+        ledger = gnc_ledger_display_query (query, SEARCH_LEDGER,
+                                           REG_STYLE_JOURNAL);
+    }
+    else
+        gnc_ledger_display_set_query (ledger, query);
 
-  gnc_ledger_display_refresh (ledger);
+    gnc_ledger_display_refresh (ledger);
 
-  if (new_ledger) {
-    page = gnc_plugin_page_register_new_ledger (ledger);
-    gnc_main_window_open_page (NULL, page);
-  }
+    if (new_ledger)
+    {
+        page = gnc_plugin_page_register_new_ledger (ledger);
+        gnc_main_window_open_page (NULL, page);
+    }
 
-  gncQueryDestroy (ftd->q);
+    gncQueryDestroy (ftd->q);
 
-  gnc_search_dialog_destroy (ftd->sw);
+    gnc_search_dialog_destroy (ftd->sw);
 }
 
 static void
 free_ftd_cb (gpointer user_data)
 {
-  struct _ftd_data *ftd = user_data;
+    struct _ftd_data *ftd = user_data;
 
-  if (!ftd)
-    return;
+    if (!ftd)
+        return;
 
-  g_free (ftd);
+    g_free (ftd);
 }
 
-GNCSearchWindow * 
+GNCSearchWindow *
 gnc_ui_find_transactions_dialog_create(GNCLedgerDisplay * orig_ledg)
 {
-  GNCIdType type = GNC_ID_SPLIT;
-  struct _ftd_data *ftd;
-  static GList *params = NULL;
-  QueryNew *start_q, *show_q = NULL;
+    GNCIdType type = GNC_ID_SPLIT;
+    struct _ftd_data *ftd;
+    static GList *params = NULL;
+    QueryNew *start_q, *show_q = NULL;
 
-  /* Build parameter list in reverse order */
-  if (params == NULL) {
-    params = gnc_search_param_prepend (params, N_("All Accounts"),
-				       ACCOUNT_MATCH_ALL_TYPE,
-				       type, SPLIT_TRANS, TRANS_SPLITLIST,
-				       SPLIT_ACCOUNT_GUID, NULL);
-    params = gnc_search_param_prepend (params, N_("Account"), GNC_ID_ACCOUNT,
-				       type, SPLIT_ACCOUNT, QUERY_PARAM_GUID,
-				       NULL);
-    params = gnc_search_param_prepend (params, N_("Balanced"), NULL,
-				       type, SPLIT_TRANS, TRANS_IS_BALANCED,
-				       NULL);
-    params = gnc_search_param_prepend (params, N_("Reconcile"), RECONCILED_MATCH_TYPE,
-				       type, SPLIT_RECONCILE, NULL);
-    params = gnc_search_param_prepend (params, N_("Share Price"), NULL,
-				       type, SPLIT_SHARE_PRICE, NULL);
-    params = gnc_search_param_prepend (params, N_("Shares"), NULL,
-				       type, SPLIT_AMOUNT, NULL);
-    params = gnc_search_param_prepend (params, N_("Value"), NULL,
-				       type, SPLIT_VALUE, NULL);
-    params = gnc_search_param_prepend (params, N_("Date Posted"), NULL,
-				       type, SPLIT_TRANS, TRANS_DATE_POSTED,
-				       NULL);
-    params = gnc_search_param_prepend (params, N_("Notes"), NULL,
-				       type, SPLIT_TRANS, TRANS_NOTES, NULL);
-    params = gnc_search_param_prepend (params, N_("Action"), NULL,
-				       type, SPLIT_ACTION, NULL);
-    params = gnc_search_param_prepend (params, N_("Number"), NULL,
-				       type, SPLIT_TRANS, TRANS_NUM, NULL);
-    params = gnc_search_param_prepend (params, N_("Memo"), NULL,
-				       type, SPLIT_MEMO, NULL);
-    params = gnc_search_param_prepend (params, N_("Description"), NULL,
-				       type, SPLIT_TRANS, TRANS_DESCRIPTION,
-				       NULL);
-  }
+    /* Build parameter list in reverse order */
+    if (params == NULL)
+    {
+        params = gnc_search_param_prepend (params, N_("All Accounts"),
+                                           ACCOUNT_MATCH_ALL_TYPE,
+                                           type, SPLIT_TRANS, TRANS_SPLITLIST,
+                                           SPLIT_ACCOUNT_GUID, NULL);
+        params = gnc_search_param_prepend (params, N_("Account"), GNC_ID_ACCOUNT,
+                                           type, SPLIT_ACCOUNT, QUERY_PARAM_GUID,
+                                           NULL);
+        params = gnc_search_param_prepend (params, N_("Balanced"), NULL,
+                                           type, SPLIT_TRANS, TRANS_IS_BALANCED,
+                                           NULL);
+        params = gnc_search_param_prepend (params, N_("Reconcile"), RECONCILED_MATCH_TYPE,
+                                           type, SPLIT_RECONCILE, NULL);
+        params = gnc_search_param_prepend (params, N_("Share Price"), NULL,
+                                           type, SPLIT_SHARE_PRICE, NULL);
+        params = gnc_search_param_prepend (params, N_("Shares"), NULL,
+                                           type, SPLIT_AMOUNT, NULL);
+        params = gnc_search_param_prepend (params, N_("Value"), NULL,
+                                           type, SPLIT_VALUE, NULL);
+        params = gnc_search_param_prepend (params, N_("Date Posted"), NULL,
+                                           type, SPLIT_TRANS, TRANS_DATE_POSTED,
+                                           NULL);
+        params = gnc_search_param_prepend (params, N_("Notes"), NULL,
+                                           type, SPLIT_TRANS, TRANS_NOTES, NULL);
+        params = gnc_search_param_prepend (params, N_("Action"), NULL,
+                                           type, SPLIT_ACTION, NULL);
+        params = gnc_search_param_prepend (params, N_("Number"), NULL,
+                                           type, SPLIT_TRANS, TRANS_NUM, NULL);
+        params = gnc_search_param_prepend (params, N_("Memo"), NULL,
+                                           type, SPLIT_MEMO, NULL);
+        params = gnc_search_param_prepend (params, N_("Description"), NULL,
+                                           type, SPLIT_TRANS, TRANS_DESCRIPTION,
+                                           NULL);
+    }
 
-  ftd = g_new0 (struct _ftd_data, 1);
+    ftd = g_new0 (struct _ftd_data, 1);
 
-  if(orig_ledg) {
-    ftd->ledger_q = gnc_ledger_display_get_query (orig_ledg);
-    start_q = show_q = gncQueryCopy (ftd->ledger_q);
-  } else {
-    start_q = gncQueryCreate ();
-    gncQuerySetBook (start_q, gnc_get_current_book ());
-
-    /* In lieu of not "mis-using" some portion of the infrastructure by writing
-     * a bunch of new code, we just filter out the accounts of the template
-     * transactions.  While these are in a seperate Account trees just for this
-     * reason, the query engine makes no distinction between Account trees.
-     * See Gnome Bug 86302.
-     * 	-- jsled 
-     *
-     * copied from gnc-ledger-display.c:gnc_ledger_display_gl()  -- warlord
-     *
-     * <jsled> Alternatively, you could look for a GNC_SX_ACCOUNT [SchedAction.h] 
-     * key in the KVP frame of the split.
-     */
+    if (orig_ledg)
     {
-      Account *tRoot;
-      GList *al;
-    
-      tRoot = gnc_book_get_template_root( gnc_get_current_book() );
-      al = gnc_account_get_descendants( tRoot );
-      xaccQueryAddAccountMatch( start_q, al, GUID_MATCH_NONE, QUERY_AND );
-      g_list_free (al);
-      al = NULL;
-      tRoot = NULL;
+        ftd->ledger_q = gnc_ledger_display_get_query (orig_ledg);
+        start_q = show_q = gncQueryCopy (ftd->ledger_q);
     }
+    else
+    {
+        start_q = gncQueryCreate ();
+        gncQuerySetBook (start_q, gnc_get_current_book ());
 
-    ftd->q = start_q;		/* save this to destroy it later */
-  }
+        /* In lieu of not "mis-using" some portion of the infrastructure by writing
+         * a bunch of new code, we just filter out the accounts of the template
+         * transactions.  While these are in a seperate Account trees just for this
+         * reason, the query engine makes no distinction between Account trees.
+         * See Gnome Bug 86302.
+         * 	-- jsled
+         *
+         * copied from gnc-ledger-display.c:gnc_ledger_display_gl()  -- warlord
+         *
+         * <jsled> Alternatively, you could look for a GNC_SX_ACCOUNT [SchedAction.h]
+         * key in the KVP frame of the split.
+         */
+        {
+            Account *tRoot;
+            GList *al;
 
-  ftd->sw = gnc_search_dialog_create (type, _("Find Transaction"),
-				      params, NULL, start_q, show_q,
-				      NULL, do_find_cb, NULL,
-				      ftd, free_ftd_cb, GCONF_SECTION, NULL);
+            tRoot = gnc_book_get_template_root( gnc_get_current_book() );
+            al = gnc_account_get_descendants( tRoot );
+            xaccQueryAddAccountMatch( start_q, al, GUID_MATCH_NONE, QUERY_AND );
+            g_list_free (al);
+            al = NULL;
+            tRoot = NULL;
+        }
 
-  if (!ftd->sw) {
-    free_ftd_cb (ftd);
-    return NULL;
-  }
+        ftd->q = start_q;		/* save this to destroy it later */
+    }
 
-  return ftd->sw;
+    ftd->sw = gnc_search_dialog_create (type, _("Find Transaction"),
+                                        params, NULL, start_q, show_q,
+                                        NULL, do_find_cb, NULL,
+                                        ftd, free_ftd_cb, GCONF_SECTION, NULL);
+
+    if (!ftd->sw)
+    {
+        free_ftd_cb (ftd);
+        return NULL;
+    }
+
+    return ftd->sw;
 }

Modified: gnucash/trunk/src/gnome/dialog-new-user.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-new-user.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-new-user.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -51,104 +51,110 @@
 void
 gnc_new_user_dialog_register_qif_druid (void (*cb_fcn)(void))
 {
-  g_return_if_fail (qifImportDruidFcn == NULL);
-  qifImportDruidFcn = cb_fcn;
+    g_return_if_fail (qifImportDruidFcn == NULL);
+    qifImportDruidFcn = cb_fcn;
 }
 
 void
 gnc_set_first_startup (gboolean first_startup)
 {
-  gnc_gconf_set_bool(GCONF_SECTION, FIRST_STARTUP, first_startup, NULL);
+    gnc_gconf_set_bool(GCONF_SECTION, FIRST_STARTUP, first_startup, NULL);
 }
 
 static void
 after_hierarchy_druid(void)
 {
-  GncPluginPage *page;
+    GncPluginPage *page;
 
-  gncp_new_user_finish ();
-  gnc_set_first_startup (FALSE);
-  
-  page = gnc_plugin_page_account_tree_new();
-  gnc_main_window_open_page(NULL, page);
+    gncp_new_user_finish ();
+    gnc_set_first_startup (FALSE);
+
+    page = gnc_plugin_page_account_tree_new();
+    gnc_main_window_open_page(NULL, page);
 }
 
 void
 gnc_ui_new_user_dialog (void)
 {
-  GtkWidget *dialog;
-  GtkWidget *new_accounts_button;
-  GtkWidget *import_qif_button;
-  GtkWidget *tutorial_button;
-  GladeXML  *xml;
-  gint result;
+    GtkWidget *dialog;
+    GtkWidget *new_accounts_button;
+    GtkWidget *import_qif_button;
+    GtkWidget *tutorial_button;
+    GladeXML  *xml;
+    gint result;
 
-  ENTER(" ");
-  xml = gnc_glade_xml_new ("newuser.glade", "New User Dialog");
+    ENTER(" ");
+    xml = gnc_glade_xml_new ("newuser.glade", "New User Dialog");
 
-  dialog = glade_xml_get_widget (xml, "New User Dialog");
+    dialog = glade_xml_get_widget (xml, "New User Dialog");
 
-  new_accounts_button = glade_xml_get_widget (xml, "new_accounts_button");
-  import_qif_button = glade_xml_get_widget (xml, "import_qif_button");
-  tutorial_button = glade_xml_get_widget (xml, "tutorial_button");
+    new_accounts_button = glade_xml_get_widget (xml, "new_accounts_button");
+    import_qif_button = glade_xml_get_widget (xml, "import_qif_button");
+    tutorial_button = glade_xml_get_widget (xml, "tutorial_button");
 
-  /* Set the sensitivity of the qif-import button based on the availability
-   * of the qif-import druid.
-   */
-  gtk_widget_set_sensitive (import_qif_button, (qifImportDruidFcn != NULL));
+    /* Set the sensitivity of the qif-import button based on the availability
+     * of the qif-import druid.
+     */
+    gtk_widget_set_sensitive (import_qif_button, (qifImportDruidFcn != NULL));
 
-  result = gtk_dialog_run (GTK_DIALOG (dialog));
-  switch (result) {
-	  case GTK_RESPONSE_CANCEL:
-	  case GTK_RESPONSE_DELETE_EVENT:
-		gnc_ui_new_user_cancel_dialog ();
-		break;
-	  case GTK_RESPONSE_OK:
-		if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (new_accounts_button))) {
-			gnc_ui_hierarchy_druid_with_callback(TRUE, after_hierarchy_druid);
-			break;
-		} else if ((qifImportDruidFcn != NULL)
-                           && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (import_qif_button))) {
-			qifImportDruidFcn();
-			gncp_new_user_finish ();
-			break;
-		} else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tutorial_button))) {
-			gnc_gnome_help (HF_GUIDE, NULL);
-			gncp_new_user_finish ();
-			break;
-		}
-	  default:
-		g_print ("DEBUG: Response: %d", result);
-		g_assert_not_reached ();
-  }
+    result = gtk_dialog_run (GTK_DIALOG (dialog));
+    switch (result)
+    {
+    case GTK_RESPONSE_CANCEL:
+    case GTK_RESPONSE_DELETE_EVENT:
+        gnc_ui_new_user_cancel_dialog ();
+        break;
+    case GTK_RESPONSE_OK:
+        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (new_accounts_button)))
+        {
+            gnc_ui_hierarchy_druid_with_callback(TRUE, after_hierarchy_druid);
+            break;
+        }
+        else if ((qifImportDruidFcn != NULL)
+                 && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (import_qif_button)))
+        {
+            qifImportDruidFcn();
+            gncp_new_user_finish ();
+            break;
+        }
+        else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tutorial_button)))
+        {
+            gnc_gnome_help (HF_GUIDE, NULL);
+            gncp_new_user_finish ();
+            break;
+        }
+    default:
+        g_print ("DEBUG: Response: %d", result);
+        g_assert_not_reached ();
+    }
 
-  gtk_widget_destroy (dialog);
-  LEAVE(" ");
+    gtk_widget_destroy (dialog);
+    LEAVE(" ");
 }
 
 static void
 gnc_ui_new_user_cancel_dialog (void)
 {
-  GtkWidget *dialog;
-  GladeXML  *xml;
-  gint result;
-  gboolean keepshowing;
+    GtkWidget *dialog;
+    GladeXML  *xml;
+    gint result;
+    gboolean keepshowing;
 
-  xml = gnc_glade_xml_new ("newuser.glade", "New User Cancel Dialog");
+    xml = gnc_glade_xml_new ("newuser.glade", "New User Cancel Dialog");
 
-  dialog = glade_xml_get_widget (xml, "New User Cancel Dialog");
+    dialog = glade_xml_get_widget (xml, "New User Cancel Dialog");
 
-  result = gtk_dialog_run (GTK_DIALOG (dialog));
-  keepshowing = (result == GTK_RESPONSE_YES);
+    result = gtk_dialog_run (GTK_DIALOG (dialog));
+    keepshowing = (result == GTK_RESPONSE_YES);
 
-  gnc_set_first_startup (keepshowing);
-  gncp_new_user_finish ();
+    gnc_set_first_startup (keepshowing);
+    gncp_new_user_finish ();
 
-  gtk_widget_destroy(dialog);
+    gtk_widget_destroy(dialog);
 }
 
 void
 gncp_new_user_finish (void)
 {
-  gnc_hook_run(HOOK_BOOK_OPENED, gnc_get_current_session());
+    gnc_hook_run(HOOK_BOOK_OPENED, gnc_get_current_session());
 }

Modified: gnucash/trunk/src/gnome/dialog-price-edit-db.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-price-edit-db.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-price-edit-db.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -68,451 +68,467 @@
 
 typedef struct
 {
-  GtkWidget * dialog;
-  QofSession *session;
-  QofBook *book;
-  GNCPriceDB *price_db;
+    GtkWidget * dialog;
+    QofSession *session;
+    QofBook *book;
+    GNCPriceDB *price_db;
 
-  GncTreeViewPrice * price_tree;
+    GncTreeViewPrice * price_tree;
 
-  GtkWidget * edit_button;
-  GtkWidget * remove_button;
+    GtkWidget * edit_button;
+    GtkWidget * remove_button;
 } PricesDialog;
 
 
 void
 gnc_prices_dialog_window_destroy_cb (GtkObject *object, gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
+    PricesDialog *pdb_dialog = data;
 
-  ENTER(" ");
-  gnc_unregister_gui_component_by_data (DIALOG_PRICE_DB_CM_CLASS, pdb_dialog);
+    ENTER(" ");
+    gnc_unregister_gui_component_by_data (DIALOG_PRICE_DB_CM_CLASS, pdb_dialog);
 
-  if (pdb_dialog->dialog) {
-    gtk_widget_destroy(pdb_dialog->dialog);
-    pdb_dialog->dialog = NULL;
-  }
+    if (pdb_dialog->dialog)
+    {
+        gtk_widget_destroy(pdb_dialog->dialog);
+        pdb_dialog->dialog = NULL;
+    }
 
-  g_free (pdb_dialog);
-  LEAVE(" ");
+    g_free (pdb_dialog);
+    LEAVE(" ");
 }
 
 void
 gnc_prices_dialog_close_cb (GtkDialog *dialog, gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
+    PricesDialog *pdb_dialog = data;
 
-  ENTER(" ");
-  gnc_close_gui_component_by_data (DIALOG_PRICE_DB_CM_CLASS, pdb_dialog);
-  LEAVE(" ");
+    ENTER(" ");
+    gnc_close_gui_component_by_data (DIALOG_PRICE_DB_CM_CLASS, pdb_dialog);
+    LEAVE(" ");
 }
 
 void
 gnc_prices_dialog_response (GtkDialog *dialog, gint response_id, gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
+    PricesDialog *pdb_dialog = data;
 
-  ENTER(" ");
-  gnc_close_gui_component_by_data (DIALOG_PRICE_DB_CM_CLASS, pdb_dialog);
-  LEAVE(" ");
+    ENTER(" ");
+    gnc_close_gui_component_by_data (DIALOG_PRICE_DB_CM_CLASS, pdb_dialog);
+    LEAVE(" ");
 }
 
 void
 gnc_prices_dialog_edit_clicked (GtkWidget *widget, gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
-  GList *price_list;
+    PricesDialog *pdb_dialog = data;
+    GList *price_list;
 
-  ENTER(" ");
-  price_list = gnc_tree_view_price_get_selected_prices(pdb_dialog->price_tree);
-  if (!price_list) {
-    LEAVE("no price selected");
-    return;
-  }
-  if (g_list_next(price_list)) {
+    ENTER(" ");
+    price_list = gnc_tree_view_price_get_selected_prices(pdb_dialog->price_tree);
+    if (!price_list)
+    {
+        LEAVE("no price selected");
+        return;
+    }
+    if (g_list_next(price_list))
+    {
+        g_list_free(price_list);
+        LEAVE("too many prices selected");
+        return;
+    }
+
+    gnc_price_edit_dialog (pdb_dialog->dialog, pdb_dialog->session,
+                           price_list->data, GNC_PRICE_EDIT);
     g_list_free(price_list);
-    LEAVE("too many prices selected");
-    return;
-  }
-
-  gnc_price_edit_dialog (pdb_dialog->dialog, pdb_dialog->session,
-			 price_list->data, GNC_PRICE_EDIT);
-  g_list_free(price_list);
-  LEAVE(" ");
+    LEAVE(" ");
 }
 
 static void
 remove_helper(GNCPrice *price, GNCPriceDB *pdb)
 {
-  gnc_pricedb_remove_price (pdb, price);
+    gnc_pricedb_remove_price (pdb, price);
 }
 
 void
 gnc_prices_dialog_remove_clicked (GtkWidget *widget, gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
-  GList *price_list;
-  gint length, response;
-  GtkWidget *dialog;
+    PricesDialog *pdb_dialog = data;
+    GList *price_list;
+    gint length, response;
+    GtkWidget *dialog;
 
-  ENTER(" ");
-  price_list = gnc_tree_view_price_get_selected_prices(pdb_dialog->price_tree);
-  if (!price_list) {
-    LEAVE("no price selected");
-    return;
-  }
+    ENTER(" ");
+    price_list = gnc_tree_view_price_get_selected_prices(pdb_dialog->price_tree);
+    if (!price_list)
+    {
+        LEAVE("no price selected");
+        return;
+    }
 
-  length = g_list_length(price_list);
-  if (length > 1) {
-    gchar *message;
+    length = g_list_length(price_list);
+    if (length > 1)
+    {
+        gchar *message;
 
-    message = g_strdup_printf
-      (/* Translators: %d is the number of prices. This
+        message = g_strdup_printf
+                  (/* Translators: %d is the number of prices. This
 	  is a ngettext(3) message. */
-       ngettext("Are you sure you want to delete the %d selected price?",
-		"Are you sure you want to delete the %d selected prices?",
-		length),
-       length);
-    dialog = gtk_message_dialog_new(GTK_WINDOW(pdb_dialog->dialog),
-				    GTK_DIALOG_DESTROY_WITH_PARENT,
-				    GTK_MESSAGE_QUESTION,
-				    GTK_BUTTONS_NONE,
-				    "%s", _("Delete prices?"));
-    gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-					     "%s", message);
-    g_free(message);
-    gtk_dialog_add_buttons(GTK_DIALOG(dialog),
-			   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-			   GTK_STOCK_DELETE, GTK_RESPONSE_YES,
-			   (gchar *)NULL);
-    gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES);
-    response = gnc_dialog_run(GTK_DIALOG(dialog), "pricedb_remove_multiple");
-    gtk_widget_destroy(dialog);
-  } else {
-    response = GTK_RESPONSE_YES;
-  }
+                      ngettext("Are you sure you want to delete the %d selected price?",
+                               "Are you sure you want to delete the %d selected prices?",
+                               length),
+                      length);
+        dialog = gtk_message_dialog_new(GTK_WINDOW(pdb_dialog->dialog),
+                                        GTK_DIALOG_DESTROY_WITH_PARENT,
+                                        GTK_MESSAGE_QUESTION,
+                                        GTK_BUTTONS_NONE,
+                                        "%s", _("Delete prices?"));
+        gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+                "%s", message);
+        g_free(message);
+        gtk_dialog_add_buttons(GTK_DIALOG(dialog),
+                               GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                               GTK_STOCK_DELETE, GTK_RESPONSE_YES,
+                               (gchar *)NULL);
+        gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES);
+        response = gnc_dialog_run(GTK_DIALOG(dialog), "pricedb_remove_multiple");
+        gtk_widget_destroy(dialog);
+    }
+    else
+    {
+        response = GTK_RESPONSE_YES;
+    }
 
-  if (response == GTK_RESPONSE_YES) {
-    g_list_foreach(price_list, (GFunc)remove_helper, pdb_dialog->price_db);
-  }
-  g_list_free(price_list);
-  LEAVE(" ");
+    if (response == GTK_RESPONSE_YES)
+    {
+        g_list_foreach(price_list, (GFunc)remove_helper, pdb_dialog->price_db);
+    }
+    g_list_free(price_list);
+    LEAVE(" ");
 }
 
 void
 gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
-  GladeXML *xml;
-  GtkWidget *dialog, *button, *date, *label;
-  gint result;
-  gboolean delete_user, delete_last;
+    PricesDialog *pdb_dialog = data;
+    GladeXML *xml;
+    GtkWidget *dialog, *button, *date, *label;
+    gint result;
+    gboolean delete_user, delete_last;
 
-  ENTER(" ");
-  xml = gnc_glade_xml_new ("price.glade", "Deletion Date");
-  dialog = glade_xml_get_widget (xml, "Deletion Date");
-  date = glade_xml_get_widget (xml, "date");
-  label = glade_xml_get_widget (xml, "date_label");
-  gnc_date_make_mnemonic_target (GNC_DATE_EDIT(date), label);
-  glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, pdb_dialog);
-  gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (pdb_dialog->dialog));
+    ENTER(" ");
+    xml = gnc_glade_xml_new ("price.glade", "Deletion Date");
+    dialog = glade_xml_get_widget (xml, "Deletion Date");
+    date = glade_xml_get_widget (xml, "date");
+    label = glade_xml_get_widget (xml, "date_label");
+    gnc_date_make_mnemonic_target (GNC_DATE_EDIT(date), label);
+    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, pdb_dialog);
+    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (pdb_dialog->dialog));
 
-  result = gtk_dialog_run (GTK_DIALOG (dialog));
-  if (result == GTK_RESPONSE_OK)
-  {
-    Timespec ts;
+    result = gtk_dialog_run (GTK_DIALOG (dialog));
+    if (result == GTK_RESPONSE_OK)
+    {
+        Timespec ts;
 
-    DEBUG("deleting prices");
-    ts.tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (date));
-    ts.tv_nsec = 0;
+        DEBUG("deleting prices");
+        ts.tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (date));
+        ts.tv_nsec = 0;
 
-    button = glade_xml_get_widget (xml, "delete_manual");
-    delete_user = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
-    button = glade_xml_get_widget (xml, "delete_last");
-    delete_last = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
+        button = glade_xml_get_widget (xml, "delete_manual");
+        delete_user = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
+        button = glade_xml_get_widget (xml, "delete_last");
+        delete_last = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
 
-    gnc_pricedb_remove_old_prices(pdb_dialog->price_db, ts,
-				  delete_user, delete_last);
-  }
+        gnc_pricedb_remove_old_prices(pdb_dialog->price_db, ts,
+                                      delete_user, delete_last);
+    }
 
-  gtk_widget_destroy(dialog);
-  LEAVE(" ");
+    gtk_widget_destroy(dialog);
+    LEAVE(" ");
 }
 
 void
 gnc_prices_dialog_add_clicked (GtkWidget *widget, gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
-  GNCPrice *price = NULL;
-  GList *price_list;
+    PricesDialog *pdb_dialog = data;
+    GNCPrice *price = NULL;
+    GList *price_list;
 
-  ENTER(" ");
-  price_list = gnc_tree_view_price_get_selected_prices(pdb_dialog->price_tree);
-  if (price_list) {
-    price = price_list->data;
-    g_list_free(price_list);
-  }
-  gnc_price_edit_dialog (pdb_dialog->dialog, pdb_dialog->session,
-			 price, GNC_PRICE_NEW);
-  LEAVE(" ");
+    ENTER(" ");
+    price_list = gnc_tree_view_price_get_selected_prices(pdb_dialog->price_tree);
+    if (price_list)
+    {
+        price = price_list->data;
+        g_list_free(price_list);
+    }
+    gnc_price_edit_dialog (pdb_dialog->dialog, pdb_dialog->session,
+                           price, GNC_PRICE_NEW);
+    LEAVE(" ");
 }
 
 void
 gnc_prices_dialog_get_quotes_clicked (GtkWidget *widget, gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
-  SCM quotes_func;
-  SCM book_scm;
-  SCM scm_window;
+    PricesDialog *pdb_dialog = data;
+    SCM quotes_func;
+    SCM book_scm;
+    SCM scm_window;
 
-  ENTER(" ");
-  quotes_func = scm_c_eval_string ("gnc:book-add-quotes");
-  if (!scm_is_procedure (quotes_func)) {
-    LEAVE(" no procedure");
-    return;
-  }
+    ENTER(" ");
+    quotes_func = scm_c_eval_string ("gnc:book-add-quotes");
+    if (!scm_is_procedure (quotes_func))
+    {
+        LEAVE(" no procedure");
+        return;
+    }
 
-  book_scm = gnc_book_to_scm (pdb_dialog->book);
-  if (scm_is_true (scm_not (book_scm))) {
-    LEAVE("no book");
-    return;
-  }
+    book_scm = gnc_book_to_scm (pdb_dialog->book);
+    if (scm_is_true (scm_not (book_scm)))
+    {
+        LEAVE("no book");
+        return;
+    }
 
-  scm_window =  SWIG_NewPointerObj(pdb_dialog->dialog,
-                                   SWIG_TypeQuery("_p_GtkWidget"), 0);
+    scm_window =  SWIG_NewPointerObj(pdb_dialog->dialog,
+                                     SWIG_TypeQuery("_p_GtkWidget"), 0);
 
-  gnc_set_busy_cursor (NULL, TRUE);
-  scm_call_2 (quotes_func, scm_window, book_scm);
-  gnc_unset_busy_cursor (NULL);
+    gnc_set_busy_cursor (NULL, TRUE);
+    scm_call_2 (quotes_func, scm_window, book_scm);
+    gnc_unset_busy_cursor (NULL);
 
-  /* Without this, the summary bar on the accounts tab
-   * won't reflect the new prices (bug #522095). */
-  gnc_gui_refresh_all ();
+    /* Without this, the summary bar on the accounts tab
+     * won't reflect the new prices (bug #522095). */
+    gnc_gui_refresh_all ();
 
-  LEAVE(" ");
+    LEAVE(" ");
 }
 
 
 static void
 gnc_prices_dialog_selection_changed (GtkTreeSelection *treeselection,
-				     gpointer data)
+                                     gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
-  GList *price_list;
-  gint length;
+    PricesDialog *pdb_dialog = data;
+    GList *price_list;
+    gint length;
 
-  ENTER(" ");
-  price_list = gnc_tree_view_price_get_selected_prices(pdb_dialog->price_tree);
-  length = g_list_length(price_list);
+    ENTER(" ");
+    price_list = gnc_tree_view_price_get_selected_prices(pdb_dialog->price_tree);
+    length = g_list_length(price_list);
 
-  gtk_widget_set_sensitive (pdb_dialog->edit_button,
-                            length == 1);
-  gtk_widget_set_sensitive (pdb_dialog->remove_button,
-                            length >= 1);
-  LEAVE("%d prices selected", length);
+    gtk_widget_set_sensitive (pdb_dialog->edit_button,
+                              length == 1);
+    gtk_widget_set_sensitive (pdb_dialog->remove_button,
+                              length >= 1);
+    LEAVE("%d prices selected", length);
 }
 
 
 static gboolean
 gnc_price_dialog_filter_ns_func (gnc_commodity_namespace *namespace,
-				 gpointer data)
+                                 gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
-  const gchar *name;
-  static GList *cm_list;
-  GList *item;
+    PricesDialog *pdb_dialog = data;
+    const gchar *name;
+    static GList *cm_list;
+    GList *item;
 
-  /* Never show the template list */
-  name = gnc_commodity_namespace_get_name (namespace);
-  if (safe_strcmp (name, "template") == 0)
-    return FALSE;
+    /* Never show the template list */
+    name = gnc_commodity_namespace_get_name (namespace);
+    if (safe_strcmp (name, "template") == 0)
+        return FALSE;
 
-  /* See if this namespace has commodities */
-  cm_list = gnc_commodity_namespace_get_commodity_list(namespace);
-  for (item = cm_list; item; item = g_list_next(item)) {
+    /* See if this namespace has commodities */
+    cm_list = gnc_commodity_namespace_get_commodity_list(namespace);
+    for (item = cm_list; item; item = g_list_next(item))
+    {
 
-    /* For each commodity, see if there are prices */
-    if (gnc_pricedb_has_prices(pdb_dialog->price_db, item->data, NULL)) {
-      return TRUE;
+        /* For each commodity, see if there are prices */
+        if (gnc_pricedb_has_prices(pdb_dialog->price_db, item->data, NULL))
+        {
+            return TRUE;
+        }
     }
-  }
 
-  //  printf("Namespace %s not visible\n", name);
-  return FALSE;
+    //  printf("Namespace %s not visible\n", name);
+    return FALSE;
 }
 
 static gboolean
 gnc_price_dialog_filter_cm_func (gnc_commodity *commodity,
-				 gpointer data)
+                                 gpointer data)
 {
-  PricesDialog *pdb_dialog = data;
+    PricesDialog *pdb_dialog = data;
 
-  /* Show any commodity that has prices */
-  return gnc_pricedb_has_prices(pdb_dialog->price_db, commodity, NULL);
+    /* Show any commodity that has prices */
+    return gnc_pricedb_has_prices(pdb_dialog->price_db, commodity, NULL);
 }
 
 static void
 row_activated_cb (GtkTreeView *view, GtkTreePath *path,
-		  GtkTreeViewColumn *column, gpointer data)
+                  GtkTreeViewColumn *column, gpointer data)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-  g_return_if_fail(view);
+    g_return_if_fail(view);
 
-  model = gtk_tree_view_get_model(view);
-  if (gtk_tree_model_get_iter(model, &iter, path))
-  {
-    if (gtk_tree_model_iter_has_child(model, &iter))
+    model = gtk_tree_view_get_model(view);
+    if (gtk_tree_model_get_iter(model, &iter, path))
     {
-      /* There are children, so it's not a price.
-       * Just expand or collapse the row. */
-      if (gtk_tree_view_row_expanded(view, path))
-        gtk_tree_view_collapse_row(view, path);
-      else
-        gtk_tree_view_expand_row(view, path, FALSE);
+        if (gtk_tree_model_iter_has_child(model, &iter))
+        {
+            /* There are children, so it's not a price.
+             * Just expand or collapse the row. */
+            if (gtk_tree_view_row_expanded(view, path))
+                gtk_tree_view_collapse_row(view, path);
+            else
+                gtk_tree_view_expand_row(view, path, FALSE);
+        }
+        else
+            /* It's a price, so click the Edit button. */
+            gnc_prices_dialog_edit_clicked(GTK_WIDGET(view), data);
     }
-    else
-      /* It's a price, so click the Edit button. */
-      gnc_prices_dialog_edit_clicked(GTK_WIDGET(view), data);
-  }
 }
 
 static void
 gnc_prices_dialog_create (GtkWidget * parent, PricesDialog *pdb_dialog)
 {
-  GtkWidget *dialog, *scrolled_window;
-  GladeXML *xml;
-  GtkTreeView *view;
-  GtkTreeSelection *selection;
+    GtkWidget *dialog, *scrolled_window;
+    GladeXML *xml;
+    GtkTreeView *view;
+    GtkTreeSelection *selection;
 
-  ENTER(" ");
-  xml = gnc_glade_xml_new ("price.glade", "Prices Dialog");
+    ENTER(" ");
+    xml = gnc_glade_xml_new ("price.glade", "Prices Dialog");
 
-  dialog = glade_xml_get_widget (xml, "Prices Dialog");
-  pdb_dialog->dialog = dialog;
+    dialog = glade_xml_get_widget (xml, "Prices Dialog");
+    pdb_dialog->dialog = dialog;
 
-  pdb_dialog->session = gnc_get_current_session();
-  pdb_dialog->book = qof_session_get_book(pdb_dialog->session);
-  pdb_dialog->price_db = gnc_pricedb_get_db(pdb_dialog->book);
+    pdb_dialog->session = gnc_get_current_session();
+    pdb_dialog->book = qof_session_get_book(pdb_dialog->session);
+    pdb_dialog->price_db = gnc_pricedb_get_db(pdb_dialog->book);
 
-  glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, pdb_dialog);
+    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, pdb_dialog);
 
-  /* parent */
-  if (parent != NULL)
-    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+    /* parent */
+    if (parent != NULL)
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
 
-  /* default to 'close' button */
-  gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
+    /* default to 'close' button */
+    gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
 
-  /* price tree */
-  scrolled_window = glade_xml_get_widget (xml, "price_list_window");
-  view = gnc_tree_view_price_new(pdb_dialog->book,
-				 "gconf-section", GCONF_SECTION,
-				 "show-column-menu", TRUE,
-				 NULL);
-  pdb_dialog->price_tree = GNC_TREE_VIEW_PRICE(view);
-  gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET(view));
-  gnc_tree_view_price_set_filter (pdb_dialog->price_tree,
-				  gnc_price_dialog_filter_ns_func,
-				  gnc_price_dialog_filter_cm_func,
-				  NULL,
-				  pdb_dialog, NULL);
+    /* price tree */
+    scrolled_window = glade_xml_get_widget (xml, "price_list_window");
+    view = gnc_tree_view_price_new(pdb_dialog->book,
+                                   "gconf-section", GCONF_SECTION,
+                                   "show-column-menu", TRUE,
+                                   NULL);
+    pdb_dialog->price_tree = GNC_TREE_VIEW_PRICE(view);
+    gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET(view));
+    gnc_tree_view_price_set_filter (pdb_dialog->price_tree,
+                                    gnc_price_dialog_filter_ns_func,
+                                    gnc_price_dialog_filter_cm_func,
+                                    NULL,
+                                    pdb_dialog, NULL);
 
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
-  gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
-  g_signal_connect (G_OBJECT (selection), "changed",
-		    G_CALLBACK (gnc_prices_dialog_selection_changed), pdb_dialog);
+    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
+    gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
+    g_signal_connect (G_OBJECT (selection), "changed",
+                      G_CALLBACK (gnc_prices_dialog_selection_changed), pdb_dialog);
 
-  g_signal_connect (G_OBJECT (view), "row-activated",
-                    G_CALLBACK (row_activated_cb), pdb_dialog);
+    g_signal_connect (G_OBJECT (view), "row-activated",
+                      G_CALLBACK (row_activated_cb), pdb_dialog);
 
-  /* buttons */
-  {
-    GtkWidget *button;
+    /* buttons */
+    {
+        GtkWidget *button;
 
-    button = glade_xml_get_widget (xml, "edit_button");
-    pdb_dialog->edit_button = button;
+        button = glade_xml_get_widget (xml, "edit_button");
+        pdb_dialog->edit_button = button;
 
-    button = glade_xml_get_widget (xml, "remove_button");
-    pdb_dialog->remove_button = button;
+        button = glade_xml_get_widget (xml, "remove_button");
+        pdb_dialog->remove_button = button;
 
-    if (!gnc_quote_source_fq_installed()) {
-      button = glade_xml_get_widget (xml, "get_quotes_button");
-      gtk_widget_set_sensitive(button, FALSE);
+        if (!gnc_quote_source_fq_installed())
+        {
+            button = glade_xml_get_widget (xml, "get_quotes_button");
+            gtk_widget_set_sensitive(button, FALSE);
+        }
     }
-  }
 
-  gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pdb_dialog->dialog));
-  LEAVE(" ");
+    gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pdb_dialog->dialog));
+    LEAVE(" ");
 }
 
 static void
 close_handler (gpointer user_data)
 {
-  PricesDialog *pdb_dialog = user_data;
+    PricesDialog *pdb_dialog = user_data;
 
-  ENTER(" ");
-  gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(pdb_dialog->dialog));
+    ENTER(" ");
+    gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(pdb_dialog->dialog));
 
-  gtk_widget_destroy (GTK_WIDGET (pdb_dialog->dialog));
-  LEAVE(" ");
+    gtk_widget_destroy (GTK_WIDGET (pdb_dialog->dialog));
+    LEAVE(" ");
 }
 
 static void
 refresh_handler (GHashTable *changes, gpointer user_data)
 {
-  ENTER(" ");
-  LEAVE(" ");
+    ENTER(" ");
+    LEAVE(" ");
 }
 
 static gboolean
 show_handler (const char *class, gint component_id,
-	      gpointer user_data, gpointer iter_data)
+              gpointer user_data, gpointer iter_data)
 {
-  PricesDialog *pdb_dialog = user_data;
+    PricesDialog *pdb_dialog = user_data;
 
-  ENTER(" ");
-  if (!pdb_dialog) {
-    LEAVE("no data strucure");
-    return(FALSE);
-  }
+    ENTER(" ");
+    if (!pdb_dialog)
+    {
+        LEAVE("no data strucure");
+        return(FALSE);
+    }
 
-  gtk_window_present (GTK_WINDOW(pdb_dialog->dialog));
-  LEAVE(" ");
-  return(TRUE);
+    gtk_window_present (GTK_WINDOW(pdb_dialog->dialog));
+    LEAVE(" ");
+    return(TRUE);
 }
 
 /********************************************************************\
  * gnc_prices_dialog                                                *
  *   opens up a window showing all price information                *
- *                                                                  * 
+ *                                                                  *
  * Args:   parent  - the parent of the window to be created         *
  * Return: nothing                                                  *
 \********************************************************************/
 void
 gnc_prices_dialog (GtkWidget * parent)
 {
-  PricesDialog *pdb_dialog;
-  gint component_id;
+    PricesDialog *pdb_dialog;
+    gint component_id;
 
-  ENTER(" ");
-  if (gnc_forall_gui_components (DIALOG_PRICE_DB_CM_CLASS, show_handler, NULL)) {
-      LEAVE("existing dialog raised");
-      return;
-  }
+    ENTER(" ");
+    if (gnc_forall_gui_components (DIALOG_PRICE_DB_CM_CLASS, show_handler, NULL))
+    {
+        LEAVE("existing dialog raised");
+        return;
+    }
 
-  pdb_dialog = g_new0 (PricesDialog, 1);
+    pdb_dialog = g_new0 (PricesDialog, 1);
 
-  gnc_prices_dialog_create (parent, pdb_dialog);
+    gnc_prices_dialog_create (parent, pdb_dialog);
 
-  component_id = gnc_register_gui_component (DIALOG_PRICE_DB_CM_CLASS,
-                                             refresh_handler, close_handler,
-                                             pdb_dialog);
-  gnc_gui_component_set_session (component_id, pdb_dialog->session);
+    component_id = gnc_register_gui_component (DIALOG_PRICE_DB_CM_CLASS,
+                   refresh_handler, close_handler,
+                   pdb_dialog);
+    gnc_gui_component_set_session (component_id, pdb_dialog->session);
 
-  gtk_widget_grab_focus (GTK_WIDGET(pdb_dialog->price_tree));
+    gtk_widget_grab_focus (GTK_WIDGET(pdb_dialog->price_tree));
 
-  gtk_widget_show (pdb_dialog->dialog);
-  LEAVE(" ");
+    gtk_widget_show (pdb_dialog->dialog);
+    LEAVE(" ");
 }

Modified: gnucash/trunk/src/gnome/dialog-price-editor.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-price-editor.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-price-editor.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -56,27 +56,27 @@
 
 typedef struct
 {
-  GtkWidget * dialog;
-  QofSession *session;
-  QofBook *book;
-  GNCPriceDB *price_db;
-  GNCPriceEditType type;
+    GtkWidget * dialog;
+    QofSession *session;
+    QofBook *book;
+    GNCPriceDB *price_db;
+    GNCPriceEditType type;
 
-  GtkWidget * namespace_cbe;
-  GtkWidget * commodity_cbe;
-  GtkWidget * currency_edit;
-  GtkWidget * date_edit;
-  GtkWidget * source_entry;
-  GtkWidget * type_combobox;
-  GtkWidget * price_edit;
+    GtkWidget * namespace_cbe;
+    GtkWidget * commodity_cbe;
+    GtkWidget * currency_edit;
+    GtkWidget * date_edit;
+    GtkWidget * source_entry;
+    GtkWidget * type_combobox;
+    GtkWidget * price_edit;
 
-  GtkWidget * cancel_button;
-  GtkWidget * apply_button;
-  GtkWidget * ok_button;
+    GtkWidget * cancel_button;
+    GtkWidget * apply_button;
+    GtkWidget * ok_button;
 
-  GNCPrice *price;
-  gboolean changed;
-  gboolean new;
+    GNCPrice *price;
+    gboolean changed;
+    gboolean new;
 
 } PriceEditDialog;
 
@@ -89,398 +89,412 @@
 static void
 gnc_prices_set_changed (PriceEditDialog *pedit_dialog, gboolean changed)
 {
-  pedit_dialog->changed = changed;
+    pedit_dialog->changed = changed;
 
-  gtk_widget_set_sensitive (pedit_dialog->apply_button, changed);
+    gtk_widget_set_sensitive (pedit_dialog->apply_button, changed);
 }
 
 static int
 type_string_to_index (const char *type)
 {
-  if (safe_strcmp (type, "bid") == 0)
-    return 0;
+    if (safe_strcmp (type, "bid") == 0)
+        return 0;
 
-  if (safe_strcmp (type, "ask") == 0)
-    return 1;
+    if (safe_strcmp (type, "ask") == 0)
+        return 1;
 
-  if (safe_strcmp (type, "last") == 0)
-    return 2;
+    if (safe_strcmp (type, "last") == 0)
+        return 2;
 
-  if (safe_strcmp (type, "nav") == 0)
-    return 3;
+    if (safe_strcmp (type, "nav") == 0)
+        return 3;
 
-  return 4;
+    return 4;
 }
 
 static const char *
 type_index_to_string (int index)
 {
-  switch (index)
-  {
-    case 0: return "bid";
-    case 1: return "ask";
-    case 2: return "last";
-    case 3: return "nav";
-    default: return "unknown";
-  }
+    switch (index)
+    {
+    case 0:
+        return "bid";
+    case 1:
+        return "ask";
+    case 2:
+        return "last";
+    case 3:
+        return "nav";
+    default:
+        return "unknown";
+    }
 }
 
 static void
 price_to_gui (PriceEditDialog *pedit_dialog)
 {
-  gnc_commodity *commodity = NULL;
-  gnc_commodity *currency = NULL;
-  const gchar *namespace, *fullname;
-  const char *source;
-  const char *type;
-  gnc_numeric value;
-  Timespec date;
+    gnc_commodity *commodity = NULL;
+    gnc_commodity *currency = NULL;
+    const gchar *namespace, *fullname;
+    const char *source;
+    const char *type;
+    gnc_numeric value;
+    Timespec date;
 
-  if (pedit_dialog->price) {
-    commodity = gnc_price_get_commodity (pedit_dialog->price);
-  }
+    if (pedit_dialog->price)
+    {
+        commodity = gnc_price_get_commodity (pedit_dialog->price);
+    }
 
-  if (commodity) {
-    namespace = gnc_commodity_get_namespace(commodity);
-    fullname = gnc_commodity_get_printname(commodity);
-    gnc_ui_update_namespace_picker(pedit_dialog->namespace_cbe,
-                                   namespace, DIAG_COMM_NON_CURRENCY);
-    gnc_ui_update_commodity_picker(pedit_dialog->commodity_cbe,
-                                   namespace, fullname);
+    if (commodity)
+    {
+        namespace = gnc_commodity_get_namespace(commodity);
+        fullname = gnc_commodity_get_printname(commodity);
+        gnc_ui_update_namespace_picker(pedit_dialog->namespace_cbe,
+                                       namespace, DIAG_COMM_NON_CURRENCY);
+        gnc_ui_update_commodity_picker(pedit_dialog->commodity_cbe,
+                                       namespace, fullname);
 
-    currency = gnc_price_get_currency (pedit_dialog->price);
-    date = gnc_price_get_time (pedit_dialog->price);
-    source = gnc_price_get_source (pedit_dialog->price);
-    type = gnc_price_get_typestr (pedit_dialog->price);
-    value = gnc_price_get_value (pedit_dialog->price);
-  }
-  else {
-    currency = gnc_default_currency ();
-    date.tv_sec = time (NULL);
-    date.tv_nsec = 0;
-    source = DIALOG_PRICE_EDIT_SOURCE;
-    type = "";
-    value = gnc_numeric_zero ();
-  }
+        currency = gnc_price_get_currency (pedit_dialog->price);
+        date = gnc_price_get_time (pedit_dialog->price);
+        source = gnc_price_get_source (pedit_dialog->price);
+        type = gnc_price_get_typestr (pedit_dialog->price);
+        value = gnc_price_get_value (pedit_dialog->price);
+    }
+    else
+    {
+        currency = gnc_default_currency ();
+        date.tv_sec = time (NULL);
+        date.tv_nsec = 0;
+        source = DIALOG_PRICE_EDIT_SOURCE;
+        type = "";
+        value = gnc_numeric_zero ();
+    }
 
 
-  if (currency) {
-    gnc_currency_edit_set_currency
-      (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit), currency);
-  }
+    if (currency)
+    {
+        gnc_currency_edit_set_currency
+        (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit), currency);
+    }
 
-  gnc_date_edit_set_time (GNC_DATE_EDIT (pedit_dialog->date_edit), date.tv_sec);
+    gnc_date_edit_set_time (GNC_DATE_EDIT (pedit_dialog->date_edit), date.tv_sec);
 
-  gtk_entry_set_text (GTK_ENTRY (pedit_dialog->source_entry), source);
+    gtk_entry_set_text (GTK_ENTRY (pedit_dialog->source_entry), source);
 
-  gtk_combo_box_set_active (GTK_COMBO_BOX(pedit_dialog->type_combobox),
-			    type_string_to_index (type));
+    gtk_combo_box_set_active (GTK_COMBO_BOX(pedit_dialog->type_combobox),
+                              type_string_to_index (type));
 
-  gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), value);
+    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), value);
 }
 
 static const char *
 gui_to_price (PriceEditDialog *pedit_dialog)
 {
-  gnc_commodity *commodity;
-  gnc_commodity *currency;
-  gchar *namespace, *fullname;
-  const char *source;
-  const char *type;
-  gnc_numeric value;
-  Timespec date;
+    gnc_commodity *commodity;
+    gnc_commodity *currency;
+    gchar *namespace, *fullname;
+    const char *source;
+    const char *type;
+    gnc_numeric value;
+    Timespec date;
 
-  namespace = gnc_ui_namespace_picker_ns (pedit_dialog->namespace_cbe);
-  fullname = gtk_combo_box_get_active_text(GTK_COMBO_BOX(pedit_dialog->commodity_cbe));
-  commodity = gnc_commodity_table_find_full(gnc_get_current_commodities(), namespace, fullname);
-  if (!commodity)
-    return _("You must select a commodity.");
+    namespace = gnc_ui_namespace_picker_ns (pedit_dialog->namespace_cbe);
+    fullname = gtk_combo_box_get_active_text(GTK_COMBO_BOX(pedit_dialog->commodity_cbe));
+    commodity = gnc_commodity_table_find_full(gnc_get_current_commodities(), namespace, fullname);
+    if (!commodity)
+        return _("You must select a commodity.");
 
-  currency = gnc_currency_edit_get_currency
-    (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit));
-  if (!currency)
-    return _("You must select a currency.");
+    currency = gnc_currency_edit_get_currency
+               (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit));
+    if (!currency)
+        return _("You must select a currency.");
 
-  date.tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (pedit_dialog->date_edit));
-  date.tv_nsec = 0;
+    date.tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (pedit_dialog->date_edit));
+    date.tv_nsec = 0;
 
-  source = gtk_entry_get_text (GTK_ENTRY (pedit_dialog->source_entry));
+    source = gtk_entry_get_text (GTK_ENTRY (pedit_dialog->source_entry));
 
-  type = type_index_to_string
-    (gtk_combo_box_get_active (GTK_COMBO_BOX (pedit_dialog->type_combobox)));
+    type = type_index_to_string
+           (gtk_combo_box_get_active (GTK_COMBO_BOX (pedit_dialog->type_combobox)));
 
-  if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (pedit_dialog->price_edit)))
-    return _("You must enter a valid amount.");
+    if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (pedit_dialog->price_edit)))
+        return _("You must enter a valid amount.");
 
-  value = gnc_amount_edit_get_amount
-    (GNC_AMOUNT_EDIT (pedit_dialog->price_edit));
+    value = gnc_amount_edit_get_amount
+            (GNC_AMOUNT_EDIT (pedit_dialog->price_edit));
 
-  if (!pedit_dialog->price)
-      pedit_dialog->price = gnc_price_create (pedit_dialog->book);
-  gnc_price_begin_edit (pedit_dialog->price);
-  gnc_price_set_commodity (pedit_dialog->price, commodity);
-  gnc_price_set_currency (pedit_dialog->price, currency);
-  gnc_price_set_time (pedit_dialog->price, date);
-  gnc_price_set_source (pedit_dialog->price, source);
-  gnc_price_set_typestr (pedit_dialog->price, type);
-  gnc_price_set_value (pedit_dialog->price, value);
-  gnc_price_commit_edit (pedit_dialog->price);
+    if (!pedit_dialog->price)
+        pedit_dialog->price = gnc_price_create (pedit_dialog->book);
+    gnc_price_begin_edit (pedit_dialog->price);
+    gnc_price_set_commodity (pedit_dialog->price, commodity);
+    gnc_price_set_currency (pedit_dialog->price, currency);
+    gnc_price_set_time (pedit_dialog->price, date);
+    gnc_price_set_source (pedit_dialog->price, source);
+    gnc_price_set_typestr (pedit_dialog->price, type);
+    gnc_price_set_value (pedit_dialog->price, value);
+    gnc_price_commit_edit (pedit_dialog->price);
 
-  g_free(namespace);
-  g_free(fullname);
+    g_free(namespace);
+    g_free(fullname);
 
-  return NULL;
+    return NULL;
 }
 
 static void
 pedit_dialog_destroy_cb (GtkWidget *widget, gpointer data)
 {
-  PriceEditDialog *pedit_dialog = data;
+    PriceEditDialog *pedit_dialog = data;
 
-  gnc_unregister_gui_component_by_data (DIALOG_PRICE_EDIT_CM_CLASS,
-					pedit_dialog);
+    gnc_unregister_gui_component_by_data (DIALOG_PRICE_EDIT_CM_CLASS,
+                                          pedit_dialog);
 
-  if (pedit_dialog->price)
-  {
-    gnc_price_unref (pedit_dialog->price);
-    pedit_dialog->price = NULL;
-    pedit_dialog->new = FALSE;
-  }
+    if (pedit_dialog->price)
+    {
+        gnc_price_unref (pedit_dialog->price);
+        pedit_dialog->price = NULL;
+        pedit_dialog->new = FALSE;
+    }
 
-  g_free (pedit_dialog);
+    g_free (pedit_dialog);
 }
 
 void
 pedit_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
 {
-  PriceEditDialog *pedit_dialog = data;
-  GNCPrice *new_price = NULL;
-  const char *error_str;
+    PriceEditDialog *pedit_dialog = data;
+    GNCPrice *new_price = NULL;
+    const char *error_str;
 
-  if ((response == GTK_RESPONSE_OK) || (response == GTK_RESPONSE_APPLY)) {
-    error_str = gui_to_price (pedit_dialog);
-    if (error_str) {
-      gnc_warning_dialog (pedit_dialog->dialog, "%s", error_str);
-      return;
-    }
+    if ((response == GTK_RESPONSE_OK) || (response == GTK_RESPONSE_APPLY))
+    {
+        error_str = gui_to_price (pedit_dialog);
+        if (error_str)
+        {
+            gnc_warning_dialog (pedit_dialog->dialog, "%s", error_str);
+            return;
+        }
 
-    gnc_prices_set_changed (pedit_dialog, FALSE);
-    if (TRUE == pedit_dialog->new) {
-      gnc_pricedb_add_price (pedit_dialog->price_db, pedit_dialog->price);
+        gnc_prices_set_changed (pedit_dialog, FALSE);
+        if (TRUE == pedit_dialog->new)
+        {
+            gnc_pricedb_add_price (pedit_dialog->price_db, pedit_dialog->price);
+        }
+
+        gnc_gui_refresh_all ();
     }
 
-    gnc_gui_refresh_all ();
-  }
+    if (response == GTK_RESPONSE_APPLY)
+    {
+        new_price = gnc_price_clone (pedit_dialog->price, pedit_dialog->book);
+        pedit_dialog->new = TRUE;
 
-  if(response == GTK_RESPONSE_APPLY) {
-    new_price = gnc_price_clone (pedit_dialog->price, pedit_dialog->book);
-    pedit_dialog->new = TRUE;
-
-    gnc_price_unref (pedit_dialog->price);
-    pedit_dialog->price = new_price;
-  }
-  else {
-    gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(pedit_dialog->dialog));
-    gtk_widget_destroy (GTK_WIDGET (pedit_dialog->dialog));
-    pedit_dialog_destroy_cb (NULL, pedit_dialog);
-  }
+        gnc_price_unref (pedit_dialog->price);
+        pedit_dialog->price = new_price;
+    }
+    else
+    {
+        gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(pedit_dialog->dialog));
+        gtk_widget_destroy (GTK_WIDGET (pedit_dialog->dialog));
+        pedit_dialog_destroy_cb (NULL, pedit_dialog);
+    }
 }
 
 void
 pedit_commodity_ns_changed_cb (GtkComboBoxEntry *cbe, gpointer data)
 {
-  PriceEditDialog *pedit_dialog = data;
-  gchar *namespace;
+    PriceEditDialog *pedit_dialog = data;
+    gchar *namespace;
 
-  gnc_prices_set_changed (pedit_dialog, TRUE);
+    gnc_prices_set_changed (pedit_dialog, TRUE);
 
-  namespace = gnc_ui_namespace_picker_ns (pedit_dialog->namespace_cbe);
-  gnc_ui_update_commodity_picker (pedit_dialog->commodity_cbe, namespace, NULL);
+    namespace = gnc_ui_namespace_picker_ns (pedit_dialog->namespace_cbe);
+    gnc_ui_update_commodity_picker (pedit_dialog->commodity_cbe, namespace, NULL);
 
-  g_free(namespace);
+    g_free(namespace);
 }
 
 void
 pedit_commodity_changed_cb (GtkComboBoxEntry *cbe, gpointer data)
 {
-  gnc_commodity *commodity = NULL;
-  gnc_commodity *currency = NULL;
-  gchar *namespace, *fullname;
-  GList *price_list;
-  PriceEditDialog *pedit_dialog = data;
+    gnc_commodity *commodity = NULL;
+    gnc_commodity *currency = NULL;
+    gchar *namespace, *fullname;
+    GList *price_list;
+    PriceEditDialog *pedit_dialog = data;
 
-  gnc_prices_set_changed (pedit_dialog, TRUE);
+    gnc_prices_set_changed (pedit_dialog, TRUE);
 
-  namespace = gnc_ui_namespace_picker_ns (pedit_dialog->namespace_cbe);
-  fullname = gtk_combo_box_get_active_text(GTK_COMBO_BOX(pedit_dialog->commodity_cbe));
-  commodity = gnc_commodity_table_find_full(gnc_get_current_commodities(), namespace, fullname);
+    namespace = gnc_ui_namespace_picker_ns (pedit_dialog->namespace_cbe);
+    fullname = gtk_combo_box_get_active_text(GTK_COMBO_BOX(pedit_dialog->commodity_cbe));
+    commodity = gnc_commodity_table_find_full(gnc_get_current_commodities(), namespace, fullname);
 
-  if(commodity)
-  {
-    price_list = gnc_pricedb_lookup_latest_any_currency
-      (pedit_dialog->price_db, commodity);
-    if(price_list)
+    if (commodity)
     {
-      currency = gnc_price_get_currency((GNCPrice *)price_list->data);
+        price_list = gnc_pricedb_lookup_latest_any_currency
+                     (pedit_dialog->price_db, commodity);
+        if (price_list)
+        {
+            currency = gnc_price_get_currency((GNCPrice *)price_list->data);
 
-      if (currency)
-	gnc_currency_edit_set_currency
-	  (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit), currency);
+            if (currency)
+                gnc_currency_edit_set_currency
+                (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit), currency);
 
-      gnc_price_list_destroy(price_list);
+            gnc_price_list_destroy(price_list);
+        }
+        else
+        {
+            gnc_currency_edit_set_currency
+            (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit), gnc_default_currency());
+        }
     }
-    else
-    {
-      gnc_currency_edit_set_currency
-	(GNC_CURRENCY_EDIT (pedit_dialog->currency_edit), gnc_default_currency());
-    }
-  }
 
-  g_free(namespace);
-  g_free(fullname);
+    g_free(namespace);
+    g_free(fullname);
 }
 
 void
 pedit_data_changed_cb (GtkWidget *w, gpointer data)
 {
-  PriceEditDialog *pedit_dialog = data;
+    PriceEditDialog *pedit_dialog = data;
 
-  gnc_prices_set_changed (pedit_dialog, TRUE);
+    gnc_prices_set_changed (pedit_dialog, TRUE);
 }
 
 static void
 gnc_price_pedit_dialog_create (GtkWidget *parent,
-			       PriceEditDialog *pedit_dialog,
-			       QofSession *session)
+                               PriceEditDialog *pedit_dialog,
+                               QofSession *session)
 {
-  GladeXML *xml;
-  GNCPrintAmountInfo print_info;
-  GtkWidget *dialog;
-  GtkWidget *entry;
-  GtkWidget *box;
-  GtkWidget *w;
-  GtkWidget *label;
-  gchar *namespace;
+    GladeXML *xml;
+    GNCPrintAmountInfo print_info;
+    GtkWidget *dialog;
+    GtkWidget *entry;
+    GtkWidget *box;
+    GtkWidget *w;
+    GtkWidget *label;
+    gchar *namespace;
 
-  xml = gnc_glade_xml_new ("price.glade", "Price Dialog");
+    xml = gnc_glade_xml_new ("price.glade", "Price Dialog");
 
-  pedit_dialog->session = session;
-  pedit_dialog->book = qof_session_get_book(pedit_dialog->session);
-  pedit_dialog->price_db = gnc_pricedb_get_db(pedit_dialog->book);
+    pedit_dialog->session = session;
+    pedit_dialog->book = qof_session_get_book(pedit_dialog->session);
+    pedit_dialog->price_db = gnc_pricedb_get_db(pedit_dialog->book);
 
-  dialog = glade_xml_get_widget (xml, "Price Dialog");
-  pedit_dialog->dialog = dialog;
+    dialog = glade_xml_get_widget (xml, "Price Dialog");
+    pedit_dialog->dialog = dialog;
 
-  /* parent */
-  if (parent != NULL)
-	  gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+    /* parent */
+    if (parent != NULL)
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
 
-  w = glade_xml_get_widget (xml, "namespace_cbe");
-  pedit_dialog->namespace_cbe = w;
-  gtk_combo_box_remove_text(GTK_COMBO_BOX(pedit_dialog->namespace_cbe), 0);
-  gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(pedit_dialog->namespace_cbe));
-  gnc_ui_update_namespace_picker(w, NULL, DIAG_COMM_ALL);
+    w = glade_xml_get_widget (xml, "namespace_cbe");
+    pedit_dialog->namespace_cbe = w;
+    gtk_combo_box_remove_text(GTK_COMBO_BOX(pedit_dialog->namespace_cbe), 0);
+    gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(pedit_dialog->namespace_cbe));
+    gnc_ui_update_namespace_picker(w, NULL, DIAG_COMM_ALL);
 
-  w = glade_xml_get_widget (xml, "commodity_cbe");
-  pedit_dialog->commodity_cbe = w;
-  gtk_combo_box_remove_text(GTK_COMBO_BOX(pedit_dialog->commodity_cbe), 0);
-  gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(pedit_dialog->commodity_cbe));
-  namespace = gnc_ui_namespace_picker_ns(pedit_dialog->namespace_cbe);
-  gnc_ui_update_commodity_picker(pedit_dialog->commodity_cbe, namespace, NULL);
-  g_free(namespace);
+    w = glade_xml_get_widget (xml, "commodity_cbe");
+    pedit_dialog->commodity_cbe = w;
+    gtk_combo_box_remove_text(GTK_COMBO_BOX(pedit_dialog->commodity_cbe), 0);
+    gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(pedit_dialog->commodity_cbe));
+    namespace = gnc_ui_namespace_picker_ns(pedit_dialog->namespace_cbe);
+    gnc_ui_update_commodity_picker(pedit_dialog->commodity_cbe, namespace, NULL);
+    g_free(namespace);
 
-  box = glade_xml_get_widget (xml, "currency_box");
-  w = gnc_currency_edit_new ();
-  gnc_currency_edit_set_currency (GNC_CURRENCY_EDIT (w),
-                                  gnc_default_currency ());
-  pedit_dialog->currency_edit = w;
-  gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
-  gtk_widget_show (w);
-  g_signal_connect (G_OBJECT (GTK_COMBO_BOX(w)), "changed",
-                    G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
-  label = glade_xml_get_widget (xml, "currency_label");
-  gtk_label_set_mnemonic_widget (GTK_LABEL(label), w);
+    box = glade_xml_get_widget (xml, "currency_box");
+    w = gnc_currency_edit_new ();
+    gnc_currency_edit_set_currency (GNC_CURRENCY_EDIT (w),
+                                    gnc_default_currency ());
+    pedit_dialog->currency_edit = w;
+    gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
+    gtk_widget_show (w);
+    g_signal_connect (G_OBJECT (GTK_COMBO_BOX(w)), "changed",
+                      G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
+    label = glade_xml_get_widget (xml, "currency_label");
+    gtk_label_set_mnemonic_widget (GTK_LABEL(label), w);
 
-  box = glade_xml_get_widget (xml, "date_box");
-  w = gnc_date_edit_new (time (NULL), FALSE, FALSE);
-  pedit_dialog->date_edit = w;
-  gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
-  gtk_widget_show (w);
-  g_signal_connect (G_OBJECT (w), "date_changed",
-                    G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
-  g_signal_connect (G_OBJECT (GNC_DATE_EDIT (w)->date_entry), "changed",
-                    G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
-  gtk_entry_set_activates_default(GTK_ENTRY(GNC_DATE_EDIT(w)->date_entry), TRUE);
-  label = glade_xml_get_widget (xml, "date_label");
-  gnc_date_make_mnemonic_target (GNC_DATE_EDIT(w), label);
+    box = glade_xml_get_widget (xml, "date_box");
+    w = gnc_date_edit_new (time (NULL), FALSE, FALSE);
+    pedit_dialog->date_edit = w;
+    gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
+    gtk_widget_show (w);
+    g_signal_connect (G_OBJECT (w), "date_changed",
+                      G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
+    g_signal_connect (G_OBJECT (GNC_DATE_EDIT (w)->date_entry), "changed",
+                      G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
+    gtk_entry_set_activates_default(GTK_ENTRY(GNC_DATE_EDIT(w)->date_entry), TRUE);
+    label = glade_xml_get_widget (xml, "date_label");
+    gnc_date_make_mnemonic_target (GNC_DATE_EDIT(w), label);
 
 
-  w = glade_xml_get_widget (xml, "source_entry");
-  pedit_dialog->source_entry = w;
+    w = glade_xml_get_widget (xml, "source_entry");
+    pedit_dialog->source_entry = w;
 
-  w = glade_xml_get_widget (xml, "type_combobox");
-  pedit_dialog->type_combobox = w;
+    w = glade_xml_get_widget (xml, "type_combobox");
+    pedit_dialog->type_combobox = w;
 
-  box = glade_xml_get_widget (xml, "price_box");
-  w = gnc_amount_edit_new ();
-  pedit_dialog->price_edit = w;
-  gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
-  gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (w), TRUE);
-  print_info = gnc_default_price_print_info ();
-  gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (w), print_info);
-  gtk_entry_set_activates_default(GTK_ENTRY(w), TRUE);
-  gtk_widget_show (w);
-  label = glade_xml_get_widget (xml, "price_label");
-  gtk_label_set_mnemonic_widget (GTK_LABEL(label), w);
+    box = glade_xml_get_widget (xml, "price_box");
+    w = gnc_amount_edit_new ();
+    pedit_dialog->price_edit = w;
+    gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
+    gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (w), TRUE);
+    print_info = gnc_default_price_print_info ();
+    gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (w), print_info);
+    gtk_entry_set_activates_default(GTK_ENTRY(w), TRUE);
+    gtk_widget_show (w);
+    label = glade_xml_get_widget (xml, "price_label");
+    gtk_label_set_mnemonic_widget (GTK_LABEL(label), w);
 
-  entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (w));
-  g_signal_connect (G_OBJECT (entry), "changed",
+    entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (w));
+    g_signal_connect (G_OBJECT (entry), "changed",
                       G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
 
-  w = glade_xml_get_widget (xml, "cancel_button");
-  pedit_dialog->cancel_button = w;
+    w = glade_xml_get_widget (xml, "cancel_button");
+    pedit_dialog->cancel_button = w;
 
-  w = glade_xml_get_widget (xml, "apply_button");
-  pedit_dialog->apply_button = w;
-  gnc_prices_set_changed (pedit_dialog, FALSE);
+    w = glade_xml_get_widget (xml, "apply_button");
+    pedit_dialog->apply_button = w;
+    gnc_prices_set_changed (pedit_dialog, FALSE);
 
-  w = glade_xml_get_widget (xml, "ok_button");
-  pedit_dialog->ok_button = w;
+    w = glade_xml_get_widget (xml, "ok_button");
+    pedit_dialog->ok_button = w;
 
-  glade_xml_signal_autoconnect_full( xml,
-                                     gnc_glade_autoconnect_full_func,
-                                     pedit_dialog );
+    glade_xml_signal_autoconnect_full( xml,
+                                       gnc_glade_autoconnect_full_func,
+                                       pedit_dialog );
 
 }
 
 static void
 close_handler (gpointer user_data)
 {
-  PriceEditDialog *pedit_dialog = user_data;
+    PriceEditDialog *pedit_dialog = user_data;
 
-  gtk_dialog_response(GTK_DIALOG(pedit_dialog->dialog), GTK_RESPONSE_CANCEL);
+    gtk_dialog_response(GTK_DIALOG(pedit_dialog->dialog), GTK_RESPONSE_CANCEL);
 }
 
 static void
 refresh_handler (GHashTable *changes, gpointer user_data)
 {
-  //  PriceEditDialog *pedit_dialog = user_data;
+    //  PriceEditDialog *pedit_dialog = user_data;
 
-  //  gnc_prices_load_prices (pedit_dialog);
+    //  gnc_prices_load_prices (pedit_dialog);
 }
 
 static gboolean
 show_handler (const char *class, gint component_id,
-	      gpointer user_data, gpointer iter_data)
+              gpointer user_data, gpointer iter_data)
 {
-  PriceEditDialog *pedit_dialog = user_data;
-  GNCPrice * price = iter_data;
+    PriceEditDialog *pedit_dialog = user_data;
+    GNCPrice * price = iter_data;
 
-  if (!pedit_dialog || (pedit_dialog->price != price))
-    return(FALSE);
+    if (!pedit_dialog || (pedit_dialog->price != price))
+        return(FALSE);
 
-  gtk_window_present (GTK_WINDOW(pedit_dialog->dialog));
-  return(TRUE);
+    gtk_window_present (GTK_WINDOW(pedit_dialog->dialog));
+    return(TRUE);
 }
 
 /********************************************************************\
@@ -492,50 +506,52 @@
 \********************************************************************/
 void
 gnc_price_edit_dialog (GtkWidget * parent,
-		       QofSession *session,
-		       GNCPrice * price,
-		       GNCPriceEditType type)
+                       QofSession *session,
+                       GNCPrice * price,
+                       GNCPriceEditType type)
 {
-  PriceEditDialog *pedit_dialog;
-  gint component_id;
+    PriceEditDialog *pedit_dialog;
+    gint component_id;
 
-  if ((type == GNC_PRICE_EDIT) &&
-      (gnc_forall_gui_components (DIALOG_PRICE_EDIT_CM_CLASS,
-				  show_handler, price)))
-      return;
+    if ((type == GNC_PRICE_EDIT) &&
+            (gnc_forall_gui_components (DIALOG_PRICE_EDIT_CM_CLASS,
+                                        show_handler, price)))
+        return;
 
-  pedit_dialog = g_new0 (PriceEditDialog, 1);
-  gnc_price_pedit_dialog_create (parent, pedit_dialog, session);
-  gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pedit_dialog->dialog));
-  pedit_dialog->type = type;
+    pedit_dialog = g_new0 (PriceEditDialog, 1);
+    gnc_price_pedit_dialog_create (parent, pedit_dialog, session);
+    gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pedit_dialog->dialog));
+    pedit_dialog->type = type;
 
-  switch (type) {
-   case GNC_PRICE_NEW:
-    if (price) {
-      price = gnc_price_clone(price, pedit_dialog->book);
+    switch (type)
+    {
+    case GNC_PRICE_NEW:
+        if (price)
+        {
+            price = gnc_price_clone(price, pedit_dialog->book);
 //  } else {
 //      price = gnc_price_create (pedit_dialog->book);
-    gnc_price_set_source (price, DIALOG_PRICE_EDIT_SOURCE);
+            gnc_price_set_source (price, DIALOG_PRICE_EDIT_SOURCE);
+        }
+
+        pedit_dialog->new = TRUE;
+        /* New price will only have one ref, this dialog. */
+        break;
+    case GNC_PRICE_EDIT:
+        gnc_price_ref(price); /* Add ref from this dialog */
+        pedit_dialog->new = FALSE;
+        break;
     }
 
-    pedit_dialog->new = TRUE;
-    /* New price will only have one ref, this dialog. */
-    break;
-   case GNC_PRICE_EDIT:
-    gnc_price_ref(price); /* Add ref from this dialog */
-    pedit_dialog->new = FALSE;
-    break;
-  }
-
-  pedit_dialog->price = price;
-  price_to_gui(pedit_dialog);
-  gnc_prices_set_changed (pedit_dialog, FALSE);
-  component_id = gnc_register_gui_component (DIALOG_PRICE_EDIT_CM_CLASS,
-                                             refresh_handler, close_handler,
-                                             pedit_dialog);
-  gnc_gui_component_set_session (component_id, pedit_dialog->session);
-  gtk_widget_grab_focus (pedit_dialog->commodity_cbe);
-  gtk_widget_show (pedit_dialog->dialog);
+    pedit_dialog->price = price;
+    price_to_gui(pedit_dialog);
+    gnc_prices_set_changed (pedit_dialog, FALSE);
+    component_id = gnc_register_gui_component (DIALOG_PRICE_EDIT_CM_CLASS,
+                   refresh_handler, close_handler,
+                   pedit_dialog);
+    gnc_gui_component_set_session (component_id, pedit_dialog->session);
+    gtk_widget_grab_focus (pedit_dialog->commodity_cbe);
+    gtk_widget_show (pedit_dialog->dialog);
 }
 
 /********************************************************************\
@@ -548,14 +564,14 @@
 GNCPrice *
 gnc_price_edit_by_guid (GtkWidget * parent, const GUID * guid)
 {
-  GNCPrice *price;
-  QofSession *session;
+    GNCPrice *price;
+    QofSession *session;
 
-  session = gnc_get_current_session ();
-  price = gnc_price_lookup (guid, qof_session_get_book(session));
-  if (price == NULL)
-    return(NULL);
+    session = gnc_get_current_session ();
+    price = gnc_price_lookup (guid, qof_session_get_book(session));
+    if (price == NULL)
+        return(NULL);
 
-  gnc_price_edit_dialog(parent, session, price, GNC_PRICE_EDIT);
-  return price;
+    gnc_price_edit_dialog(parent, session, price, GNC_PRICE_EDIT);
+    return price;
 }

Modified: gnucash/trunk/src/gnome/dialog-print-check.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-print-check.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-print-check.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -107,7 +107,8 @@
 #define KF_KEY_SPLITS_ACCOUNT "SplitsAccount"
 
 /**< This enum specifies the columns used in the check format combobox. */
-typedef enum format_combo_col_t {
+typedef enum format_combo_col_t
+{
     COL_NAME = 0,               /**< This column holds a copy of the check
                                  *   format name and is what is displayed to
                                  *   the user in the combobox. It is NULL for
@@ -168,7 +169,8 @@
 
 /** This data structure describes a single item printed on a check.
  *  It is build from a description in a text file. */
-typedef struct _check_item {
+typedef struct _check_item
+{
 
     CheckItemType type;         /**< What type of item is this?  */
 
@@ -208,7 +210,8 @@
  *  upon the check format, the page may contain multiple checks or
  *  only a single check.  The data structure is build from a
  *  description in a text file. */
-typedef struct _check_format {
+typedef struct _check_format
+{
 
     gchar *guid;                /**< Unique identifier for this format. */
 
@@ -251,46 +254,47 @@
  *  of the widgets in the dialog, pointers to the check descriptions
  *  that have been read, and also contains the data from the gnucash
  *  transaction/split that is to be printed.  */
-struct _print_check_dialog {
-  GladeXML * xml;
-  GtkWidget * dialog;
-  GtkWindow * caller_window;
+struct _print_check_dialog
+{
+    GladeXML * xml;
+    GtkWidget * dialog;
+    GtkWindow * caller_window;
 
-  GncPluginPageRegister *plugin_page;
-  Split *split;
+    GncPluginPageRegister *plugin_page;
+    Split *split;
 
-  GtkWidget * format_combobox;
-  gint format_max;
-  GtkWidget * position_combobox;
-  gint position_max;
-  GtkWidget * custom_table;
-  GtkSpinButton * payee_x,  * payee_y;
-  GtkSpinButton * date_x,   * date_y;
-  GtkSpinButton * words_x,  * words_y;
-  GtkSpinButton * number_x, * number_y;
-  GtkSpinButton * address_x, * address_y;
-  GtkSpinButton * notes_x,   * notes_y;
-  GtkSpinButton * memo_x,   * memo_y;
-  GtkSpinButton * splits_amount_x,   * splits_amount_y;
-  GtkSpinButton * splits_memo_x,   * splits_memo_y;
-  GtkSpinButton * splits_account_x,   * splits_account_y;
-  GtkSpinButton * translation_x, * translation_y;
-  GtkSpinButton * check_rotation;
-  GtkWidget * translation_label;
+    GtkWidget * format_combobox;
+    gint format_max;
+    GtkWidget * position_combobox;
+    gint position_max;
+    GtkWidget * custom_table;
+    GtkSpinButton * payee_x,  * payee_y;
+    GtkSpinButton * date_x,   * date_y;
+    GtkSpinButton * words_x,  * words_y;
+    GtkSpinButton * number_x, * number_y;
+    GtkSpinButton * address_x, * address_y;
+    GtkSpinButton * notes_x,   * notes_y;
+    GtkSpinButton * memo_x,   * memo_y;
+    GtkSpinButton * splits_amount_x,   * splits_amount_y;
+    GtkSpinButton * splits_memo_x,   * splits_memo_y;
+    GtkSpinButton * splits_account_x,   * splits_account_y;
+    GtkSpinButton * translation_x, * translation_y;
+    GtkSpinButton * check_rotation;
+    GtkWidget * translation_label;
 
-  GtkWidget * units_combobox;
+    GtkWidget * units_combobox;
 
-  GtkWidget * date_format;
+    GtkWidget * date_format;
 
-  GtkWidget * check_address_name;
-  GtkWidget * check_address_1;
-  GtkWidget * check_address_2;
-  GtkWidget * check_address_3;
-  GtkWidget * check_address_4;
+    GtkWidget * check_address_name;
+    GtkWidget * check_address_1;
+    GtkWidget * check_address_2;
+    GtkWidget * check_address_3;
+    GtkWidget * check_address_4;
 
-  gchar *default_font;
+    gchar *default_font;
 
-  check_format_t *selected_format;
+    check_format_t *selected_format;
 };
 
 
@@ -311,7 +315,8 @@
     if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter))
         return NULL;
 
-    do {
+    do
+    {
         gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
                            COL_DATA, &format, -1);
         if (format == NULL)
@@ -320,9 +325,10 @@
             continue;
 
         if (iter_out)
-          *iter_out = iter;
+            *iter_out = iter;
         return format;
-    } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter));
+    }
+    while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter));
 
     return NULL;
 }
@@ -331,313 +337,332 @@
 static void
 save_float_pair (const char *section, const char *key, double a, double b)
 {
-  GSList *coord_list = NULL;
+    GSList *coord_list = NULL;
 
-  coord_list = g_slist_append(coord_list, &a);
-  coord_list = g_slist_append(coord_list, &b);
-  gnc_gconf_set_list(section, key, GCONF_VALUE_FLOAT, coord_list, NULL);
-  g_slist_free(coord_list);
+    coord_list = g_slist_append(coord_list, &a);
+    coord_list = g_slist_append(coord_list, &b);
+    gnc_gconf_set_list(section, key, GCONF_VALUE_FLOAT, coord_list, NULL);
+    g_slist_free(coord_list);
 }
 
 static void
 get_float_pair (const char *section, const char *key, double *a, double *b)
 {
-  GSList *coord_list;
+    GSList *coord_list;
 
-  coord_list = gnc_gconf_get_list (section, key, GCONF_VALUE_FLOAT, NULL);
-  if (NULL == coord_list) {
-    *a = 0;
-    *b = 0;
-    return;
-  }
+    coord_list = gnc_gconf_get_list (section, key, GCONF_VALUE_FLOAT, NULL);
+    if (NULL == coord_list)
+    {
+        *a = 0;
+        *b = 0;
+        return;
+    }
 
-  *a = *(gdouble*)g_slist_nth_data(coord_list, 0);
-  *b = *(gdouble*)g_slist_nth_data(coord_list, 1);
-  g_slist_free(coord_list);
+    *a = *(gdouble*)g_slist_nth_data(coord_list, 0);
+    *b = *(gdouble*)g_slist_nth_data(coord_list, 1);
+    g_slist_free(coord_list);
 }
 
 gchar *
 get_check_address( PrintCheckDialog *pcd)
 {
-  /* return an address in five lines
-   * the string needs to be freed with g_free */
-  gchar *address;
-  address = g_strconcat(gtk_entry_get_text(GTK_ENTRY(pcd->check_address_name)),"\n",
-                        gtk_entry_get_text(GTK_ENTRY(pcd->check_address_1)),"\n",
-                        gtk_entry_get_text(GTK_ENTRY(pcd->check_address_2)),"\n",
-                        gtk_entry_get_text(GTK_ENTRY(pcd->check_address_3)),"\n",
-                        gtk_entry_get_text(GTK_ENTRY(pcd->check_address_4)),
-                        NULL);
-  return address;
+    /* return an address in five lines
+     * the string needs to be freed with g_free */
+    gchar *address;
+    address = g_strconcat(gtk_entry_get_text(GTK_ENTRY(pcd->check_address_name)), "\n",
+                          gtk_entry_get_text(GTK_ENTRY(pcd->check_address_1)), "\n",
+                          gtk_entry_get_text(GTK_ENTRY(pcd->check_address_2)), "\n",
+                          gtk_entry_get_text(GTK_ENTRY(pcd->check_address_3)), "\n",
+                          gtk_entry_get_text(GTK_ENTRY(pcd->check_address_4)),
+                          NULL);
+    return address;
 }
 
 gchar *
 get_check_splits_amount(PrintCheckDialog *pcd)
 {
-   gchar* amount = NULL;
-   gchar* amt_temp;
-   int cnt;
-   const gchar* split_amount;
-   int nSplits;
-   Transaction *trans;
-   Split *split;
-   GList *node;
-   SplitList* s_list;
+    gchar* amount = NULL;
+    gchar* amt_temp;
+    int cnt;
+    const gchar* split_amount;
+    int nSplits;
+    Transaction *trans;
+    Split *split;
+    GList *node;
+    SplitList* s_list;
 
-   trans = xaccSplitGetParent(pcd->split);
-   nSplits = xaccTransCountSplits(trans);
-   s_list = xaccTransGetSplitList(trans);
-   if ( !s_list ) return NULL;
+    trans = xaccSplitGetParent(pcd->split);
+    nSplits = xaccTransCountSplits(trans);
+    s_list = xaccTransGetSplitList(trans);
+    if ( !s_list ) return NULL;
 
-   amount = g_strconcat("",NULL);
-   node = s_list;
-   cnt = 1;
-   while ( cnt < nSplits ) {
-      cnt++;
-      split = node->data;
-      split_amount = xaccPrintAmount(xaccSplitGetAmount(split),gnc_split_amount_print_info(split,TRUE));
-      amt_temp = amount;
-      amount = g_strconcat(amt_temp,"\n",split_amount,NULL);
-      g_free(amt_temp);
-      node = node->next;
-   }
-   return amount;
+    amount = g_strconcat("", NULL);
+    node = s_list;
+    cnt = 1;
+    while ( cnt < nSplits )
+    {
+        cnt++;
+        split = node->data;
+        split_amount = xaccPrintAmount(xaccSplitGetAmount(split), gnc_split_amount_print_info(split, TRUE));
+        amt_temp = amount;
+        amount = g_strconcat(amt_temp, "\n", split_amount, NULL);
+        g_free(amt_temp);
+        node = node->next;
+    }
+    return amount;
 }
 
 gchar *
 get_check_splits_memo(PrintCheckDialog *pcd)
 {
-   gchar* memo = NULL;
-   gchar* memo_temp;
-   int cnt;
-   const gchar* split_memo;
-   int nSplits;
-   Transaction *trans;
-   Split *split;
-   GList *node;
-   SplitList* s_list;
+    gchar* memo = NULL;
+    gchar* memo_temp;
+    int cnt;
+    const gchar* split_memo;
+    int nSplits;
+    Transaction *trans;
+    Split *split;
+    GList *node;
+    SplitList* s_list;
 
-   trans = xaccSplitGetParent(pcd->split);
-   nSplits = xaccTransCountSplits(trans);
-   s_list = xaccTransGetSplitList(trans);
-   if ( !s_list ) return NULL;
+    trans = xaccSplitGetParent(pcd->split);
+    nSplits = xaccTransCountSplits(trans);
+    s_list = xaccTransGetSplitList(trans);
+    if ( !s_list ) return NULL;
 
-   memo = g_strconcat("",NULL);
-   node = s_list;
-   cnt = 1;
-   while ( cnt < nSplits ) {
-      cnt++;
-      split = node->data;
-      split_memo = xaccSplitGetMemo(split);
-      memo_temp = memo;
-      memo = g_strconcat(memo_temp,"\n",split_memo,NULL);
-      g_free(memo_temp);
-      node = node->next;
-   }
-   return memo;
+    memo = g_strconcat("", NULL);
+    node = s_list;
+    cnt = 1;
+    while ( cnt < nSplits )
+    {
+        cnt++;
+        split = node->data;
+        split_memo = xaccSplitGetMemo(split);
+        memo_temp = memo;
+        memo = g_strconcat(memo_temp, "\n", split_memo, NULL);
+        g_free(memo_temp);
+        node = node->next;
+    }
+    return memo;
 }
 
 gchar *
 get_check_splits_account(PrintCheckDialog *pcd)
 {
-   gchar* account = NULL;
-   gchar* account_temp;
-   int cnt;
-   const gchar* aName = NULL;
-   int nSplits;
-   Account *pAccount;
-   Transaction *trans;
-   Split *split;
-   GList *node;
-   SplitList* s_list;
+    gchar* account = NULL;
+    gchar* account_temp;
+    int cnt;
+    const gchar* aName = NULL;
+    int nSplits;
+    Account *pAccount;
+    Transaction *trans;
+    Split *split;
+    GList *node;
+    SplitList* s_list;
 
-   trans = xaccSplitGetParent(pcd->split);
-   nSplits = xaccTransCountSplits(trans);
-   s_list = xaccTransGetSplitList(trans);
-   if ( !s_list ) return NULL;
+    trans = xaccSplitGetParent(pcd->split);
+    nSplits = xaccTransCountSplits(trans);
+    s_list = xaccTransGetSplitList(trans);
+    if ( !s_list ) return NULL;
 
-   account = g_strconcat("",NULL);
-   node = s_list;
-   cnt = 1;
-   while ( cnt < nSplits ) {
-      cnt++;
-      split = node->data;
-      pAccount = xaccSplitGetAccount(split);
-      aName = gnc_get_account_name_for_register(pAccount);
-      account_temp = account;
-      account = g_strconcat(account_temp,"\n",aName,NULL);
-      g_free(account_temp);
-      node = node->next;
-   }
-   return account;
+    account = g_strconcat("", NULL);
+    node = s_list;
+    cnt = 1;
+    while ( cnt < nSplits )
+    {
+        cnt++;
+        split = node->data;
+        pAccount = xaccSplitGetAccount(split);
+        aName = gnc_get_account_name_for_register(pAccount);
+        account_temp = account;
+        account = g_strconcat(account_temp, "\n", aName, NULL);
+        g_free(account_temp);
+        node = node->next;
+    }
+    return account;
 }
 
 gboolean
 check_format_has_address ( PrintCheckDialog *pcd )
 {
-  /* check format for an ADDRESS item */
-  check_item_t *item = NULL;
-  GSList *elem;
-  check_format_t *format = NULL;
+    /* check format for an ADDRESS item */
+    check_item_t *item = NULL;
+    GSList *elem;
+    check_format_t *format = NULL;
 
-  if ( !pcd ) return FALSE;
-  /* if format is NULL, then the custom format is being used
-   * which has an ADDRESS item by definition */
-  format = pcd->selected_format;
-  if ( !format ) return TRUE;
+    if ( !pcd ) return FALSE;
+    /* if format is NULL, then the custom format is being used
+     * which has an ADDRESS item by definition */
+    format = pcd->selected_format;
+    if ( !format ) return TRUE;
 
-  for (elem = pcd->selected_format->items; elem; elem = g_slist_next(elem)) {
-    item = elem->data;
-    if ( item->type == ADDRESS ) return TRUE;
+    for (elem = pcd->selected_format->items; elem; elem = g_slist_next(elem))
+    {
+        item = elem->data;
+        if ( item->type == ADDRESS ) return TRUE;
     }
-  return FALSE;
+    return FALSE;
 }
 
 static void
 gnc_ui_print_save_dialog(PrintCheckDialog * pcd)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  check_format_t *check;
-  const gchar *format;
-  gint active;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    check_format_t *check;
+    const gchar *format;
+    gint active;
 
-  /* Options page */
-  if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(pcd->format_combobox),
-                                    &iter)) {
-      model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox));
-      gtk_tree_model_get(model, &iter, COL_DATA, &check, -1);
-      gnc_gconf_set_string(GCONF_SECTION, KEY_CHECK_FORMAT_GUID,
-                           check ? check->guid : "custom", NULL);
-  }
-  active = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
-  gnc_gconf_set_int(GCONF_SECTION, KEY_CHECK_POSITION, active, NULL);
-  active = gnc_date_format_get_format (GNC_DATE_FORMAT(pcd->date_format));
-  gnc_gconf_set_int(GCONF_SECTION, KEY_DATE_FORMAT, active, NULL);
-  if (active == QOF_DATE_FORMAT_CUSTOM) {
-    format = gnc_date_format_get_custom (GNC_DATE_FORMAT(pcd->date_format));
-    gnc_gconf_set_string(GCONF_SECTION, KEY_DATE_FORMAT_USER, format, NULL);
-  } else {
-    gnc_gconf_unset (GCONF_SECTION, KEY_DATE_FORMAT_USER, NULL);
-  }
+    /* Options page */
+    if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(pcd->format_combobox),
+                                      &iter))
+    {
+        model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox));
+        gtk_tree_model_get(model, &iter, COL_DATA, &check, -1);
+        gnc_gconf_set_string(GCONF_SECTION, KEY_CHECK_FORMAT_GUID,
+                             check ? check->guid : "custom", NULL);
+    }
+    active = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
+    gnc_gconf_set_int(GCONF_SECTION, KEY_CHECK_POSITION, active, NULL);
+    active = gnc_date_format_get_format (GNC_DATE_FORMAT(pcd->date_format));
+    gnc_gconf_set_int(GCONF_SECTION, KEY_DATE_FORMAT, active, NULL);
+    if (active == QOF_DATE_FORMAT_CUSTOM)
+    {
+        format = gnc_date_format_get_custom (GNC_DATE_FORMAT(pcd->date_format));
+        gnc_gconf_set_string(GCONF_SECTION, KEY_DATE_FORMAT_USER, format, NULL);
+    }
+    else
+    {
+        gnc_gconf_unset (GCONF_SECTION, KEY_DATE_FORMAT_USER, NULL);
+    }
 
-  /* Custom format page */
-  save_float_pair(GCONF_SECTION, KEY_CUSTOM_PAYEE,
-		  gtk_spin_button_get_value(pcd->payee_x),
-		  gtk_spin_button_get_value(pcd->payee_y));
-  save_float_pair(GCONF_SECTION, KEY_CUSTOM_DATE,
-		  gtk_spin_button_get_value(pcd->date_x),
-		  gtk_spin_button_get_value(pcd->date_y));
-  save_float_pair(GCONF_SECTION, KEY_CUSTOM_WORDS,
-		  gtk_spin_button_get_value(pcd->words_x),
-		  gtk_spin_button_get_value(pcd->words_y));
-  save_float_pair(GCONF_SECTION, KEY_CUSTOM_NUMBER,
-		  gtk_spin_button_get_value(pcd->number_x),
-		  gtk_spin_button_get_value(pcd->number_y));
-  save_float_pair(GCONF_SECTION, KEY_CUSTOM_NOTES,
-		  gtk_spin_button_get_value(pcd->notes_x),
-		  gtk_spin_button_get_value(pcd->notes_y));
-  save_float_pair(GCONF_SECTION, KEY_CUSTOM_MEMO,
-		  gtk_spin_button_get_value(pcd->memo_x),
-		  gtk_spin_button_get_value(pcd->memo_y));
-  save_float_pair(GCONF_SECTION, KEY_CUSTOM_ADDRESS,
-		  gtk_spin_button_get_value(pcd->address_x),
-		  gtk_spin_button_get_value(pcd->address_y));
-  save_float_pair(GCONF_SECTION, KEY_SPLITS_AMOUNT,
-		  gtk_spin_button_get_value(pcd->splits_amount_x),
-		  gtk_spin_button_get_value(pcd->splits_amount_y));
-  save_float_pair(GCONF_SECTION, KEY_SPLITS_MEMO,
-		  gtk_spin_button_get_value(pcd->splits_memo_x),
-		  gtk_spin_button_get_value(pcd->splits_memo_y));
-  save_float_pair(GCONF_SECTION, KEY_SPLITS_ACCOUNT,
-		  gtk_spin_button_get_value(pcd->splits_account_x),
-		  gtk_spin_button_get_value(pcd->splits_account_y));
-  save_float_pair(GCONF_SECTION, KEY_CUSTOM_TRANSLATION,
-		  gtk_spin_button_get_value(pcd->translation_x),
-		  gtk_spin_button_get_value(pcd->translation_y));
-  gnc_gconf_set_float(GCONF_SECTION, KEY_CUSTOM_ROTATION,
-		      gtk_spin_button_get_value(pcd->check_rotation),
-		      NULL);
-  active = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->units_combobox));
-  gnc_gconf_set_int(GCONF_SECTION, KEY_CUSTOM_UNITS, active, NULL);
+    /* Custom format page */
+    save_float_pair(GCONF_SECTION, KEY_CUSTOM_PAYEE,
+                    gtk_spin_button_get_value(pcd->payee_x),
+                    gtk_spin_button_get_value(pcd->payee_y));
+    save_float_pair(GCONF_SECTION, KEY_CUSTOM_DATE,
+                    gtk_spin_button_get_value(pcd->date_x),
+                    gtk_spin_button_get_value(pcd->date_y));
+    save_float_pair(GCONF_SECTION, KEY_CUSTOM_WORDS,
+                    gtk_spin_button_get_value(pcd->words_x),
+                    gtk_spin_button_get_value(pcd->words_y));
+    save_float_pair(GCONF_SECTION, KEY_CUSTOM_NUMBER,
+                    gtk_spin_button_get_value(pcd->number_x),
+                    gtk_spin_button_get_value(pcd->number_y));
+    save_float_pair(GCONF_SECTION, KEY_CUSTOM_NOTES,
+                    gtk_spin_button_get_value(pcd->notes_x),
+                    gtk_spin_button_get_value(pcd->notes_y));
+    save_float_pair(GCONF_SECTION, KEY_CUSTOM_MEMO,
+                    gtk_spin_button_get_value(pcd->memo_x),
+                    gtk_spin_button_get_value(pcd->memo_y));
+    save_float_pair(GCONF_SECTION, KEY_CUSTOM_ADDRESS,
+                    gtk_spin_button_get_value(pcd->address_x),
+                    gtk_spin_button_get_value(pcd->address_y));
+    save_float_pair(GCONF_SECTION, KEY_SPLITS_AMOUNT,
+                    gtk_spin_button_get_value(pcd->splits_amount_x),
+                    gtk_spin_button_get_value(pcd->splits_amount_y));
+    save_float_pair(GCONF_SECTION, KEY_SPLITS_MEMO,
+                    gtk_spin_button_get_value(pcd->splits_memo_x),
+                    gtk_spin_button_get_value(pcd->splits_memo_y));
+    save_float_pair(GCONF_SECTION, KEY_SPLITS_ACCOUNT,
+                    gtk_spin_button_get_value(pcd->splits_account_x),
+                    gtk_spin_button_get_value(pcd->splits_account_y));
+    save_float_pair(GCONF_SECTION, KEY_CUSTOM_TRANSLATION,
+                    gtk_spin_button_get_value(pcd->translation_x),
+                    gtk_spin_button_get_value(pcd->translation_y));
+    gnc_gconf_set_float(GCONF_SECTION, KEY_CUSTOM_ROTATION,
+                        gtk_spin_button_get_value(pcd->check_rotation),
+                        NULL);
+    active = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->units_combobox));
+    gnc_gconf_set_int(GCONF_SECTION, KEY_CUSTOM_UNITS, active, NULL);
 }
 
 static void
 gnc_ui_print_restore_dialog(PrintCheckDialog * pcd)
 {
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  gchar *format, *guid;
-  gdouble x, y;
-  gint active;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    gchar *format, *guid;
+    gdouble x, y;
+    gint active;
 
-  /* Options page */
-  guid = gnc_gconf_get_string(GCONF_SECTION, KEY_CHECK_FORMAT_GUID, NULL);
-  if (guid == NULL) {
-      active = gnc_gconf_get_int(GCONF_SECTION, KEY_CHECK_FORMAT, NULL);
-      gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), active);
-  } else if (strcmp(guid, "custom") == 0) {
-      gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox),
-                               pcd->format_max - 1);
-  } else {
-      model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox));
-      if (find_existing_format(GTK_LIST_STORE(model), guid, &iter)) {
-          gtk_combo_box_set_active_iter(GTK_COMBO_BOX(pcd->format_combobox), &iter);
-      } else {
-          gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), 0);
-      }
-  }
-  active = gnc_gconf_get_int(GCONF_SECTION, KEY_CHECK_POSITION, NULL);
-  gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->position_combobox), active);
-  active = gnc_gconf_get_int(GCONF_SECTION, KEY_DATE_FORMAT, NULL);
-  gnc_date_format_set_format(GNC_DATE_FORMAT(pcd->date_format), active);
-  if (active == QOF_DATE_FORMAT_CUSTOM) {
-    format = gnc_gconf_get_string(GCONF_SECTION, KEY_DATE_FORMAT_USER, NULL);
-    if (format) {
-      gnc_date_format_set_custom(GNC_DATE_FORMAT(pcd->date_format), format);
-      g_free(format);
+    /* Options page */
+    guid = gnc_gconf_get_string(GCONF_SECTION, KEY_CHECK_FORMAT_GUID, NULL);
+    if (guid == NULL)
+    {
+        active = gnc_gconf_get_int(GCONF_SECTION, KEY_CHECK_FORMAT, NULL);
+        gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), active);
     }
-  }
+    else if (strcmp(guid, "custom") == 0)
+    {
+        gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox),
+                                 pcd->format_max - 1);
+    }
+    else
+    {
+        model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox));
+        if (find_existing_format(GTK_LIST_STORE(model), guid, &iter))
+        {
+            gtk_combo_box_set_active_iter(GTK_COMBO_BOX(pcd->format_combobox), &iter);
+        }
+        else
+        {
+            gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), 0);
+        }
+    }
+    active = gnc_gconf_get_int(GCONF_SECTION, KEY_CHECK_POSITION, NULL);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->position_combobox), active);
+    active = gnc_gconf_get_int(GCONF_SECTION, KEY_DATE_FORMAT, NULL);
+    gnc_date_format_set_format(GNC_DATE_FORMAT(pcd->date_format), active);
+    if (active == QOF_DATE_FORMAT_CUSTOM)
+    {
+        format = gnc_gconf_get_string(GCONF_SECTION, KEY_DATE_FORMAT_USER, NULL);
+        if (format)
+        {
+            gnc_date_format_set_custom(GNC_DATE_FORMAT(pcd->date_format), format);
+            g_free(format);
+        }
+    }
 
-  /* Custom format page */
-  get_float_pair(GCONF_SECTION, KEY_CUSTOM_PAYEE, &x, &y);
-  gtk_spin_button_set_value(pcd->payee_x, x);
-  gtk_spin_button_set_value(pcd->payee_y, y);
+    /* Custom format page */
+    get_float_pair(GCONF_SECTION, KEY_CUSTOM_PAYEE, &x, &y);
+    gtk_spin_button_set_value(pcd->payee_x, x);
+    gtk_spin_button_set_value(pcd->payee_y, y);
 
-  get_float_pair(GCONF_SECTION, KEY_CUSTOM_DATE, &x, &y);
-  gtk_spin_button_set_value(pcd->date_x, x);
-  gtk_spin_button_set_value(pcd->date_y, y);
-  get_float_pair(GCONF_SECTION, KEY_CUSTOM_WORDS, &x, &y);
-  gtk_spin_button_set_value(pcd->words_x, x);
-  gtk_spin_button_set_value(pcd->words_y, y);
-  get_float_pair(GCONF_SECTION, KEY_CUSTOM_NUMBER, &x, &y);
-  gtk_spin_button_set_value(pcd->number_x, x);
-  gtk_spin_button_set_value(pcd->number_y, y);
-  get_float_pair(GCONF_SECTION, KEY_CUSTOM_ADDRESS, &x, &y);
-  gtk_spin_button_set_value(pcd->address_x, x);
-  gtk_spin_button_set_value(pcd->address_y, y);
-  get_float_pair(GCONF_SECTION, KEY_CUSTOM_NOTES, &x, &y);
-  gtk_spin_button_set_value(pcd->notes_x, x);
-  gtk_spin_button_set_value(pcd->notes_y, y);
-  get_float_pair(GCONF_SECTION, KEY_CUSTOM_MEMO, &x, &y);
-  gtk_spin_button_set_value(pcd->memo_x, x);
-  gtk_spin_button_set_value(pcd->memo_y, y);
-  get_float_pair(GCONF_SECTION, KEY_SPLITS_AMOUNT, &x, &y);
-  gtk_spin_button_set_value(pcd->splits_amount_x, x);
-  gtk_spin_button_set_value(pcd->splits_amount_y, y);
-  get_float_pair(GCONF_SECTION, KEY_SPLITS_MEMO, &x, &y);
-  gtk_spin_button_set_value(pcd->splits_memo_x, x);
-  gtk_spin_button_set_value(pcd->splits_memo_y, y);
-  get_float_pair(GCONF_SECTION, KEY_SPLITS_ACCOUNT, &x, &y);
-  gtk_spin_button_set_value(pcd->splits_account_x, x);
-  gtk_spin_button_set_value(pcd->splits_account_y, y);
-  get_float_pair(GCONF_SECTION, KEY_CUSTOM_TRANSLATION, &x, &y);
-  gtk_spin_button_set_value(pcd->translation_x, x);
-  gtk_spin_button_set_value(pcd->translation_y, y);
-  x = gnc_gconf_get_float(GCONF_SECTION, KEY_CUSTOM_ROTATION, NULL);
-  gtk_spin_button_set_value(pcd->check_rotation, x);
-  active = gnc_gconf_get_int(GCONF_SECTION, KEY_CUSTOM_UNITS, NULL);
-  gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->units_combobox), active);
+    get_float_pair(GCONF_SECTION, KEY_CUSTOM_DATE, &x, &y);
+    gtk_spin_button_set_value(pcd->date_x, x);
+    gtk_spin_button_set_value(pcd->date_y, y);
+    get_float_pair(GCONF_SECTION, KEY_CUSTOM_WORDS, &x, &y);
+    gtk_spin_button_set_value(pcd->words_x, x);
+    gtk_spin_button_set_value(pcd->words_y, y);
+    get_float_pair(GCONF_SECTION, KEY_CUSTOM_NUMBER, &x, &y);
+    gtk_spin_button_set_value(pcd->number_x, x);
+    gtk_spin_button_set_value(pcd->number_y, y);
+    get_float_pair(GCONF_SECTION, KEY_CUSTOM_ADDRESS, &x, &y);
+    gtk_spin_button_set_value(pcd->address_x, x);
+    gtk_spin_button_set_value(pcd->address_y, y);
+    get_float_pair(GCONF_SECTION, KEY_CUSTOM_NOTES, &x, &y);
+    gtk_spin_button_set_value(pcd->notes_x, x);
+    gtk_spin_button_set_value(pcd->notes_y, y);
+    get_float_pair(GCONF_SECTION, KEY_CUSTOM_MEMO, &x, &y);
+    gtk_spin_button_set_value(pcd->memo_x, x);
+    gtk_spin_button_set_value(pcd->memo_y, y);
+    get_float_pair(GCONF_SECTION, KEY_SPLITS_AMOUNT, &x, &y);
+    gtk_spin_button_set_value(pcd->splits_amount_x, x);
+    gtk_spin_button_set_value(pcd->splits_amount_y, y);
+    get_float_pair(GCONF_SECTION, KEY_SPLITS_MEMO, &x, &y);
+    gtk_spin_button_set_value(pcd->splits_memo_x, x);
+    gtk_spin_button_set_value(pcd->splits_memo_y, y);
+    get_float_pair(GCONF_SECTION, KEY_SPLITS_ACCOUNT, &x, &y);
+    gtk_spin_button_set_value(pcd->splits_account_x, x);
+    gtk_spin_button_set_value(pcd->splits_account_y, y);
+    get_float_pair(GCONF_SECTION, KEY_CUSTOM_TRANSLATION, &x, &y);
+    gtk_spin_button_set_value(pcd->translation_x, x);
+    gtk_spin_button_set_value(pcd->translation_y, y);
+    x = gnc_gconf_get_float(GCONF_SECTION, KEY_CUSTOM_ROTATION, NULL);
+    gtk_spin_button_set_value(pcd->check_rotation, x);
+    active = gnc_gconf_get_int(GCONF_SECTION, KEY_CUSTOM_UNITS, NULL);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->units_combobox), active);
 }
 
 
@@ -647,15 +672,16 @@
     gint selected;
 
     selected = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->units_combobox));
-    switch (selected) {
-        default:
-            return 72.0;        /* inches */
-        case 1:
-            return 28.346;      /* cm */
-        case 2:
-            return 2.8346;      /* mm */
-        case 3:
-            return 1.0;         /* points */
+    switch (selected)
+    {
+    default:
+        return 72.0;        /* inches */
+    case 1:
+        return 28.346;      /* cm */
+    case 2:
+        return 2.8346;      /* mm */
+    case 3:
+        return 1.0;         /* points */
     }
 }
 
@@ -752,49 +778,52 @@
     pathname = g_build_filename(gnc_dotgnucash_dir(), CHECK_FMT_DIR,
                                 filename, NULL);
 
-    if (gnc_key_file_save_to_file(pathname, key_file, &error)) {
-                if (!gnc_gconf_get_bool(GCONF_SECTION, KEY_PRINT_DATE_FMT, NULL))
-        /* Reload the format combo box and reselect the "custom" entry */
-        initialize_format_combobox(pcd);
+    if (gnc_key_file_save_to_file(pathname, key_file, &error))
+    {
+        if (!gnc_gconf_get_bool(GCONF_SECTION, KEY_PRINT_DATE_FMT, NULL))
+            /* Reload the format combo box and reselect the "custom" entry */
+            initialize_format_combobox(pcd);
         model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox));
         gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox),
                                  pcd->format_max - 1);
-    } else {
+    }
+    else
+    {
         dialog = gtk_message_dialog_new(GTK_WINDOW(pcd->dialog),
                                         GTK_DIALOG_DESTROY_WITH_PARENT,
                                         GTK_MESSAGE_ERROR,
                                         GTK_BUTTONS_CLOSE, "%s",
                                         _("Cannot save check format file."));
         gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-                                                 "%s", error->message);
+                "%s", error->message);
         gtk_dialog_run(GTK_DIALOG(dialog));
         gtk_widget_destroy(dialog);
         g_error_free(error);
     }
     g_free(pathname);
     g_free(filename);
-	}
+}
 
 
-	/* Make the OK button sensitive iff a title has been entered. */
-	void
-	gnc_check_format_title_changed (GtkEditable *editable, GtkWidget *ok_button)
-	{
-  const gchar *text;
-  gboolean sensitive;
+/* Make the OK button sensitive iff a title has been entered. */
+void
+gnc_check_format_title_changed (GtkEditable *editable, GtkWidget *ok_button)
+{
+    const gchar *text;
+    gboolean sensitive;
 
-  text = gtk_entry_get_text(GTK_ENTRY(editable));
-  sensitive = text && *text;
-  gtk_widget_set_sensitive(ok_button, sensitive);
-	}
+    text = gtk_entry_get_text(GTK_ENTRY(editable));
+    sensitive = text && *text;
+    gtk_widget_set_sensitive(ok_button, sensitive);
+}
 
 
-	/** This function is called when the user clicks the "save format" button in
+/** This function is called when the user clicks the "save format" button in
  *  the check printing dialog.  It presents another dialog to the user to get
  *  the filename for saving the data. */
-	void
-	gnc_print_check_save_button_clicked(GtkButton *unused, PrintCheckDialog *pcd)
-	{
+void
+gnc_print_check_save_button_clicked(GtkButton *unused, PrintCheckDialog *pcd)
+{
     GtkWidget *dialog, *entry, *button;
     GladeXML *xml;
     gchar *title;
@@ -808,7 +837,8 @@
     glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, pcd);
 
     gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(pcd->dialog));
-    if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK) {
+    if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK)
+    {
         gtk_widget_destroy(dialog);
         g_object_unref(xml);
         return;
@@ -820,14 +850,14 @@
 
     pcd_save_custom_data(pcd, title);
     g_free(title);
-	}
+}
 
 
-	/** This is an auxiliary debugging function for converting an array of doubles
+/** This is an auxiliary debugging function for converting an array of doubles
  *  into a printable string. */
-	static gchar *
-	doubles_to_string(gdouble * dd, gint len)
-	{
+static gchar *
+doubles_to_string(gdouble * dd, gint len)
+{
     GString *str;
     gint i;
 
@@ -835,10 +865,10 @@
     for (i = 0; i < len; i++)
         g_string_append_printf(str, "%f ", dd[i]);
     return g_string_free(str, FALSE);
-	}
+}
 
 
-	/** Read the information describing the placement for each item to be printed
+/** Read the information describing the placement for each item to be printed
  *  on the check.  This information is all relative to the upper left hand
  *  corner of a "check".  See the format_read_multicheck_info() function for
  *  determining if there are multiple checks on a single page of paper. This
@@ -846,10 +876,10 @@
  *  information.  These items will be printed in the same order they are read,
  *  meaning that items listed later in the date file can be printed over top
  *  of items that appear earlier in the file. */
-	static GSList *
-	format_read_item_placement(const gchar * file,
+static GSList *
+format_read_item_placement(const gchar * file,
                            GKeyFile * key_file, check_format_t * format)
-	{
+{
     check_item_t *data = NULL;
     GError *error = NULL;
     GSList *list = NULL;
@@ -860,7 +890,8 @@
     gsize dd_len;
 
     /* Read until failure. */
-    for (item_num = 1;; item_num++) {
+    for (item_num = 1;; item_num++)
+    {
 
         /* Create the per-item data structure */
         data = g_new0(check_item_t, 1);
@@ -870,9 +901,11 @@
         /* Get the item type */
         key = g_strdup_printf("%s_%d", KF_KEY_TYPE, item_num);
         value = g_key_file_get_string(key_file, KF_GROUP_ITEMS, key, &error);
-        if (error) {
+        if (error)
+        {
             if ((error->domain == G_KEY_FILE_ERROR)
-                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
+                    && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND))
+            {
                 /* This is the expected exit from this function. */
                 goto cleanup;
             }
@@ -901,20 +934,21 @@
         g_free(value);
 
         /* Must have "x;y" or "x;y;w;h". */
-        switch (dd_len) {
-            case 4:
-                data->w = dd[2];
-                data->h = dd[3];
-                /* fall through */
-            case 2:
-                data->x = dd[0];
-                data->y = dd[1];
-                break;
-            default:
-                g_warning
-                    ("Check file %s, group %s, key %s, error: 2 or 4 values only",
-                     file, KF_GROUP_ITEMS, key);
-                goto cleanup;
+        switch (dd_len)
+        {
+        case 4:
+            data->w = dd[2];
+            data->h = dd[3];
+            /* fall through */
+        case 2:
+            data->x = dd[0];
+            data->y = dd[1];
+            break;
+        default:
+            g_warning
+            ("Check file %s, group %s, key %s, error: 2 or 4 values only",
+             file, KF_GROUP_ITEMS, key);
+            goto cleanup;
         }
         g_free(dd);
         g_free(key);
@@ -922,19 +956,23 @@
         /* Any text item can specify:
          *   a font  FONT_n
          *   an alignment if a width was provided for the item  ALIGN_n
-		 *   blocking chars flag  BLOCKING_CHARS_n
+         *   blocking chars flag  BLOCKING_CHARS_n
          * These values are optional and do not cause a failure if they are missing. */
 
-        if (data->type != PICTURE) {
+        if (data->type != PICTURE)
+        {
             key = g_strdup_printf("%s_%d", KF_KEY_FONT, item_num);
             data->font =
                 g_key_file_get_string(key_file, KF_GROUP_ITEMS, key, &error);
-            if (!error) {
+            if (!error)
+            {
                 g_debug("Check file %s, group %s, key %s, value: %s",
                         file, KF_GROUP_ITEMS, key, data->font);
-            } else {
+            }
+            else
+            {
                 if (!((error->domain == G_KEY_FILE_ERROR)
-                      && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                        && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
                     g_warning("Check file %s, group %s, key %s, error: %s",
                               file, KF_GROUP_ITEMS, key, error->message);
                 g_clear_error(&error);
@@ -944,7 +982,8 @@
             key = g_strdup_printf("%s_%d", KF_KEY_ALIGN, item_num);
             value =
                 g_key_file_get_string(key_file, KF_GROUP_ITEMS, key, &error);
-            if (!error) {
+            if (!error)
+            {
                 g_debug("Check file %s, group %s, key %s, value: %s",
                         file, KF_GROUP_ITEMS, key, value);
                 name = g_utf8_strdown(value, -1);
@@ -956,9 +995,11 @@
                     data->align = PANGO_ALIGN_LEFT;
                 g_free(name);
                 g_free(value);
-            } else {
+            }
+            else
+            {
                 if (!((error->domain == G_KEY_FILE_ERROR)
-                      && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                        && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
                     g_warning("Check file %s, group %s, key %s, error: %s",
                               file, KF_GROUP_ITEMS, key, error->message);
                 data->align = PANGO_ALIGN_LEFT;
@@ -969,64 +1010,71 @@
             key = g_strdup_printf("%s_%d", KF_KEY_BLOCKING, item_num);
             bval =
                 g_key_file_get_boolean(key_file, KF_GROUP_ITEMS, key, &error);
-            if (!error) {
+            if (!error)
+            {
                 g_debug("Check file %s, group %s, key %s, value: %d",
                         file, KF_GROUP_ITEMS, key, bval);
-		data->blocking = bval;
-            } else {
+                data->blocking = bval;
+            }
+            else
+            {
                 if (!((error->domain == G_KEY_FILE_ERROR)
-                      && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                        && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
                     g_warning("Check file %s, group %s, key %s, error: %s",
                               file, KF_GROUP_ITEMS, key, error->message);
-		data->blocking = format->blocking;
+                data->blocking = format->blocking;
                 g_clear_error(&error);
             }
             g_free(key);
         }
         /* Get any extra data for specific items. */
-        switch (data->type) {
-            case PICTURE:
-                key = g_strdup_printf("%s_%d", KF_KEY_FILENAME, item_num);
-                data->filename =
-                    g_key_file_get_string(key_file, KF_GROUP_ITEMS, key,
-                                          &error);
-                if (error)
-                    goto failed;
-                g_debug("Check file %s, group %s, key %s, value: %s",
-                        file, KF_GROUP_ITEMS, key, data->filename);
-                g_free(key);
-                break;
-            case TEXT:
-                key = g_strdup_printf("%s_%d", KF_KEY_TEXT, item_num);
-                data->text =
-                    g_key_file_get_string(key_file, KF_GROUP_ITEMS, key,
-                                          &error);
-                if (error)
-                    goto failed;
-                g_debug("Check file %s, group %s, key %s, value: %s",
-                        file, KF_GROUP_ITEMS, key, data->text);
-                g_free(key);
-                    case DATE:
-                      /* no error if the date_format is not present */
-			key = g_strdup_printf("%s_%d", KF_KEY_DATE_FORMAT, item_num);
-                        bval = g_key_file_get_boolean(key_file, KF_GROUP_ITEMS, key, &error);
-   		    	if (!error) {
-			   g_debug("Check file %s, group %s, key %s, value: %d",
-				file, KF_GROUP_ITEMS, key, bval);
-			   data->print_date_format = bval;
-			} else {
-			   if (!((error->domain == G_KEY_FILE_ERROR)
-			      && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-			      g_warning("Check file %s, group %s, key %s, error: %s",
-			         file, KF_GROUP_ITEMS, key, error->message);
-			   //data->print_date_format = gnc_gconf_get_bool(GCONF_SECTION, KEY_PRINT_DATE_FMT, NULL);
-			   data->print_date_format = format->print_date_format;
-			   g_clear_error(&error);
-			}
-			g_free(key);
-                break;
-            default:
-                break;
+        switch (data->type)
+        {
+        case PICTURE:
+            key = g_strdup_printf("%s_%d", KF_KEY_FILENAME, item_num);
+            data->filename =
+                g_key_file_get_string(key_file, KF_GROUP_ITEMS, key,
+                                      &error);
+            if (error)
+                goto failed;
+            g_debug("Check file %s, group %s, key %s, value: %s",
+                    file, KF_GROUP_ITEMS, key, data->filename);
+            g_free(key);
+            break;
+        case TEXT:
+            key = g_strdup_printf("%s_%d", KF_KEY_TEXT, item_num);
+            data->text =
+                g_key_file_get_string(key_file, KF_GROUP_ITEMS, key,
+                                      &error);
+            if (error)
+                goto failed;
+            g_debug("Check file %s, group %s, key %s, value: %s",
+                    file, KF_GROUP_ITEMS, key, data->text);
+            g_free(key);
+        case DATE:
+            /* no error if the date_format is not present */
+            key = g_strdup_printf("%s_%d", KF_KEY_DATE_FORMAT, item_num);
+            bval = g_key_file_get_boolean(key_file, KF_GROUP_ITEMS, key, &error);
+            if (!error)
+            {
+                g_debug("Check file %s, group %s, key %s, value: %d",
+                        file, KF_GROUP_ITEMS, key, bval);
+                data->print_date_format = bval;
+            }
+            else
+            {
+                if (!((error->domain == G_KEY_FILE_ERROR)
+                        && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                    g_warning("Check file %s, group %s, key %s, error: %s",
+                              file, KF_GROUP_ITEMS, key, error->message);
+                //data->print_date_format = gnc_gconf_get_bool(GCONF_SECTION, KEY_PRINT_DATE_FMT, NULL);
+                data->print_date_format = format->print_date_format;
+                g_clear_error(&error);
+            }
+            g_free(key);
+            break;
+        default:
+            break;
         }
 
         list = g_slist_append(list, data);
@@ -1036,10 +1084,10 @@
     /* Should never be reached. */
     return list;
 
-  failed:
+failed:
     g_warning("Check file %s, group %s, key %s, error: %s",
               file, KF_GROUP_ITEMS, key, error->message);
-  cleanup:
+cleanup:
     if (error)
         g_error_free(error);
     if (data)
@@ -1080,13 +1128,17 @@
 
     key = g_strdup_printf("%s", KF_KEY_HEIGHT);
     format->height = g_key_file_get_double(key_file, KF_GROUP_POS, key, &error);
-    if (error) {
+    if (error)
+    {
         if ((error->domain == G_KEY_FILE_ERROR)
-            && ((error->code == G_KEY_FILE_ERROR_GROUP_NOT_FOUND)
-                || (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND))) {
+                && ((error->code == G_KEY_FILE_ERROR_GROUP_NOT_FOUND)
+                    || (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+        {
             g_clear_error(&error);
             format->height = 0.0;
-        } else {
+        }
+        else
+        {
             g_warning("Check file %s, error reading group %s, key %s: %s",
                       file, KF_GROUP_POS, key, error->message);
             g_free(key);
@@ -1096,13 +1148,15 @@
 
     names = g_key_file_get_string_list(key_file, KF_GROUP_POS, KF_KEY_NAMES,
                                        &length, &error);
-    if (error) {
+    if (error)
+    {
         if ((error->domain == G_KEY_FILE_ERROR)
-            && ((error->code == G_KEY_FILE_ERROR_GROUP_NOT_FOUND)
-                || (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND))) {
-          /* This is the expected exit from this function. */
-          g_free(key);
-          return NULL;
+                && ((error->code == G_KEY_FILE_ERROR_GROUP_NOT_FOUND)
+                    || (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+        {
+            /* This is the expected exit from this function. */
+            g_free(key);
+            return NULL;
         }
         g_warning("Check file %s, error reading group %s, key %s: %s",
                   file, KF_GROUP_POS, key, error->message);
@@ -1111,7 +1165,7 @@
     }
 
     for (i = 0; i < length; i++)
-      list = g_slist_append(list, g_strdup(names[i]));
+        list = g_slist_append(list, g_strdup(names[i]));
 
     g_strfreev(names);
     return list;
@@ -1140,7 +1194,8 @@
     gsize dd_len;
 
     value = g_key_file_get_string(key_file, KF_GROUP_TOP, KF_KEY_GUID, &error);
-    if (error) {
+    if (error)
+    {
         g_warning("Check file %s, group %s, key %s, error: %s",
                   file, KF_GROUP_TOP, KF_KEY_GUID, error->message);
         g_error_free(error);
@@ -1154,10 +1209,13 @@
 
     format->title =
         g_key_file_get_string(key_file, KF_GROUP_TOP, KF_KEY_TITLE, &error);
-    if (!error) {
+    if (!error)
+    {
         g_debug("Check file %s, group %s, key %s, value: %s",
                 file, KF_GROUP_TOP, KF_KEY_TITLE, format->title);
-    } else {
+    }
+    else
+    {
         g_warning("Check file %s, group %s, key %s, error: %s",
                   file, KF_GROUP_TOP, KF_KEY_TITLE, error->message);
         return FALSE;
@@ -1166,50 +1224,65 @@
     format->blocking =
         g_key_file_get_boolean(key_file, KF_GROUP_TOP, KF_KEY_BLOCKING,
                                &error);
-    if (!error) {
+    if (!error)
+    {
         g_debug("Check file %s, group %s, key %s, value: %d",
                 file, KF_GROUP_TOP, KF_KEY_BLOCKING, format->blocking);
-    } else {
+    }
+    else
+    {
         if (!((error->domain == G_KEY_FILE_ERROR)
-              && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
             g_warning("Check file %s, group %s, key %s, error: %s",
                       file, KF_GROUP_TOP, KF_KEY_BLOCKING, error->message);
-           if( gnc_gconf_get_bool(GCONF_SECTION, KEY_BLOCKING_CHARS, NULL) ) {
-		format->blocking = TRUE;
-           } else {
-                format->blocking = FALSE;
-           }
+        if ( gnc_gconf_get_bool(GCONF_SECTION, KEY_BLOCKING_CHARS, NULL) )
+        {
+            format->blocking = TRUE;
+        }
+        else
+        {
+            format->blocking = FALSE;
+        }
         g_clear_error(&error);
     }
 
     format->print_date_format =
         g_key_file_get_boolean(key_file, KF_GROUP_TOP, KF_KEY_DATE_FORMAT,
                                &error);
-    if (!error) {
+    if (!error)
+    {
         g_debug("Check file %s, group %s, key %s, value: %d",
                 file, KF_GROUP_TOP, KF_KEY_DATE_FORMAT, format->print_date_format);
-    } else {
+    }
+    else
+    {
         if (!((error->domain == G_KEY_FILE_ERROR)
-              && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
             g_warning("Check file %s, group %s, key %s, error: %s",
                       file, KF_GROUP_TOP, KF_KEY_DATE_FORMAT, error->message);
-           if( gnc_gconf_get_bool(GCONF_SECTION, KEY_PRINT_DATE_FMT, NULL) ) {
-		format->print_date_format = TRUE;
-           } else {
-                format->print_date_format = FALSE;
-           }
+        if ( gnc_gconf_get_bool(GCONF_SECTION, KEY_PRINT_DATE_FMT, NULL) )
+        {
+            format->print_date_format = TRUE;
+        }
+        else
+        {
+            format->print_date_format = FALSE;
+        }
         g_clear_error(&error);
     }
 
     format->show_grid =
         g_key_file_get_boolean(key_file, KF_GROUP_TOP, KF_KEY_SHOW_GRID,
                                &error);
-    if (!error) {
+    if (!error)
+    {
         g_debug("Check file %s, group %s, key %s, value: %d",
                 file, KF_GROUP_TOP, KF_KEY_SHOW_GRID, format->show_grid);
-    } else {
+    }
+    else
+    {
         if (!((error->domain == G_KEY_FILE_ERROR)
-              && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
             g_warning("Check file %s, group %s, key %s, error: %s",
                       file, KF_GROUP_TOP, KF_KEY_SHOW_GRID, error->message);
         format->show_grid = FALSE;
@@ -1219,12 +1292,15 @@
     format->show_boxes =
         g_key_file_get_boolean(key_file, KF_GROUP_TOP, KF_KEY_SHOW_BOXES,
                                &error);
-    if (!error) {
+    if (!error)
+    {
         g_debug("Check file %s, group %s, key %s, value: %d",
                 file, KF_GROUP_TOP, KF_KEY_SHOW_BOXES, format->show_boxes);
-    } else {
+    }
+    else
+    {
         if (!((error->domain == G_KEY_FILE_ERROR)
-              && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
             g_warning("Check file %s, group %s, key %s, error: %s",
                       file, KF_GROUP_TOP, KF_KEY_SHOW_BOXES, error->message);
         format->show_boxes = FALSE;
@@ -1233,12 +1309,15 @@
 
     format->font =
         g_key_file_get_string(key_file, KF_GROUP_TOP, KF_KEY_FONT, &error);
-    if (!error) {
+    if (!error)
+    {
         g_debug("Check file %s, group %s, key %s, value: %s",
                 file, KF_GROUP_TOP, KF_KEY_FONT, format->font);
-    } else {
+    }
+    else
+    {
         if (!((error->domain == G_KEY_FILE_ERROR)
-              && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
             g_warning("Check file %s, group %s, key %s, error: %s",
                       file, KF_GROUP_TOP, KF_KEY_FONT, error->message);
         g_clear_error(&error);
@@ -1246,12 +1325,15 @@
 
     format->rotation =
         g_key_file_get_double(key_file, KF_GROUP_TOP, KF_KEY_ROTATION, &error);
-    if (!error) {
+    if (!error)
+    {
         g_debug("Check file %s, group %s, key %s, value: %f",
                 file, KF_GROUP_TOP, KF_KEY_ROTATION, format->rotation);
-    } else {
+    }
+    else
+    {
         if (!((error->domain == G_KEY_FILE_ERROR)
-              && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
             g_warning("Check file %s, group %s, key %s, error: %s",
                       file, KF_GROUP_TOP, KF_KEY_ROTATION, error->message);
         format->rotation = 0.0;
@@ -1260,23 +1342,29 @@
 
     dd = g_key_file_get_double_list(key_file, KF_GROUP_TOP, KF_KEY_TRANSLATION,
                                     &dd_len, &error);
-    if (!error) {
+    if (!error)
+    {
         value = doubles_to_string(dd, dd_len);
         g_debug("Check file %s, group %s, key %s, length %zd; values: %s",
                 file, KF_GROUP_TOP, KF_KEY_TRANSLATION, dd_len, value);
         g_free(value);
 
-        if (dd_len == 2) {
+        if (dd_len == 2)
+        {
             format->trans_x = dd[0];
             format->trans_y = dd[1];
-        } else {
+        }
+        else
+        {
             g_warning("Check file %s, error top %s, key %s: 2 values only",
                       file, KF_GROUP_TOP, KF_KEY_TRANSLATION);
         }
         g_free(dd);
-    } else {
+    }
+    else
+    {
         if (!((error->domain == G_KEY_FILE_ERROR)
-              && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
+                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
             g_warning("Check file %s, group top %s, key %s: %s",
                       file, KF_GROUP_ITEMS, KF_KEY_TRANSLATION, error->message);
         g_clear_error(&error);
@@ -1316,7 +1404,8 @@
     pathname = g_build_filename(dirname, file, (char *)NULL);
     key_file = gnc_key_file_load_from_file(pathname, FALSE, FALSE, NULL);
     g_free(pathname);
-    if (!key_file) {
+    if (!key_file)
+    {
         g_warning("Check file %s, cannot load file", file);
         return NULL;
     }
@@ -1324,13 +1413,15 @@
     format = g_new0(check_format_t, 1);
     format->group = groupname;
     format->filename = g_strdup(file);
-    if (format_read_general_info(file, key_file, format)) {
+    if (format_read_general_info(file, key_file, format))
+    {
         format->positions = format_read_multicheck_info(file, key_file, format);
         format->items = format_read_item_placement(file, key_file, format);
     }
 
     g_key_file_free(key_file);
-    if ((NULL == format->title) || (NULL == format->items)) {
+    if ((NULL == format->title) || (NULL == format->items))
+    {
         g_warning("Check file %s, no items read. Dropping file.", file);
         free_check_format(format);
         return NULL;
@@ -1358,7 +1449,8 @@
     if (dir == NULL)
         return;
 
-    while ((filename = g_dir_read_name(dir)) != NULL) {
+    while ((filename = g_dir_read_name(dir)) != NULL)
+    {
         if (g_str_has_prefix(filename, "#"))
             continue;
         if (!g_str_has_suffix(filename, ".chk"))
@@ -1369,26 +1461,29 @@
             continue;
 
         existing = find_existing_format(store, format->guid, NULL);
-        if (existing) {
+        if (existing)
+        {
             dialog = gtk_message_dialog_new
-                (GTK_WINDOW(pcd->dialog),
-                 GTK_DIALOG_DESTROY_WITH_PARENT,
-                 GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s",
-                 _("There is a duplicate check format file."));
+                     (GTK_WINDOW(pcd->dialog),
+                      GTK_DIALOG_DESTROY_WITH_PARENT,
+                      GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s",
+                      _("There is a duplicate check format file."));
             gtk_message_dialog_format_secondary_text
-                (GTK_MESSAGE_DIALOG(dialog),
-		 /* Translators: %1$s is the type of the first check
-		  * format (user defined or application defined); %2$s
-		  * is the filename of that format; %3$s the type of
-		  * the other check format; and %4$s the filename of
-		  * that other format. */
-                 _("The GUIDs in the %s check format file '%s' and "
-                   "the %s check format file '%s' match."),
-                 existing->group, existing->filename,
-                 format->group, format->filename);
+            (GTK_MESSAGE_DIALOG(dialog),
+             /* Translators: %1$s is the type of the first check
+              * format (user defined or application defined); %2$s
+              * is the filename of that format; %3$s the type of
+              * the other check format; and %4$s the filename of
+              * that other format. */
+             _("The GUIDs in the %s check format file '%s' and "
+               "the %s check format file '%s' match."),
+             existing->group, existing->filename,
+             format->group, format->filename);
             gtk_dialog_run(GTK_DIALOG(dialog));
             gtk_widget_destroy(dialog);
-        } else {
+        }
+        else
+        {
             gtk_list_store_append(store, &iter);
             gtk_list_store_set(store, &iter, COL_NAME, format->title,
                                COL_DATA, format, -1);
@@ -1399,7 +1494,8 @@
 
     /* If any files were added to the list, add a separator between
      *  this group and the next. */
-    if (found) {
+    if (found)
+    {
         gtk_list_store_append(store, &iter);
         gtk_list_store_set(store, &iter, COL_SEP, TRUE, -1);
     }
@@ -1444,18 +1540,18 @@
 static void
 initialize_format_combobox (PrintCheckDialog * pcd)
 {
-  GtkListStore *store;
-  GtkTreeIter iter;
+    GtkListStore *store;
+    GtkTreeIter iter;
 
-  store = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
-  read_formats(pcd, store);
-  gtk_list_store_append(store, &iter);
-  gtk_list_store_set(store, &iter, COL_NAME, _("Custom"), -1);
-  pcd->format_max = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store),NULL);
-  gtk_combo_box_set_model(GTK_COMBO_BOX(pcd->format_combobox),
-                          GTK_TREE_MODEL(store));
-  gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(pcd->format_combobox),
-                                       format_is_a_separator, NULL, NULL);
+    store = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
+    read_formats(pcd, store);
+    gtk_list_store_append(store, &iter);
+    gtk_list_store_set(store, &iter, COL_NAME, _("Custom"), -1);
+    pcd->format_max = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL);
+    gtk_combo_box_set_model(GTK_COMBO_BOX(pcd->format_combobox),
+                            GTK_TREE_MODEL(store));
+    gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(pcd->format_combobox),
+                                         format_is_a_separator, NULL, NULL);
 }
 
 
@@ -1468,96 +1564,99 @@
 gnc_ui_print_check_dialog_create(GncPluginPageRegister *plugin_page,
                                  Split *split)
 {
-  PrintCheckDialog * pcd;
-  GladeXML *xml;
-  GtkWidget *table;
-  GtkWindow *window;
-  gchar *font;
-  Transaction *trans;
+    PrintCheckDialog * pcd;
+    GladeXML *xml;
+    GtkWidget *table;
+    GtkWindow *window;
+    gchar *font;
+    Transaction *trans;
 
-  pcd = g_new0(PrintCheckDialog, 1);
-  pcd->plugin_page = plugin_page;
-  pcd->split = split;
+    pcd = g_new0(PrintCheckDialog, 1);
+    pcd->plugin_page = plugin_page;
+    pcd->split = split;
 
-  xml = gnc_glade_xml_new ("print.glade", "Print Check Dialog");
-  glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, pcd);
+    xml = gnc_glade_xml_new ("print.glade", "Print Check Dialog");
+    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, pcd);
 
-  pcd->xml = xml;
-  pcd->dialog = glade_xml_get_widget (xml, "Print Check Dialog");
+    pcd->xml = xml;
+    pcd->dialog = glade_xml_get_widget (xml, "Print Check Dialog");
 
-  /* now pick out the relevant child widgets */
-  pcd->format_combobox = glade_xml_get_widget (xml, "check_format_combobox");
-  pcd->position_combobox = glade_xml_get_widget (xml, "check_position_combobox");
+    /* now pick out the relevant child widgets */
+    pcd->format_combobox = glade_xml_get_widget (xml, "check_format_combobox");
+    pcd->position_combobox = glade_xml_get_widget (xml, "check_position_combobox");
 
-  pcd->custom_table = glade_xml_get_widget (xml, "custom_table");
-  pcd->payee_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "payee_x_entry"));
-  pcd->payee_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "payee_y_entry"));
-  pcd->date_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "date_x_entry"));
-  pcd->date_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "date_y_entry"));
-  pcd->words_x =
-    GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "amount_words_x_entry"));
-  pcd->words_y =
-    GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "amount_words_y_entry"));
-  pcd->number_x =
-    GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "amount_numbers_x_entry"));
-  pcd->number_y =
-    GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "amount_numbers_y_entry"));
-  pcd->notes_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "notes_x_entry"));
-  pcd->notes_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "notes_y_entry"));
-  pcd->memo_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "memo_x_entry"));
-  pcd->memo_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "memo_y_entry"));
-  pcd->address_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "address_x_entry"));
-  pcd->address_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "address_y_entry"));
-  pcd->splits_amount_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_amount_x_entry"));
-  pcd->splits_amount_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_amount_y_entry"));
-  pcd->splits_memo_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_memo_x_entry"));
-  pcd->splits_memo_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_memo_y_entry"));
-  pcd->splits_account_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_account_x_entry"));
-  pcd->splits_account_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_account_y_entry"));
-  pcd->translation_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "translation_x_entry"));
-  pcd->translation_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "translation_y_entry"));
-  pcd->translation_label = glade_xml_get_widget (xml, "translation_label");
-  pcd->check_rotation =
-    GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "check_rotation_entry"));
-  pcd->units_combobox = glade_xml_get_widget (xml, "units_combobox");
+    pcd->custom_table = glade_xml_get_widget (xml, "custom_table");
+    pcd->payee_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "payee_x_entry"));
+    pcd->payee_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "payee_y_entry"));
+    pcd->date_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "date_x_entry"));
+    pcd->date_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "date_y_entry"));
+    pcd->words_x =
+        GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "amount_words_x_entry"));
+    pcd->words_y =
+        GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "amount_words_y_entry"));
+    pcd->number_x =
+        GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "amount_numbers_x_entry"));
+    pcd->number_y =
+        GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "amount_numbers_y_entry"));
+    pcd->notes_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "notes_x_entry"));
+    pcd->notes_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "notes_y_entry"));
+    pcd->memo_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "memo_x_entry"));
+    pcd->memo_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "memo_y_entry"));
+    pcd->address_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "address_x_entry"));
+    pcd->address_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "address_y_entry"));
+    pcd->splits_amount_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_amount_x_entry"));
+    pcd->splits_amount_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_amount_y_entry"));
+    pcd->splits_memo_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_memo_x_entry"));
+    pcd->splits_memo_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_memo_y_entry"));
+    pcd->splits_account_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_account_x_entry"));
+    pcd->splits_account_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "splits_account_y_entry"));
+    pcd->translation_x = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "translation_x_entry"));
+    pcd->translation_y = GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "translation_y_entry"));
+    pcd->translation_label = glade_xml_get_widget (xml, "translation_label");
+    pcd->check_rotation =
+        GTK_SPIN_BUTTON(glade_xml_get_widget (xml, "check_rotation_entry"));
+    pcd->units_combobox = glade_xml_get_widget (xml, "units_combobox");
 
-  window = GTK_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
-  gtk_window_set_transient_for(GTK_WINDOW(pcd->dialog), window);
-  pcd->caller_window = GTK_WINDOW(window);
+    window = GTK_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
+    gtk_window_set_transient_for(GTK_WINDOW(pcd->dialog), window);
+    pcd->caller_window = GTK_WINDOW(window);
 
-  /* Create and attach the date-format chooser */
-  table = glade_xml_get_widget (xml, "options_table");
-  pcd->date_format = gnc_date_format_new_without_label();
-  gtk_table_attach_defaults(GTK_TABLE(table), pcd->date_format, 1, 3, 2, 7);
+    /* Create and attach the date-format chooser */
+    table = glade_xml_get_widget (xml, "options_table");
+    pcd->date_format = gnc_date_format_new_without_label();
+    gtk_table_attach_defaults(GTK_TABLE(table), pcd->date_format, 1, 3, 2, 7);
 
-  /* Default font (set in preferences) */
-  font = gnc_gconf_get_string(GCONF_SECTION, KEY_DEFAULT_FONT, NULL);
-  pcd->default_font = font ? font : g_strdup(DEFAULT_FONT);
+    /* Default font (set in preferences) */
+    font = gnc_gconf_get_string(GCONF_SECTION, KEY_DEFAULT_FONT, NULL);
+    pcd->default_font = font ? font : g_strdup(DEFAULT_FONT);
 
-  /* Update the combo boxes bases on the available check formats */
-  initialize_format_combobox(pcd);
+    /* Update the combo boxes bases on the available check formats */
+    initialize_format_combobox(pcd);
 
-  /* address */
-  pcd->check_address_name = glade_xml_get_widget( xml, "check_address_name");
-  pcd->check_address_1 = glade_xml_get_widget( xml, "check_address_1");
-  pcd->check_address_2 = glade_xml_get_widget( xml, "check_address_2");
-  pcd->check_address_3 = glade_xml_get_widget( xml, "check_address_3");
-  pcd->check_address_4 = glade_xml_get_widget( xml, "check_address_4");
-  /* fill in any available address data */
-  /* Can't access business objects e.g. Customer,Vendor,Employee because
-   * it would create build problems */
-  trans = xaccSplitGetParent(pcd->split);
-  if ( trans ) {
-    gtk_entry_set_text(GTK_ENTRY(pcd->check_address_name),xaccTransGetDescription(trans));
-  } else {
-    /* nothing to do - defaults to blank */
-  }
+    /* address */
+    pcd->check_address_name = glade_xml_get_widget( xml, "check_address_name");
+    pcd->check_address_1 = glade_xml_get_widget( xml, "check_address_1");
+    pcd->check_address_2 = glade_xml_get_widget( xml, "check_address_2");
+    pcd->check_address_3 = glade_xml_get_widget( xml, "check_address_3");
+    pcd->check_address_4 = glade_xml_get_widget( xml, "check_address_4");
+    /* fill in any available address data */
+    /* Can't access business objects e.g. Customer,Vendor,Employee because
+     * it would create build problems */
+    trans = xaccSplitGetParent(pcd->split);
+    if ( trans )
+    {
+        gtk_entry_set_text(GTK_ENTRY(pcd->check_address_name), xaccTransGetDescription(trans));
+    }
+    else
+    {
+        /* nothing to do - defaults to blank */
+    }
 
-  gtk_widget_destroy(glade_xml_get_widget (xml, "lower_left"));
+    gtk_widget_destroy(glade_xml_get_widget (xml, "lower_left"));
 
-  gnc_ui_print_restore_dialog(pcd);
-  gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pcd->dialog));
-  gtk_widget_show_all(pcd->dialog);
+    gnc_ui_print_restore_dialog(pcd);
+    gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pcd->dialog));
+    gtk_widget_show_all(pcd->dialog);
 }
 
 /********************************************************************\
@@ -1593,7 +1692,8 @@
     cairo_set_dash(cr, dash_pattern, 2, 0);
 
     /* Draw horizontal lines */
-    for (i = -200; i < (height + 200); i += 50) {
+    for (i = -200; i < (height + 200); i += 50)
+    {
         text = g_strdup_printf("%d", (int)i);
         cairo_move_to(cr, -200, i);
         cairo_line_to(cr, width + 200, i);
@@ -1605,7 +1705,8 @@
     }
 
     /* Draw vertical lines */
-    for (i = -200; i < (width + 200); i += 50) {
+    for (i = -200; i < (width + 200); i += 50)
+    {
         text = g_strdup_printf("%d", (int)i);
         cairo_move_to(cr, i, -200);
         cairo_line_to(cr, i, height + 200);
@@ -1639,26 +1740,32 @@
     CheckItemType ct;
 
     if ((NULL == text) || (strlen(text) == 0))
-      return 0.0;
+        return 0.0;
 
     /* Initialize for printing text */
     layout = gtk_print_context_create_pango_layout(context);
-    if (data->font) {
-      desc = pango_font_description_from_string(data->font);
-      pango_layout_set_font_description(layout, desc);
-      pango_font_description_free(desc);
-    } else {
-      pango_layout_set_font_description(layout, default_desc);
+    if (data->font)
+    {
+        desc = pango_font_description_from_string(data->font);
+        pango_layout_set_font_description(layout, desc);
+        pango_font_description_free(desc);
     }
+    else
+    {
+        pango_layout_set_font_description(layout, default_desc);
+    }
     pango_layout_set_alignment(layout,
                                data->w ? data->align : PANGO_ALIGN_LEFT);
     pango_layout_set_width(layout, data->w ? data->w * PANGO_SCALE : -1);
     pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
-    if ( data->blocking ) {
+    if ( data->blocking )
+    {
         new_text = g_strdup_printf("***%s***", text);
         pango_layout_set_text(layout, new_text, -1);
         g_free(new_text);
-    } else {
+    }
+    else
+    {
         pango_layout_set_text(layout, text, -1);
     }
     pango_layout_get_size(layout, &layout_width, &layout_height);
@@ -1669,7 +1776,8 @@
     cairo_save(cr);
 
     /* Clip text to the enclosing rectangle */
-    if (data->w && data->h) {
+    if (data->w && data->h)
+    {
         g_debug("Text clip rectangle, coords %f,%f, size %f,%f",
                 data->x, data->y - data->h, data->w, data->h);
         cairo_rectangle(cr, data->x, data->y - data->h, data->w, data->h);
@@ -1710,11 +1818,12 @@
 
     pkgdatadir = gnc_path_get_pkgdatadir();
     tmp_name = g_build_filename(pkgdatadir, CHECK_FMT_DIR, filename, (char *)NULL);
-    if (!g_file_test(tmp_name, G_FILE_TEST_EXISTS)) {
+    if (!g_file_test(tmp_name, G_FILE_TEST_EXISTS))
+    {
         g_free(tmp_name);
-	dirname = gnc_build_dotgnucash_path(CHECK_FMT_DIR);
-	tmp_name = g_build_filename(dirname, filename, (char *)NULL);
-	g_free(dirname);
+        dirname = gnc_build_dotgnucash_path(CHECK_FMT_DIR);
+        tmp_name = g_build_filename(dirname, filename, (char *)NULL);
+        g_free(dirname);
     }
     image = gtk_image_new_from_file(tmp_name);
     g_free(tmp_name);
@@ -1740,9 +1849,12 @@
     /* Get the picture. */
     image = GTK_IMAGE(read_image(data->filename));
     pixbuf = gtk_image_get_pixbuf(image);
-    if (pixbuf) {
+    if (pixbuf)
+    {
         g_object_ref(pixbuf);
-    } else {
+    }
+    else
+    {
         g_warning("Filename '%s' cannot be read or understood.",
                   data->filename);
         pixbuf = gtk_widget_render_icon(GTK_WIDGET(image),
@@ -1753,11 +1865,14 @@
     pix_h = gdk_pixbuf_get_height(pixbuf);
 
     /* Draw the enclosing rectangle */
-    if (data->w && data->h) {
+    if (data->w && data->h)
+    {
         cairo_rectangle(cr, data->x, data->y - data->h, data->w, data->h);
         g_debug("Picture clip rectangle, user coords %f,%f, user size %f,%f",
                 data->x, data->y - data->h, data->w, data->h);
-    } else {
+    }
+    else
+    {
         cairo_rectangle(cr, data->x, data->y - pix_h, pix_w, pix_h);
         g_debug("Picture clip rectangle, user coords %f,%f, pic size %d,%d",
                 data->x, data->y - data->h, pix_w, pix_h);
@@ -1772,7 +1887,8 @@
         scale_h = data->h / pix_h;
     scale = MIN(scale_w, scale_h);
 
-    if (scale != 1) {
+    if (scale != 1)
+    {
         scaled_pixbuf = gdk_pixbuf_scale_simple(pixbuf, pix_w * scale,
                                                 pix_h * scale,
                                                 GDK_INTERP_BILINEAR);
@@ -1780,7 +1896,9 @@
         gdk_cairo_set_source_pixbuf(cr, scaled_pixbuf, data->x,
                                     data->y - pix_h);
         g_object_unref(scaled_pixbuf);
-    } else {
+    }
+    else
+    {
         gdk_cairo_set_source_pixbuf(cr, pixbuf, data->x, data->y - pix_h);
     }
     g_object_unref(pixbuf);
@@ -1831,36 +1949,39 @@
 
     /* This is a date format string. It should only contain ascii. */
     cdn_fmt = g_string_new_len(NULL, 50);
-    for (c = date_format; c && *c; ) {
-        if ((c[0] != '%') || (c[1] == '\0')) {
+    for (c = date_format; c && *c; )
+    {
+        if ((c[0] != '%') || (c[1] == '\0'))
+        {
             c += 1;
             continue;
         }
-        switch (c[1]) {
-            case 'F':
-                cdn_fmt = g_string_append(cdn_fmt, "YYYYMMDD");
-                break;
-            case 'Y':
-                cdn_fmt = g_string_append(cdn_fmt, "YYYY");
-                break;
-            case 'y':
-                cdn_fmt = g_string_append(cdn_fmt, "YY");
-                break;
-            case 'm':
-                cdn_fmt = g_string_append(cdn_fmt, "MM");
-                break;
-            case 'd':
-            case 'e':
-                cdn_fmt = g_string_append(cdn_fmt, "DD");
-                break;
-            case 'x':
-                expanded = g_strdup_printf("%s%s",
-                                           qof_date_format_get_string(QOF_DATE_FORMAT_LOCALE),
-                                           c + 2);
-                c = expanded;
-                continue;
-            default:
-                break;
+        switch (c[1])
+        {
+        case 'F':
+            cdn_fmt = g_string_append(cdn_fmt, "YYYYMMDD");
+            break;
+        case 'Y':
+            cdn_fmt = g_string_append(cdn_fmt, "YYYY");
+            break;
+        case 'y':
+            cdn_fmt = g_string_append(cdn_fmt, "YY");
+            break;
+        case 'm':
+            cdn_fmt = g_string_append(cdn_fmt, "MM");
+            break;
+        case 'd':
+        case 'e':
+            cdn_fmt = g_string_append(cdn_fmt, "DD");
+            break;
+        case 'x':
+            expanded = g_strdup_printf("%s%s",
+                                       qof_date_format_get_string(QOF_DATE_FORMAT_LOCALE),
+                                       c + 2);
+            c = expanded;
+            continue;
+        default:
+            break;
         }
         c += 2;
     }
@@ -1905,90 +2026,92 @@
         default_desc = pango_font_description_from_string(pcd->default_font);
 
     /* Now put the actual data onto the page. */
-    for (elem = format->items; elem; elem = g_slist_next(elem)) {
+    for (elem = format->items; elem; elem = g_slist_next(elem))
+    {
         item = elem->data;
 
-        switch (item->type) {
-            case DATE:
-                date = g_date_new();
-                g_date_set_time_t(date, xaccTransGetDate(trans));
-                date_format =
-                    gnc_date_format_get_custom(GNC_DATE_FORMAT
-                                               (pcd->date_format));
-                g_date_strftime(buf, 100, date_format, date);
-                width = draw_text(context, buf, item, default_desc);
-		draw_date_format(context, date_format, item, default_desc, width);
-                g_date_free(date);
-                break;
+        switch (item->type)
+        {
+        case DATE:
+            date = g_date_new();
+            g_date_set_time_t(date, xaccTransGetDate(trans));
+            date_format =
+                gnc_date_format_get_custom(GNC_DATE_FORMAT
+                                           (pcd->date_format));
+            g_date_strftime(buf, 100, date_format, date);
+            width = draw_text(context, buf, item, default_desc);
+            draw_date_format(context, date_format, item, default_desc, width);
+            g_date_free(date);
+            break;
 
-            case PAYEE:
-                draw_text(context, xaccTransGetDescription(trans), item, default_desc);
-                break;
+        case PAYEE:
+            draw_text(context, xaccTransGetDescription(trans), item, default_desc);
+            break;
 
-            case NOTES:
-                draw_text(context, xaccTransGetNotes(trans), item, default_desc);
-                break;
+        case NOTES:
+            draw_text(context, xaccTransGetNotes(trans), item, default_desc);
+            break;
 
-            case MEMO:
-                draw_text(context, xaccSplitGetMemo(pcd->split), item, default_desc);
-                break;
+        case MEMO:
+            draw_text(context, xaccSplitGetMemo(pcd->split), item, default_desc);
+            break;
 
-            case ACTION:
-                draw_text(context, xaccSplitGetAction(pcd->split), item, default_desc);
-                break;
+        case ACTION:
+            draw_text(context, xaccSplitGetAction(pcd->split), item, default_desc);
+            break;
 
-            case CHECK_NUMBER:
-                draw_text(context, xaccTransGetNum(trans), item, default_desc);
-                break;
+        case CHECK_NUMBER:
+            draw_text(context, xaccTransGetNum(trans), item, default_desc);
+            break;
 
-            case AMOUNT_NUMBER:
-                info = gnc_default_print_info(FALSE);
-                draw_text(context, xaccPrintAmount(amount, info),
-                          item, default_desc);
-                break;
+        case AMOUNT_NUMBER:
+            info = gnc_default_print_info(FALSE);
+            draw_text(context, xaccPrintAmount(amount, info),
+                      item, default_desc);
+            break;
 
-            case AMOUNT_WORDS:
-                text = numeric_to_words(amount);
-                draw_text(context, text, item, default_desc);
-                g_free(text);
-                break;
+        case AMOUNT_WORDS:
+            text = numeric_to_words(amount);
+            draw_text(context, text, item, default_desc);
+            g_free(text);
+            break;
 
-            case TEXT:
-                draw_text(context, item->text, item, default_desc);
-                break;
+        case TEXT:
+            draw_text(context, item->text, item, default_desc);
+            break;
 
-            case ADDRESS:
-                address = get_check_address(pcd);
-                draw_text(context, address, item, default_desc);
-		g_free(address);
-                break;
+        case ADDRESS:
+            address = get_check_address(pcd);
+            draw_text(context, address, item, default_desc);
+            g_free(address);
+            break;
 
-            case SPLITS_AMOUNT:
-                text = get_check_splits_amount(pcd);
-                draw_text(context, text, item, default_desc);
-		g_free(text);
-                break;
+        case SPLITS_AMOUNT:
+            text = get_check_splits_amount(pcd);
+            draw_text(context, text, item, default_desc);
+            g_free(text);
+            break;
 
-            case SPLITS_MEMO:
-                text = get_check_splits_memo(pcd);
-                draw_text(context, text, item, default_desc);
-		g_free(text);
-                break;
+        case SPLITS_MEMO:
+            text = get_check_splits_memo(pcd);
+            draw_text(context, text, item, default_desc);
+            g_free(text);
+            break;
 
-            case SPLITS_ACCOUNT:
-                text = get_check_splits_account(pcd);
-                draw_text(context, text, item, default_desc);
-		g_free(text);
-                break;
+        case SPLITS_ACCOUNT:
+            text = get_check_splits_account(pcd);
+            draw_text(context, text, item, default_desc);
+            g_free(text);
+            break;
 
-            case PICTURE:
-                draw_picture(context, item);
-                break;
+        case PICTURE:
+            draw_picture(context, item);
+            break;
 
-            default:
-                text = g_strdup_printf("(unknown check field, type %d)", item->type);
-                draw_text(context, text, item, default_desc);
-                g_free(text);
+        default:
+            text = g_strdup_printf("(unknown check field, type %d)", item->type);
+            draw_text(context, text, item, default_desc);
+            g_free(text);
         }
     }
 
@@ -2010,7 +2133,8 @@
     cr = gtk_print_context_get_cairo_context(context);
 
     /* Now put the actual data onto the page. */
-    for (elem = format->items; elem; elem = g_slist_next(elem)) {
+    for (elem = format->items; elem; elem = g_slist_next(elem))
+    {
         item = elem->data;
         if (!item->w || !item->h)
             continue;
@@ -2039,7 +2163,8 @@
     g_debug("Page rotated by %f degrees", format->rotation);
 
     /* The grid is useful when determining check layouts */
-    if (format->show_grid) {
+    if (format->show_grid)
+    {
         draw_grid(context,
                   gtk_print_context_get_width(context),
                   gtk_print_context_get_height(context),
@@ -2048,11 +2173,14 @@
 
     /* Translate all subsequent check items if requested. */
     i = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
-    if ((i >= 0) && (i < pcd->position_max)) {
+    if ((i >= 0) && (i < pcd->position_max))
+    {
         y = format->height * i;
         cairo_translate(cr, 0, y);
         g_debug("Position translated by %f (pre-defined)", y);
-    } else {
+    }
+    else
+    {
         multip = pcd_get_custom_multip(pcd);
         x = multip * gtk_spin_button_get_value(pcd->translation_x);
         y = multip * gtk_spin_button_get_value(pcd->translation_y);
@@ -2063,7 +2191,7 @@
     /* Draw layout boxes if requested. Also useful when determining check
      * layouts. */
     if (format->show_boxes)
-      draw_page_boxes(context, page_nr, format, user_data);
+        draw_page_boxes(context, page_nr, format, user_data);
 
     /* Draw the actual check data. */
     draw_page_items(context, page_nr, format, user_data);
@@ -2228,91 +2356,96 @@
 static void
 gnc_print_check_set_sensitive (GtkWidget *widget, gpointer data)
 {
-  gboolean sensitive = GPOINTER_TO_INT(data);
-  gtk_widget_set_sensitive(widget, sensitive);
+    gboolean sensitive = GPOINTER_TO_INT(data);
+    gtk_widget_set_sensitive(widget, sensitive);
 }
 
 void
 gnc_print_check_format_changed (GtkComboBox *widget,
                                 PrintCheckDialog * pcd)
 {
-  GtkListStore *p_store;
-  GtkTreeModel *f_model;
-  GtkTreeIter f_iter;
-  gboolean sensitive;
-  gint pnum;
-  check_format_t *format;
-  gboolean separator;
-  GSList *elem;
+    GtkListStore *p_store;
+    GtkTreeModel *f_model;
+    GtkTreeIter f_iter;
+    gboolean sensitive;
+    gint pnum;
+    check_format_t *format;
+    gboolean separator;
+    GSList *elem;
 
-  if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(pcd->format_combobox), &f_iter))
-    return;
-  f_model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox));
-  gtk_tree_model_get(f_model, &f_iter, COL_DATA, &format, COL_SEP, &separator, -1);
-  if (separator)
-    return;
+    if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(pcd->format_combobox), &f_iter))
+        return;
+    f_model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox));
+    gtk_tree_model_get(f_model, &f_iter, COL_DATA, &format, COL_SEP, &separator, -1);
+    if (separator)
+        return;
 
-  pnum = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
+    pnum = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
 
-  /* Update the positions combobox */
-  pcd->selected_format = format;
-  p_store = gtk_list_store_new (1, G_TYPE_STRING);
-  gtk_combo_box_set_model(GTK_COMBO_BOX(pcd->position_combobox),
-                          GTK_TREE_MODEL(p_store));
-  if (format) {
-    pcd->position_max = g_slist_length(format->positions); /* -1 for 0 base, +1 for custom entry */
-    for (elem = format->positions; elem; elem = g_slist_next(elem)) {
-      gtk_combo_box_append_text(GTK_COMBO_BOX(pcd->position_combobox), elem->data);
+    /* Update the positions combobox */
+    pcd->selected_format = format;
+    p_store = gtk_list_store_new (1, G_TYPE_STRING);
+    gtk_combo_box_set_model(GTK_COMBO_BOX(pcd->position_combobox),
+                            GTK_TREE_MODEL(p_store));
+    if (format)
+    {
+        pcd->position_max = g_slist_length(format->positions); /* -1 for 0 base, +1 for custom entry */
+        for (elem = format->positions; elem; elem = g_slist_next(elem))
+        {
+            gtk_combo_box_append_text(GTK_COMBO_BOX(pcd->position_combobox), elem->data);
+        }
     }
-  } else {
-    pcd->position_max = 0;
-  }
-  gtk_combo_box_append_text(GTK_COMBO_BOX(pcd->position_combobox), _("Custom"));
-  pnum = MIN(pnum, pcd->position_max);
-  gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->position_combobox), pnum);
+    else
+    {
+        pcd->position_max = 0;
+    }
+    gtk_combo_box_append_text(GTK_COMBO_BOX(pcd->position_combobox), _("Custom"));
+    pnum = MIN(pnum, pcd->position_max);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->position_combobox), pnum);
 
-  /* If there's only one thing in the position combobox, make it insensitive */
-  sensitive = (pcd->position_max > 0);
-  gtk_widget_set_sensitive(GTK_WIDGET(pcd->position_combobox), sensitive);
+    /* If there's only one thing in the position combobox, make it insensitive */
+    sensitive = (pcd->position_max > 0);
+    gtk_widget_set_sensitive(GTK_WIDGET(pcd->position_combobox), sensitive);
 
-  /* Update the custom page */
-  sensitive = (!separator && !format);
-  gtk_container_foreach(GTK_CONTAINER(pcd->custom_table),
-			gnc_print_check_set_sensitive,
-			GINT_TO_POINTER(sensitive));
+    /* Update the custom page */
+    sensitive = (!separator && !format);
+    gtk_container_foreach(GTK_CONTAINER(pcd->custom_table),
+                          gnc_print_check_set_sensitive,
+                          GINT_TO_POINTER(sensitive));
 
-  /* Update address fields */
-  sensitive = check_format_has_address(pcd);
-  gtk_widget_set_sensitive(pcd->check_address_name,sensitive);
-  gtk_widget_set_sensitive(pcd->check_address_1,sensitive);
-  gtk_widget_set_sensitive(pcd->check_address_2,sensitive);
-  gtk_widget_set_sensitive(pcd->check_address_3,sensitive);
-  gtk_widget_set_sensitive(pcd->check_address_4,sensitive);
+    /* Update address fields */
+    sensitive = check_format_has_address(pcd);
+    gtk_widget_set_sensitive(pcd->check_address_name, sensitive);
+    gtk_widget_set_sensitive(pcd->check_address_1, sensitive);
+    gtk_widget_set_sensitive(pcd->check_address_2, sensitive);
+    gtk_widget_set_sensitive(pcd->check_address_3, sensitive);
+    gtk_widget_set_sensitive(pcd->check_address_4, sensitive);
 }
 
 void
 gnc_ui_print_check_response_cb(GtkDialog * dialog,
-			       gint response,
-			       PrintCheckDialog *pcd)
+                               gint response,
+                               PrintCheckDialog *pcd)
 {
-  switch (response) {
+    switch (response)
+    {
     case GTK_RESPONSE_HELP:
-      gnc_gnome_help(HF_HELP, HL_PRINTCHECK);
-      return;
+        gnc_gnome_help(HF_HELP, HL_PRINTCHECK);
+        return;
 
     case GTK_RESPONSE_OK:
-      gnc_ui_print_check_dialog_ok_cb(pcd);
-      gnc_ui_print_save_dialog(pcd);
-      gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
-      break;
+        gnc_ui_print_check_dialog_ok_cb(pcd);
+        gnc_ui_print_save_dialog(pcd);
+        gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
+        break;
 
     case GTK_RESPONSE_CANCEL:
-      gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
-      break;
-  }
+        gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
+        break;
+    }
 
-  gtk_widget_destroy(pcd->dialog);
-  g_object_unref(pcd->xml);
-  g_free(pcd->default_font);
-  g_free(pcd);
+    gtk_widget_destroy(pcd->dialog);
+    g_object_unref(pcd->xml);
+    g_free(pcd->default_font);
+    g_free(pcd);
 }

Modified: gnucash/trunk/src/gnome/dialog-progress.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-progress.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-progress.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -34,245 +34,245 @@
 
 struct _GNCProgressDialog
 {
-  GtkWidget *dialog;
+    GtkWidget *dialog;
 
-  GtkWidget *primary_label;
-  GtkWidget *secondary_label;
-  GtkWidget *progress_bar;
-  GtkWidget *sub_label;
-  GtkWidget *log;
+    GtkWidget *primary_label;
+    GtkWidget *secondary_label;
+    GtkWidget *progress_bar;
+    GtkWidget *sub_label;
+    GtkWidget *log;
 
-  GtkWidget *ok_button;
-  GtkWidget *cancel_button;
+    GtkWidget *ok_button;
+    GtkWidget *cancel_button;
 
-  /* The stack of virtual progress bars. */
-  GList     *bars;
-  /* The fraction of the current bar that is filled. */
-  gdouble    bar_value;
-  /* The value of the real (top-level) bar before the last push. */
-  gdouble    total_offset;
-  /* The product of all weights in the stack. */
-  gdouble    total_weight;
+    /* The stack of virtual progress bars. */
+    GList     *bars;
+    /* The fraction of the current bar that is filled. */
+    gdouble    bar_value;
+    /* The value of the real (top-level) bar before the last push. */
+    gdouble    total_offset;
+    /* The product of all weights in the stack. */
+    gdouble    total_weight;
 
-  GNCProgressCancelFunc cancel_func;
-  gpointer user_data;
+    GNCProgressCancelFunc cancel_func;
+    gpointer user_data;
 
-  SCM cancel_scm_func;
+    SCM cancel_scm_func;
 
-  gboolean use_ok_button;
-  gboolean closed;
-  gboolean finished;
-  gboolean destroyed;
-  gboolean title_set;
+    gboolean use_ok_button;
+    gboolean closed;
+    gboolean finished;
+    gboolean destroyed;
+    gboolean title_set;
 };
 
 typedef struct
 {
-  gdouble offset;
-  gdouble weight;
+    gdouble offset;
+    gdouble weight;
 } VirtualBar;
 
 static void
 gnc_progress_maybe_destroy(GNCProgressDialog *progress)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (!(progress->closed && progress->destroyed))
-    return;
+    if (!(progress->closed && progress->destroyed))
+        return;
 
-  if (progress->dialog != NULL)
-    gtk_widget_destroy(progress->dialog);
+    if (progress->dialog != NULL)
+        gtk_widget_destroy(progress->dialog);
 }
 
 
 static void
 ok_cb(GtkWidget * widget, gpointer data)
 {
-  GNCProgressDialog *progress = data;
+    GNCProgressDialog *progress = data;
 
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (progress->dialog != NULL)
-    gtk_widget_hide(progress->dialog);
-  progress->closed = TRUE;
-  gnc_progress_maybe_destroy(progress);
+    if (progress->dialog != NULL)
+        gtk_widget_hide(progress->dialog);
+    progress->closed = TRUE;
+    gnc_progress_maybe_destroy(progress);
 }
 
 
 static void
 cancel_cb(GtkWidget * widget, gpointer data)
 {
-  GNCProgressDialog *progress = data;
+    GNCProgressDialog *progress = data;
 
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (progress->cancel_func && !progress->cancel_func(progress->user_data))
-    return;
+    if (progress->cancel_func && !progress->cancel_func(progress->user_data))
+        return;
 
-  if (progress->cancel_scm_func != SCM_UNDEFINED)
-  {
-    SCM result;
+    if (progress->cancel_scm_func != SCM_UNDEFINED)
+    {
+        SCM result;
 
-    result = scm_call_0(progress->cancel_scm_func);
+        result = scm_call_0(progress->cancel_scm_func);
 
-    if (!scm_is_true(result))
-      return;
-  }
+        if (!scm_is_true(result))
+            return;
+    }
 
-  if (progress->dialog != NULL)
-    gtk_widget_hide(progress->dialog);
-  progress->closed = TRUE;
-  gnc_progress_maybe_destroy(progress);
+    if (progress->dialog != NULL)
+        gtk_widget_hide(progress->dialog);
+    progress->closed = TRUE;
+    gnc_progress_maybe_destroy(progress);
 }
 
 
 static gboolean
 delete_cb(GtkWidget *widget, GdkEvent  *event, gpointer data)
 {
-  GNCProgressDialog *progress = data;
+    GNCProgressDialog *progress = data;
 
-  g_return_val_if_fail(progress, TRUE);
+    g_return_val_if_fail(progress, TRUE);
 
-  if (progress->finished)
-  {
-    if (progress->dialog != NULL)
-      gtk_widget_hide(progress->dialog);
-    progress->closed = TRUE;
-    gnc_progress_maybe_destroy(progress);
-    return TRUE;
-  }
+    if (progress->finished)
+    {
+        if (progress->dialog != NULL)
+            gtk_widget_hide(progress->dialog);
+        progress->closed = TRUE;
+        gnc_progress_maybe_destroy(progress);
+        return TRUE;
+    }
 
-  if (progress->cancel_func)
-  {
-    if (progress->cancel_func(progress->user_data))
+    if (progress->cancel_func)
     {
-      if (progress->dialog != NULL)
-        gtk_widget_hide(progress->dialog);
-      progress->closed = TRUE;
-      gnc_progress_maybe_destroy(progress);
-      return TRUE;
+        if (progress->cancel_func(progress->user_data))
+        {
+            if (progress->dialog != NULL)
+                gtk_widget_hide(progress->dialog);
+            progress->closed = TRUE;
+            gnc_progress_maybe_destroy(progress);
+            return TRUE;
+        }
     }
-  }
 
-  if (progress->cancel_scm_func != SCM_UNDEFINED)
-  {
-    SCM result;
+    if (progress->cancel_scm_func != SCM_UNDEFINED)
+    {
+        SCM result;
 
-    result = scm_call_0(progress->cancel_scm_func);
+        result = scm_call_0(progress->cancel_scm_func);
 
-    if (scm_is_true(result))
-    {
-      if (progress->dialog != NULL)
-        gtk_widget_hide(progress->dialog);
-      progress->closed = TRUE;
-      gnc_progress_maybe_destroy(progress);
-      return TRUE;
+        if (scm_is_true(result))
+        {
+            if (progress->dialog != NULL)
+                gtk_widget_hide(progress->dialog);
+            progress->closed = TRUE;
+            gnc_progress_maybe_destroy(progress);
+            return TRUE;
+        }
     }
-  }
 
-  /* Don't delete the window, wait for gnc_progress_dialog_destroy. */
-  return TRUE;
+    /* Don't delete the window, wait for gnc_progress_dialog_destroy. */
+    return TRUE;
 }
 
 
 static void
 destroy_cb(GtkObject *object, gpointer data)
 {
-  GNCProgressDialog *progress = data;
+    GNCProgressDialog *progress = data;
 
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  /* Make sure the callbacks aren't invoked */
-  progress->cancel_func = NULL;
-  if (progress->cancel_scm_func != SCM_UNDEFINED)
-    scm_gc_unprotect_object(progress->cancel_scm_func);
-  progress->cancel_scm_func = SCM_UNDEFINED;
+    /* Make sure the callbacks aren't invoked */
+    progress->cancel_func = NULL;
+    if (progress->cancel_scm_func != SCM_UNDEFINED)
+        scm_gc_unprotect_object(progress->cancel_scm_func);
+    progress->cancel_scm_func = SCM_UNDEFINED;
 
-  g_free(progress);
+    g_free(progress);
 }
 
 
 static void
 gnc_progress_dialog_create(GtkWidget * parent, GNCProgressDialog *progress)
 {
-  GtkWidget *dialog;
-  GtkObject *tdo;
-  GladeXML  *xml;
+    GtkWidget *dialog;
+    GtkObject *tdo;
+    GladeXML  *xml;
 
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  xml = gnc_glade_xml_new("progress.glade", "Progress Dialog");
+    xml = gnc_glade_xml_new("progress.glade", "Progress Dialog");
 
-  dialog = glade_xml_get_widget(xml, "Progress Dialog");
-  progress->dialog = dialog;
-  tdo = GTK_OBJECT(dialog);
+    dialog = glade_xml_get_widget(xml, "Progress Dialog");
+    progress->dialog = dialog;
+    tdo = GTK_OBJECT(dialog);
 
-  /* parent */
-  if (parent != NULL)
-    gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent));
+    /* parent */
+    if (parent != NULL)
+        gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent));
 
-  g_signal_connect(tdo, "delete_event", G_CALLBACK(delete_cb), progress);
+    g_signal_connect(tdo, "delete_event", G_CALLBACK(delete_cb), progress);
 
-  g_signal_connect(tdo, "destroy", G_CALLBACK(destroy_cb), progress);
+    g_signal_connect(tdo, "destroy", G_CALLBACK(destroy_cb), progress);
 
-  progress->primary_label = glade_xml_get_widget(xml, "primary_label");
-  gtk_widget_hide(progress->primary_label);
+    progress->primary_label = glade_xml_get_widget(xml, "primary_label");
+    gtk_widget_hide(progress->primary_label);
 
-  progress->secondary_label = glade_xml_get_widget(xml, "secondary_label");
-  gtk_widget_hide(progress->secondary_label);
+    progress->secondary_label = glade_xml_get_widget(xml, "secondary_label");
+    gtk_widget_hide(progress->secondary_label);
 
-  progress->progress_bar = glade_xml_get_widget(xml, "progress_bar");
-  progress->total_offset = 0;
-  progress->total_weight = 1;
-  progress->bar_value = 0;
+    progress->progress_bar = glade_xml_get_widget(xml, "progress_bar");
+    progress->total_offset = 0;
+    progress->total_weight = 1;
+    progress->bar_value = 0;
 
-  progress->sub_label = glade_xml_get_widget(xml, "sub_label");
-  gtk_widget_hide(progress->sub_label);
+    progress->sub_label = glade_xml_get_widget(xml, "sub_label");
+    gtk_widget_hide(progress->sub_label);
 
-  progress->log = glade_xml_get_widget(xml, "progress_log");
-  gtk_widget_hide(glade_xml_get_widget(xml, "progress_log_window"));
+    progress->log = glade_xml_get_widget(xml, "progress_log");
+    gtk_widget_hide(glade_xml_get_widget(xml, "progress_log_window"));
 
-  progress->ok_button = glade_xml_get_widget(xml, "ok_button");
+    progress->ok_button = glade_xml_get_widget(xml, "ok_button");
 
-  g_signal_connect(progress->ok_button, "clicked",
-                   G_CALLBACK(ok_cb), progress);
+    g_signal_connect(progress->ok_button, "clicked",
+                     G_CALLBACK(ok_cb), progress);
 
-  if (!progress->use_ok_button)
-    gtk_widget_hide(progress->ok_button);
+    if (!progress->use_ok_button)
+        gtk_widget_hide(progress->ok_button);
 
-  progress->cancel_button = glade_xml_get_widget(xml, "cancel_button");
+    progress->cancel_button = glade_xml_get_widget(xml, "cancel_button");
 
-  g_signal_connect(progress->cancel_button, "clicked",
-                   G_CALLBACK(cancel_cb), progress);
+    g_signal_connect(progress->cancel_button, "clicked",
+                     G_CALLBACK(cancel_cb), progress);
 
-  progress->cancel_func = NULL;
-  progress->user_data = NULL;
+    progress->cancel_func = NULL;
+    progress->user_data = NULL;
 
-  progress->cancel_scm_func = SCM_UNDEFINED;
+    progress->cancel_scm_func = SCM_UNDEFINED;
 
-  progress->closed = FALSE;
-  progress->finished = FALSE;
-  progress->destroyed = FALSE;
-  progress->title_set = FALSE;
+    progress->closed = FALSE;
+    progress->finished = FALSE;
+    progress->destroyed = FALSE;
+    progress->title_set = FALSE;
 }
 
 
 GNCProgressDialog *
 gnc_progress_dialog_new(GtkWidget * parent, gboolean use_ok_button)
 {
-  GNCProgressDialog *progress;
+    GNCProgressDialog *progress;
 
-  progress = g_new0(GNCProgressDialog, 1);
+    progress = g_new0(GNCProgressDialog, 1);
 
-  progress->use_ok_button = use_ok_button;
+    progress->use_ok_button = use_ok_button;
 
-  gnc_progress_dialog_create(parent, progress);
+    gnc_progress_dialog_create(parent, progress);
 
-  gtk_widget_show(progress->dialog);
+    gtk_widget_show(progress->dialog);
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 
-  return progress;
+    return progress;
 }
 
 
@@ -283,53 +283,53 @@
                            GtkLabel       *suboperation,
                            GtkTextView    *log)
 {
-  GNCProgressDialog *progress;
+    GNCProgressDialog *progress;
 
-  progress = g_new0(GNCProgressDialog, 1);
+    progress = g_new0(GNCProgressDialog, 1);
 
-  /* Set up widgets. */
-  progress->dialog = NULL;
-  progress->primary_label = GTK_WIDGET(primary);
-  progress->secondary_label = GTK_WIDGET(secondary);
-  progress->progress_bar = GTK_WIDGET(bar);
-  progress->sub_label = GTK_WIDGET(suboperation);
-  progress->log = GTK_WIDGET(log);
-  progress->ok_button = NULL;
-  progress->cancel_button = NULL;
+    /* Set up widgets. */
+    progress->dialog = NULL;
+    progress->primary_label = GTK_WIDGET(primary);
+    progress->secondary_label = GTK_WIDGET(secondary);
+    progress->progress_bar = GTK_WIDGET(bar);
+    progress->sub_label = GTK_WIDGET(suboperation);
+    progress->log = GTK_WIDGET(log);
+    progress->ok_button = NULL;
+    progress->cancel_button = NULL;
 
-  /* Initialize all other items. */
-  progress->total_offset = 0;
-  progress->total_weight = 1;
-  progress->bar_value = 0;
-  progress->cancel_func = NULL;
-  progress->user_data = NULL;
-  progress->cancel_scm_func = SCM_UNDEFINED;
-  progress->use_ok_button = FALSE;
-  progress->closed = FALSE;
-  progress->finished = FALSE;
-  progress->destroyed = FALSE;
-  progress->title_set = FALSE;
+    /* Initialize all other items. */
+    progress->total_offset = 0;
+    progress->total_weight = 1;
+    progress->bar_value = 0;
+    progress->cancel_func = NULL;
+    progress->user_data = NULL;
+    progress->cancel_scm_func = SCM_UNDEFINED;
+    progress->use_ok_button = FALSE;
+    progress->closed = FALSE;
+    progress->finished = FALSE;
+    progress->destroyed = FALSE;
+    progress->title_set = FALSE;
 
-  return progress;
+    return progress;
 }
 
 
 void
 gnc_progress_dialog_set_title(GNCProgressDialog *progress, const char *title)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (!progress->dialog)
-    return;
+    if (!progress->dialog)
+        return;
 
-  if (title == NULL)
-    title = "";
+    if (title == NULL)
+        title = "";
 
-  gtk_window_set_title(GTK_WINDOW(progress->dialog), title);
+    gtk_window_set_title(GTK_WINDOW(progress->dialog), title);
 
-  progress->title_set = TRUE;
+    progress->title_set = TRUE;
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 
@@ -337,45 +337,45 @@
 gnc_progress_dialog_set_primary(GNCProgressDialog *progress,
                                 const gchar *str)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (progress->primary_label == NULL)
-    return;
+    if (progress->primary_label == NULL)
+        return;
 
-  if (str == NULL || *str == '\0')
-    gtk_widget_hide(progress->primary_label);
-  else
-  {
-    /* Display the primary text with the HIG-recommended style. */
-    char *markup = g_markup_printf_escaped("<span weight=\"bold\" size=\"larger\">%s</span>", str);
+    if (str == NULL || *str == '\0')
+        gtk_widget_hide(progress->primary_label);
+    else
+    {
+        /* Display the primary text with the HIG-recommended style. */
+        char *markup = g_markup_printf_escaped("<span weight=\"bold\" size=\"larger\">%s</span>", str);
 
-    gtk_label_set_markup(GTK_LABEL(progress->primary_label), markup);
-    g_free(markup);
-    gtk_widget_show(progress->primary_label);
-  }
+        gtk_label_set_markup(GTK_LABEL(progress->primary_label), markup);
+        g_free(markup);
+        gtk_widget_show(progress->primary_label);
+    }
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 
 void
 gnc_progress_dialog_set_heading(GNCProgressDialog *progress,
-                                 const char *heading)
+                                const char *heading)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (progress->primary_label == NULL)
-    return;
+    if (progress->primary_label == NULL)
+        return;
 
-  if (heading == NULL || *heading == '\0')
-    gtk_widget_hide(progress->primary_label);
-  else
-  {
-    gtk_label_set_text(GTK_LABEL(progress->primary_label), heading);
-    gtk_widget_show(progress->primary_label);
-  }
+    if (heading == NULL || *heading == '\0')
+        gtk_widget_hide(progress->primary_label);
+    else
+    {
+        gtk_label_set_text(GTK_LABEL(progress->primary_label), heading);
+        gtk_widget_show(progress->primary_label);
+    }
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 
@@ -383,20 +383,20 @@
 gnc_progress_dialog_set_secondary(GNCProgressDialog *progress,
                                   const gchar *str)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (progress->secondary_label == NULL)
-    return;
+    if (progress->secondary_label == NULL)
+        return;
 
-  if (str == NULL || *str == '\0')
-    gtk_widget_hide(progress->secondary_label);
-  else
-  {
-    gtk_label_set_text(GTK_LABEL(progress->secondary_label), str);
-    gtk_widget_show(progress->secondary_label);
-  }
+    if (str == NULL || *str == '\0')
+        gtk_widget_hide(progress->secondary_label);
+    else
+    {
+        gtk_label_set_text(GTK_LABEL(progress->secondary_label), str);
+        gtk_widget_show(progress->secondary_label);
+    }
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 
@@ -404,170 +404,170 @@
 gnc_progress_dialog_set_sub(GNCProgressDialog *progress,
                             const gchar *str)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (progress->sub_label == NULL)
-    return;
+    if (progress->sub_label == NULL)
+        return;
 
-  if (str == NULL || *str == '\0')
-    gtk_widget_hide(progress->sub_label);
-  else
-  {
-    /* Display the suboperation text with the HIG-recommended style. */
-    char *markup = g_markup_printf_escaped("<span style=\"italic\">%s</span>", str);
+    if (str == NULL || *str == '\0')
+        gtk_widget_hide(progress->sub_label);
+    else
+    {
+        /* Display the suboperation text with the HIG-recommended style. */
+        char *markup = g_markup_printf_escaped("<span style=\"italic\">%s</span>", str);
 
-    gtk_label_set_markup(GTK_LABEL(progress->sub_label), markup);
-    g_free(markup);
-    gtk_widget_show(progress->sub_label);
-  }
+        gtk_label_set_markup(GTK_LABEL(progress->sub_label), markup);
+        g_free(markup);
+        gtk_widget_show(progress->sub_label);
+    }
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 
 void
 gnc_progress_dialog_reset_log(GNCProgressDialog *progress)
 {
-  GtkTextBuffer *buf;
+    GtkTextBuffer *buf;
 
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (progress->log == NULL)
-    return;
+    if (progress->log == NULL)
+        return;
 
-  /* Reset the text buffer. */
-  buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(progress->log));
-  gtk_text_buffer_set_text(buf, "", -1);
-  gtk_text_buffer_set_modified(buf, FALSE);
+    /* Reset the text buffer. */
+    buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(progress->log));
+    gtk_text_buffer_set_text(buf, "", -1);
+    gtk_text_buffer_set_modified(buf, FALSE);
 
-  /* Show the log and its parent (in case it is in a scrolled window). */
-  gtk_widget_show(progress->log);
-  gtk_widget_show(gtk_widget_get_parent(progress->log));
+    /* Show the log and its parent (in case it is in a scrolled window). */
+    gtk_widget_show(progress->log);
+    gtk_widget_show(gtk_widget_get_parent(progress->log));
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 
 void
 gnc_progress_dialog_append_log(GNCProgressDialog *progress, const gchar *str)
 {
-  GtkTextBuffer *buf;
-  GtkTextIter    iter;
+    GtkTextBuffer *buf;
+    GtkTextIter    iter;
 
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (progress->log == NULL || !str || !*str)
-    return;
+    if (progress->log == NULL || !str || !*str)
+        return;
 
-  /* Append to the text buffer. */
-  buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(progress->log));
-  gtk_text_buffer_get_end_iter(buf, &iter);
-  gtk_text_buffer_insert(buf, &iter, str, -1);
+    /* Append to the text buffer. */
+    buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(progress->log));
+    gtk_text_buffer_get_end_iter(buf, &iter);
+    gtk_text_buffer_insert(buf, &iter, str, -1);
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 
 void
 gnc_progress_dialog_pause(GNCProgressDialog *progress)
 {
-  gchar *suffix;
+    gchar *suffix;
 
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  suffix = g_strconcat(" ", _("(paused)"), NULL);
+    suffix = g_strconcat(" ", _("(paused)"), NULL);
 
-  if (progress->sub_label && GTK_WIDGET_VISIBLE(progress->sub_label))
-  {
-    const gchar *txt = gtk_label_get_text(GTK_LABEL(progress->sub_label));
+    if (progress->sub_label && GTK_WIDGET_VISIBLE(progress->sub_label))
+    {
+        const gchar *txt = gtk_label_get_text(GTK_LABEL(progress->sub_label));
 
-    if (txt && !g_str_has_suffix(txt, suffix))
+        if (txt && !g_str_has_suffix(txt, suffix))
+        {
+            gchar *newtxt = g_strconcat(txt, suffix, NULL);
+            gnc_progress_dialog_set_sub(progress, newtxt);
+            g_free(newtxt);
+        }
+    }
+    else if (progress->dialog)
     {
-      gchar *newtxt = g_strconcat(txt, suffix, NULL);
-      gnc_progress_dialog_set_sub(progress, newtxt);
-      g_free(newtxt);
+        const gchar *txt = gtk_window_get_title(GTK_WINDOW(progress->dialog));
+
+        if (txt && !g_str_has_suffix(txt, suffix))
+        {
+            gchar *newtxt = g_strconcat(txt, suffix, NULL);
+            gtk_window_set_title(GTK_WINDOW(progress->dialog), newtxt);
+            g_free(newtxt);
+        }
     }
-  }
-  else if (progress->dialog)
-  {
-    const gchar *txt = gtk_window_get_title(GTK_WINDOW(progress->dialog));
-
-    if (txt && !g_str_has_suffix(txt, suffix))
+    else if (progress->primary_label &&
+             GTK_WIDGET_VISIBLE(progress->primary_label))
     {
-      gchar *newtxt = g_strconcat(txt, suffix, NULL);
-      gtk_window_set_title(GTK_WINDOW(progress->dialog), newtxt);
-      g_free(newtxt);
-    }
-  }
-  else if (progress->primary_label &&
-           GTK_WIDGET_VISIBLE(progress->primary_label))
-  {
-    const gchar *txt = gtk_label_get_text(GTK_LABEL(progress->primary_label));
+        const gchar *txt = gtk_label_get_text(GTK_LABEL(progress->primary_label));
 
-    if (txt && !g_str_has_suffix(txt, suffix))
-    {
-      gchar *newtxt = g_strconcat(txt, suffix, NULL);
-      gnc_progress_dialog_set_primary(progress, newtxt);
-      g_free(newtxt);
+        if (txt && !g_str_has_suffix(txt, suffix))
+        {
+            gchar *newtxt = g_strconcat(txt, suffix, NULL);
+            gnc_progress_dialog_set_primary(progress, newtxt);
+            g_free(newtxt);
+        }
     }
-  }
 
-  g_free(suffix);
+    g_free(suffix);
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 void
 gnc_progress_dialog_resume(GNCProgressDialog *progress)
 {
-  gchar *suffix;
+    gchar *suffix;
 
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  suffix = g_strconcat(" ", _("(paused)"), NULL);
+    suffix = g_strconcat(" ", _("(paused)"), NULL);
 
-  /* Remove any pause indication from the suboperation label. */
-  if (progress->sub_label)
-  {
-    const gchar *txt = gtk_label_get_text(GTK_LABEL(progress->sub_label));
+    /* Remove any pause indication from the suboperation label. */
+    if (progress->sub_label)
+    {
+        const gchar *txt = gtk_label_get_text(GTK_LABEL(progress->sub_label));
 
-    if (txt && g_str_has_suffix(txt, suffix))
-    {
-      gchar *newtxt = g_strndup(txt, strlen(txt) - strlen(suffix));
-      gnc_progress_dialog_set_sub(progress, newtxt);
-      g_free(newtxt);
+        if (txt && g_str_has_suffix(txt, suffix))
+        {
+            gchar *newtxt = g_strndup(txt, strlen(txt) - strlen(suffix));
+            gnc_progress_dialog_set_sub(progress, newtxt);
+            g_free(newtxt);
+        }
     }
-  }
 
-  /* Remove any pause indication from the window title. */
-  if (progress->dialog)
-  {
-    const gchar *txt = gtk_window_get_title(GTK_WINDOW(progress->dialog));
+    /* Remove any pause indication from the window title. */
+    if (progress->dialog)
+    {
+        const gchar *txt = gtk_window_get_title(GTK_WINDOW(progress->dialog));
 
-    if (txt && g_str_has_suffix(txt, suffix))
-    {
-      gchar *newtxt = g_strndup(txt, strlen(txt) - strlen(suffix));
-      gtk_window_set_title(GTK_WINDOW(progress->dialog), newtxt);
-      g_free(newtxt);
+        if (txt && g_str_has_suffix(txt, suffix))
+        {
+            gchar *newtxt = g_strndup(txt, strlen(txt) - strlen(suffix));
+            gtk_window_set_title(GTK_WINDOW(progress->dialog), newtxt);
+            g_free(newtxt);
+        }
     }
-  }
 
-  /* Remove any pause indication from the primary text. */
-  if (progress->primary_label)
-  {
-    const gchar *txt = gtk_label_get_text(GTK_LABEL(progress->primary_label));
+    /* Remove any pause indication from the primary text. */
+    if (progress->primary_label)
+    {
+        const gchar *txt = gtk_label_get_text(GTK_LABEL(progress->primary_label));
 
-    if (txt && g_str_has_suffix(txt, suffix))
-    {
-      gchar *newtxt = g_strndup(txt, strlen(txt) - strlen(suffix));
-      gnc_progress_dialog_set_primary(progress, newtxt);
-      g_free(newtxt);
+        if (txt && g_str_has_suffix(txt, suffix))
+        {
+            gchar *newtxt = g_strndup(txt, strlen(txt) - strlen(suffix));
+            gnc_progress_dialog_set_primary(progress, newtxt);
+            g_free(newtxt);
+        }
     }
-  }
 
-  g_free(suffix);
+    g_free(suffix);
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 
@@ -576,16 +576,16 @@
                                     GNCProgressCancelFunc cancel_func,
                                     gpointer user_data)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (progress->cancel_button == NULL)
-    return;
+    if (progress->cancel_button == NULL)
+        return;
 
-  progress->cancel_func = cancel_func;
-  progress->user_data = user_data;
+    progress->cancel_func = cancel_func;
+    progress->user_data = user_data;
 
-  if (cancel_func)
-    gtk_widget_show(progress->cancel_button);
+    if (cancel_func)
+        gtk_widget_show(progress->cancel_button);
 }
 
 
@@ -593,204 +593,204 @@
 gnc_progress_dialog_set_cancel_scm_func(GNCProgressDialog *progress,
                                         SCM cancel_scm_func)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (progress->cancel_button == NULL)
-    return;
+    if (progress->cancel_button == NULL)
+        return;
 
-  if (progress->cancel_scm_func != SCM_UNDEFINED)
-    scm_gc_unprotect_object(progress->cancel_scm_func);
+    if (progress->cancel_scm_func != SCM_UNDEFINED)
+        scm_gc_unprotect_object(progress->cancel_scm_func);
 
-  if (scm_is_procedure(cancel_scm_func))
-  {
-    progress->cancel_scm_func = cancel_scm_func;
-    scm_gc_protect_object(cancel_scm_func);
-    gtk_widget_show(progress->cancel_button);
-  }
-  else
-    progress->cancel_scm_func = SCM_UNDEFINED;
+    if (scm_is_procedure(cancel_scm_func))
+    {
+        progress->cancel_scm_func = cancel_scm_func;
+        scm_gc_protect_object(cancel_scm_func);
+        gtk_widget_show(progress->cancel_button);
+    }
+    else
+        progress->cancel_scm_func = SCM_UNDEFINED;
 }
 
 
 void
 gnc_progress_dialog_set_value(GNCProgressDialog *progress, gdouble value)
 {
-  GtkProgressBar *bar;
+    GtkProgressBar *bar;
 
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  /* Get the progress bar widget. */
-  bar = GTK_PROGRESS_BAR(progress->progress_bar);
-  if (bar == NULL)
-    return;
+    /* Get the progress bar widget. */
+    bar = GTK_PROGRESS_BAR(progress->progress_bar);
+    if (bar == NULL)
+        return;
 
-  /* Update the progress bar. If value is over 1,
-   * the bar will pulse instead of fill. */
-  if (value > 1)
-      gtk_progress_bar_pulse(bar);
-  else
-  {
-    progress->bar_value = value > 0 ? value : 0;
-    gtk_progress_bar_set_fraction(bar,
-      progress->total_offset + progress->bar_value * progress->total_weight);
-  }
+    /* Update the progress bar. If value is over 1,
+     * the bar will pulse instead of fill. */
+    if (value > 1)
+        gtk_progress_bar_pulse(bar);
+    else
+    {
+        progress->bar_value = value > 0 ? value : 0;
+        gtk_progress_bar_set_fraction(bar,
+                                      progress->total_offset + progress->bar_value * progress->total_weight);
+    }
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 
 guint
 gnc_progress_dialog_push(GNCProgressDialog *progress, gdouble weight)
 {
-  GtkProgressBar *bar;
-  VirtualBar     *newbar;
+    GtkProgressBar *bar;
+    VirtualBar     *newbar;
 
-  g_return_val_if_fail(progress, 0);
-  g_return_val_if_fail(weight > 0, 0);
+    g_return_val_if_fail(progress, 0);
+    g_return_val_if_fail(weight > 0, 0);
 
-  /* Get the progress bar widget. */
-  bar = GTK_PROGRESS_BAR(progress->progress_bar);
-  if (bar == NULL)
-    return 0;
+    /* Get the progress bar widget. */
+    bar = GTK_PROGRESS_BAR(progress->progress_bar);
+    if (bar == NULL)
+        return 0;
 
-  /* Create the new virtual progress bar. */
-  newbar = g_new0(VirtualBar, 1);
-  newbar->offset = progress->bar_value;
-  if (newbar->offset + weight > 1)
-    /* The requested weight is more than the unfilled portion of the bar. */
-    newbar->weight = 1 - newbar->offset;
-  else
-    newbar->weight = weight;
-  progress->bars = g_list_prepend(progress->bars, newbar);
+    /* Create the new virtual progress bar. */
+    newbar = g_new0(VirtualBar, 1);
+    newbar->offset = progress->bar_value;
+    if (newbar->offset + weight > 1)
+        /* The requested weight is more than the unfilled portion of the bar. */
+        newbar->weight = 1 - newbar->offset;
+    else
+        newbar->weight = weight;
+    progress->bars = g_list_prepend(progress->bars, newbar);
 
-  /* Set the total effective offset and weight */
-  progress->total_offset = gtk_progress_bar_get_fraction(bar);
-  progress->total_weight *= newbar->weight;
+    /* Set the total effective offset and weight */
+    progress->total_offset = gtk_progress_bar_get_fraction(bar);
+    progress->total_weight *= newbar->weight;
 
-  /* Set the new bar as unfilled. */
-  progress->bar_value = 0;
+    /* Set the new bar as unfilled. */
+    progress->bar_value = 0;
 
-  return g_list_length(progress->bars);
+    return g_list_length(progress->bars);
 }
 
 
 guint
 gnc_progress_dialog_pop(GNCProgressDialog *progress)
 {
-  VirtualBar     *bar;
+    VirtualBar     *bar;
 
-  g_return_val_if_fail(progress, 0);
+    g_return_val_if_fail(progress, 0);
 
-  /* Get the progress bar widget. */
-  if (progress->progress_bar == NULL || progress->bars == NULL)
-    return 0;
+    /* Get the progress bar widget. */
+    if (progress->progress_bar == NULL || progress->bars == NULL)
+        return 0;
 
-  /* Pop the bar off the bar stack. */
-  bar = progress->bars->data;
-  progress->bars = g_list_delete_link(progress->bars, progress->bars);
+    /* Pop the bar off the bar stack. */
+    bar = progress->bars->data;
+    progress->bars = g_list_delete_link(progress->bars, progress->bars);
 
-  /* Determine the value of the current bar. */
-  progress->bar_value = bar->offset + bar->weight * progress->bar_value;
+    /* Determine the value of the current bar. */
+    progress->bar_value = bar->offset + bar->weight * progress->bar_value;
 
-  /* Set the total effective offset and weight. */
-  if (progress->bars == NULL)
-  {
-    progress->total_offset = 0;
-    progress->total_weight = 1;
-  }
-  else
-  {
-    progress->total_offset -= bar->offset *
-                              ((VirtualBar *) progress->bars->data)->weight;
-    progress->total_weight /= bar->weight;
-  }
-  g_free(bar);
+    /* Set the total effective offset and weight. */
+    if (progress->bars == NULL)
+    {
+        progress->total_offset = 0;
+        progress->total_weight = 1;
+    }
+    else
+    {
+        progress->total_offset -= bar->offset *
+                                  ((VirtualBar *) progress->bars->data)->weight;
+        progress->total_weight /= bar->weight;
+    }
+    g_free(bar);
 
-  if (progress->bars == NULL)
-    return 0;
-  return g_list_length(progress->bars);
+    if (progress->bars == NULL)
+        return 0;
+    return g_list_length(progress->bars);
 }
 
 
 guint
 gnc_progress_dialog_pop_full(GNCProgressDialog *progress)
 {
-  gnc_progress_dialog_set_value(progress, 1);
-  return gnc_progress_dialog_pop(progress);
+    gnc_progress_dialog_set_value(progress, 1);
+    return gnc_progress_dialog_pop(progress);
 }
 
 
 void
 gnc_progress_dialog_reset_value(GNCProgressDialog *progress)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  /* Return to the top level. */
-  while (gnc_progress_dialog_pop(progress));
+    /* Return to the top level. */
+    while (gnc_progress_dialog_pop(progress));
 
-  /* Reset the bar to empty. */
-  gnc_progress_dialog_set_value(progress, 0);
+    /* Reset the bar to empty. */
+    gnc_progress_dialog_set_value(progress, 0);
 }
 
 
 void
 gnc_progress_dialog_update(GNCProgressDialog *progress)
 {
-  while (gtk_events_pending())
-    gtk_main_iteration();
+    while (gtk_events_pending())
+        gtk_main_iteration();
 }
 
 
 void
 gnc_progress_dialog_finish(GNCProgressDialog *progress)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  if (!progress->use_ok_button)
-  {
-    if (progress->dialog != NULL)
-      gtk_widget_hide(progress->dialog);
-    progress->closed = TRUE;
-  }
+    if (!progress->use_ok_button)
+    {
+        if (progress->dialog != NULL)
+            gtk_widget_hide(progress->dialog);
+        progress->closed = TRUE;
+    }
 
-  gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress->progress_bar), 1.0);
+    gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress->progress_bar), 1.0);
 
-  gtk_widget_set_sensitive(progress->ok_button, TRUE);
-  gtk_widget_set_sensitive(progress->cancel_button, FALSE);
+    gtk_widget_set_sensitive(progress->ok_button, TRUE);
+    gtk_widget_set_sensitive(progress->cancel_button, FALSE);
 
-  if (GTK_WIDGET_VISIBLE(progress->primary_label))
-    gnc_progress_dialog_set_heading(progress, _("Complete"));
+    if (GTK_WIDGET_VISIBLE(progress->primary_label))
+        gnc_progress_dialog_set_heading(progress, _("Complete"));
 
-  if (!progress->title_set)
-    gtk_window_set_title(GTK_WINDOW(progress->dialog), _("Complete"));
+    if (!progress->title_set)
+        gtk_window_set_title(GTK_WINDOW(progress->dialog), _("Complete"));
 
-  gtk_window_set_modal(GTK_WINDOW(progress->dialog), FALSE);
+    gtk_window_set_modal(GTK_WINDOW(progress->dialog), FALSE);
 
-  progress->finished = TRUE;
+    progress->finished = TRUE;
 
-  gnc_progress_dialog_update(progress);
+    gnc_progress_dialog_update(progress);
 }
 
 
 void
 gnc_progress_dialog_destroy(GNCProgressDialog *progress)
 {
-  g_return_if_fail(progress);
+    g_return_if_fail(progress);
 
-  /* Make sure the callbacks aren't invoked */
-  progress->cancel_func = NULL;
-  if (progress->cancel_scm_func != SCM_UNDEFINED)
-    scm_gc_unprotect_object(progress->cancel_scm_func);
-  progress->cancel_scm_func = SCM_UNDEFINED;
+    /* Make sure the callbacks aren't invoked */
+    progress->cancel_func = NULL;
+    if (progress->cancel_scm_func != SCM_UNDEFINED)
+        scm_gc_unprotect_object(progress->cancel_scm_func);
+    progress->cancel_scm_func = SCM_UNDEFINED;
 
-  if (!progress->finished)
-  {
-    if (progress->dialog != NULL)
-      gtk_widget_hide(progress->dialog);
-    progress->closed = TRUE;
-  }
+    if (!progress->finished)
+    {
+        if (progress->dialog != NULL)
+            gtk_widget_hide(progress->dialog);
+        progress->closed = TRUE;
+    }
 
-  progress->destroyed = TRUE;
+    progress->destroyed = TRUE;
 
-  gnc_progress_maybe_destroy(progress);
+    gnc_progress_maybe_destroy(progress);
 }

Modified: gnucash/trunk/src/gnome/dialog-progress.h
===================================================================
--- gnucash/trunk/src/gnome/dialog-progress.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-progress.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -63,17 +63,17 @@
  *  additional visual elements such as a Cancel button, text
  *  log, and additional labels can be activated by following
  *  with calls to some of the other API functions.
- *  
+ *
  *  @param parent The parent window for which the progress dialog
  *  becomes modal.
- *  
+ *
  *  @param use_ok_button If @c TRUE, an OK button is shown and must be
  *  clicked when progress is completed.
  *
  *  @return A ::GNCProgressDialog that identifies the dialog and
  *  is needed when making subsequent API calls. */
 GNCProgressDialog * gnc_progress_dialog_new(GtkWidget *parent,
-                                            gboolean use_ok_button);
+        gboolean use_ok_button);
 
 /** Creates a dialog for displaying the progress of an activity using
  *  existing widgets. This allows long-running operations to update the
@@ -95,10 +95,10 @@
  *  @return A ::GNCProgressDialog that identifies the dialog and
  *  is needed when making subsequent API calls. */
 GNCProgressDialog * gnc_progress_dialog_custom(GtkLabel       *primary,
-                                               GtkLabel       *secondary,
-                                               GtkProgressBar *bar,
-                                               GtkLabel       *suboperation,
-                                               GtkTextView    *log);
+        GtkLabel       *secondary,
+        GtkProgressBar *bar,
+        GtkLabel       *suboperation,
+        GtkTextView    *log);
 
 /** Set the title of a pop-up progress dialog. This function has no effect
  *  on dialogs registered using gnc_progress_dialog_custom().
@@ -190,8 +190,8 @@
  *
  *  @param user_data user data to be passed to @a cancel_func */
 void gnc_progress_dialog_set_cancel_func(GNCProgressDialog *progress,
-                                         GNCProgressCancelFunc cancel_func,
-                                         gpointer user_data);
+        GNCProgressCancelFunc cancel_func,
+        gpointer user_data);
 
 /** Show a Cancel button and set the Guile procedure that will be called
  *  when it is pressed by the user. It will be called after any C function
@@ -203,7 +203,7 @@
  *
  *  @param cancel_scm_func the Guile callback procedure */
 void gnc_progress_dialog_set_cancel_scm_func(GNCProgressDialog *progress,
-                                             SCM cancel_scm_func);
+        SCM cancel_scm_func);
 
 /** Set the fraction of the progress bar to fill, where 0 is empty and
  *  1 is full. If @a value is over 1, the bar will pulse instead of fill.
@@ -214,7 +214,7 @@
 void gnc_progress_dialog_set_value(GNCProgressDialog *progress, gdouble value);
 
 /** Create a new "virtual" progress bar that, as it becomes full, will fill
- *  the current bar by the fraction specified by @a weight. All calls to 
+ *  the current bar by the fraction specified by @a weight. All calls to
  *  gnc_progress_dialog_set_value() will operate on the new bar until
  *  gnc_progress_dialog_pop() is called.
  *
@@ -232,7 +232,7 @@
  *
  *  @param weight the requested fraction of the current bar that the new bar
  *  will represent (The fraction actually assigned will be the lesser of the
- *  requested amount and the amount of the bar that is unfilled.) 
+ *  requested amount and the amount of the bar that is unfilled.)
  *
  *  @return the number of times that gnc_progress_dialog_pop() would have to
  *  be called to return to the top level. */

Modified: gnucash/trunk/src/gnome/dialog-sx-editor.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-editor.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-sx-editor.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -106,7 +106,8 @@
 
 /** Datatypes ***********************************************************/
 
-typedef enum _EndTypeEnum {
+typedef enum _EndTypeEnum
+{
     END_NEVER,
     END_DATE,
     END_OCCUR,
@@ -177,7 +178,7 @@
 static gboolean sxed_confirmed_cancel( GncSxEditorDialog *sxed );
 
 static gboolean editor_component_sx_equality( gpointer find_data,
-                                              gpointer user_data );
+        gpointer user_data );
 
 static GtkActionEntry gnc_sxed_menu_entries [] =
 {
@@ -212,11 +213,13 @@
 
     reg = gnc_ledger_display_get_split_register( sxed->ledger );
     /* check for changes */
-    if ( gnc_sxed_check_changed( sxed ) ) {
+    if ( gnc_sxed_check_changed( sxed ) )
+    {
         const char *sx_changed_msg =
             _( "This SX has changed; are you "
                "sure you want to cancel?" );
-        if (!gnc_verify_dialog(sxed->dialog, FALSE, "%s", sx_changed_msg)) {
+        if (!gnc_verify_dialog(sxed->dialog, FALSE, "%s", sx_changed_msg))
+        {
             return FALSE;
         }
     }
@@ -255,7 +258,8 @@
 
     /* add to list */
     // @@fixme -- forget 'new'-flag: check for existance of the SX [?]
-    if ( sxed->newsxP ) {
+    if ( sxed->newsxP )
+    {
         book = gnc_get_current_book ();
         sxes = gnc_book_get_schedxactions(book);
         gnc_sxes_add_sx(sxes, sxed->sx);
@@ -284,13 +288,15 @@
         char *name;
 
         name = gtk_editable_get_chars( GTK_EDITABLE(sxed->nameEntry), 0, -1 );
-        if ( strlen(name) == 0 ) {
+        if ( strlen(name) == 0 )
+        {
             return TRUE;
 
         }
         if ( (xaccSchedXactionGetName(sxed->sx) == NULL)
-             || (strcmp( xaccSchedXactionGetName(sxed->sx),
-                         name ) != 0) ) {
+                || (strcmp( xaccSchedXactionGetName(sxed->sx),
+                            name ) != 0) )
+        {
             return TRUE;
         }
     }
@@ -298,35 +304,42 @@
     /* end options */
     {
         /* dialog says... no end */
-        if ( gtk_toggle_button_get_active( sxed->optEndNone ) ) {
+        if ( gtk_toggle_button_get_active( sxed->optEndNone ) )
+        {
             if ( xaccSchedXactionHasEndDate(sxed->sx)
-                 || xaccSchedXactionHasOccurDef(sxed->sx) ) {
+                    || xaccSchedXactionHasOccurDef(sxed->sx) )
+            {
                 return TRUE;
             }
         }
 
         /* dialog says... end date */
-        if ( gtk_toggle_button_get_active( sxed->optEndDate ) ) {
+        if ( gtk_toggle_button_get_active( sxed->optEndDate ) )
+        {
             GDate sxEndDate, dlgEndDate;
 
-            if ( ! xaccSchedXactionHasEndDate( sxed->sx ) ) {
+            if ( ! xaccSchedXactionHasEndDate( sxed->sx ) )
+            {
                 return TRUE;
             }
             sxEndDate = *xaccSchedXactionGetEndDate( sxed->sx );
             g_date_set_time_t( &dlgEndDate,
                                gnc_date_edit_get_date( sxed->
-                                                       endDateEntry ) );
+                                       endDateEntry ) );
 
-            if ( g_date_compare( &sxEndDate, &dlgEndDate ) != 0 ) {
+            if ( g_date_compare( &sxEndDate, &dlgEndDate ) != 0 )
+            {
                 return TRUE;
             }
         }
 
         /* dialog says... num occur */
-        if ( gtk_toggle_button_get_active( sxed->optEndCount ) ) {
+        if ( gtk_toggle_button_get_active( sxed->optEndCount ) )
+        {
             gint sxNumOccur, sxNumRem, dlgNumOccur, dlgNumRem;
 
-            if ( ! xaccSchedXactionGetNumOccur( sxed->sx ) ) {
+            if ( ! xaccSchedXactionGetNumOccur( sxed->sx ) )
+            {
                 return TRUE;
             }
 
@@ -340,7 +353,8 @@
             sxNumRem = xaccSchedXactionGetRemOccur( sxed->sx );
 
             if ( (dlgNumOccur != sxNumOccur)
-                 || (dlgNumRem != sxNumRem) ) {
+                    || (dlgNumRem != sxNumRem) )
+            {
                 return TRUE;
             }
         }
@@ -349,53 +363,59 @@
     /* SX options [autocreate, notify, reminder, advance] */
     {
         gboolean dlgEnabled,
-            dlgAutoCreate,
-            dlgNotify,
-            sxEnabled,
-            sxAutoCreate,
-            sxNotify;
+                 dlgAutoCreate,
+                 dlgNotify,
+                 sxEnabled,
+                 sxAutoCreate,
+                 sxNotify;
         gint dlgAdvance, sxAdvance;
         gint dlgRemind, sxRemind;
 
         dlgEnabled =
             gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(sxed->
-                                                            enabledOpt) );
+                                          enabledOpt) );
         dlgAutoCreate =
             gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(sxed->
-                                                            autocreateOpt) );
+                                          autocreateOpt) );
         dlgNotify =
             gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(sxed->
-                                                            notifyOpt) );
+                                          notifyOpt) );
 
         sxEnabled = xaccSchedXactionGetEnabled( sxed->sx );
-        if ( ! ((dlgEnabled == sxEnabled)) ) {
+        if ( ! ((dlgEnabled == sxEnabled)) )
+        {
             return TRUE;
         }
 
         xaccSchedXactionGetAutoCreate( sxed->sx, &sxAutoCreate, &sxNotify );
         if ( ! ((dlgAutoCreate == sxAutoCreate)
-                && (dlgNotify == sxNotify)) ) {
+                && (dlgNotify == sxNotify)) )
+        {
             return TRUE;
         }
 
         dlgAdvance = 0;
-        if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(sxed->advanceOpt) ) ) {
+        if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(sxed->advanceOpt) ) )
+        {
             dlgAdvance =
                 gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(sxed->
-                                                                  advanceSpin) );
+                                                  advanceSpin) );
         }
         sxAdvance = xaccSchedXactionGetAdvanceCreation( sxed->sx );
-        if ( dlgAdvance != sxAdvance ) {
+        if ( dlgAdvance != sxAdvance )
+        {
             return TRUE;
         }
 
         dlgRemind = 0;
-        if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(sxed->remindOpt) ) ) {
+        if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(sxed->remindOpt) ) )
+        {
             dlgRemind =
                 gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(sxed->remindSpin) );
         }
         sxRemind = xaccSchedXactionGetAdvanceReminder( sxed->sx );
-        if ( dlgRemind != sxRemind ) {
+        if ( dlgRemind != sxRemind )
+        {
             return TRUE;
         }
     }
@@ -432,7 +452,8 @@
         SplitRegister *sr =
             gnc_ledger_display_get_split_register( sxed->ledger );
 
-        if ( gnc_split_register_changed( sr ) ) {
+        if ( gnc_split_register_changed( sr ) )
+        {
             return TRUE;
         }
     }
@@ -444,7 +465,8 @@
  * Holds the credit- and debit-sum for a given Transaction, as used in
  * gnc_sxed_check_consistent.
  **/
-typedef struct _txnCreditDebitSums {
+typedef struct _txnCreditDebitSums
+{
     gnc_numeric creditSum;
     gnc_numeric debitSum;
 } txnCreditDebitSums;
@@ -469,25 +491,28 @@
     gboolean *unbalanced = (gboolean*)ud;
     *unbalanced |= !(gnc_numeric_zero_p(
                          gnc_numeric_sub_fixed( tcds->debitSum,
-                                                tcds->creditSum ) ));
+                                 tcds->creditSum ) ));
 
     if (qof_log_check(G_LOG_DOMAIN, QOF_LOG_DEBUG))
     {
         if ( gnc_numeric_zero_p( gnc_numeric_sub_fixed( tcds->debitSum,
-                                                        tcds->creditSum ) ) ) {
+                                 tcds->creditSum ) ) )
+        {
             g_debug( "%p | true [%s - %s = %s]",
                      key,
                      gnc_numeric_to_string( tcds->debitSum ),
                      gnc_numeric_to_string( tcds->creditSum ),
                      gnc_numeric_to_string(gnc_numeric_sub_fixed( tcds->debitSum,
-                                                                  tcds->creditSum )) );
-        } else {
+                                           tcds->creditSum )) );
+        }
+        else
+        {
             g_debug( "%p | false [%s - %s = %s]",
                      key,
                      gnc_numeric_to_string( tcds->debitSum ),
                      gnc_numeric_to_string( tcds->creditSum ),
                      gnc_numeric_to_string(gnc_numeric_sub_fixed( tcds->debitSum,
-                                                                  tcds->creditSum )) );
+                                           tcds->creditSum )) );
         }
     }
 }
@@ -561,7 +586,8 @@
         gnc_sx_get_variables( sxed->sx, vars );
 
         ttVarCount = g_hash_table_size( vars );
-        if ( ttVarCount != 0 ) {
+        if ( ttVarCount != 0 )
+        {
             /* balance with random variable bindings some number
              * of times in an attempt to ferret out
              * un-balanceable transactions.
@@ -575,7 +601,8 @@
         }
 
         srand(time(NULL));
-        for ( i=0; i < numIters && !unbalanceable; i++ ) {
+        for ( i = 0; i < numIters && !unbalanceable; i++ )
+        {
             gnc_sx_randomize_variables(vars);
             g_hash_table_foreach( txns, set_sums_to_zero, NULL );
             tmp = gnc_numeric_zero();
@@ -594,8 +621,8 @@
                 t = xaccSplitGetParent( s );
 
                 if ( !(tcds =
-                       (txnCreditDebitSums*)g_hash_table_lookup( txns,
-                                                                 (gpointer)t )) )
+                            (txnCreditDebitSums*)g_hash_table_lookup( txns,
+                                    (gpointer)t )) )
                 {
                     tcds = g_new0( txnCreditDebitSums, 1 );
                     tcds->creditSum = gnc_numeric_zero();
@@ -624,9 +651,11 @@
                                              GNC_SX_CREDIT_FORMULA,
                                              NULL );
                 if ( v
-                     && (str = kvp_value_get_string(v))
-                     && strlen( str ) != 0 ) {
-                    if ( gnc_sx_parse_vars_from_formula( str, vars, &tmp ) < 0 ) {
+                        && (str = kvp_value_get_string(v))
+                        && strlen( str ) != 0 )
+                {
+                    if ( gnc_sx_parse_vars_from_formula( str, vars, &tmp ) < 0 )
+                    {
                         GString *errStr;
 
                         errStr = g_string_sized_new( 32 );
@@ -650,9 +679,11 @@
                                              GNC_SX_DEBIT_FORMULA,
                                              NULL );
                 if ( v
-                     && (str = kvp_value_get_string(v))
-                     && strlen(str) != 0 ) {
-                    if ( gnc_sx_parse_vars_from_formula( str, vars, &tmp ) < 0 ) {
+                        && (str = kvp_value_get_string(v))
+                        && strlen(str) != 0 )
+                {
+                    if ( gnc_sx_parse_vars_from_formula( str, vars, &tmp ) < 0 )
+                    {
                         GString *errStr;
 
                         errStr = g_string_sized_new( 32 );
@@ -689,13 +720,14 @@
         g_hash_table_destroy(txns);
 
         if ( unbalanceable
-             && !gnc_verify_dialog( sxed->dialog, FALSE,
-                                    "%s",
-                                    _("The Scheduled Transaction Editor "
-                                      "cannot automatically balance "
-                                      "this transaction. "
-                                      "Should it still be "
-                                      "entered?") ) ) {
+                && !gnc_verify_dialog( sxed->dialog, FALSE,
+                                       "%s",
+                                       _("The Scheduled Transaction Editor "
+                                         "cannot automatically balance "
+                                         "this transaction. "
+                                         "Should it still be "
+                                         "entered?") ) )
+        {
             return FALSE;
         }
     }
@@ -708,7 +740,8 @@
         GList *sxList;
 
         name = gtk_editable_get_chars( GTK_EDITABLE(sxed->nameEntry), 0, -1 );
-        if ( strlen(name) == 0 ) {
+        if ( strlen(name) == 0 )
+        {
             const char *sx_has_no_name_msg =
                 _( "Please name the Scheduled Transaction." );
             gnc_error_dialog( sxed->dialog, "%s", sx_has_no_name_msg );
@@ -723,9 +756,10 @@
             (xaccSchedXactionGetName(sxed->sx) == NULL)
             || (strcmp( xaccSchedXactionGetName(sxed->sx), name ) != 0);
         for ( sxList =
-                  gnc_book_get_schedxactions(gnc_get_current_book())->sx_list;
-              nameHasChanged && !nameExists && sxList;
-              sxList = sxList->next ) {
+                    gnc_book_get_schedxactions(gnc_get_current_book())->sx_list;
+                nameHasChanged && !nameExists && sxList;
+                sxList = sxList->next )
+        {
             char *existingName, *existingNameKey;
             existingName =
                 xaccSchedXactionGetName( (SchedXaction*)sxList->
@@ -734,7 +768,8 @@
             nameExists |= ( strcmp(nameKey, existingNameKey) == 0 );
             g_free( existingNameKey );
         }
-        if ( nameHasChanged && nameExists ) {
+        if ( nameHasChanged && nameExists )
+        {
             const char *sx_has_existing_name_msg =
                 _( "A Scheduled Transaction with the "
                    "name \"%s\" already exists. "
@@ -742,7 +777,8 @@
                    "this one the same?" );
             if ( ! gnc_verify_dialog( sxed->dialog, FALSE,
                                       sx_has_existing_name_msg,
-                                      name) ) {
+                                      name) )
+            {
                 g_free( nameKey );
                 g_free( name );
                 return FALSE;
@@ -763,7 +799,8 @@
             gtk_toggle_button_get_active(
                 GTK_TOGGLE_BUTTON(sxed->notifyOpt) );
 
-        if (((ttVarCount > 0) || multi_commodity) && autocreateState) {
+        if (((ttVarCount > 0) || multi_commodity) && autocreateState)
+        {
             gnc_warning_dialog(sxed->dialog, "%s",
                                _("Scheduled Transactions with variables "
                                  "cannot be automatically created."));
@@ -772,10 +809,11 @@
 
         /* Fix for part of Bug#121740 -- auto-create transactions are
          * only valid if there's actually a transaction to create. */
-        if ( autocreateState && splitCount == 0 ) {
+        if ( autocreateState && splitCount == 0 )
+        {
             gnc_warning_dialog(sxed->dialog, "%s",
-                                _("Scheduled Transactions without a template "
-                                  "transaction cannot be automatically created.") );
+                               _("Scheduled Transactions without a template "
+                                 "transaction cannot be automatically created.") );
             return FALSE;
         }
     }
@@ -785,15 +823,17 @@
         GDate startDate, endDate, nextDate;
 
         if ( !gtk_toggle_button_get_active(sxed->optEndDate)
-             && !gtk_toggle_button_get_active(sxed->optEndCount)
-             && !gtk_toggle_button_get_active(sxed->optEndNone) ) {
+                && !gtk_toggle_button_get_active(sxed->optEndCount)
+                && !gtk_toggle_button_get_active(sxed->optEndNone) )
+        {
             const char *sx_end_spec_msg =
                 _( "Please provide a valid end selection." );
             gnc_error_dialog( sxed->dialog, "%s", sx_end_spec_msg );
             return FALSE;
         }
 
-        if ( gtk_toggle_button_get_active(sxed->optEndCount)) {
+        if ( gtk_toggle_button_get_active(sxed->optEndCount))
+        {
             gint occur, rem;
 
             occur  =
@@ -802,7 +842,8 @@
             rem =
                 gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(sxed->endRemainSpin) );
 
-            if ( occur == 0 ) {
+            if ( occur == 0 )
+            {
                 const char *sx_occur_count_zero_msg =
                     _( "There must be some number of occurrences." );
                 gnc_error_dialog( sxed->dialog, "%s",
@@ -810,7 +851,8 @@
                 return FALSE;
             }
 
-            if ( rem > occur ) {
+            if ( rem > occur )
+            {
                 const char *sx_occur_counts_wrong_msg =
                     _( "The number of remaining occurrences "
                        "(%d) is greater than the number of "
@@ -824,10 +866,11 @@
         }
 
         g_date_clear( &endDate, 1 );
-        if ( gtk_toggle_button_get_active(sxed->optEndDate) ) {
+        if ( gtk_toggle_button_get_active(sxed->optEndDate) )
+        {
             g_date_set_time_t( &endDate,
                                gnc_date_edit_get_date( sxed->
-                                                       endDateEntry ) );
+                                       endDateEntry ) );
         }
 
         g_date_clear(&nextDate, 1);
@@ -840,7 +883,7 @@
         recurrenceListFree(&schedule);
 
         if (!g_date_valid(&nextDate)
-            || (g_date_valid(&endDate) && (g_date_compare(&nextDate, &endDate) > 0)))
+                || (g_date_valid(&endDate) && (g_date_compare(&nextDate, &endDate) > 0)))
         {
             const char *invalid_sx_check_msg =
                 _("You have attempted to create a Scheduled "
@@ -861,7 +904,7 @@
 static void
 gnc_sxed_save_sx( GncSxEditorDialog *sxed )
 {
-	gnc_sx_begin_edit( sxed->sx );
+    gnc_sx_begin_edit( sxed->sx );
 
     /* name */
     {
@@ -876,7 +919,8 @@
     {
         GDate gdate;
 
-        if ( gtk_toggle_button_get_active(sxed->optEndDate) ) {
+        if ( gtk_toggle_button_get_active(sxed->optEndDate) )
+        {
             /* get the end date data */
             g_date_set_time_t( &gdate,
                                gnc_date_edit_get_date(
@@ -884,7 +928,9 @@
             xaccSchedXactionSetEndDate( sxed->sx, &gdate );
             /* set the num occurances data */
             xaccSchedXactionSetNumOccur( sxed->sx, 0 );
-        } else if ( gtk_toggle_button_get_active(sxed->optEndCount) ) {
+        }
+        else if ( gtk_toggle_button_get_active(sxed->optEndCount) )
+        {
             gint num;
 
             /* get the occurances data */
@@ -898,11 +944,15 @@
 
             g_date_clear( &gdate, 1 );
             xaccSchedXactionSetEndDate( sxed->sx, &gdate );
-        } else if ( gtk_toggle_button_get_active( sxed->optEndNone ) ) {
+        }
+        else if ( gtk_toggle_button_get_active( sxed->optEndNone ) )
+        {
             xaccSchedXactionSetNumOccur( sxed->sx, 0 );
             g_date_clear( &gdate, 1 );
             xaccSchedXactionSetEndDate( sxed->sx, &gdate );
-        } else {
+        }
+        else
+        {
             g_critical("no valid end specified\n");
         }
     }
@@ -933,14 +983,16 @@
         int daysInAdvance;
 
         daysInAdvance = 0;
-        if ( gtk_toggle_button_get_active( sxed->advanceOpt ) ) {
+        if ( gtk_toggle_button_get_active( sxed->advanceOpt ) )
+        {
             daysInAdvance =
                 gtk_spin_button_get_value_as_int( sxed->advanceSpin );
         }
         xaccSchedXactionSetAdvanceCreation( sxed->sx, daysInAdvance );
 
         daysInAdvance = 0;
-        if ( gtk_toggle_button_get_active( sxed->remindOpt ) ) {
+        if ( gtk_toggle_button_get_active( sxed->remindOpt ) )
+        {
             daysInAdvance =
                 gtk_spin_button_get_value_as_int( sxed->remindSpin );
         }
@@ -965,7 +1017,7 @@
         xaccSchedXactionSetStartDate( sxed->sx, &gdate );
     }
 
-	gnc_sx_commit_edit( sxed->sx );
+    gnc_sx_commit_edit( sxed->sx );
 }
 
 static void
@@ -977,7 +1029,8 @@
 static void
 autocreate_toggled( GtkObject *o, GncSxEditorDialog *sxed )
 {
-    if ( !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(o)) ) {
+    if ( !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(o)) )
+    {
         gtk_toggle_button_set_active( sxed->notifyOpt, FALSE );
     }
     gtk_widget_set_sensitive( GTK_WIDGET(sxed->notifyOpt),
@@ -992,7 +1045,8 @@
 
     spinName = (gchar*)g_object_get_data( G_OBJECT(o), "whichOneAmI" );
     spin = glade_xml_get_widget( sxed->gxml, spinName );
-    if ( !spin ) {
+    if ( !spin )
+    {
         g_critical("Error getting widget with name \"%s\"", spinName);
         return;
     }
@@ -1012,7 +1066,7 @@
         return;
 
     gnc_unregister_gui_component_by_data
-        (DIALOG_SCHEDXACTION_EDITOR_CM_CLASS, sxed);
+    (DIALOG_SCHEDXACTION_EDITOR_CM_CLASS, sxed);
 
     gnc_embedded_window_close_page(sxed->embed_window, sxed->plugin_page);
     gtk_widget_destroy(GTK_WIDGET(sxed->embed_window));
@@ -1023,7 +1077,8 @@
     g_free (sxed->sxGUIDstr);
     sxed->sxGUIDstr = NULL;
 
-    if ( sxed->newsxP ) {
+    if ( sxed->newsxP )
+    {
         /* FIXME: WTF???
          *
          * "WTF" explaination: in the "new" click from the caller, we
@@ -1032,7 +1087,7 @@
          * "Cancel" is clicked, the flag will still be true, and this
          * SX will be cleaned, here. -- jsled
          */
-		gnc_sx_begin_edit( sxed->sx );
+        gnc_sx_begin_edit( sxed->sx );
         xaccSchedXactionDestroy( sxed->sx );
     }
     sxed->sx = NULL;
@@ -1048,11 +1103,13 @@
 
     /* We've already processed the SX, likely because of "ok" being
      * clicked. */
-    if ( sxed->sx == NULL ) {
+    if ( sxed->sx == NULL )
+    {
         return FALSE;
     }
 
-    if ( ! sxed_confirmed_cancel( sxed ) ) {
+    if ( ! sxed_confirmed_cancel( sxed ) )
+    {
         return TRUE;
     }
     return FALSE;
@@ -1102,19 +1159,21 @@
 
 GncSxEditorDialog *
 gnc_ui_scheduled_xaction_editor_dialog_create(SchedXaction *sx,
-                                              gboolean newSX)
+        gboolean newSX)
 {
     GncSxEditorDialog *sxed;
     GtkWidget *button;
     int i;
     GList *dlgExists = NULL;
 
-    static struct widgetSignalCallback {
+    static struct widgetSignalCallback
+    {
         char     *name;
         char     *signal;
         void     (*fn)();
         gpointer objectData;
-    } widgets[] = {
+    } widgets[] =
+    {
         { "ok_button",      "clicked", editor_ok_button_clicked,     NULL },
         { "cancel_button",  "clicked", editor_cancel_button_clicked, NULL },
         { "help_button",    "clicked", editor_help_button_clicked,   NULL },
@@ -1136,7 +1195,8 @@
     dlgExists = gnc_find_gui_components( DIALOG_SCHEDXACTION_EDITOR_CM_CLASS,
                                          editor_component_sx_equality,
                                          sx );
-    if ( dlgExists != NULL ) {
+    if ( dlgExists != NULL )
+    {
         g_debug( "dialog already exists; using that one." );
         sxed = (GncSxEditorDialog*)dlgExists->data;
         gtk_window_present( GTK_WINDOW(sxed->dialog) );
@@ -1184,9 +1244,11 @@
                       G_CALLBACK(scheduledxaction_editor_dialog_destroy),
                       sxed );
 
-    for ( i=0; widgets[i].name != NULL; i++ ) {
+    for ( i = 0; widgets[i].name != NULL; i++ )
+    {
         button = glade_xml_get_widget( sxed->gxml, widgets[i].name );
-        if ( widgets[i].objectData != NULL ) {
+        if ( widgets[i].objectData != NULL )
+        {
             g_object_set_data( G_OBJECT(button), "whichOneAmI",
                                widgets[i].objectData );
         }
@@ -1250,7 +1312,7 @@
     b = GTK_BOX(glade_xml_get_widget( sxed->gxml, "gncfreq_hbox" ));
     sxed->gncfreq =
         GNC_FREQUENCY(gnc_frequency_new_from_recurrence(gnc_sx_get_schedule(sxed->sx),
-                                                        xaccSchedXactionGetStartDate(sxed->sx)));
+                      xaccSchedXactionGetStartDate(sxed->sx)));
     g_assert(sxed->gncfreq);
     g_signal_connect( sxed->gncfreq, "changed",
                       G_CALLBACK(gnc_sxed_freq_changed),
@@ -1258,7 +1320,7 @@
     gtk_container_add( GTK_CONTAINER(b), GTK_WIDGET(sxed->gncfreq) );
 
     b = GTK_BOX(glade_xml_get_widget( sxed->gxml, "example_cal_hbox" ));
-    sxed->dense_cal_model = gnc_dense_cal_store_new(EX_CAL_NUM_MONTHS*31);
+    sxed->dense_cal_model = gnc_dense_cal_store_new(EX_CAL_NUM_MONTHS * 31);
     sxed->example_cal = GNC_DENSE_CAL(gnc_dense_cal_new_with_model(GNC_DENSE_CAL_MODEL(sxed->dense_cal_model)));
     g_assert(sxed->example_cal);
     gnc_dense_cal_set_num_months( sxed->example_cal, EX_CAL_NUM_MONTHS );
@@ -1327,23 +1389,28 @@
     gboolean enabledState, autoCreateState, notifyState;
 
     name = xaccSchedXactionGetName(sxed->sx);
-    if ( name != NULL ) {
+    if ( name != NULL )
+    {
         gtk_entry_set_text( GTK_ENTRY(sxed->nameEntry), name  );
     }
     {
         gd = xaccSchedXactionGetLastOccurDate( sxed->sx );
-        if ( g_date_valid( gd ) ) {
+        if ( g_date_valid( gd ) )
+        {
             gchar dateBuf[ MAX_DATE_LENGTH+1 ];
-            qof_print_gdate( dateBuf,MAX_DATE_LENGTH, gd );
+            qof_print_gdate( dateBuf, MAX_DATE_LENGTH, gd );
             gtk_label_set_text( sxed->lastOccurLabel, dateBuf );
-        } else {
+        }
+        else
+        {
             gtk_label_set_text( sxed->lastOccurLabel, _( "(never)" ) );
         }
         gd = NULL;
     }
 
     gd = xaccSchedXactionGetEndDate( sxed->sx );
-    if ( g_date_valid( gd ) ) {
+    if ( g_date_valid( gd ) )
+    {
         gtk_toggle_button_set_active( sxed->optEndDate, TRUE );
         /* fill in date data. */
         tmpTm = g_new0( struct tm, 1 );
@@ -1353,7 +1420,9 @@
         gnc_date_edit_set_time( sxed->endDateEntry, tmpDate );
 
         set_endgroup_toggle_states( sxed, END_DATE );
-    } else if ( xaccSchedXactionHasOccurDef( sxed->sx ) ) {
+    }
+    else if ( xaccSchedXactionHasOccurDef( sxed->sx ) )
+    {
         gint numOccur = xaccSchedXactionGetNumOccur( sxed->sx );
         gint numRemain = xaccSchedXactionGetRemOccur( sxed->sx );
 
@@ -1363,7 +1432,9 @@
         gtk_spin_button_set_value ( GTK_SPIN_BUTTON(sxed->endRemainSpin), numRemain );
 
         set_endgroup_toggle_states( sxed, END_OCCUR );
-    } else {
+    }
+    else
+    {
         gtk_toggle_button_set_active( sxed->optEndNone, TRUE );
         set_endgroup_toggle_states( sxed, END_NEVER );
     }
@@ -1372,52 +1443,65 @@
     gtk_toggle_button_set_active( sxed->enabledOpt, enabledState );
 
     /* Do auto-create/notify setup */
-    if ( sxed->newsxP ) {
+    if ( sxed->newsxP )
+    {
         autoCreateState =
             gnc_gconf_get_bool( SXED_GCONF_SECTION, KEY_CREATE_AUTO, NULL );
         notifyState =
             gnc_gconf_get_bool( SXED_GCONF_SECTION, KEY_NOTIFY, NULL );
-    } else {
+    }
+    else
+    {
         xaccSchedXactionGetAutoCreate( sxed->sx,
                                        &autoCreateState,
                                        &notifyState );
     }
     gtk_toggle_button_set_active( sxed->autocreateOpt, autoCreateState );
-    if ( ! autoCreateState ) {
+    if ( ! autoCreateState )
+    {
         notifyState = FALSE;
     }
     gtk_toggle_button_set_active( sxed->notifyOpt, notifyState );
 
 
     /* Do days-in-advance-to-create widget[s] setup. */
-    if ( sxed->newsxP ) {
+    if ( sxed->newsxP )
+    {
         daysInAdvance =
             gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_CREATE_DAYS, NULL );
-    } else {
+    }
+    else
+    {
         daysInAdvance =
             xaccSchedXactionGetAdvanceCreation( sxed->sx );
     }
-    if ( daysInAdvance != 0 ) {
+    if ( daysInAdvance != 0 )
+    {
         gtk_toggle_button_set_active( sxed->advanceOpt, TRUE );
         gtk_spin_button_set_value( sxed->advanceSpin,
                                    (gfloat)daysInAdvance );
     }
 
     /* Do days-in-advance-to-remind widget[s] setup. */
-    if ( sxed->newsxP ) {
+    if ( sxed->newsxP )
+    {
         daysInAdvance =
             gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_REMIND_DAYS, NULL );
-    } else {
+    }
+    else
+    {
         daysInAdvance =
             xaccSchedXactionGetAdvanceReminder( sxed->sx );
     }
-    if ( daysInAdvance != 0 ) {
+    if ( daysInAdvance != 0 )
+    {
         gtk_toggle_button_set_active( sxed->remindOpt, TRUE );
         gtk_spin_button_set_value( sxed->remindSpin,
                                    (gfloat)daysInAdvance );
     }
 
-    if ( sxed->newsxP ) {
+    if ( sxed->newsxP )
+    {
         gnc_sx_set_instance_count( sxed->sx, 1 );
     }
 
@@ -1427,9 +1511,10 @@
         GList        *splitList;
 
         splitList = xaccSchedXactionGetSplits( sxed->sx );
-        if ( splitList != NULL ) {
+        if ( splitList != NULL )
+        {
             splitReg = gnc_ledger_display_get_split_register
-                ( sxed->ledger );
+                       ( sxed->ledger );
             gnc_split_register_load(splitReg, splitList, NULL );
         } /* otherwise, use the existing stuff. */
     }
@@ -1458,7 +1543,8 @@
     sxed = (GncSxEditorDialog*)d;
     id = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(b), "whichOneAmI" ));
 
-    switch (id) {
+    switch (id)
+    {
     case END_NEVER_OPTION:
         set_endgroup_toggle_states( sxed, END_NEVER );
         break;
@@ -1494,18 +1580,22 @@
 
     reg = gnc_ledger_display_get_split_register (sxed->ledger);
     pending_changes = gnc_split_register_changed (reg);
-    if (!pending_changes) {
+    if (!pending_changes)
+    {
         return;
     }
 
-    if (gnc_verify_dialog(sxed->dialog, TRUE, "%s", message)) {
+    if (gnc_verify_dialog(sxed->dialog, TRUE, "%s", message))
+    {
         Transaction *trans;
         trans = gnc_split_register_get_current_trans( reg );
         if ( !gnc_split_register_save( reg, TRUE ) )
             return;
 
         gnc_split_register_redraw( reg );
-    } else {
+    }
+    else
+    {
         gnc_split_register_cancel_cursor_trans_changes (reg);
     }
 }
@@ -1539,8 +1629,8 @@
 
         last_sx_inst = xaccSchedXactionGetLastOccurDate(sxed->sx);
         if (g_date_valid(last_sx_inst)
-            && g_date_valid(&first_date)
-            && g_date_compare(last_sx_inst, &first_date) != 0)
+                && g_date_valid(&first_date)
+                && g_date_compare(last_sx_inst, &first_date) != 0)
         {
             start_date = *last_sx_inst;
             recurrenceListNextInstance(recurrences, &start_date, &first_date);
@@ -1578,7 +1668,7 @@
     else if (gtk_toggle_button_get_active(sxed->optEndCount))
     {
         gint num_remain
-            = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(sxed->endRemainSpin));
+        = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(sxed->endRemainSpin));
         gnc_dense_cal_store_update_recurrences_count_end(sxed->dense_cal_model, &first_date, recurrences, num_remain);
     }
     else
@@ -1641,7 +1731,7 @@
         for (sx_iter = adhd->affected_sxes; sx_iter; sx_iter = sx_iter->next)
         {
             gnc_ui_scheduled_xaction_editor_dialog_create((SchedXaction*)sx_iter->data,
-                                                          FALSE);
+                    FALSE);
         }
     }
     g_list_free(adhd->affected_sxes);
@@ -1701,8 +1791,8 @@
 
         renderer = gtk_cell_renderer_text_new();
         name_column = gtk_tree_view_column_new_with_attributes(_("Name"),
-                                                               renderer,
-                                                               "text", 0, NULL);
+                      renderer,
+                      "text", 0, NULL);
         gtk_tree_view_append_column(list, name_column);
 
         g_signal_connect(G_OBJECT(dialog), "response",

Modified: gnucash/trunk/src/gnome/dialog-sx-editor.h
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-editor.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-sx-editor.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -36,7 +36,7 @@
 typedef struct _GncSxEditorDialog GncSxEditorDialog;
 
 GncSxEditorDialog* gnc_ui_scheduled_xaction_editor_dialog_create(SchedXaction *sx,
-                                                                 gboolean newSX);
+        gboolean newSX);
 
 void gnc_ui_scheduled_xaction_editor_dialog_destroy(GncSxEditorDialog *sxd);
 

Modified: gnucash/trunk/src/gnome/dialog-sx-from-trans.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-from-trans.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-sx-from-trans.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -87,27 +87,27 @@
                FREQ_MONTHLY,
                FREQ_QUARTERLY,
                FREQ_ANNUALLY
-} SxftiFreqType;
+             } SxftiFreqType;
 
 typedef struct
 {
-  GladeXML *gxml;
-  GtkWidget *dialog;
-  Transaction *trans;
-  SchedXaction *sx;
+    GladeXML *gxml;
+    GtkWidget *dialog;
+    Transaction *trans;
+    SchedXaction *sx;
 
-  GncDenseCalStore *dense_cal_model;
-  GncDenseCal *example_cal;
+    GncDenseCalStore *dense_cal_model;
+    GncDenseCal *example_cal;
 
-  GNCDateEdit *startDateGDE, *endDateGDE;
+    GNCDateEdit *startDateGDE, *endDateGDE;
 
 } SXFromTransInfo;
 
 typedef struct
 {
-  gdcs_end_type type;
-  GDate end_date;
-  guint n_occurrences;
+    gdcs_end_type type;
+    GDate end_date;
+    guint n_occurrences;
 } getEndTuple;
 
 static void sxftd_update_example_cal( SXFromTransInfo *sxfti );
@@ -115,9 +115,9 @@
 
 typedef struct
 {
-  gchar *name;
-  gchar *signal;
-  void (*handlerFn)();
+    gchar *name;
+    gchar *signal;
+    void (*handlerFn)();
 } widgetSignalHandlerTuple;
 
 static void sxftd_ok_clicked(SXFromTransInfo *sxfti);
@@ -127,91 +127,95 @@
 sxfti_attach_callbacks(SXFromTransInfo *sxfti)
 {
 
-  widgetSignalHandlerTuple callbacks[] =
+    widgetSignalHandlerTuple callbacks[] =
     {
-      /* Whenever any of the controls change, we want to update the
-       * calendar. */
-      { SXFTD_NEVER_END_BUTTON,     "clicked",      sxftd_update_excal_adapt },
-      { SXFTD_END_ON_DATE_BUTTON,   "clicked",      sxftd_update_excal_adapt },
-      { SXFTD_N_OCCURRENCES_BUTTON, "clicked",      sxftd_update_excal_adapt },
-      { SXFTD_N_OCCURRENCES_ENTRY,  "changed",      sxftd_update_excal_adapt },
-      { NULL,                  NULL,      NULL }
+        /* Whenever any of the controls change, we want to update the
+         * calendar. */
+        { SXFTD_NEVER_END_BUTTON,     "clicked",      sxftd_update_excal_adapt },
+        { SXFTD_END_ON_DATE_BUTTON,   "clicked",      sxftd_update_excal_adapt },
+        { SXFTD_N_OCCURRENCES_BUTTON, "clicked",      sxftd_update_excal_adapt },
+        { SXFTD_N_OCCURRENCES_ENTRY,  "changed",      sxftd_update_excal_adapt },
+        { NULL,                  NULL,      NULL }
     };
 
-  int i;
+    int i;
 
-  GtkWidget *w;
-  for(i = 0; callbacks[i].name != NULL; i++)
-  {
-    w = glade_xml_get_widget(sxfti->gxml, callbacks[i].name);
+    GtkWidget *w;
+    for (i = 0; callbacks[i].name != NULL; i++)
+    {
+        w = glade_xml_get_widget(sxfti->gxml, callbacks[i].name);
 
-    g_signal_connect (GTK_OBJECT(w), callbacks[i].signal,
-		      G_CALLBACK(callbacks[i].handlerFn),
-		      sxfti );
-  }
+        g_signal_connect (GTK_OBJECT(w), callbacks[i].signal,
+                          G_CALLBACK(callbacks[i].handlerFn),
+                          sxfti );
+    }
 
-  g_signal_connect (G_OBJECT(sxfti->dialog), "response",
-                    G_CALLBACK (gnc_sx_trans_window_response_cb),
-                    sxfti);
+    g_signal_connect (G_OBJECT(sxfti->dialog), "response",
+                      G_CALLBACK (gnc_sx_trans_window_response_cb),
+                      sxfti);
 }
 
 
 static getEndTuple
 sxftd_get_end_info(SXFromTransInfo *sxfti)
 {
-  getEndTuple retval;
-  GtkWidget *w;
+    getEndTuple retval;
+    GtkWidget *w;
 
-  retval.type = BAD_END;
-  g_date_clear( &(retval.end_date), 1 );
-  retval.n_occurrences = 0;
-
-  w = glade_xml_get_widget(sxfti->gxml, SXFTD_NEVER_END_BUTTON);
-  if(gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w))) {
-    retval.type = NEVER_END;
-    return retval;
-  }
-
-  w = glade_xml_get_widget(sxfti->gxml, SXFTD_END_ON_DATE_BUTTON);
-  if(gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w))) {
-    time_t end_tt;
-    retval.type = END_ON_DATE;
+    retval.type = BAD_END;
     g_date_clear( &(retval.end_date), 1 );
-    end_tt = gnc_date_edit_get_date(sxfti->endDateGDE);
-    g_date_set_time_t( &(retval.end_date), end_tt);
-    return retval;
-  }
+    retval.n_occurrences = 0;
 
-  w = glade_xml_get_widget(sxfti->gxml, SXFTD_N_OCCURRENCES_BUTTON);
-  if(gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w) )) {
-    gchar *text, *endptr;
-    guint n_occs;
-    w = glade_xml_get_widget(sxfti->gxml, SXFTD_N_OCCURRENCES_ENTRY);
-    text = gtk_editable_get_chars(GTK_EDITABLE(w), 0, -1);
+    w = glade_xml_get_widget(sxfti->gxml, SXFTD_NEVER_END_BUTTON);
+    if (gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w)))
+    {
+        retval.type = NEVER_END;
+        return retval;
+    }
 
-    if (text == NULL || strlen(text) == 0)
+    w = glade_xml_get_widget(sxfti->gxml, SXFTD_END_ON_DATE_BUTTON);
+    if (gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w)))
     {
-        n_occs = 0;
+        time_t end_tt;
+        retval.type = END_ON_DATE;
+        g_date_clear( &(retval.end_date), 1 );
+        end_tt = gnc_date_edit_get_date(sxfti->endDateGDE);
+        g_date_set_time_t( &(retval.end_date), end_tt);
+        return retval;
     }
-    else
+
+    w = glade_xml_get_widget(sxfti->gxml, SXFTD_N_OCCURRENCES_BUTTON);
+    if (gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w) ))
     {
-        n_occs = strtoul(text, &endptr, 10);
-        if ( !endptr )
+        gchar *text, *endptr;
+        guint n_occs;
+        w = glade_xml_get_widget(sxfti->gxml, SXFTD_N_OCCURRENCES_ENTRY);
+        text = gtk_editable_get_chars(GTK_EDITABLE(w), 0, -1);
+
+        if (text == NULL || strlen(text) == 0)
         {
-            n_occs = -1;
+            n_occs = 0;
         }
-    }
+        else
+        {
+            n_occs = strtoul(text, &endptr, 10);
+            if ( !endptr )
+            {
+                n_occs = -1;
+            }
+        }
 
-    g_free(text);
+        g_free(text);
 
-    if(n_occs > 0) {
-      retval.type = END_AFTER_N_OCCS;
-      retval.n_occurrences = n_occs;
-      return retval;
+        if (n_occs > 0)
+        {
+            retval.type = END_AFTER_N_OCCS;
+            retval.n_occurrences = n_occs;
+            return retval;
+        }
     }
-  }
 
-  return retval;
+    return retval;
 }
 
 
@@ -219,342 +223,359 @@
 sxftd_add_template_trans(SXFromTransInfo *sxfti)
 {
 
-  Transaction *tr = sxfti->trans;
-  GList *tt_list = NULL;
-  GList *splits, *template_splits = NULL;
-  TTInfo *tti = gnc_ttinfo_malloc();
-  TTSplitInfo *ttsi;
-  Split *sp;
-  gnc_numeric runningBalance;
-  gnc_numeric split_value;
-  const char *tmpStr;
+    Transaction *tr = sxfti->trans;
+    GList *tt_list = NULL;
+    GList *splits, *template_splits = NULL;
+    TTInfo *tti = gnc_ttinfo_malloc();
+    TTSplitInfo *ttsi;
+    Split *sp;
+    gnc_numeric runningBalance;
+    gnc_numeric split_value;
+    const char *tmpStr;
 
-  runningBalance = gnc_numeric_zero();
+    runningBalance = gnc_numeric_zero();
 
-  gnc_ttinfo_set_description(tti, xaccTransGetDescription(tr));
-  gnc_ttinfo_set_num(tti, xaccTransGetNum(tr));
-  gnc_ttinfo_set_currency(tti, xaccTransGetCurrency(tr));
+    gnc_ttinfo_set_description(tti, xaccTransGetDescription(tr));
+    gnc_ttinfo_set_num(tti, xaccTransGetNum(tr));
+    gnc_ttinfo_set_currency(tti, xaccTransGetCurrency(tr));
 
-  for(splits = xaccTransGetSplitList(tr); splits; splits = splits->next) {
-    sp = splits->data;
-    ttsi = gnc_ttsplitinfo_malloc();
-    gnc_ttsplitinfo_set_action(ttsi, xaccSplitGetAction(sp));
-    split_value = xaccSplitGetValue(sp);
-    gnc_ttsplitinfo_set_memo(ttsi, xaccSplitGetMemo(sp));
+    for (splits = xaccTransGetSplitList(tr); splits; splits = splits->next)
+    {
+        sp = splits->data;
+        ttsi = gnc_ttsplitinfo_malloc();
+        gnc_ttsplitinfo_set_action(ttsi, xaccSplitGetAction(sp));
+        split_value = xaccSplitGetValue(sp);
+        gnc_ttsplitinfo_set_memo(ttsi, xaccSplitGetMemo(sp));
 
-    runningBalance = gnc_numeric_add( runningBalance, split_value,
-                                      100, (GNC_DENOM_AUTO | GNC_DENOM_LCD) );
+        runningBalance = gnc_numeric_add( runningBalance, split_value,
+                                          100, (GNC_DENOM_AUTO | GNC_DENOM_LCD) );
 
-    if(gnc_numeric_positive_p(split_value)) {
+        if (gnc_numeric_positive_p(split_value))
+        {
             tmpStr = xaccPrintAmount( split_value,
                                       gnc_default_print_info(FALSE) );
             gnc_ttsplitinfo_set_debit_formula( ttsi, tmpStr );
-    }
-    else {
+        }
+        else
+        {
             /* Negate the numeric so it prints w/o the sign at the front. */
             tmpStr = xaccPrintAmount( gnc_numeric_neg( split_value ),
                                       gnc_default_print_info(FALSE) );
             gnc_ttsplitinfo_set_credit_formula( ttsi, tmpStr );
-    }
+        }
 
-    /* Copy over per-split account info */
-    gnc_ttsplitinfo_set_account( ttsi, xaccSplitGetAccount( sp ) );
+        /* Copy over per-split account info */
+        gnc_ttsplitinfo_set_account( ttsi, xaccSplitGetAccount( sp ) );
 
-    template_splits = g_list_append(template_splits, ttsi);
-  }
+        template_splits = g_list_append(template_splits, ttsi);
+    }
 
-  if ( ! gnc_numeric_zero_p( runningBalance )
-          && !gnc_verify_dialog( (gncUIWidget)sxfti->dialog,
-                                 FALSE, "%s",
-                                 _("The Scheduled Transaction Editor "
-                                   "cannot automatically balance "
-                                   "this transaction. "
-                                   "Should it still be "
-                                   "entered?") ) ) {
+    if ( ! gnc_numeric_zero_p( runningBalance )
+            && !gnc_verify_dialog( (gncUIWidget)sxfti->dialog,
+                                   FALSE, "%s",
+                                   _("The Scheduled Transaction Editor "
+                                     "cannot automatically balance "
+                                     "this transaction. "
+                                     "Should it still be "
+                                     "entered?") ) )
+    {
         return SXFTD_ERRNO_UNBALANCED_XACTION;
-  }
+    }
 
-  gnc_ttinfo_set_template_splits(tti, template_splits);
+    gnc_ttinfo_set_template_splits(tti, template_splits);
 
-  tt_list = g_list_append(tt_list, tti);
+    tt_list = g_list_append(tt_list, tti);
 
-  gnc_suspend_gui_refresh ();
-  xaccSchedXactionSetTemplateTrans(sxfti->sx, tt_list,
-                                   gnc_get_current_book ());
-  gnc_resume_gui_refresh ();
+    gnc_suspend_gui_refresh ();
+    xaccSchedXactionSetTemplateTrans(sxfti->sx, tt_list,
+                                     gnc_get_current_book ());
+    gnc_resume_gui_refresh ();
 
-  return 0;
+    return 0;
 }
 
 static void
 sxftd_update_schedule( SXFromTransInfo *sxfti, GDate *date, GList **recurrences)
 {
-  gint index;
-  GtkWidget *w;
+    gint index;
+    GtkWidget *w;
 
-  /* Note that we make the start date the *NEXT* instance, not the
-   * present one. */
-  w = glade_xml_get_widget(sxfti->gxml, SXFTD_FREQ_COMBO_BOX);
-  index = gtk_combo_box_get_active(GTK_COMBO_BOX(w));
+    /* Note that we make the start date the *NEXT* instance, not the
+     * present one. */
+    w = glade_xml_get_widget(sxfti->gxml, SXFTD_FREQ_COMBO_BOX);
+    index = gtk_combo_box_get_active(GTK_COMBO_BOX(w));
 
-  switch (index)
-  {
-  case FREQ_DAILY: {
-      Recurrence *r = g_new0(Recurrence, 1);
-      recurrenceSet(r, 1, PERIOD_DAY, date, WEEKEND_ADJ_NONE);
-      *recurrences = g_list_append(*recurrences, r);
-    } break;
+    switch (index)
+    {
+    case FREQ_DAILY:
+    {
+        Recurrence *r = g_new0(Recurrence, 1);
+        recurrenceSet(r, 1, PERIOD_DAY, date, WEEKEND_ADJ_NONE);
+        *recurrences = g_list_append(*recurrences, r);
+    }
+    break;
 
-  case FREQ_WEEKLY:
-  case FREQ_BIWEEKLY: {
-      Recurrence *r = g_new0(Recurrence, 1);
-      int mult = (index == FREQ_BIWEEKLY ? 2 : 1);
-      recurrenceSet(r, mult, PERIOD_WEEK, date, WEEKEND_ADJ_NONE);
-      *recurrences = g_list_append(*recurrences, r);
-  } break;
+    case FREQ_WEEKLY:
+    case FREQ_BIWEEKLY:
+    {
+        Recurrence *r = g_new0(Recurrence, 1);
+        int mult = (index == FREQ_BIWEEKLY ? 2 : 1);
+        recurrenceSet(r, mult, PERIOD_WEEK, date, WEEKEND_ADJ_NONE);
+        *recurrences = g_list_append(*recurrences, r);
+    }
+    break;
 
-  case FREQ_MONTHLY:
-  case FREQ_QUARTERLY:
-  case FREQ_ANNUALLY: {
-      Recurrence *r = g_new0(Recurrence, 1);
-      int mult = (index == FREQ_MONTHLY
-                  ? 1
-                  : (index == FREQ_QUARTERLY
-                     ? 3
-                     : 12));
-      recurrenceSet(r, mult, PERIOD_MONTH, date, recurrenceGetWeekendAdjust(r));
-      *recurrences = g_list_append(*recurrences, r);
-  } break;
+    case FREQ_MONTHLY:
+    case FREQ_QUARTERLY:
+    case FREQ_ANNUALLY:
+    {
+        Recurrence *r = g_new0(Recurrence, 1);
+        int mult = (index == FREQ_MONTHLY
+                    ? 1
+                    : (index == FREQ_QUARTERLY
+                       ? 3
+                       : 12));
+        recurrenceSet(r, mult, PERIOD_MONTH, date, recurrenceGetWeekendAdjust(r));
+        *recurrences = g_list_append(*recurrences, r);
+    }
+    break;
 
-  default:
-       g_critical("nonexistent frequency selected");
-       break;
-  }
+    default:
+        g_critical("nonexistent frequency selected");
+        break;
+    }
 }
 
 static gint
 sxftd_init( SXFromTransInfo *sxfti )
 {
-  GtkWidget *w;
-  const char *transName;
-  gint pos;
-  GList *schedule = NULL;
-  time_t start_tt;
-  struct tm *tmpTm;
-  GDate date, nextDate;
+    GtkWidget *w;
+    const char *transName;
+    gint pos;
+    GList *schedule = NULL;
+    time_t start_tt;
+    struct tm *tmpTm;
+    GDate date, nextDate;
 
-  if ( ! sxfti->sx ) {
-    return -1;
-  }
-  if ( ! sxfti->trans ) {
-    return -2;
-  }
-  if ( xaccTransIsOpen( sxfti->trans ) ) {
-          return SXFTD_ERRNO_OPEN_XACTION;
-  }
+    if ( ! sxfti->sx )
+    {
+        return -1;
+    }
+    if ( ! sxfti->trans )
+    {
+        return -2;
+    }
+    if ( xaccTransIsOpen( sxfti->trans ) )
+    {
+        return SXFTD_ERRNO_OPEN_XACTION;
+    }
 
-  sxfti_attach_callbacks(sxfti);
+    sxfti_attach_callbacks(sxfti);
 
-  /* Setup the example calendar and related data structures. */
-  {
-    int num_marks = SXFTD_EXCAL_NUM_MONTHS * 31;
+    /* Setup the example calendar and related data structures. */
+    {
+        int num_marks = SXFTD_EXCAL_NUM_MONTHS * 31;
 
-    w = GTK_WIDGET(glade_xml_get_widget( sxfti->gxml, SXFTD_EX_CAL_FRAME ));
-    sxfti->dense_cal_model = gnc_dense_cal_store_new(num_marks);
-    sxfti->example_cal = GNC_DENSE_CAL(gnc_dense_cal_new_with_model(GNC_DENSE_CAL_MODEL(sxfti->dense_cal_model)));
-    g_object_ref_sink(sxfti->example_cal);
+        w = GTK_WIDGET(glade_xml_get_widget( sxfti->gxml, SXFTD_EX_CAL_FRAME ));
+        sxfti->dense_cal_model = gnc_dense_cal_store_new(num_marks);
+        sxfti->example_cal = GNC_DENSE_CAL(gnc_dense_cal_new_with_model(GNC_DENSE_CAL_MODEL(sxfti->dense_cal_model)));
+        g_object_ref_sink(sxfti->example_cal);
 
-    g_assert(sxfti->example_cal);
-    gnc_dense_cal_set_num_months( sxfti->example_cal, SXFTD_EXCAL_NUM_MONTHS );
-    gnc_dense_cal_set_months_per_col( sxfti->example_cal, SXFTD_EXCAL_MONTHS_PER_COL );
-    gtk_container_add( GTK_CONTAINER(w), GTK_WIDGET(sxfti->example_cal) );
-  }
+        g_assert(sxfti->example_cal);
+        gnc_dense_cal_set_num_months( sxfti->example_cal, SXFTD_EXCAL_NUM_MONTHS );
+        gnc_dense_cal_set_months_per_col( sxfti->example_cal, SXFTD_EXCAL_MONTHS_PER_COL );
+        gtk_container_add( GTK_CONTAINER(w), GTK_WIDGET(sxfti->example_cal) );
+    }
 
-  /* Setup the start and end dates as GNCDateEdits */
-  {
-    GtkWidget *paramTable = glade_xml_get_widget( sxfti->gxml,
-                                                  SXFTD_PARAM_TABLE );
-    sxfti->startDateGDE =
-      GNC_DATE_EDIT( gnc_date_edit_new( time( NULL ),
-                                        FALSE, FALSE ) );
-    gtk_table_attach( GTK_TABLE(paramTable),
-                      GTK_WIDGET( sxfti->startDateGDE ),
-                      1, 2, 2, 3,
-                      (GTK_EXPAND | GTK_FILL),
-                      GTK_FILL,
-                      0, 0 );
-    g_signal_connect( sxfti->startDateGDE, "date-changed",
-                      G_CALLBACK( sxftd_update_excal_adapt ),
-                      sxfti );
-  }
-  {
-    GtkWidget *endDateBox = glade_xml_get_widget( sxfti->gxml,
-                                                  SXFTD_END_DATE_BOX );
-    sxfti->endDateGDE =
-      GNC_DATE_EDIT( gnc_date_edit_new( time( NULL ),
-                                        FALSE, FALSE ) );
-    gtk_box_pack_start( GTK_BOX( endDateBox ),
-                        GTK_WIDGET( sxfti->endDateGDE ),
-                        FALSE, TRUE, 0 );
-    g_signal_connect( sxfti->endDateGDE, "date-changed",
-                      G_CALLBACK( sxftd_update_excal_adapt ),
-                      sxfti );
-  }
+    /* Setup the start and end dates as GNCDateEdits */
+    {
+        GtkWidget *paramTable = glade_xml_get_widget( sxfti->gxml,
+                                SXFTD_PARAM_TABLE );
+        sxfti->startDateGDE =
+            GNC_DATE_EDIT( gnc_date_edit_new( time( NULL ),
+                                              FALSE, FALSE ) );
+        gtk_table_attach( GTK_TABLE(paramTable),
+                          GTK_WIDGET( sxfti->startDateGDE ),
+                          1, 2, 2, 3,
+                          (GTK_EXPAND | GTK_FILL),
+                          GTK_FILL,
+                          0, 0 );
+        g_signal_connect( sxfti->startDateGDE, "date-changed",
+                          G_CALLBACK( sxftd_update_excal_adapt ),
+                          sxfti );
+    }
+    {
+        GtkWidget *endDateBox = glade_xml_get_widget( sxfti->gxml,
+                                SXFTD_END_DATE_BOX );
+        sxfti->endDateGDE =
+            GNC_DATE_EDIT( gnc_date_edit_new( time( NULL ),
+                                              FALSE, FALSE ) );
+        gtk_box_pack_start( GTK_BOX( endDateBox ),
+                            GTK_WIDGET( sxfti->endDateGDE ),
+                            FALSE, TRUE, 0 );
+        g_signal_connect( sxfti->endDateGDE, "date-changed",
+                          G_CALLBACK( sxftd_update_excal_adapt ),
+                          sxfti );
+    }
 
-  /* Get the name from the transaction, try that as the initial SX name. */
-  transName = xaccTransGetDescription( sxfti->trans );
-  xaccSchedXactionSetName( sxfti->sx, transName );
+    /* Get the name from the transaction, try that as the initial SX name. */
+    transName = xaccTransGetDescription( sxfti->trans );
+    xaccSchedXactionSetName( sxfti->sx, transName );
 
-  /* Setup the initial start date for user display/confirmation */
-  /* compute good initial date. */
-  start_tt = xaccTransGetDate( sxfti->trans );
-  g_date_set_time_t( &date, start_tt );
-  w = glade_xml_get_widget(sxfti->gxml,
-			   SXFTD_FREQ_COMBO_BOX);
-  gtk_combo_box_set_active(GTK_COMBO_BOX(w), 0);
-  g_signal_connect( w, "changed",
-                    G_CALLBACK(sxftd_freq_combo_changed),
-                    sxfti );
-  sxftd_update_schedule( sxfti, &date, &schedule);
-  recurrenceListNextInstance(schedule, &date, &nextDate);
-  recurrenceListFree(&schedule);
+    /* Setup the initial start date for user display/confirmation */
+    /* compute good initial date. */
+    start_tt = xaccTransGetDate( sxfti->trans );
+    g_date_set_time_t( &date, start_tt );
+    w = glade_xml_get_widget(sxfti->gxml,
+                             SXFTD_FREQ_COMBO_BOX);
+    gtk_combo_box_set_active(GTK_COMBO_BOX(w), 0);
+    g_signal_connect( w, "changed",
+                      G_CALLBACK(sxftd_freq_combo_changed),
+                      sxfti );
+    sxftd_update_schedule( sxfti, &date, &schedule);
+    recurrenceListNextInstance(schedule, &date, &nextDate);
+    recurrenceListFree(&schedule);
 
-  tmpTm = g_new0( struct tm, 1 );
-  g_date_to_struct_tm( &nextDate, tmpTm );
-  start_tt = mktime( tmpTm );
-  g_free( tmpTm );
-  gnc_date_edit_set_time( sxfti->startDateGDE, start_tt );
+    tmpTm = g_new0( struct tm, 1 );
+    g_date_to_struct_tm( &nextDate, tmpTm );
+    start_tt = mktime( tmpTm );
+    g_free( tmpTm );
+    gnc_date_edit_set_time( sxfti->startDateGDE, start_tt );
 
-  w = glade_xml_get_widget( sxfti->gxml, SXFTD_NAME_ENTRY );
-  pos = 0;
-  gtk_editable_insert_text( GTK_EDITABLE(w), transName,
-                            (strlen(transName) * sizeof(char)), &pos );
+    w = glade_xml_get_widget( sxfti->gxml, SXFTD_NAME_ENTRY );
+    pos = 0;
+    gtk_editable_insert_text( GTK_EDITABLE(w), transName,
+                              (strlen(transName) * sizeof(char)), &pos );
 
-  g_signal_connect( GTK_OBJECT(w), "destroy",
-                    G_CALLBACK(sxftd_destroy),
-                    sxfti );
+    g_signal_connect( GTK_OBJECT(w), "destroy",
+                      G_CALLBACK(sxftd_destroy),
+                      sxfti );
 
-  sxftd_update_example_cal( sxfti );
+    sxftd_update_example_cal( sxfti );
 
-  return 0;
+    return 0;
 }
 
 static guint
 sxftd_compute_sx(SXFromTransInfo *sxfti)
 {
-  GtkWidget *w;
-  gchar *name;
-  GDate date;
-  GList *schedule = NULL;
-  getEndTuple end_info;
-  guint sxftd_errno = 0; /* 0 == OK, > 0 means dialog needs to be run again */
+    GtkWidget *w;
+    gchar *name;
+    GDate date;
+    GList *schedule = NULL;
+    getEndTuple end_info;
+    guint sxftd_errno = 0; /* 0 == OK, > 0 means dialog needs to be run again */
 
-  SchedXaction *sx = sxfti->sx;
+    SchedXaction *sx = sxfti->sx;
 
-  /* get the name */
-  w = glade_xml_get_widget(sxfti->gxml, SXFTD_NAME_ENTRY);
-  name = gtk_editable_get_chars(GTK_EDITABLE(w), 0, -1);
-  xaccSchedXactionSetName(sx, name);
-  g_free(name);
+    /* get the name */
+    w = glade_xml_get_widget(sxfti->gxml, SXFTD_NAME_ENTRY);
+    name = gtk_editable_get_chars(GTK_EDITABLE(w), 0, -1);
+    xaccSchedXactionSetName(sx, name);
+    g_free(name);
 
-  g_date_set_time_t( &date, gnc_date_edit_get_date( sxfti->startDateGDE ) );
+    g_date_set_time_t( &date, gnc_date_edit_get_date( sxfti->startDateGDE ) );
 
-  sxftd_update_schedule(sxfti, &date, &schedule);
-  if (sxftd_errno == 0) {
-      gnc_sx_set_schedule(sx, schedule);
-      xaccSchedXactionSetStartDate( sx, &date );
-  }
+    sxftd_update_schedule(sxfti, &date, &schedule);
+    if (sxftd_errno == 0)
+    {
+        gnc_sx_set_schedule(sx, schedule);
+        xaccSchedXactionSetStartDate( sx, &date );
+    }
 
-  end_info = sxftd_get_end_info(sxfti);
+    end_info = sxftd_get_end_info(sxfti);
 
-  switch(end_info.type)
-  {
-  case NEVER_END:
-    break;
+    switch (end_info.type)
+    {
+    case NEVER_END:
+        break;
 
-  case END_ON_DATE:
-    xaccSchedXactionSetEndDate(sx, &(end_info.end_date));
-    break;
+    case END_ON_DATE:
+        xaccSchedXactionSetEndDate(sx, &(end_info.end_date));
+        break;
 
-  case END_AFTER_N_OCCS:
-    xaccSchedXactionSetNumOccur(sx, end_info.n_occurrences);
-    break;
+    case END_AFTER_N_OCCS:
+        xaccSchedXactionSetNumOccur(sx, end_info.n_occurrences);
+        break;
 
-  default:
-    sxftd_errno = 2;
-    break;
-  }
+    default:
+        sxftd_errno = 2;
+        break;
+    }
 
-  gnc_sx_set_instance_count( sx, 1 );
+    gnc_sx_set_instance_count( sx, 1 );
 
-  /* Set the autocreate, days-in-advance and remind-in-advance values from
-   * options. */
-  {
-    gboolean autoCreateState, notifyState;
-    gint daysInAdvance;
+    /* Set the autocreate, days-in-advance and remind-in-advance values from
+     * options. */
+    {
+        gboolean autoCreateState, notifyState;
+        gint daysInAdvance;
 
-    autoCreateState =
-      gnc_gconf_get_bool( SXED_GCONF_SECTION, KEY_CREATE_AUTO, NULL );
-    notifyState =
-      gnc_gconf_get_bool( SXED_GCONF_SECTION, KEY_NOTIFY, NULL );
-    xaccSchedXactionSetAutoCreate( sx,
-                                   autoCreateState,
-                                   (autoCreateState & notifyState) );
+        autoCreateState =
+            gnc_gconf_get_bool( SXED_GCONF_SECTION, KEY_CREATE_AUTO, NULL );
+        notifyState =
+            gnc_gconf_get_bool( SXED_GCONF_SECTION, KEY_NOTIFY, NULL );
+        xaccSchedXactionSetAutoCreate( sx,
+                                       autoCreateState,
+                                       (autoCreateState & notifyState) );
 
-    daysInAdvance =
-      gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_CREATE_DAYS, NULL );
-    xaccSchedXactionSetAdvanceCreation( sx, daysInAdvance );
+        daysInAdvance =
+            gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_CREATE_DAYS, NULL );
+        xaccSchedXactionSetAdvanceCreation( sx, daysInAdvance );
 
-    daysInAdvance =
-      gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_REMIND_DAYS, NULL );
-    xaccSchedXactionSetAdvanceReminder( sx, daysInAdvance );
-  }
+        daysInAdvance =
+            gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_REMIND_DAYS, NULL );
+        xaccSchedXactionSetAdvanceReminder( sx, daysInAdvance );
+    }
 
-  if ( sxftd_add_template_trans( sxfti ) != 0 ) {
-          sxftd_errno = SXFTD_ERRNO_UNBALANCED_XACTION;
-  }
+    if ( sxftd_add_template_trans( sxfti ) != 0 )
+    {
+        sxftd_errno = SXFTD_ERRNO_UNBALANCED_XACTION;
+    }
 
-  return sxftd_errno;
+    return sxftd_errno;
 }
 
 static void
 sxftd_close(SXFromTransInfo *sxfti, gboolean delete_sx)
 {
-  if ( sxfti->sx && delete_sx ) {
-	gnc_sx_begin_edit(sxfti->sx);
-    xaccSchedXactionDestroy(sxfti->sx);
-  }
-  sxfti->sx = NULL;
+    if ( sxfti->sx && delete_sx )
+    {
+        gnc_sx_begin_edit(sxfti->sx);
+        xaccSchedXactionDestroy(sxfti->sx);
+    }
+    sxfti->sx = NULL;
 
-  gtk_widget_destroy (GTK_WIDGET (sxfti->dialog));
+    gtk_widget_destroy (GTK_WIDGET (sxfti->dialog));
 }
 
 static void
 sxftd_ok_clicked(SXFromTransInfo *sxfti)
 {
-  QofBook *book;
-  SchedXactions *sxes;
-  guint sx_error = sxftd_compute_sx(sxfti);
+    QofBook *book;
+    SchedXactions *sxes;
+    guint sx_error = sxftd_compute_sx(sxfti);
 
-  if (sx_error != 0
-      && sx_error != SXFTD_ERRNO_UNBALANCED_XACTION)
-  {
-       g_critical("sxftd_compute_sx after ok_clicked [%d]", sx_error);
-  }
-  else
-  {
-    if ( sx_error == SXFTD_ERRNO_UNBALANCED_XACTION ) {
+    if (sx_error != 0
+            && sx_error != SXFTD_ERRNO_UNBALANCED_XACTION)
+    {
+        g_critical("sxftd_compute_sx after ok_clicked [%d]", sx_error);
+    }
+    else
+    {
+        if ( sx_error == SXFTD_ERRNO_UNBALANCED_XACTION )
+        {
             gnc_error_dialog( gnc_ui_get_toplevel(), "%s",
                               _( "The Scheduled Transaction is unbalanced. "
                                  "You are strongly encouraged to correct this situation." ) );
+        }
+        book = gnc_get_current_book ();
+        sxes = gnc_book_get_schedxactions(book);
+        gnc_sxes_add_sx(sxes, sxfti->sx);
     }
-    book = gnc_get_current_book ();
-    sxes = gnc_book_get_schedxactions(book);
-    gnc_sxes_add_sx(sxes, sxfti->sx);
-  }
 
-  sxftd_close(sxfti, FALSE);
-  return;
+    sxftd_close(sxfti, FALSE);
+    return;
 }
 
 /**
@@ -565,101 +586,103 @@
 static void
 sxftd_freq_combo_changed( GtkWidget *w, gpointer user_data )
 {
-  SXFromTransInfo *sxfti = (SXFromTransInfo*)user_data;
-  GDate date, nextDate;
-  time_t tmp_tt;
-  struct tm *tmpTm;
-  GList *schedule = NULL;
+    SXFromTransInfo *sxfti = (SXFromTransInfo*)user_data;
+    GDate date, nextDate;
+    time_t tmp_tt;
+    struct tm *tmpTm;
+    GList *schedule = NULL;
 
-  tmp_tt = xaccTransGetDate( sxfti->trans );
-  g_date_set_time_t( &date, tmp_tt );
+    tmp_tt = xaccTransGetDate( sxfti->trans );
+    g_date_set_time_t( &date, tmp_tt );
 
-  g_date_clear(&nextDate, 1);
-  sxftd_update_schedule(sxfti, &date, &schedule);
-  recurrenceListNextInstance(schedule, &date, &nextDate);
+    g_date_clear(&nextDate, 1);
+    sxftd_update_schedule(sxfti, &date, &schedule);
+    recurrenceListNextInstance(schedule, &date, &nextDate);
 
-  tmpTm = g_new0( struct tm, 1 );
-  g_date_to_struct_tm( &nextDate, tmpTm );
-  tmp_tt = mktime( tmpTm );
-  g_free( tmpTm );
-  gnc_date_edit_set_time( sxfti->startDateGDE, tmp_tt );
+    tmpTm = g_new0( struct tm, 1 );
+    g_date_to_struct_tm( &nextDate, tmpTm );
+    tmp_tt = mktime( tmpTm );
+    g_free( tmpTm );
+    gnc_date_edit_set_time( sxfti->startDateGDE, tmp_tt );
 
-  recurrenceListFree(&schedule);
-  sxftd_update_example_cal( sxfti );
+    recurrenceListFree(&schedule);
+    sxftd_update_example_cal( sxfti );
 }
 
 static void
 sxftd_advanced_clicked(SXFromTransInfo *sxfti)
 {
-  guint sx_error = sxftd_compute_sx(sxfti);
-  GncSxEditorDialog *adv_edit_dlg;
-  GMainContext *context;
+    guint sx_error = sxftd_compute_sx(sxfti);
+    GncSxEditorDialog *adv_edit_dlg;
+    GMainContext *context;
 
-  if ( sx_error != 0
-       && sx_error != SXFTD_ERRNO_UNBALANCED_XACTION )
-  {
-       // unbalanced-xaction is "okay", since this is also checked for by
-       // the advanced editor.
-       g_warning("something bad happened in sxftd_compute_sx [%d]", sx_error);
-       return;
-  }
-  gtk_widget_hide( sxfti->dialog );
-  /* force a gui update. */
-  context = g_main_context_default();
-  while (g_main_context_iteration(context, FALSE));
+    if ( sx_error != 0
+            && sx_error != SXFTD_ERRNO_UNBALANCED_XACTION )
+    {
+        // unbalanced-xaction is "okay", since this is also checked for by
+        // the advanced editor.
+        g_warning("something bad happened in sxftd_compute_sx [%d]", sx_error);
+        return;
+    }
+    gtk_widget_hide( sxfti->dialog );
+    /* force a gui update. */
+    context = g_main_context_default();
+    while (g_main_context_iteration(context, FALSE));
 
-  adv_edit_dlg =
-    gnc_ui_scheduled_xaction_editor_dialog_create(sxfti->sx,
-                                                  TRUE /* newSX */);
-  /* close ourself, since advanced editing entails us, and there are sync
-   * issues otherwise. */
-  sxftd_close(sxfti, FALSE);
+    adv_edit_dlg =
+        gnc_ui_scheduled_xaction_editor_dialog_create(sxfti->sx,
+                TRUE /* newSX */);
+    /* close ourself, since advanced editing entails us, and there are sync
+     * issues otherwise. */
+    sxftd_close(sxfti, FALSE);
 }
 
 static void
 sxftd_destroy( GtkWidget *w, gpointer user_data )
 {
-  SXFromTransInfo *sxfti = (SXFromTransInfo*)user_data;
+    SXFromTransInfo *sxfti = (SXFromTransInfo*)user_data;
 
-  if ( sxfti->sx ) {
-	gnc_sx_begin_edit(sxfti->sx);
-    xaccSchedXactionDestroy(sxfti->sx);
-    sxfti->sx = NULL;
-  }
+    if ( sxfti->sx )
+    {
+        gnc_sx_begin_edit(sxfti->sx);
+        xaccSchedXactionDestroy(sxfti->sx);
+        sxfti->sx = NULL;
+    }
 
-  g_object_unref(G_OBJECT(sxfti->dense_cal_model));
-  g_object_unref(G_OBJECT(sxfti->example_cal));
+    g_object_unref(G_OBJECT(sxfti->dense_cal_model));
+    g_object_unref(G_OBJECT(sxfti->example_cal));
 
-  /* FIXME: do we need to clean up the GladeXML pointer? */
+    /* FIXME: do we need to clean up the GladeXML pointer? */
 
-  g_free(sxfti);
+    g_free(sxfti);
 }
 
 static void
 gnc_sx_trans_window_response_cb (GtkDialog *dialog,
-                                gint response,
-                                gpointer data)
+                                 gint response,
+                                 gpointer data)
 {
-	SXFromTransInfo *sxfti = (SXFromTransInfo *)data;
+    SXFromTransInfo *sxfti = (SXFromTransInfo *)data;
 
-	ENTER(" dialog %p, response %d, sx %p", dialog, response, sxfti);
-    switch (response) {
+    ENTER(" dialog %p, response %d, sx %p", dialog, response, sxfti);
+    switch (response)
+    {
     case GTK_RESPONSE_OK:
-         g_debug(" OK");
-         sxftd_ok_clicked(sxfti);
-         break;
+        g_debug(" OK");
+        sxftd_ok_clicked(sxfti);
+        break;
     case SXFTD_RESPONSE_ADVANCED:
-         g_debug(" ADVANCED");
-         sxftd_advanced_clicked(sxfti);
-         break;
+        g_debug(" ADVANCED");
+        sxftd_advanced_clicked(sxfti);
+        break;
     case GTK_RESPONSE_CANCEL:
     default:
-         g_debug(" CANCEL");
-         sxftd_close(sxfti, TRUE);
-         break;
+        g_debug(" CANCEL");
+        sxftd_close(sxfti, TRUE);
+        break;
 
-	}
-	LEAVE(" ");
+    }
+    LEAVE(" ");
 }
 
 /**
@@ -669,69 +692,69 @@
 static void
 sxftd_update_example_cal( SXFromTransInfo *sxfti )
 {
-  struct tm *tmpTm;
-  time_t tmp_tt;
-  GDate date, startDate, nextDate;
-  GList *schedule = NULL;
-  getEndTuple get;
+    struct tm *tmpTm;
+    time_t tmp_tt;
+    GDate date, startDate, nextDate;
+    GList *schedule = NULL;
+    getEndTuple get;
 
-  get = sxftd_get_end_info( sxfti );
+    get = sxftd_get_end_info( sxfti );
 
-  tmp_tt = gnc_date_edit_get_date( sxfti->startDateGDE );
-  tmpTm = g_new0( struct tm, 1 );
-  *tmpTm = *localtime( &tmp_tt );
-  g_date_clear(&date, 1);
-  g_date_set_day( &date, tmpTm->tm_mday );
-  g_date_set_month( &date, tmpTm->tm_mon+1 );
-  g_date_set_year( &date, tmpTm->tm_year+1900 );
-  g_free( tmpTm );
+    tmp_tt = gnc_date_edit_get_date( sxfti->startDateGDE );
+    tmpTm = g_new0( struct tm, 1 );
+    *tmpTm = *localtime( &tmp_tt );
+    g_date_clear(&date, 1);
+    g_date_set_day( &date, tmpTm->tm_mday );
+    g_date_set_month( &date, tmpTm->tm_mon + 1 );
+    g_date_set_year( &date, tmpTm->tm_year + 1900 );
+    g_free( tmpTm );
 
-  sxftd_update_schedule(sxfti, &date, &schedule);
+    sxftd_update_schedule(sxfti, &date, &schedule);
 
-  /* go one day before what's in the box so we can get the correct start
-   * date. */
-  startDate = date;
-  g_date_subtract_days(&date, 1);
-  g_date_clear(&nextDate, 1);
-  recurrenceListNextInstance(schedule, &date, &nextDate);
+    /* go one day before what's in the box so we can get the correct start
+     * date. */
+    startDate = date;
+    g_date_subtract_days(&date, 1);
+    g_date_clear(&nextDate, 1);
+    recurrenceListNextInstance(schedule, &date, &nextDate);
 
-  {
-      GtkWidget *w;
-      gchar *name;
-      /* get the name */
-      w = glade_xml_get_widget(sxfti->gxml, SXFTD_NAME_ENTRY);
-      name = gtk_editable_get_chars(GTK_EDITABLE(w), 0, -1);
-      gnc_dense_cal_store_update_name(sxfti->dense_cal_model, name);
-      g_free(name);
-  }
+    {
+        GtkWidget *w;
+        gchar *name;
+        /* get the name */
+        w = glade_xml_get_widget(sxfti->gxml, SXFTD_NAME_ENTRY);
+        name = gtk_editable_get_chars(GTK_EDITABLE(w), 0, -1);
+        gnc_dense_cal_store_update_name(sxfti->dense_cal_model, name);
+        g_free(name);
+    }
 
-  {
-      gchar *schedule_desc;
-      schedule_desc = recurrenceListToCompactString(schedule);
-      gnc_dense_cal_store_update_info(sxfti->dense_cal_model, schedule_desc);
-      g_free(schedule_desc);
-  }
+    {
+        gchar *schedule_desc;
+        schedule_desc = recurrenceListToCompactString(schedule);
+        gnc_dense_cal_store_update_info(sxfti->dense_cal_model, schedule_desc);
+        g_free(schedule_desc);
+    }
 
-  switch (get.type)
-  {
-  case NEVER_END:
-    gnc_dense_cal_store_update_recurrences_no_end(sxfti->dense_cal_model, &startDate, schedule);
-    break;
-  case END_ON_DATE:
-    gnc_dense_cal_store_update_recurrences_date_end(sxfti->dense_cal_model, &startDate, schedule, &get.end_date);
-    break;
-  case END_AFTER_N_OCCS:
-    gnc_dense_cal_store_update_recurrences_count_end(sxfti->dense_cal_model, &startDate, schedule, get.n_occurrences);
-    break;
-  default:
-      g_warning("unknown get.type [%d]\n", get.type);
-    break;
-  }
+    switch (get.type)
+    {
+    case NEVER_END:
+        gnc_dense_cal_store_update_recurrences_no_end(sxfti->dense_cal_model, &startDate, schedule);
+        break;
+    case END_ON_DATE:
+        gnc_dense_cal_store_update_recurrences_date_end(sxfti->dense_cal_model, &startDate, schedule, &get.end_date);
+        break;
+    case END_AFTER_N_OCCS:
+        gnc_dense_cal_store_update_recurrences_count_end(sxfti->dense_cal_model, &startDate, schedule, get.n_occurrences);
+        break;
+    default:
+        g_warning("unknown get.type [%d]\n", get.type);
+        break;
+    }
 
-  gnc_dense_cal_set_month( sxfti->example_cal, g_date_get_month( &startDate ) );
-  gnc_dense_cal_set_year( sxfti->example_cal, g_date_get_year( &startDate ) );
+    gnc_dense_cal_set_month( sxfti->example_cal, g_date_get_month( &startDate ) );
+    gnc_dense_cal_set_year( sxfti->example_cal, g_date_get_year( &startDate ) );
 
-  recurrenceListFree(&schedule);
+    recurrenceListFree(&schedule);
 }
 
 /**
@@ -740,42 +763,43 @@
 static void
 sxftd_update_excal_adapt( GObject *o, gpointer ud )
 {
-  SXFromTransInfo *sxfti = (SXFromTransInfo*)ud;
-  sxftd_update_example_cal( sxfti );
+    SXFromTransInfo *sxfti = (SXFromTransInfo*)ud;
+    sxftd_update_example_cal( sxfti );
 }
 
 void
 gnc_sx_create_from_trans( Transaction *trans )
 {
-  int errno;
-  SXFromTransInfo *sxfti = g_new0( SXFromTransInfo, 1);
+    int errno;
+    SXFromTransInfo *sxfti = g_new0( SXFromTransInfo, 1);
 
-  sxfti->gxml = gnc_glade_xml_new(SX_GLADE_FILE,
-				  SXFTD_DIALOG_GLADE_NAME);
+    sxfti->gxml = gnc_glade_xml_new(SX_GLADE_FILE,
+                                    SXFTD_DIALOG_GLADE_NAME);
 
-  sxfti->dialog = glade_xml_get_widget(sxfti->gxml,
-				       SXFTD_DIALOG_GLADE_NAME);
+    sxfti->dialog = glade_xml_get_widget(sxfti->gxml,
+                                         SXFTD_DIALOG_GLADE_NAME);
 
-  sxfti->trans = trans;
+    sxfti->trans = trans;
 
-  sxfti->sx = xaccSchedXactionMalloc(gnc_get_current_book ());
+    sxfti->sx = xaccSchedXactionMalloc(gnc_get_current_book ());
 
-  if ( (errno = sxftd_init( sxfti )) < 0 ) {
-          if ( errno == SXFTD_ERRNO_OPEN_XACTION )
-          {
-                  gnc_error_dialog( gnc_ui_get_toplevel(), "%s",
-                                    _( "Cannot create a Scheduled Transaction "
-                                       "from a Transaction currently "
-                                       "being edited. Please Enter the "
-                                       "Transaction before Scheduling." ) );
-                  sxftd_close( sxfti, TRUE );
-                  return;
-          }
-          else
-          {
-               g_error("sxftd_init: %d", errno);
-          }
-  }
+    if ( (errno = sxftd_init( sxfti )) < 0 )
+    {
+        if ( errno == SXFTD_ERRNO_OPEN_XACTION )
+        {
+            gnc_error_dialog( gnc_ui_get_toplevel(), "%s",
+                              _( "Cannot create a Scheduled Transaction "
+                                 "from a Transaction currently "
+                                 "being edited. Please Enter the "
+                                 "Transaction before Scheduling." ) );
+            sxftd_close( sxfti, TRUE );
+            return;
+        }
+        else
+        {
+            g_error("sxftd_init: %d", errno);
+        }
+    }
 
-  gtk_widget_show(GTK_WIDGET(sxfti->dialog));
+    gtk_widget_show(GTK_WIDGET(sxfti->dialog));
 }

Modified: gnucash/trunk/src/gnome/dialog-sx-since-last-run.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-since-last-run.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-sx-since-last-run.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -140,8 +140,10 @@
 gnc_sx_slr_tree_model_adapter_get_type(void)
 {
     static GType gsstma_type = 0;
-    if (gsstma_type == 0) {
-        static const GTypeInfo info = {
+    if (gsstma_type == 0)
+    {
+        static const GTypeInfo info =
+        {
             sizeof (GncSxSlrTreeModelAdapterClass),
             NULL,   /* base_init */
             NULL,   /* base_finalize */
@@ -152,7 +154,8 @@
             0,      /* n_preallocs */
             (GInstanceInitFunc)gnc_sx_slr_tree_model_adapter_init    /* instance_init */
         };
-        static const GInterfaceInfo itreeModel_info = {
+        static const GInterfaceInfo itreeModel_info =
+        {
             (GInterfaceInitFunc) gnc_sx_slr_tree_model_adapter_interface_init,    /* interface_init */
             NULL,               /* interface_finalize */
             NULL                /* interface_data */
@@ -349,7 +352,8 @@
 }
 
 // model columns
-enum {
+enum
+{
     SLR_MODEL_COL_NAME = 0,
     SLR_MODEL_COL_INSTANCE_STATE,
     SLR_MODEL_COL_VARAIBLE_VALUE,
@@ -375,7 +379,8 @@
     g_signal_connect(adapter->real, "rows-reordered", G_CALLBACK(gsslrtma_proxy_rows_reordered), adapter);
 }
 
-static char* gnc_sx_instance_state_names[] = {
+static char* gnc_sx_instance_state_names[] =
+{
     N_("Ignored"),
     N_("Postponed"),
     N_("To-Create"),
@@ -529,7 +534,7 @@
                                            SLR_MODEL_COL_INSTANCE_VISIBILITY, FALSE,
                                            SLR_MODEL_COL_VARIABLE_VISIBILITY, TRUE,
                                            SLR_MODEL_COL_INSTANCE_STATE_SENSITIVITY, FALSE
-                                           -1);
+                                           - 1);
                         g_string_free(tmp_str, TRUE);
                     }
                     g_list_free(vars);
@@ -537,7 +542,7 @@
                     _consume_excess_rows(model->real, visible_variable_index, &inst_tree_iter, &var_tree_iter);
                 }
             }
-               
+
             // if there are more instance iters, remove
             _consume_excess_rows(model->real, instance_index, &sx_tree_iter, &inst_tree_iter);
         }
@@ -708,7 +713,7 @@
 static void
 gsslrtma_added_cb(GncSxInstanceModel *instances, SchedXaction *added_sx, gpointer user_data)
 {
-    GncSxSlrTreeModelAdapter *model = GNC_SX_SLR_TREE_MODEL_ADAPTER(user_data); 
+    GncSxSlrTreeModelAdapter *model = GNC_SX_SLR_TREE_MODEL_ADAPTER(user_data);
     // this is wasteful, but fine.
     gsslrtma_populate_tree_store(model);
 }
@@ -716,7 +721,7 @@
 static void
 gsslrtma_updated_cb(GncSxInstanceModel *instances, SchedXaction *updated_sx, gpointer user_data)
 {
-    GncSxSlrTreeModelAdapter *model = GNC_SX_SLR_TREE_MODEL_ADAPTER(user_data); 
+    GncSxSlrTreeModelAdapter *model = GNC_SX_SLR_TREE_MODEL_ADAPTER(user_data);
     gnc_sx_instance_model_update_sx_instances(instances, updated_sx);
     gsslrtma_populate_tree_store(model);
 }
@@ -724,7 +729,7 @@
 static void
 gsslrtma_removing_cb(GncSxInstanceModel *instances, SchedXaction *to_remove_sx, gpointer user_data)
 {
-    GncSxSlrTreeModelAdapter *model = GNC_SX_SLR_TREE_MODEL_ADAPTER(user_data); 
+    GncSxSlrTreeModelAdapter *model = GNC_SX_SLR_TREE_MODEL_ADAPTER(user_data);
     GtkTreeIter tree_iter;
     GList *iter;
     int index = 0;
@@ -752,7 +757,7 @@
     adapter = GNC_SX_SLR_TREE_MODEL_ADAPTER(obj);
     g_return_if_fail(!adapter->disposed);
     adapter->disposed = TRUE;
-     
+
     g_object_unref(G_OBJECT(adapter->instances));
     adapter->instances = NULL;
     g_object_unref(G_OBJECT(adapter->real));
@@ -807,14 +812,14 @@
         if (summary.num_auto_create_no_notify_instances != 0)
         {
             gnc_info_dialog
-                (NULL,
-                 ngettext 
-                 ("There are no Scheduled Transactions to be entered at this time. "
-                  "(%d transaction automatically created)",
-                  "There are no Scheduled Transactions to be entered at this time. "
-                  "(%d transactions automatically created)",
-                  summary.num_auto_create_no_notify_instances),
-                 summary.num_auto_create_no_notify_instances);
+            (NULL,
+             ngettext
+             ("There are no Scheduled Transactions to be entered at this time. "
+              "(%d transaction automatically created)",
+              "There are no Scheduled Transactions to be entered at this time. "
+              "(%d transactions automatically created)",
+              summary.num_auto_create_no_notify_instances),
+             summary.num_auto_create_no_notify_instances);
         }
     }
     g_list_free(auto_created_txns);
@@ -831,7 +836,7 @@
     GncSxInstance *inst;
     int i;
     GncSxInstanceState new_state;
-     
+
     for (i = 0; i < SX_INSTANCE_STATE_CREATED; i++)
     {
         if (strcmp(value, _(gnc_sx_instance_state_names[i])) == 0)
@@ -886,7 +891,7 @@
     }
 
     if (!xaccParseAmount(value, TRUE, &parsed_num, &endStr)
-        || gnc_numeric_check(parsed_num) != GNC_ERROR_OK)
+            || gnc_numeric_check(parsed_num) != GNC_ERROR_OK)
     {
         gchar *value_copy = g_strdup(value);
         g_debug("value=[%s] endStr[%s]", value, endStr);
@@ -919,18 +924,18 @@
     dialog->review_created_txns_toggle = GTK_TOGGLE_BUTTON(glade_xml_get_widget(glade, "review_txn_toggle"));
 
     dialog->created_txns = auto_created_txn_guids;
-     
+
     {
         GtkCellRenderer *renderer;
         GtkTreeViewColumn *col;
-          
+
         dialog->instance_view = GTK_TREE_VIEW(glade_xml_get_widget(glade, "instance_view"));
         gtk_tree_view_set_model(dialog->instance_view, GTK_TREE_MODEL(dialog->editing_model));
 
         renderer = gtk_cell_renderer_text_new();
         col = gtk_tree_view_column_new_with_attributes(_("Transaction"), renderer,
-                                                       "text", SLR_MODEL_COL_NAME,
-                                                       NULL);
+                "text", SLR_MODEL_COL_NAME,
+                NULL);
         gtk_tree_view_append_column(dialog->instance_view, col);
 
         renderer = gtk_cell_renderer_combo_new();
@@ -945,14 +950,14 @@
                          G_CALLBACK(instance_state_changed_cb),
                          dialog);
         col = gtk_tree_view_column_new_with_attributes(_("Status"), renderer,
-                                                       "text", SLR_MODEL_COL_INSTANCE_STATE,
-                                                       "visible", SLR_MODEL_COL_INSTANCE_VISIBILITY,
-                                                       // you might think only "sensitive" is required to
-                                                       // control the ability of the combo box to select
-                                                       // a new state, but you'd be wrong.
-                                                       "editable", SLR_MODEL_COL_INSTANCE_STATE_SENSITIVITY,
-                                                       "sensitive", SLR_MODEL_COL_INSTANCE_STATE_SENSITIVITY,
-                                                       NULL);
+                "text", SLR_MODEL_COL_INSTANCE_STATE,
+                "visible", SLR_MODEL_COL_INSTANCE_VISIBILITY,
+                // you might think only "sensitive" is required to
+                // control the ability of the combo box to select
+                // a new state, but you'd be wrong.
+                "editable", SLR_MODEL_COL_INSTANCE_STATE_SENSITIVITY,
+                "sensitive", SLR_MODEL_COL_INSTANCE_STATE_SENSITIVITY,
+                NULL);
         gtk_tree_view_append_column(dialog->instance_view, col);
 
         renderer = gtk_cell_renderer_text_new();
@@ -964,9 +969,9 @@
                          G_CALLBACK(variable_value_changed_cb),
                          dialog);
         col = gtk_tree_view_column_new_with_attributes(_("Value"), renderer,
-                                                       "text", SLR_MODEL_COL_VARAIBLE_VALUE,
-                                                       "visible", SLR_MODEL_COL_VARIABLE_VISIBILITY,
-                                                       NULL);
+                "text", SLR_MODEL_COL_VARAIBLE_VALUE,
+                "visible", SLR_MODEL_COL_VARIABLE_VISIBILITY,
+                NULL);
         gtk_tree_view_append_column(dialog->instance_view, col);
 
         gtk_tree_view_expand_all(dialog->instance_view);
@@ -978,7 +983,7 @@
     gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(dialog->dialog));
 
     dialog->component_id = gnc_register_gui_component
-        (DIALOG_SX_SINCE_LAST_RUN_CM_CLASS, NULL, close_handler, dialog);
+                           (DIALOG_SX_SINCE_LAST_RUN_CM_CLASS, NULL, close_handler, dialog);
     gnc_gui_component_set_session(dialog->component_id,
                                   gnc_get_current_session());
 
@@ -1044,41 +1049,41 @@
         // - [ ] instance state constraints
         // - [x] required variable binding
         // - [?] ability to create transactions
+    {
+        GList *unbound_variables;
+        unbound_variables = gnc_sx_instance_model_check_variables(app_dialog->editing_model->instances);
+        g_message("%d variables unbound", g_list_length(unbound_variables));
+        if (g_list_length(unbound_variables) > 0)
         {
-            GList *unbound_variables;
-            unbound_variables = gnc_sx_instance_model_check_variables(app_dialog->editing_model->instances);
-            g_message("%d variables unbound", g_list_length(unbound_variables));
-            if (g_list_length(unbound_variables) > 0)
-            {
-                // focus first variable
-                GncSxVariableNeeded *first_unbound;
-                GtkTreePath *variable_path;
-                GtkTreeViewColumn *variable_col;
-                gint variable_view_column = 2;
-                gboolean start_editing = TRUE;
+            // focus first variable
+            GncSxVariableNeeded *first_unbound;
+            GtkTreePath *variable_path;
+            GtkTreeViewColumn *variable_col;
+            gint variable_view_column = 2;
+            gboolean start_editing = TRUE;
 
-                first_unbound = (GncSxVariableNeeded*)unbound_variables->data;
-                variable_path = _get_path_for_variable(app_dialog->editing_model, first_unbound->instance, first_unbound->variable);
-                variable_col = gtk_tree_view_get_column(app_dialog->instance_view, variable_view_column);
+            first_unbound = (GncSxVariableNeeded*)unbound_variables->data;
+            variable_path = _get_path_for_variable(app_dialog->editing_model, first_unbound->instance, first_unbound->variable);
+            variable_col = gtk_tree_view_get_column(app_dialog->instance_view, variable_view_column);
 
-                gtk_tree_view_set_cursor(app_dialog->instance_view, variable_path, variable_col, start_editing);
+            gtk_tree_view_set_cursor(app_dialog->instance_view, variable_path, variable_col, start_editing);
 
-                gtk_tree_path_free(variable_path);
-                g_list_foreach(unbound_variables, (GFunc)g_free, NULL);
-                g_list_free(unbound_variables);
-                return;
-            }
+            gtk_tree_path_free(variable_path);
+            g_list_foreach(unbound_variables, (GFunc)g_free, NULL);
+            g_list_free(unbound_variables);
+            return;
         }
-        gnc_suspend_gui_refresh();
-        gnc_sx_slr_model_effect_change(app_dialog->editing_model, FALSE, &app_dialog->created_txns, NULL);
-        gnc_resume_gui_refresh();
-        if (gtk_toggle_button_get_active(app_dialog->review_created_txns_toggle)
+    }
+    gnc_suspend_gui_refresh();
+    gnc_sx_slr_model_effect_change(app_dialog->editing_model, FALSE, &app_dialog->created_txns, NULL);
+    gnc_resume_gui_refresh();
+    if (gtk_toggle_button_get_active(app_dialog->review_created_txns_toggle)
             && g_list_length(app_dialog->created_txns) > 0)
-        {
-            _show_created_transactions(app_dialog, app_dialog->created_txns);
-        }
-        g_list_free(app_dialog->created_txns);
-        app_dialog->created_txns = NULL;
+    {
+        _show_created_transactions(app_dialog, app_dialog->created_txns);
+    }
+    g_list_free(app_dialog->created_txns);
+    app_dialog->created_txns = NULL;
 
     /* FALLTHROUGH */
     case GTK_RESPONSE_CANCEL:

Modified: gnucash/trunk/src/gnome/dialog-sx-since-last-run.h
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-since-last-run.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-sx-since-last-run.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -43,6 +43,6 @@
  * Create the since-last-run dialog.
  **/
 GncSxSinceLastRunDialog*  gnc_ui_sx_since_last_run_dialog(GncSxInstanceModel *sx_instances,
-                                                          GList *auto_created_txn_guids);
+        GList *auto_created_txn_guids);
 
 #endif

Modified: gnucash/trunk/src/gnome/dialog-tax-info.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-tax-info.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-tax-info.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -48,1392 +48,1399 @@
 
 enum
 {
-   INCOME,
-   EXPENSE,
-   ASSET,
-   LIAB_EQ,
-   N_CATEGORIES
+    INCOME,
+    EXPENSE,
+    ASSET,
+    LIAB_EQ,
+    N_CATEGORIES
 };
 
 static struct
 {
-  SCM payer_name_source;
-  SCM form;
-  SCM description;
-  SCM help;
-  SCM line_data;
-  SCM last_year;
-  SCM copy;
+    SCM payer_name_source;
+    SCM form;
+    SCM description;
+    SCM help;
+    SCM line_data;
+    SCM last_year;
+    SCM copy;
 
-  SCM codes;
+    SCM codes;
 
-  SCM tax_entity_type;
-  SCM tax_entity_desc;
+    SCM tax_entity_type;
+    SCM tax_entity_desc;
 
-  SCM tax_entity_types;
+    SCM tax_entity_types;
 } getters;
 
 typedef struct
 {
-  char *type_code;
-  char *type;
-  char *description;
-  char *combo_box_entry;
+    char *type_code;
+    char *type;
+    char *description;
+    char *combo_box_entry;
 } TaxTypeInfo;
 
 typedef struct
 {
-  char *code;
-  char *payer_name_source;
-  char *form;
-  char *description;
-  char *help;
-  gboolean copy;
+    char *code;
+    char *payer_name_source;
+    char *form;
+    char *description;
+    char *help;
+    gboolean copy;
 } TXFInfo;
 
 typedef struct
 {
-  GtkWidget * dialog;
+    GtkWidget * dialog;
 
-  GtkWidget * entity_name_display;
-  GtkWidget * entity_name_entry;
-  GtkWidget * entity_type_display;
-  GtkWidget * entity_type_combo;
-  GtkWidget * tax_identity_edit_button;
+    GtkWidget * entity_name_display;
+    GtkWidget * entity_name_entry;
+    GtkWidget * entity_type_display;
+    GtkWidget * entity_type_combo;
+    GtkWidget * tax_identity_edit_button;
 
-  GtkWidget * acct_info;
-  GtkWidget * expense_radio;
-  GtkWidget * asset_radio;
-  GtkWidget * liab_eq_radio;
-  GtkWidget * account_treeview;
-  GtkWidget * select_button;
+    GtkWidget * acct_info;
+    GtkWidget * expense_radio;
+    GtkWidget * asset_radio;
+    GtkWidget * liab_eq_radio;
+    GtkWidget * account_treeview;
+    GtkWidget * select_button;
 
-  GtkWidget * txf_info;
-  GtkWidget * tax_related_button;
-  GtkWidget * txf_category_view;
-  GtkWidget * txf_help_text;
-  GtkWidget * current_account_button;
-  GtkWidget * parent_account_button;
-  GtkWidget * copy_spin_button;
+    GtkWidget * txf_info;
+    GtkWidget * tax_related_button;
+    GtkWidget * txf_category_view;
+    GtkWidget * txf_help_text;
+    GtkWidget * current_account_button;
+    GtkWidget * parent_account_button;
+    GtkWidget * copy_spin_button;
 
-  GList * entity_type_infos;
-  GList * income_txf_infos;
-  GList * expense_txf_infos;
-  GList * asset_txf_infos;
-  GList * liab_eq_txf_infos;
+    GList * entity_type_infos;
+    GList * income_txf_infos;
+    GList * expense_txf_infos;
+    GList * asset_txf_infos;
+    GList * liab_eq_txf_infos;
 
-  const gchar * tax_name;
-  const gchar * tax_type;
-  const gchar * tax_type_combo_text;
-  const gchar * default_tax_type;
+    const gchar * tax_name;
+    const gchar * tax_type;
+    const gchar * tax_type_combo_text;
+    const gchar * default_tax_type;
 
-  QofBook *this_book;
+    QofBook *this_book;
 
-  gboolean changed;
-  gboolean tax_type_changed;
+    gboolean changed;
+    gboolean tax_type_changed;
 
-  GNCAccountType account_type;
+    GNCAccountType account_type;
 } TaxInfoDialog;
 
 
 static void
 initialize_getters (void)
 {
-  getters.payer_name_source = scm_c_eval_string ("gnc:txf-get-payer-name-source");
-  getters.form              = scm_c_eval_string ("gnc:txf-get-form");
-  getters.description       = scm_c_eval_string ("gnc:txf-get-description");
-  getters.help              = scm_c_eval_string ("gnc:txf-get-help");
-  getters.line_data         = scm_c_eval_string ("gnc:txf-get-line-data");
-  getters.last_year         = scm_c_eval_string ("gnc:txf-get-last-year");
-  getters.copy              = scm_c_eval_string ("gnc:txf-get-multiple");
+    getters.payer_name_source = scm_c_eval_string ("gnc:txf-get-payer-name-source");
+    getters.form              = scm_c_eval_string ("gnc:txf-get-form");
+    getters.description       = scm_c_eval_string ("gnc:txf-get-description");
+    getters.help              = scm_c_eval_string ("gnc:txf-get-help");
+    getters.line_data         = scm_c_eval_string ("gnc:txf-get-line-data");
+    getters.last_year         = scm_c_eval_string ("gnc:txf-get-last-year");
+    getters.copy              = scm_c_eval_string ("gnc:txf-get-multiple");
 
-  getters.codes             = scm_c_eval_string ("gnc:txf-get-codes");
+    getters.codes             = scm_c_eval_string ("gnc:txf-get-codes");
 
-  getters.tax_entity_type   = scm_c_eval_string ("gnc:txf-get-tax-entity-type");
-  getters.tax_entity_desc   = scm_c_eval_string
-                                    ("gnc:txf-get-tax-entity-type-description");
+    getters.tax_entity_type   = scm_c_eval_string ("gnc:txf-get-tax-entity-type");
+    getters.tax_entity_desc   = scm_c_eval_string
+                                ("gnc:txf-get-tax-entity-type-description");
 
-  getters.tax_entity_types = scm_c_eval_string
-                                          ("gnc:txf-get-tax-entity-type-codes");
+    getters.tax_entity_types = scm_c_eval_string
+                               ("gnc:txf-get-tax-entity-type-codes");
 }
 
 static void
 destroy_tax_type_info (gpointer data, gpointer user_data)
 {
-  TaxTypeInfo *tax_type = data;
+    TaxTypeInfo *tax_type = data;
 
-  g_free (tax_type->type_code);
-  tax_type->type_code = NULL;
+    g_free (tax_type->type_code);
+    tax_type->type_code = NULL;
 
-  g_free (tax_type->type);
-  tax_type->type = NULL;
+    g_free (tax_type->type);
+    tax_type->type = NULL;
 
-  g_free (tax_type->description);
-  tax_type->description = NULL;
+    g_free (tax_type->description);
+    tax_type->description = NULL;
 
-  g_free (tax_type->combo_box_entry);
-  tax_type->combo_box_entry = NULL;
+    g_free (tax_type->combo_box_entry);
+    tax_type->combo_box_entry = NULL;
 
-  g_free (tax_type);
+    g_free (tax_type);
 }
 
 static void
 destroy_tax_type_infos (GList *types)
 {
-  g_list_foreach (types, destroy_tax_type_info, NULL);
-  g_list_free (types);
+    g_list_foreach (types, destroy_tax_type_info, NULL);
+    g_list_free (types);
 }
 
 static void
 destroy_txf_info (gpointer data, gpointer user_data)
 {
-  TXFInfo *txf_info = data;
+    TXFInfo *txf_info = data;
 
-  g_free (txf_info->code);
-  txf_info->code = NULL;
+    g_free (txf_info->code);
+    txf_info->code = NULL;
 
-  g_free (txf_info->payer_name_source);
-  txf_info->payer_name_source = NULL;
+    g_free (txf_info->payer_name_source);
+    txf_info->payer_name_source = NULL;
 
-  g_free (txf_info->form);
-  txf_info->form = NULL;
+    g_free (txf_info->form);
+    txf_info->form = NULL;
 
-  g_free (txf_info->description);
-  txf_info->description = NULL;
+    g_free (txf_info->description);
+    txf_info->description = NULL;
 
-  g_free (txf_info->help);
-  txf_info->help = NULL;
+    g_free (txf_info->help);
+    txf_info->help = NULL;
 
-  g_free (txf_info);
+    g_free (txf_info);
 }
 
 static void
 destroy_txf_infos (GList *infos)
 {
-  g_list_foreach (infos, destroy_txf_info, NULL);
-  g_list_free (infos);
+    g_list_foreach (infos, destroy_txf_info, NULL);
+    g_list_free (infos);
 }
 
 static void
 gnc_tax_info_set_changed (TaxInfoDialog *ti_dialog, gboolean changed)
 {
-  ti_dialog->changed = changed;
+    ti_dialog->changed = changed;
 }
 
 static GList *
 load_txf_info (gint acct_category, TaxInfoDialog *ti_dialog)
 {
-  GList *infos = NULL;
-  SCM tax_entity_type;
-  SCM category;
-  SCM codes;
+    GList *infos = NULL;
+    SCM tax_entity_type;
+    SCM category;
+    SCM codes;
 
-  if (ti_dialog->tax_type == NULL ||
-        (safe_strcmp (ti_dialog->tax_type, "") == 0))
-  {
-     destroy_txf_infos (infos);
-     return NULL;
-  }
-  else
-  {
-/*     tax_entity_type = scm_from_locale_string (ti_dialog->tax_type); <- Req's guile 1.8 */
-     tax_entity_type = scm_makfrom0str (ti_dialog->tax_type); /* <-guile 1.6  */
-  }
+    if (ti_dialog->tax_type == NULL ||
+            (safe_strcmp (ti_dialog->tax_type, "") == 0))
+    {
+        destroy_txf_infos (infos);
+        return NULL;
+    }
+    else
+    {
+        /*     tax_entity_type = scm_from_locale_string (ti_dialog->tax_type); <- Req's guile 1.8 */
+        tax_entity_type = scm_makfrom0str (ti_dialog->tax_type); /* <-guile 1.6  */
+    }
 
-  switch (acct_category) {
-   case INCOME:
-    category = scm_c_eval_string ("txf-income-categories");
-    break;
-   case EXPENSE:
-    category = scm_c_eval_string ("txf-expense-categories");
-    break;
-   case ASSET:
-    category = scm_c_eval_string ("txf-asset-categories");
-    break;
-   case LIAB_EQ:
-    category = scm_c_eval_string ("txf-liab-eq-categories");
-    break;
-   default:
-    destroy_txf_infos (infos);
-    return NULL;
-  }
+    switch (acct_category)
+    {
+    case INCOME:
+        category = scm_c_eval_string ("txf-income-categories");
+        break;
+    case EXPENSE:
+        category = scm_c_eval_string ("txf-expense-categories");
+        break;
+    case ASSET:
+        category = scm_c_eval_string ("txf-asset-categories");
+        break;
+    case LIAB_EQ:
+        category = scm_c_eval_string ("txf-liab-eq-categories");
+        break;
+    default:
+        destroy_txf_infos (infos);
+        return NULL;
+    }
 
-  if (category == SCM_UNDEFINED)
-  {
-    destroy_txf_infos (infos);
-    return NULL;
-  }
+    if (category == SCM_UNDEFINED)
+    {
+        destroy_txf_infos (infos);
+        return NULL;
+    }
 
-  codes = scm_call_2 (getters.codes, category, tax_entity_type);
-  if (!scm_is_list (codes))
-  {
-    destroy_txf_infos (infos);
-    return NULL;
-  }
+    codes = scm_call_2 (getters.codes, category, tax_entity_type);
+    if (!scm_is_list (codes))
+    {
+        destroy_txf_infos (infos);
+        return NULL;
+    }
 
-  while (!scm_is_null (codes))
-  {
-    TXFInfo *txf_info;
-    SCM code_scm;
-    const gchar *str;
-    const gchar *last_yr = _("Last Valid Year: ");
-    const gchar *form_line = _("Form Line Data: ");
-    gchar *form_line_data = NULL;
-    SCM scm;
-    gint year;
-    gboolean cpy;
+    while (!scm_is_null (codes))
+    {
+        TXFInfo *txf_info;
+        SCM code_scm;
+        const gchar *str;
+        const gchar *last_yr = _("Last Valid Year: ");
+        const gchar *form_line = _("Form Line Data: ");
+        gchar *form_line_data = NULL;
+        SCM scm;
+        gint year;
+        gboolean cpy;
 
-    code_scm  = SCM_CAR (codes);
-    codes     = SCM_CDR (codes);
+        code_scm  = SCM_CAR (codes);
+        codes     = SCM_CDR (codes);
 
-    scm = scm_call_3 (getters.payer_name_source, category, code_scm,
-                                                               tax_entity_type);
-    str = SCM_SYMBOL_CHARS (scm);
-    if (safe_strcmp (str, "not-impl") == 0)
-    {
-      continue;
-    }
+        scm = scm_call_3 (getters.payer_name_source, category, code_scm,
+                          tax_entity_type);
+        str = SCM_SYMBOL_CHARS (scm);
+        if (safe_strcmp (str, "not-impl") == 0)
+        {
+            continue;
+        }
 
-    txf_info = g_new0 (TXFInfo, 1);
+        txf_info = g_new0 (TXFInfo, 1);
 
-    if (safe_strcmp (str, "none") == 0)
-      txf_info->payer_name_source = NULL;
-    else
-      txf_info->payer_name_source = g_strdup (str);
+        if (safe_strcmp (str, "none") == 0)
+            txf_info->payer_name_source = NULL;
+        else
+            txf_info->payer_name_source = g_strdup (str);
 
-    str = scm_is_symbol(code_scm) ? SCM_SYMBOL_CHARS(code_scm) : "";
-    txf_info->code = g_strdup (str);
+        str = scm_is_symbol(code_scm) ? SCM_SYMBOL_CHARS(code_scm) : "";
+        txf_info->code = g_strdup (str);
 
-    scm = scm_call_3 (getters.form, category, code_scm, tax_entity_type);
-    str = scm_is_string(scm) ? scm_to_locale_string(scm) : "";
-    txf_info->form = g_strdup (str);
+        scm = scm_call_3 (getters.form, category, code_scm, tax_entity_type);
+        str = scm_is_string(scm) ? scm_to_locale_string(scm) : "";
+        txf_info->form = g_strdup (str);
 
-    scm = scm_call_3 (getters.description, category, code_scm, tax_entity_type);
-    str = scm_is_string(scm) ? scm_to_locale_string(scm) : "";
-    txf_info->description = g_strdup (str);
+        scm = scm_call_3 (getters.description, category, code_scm, tax_entity_type);
+        str = scm_is_string(scm) ? scm_to_locale_string(scm) : "";
+        txf_info->description = g_strdup (str);
 
-    scm = scm_call_2 (getters.help, category, code_scm);
-    str = scm_is_string(scm) ? scm_to_locale_string(scm) : "";
-    scm = scm_call_3 (getters.last_year, category, code_scm, tax_entity_type);
-/*    year = scm_is_bool (scm) ? 0 : scm_to_int(scm); <- Req's guile 1.8 */
-    year = scm_is_bool (scm) ? 0 : SCM_INUM(scm); /* <-guile 1.6  */
-    scm = scm_call_3 (getters.line_data, category, code_scm, tax_entity_type);
-    if (scm_is_list (scm))
-    {
-      const gchar *until = _("now");
+        scm = scm_call_2 (getters.help, category, code_scm);
+        str = scm_is_string(scm) ? scm_to_locale_string(scm) : "";
+        scm = scm_call_3 (getters.last_year, category, code_scm, tax_entity_type);
+        /*    year = scm_is_bool (scm) ? 0 : scm_to_int(scm); <- Req's guile 1.8 */
+        year = scm_is_bool (scm) ? 0 : SCM_INUM(scm); /* <-guile 1.6  */
+        scm = scm_call_3 (getters.line_data, category, code_scm, tax_entity_type);
+        if (scm_is_list (scm))
+        {
+            const gchar *until = _("now");
 
-      if (year != 0)
-        until = g_strdup_printf ("%d", year);
-      form_line_data = g_strconcat ("\n", "\n", form_line, NULL);
-      while (!scm_is_null (scm))
-      {
-        SCM year_scm;
-        gint line_year;
-        const gchar *line;
-        gchar *temp;
+            if (year != 0)
+                until = g_strdup_printf ("%d", year);
+            form_line_data = g_strconcat ("\n", "\n", form_line, NULL);
+            while (!scm_is_null (scm))
+            {
+                SCM year_scm;
+                gint line_year;
+                const gchar *line;
+                gchar *temp;
 
-        year_scm  = SCM_CAR (scm);
-        scm       = SCM_CDR (scm);
+                year_scm  = SCM_CAR (scm);
+                scm       = SCM_CDR (scm);
 
-/*        line_year = scm_is_bool (SCM_CAR (year_scm)) ? 0 :
-                          scm_to_int (SCM_CAR (year_scm)); <- Req's guile 1.8 */
-        line_year = scm_is_bool (SCM_CAR (year_scm)) ? 0 :
+                /*        line_year = scm_is_bool (SCM_CAR (year_scm)) ? 0 :
+                                          scm_to_int (SCM_CAR (year_scm)); <- Req's guile 1.8 */
+                line_year = scm_is_bool (SCM_CAR (year_scm)) ? 0 :
                             SCM_INUM (SCM_CAR (year_scm)); /* <-guile 1.6  */
-        line = scm_is_string((SCM_CAR (SCM_CDR (year_scm))))
-                        ? scm_to_locale_string((SCM_CAR (SCM_CDR (year_scm)))) : "";
-        temp = g_strconcat (form_line_data, "\n",
-                            g_strdup_printf ("%d", line_year), " - ", until,
-                            "   ", line, NULL);
-        until = g_strdup_printf ("%d", (line_year - 1));
-        g_free(form_line_data);
-        form_line_data = g_strdup (temp);
-        g_free(temp);
-      }
-    }
-    if (year != 0)
-    {
-      if (form_line_data != NULL)
-        txf_info->help = g_strconcat (last_yr, g_strdup_printf ("%d", year),
-                                         "\n", "\n", str, form_line_data, NULL);
-      else
-        txf_info->help = g_strconcat (last_yr, g_strdup_printf ("%d", year),
-                                                         "\n", "\n", str, NULL);
-    }
-    else
-    {
-      if (form_line_data != NULL)
-        txf_info->help = g_strconcat (str, form_line_data, NULL);
-      else
-        txf_info->help = g_strdup (str);
-    }
+                line = scm_is_string((SCM_CAR (SCM_CDR (year_scm))))
+                       ? scm_to_locale_string((SCM_CAR (SCM_CDR (year_scm)))) : "";
+                temp = g_strconcat (form_line_data, "\n",
+                                    g_strdup_printf ("%d", line_year), " - ", until,
+                                    "   ", line, NULL);
+                until = g_strdup_printf ("%d", (line_year - 1));
+                g_free(form_line_data);
+                form_line_data = g_strdup (temp);
+                g_free(temp);
+            }
+        }
+        if (year != 0)
+        {
+            if (form_line_data != NULL)
+                txf_info->help = g_strconcat (last_yr, g_strdup_printf ("%d", year),
+                                              "\n", "\n", str, form_line_data, NULL);
+            else
+                txf_info->help = g_strconcat (last_yr, g_strdup_printf ("%d", year),
+                                              "\n", "\n", str, NULL);
+        }
+        else
+        {
+            if (form_line_data != NULL)
+                txf_info->help = g_strconcat (str, form_line_data, NULL);
+            else
+                txf_info->help = g_strdup (str);
+        }
 
-    if (form_line_data != NULL)
-      g_free(form_line_data);
+        if (form_line_data != NULL)
+            g_free(form_line_data);
 
-    scm = scm_call_3 (getters.copy, category, code_scm, tax_entity_type);
-/*    cpy = scm_is_bool (scm) ? (scm_is_false (scm) ? FALSE : TRUE): FALSE; <- Req's guile 1.8 */
-    cpy = scm_is_bool (scm) ? (scm_is_false (scm) ? FALSE : TRUE): FALSE; /* <-guile 1.6  */
-    txf_info->copy = cpy;
+        scm = scm_call_3 (getters.copy, category, code_scm, tax_entity_type);
+        /*    cpy = scm_is_bool (scm) ? (scm_is_false (scm) ? FALSE : TRUE): FALSE; <- Req's guile 1.8 */
+        cpy = scm_is_bool (scm) ? (scm_is_false (scm) ? FALSE : TRUE) : FALSE; /* <-guile 1.6  */
+        txf_info->copy = cpy;
 
-    infos = g_list_prepend (infos, txf_info);
-  }
+        infos = g_list_prepend (infos, txf_info);
+    }
 
-  return g_list_reverse (infos);
+    return g_list_reverse (infos);
 }
 
 static GList *
 tax_infos (TaxInfoDialog *ti_dialog)
 {
-  return
-      (ti_dialog->account_type == ACCT_TYPE_INCOME)
-                                              ? ti_dialog->income_txf_infos :
-     ((ti_dialog->account_type == ACCT_TYPE_EXPENSE)
-                                              ? ti_dialog->expense_txf_infos :
-    (((ti_dialog->account_type == ACCT_TYPE_ASSET)
-                                              ? ti_dialog->asset_txf_infos :
-                                                ti_dialog->liab_eq_txf_infos)));
+    return
+        (ti_dialog->account_type == ACCT_TYPE_INCOME)
+        ? ti_dialog->income_txf_infos :
+        ((ti_dialog->account_type == ACCT_TYPE_EXPENSE)
+         ? ti_dialog->expense_txf_infos :
+         (((ti_dialog->account_type == ACCT_TYPE_ASSET)
+           ? ti_dialog->asset_txf_infos :
+           ti_dialog->liab_eq_txf_infos)));
 }
 
 static void
 load_tax_entity_type_list (TaxInfoDialog *ti_dialog)
 {
-  GList *types = NULL;
-  SCM tax_types;
+    GList *types = NULL;
+    SCM tax_types;
 
-  ti_dialog->tax_type_combo_text = NULL;
-  tax_types = scm_call_0 (getters.tax_entity_types);
-  if (!scm_is_list (tax_types))
-  {
-    destroy_tax_type_infos (types);
-    return;
-  }
+    ti_dialog->tax_type_combo_text = NULL;
+    tax_types = scm_call_0 (getters.tax_entity_types);
+    if (!scm_is_list (tax_types))
+    {
+        destroy_tax_type_infos (types);
+        return;
+    }
 
-  while (!scm_is_null (tax_types))
-  {
-    TaxTypeInfo *tax_type_info;
-    SCM type_scm;
-    const gchar *str;
-    SCM scm;
+    while (!scm_is_null (tax_types))
+    {
+        TaxTypeInfo *tax_type_info;
+        SCM type_scm;
+        const gchar *str;
+        SCM scm;
 
-    type_scm  = SCM_CAR (tax_types);
-    tax_types = SCM_CDR (tax_types);
+        type_scm  = SCM_CAR (tax_types);
+        tax_types = SCM_CDR (tax_types);
 
-    ti_dialog->default_tax_type = NULL;
+        ti_dialog->default_tax_type = NULL;
 
-    tax_type_info = g_new0 (TaxTypeInfo, 1);
+        tax_type_info = g_new0 (TaxTypeInfo, 1);
 
-    str = scm_is_symbol(type_scm) ? SCM_SYMBOL_CHARS(type_scm) : "";
-    tax_type_info->type_code = g_strdup (str);
+        str = scm_is_symbol(type_scm) ? SCM_SYMBOL_CHARS(type_scm) : "";
+        tax_type_info->type_code = g_strdup (str);
 
-    scm = scm_call_1 (getters.tax_entity_type, type_scm);
-    str = scm_is_string(scm) ? scm_to_locale_string (scm) : "";
-    tax_type_info->type = g_strdup (str);
+        scm = scm_call_1 (getters.tax_entity_type, type_scm);
+        str = scm_is_string(scm) ? scm_to_locale_string (scm) : "";
+        tax_type_info->type = g_strdup (str);
 
-    scm = scm_call_1 (getters.tax_entity_desc, type_scm);
-    str = scm_is_string(scm) ? scm_to_locale_string (scm) : "";
-    tax_type_info->description = g_strdup (str);
+        scm = scm_call_1 (getters.tax_entity_desc, type_scm);
+        str = scm_is_string(scm) ? scm_to_locale_string (scm) : "";
+        tax_type_info->description = g_strdup (str);
 
-    tax_type_info->combo_box_entry = g_strconcat(tax_type_info->type, " - ", 
-                                             tax_type_info->description, NULL);
-    /* save combo text for current tax type code */
-    if (safe_strcmp (ti_dialog->tax_type, tax_type_info->type_code) == 0)
-       ti_dialog->tax_type_combo_text = g_strdup (tax_type_info->combo_box_entry);
-     /* the last will be default */
-    ti_dialog->default_tax_type = g_strdup (tax_type_info->combo_box_entry);
+        tax_type_info->combo_box_entry = g_strconcat(tax_type_info->type, " - ",
+                                         tax_type_info->description, NULL);
+        /* save combo text for current tax type code */
+        if (safe_strcmp (ti_dialog->tax_type, tax_type_info->type_code) == 0)
+            ti_dialog->tax_type_combo_text = g_strdup (tax_type_info->combo_box_entry);
+        /* the last will be default */
+        ti_dialog->default_tax_type = g_strdup (tax_type_info->combo_box_entry);
 
-    types = g_list_prepend (types, tax_type_info);
-  }
+        types = g_list_prepend (types, tax_type_info);
+    }
 
-  ti_dialog->entity_type_infos = g_list_reverse (types);
+    ti_dialog->entity_type_infos = g_list_reverse (types);
 }
 
 static void
 load_category_list (TaxInfoDialog *ti_dialog)
 {
-  GtkTreeView *view;
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GList *codes;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkTreeIter iter;
+    GList *codes;
 
-  view = GTK_TREE_VIEW(ti_dialog->txf_category_view);
-  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
-  g_object_ref(store);
-  gtk_tree_view_set_model(view, NULL);
+    view = GTK_TREE_VIEW(ti_dialog->txf_category_view);
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+    g_object_ref(store);
+    gtk_tree_view_set_model(view, NULL);
 
-  gtk_list_store_clear(store);
+    gtk_list_store_clear(store);
 
-  codes = tax_infos (ti_dialog);
-  for ( ; codes; codes = codes->next)
-  {
-    TXFInfo *txf_info = codes->data;
+    codes = tax_infos (ti_dialog);
+    for ( ; codes; codes = codes->next)
+    {
+        TXFInfo *txf_info = codes->data;
 
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-		       0, txf_info->form,
-		       1, txf_info->description,
-		       -1);
-  }
+        gtk_list_store_append(store, &iter);
+        gtk_list_store_set(store, &iter,
+                           0, txf_info->form,
+                           1, txf_info->description,
+                           -1);
+    }
 
-  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-  g_object_unref(store);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 }
 
 static void
 clear_gui (TaxInfoDialog *ti_dialog)
 {
-  GtkTreeView *view;
-  GtkTreeSelection *selection;
+    GtkTreeView *view;
+    GtkTreeSelection *selection;
 
-  gtk_toggle_button_set_active
+    gtk_toggle_button_set_active
     (GTK_TOGGLE_BUTTON (ti_dialog->tax_related_button), FALSE);
 
-  view = GTK_TREE_VIEW(ti_dialog->txf_category_view);
-  selection = gtk_tree_view_get_selection(view);
-  gtk_tree_selection_unselect_all(selection);
+    view = GTK_TREE_VIEW(ti_dialog->txf_category_view);
+    selection = gtk_tree_view_get_selection(view);
+    gtk_tree_selection_unselect_all(selection);
 
-  gtk_toggle_button_set_active
+    gtk_toggle_button_set_active
     (GTK_TOGGLE_BUTTON (ti_dialog->current_account_button), TRUE);
 
-  gtk_spin_button_set_value
+    gtk_spin_button_set_value
     (GTK_SPIN_BUTTON (ti_dialog->copy_spin_button), 1);
 }
 
 static gboolean
 gnc_tax_info_dialog_account_filter_func (Account *account,
-					 gpointer data)
+        gpointer data)
 {
-  TaxInfoDialog *dialog = data;
-  gboolean included = FALSE;
+    TaxInfoDialog *dialog = data;
+    gboolean included = FALSE;
 
-  if ((dialog->account_type == ACCT_TYPE_INCOME) ||
-      (dialog->account_type == ACCT_TYPE_EXPENSE))
-     included = (xaccAccountGetType (account) == dialog->account_type);
-  else if (dialog->account_type == ACCT_TYPE_ASSET)
-     included = ((xaccAccountGetType (account) == ACCT_TYPE_BANK) ||
-                 (xaccAccountGetType (account) == ACCT_TYPE_CASH) ||
-                 (xaccAccountGetType (account) == ACCT_TYPE_ASSET) ||
-                 (xaccAccountGetType (account) == ACCT_TYPE_STOCK) ||
-                 (xaccAccountGetType (account) == ACCT_TYPE_MUTUAL) ||
-                 (xaccAccountGetType (account) == ACCT_TYPE_RECEIVABLE));
-  else if (dialog->account_type == ACCT_TYPE_LIABILITY)
-     included = ((xaccAccountGetType (account) == ACCT_TYPE_CREDIT) ||
-                 (xaccAccountGetType (account) == ACCT_TYPE_LIABILITY) ||
-                 (xaccAccountGetType (account) == ACCT_TYPE_EQUITY) ||
-                 (xaccAccountGetType (account) == ACCT_TYPE_PAYABLE));
-  else
-     included = FALSE;
-  return included;
+    if ((dialog->account_type == ACCT_TYPE_INCOME) ||
+            (dialog->account_type == ACCT_TYPE_EXPENSE))
+        included = (xaccAccountGetType (account) == dialog->account_type);
+    else if (dialog->account_type == ACCT_TYPE_ASSET)
+        included = ((xaccAccountGetType (account) == ACCT_TYPE_BANK) ||
+                    (xaccAccountGetType (account) == ACCT_TYPE_CASH) ||
+                    (xaccAccountGetType (account) == ACCT_TYPE_ASSET) ||
+                    (xaccAccountGetType (account) == ACCT_TYPE_STOCK) ||
+                    (xaccAccountGetType (account) == ACCT_TYPE_MUTUAL) ||
+                    (xaccAccountGetType (account) == ACCT_TYPE_RECEIVABLE));
+    else if (dialog->account_type == ACCT_TYPE_LIABILITY)
+        included = ((xaccAccountGetType (account) == ACCT_TYPE_CREDIT) ||
+                    (xaccAccountGetType (account) == ACCT_TYPE_LIABILITY) ||
+                    (xaccAccountGetType (account) == ACCT_TYPE_EQUITY) ||
+                    (xaccAccountGetType (account) == ACCT_TYPE_PAYABLE));
+    else
+        included = FALSE;
+    return included;
 }
 
 static TXFInfo *
 txf_infos_find_code (GList *infos, const char *code)
 {
-  for (; infos; infos = infos->next)
-  {
-    TXFInfo *info = infos->data;
+    for (; infos; infos = infos->next)
+    {
+        TXFInfo *info = infos->data;
 
-    if (safe_strcmp (code, info->code) == 0)
-      return info;
-  }
+        if (safe_strcmp (code, info->code) == 0)
+            return info;
+    }
 
-  return NULL;
+    return NULL;
 }
 
 static void
 account_to_gui (TaxInfoDialog *ti_dialog, Account *account)
 {
-  GtkTreeView *view;
-  GtkTreeSelection *selection;
-  GtkTreePath *path;
-  gboolean tax_related;
-  const char *str;
-  TXFInfo *info;
-  GList *infos;
-  guint index;
+    GtkTreeView *view;
+    GtkTreeSelection *selection;
+    GtkTreePath *path;
+    gboolean tax_related;
+    const char *str;
+    TXFInfo *info;
+    GList *infos;
+    guint index;
 
-  if (!account)
-  {
-    clear_gui (ti_dialog);
-    return;
-  }
+    if (!account)
+    {
+        clear_gui (ti_dialog);
+        return;
+    }
 
-  tax_related = xaccAccountGetTaxRelated (account);
-  gtk_toggle_button_set_active
+    tax_related = xaccAccountGetTaxRelated (account);
+    gtk_toggle_button_set_active
     (GTK_TOGGLE_BUTTON (ti_dialog->tax_related_button), tax_related);
 
-  infos = tax_infos (ti_dialog);
+    infos = tax_infos (ti_dialog);
 
-  str = xaccAccountGetTaxUSCode (account);
-  info = txf_infos_find_code (infos, str);
-  if (info)
-    index = g_list_index (infos, info);
-  else
-    index = 0;
-  if (index < 0)
-    index = 0;
+    str = xaccAccountGetTaxUSCode (account);
+    info = txf_infos_find_code (infos, str);
+    if (info)
+        index = g_list_index (infos, info);
+    else
+        index = 0;
+    if (index < 0)
+        index = 0;
 
-  view = GTK_TREE_VIEW(ti_dialog->txf_category_view);
-  selection = gtk_tree_view_get_selection(view);
-  path =  gtk_tree_path_new_from_indices(index, -1);
-  gtk_tree_selection_select_path(selection, path);
-  gtk_tree_view_scroll_to_cell(view, path, NULL, FALSE, 0, 0);
-  gtk_tree_path_free(path);
+    view = GTK_TREE_VIEW(ti_dialog->txf_category_view);
+    selection = gtk_tree_view_get_selection(view);
+    path =  gtk_tree_path_new_from_indices(index, -1);
+    gtk_tree_selection_select_path(selection, path);
+    gtk_tree_view_scroll_to_cell(view, path, NULL, FALSE, 0, 0);
+    gtk_tree_path_free(path);
 
-  str = xaccAccountGetTaxUSPayerNameSource (account);
-  if (safe_strcmp (str, "parent") == 0)
-    gtk_toggle_button_set_active
-      (GTK_TOGGLE_BUTTON (ti_dialog->parent_account_button), TRUE);
-  else
-    gtk_toggle_button_set_active
-      (GTK_TOGGLE_BUTTON (ti_dialog->current_account_button), TRUE);
+    str = xaccAccountGetTaxUSPayerNameSource (account);
+    if (safe_strcmp (str, "parent") == 0)
+        gtk_toggle_button_set_active
+        (GTK_TOGGLE_BUTTON (ti_dialog->parent_account_button), TRUE);
+    else
+        gtk_toggle_button_set_active
+        (GTK_TOGGLE_BUTTON (ti_dialog->current_account_button), TRUE);
 
-  gtk_spin_button_set_value
-      (GTK_SPIN_BUTTON (ti_dialog->copy_spin_button),
-                (gdouble) xaccAccountGetTaxUSCopyNumber (account));
+    gtk_spin_button_set_value
+    (GTK_SPIN_BUTTON (ti_dialog->copy_spin_button),
+     (gdouble) xaccAccountGetTaxUSCopyNumber (account));
 }
 
 static void
 gui_to_accounts (TaxInfoDialog *ti_dialog)
 {
-  GtkTreeView *view;
-  GtkTreeModel *model;
-  GtkTreeSelection *selection;
-  GtkTreePath *path;
-  GtkTreeIter iter;
-  gint *indices;
-  gboolean tax_related;
-  const char *code;
-  const char *pns;
-  GList *accounts;
-  TXFInfo *info;
-  GList *infos;
-  GList *node;
-  gint64 copy_number;
+    GtkTreeView *view;
+    GtkTreeModel *model;
+    GtkTreeSelection *selection;
+    GtkTreePath *path;
+    GtkTreeIter iter;
+    gint *indices;
+    gboolean tax_related;
+    const char *code;
+    const char *pns;
+    GList *accounts;
+    TXFInfo *info;
+    GList *infos;
+    GList *node;
+    gint64 copy_number;
 
-  tax_related = gtk_toggle_button_get_active
-    (GTK_TOGGLE_BUTTON (ti_dialog->tax_related_button));
+    tax_related = gtk_toggle_button_get_active
+                  (GTK_TOGGLE_BUTTON (ti_dialog->tax_related_button));
 
-  infos = tax_infos (ti_dialog);
+    infos = tax_infos (ti_dialog);
 
-  view = GTK_TREE_VIEW(ti_dialog->txf_category_view);
-  selection = gtk_tree_view_get_selection(view);
-  if (!gtk_tree_selection_get_selected(selection, &model, &iter))
-    return;
-  path = gtk_tree_model_get_path(model, &iter);
-  indices = gtk_tree_path_get_indices(path);
-  info = g_list_nth_data (infos, indices[0]);
-  gtk_tree_path_free(path);
-  g_return_if_fail (info != NULL);
+    view = GTK_TREE_VIEW(ti_dialog->txf_category_view);
+    selection = gtk_tree_view_get_selection(view);
+    if (!gtk_tree_selection_get_selected(selection, &model, &iter))
+        return;
+    path = gtk_tree_model_get_path(model, &iter);
+    indices = gtk_tree_path_get_indices(path);
+    info = g_list_nth_data (infos, indices[0]);
+    gtk_tree_path_free(path);
+    g_return_if_fail (info != NULL);
 
-  code = tax_related ? info->code : NULL;
+    code = tax_related ? info->code : NULL;
 
-  if (tax_related && info->payer_name_source)
-  {
-    gboolean current;
+    if (tax_related && info->payer_name_source)
+    {
+        gboolean current;
 
-    current = gtk_toggle_button_get_active
-      (GTK_TOGGLE_BUTTON (ti_dialog->current_account_button));
+        current = gtk_toggle_button_get_active
+                  (GTK_TOGGLE_BUTTON (ti_dialog->current_account_button));
 
-    pns = current ? "current" : "parent";
-  }
-  else
-    pns = NULL;
+        pns = current ? "current" : "parent";
+    }
+    else
+        pns = NULL;
 
-  if (tax_related && info->copy)
-  {
-    copy_number = gtk_spin_button_get_value_as_int
-      (GTK_SPIN_BUTTON (ti_dialog->copy_spin_button));
-  }
-  else
-    copy_number = 0;/* setting to zero removes slot */
+    if (tax_related && info->copy)
+    {
+        copy_number = gtk_spin_button_get_value_as_int
+                      (GTK_SPIN_BUTTON (ti_dialog->copy_spin_button));
+    }
+    else
+        copy_number = 0;/* setting to zero removes slot */
 
-  accounts = gnc_tree_view_account_get_selected_accounts
-    (GNC_TREE_VIEW_ACCOUNT(ti_dialog->account_treeview));
+    accounts = gnc_tree_view_account_get_selected_accounts
+               (GNC_TREE_VIEW_ACCOUNT(ti_dialog->account_treeview));
 
-  for (node = accounts; node; node = node->next)
-  {
-    Account *account = node->data;
+    for (node = accounts; node; node = node->next)
+    {
+        Account *account = node->data;
 
-    xaccAccountBeginEdit (account);
+        xaccAccountBeginEdit (account);
 
-    xaccAccountSetTaxRelated (account, tax_related);
-    xaccAccountSetTaxUSPayerNameSource (account, pns);
-    xaccAccountSetTaxUSCopyNumber (account, copy_number);
-    /* USCode is last because it removes TaxUS KVP if not tax_related */
-    xaccAccountSetTaxUSCode (account, code);
+        xaccAccountSetTaxRelated (account, tax_related);
+        xaccAccountSetTaxUSPayerNameSource (account, pns);
+        xaccAccountSetTaxUSCopyNumber (account, copy_number);
+        /* USCode is last because it removes TaxUS KVP if not tax_related */
+        xaccAccountSetTaxUSCode (account, code);
 
-    xaccAccountCommitEdit (account);
-  }
+        xaccAccountCommitEdit (account);
+    }
 }
 
 static void
 identity_edit_destroy_cb (GtkObject *object, gpointer data)
 {
-  TaxInfoDialog *ti_dialog = data;
+    TaxInfoDialog *ti_dialog = data;
 
-  ti_dialog->entity_name_entry = NULL;
-  ti_dialog->entity_type_combo = NULL;
+    ti_dialog->entity_name_entry = NULL;
+    ti_dialog->entity_type_combo = NULL;
 
-  gtk_object_destroy (object);
+    gtk_object_destroy (object);
 }
 
 static void
 window_destroy_cb (GtkObject *object, gpointer data)
 {
-  TaxInfoDialog *ti_dialog = data;
+    TaxInfoDialog *ti_dialog = data;
 
-  gnc_unregister_gui_component_by_data (DIALOG_TAX_INFO_CM_CLASS, ti_dialog);
+    gnc_unregister_gui_component_by_data (DIALOG_TAX_INFO_CM_CLASS, ti_dialog);
 
-  destroy_tax_type_infos (ti_dialog->entity_type_infos);
-  ti_dialog->entity_type_infos = NULL;
+    destroy_tax_type_infos (ti_dialog->entity_type_infos);
+    ti_dialog->entity_type_infos = NULL;
 
-  destroy_txf_infos (ti_dialog->income_txf_infos);
-  ti_dialog->income_txf_infos = NULL;
+    destroy_txf_infos (ti_dialog->income_txf_infos);
+    ti_dialog->income_txf_infos = NULL;
 
-  destroy_txf_infos (ti_dialog->expense_txf_infos);
-  ti_dialog->expense_txf_infos = NULL;
+    destroy_txf_infos (ti_dialog->expense_txf_infos);
+    ti_dialog->expense_txf_infos = NULL;
 
-  destroy_txf_infos (ti_dialog->asset_txf_infos);
-  ti_dialog->asset_txf_infos = NULL;
+    destroy_txf_infos (ti_dialog->asset_txf_infos);
+    ti_dialog->asset_txf_infos = NULL;
 
-  destroy_txf_infos (ti_dialog->liab_eq_txf_infos);
-  ti_dialog->liab_eq_txf_infos = NULL;
+    destroy_txf_infos (ti_dialog->liab_eq_txf_infos);
+    ti_dialog->liab_eq_txf_infos = NULL;
 
-  g_free (ti_dialog);
+    g_free (ti_dialog);
 }
 
 static void
 cursor_changed_cb (GtkWidget *widget, gpointer data)
 {
-  TaxInfoDialog *ti_dialog = data;
-  GncTreeViewAccount *account_tree;
-  Account *account;
-  gint num_children;
+    TaxInfoDialog *ti_dialog = data;
+    GncTreeViewAccount *account_tree;
+    Account *account;
+    gint num_children;
 
-  account_tree = GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview);
-  account = gnc_tree_view_account_get_cursor_account (account_tree);
-  if (!account) {
-    gtk_widget_set_sensitive(ti_dialog->select_button, FALSE);
-    return;
-  }
+    account_tree = GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview);
+    account = gnc_tree_view_account_get_cursor_account (account_tree);
+    if (!account)
+    {
+        gtk_widget_set_sensitive(ti_dialog->select_button, FALSE);
+        return;
+    }
 
-  num_children = gnc_tree_view_account_count_children(account_tree, account);
-  gtk_widget_set_sensitive(ti_dialog->select_button, num_children > 0);
+    num_children = gnc_tree_view_account_count_children(account_tree, account);
+    gtk_widget_set_sensitive(ti_dialog->select_button, num_children > 0);
 }
 
 static void
 select_subaccounts_clicked (GtkWidget *widget, gpointer data)
 {
-  TaxInfoDialog *ti_dialog = data;
-  GncTreeViewAccount *account_tree;
-  Account *account;
+    TaxInfoDialog *ti_dialog = data;
+    GncTreeViewAccount *account_tree;
+    Account *account;
 
-  account_tree = GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview);
-  account = gnc_tree_view_account_get_cursor_account (account_tree);
-  if (!account)
-    return;
+    account_tree = GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview);
+    account = gnc_tree_view_account_get_cursor_account (account_tree);
+    if (!account)
+        return;
 
-  gnc_tree_view_account_select_subaccounts (account_tree, account);
+    gnc_tree_view_account_select_subaccounts (account_tree, account);
 
-  gtk_widget_grab_focus (ti_dialog->account_treeview);
+    gtk_widget_grab_focus (ti_dialog->account_treeview);
 }
 
 static void
 gnc_tax_info_dialog_response (GtkDialog *dialog, gint response, gpointer data)
 {
-  TaxInfoDialog *ti_dialog = data;
+    TaxInfoDialog *ti_dialog = data;
 
-  if (response == GTK_RESPONSE_OK && ti_dialog->changed)
-      gui_to_accounts (ti_dialog);
+    if (response == GTK_RESPONSE_OK && ti_dialog->changed)
+        gui_to_accounts (ti_dialog);
 
-  gnc_close_gui_component_by_data (DIALOG_TAX_INFO_CM_CLASS, ti_dialog);
+    gnc_close_gui_component_by_data (DIALOG_TAX_INFO_CM_CLASS, ti_dialog);
 }
 
 static void
 tax_info_show_acct_type_accounts (TaxInfoDialog *ti_dialog)
 {
-  GncTreeViewAccount *tree;
-  AccountViewInfo info;
-  GNCAccountType type;
+    GncTreeViewAccount *tree;
+    AccountViewInfo info;
+    GNCAccountType type;
 
-  tree = GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview);
+    tree = GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview);
 
-  gnc_tree_view_account_get_view_info (tree, &info);
+    gnc_tree_view_account_get_view_info (tree, &info);
 
-  for (type = 0; type < NUM_ACCOUNT_TYPES; type++) /* from Account.h */
-  {
-    if (ti_dialog->account_type == ACCT_TYPE_EXPENSE)
-       info.include_type[type] = (type == ACCT_TYPE_EXPENSE);
-    else if (ti_dialog->account_type == ACCT_TYPE_INCOME)
-       info.include_type[type] = (type == ACCT_TYPE_INCOME);
-    else if (ti_dialog->account_type == ACCT_TYPE_ASSET)
-       info.include_type[type] = ((type == ACCT_TYPE_BANK)      ||
-                                  (type == ACCT_TYPE_CASH)      ||
-                                  (type == ACCT_TYPE_ASSET)     ||
-                                  (type == ACCT_TYPE_STOCK)     ||
-                                  (type == ACCT_TYPE_MUTUAL)    ||
-                                  (type == ACCT_TYPE_RECEIVABLE));
-    else if (ti_dialog->account_type == ACCT_TYPE_LIABILITY)
-       info.include_type[type] = ((type == ACCT_TYPE_CREDIT)    ||
-                                  (type == ACCT_TYPE_LIABILITY) ||
-                                  (type == ACCT_TYPE_EQUITY)    ||
-                                  (type == ACCT_TYPE_PAYABLE));
-    else
-       info.include_type[type] = FALSE;
-  }
+    for (type = 0; type < NUM_ACCOUNT_TYPES; type++) /* from Account.h */
+    {
+        if (ti_dialog->account_type == ACCT_TYPE_EXPENSE)
+            info.include_type[type] = (type == ACCT_TYPE_EXPENSE);
+        else if (ti_dialog->account_type == ACCT_TYPE_INCOME)
+            info.include_type[type] = (type == ACCT_TYPE_INCOME);
+        else if (ti_dialog->account_type == ACCT_TYPE_ASSET)
+            info.include_type[type] = ((type == ACCT_TYPE_BANK)      ||
+                                       (type == ACCT_TYPE_CASH)      ||
+                                       (type == ACCT_TYPE_ASSET)     ||
+                                       (type == ACCT_TYPE_STOCK)     ||
+                                       (type == ACCT_TYPE_MUTUAL)    ||
+                                       (type == ACCT_TYPE_RECEIVABLE));
+        else if (ti_dialog->account_type == ACCT_TYPE_LIABILITY)
+            info.include_type[type] = ((type == ACCT_TYPE_CREDIT)    ||
+                                       (type == ACCT_TYPE_LIABILITY) ||
+                                       (type == ACCT_TYPE_EQUITY)    ||
+                                       (type == ACCT_TYPE_PAYABLE));
+        else
+            info.include_type[type] = FALSE;
+    }
 
-  gnc_tree_view_account_set_view_info (tree, &info);
+    gnc_tree_view_account_set_view_info (tree, &info);
 
-  load_category_list (ti_dialog);
-  cursor_changed_cb(GTK_WIDGET(tree), ti_dialog);
+    load_category_list (ti_dialog);
+    cursor_changed_cb(GTK_WIDGET(tree), ti_dialog);
 }
 
 static int
 gnc_tax_info_update_accounts (TaxInfoDialog *ti_dialog)
 {
-  GncTreeViewAccount *tree;
-  GtkTreeSelection* selection;
-  GtkWidget *label;
-  GtkWidget *vbox;
-  int num_accounts;
-  char *string;
+    GncTreeViewAccount *tree;
+    GtkTreeSelection* selection;
+    GtkWidget *label;
+    GtkWidget *vbox;
+    int num_accounts;
+    char *string;
 
-  tree = GNC_TREE_VIEW_ACCOUNT(ti_dialog->account_treeview);
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(tree));
-  num_accounts = gtk_tree_selection_count_selected_rows (selection);
+    tree = GNC_TREE_VIEW_ACCOUNT(ti_dialog->account_treeview);
+    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(tree));
+    num_accounts = gtk_tree_selection_count_selected_rows (selection);
 
-  label = gnc_glade_lookup_widget (ti_dialog->dialog, "num_accounts_label");
-  vbox = gnc_glade_lookup_widget (ti_dialog->dialog, "tax_info_vbox");
+    label = gnc_glade_lookup_widget (ti_dialog->dialog, "num_accounts_label");
+    vbox = gnc_glade_lookup_widget (ti_dialog->dialog, "tax_info_vbox");
 
-  string = g_strdup_printf ("%d", num_accounts);
-  gtk_label_set_text (GTK_LABEL (label), string);
-  g_free (string);
+    string = g_strdup_printf ("%d", num_accounts);
+    gtk_label_set_text (GTK_LABEL (label), string);
+    g_free (string);
 
-  gtk_widget_set_sensitive (vbox, num_accounts > 0);
+    gtk_widget_set_sensitive (vbox, num_accounts > 0);
 
-  return num_accounts;
+    return num_accounts;
 }
 
 static void
 gnc_tax_info_acct_type_cb (GtkWidget *w, gpointer data)
 {
-  TaxInfoDialog *ti_dialog = data;
-  const gchar *button_name;
+    TaxInfoDialog *ti_dialog = data;
+    const gchar *button_name;
 
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)))
-  {
-     button_name = gtk_widget_get_name (w);
-     if (safe_strcmp (button_name, "income_radio") == 0)
-        ti_dialog->account_type = ACCT_TYPE_INCOME;
-     else if (safe_strcmp (button_name, "expense_radio") == 0)
-        ti_dialog->account_type = ACCT_TYPE_EXPENSE;
-     else if (safe_strcmp (button_name, "asset_radio") == 0)
-        ti_dialog->account_type = ACCT_TYPE_ASSET;
-     else if (safe_strcmp (button_name, "liab_eq_radio") == 0)
-        ti_dialog->account_type = ACCT_TYPE_LIABILITY;
-     else
+    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)))
+    {
+        button_name = gtk_widget_get_name (w);
+        if (safe_strcmp (button_name, "income_radio") == 0)
+            ti_dialog->account_type = ACCT_TYPE_INCOME;
+        else if (safe_strcmp (button_name, "expense_radio") == 0)
+            ti_dialog->account_type = ACCT_TYPE_EXPENSE;
+        else if (safe_strcmp (button_name, "asset_radio") == 0)
+            ti_dialog->account_type = ACCT_TYPE_ASSET;
+        else if (safe_strcmp (button_name, "liab_eq_radio") == 0)
+            ti_dialog->account_type = ACCT_TYPE_LIABILITY;
+        else
+            return;
+        tax_info_show_acct_type_accounts (ti_dialog);
+        gnc_tree_view_account_refilter
+        (GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview));
+        gnc_tax_info_update_accounts (ti_dialog);
+        clear_gui (ti_dialog);
+    }
+    else
         return;
-     tax_info_show_acct_type_accounts (ti_dialog);
-     gnc_tree_view_account_refilter
-                          (GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview));
-     gnc_tax_info_update_accounts (ti_dialog);
-     clear_gui (ti_dialog);
-  }
-  else
-     return;
 }
 
 static void
 gnc_tax_info_account_changed_cb (GtkTreeSelection *selection,
-				 gpointer data)
+                                 gpointer data)
 {
-  TaxInfoDialog *ti_dialog = data;
-  GncTreeViewAccount *view;
-  GList *accounts;
-  int num_accounts;
+    TaxInfoDialog *ti_dialog = data;
+    GncTreeViewAccount *view;
+    GList *accounts;
+    int num_accounts;
 
-  g_return_if_fail(GTK_IS_TREE_SELECTION(selection));
+    g_return_if_fail(GTK_IS_TREE_SELECTION(selection));
 
-  num_accounts = gnc_tax_info_update_accounts (ti_dialog);
-  switch (num_accounts) {
-   case 0:
-    clear_gui (ti_dialog);
-    gnc_tax_info_set_changed (ti_dialog, FALSE);
-    return;
+    num_accounts = gnc_tax_info_update_accounts (ti_dialog);
+    switch (num_accounts)
+    {
+    case 0:
+        clear_gui (ti_dialog);
+        gnc_tax_info_set_changed (ti_dialog, FALSE);
+        return;
 
-   case 1:
-    /* Get the account. This view is set for multiple selection, so we
-       can only get a list of accounts. */
-    view = GNC_TREE_VIEW_ACCOUNT(ti_dialog->account_treeview);
-    accounts = gnc_tree_view_account_get_selected_accounts (view);
-    account_to_gui (ti_dialog, accounts->data);
-    g_list_free(accounts);
+    case 1:
+        /* Get the account. This view is set for multiple selection, so we
+           can only get a list of accounts. */
+        view = GNC_TREE_VIEW_ACCOUNT(ti_dialog->account_treeview);
+        accounts = gnc_tree_view_account_get_selected_accounts (view);
+        account_to_gui (ti_dialog, accounts->data);
+        g_list_free(accounts);
 
-    gnc_tax_info_set_changed (ti_dialog, FALSE);
-    break;
+        gnc_tax_info_set_changed (ti_dialog, FALSE);
+        break;
 
-   default:
-    gnc_tax_info_set_changed (ti_dialog, TRUE);
-    return;
-  }
+    default:
+        gnc_tax_info_set_changed (ti_dialog, TRUE);
+        return;
+    }
 }
 
 static void
 txf_code_select_row_cb (GtkTreeSelection *selection,
-			gpointer user_data)
+                        gpointer user_data)
 {
-  TaxInfoDialog *ti_dialog = user_data;
-  GtkTreeModel *model;
-  GtkTreePath *path;
-  GtkTreeIter iter;
-  gint *indices;
-  TXFInfo *txf_info;
-  GtkAdjustment *adj;
-  GtkWidget *scroll;
-  GtkWidget *vbox;
-  GtkTextBuffer *tb;
-  const char *text;
+    TaxInfoDialog *ti_dialog = user_data;
+    GtkTreeModel *model;
+    GtkTreePath *path;
+    GtkTreeIter iter;
+    gint *indices;
+    TXFInfo *txf_info;
+    GtkAdjustment *adj;
+    GtkWidget *scroll;
+    GtkWidget *vbox;
+    GtkTextBuffer *tb;
+    const char *text;
 
-  if (!gtk_tree_selection_get_selected(selection, &model, &iter))
-    return;
-  path = gtk_tree_model_get_path(model, &iter);
-  indices = gtk_tree_path_get_indices(path);
-  txf_info = g_list_nth_data (tax_infos (ti_dialog), indices[0]);
-  gtk_tree_path_free(path);
+    if (!gtk_tree_selection_get_selected(selection, &model, &iter))
+        return;
+    path = gtk_tree_model_get_path(model, &iter);
+    indices = gtk_tree_path_get_indices(path);
+    txf_info = g_list_nth_data (tax_infos (ti_dialog), indices[0]);
+    gtk_tree_path_free(path);
 
-  tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(ti_dialog->txf_help_text));
+    tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(ti_dialog->txf_help_text));
 
-  text = (txf_info && txf_info->help) ? txf_info->help : "";
-  gtk_text_buffer_set_text (tb, text, -1);
+    text = (txf_info && txf_info->help) ? txf_info->help : "";
+    gtk_text_buffer_set_text (tb, text, -1);
 
-  scroll = gnc_glade_lookup_widget (GTK_WIDGET (ti_dialog->dialog),
-				    "help_scroll");
+    scroll = gnc_glade_lookup_widget (GTK_WIDGET (ti_dialog->dialog),
+                                      "help_scroll");
 
-  adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scroll));
-  gtk_adjustment_set_value (adj, 0.0);
+    adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scroll));
+    gtk_adjustment_set_value (adj, 0.0);
 
-  vbox = gnc_glade_lookup_widget (GTK_WIDGET (ti_dialog->dialog),
-                                   "payer_name_source_vbox");
+    vbox = gnc_glade_lookup_widget (GTK_WIDGET (ti_dialog->dialog),
+                                    "payer_name_source_vbox");
 
-  if (txf_info && txf_info->payer_name_source)
-  {
-    gboolean current;
+    if (txf_info && txf_info->payer_name_source)
+    {
+        gboolean current;
 
-    gtk_widget_set_sensitive (vbox, TRUE);
+        gtk_widget_set_sensitive (vbox, TRUE);
 
-    current = (strcmp ("current", txf_info->payer_name_source) == 0);
+        current = (strcmp ("current", txf_info->payer_name_source) == 0);
 
-    if (current)
-      gtk_toggle_button_set_active
+        if (current)
+            gtk_toggle_button_set_active
+            (GTK_TOGGLE_BUTTON (ti_dialog->current_account_button), TRUE);
+        else
+            gtk_toggle_button_set_active
+            (GTK_TOGGLE_BUTTON (ti_dialog->parent_account_button), TRUE);
+    }
+    else
+    {
+        gtk_widget_set_sensitive (vbox, FALSE);
+        gtk_toggle_button_set_active
         (GTK_TOGGLE_BUTTON (ti_dialog->current_account_button), TRUE);
-    else
-      gtk_toggle_button_set_active
-        (GTK_TOGGLE_BUTTON (ti_dialog->parent_account_button), TRUE);
-  }
-  else
-  {
-    gtk_widget_set_sensitive (vbox, FALSE);
-    gtk_toggle_button_set_active
-      (GTK_TOGGLE_BUTTON (ti_dialog->current_account_button), TRUE);
-  }
+    }
 
-  vbox = gnc_glade_lookup_widget (GTK_WIDGET (ti_dialog->dialog),
-                                   "copy_number_vbox");
+    vbox = gnc_glade_lookup_widget (GTK_WIDGET (ti_dialog->dialog),
+                                    "copy_number_vbox");
 
-  if (txf_info && txf_info->copy)
-  {
-    gtk_widget_set_sensitive (vbox, TRUE);
-  }
-  else
-  {
-    gtk_widget_set_sensitive (vbox, FALSE);
-  }
+    if (txf_info && txf_info->copy)
+    {
+        gtk_widget_set_sensitive (vbox, TRUE);
+    }
+    else
+    {
+        gtk_widget_set_sensitive (vbox, FALSE);
+    }
 
-  gnc_tax_info_set_changed (ti_dialog, TRUE);
+    gnc_tax_info_set_changed (ti_dialog, TRUE);
 }
 
 static void
 set_focus_sensitivity (TaxInfoDialog *ti_dialog)
 {
-  if ((ti_dialog->tax_type == NULL) ||
-      (safe_strcmp (ti_dialog->tax_type, "Other") == 0) ||
-      (safe_strcmp (ti_dialog->tax_type, "") == 0))
-  {
-     gtk_widget_grab_focus (ti_dialog->tax_identity_edit_button);
-     gtk_widget_set_sensitive (ti_dialog->acct_info, FALSE);
-     gtk_widget_set_sensitive (ti_dialog->txf_info, FALSE);
-     gtk_widget_hide (ti_dialog->txf_help_text); /* doesn't go insensitive!? */
-  }
-  else if (ti_dialog->tax_type_changed)
-  {
-     gtk_widget_set_sensitive (ti_dialog->acct_info, TRUE);
-     gtk_widget_set_sensitive (ti_dialog->txf_info, TRUE);
-     gtk_widget_show (ti_dialog->txf_help_text);
-     gtk_widget_grab_focus (ti_dialog->account_treeview);
+    if ((ti_dialog->tax_type == NULL) ||
+            (safe_strcmp (ti_dialog->tax_type, "Other") == 0) ||
+            (safe_strcmp (ti_dialog->tax_type, "") == 0))
+    {
+        gtk_widget_grab_focus (ti_dialog->tax_identity_edit_button);
+        gtk_widget_set_sensitive (ti_dialog->acct_info, FALSE);
+        gtk_widget_set_sensitive (ti_dialog->txf_info, FALSE);
+        gtk_widget_hide (ti_dialog->txf_help_text); /* doesn't go insensitive!? */
+    }
+    else if (ti_dialog->tax_type_changed)
+    {
+        gtk_widget_set_sensitive (ti_dialog->acct_info, TRUE);
+        gtk_widget_set_sensitive (ti_dialog->txf_info, TRUE);
+        gtk_widget_show (ti_dialog->txf_help_text);
+        gtk_widget_grab_focus (ti_dialog->account_treeview);
 
-  }
-  else
-  {
-     gtk_widget_set_sensitive (ti_dialog->acct_info, TRUE);
-     gtk_widget_grab_focus (ti_dialog->account_treeview);
-  }
-  if (ti_dialog->asset_txf_infos == NULL)
-     gtk_widget_hide (ti_dialog->asset_radio);
-  else
-     gtk_widget_show (ti_dialog->asset_radio);
-  if (ti_dialog->liab_eq_txf_infos == NULL)
-     gtk_widget_hide (ti_dialog->liab_eq_radio);
-  else
-     gtk_widget_show (ti_dialog->liab_eq_radio);
+    }
+    else
+    {
+        gtk_widget_set_sensitive (ti_dialog->acct_info, TRUE);
+        gtk_widget_grab_focus (ti_dialog->account_treeview);
+    }
+    if (ti_dialog->asset_txf_infos == NULL)
+        gtk_widget_hide (ti_dialog->asset_radio);
+    else
+        gtk_widget_show (ti_dialog->asset_radio);
+    if (ti_dialog->liab_eq_txf_infos == NULL)
+        gtk_widget_hide (ti_dialog->liab_eq_radio);
+    else
+        gtk_widget_show (ti_dialog->liab_eq_radio);
 }
 
 static void
 identity_edit_response_cb (GtkDialog *dialog, gint response, gpointer data)
 {
-  TaxInfoDialog *ti_dialog = data;
-  const gchar *entry_name = NULL;
-  const gchar *entry_type = NULL;
-  gint active_item = 0;
-  TaxTypeInfo *selected_type = NULL;
+    TaxInfoDialog *ti_dialog = data;
+    const gchar *entry_name = NULL;
+    const gchar *entry_type = NULL;
+    gint active_item = 0;
+    TaxTypeInfo *selected_type = NULL;
 
-  if (response == GTK_RESPONSE_APPLY)
-  {
-     entry_name = gtk_entry_get_text (GTK_ENTRY (ti_dialog->entity_name_entry));
-     active_item = gtk_combo_box_get_active
-                              (GTK_COMBO_BOX (ti_dialog->entity_type_combo));
-     if (active_item != -1)  /* -1 if there's no active item */
-     {
-        selected_type = g_list_nth_data (ti_dialog->entity_type_infos,
-                                                       (guint) active_item);
-        if (selected_type)
+    if (response == GTK_RESPONSE_APPLY)
+    {
+        entry_name = gtk_entry_get_text (GTK_ENTRY (ti_dialog->entity_name_entry));
+        active_item = gtk_combo_box_get_active
+                      (GTK_COMBO_BOX (ti_dialog->entity_type_combo));
+        if (active_item != -1)  /* -1 if there's no active item */
         {
-           entry_type = selected_type->type_code;
-           if (!(safe_strcmp (ti_dialog->tax_type, entry_type) == 0))
-           {
-              ti_dialog->tax_type_changed = TRUE;
-              gnc_set_current_book_tax_type (entry_type);
-              ti_dialog->tax_type = g_strdup (entry_type);
-              if (entry_type != NULL)
-              {
-                 gtk_label_set_text (GTK_LABEL (ti_dialog->entity_type_display),
-                                                selected_type->combo_box_entry);
-              }
-              else
-              {
-                 gtk_label_set_text (GTK_LABEL (ti_dialog->entity_type_display),
-                                                   ti_dialog->default_tax_type);
-              }
-              ti_dialog->income_txf_infos = load_txf_info (INCOME, ti_dialog);
-              ti_dialog->expense_txf_infos = load_txf_info (EXPENSE, ti_dialog);
-              ti_dialog->asset_txf_infos = load_txf_info (ASSET, ti_dialog);
-              ti_dialog->liab_eq_txf_infos = load_txf_info (LIAB_EQ, ti_dialog);
-              gtk_toggle_button_set_active
-                            (GTK_TOGGLE_BUTTON(ti_dialog->expense_radio), TRUE);
-              tax_info_show_acct_type_accounts (ti_dialog);
-              gnc_tree_view_account_refilter
-                          (GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview));
-              gnc_tax_info_update_accounts (ti_dialog);
-              clear_gui (ti_dialog);
-           }           
+            selected_type = g_list_nth_data (ti_dialog->entity_type_infos,
+                                             (guint) active_item);
+            if (selected_type)
+            {
+                entry_type = selected_type->type_code;
+                if (!(safe_strcmp (ti_dialog->tax_type, entry_type) == 0))
+                {
+                    ti_dialog->tax_type_changed = TRUE;
+                    gnc_set_current_book_tax_type (entry_type);
+                    ti_dialog->tax_type = g_strdup (entry_type);
+                    if (entry_type != NULL)
+                    {
+                        gtk_label_set_text (GTK_LABEL (ti_dialog->entity_type_display),
+                                            selected_type->combo_box_entry);
+                    }
+                    else
+                    {
+                        gtk_label_set_text (GTK_LABEL (ti_dialog->entity_type_display),
+                                            ti_dialog->default_tax_type);
+                    }
+                    ti_dialog->income_txf_infos = load_txf_info (INCOME, ti_dialog);
+                    ti_dialog->expense_txf_infos = load_txf_info (EXPENSE, ti_dialog);
+                    ti_dialog->asset_txf_infos = load_txf_info (ASSET, ti_dialog);
+                    ti_dialog->liab_eq_txf_infos = load_txf_info (LIAB_EQ, ti_dialog);
+                    gtk_toggle_button_set_active
+                    (GTK_TOGGLE_BUTTON(ti_dialog->expense_radio), TRUE);
+                    tax_info_show_acct_type_accounts (ti_dialog);
+                    gnc_tree_view_account_refilter
+                    (GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview));
+                    gnc_tax_info_update_accounts (ti_dialog);
+                    clear_gui (ti_dialog);
+                }
+            }
         }
-     }
-     if (!(safe_strcmp (ti_dialog->tax_name, entry_name) == 0))
-     {
-        gnc_set_current_book_tax_name (entry_name);
-        ti_dialog->tax_name = g_strdup (entry_name);
-        gtk_label_set_text (GTK_LABEL (ti_dialog->entity_name_display),
-                                                                    entry_name);
-     }
-     set_focus_sensitivity (ti_dialog);
-     ti_dialog->tax_type_changed = FALSE;
-  }
-  identity_edit_destroy_cb (GTK_OBJECT (dialog), ti_dialog);
+        if (!(safe_strcmp (ti_dialog->tax_name, entry_name) == 0))
+        {
+            gnc_set_current_book_tax_name (entry_name);
+            ti_dialog->tax_name = g_strdup (entry_name);
+            gtk_label_set_text (GTK_LABEL (ti_dialog->entity_name_display),
+                                entry_name);
+        }
+        set_focus_sensitivity (ti_dialog);
+        ti_dialog->tax_type_changed = FALSE;
+    }
+    identity_edit_destroy_cb (GTK_OBJECT (dialog), ti_dialog);
 }
 
 static void
 identity_edit_clicked_cb (GtkButton *button,
-                        gpointer user_data)
+                          gpointer user_data)
 {
-  TaxInfoDialog *ti_dialog = user_data;
-  GtkWidget *dialog;
-/*  GtkWidget *content_area;  <- requires GTK 2.14 */
-  GtkWidget *name_entry;
-  GtkWidget *label;
-  GtkWidget *alignment;
-  GtkWidget *table;
-  GtkListStore *store;
-  GList *types = NULL;
-  GtkTreeIter iter;
-  gint current_item = -1;
-  gint item = 0;
-  GtkCellRenderer *renderer; 
-  GtkWidget *type_combo;
+    TaxInfoDialog *ti_dialog = user_data;
+    GtkWidget *dialog;
+    /*  GtkWidget *content_area;  <- requires GTK 2.14 */
+    GtkWidget *name_entry;
+    GtkWidget *label;
+    GtkWidget *alignment;
+    GtkWidget *table;
+    GtkListStore *store;
+    GList *types = NULL;
+    GtkTreeIter iter;
+    gint current_item = -1;
+    gint item = 0;
+    GtkCellRenderer *renderer;
+    GtkWidget *type_combo;
 
-  dialog = gtk_dialog_new_with_buttons (_("Income Tax Identity"),
-                                        (GtkWindow *)ti_dialog->dialog,
-                                        GTK_DIALOG_MODAL |
-                                                GTK_DIALOG_DESTROY_WITH_PARENT,
-                                        GTK_STOCK_CANCEL,
-                                        GTK_RESPONSE_CANCEL,
-                                        GTK_STOCK_APPLY,
-                                        GTK_RESPONSE_APPLY,
-                                        NULL);
-/*  content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); <- requires GTK 2.14 */
-  name_entry = gtk_entry_new();
-  ti_dialog->entity_name_entry = name_entry;
-  gtk_entry_set_text (GTK_ENTRY (name_entry), ti_dialog->tax_name);
-  label = gtk_label_new (_("Name"));
-  gtk_misc_set_alignment (GTK_MISC (label), 1.00, 0.50);
-  alignment = gtk_alignment_new(1.00, 0.50, 1.00, 0.00);
-  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);
-  gtk_container_add (GTK_CONTAINER (alignment), label);
-  table = gtk_table_new (3, 2, FALSE);
-  gtk_table_attach_defaults (GTK_TABLE (table), alignment, 0, 1, 0, 1);
-  alignment = gtk_alignment_new(0.00, 0.50, 1.00, 0.00);
-  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);
-  gtk_container_add (GTK_CONTAINER (alignment), name_entry);
-  gtk_table_attach_defaults (GTK_TABLE (table), alignment, 1, 2, 0, 1);
-  store = gtk_list_store_new (1, G_TYPE_STRING);
-  gtk_list_store_clear(store);
-  types = ti_dialog->entity_type_infos;
-  for ( ; types; types = types->next)
-  {
-    TaxTypeInfo *tax_type_info = types->data;
+    dialog = gtk_dialog_new_with_buttons (_("Income Tax Identity"),
+                                          (GtkWindow *)ti_dialog->dialog,
+                                          GTK_DIALOG_MODAL |
+                                          GTK_DIALOG_DESTROY_WITH_PARENT,
+                                          GTK_STOCK_CANCEL,
+                                          GTK_RESPONSE_CANCEL,
+                                          GTK_STOCK_APPLY,
+                                          GTK_RESPONSE_APPLY,
+                                          NULL);
+    /*  content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); <- requires GTK 2.14 */
+    name_entry = gtk_entry_new();
+    ti_dialog->entity_name_entry = name_entry;
+    gtk_entry_set_text (GTK_ENTRY (name_entry), ti_dialog->tax_name);
+    label = gtk_label_new (_("Name"));
+    gtk_misc_set_alignment (GTK_MISC (label), 1.00, 0.50);
+    alignment = gtk_alignment_new(1.00, 0.50, 1.00, 0.00);
+    gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);
+    gtk_container_add (GTK_CONTAINER (alignment), label);
+    table = gtk_table_new (3, 2, FALSE);
+    gtk_table_attach_defaults (GTK_TABLE (table), alignment, 0, 1, 0, 1);
+    alignment = gtk_alignment_new(0.00, 0.50, 1.00, 0.00);
+    gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);
+    gtk_container_add (GTK_CONTAINER (alignment), name_entry);
+    gtk_table_attach_defaults (GTK_TABLE (table), alignment, 1, 2, 0, 1);
+    store = gtk_list_store_new (1, G_TYPE_STRING);
+    gtk_list_store_clear(store);
+    types = ti_dialog->entity_type_infos;
+    for ( ; types; types = types->next)
+    {
+        TaxTypeInfo *tax_type_info = types->data;
 
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter, 0, tax_type_info->combo_box_entry, -1);
-    if (safe_strcmp (ti_dialog->tax_type, tax_type_info->type_code) == 0)
-        current_item = item;
-    item++;
-  }
-  type_combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL(store));
-  g_object_unref(G_OBJECT (store));
-  renderer = gtk_cell_renderer_text_new();
-  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(type_combo), renderer, TRUE);
-  gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(type_combo), renderer,
-    "text", 0, NULL);
-  ti_dialog->entity_type_combo = type_combo;
-  if (ti_dialog->tax_type) {
-     gtk_combo_box_set_active (GTK_COMBO_BOX (type_combo), current_item);
-  }
-  else {   /* set to no active item */
-     gtk_combo_box_set_active (GTK_COMBO_BOX (type_combo), -1);
-  }
-  label = gtk_label_new (_("Type"));
-  gtk_misc_set_alignment (GTK_MISC (label), 1.00, 0.50);
-  alignment = gtk_alignment_new(1.00, 0.50, 1.00, 0.00);
-  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);
-  gtk_container_add (GTK_CONTAINER (alignment), label);
-  gtk_table_attach_defaults (GTK_TABLE (table), alignment, 0, 1, 1, 2);
-  alignment = gtk_alignment_new(0.00, 0.50, 1.00, 0.00);
-  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);
-  gtk_container_add (GTK_CONTAINER (alignment), type_combo);
-  gtk_table_attach_defaults (GTK_TABLE (table), alignment, 1, 2, 1, 2);
-  label = gtk_label_new (_("CAUTION: If you set TXF categories, and later change 'Type', you will need to manually reset those categories one at a time"));
-  gtk_misc_set_alignment (GTK_MISC (label), 0.50, 0.50);
-  alignment = gtk_alignment_new(0.50, 0.50, 1.00, 0.00);
-  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 6, 4, 4);
-  gtk_container_add (GTK_CONTAINER (alignment), label);
-  gtk_table_attach_defaults (GTK_TABLE (table), alignment, 0, 2, 2, 3);
-/*  gtk_container_add (GTK_CONTAINER (content_area), table);  <- requires GTK 2.14 */
-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), table);
-  gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY);
-  g_signal_connect (G_OBJECT (dialog), "response",
-                          G_CALLBACK (identity_edit_response_cb), ti_dialog);
-  g_signal_connect (G_OBJECT (dialog), "destroy",
-                          G_CALLBACK (identity_edit_destroy_cb), ti_dialog);
-  gtk_widget_show_all (dialog);
+        gtk_list_store_append(store, &iter);
+        gtk_list_store_set(store, &iter, 0, tax_type_info->combo_box_entry, -1);
+        if (safe_strcmp (ti_dialog->tax_type, tax_type_info->type_code) == 0)
+            current_item = item;
+        item++;
+    }
+    type_combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL(store));
+    g_object_unref(G_OBJECT (store));
+    renderer = gtk_cell_renderer_text_new();
+    gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(type_combo), renderer, TRUE);
+    gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(type_combo), renderer,
+                                   "text", 0, NULL);
+    ti_dialog->entity_type_combo = type_combo;
+    if (ti_dialog->tax_type)
+    {
+        gtk_combo_box_set_active (GTK_COMBO_BOX (type_combo), current_item);
+    }
+    else     /* set to no active item */
+    {
+        gtk_combo_box_set_active (GTK_COMBO_BOX (type_combo), -1);
+    }
+    label = gtk_label_new (_("Type"));
+    gtk_misc_set_alignment (GTK_MISC (label), 1.00, 0.50);
+    alignment = gtk_alignment_new(1.00, 0.50, 1.00, 0.00);
+    gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);
+    gtk_container_add (GTK_CONTAINER (alignment), label);
+    gtk_table_attach_defaults (GTK_TABLE (table), alignment, 0, 1, 1, 2);
+    alignment = gtk_alignment_new(0.00, 0.50, 1.00, 0.00);
+    gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0);
+    gtk_container_add (GTK_CONTAINER (alignment), type_combo);
+    gtk_table_attach_defaults (GTK_TABLE (table), alignment, 1, 2, 1, 2);
+    label = gtk_label_new (_("CAUTION: If you set TXF categories, and later change 'Type', you will need to manually reset those categories one at a time"));
+    gtk_misc_set_alignment (GTK_MISC (label), 0.50, 0.50);
+    alignment = gtk_alignment_new(0.50, 0.50, 1.00, 0.00);
+    gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 6, 4, 4);
+    gtk_container_add (GTK_CONTAINER (alignment), label);
+    gtk_table_attach_defaults (GTK_TABLE (table), alignment, 0, 2, 2, 3);
+    /*  gtk_container_add (GTK_CONTAINER (content_area), table);  <- requires GTK 2.14 */
+    gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), table);
+    gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY);
+    g_signal_connect (G_OBJECT (dialog), "response",
+                      G_CALLBACK (identity_edit_response_cb), ti_dialog);
+    g_signal_connect (G_OBJECT (dialog), "destroy",
+                      G_CALLBACK (identity_edit_destroy_cb), ti_dialog);
+    gtk_widget_show_all (dialog);
 }
 
 static void
 tax_related_toggled_cb (GtkToggleButton *togglebutton,
                         gpointer user_data)
 {
-  TaxInfoDialog *ti_dialog = user_data;
-  GtkWidget *vbox;
-  GtkWidget *hbox;
-  gboolean on;
+    TaxInfoDialog *ti_dialog = user_data;
+    GtkWidget *vbox;
+    GtkWidget *hbox;
+    gboolean on;
 
-  on = gtk_toggle_button_get_active (togglebutton);
+    on = gtk_toggle_button_get_active (togglebutton);
 
-  vbox = gnc_glade_lookup_widget (GTK_WIDGET (togglebutton),
-                                   "txf_categories_vbox");
-  hbox = gnc_glade_lookup_widget (GTK_WIDGET (togglebutton),
-                                   "pns_copy_hbox");
-  gtk_widget_set_sensitive (vbox, on);
+    vbox = gnc_glade_lookup_widget (GTK_WIDGET (togglebutton),
+                                    "txf_categories_vbox");
+    hbox = gnc_glade_lookup_widget (GTK_WIDGET (togglebutton),
+                                    "pns_copy_hbox");
+    gtk_widget_set_sensitive (vbox, on);
 
-  gtk_widget_set_sensitive (hbox, on);
+    gtk_widget_set_sensitive (hbox, on);
 
-  gnc_tax_info_set_changed (ti_dialog, TRUE);
+    gnc_tax_info_set_changed (ti_dialog, TRUE);
 }
 
 static void
 current_account_toggled_cb (GtkToggleButton *togglebutton,
                             gpointer user_data)
 {
-  TaxInfoDialog *ti_dialog = user_data;
+    TaxInfoDialog *ti_dialog = user_data;
 
-  gnc_tax_info_set_changed (ti_dialog, TRUE);
+    gnc_tax_info_set_changed (ti_dialog, TRUE);
 }
 
 static void
 copy_number_value_changed_cb (GtkSpinButton *spinbutton,
-                            gpointer user_data)
+                              gpointer user_data)
 {
-  TaxInfoDialog *ti_dialog = user_data;
+    TaxInfoDialog *ti_dialog = user_data;
 
-  gnc_tax_info_set_changed (ti_dialog, TRUE);
+    gnc_tax_info_set_changed (ti_dialog, TRUE);
 }
 
 static void
 gnc_tax_info_dialog_create (GtkWidget * parent, TaxInfoDialog *ti_dialog)
 {
-  GtkWidget *dialog;
-  GtkObject *tido;
-  GladeXML  *xml;
-  GtkTreeView *tree_view;
-  GtkTreeSelection *selection;
-  GtkWidget *label;
+    GtkWidget *dialog;
+    GtkObject *tido;
+    GladeXML  *xml;
+    GtkTreeView *tree_view;
+    GtkTreeSelection *selection;
+    GtkWidget *label;
 
-  xml = gnc_glade_xml_new ("tax.glade", "Tax Information Dialog");
+    xml = gnc_glade_xml_new ("tax.glade", "Tax Information Dialog");
 
-  dialog = glade_xml_get_widget (xml, "Tax Information Dialog");
-  ti_dialog->dialog = dialog;
-  tido = GTK_OBJECT (dialog);
+    dialog = glade_xml_get_widget (xml, "Tax Information Dialog");
+    ti_dialog->dialog = dialog;
+    tido = GTK_OBJECT (dialog);
 
-  initialize_getters ();
+    initialize_getters ();
 
-  g_signal_connect (G_OBJECT (dialog), "response",
-                    G_CALLBACK (gnc_tax_info_dialog_response), ti_dialog);
+    g_signal_connect (G_OBJECT (dialog), "response",
+                      G_CALLBACK (gnc_tax_info_dialog_response), ti_dialog);
 
-  g_signal_connect (G_OBJECT (dialog), "destroy",
-                    G_CALLBACK (window_destroy_cb), ti_dialog);
+    g_signal_connect (G_OBJECT (dialog), "destroy",
+                      G_CALLBACK (window_destroy_cb), ti_dialog);
 
-  /* parent */
-  if (parent != NULL)
-    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+    /* parent */
+    if (parent != NULL)
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
 
-  /* default to ok */
-  gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+    /* default to ok */
+    gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK);
 
-  /* tax identity */
-  {
-    GtkWidget *label;
-    GtkWidget *edit_button;
+    /* tax identity */
+    {
+        GtkWidget *label;
+        GtkWidget *edit_button;
 
-    ti_dialog->this_book = gnc_get_current_book();
-    ti_dialog->tax_name = gnc_get_current_book_tax_name();
-    ti_dialog->tax_type = gnc_get_current_book_tax_type();
+        ti_dialog->this_book = gnc_get_current_book();
+        ti_dialog->tax_name = gnc_get_current_book_tax_name();
+        ti_dialog->tax_type = gnc_get_current_book_tax_type();
 
-    label = glade_xml_get_widget (xml, "entity_name");
-    ti_dialog->entity_name_display = label;
-    gtk_label_set_text (GTK_LABEL (label), ti_dialog->tax_name);
-    ti_dialog->entity_name_entry = NULL;
+        label = glade_xml_get_widget (xml, "entity_name");
+        ti_dialog->entity_name_display = label;
+        gtk_label_set_text (GTK_LABEL (label), ti_dialog->tax_name);
+        ti_dialog->entity_name_entry = NULL;
 
-    load_tax_entity_type_list (ti_dialog); /* initialize tax_type_combo_text */
+        load_tax_entity_type_list (ti_dialog); /* initialize tax_type_combo_text */
 
-    label = glade_xml_get_widget (xml, "entity_type");
-    ti_dialog->entity_type_display = label;
-    if (ti_dialog->tax_type != NULL)
-       gtk_label_set_text (GTK_LABEL (label), ti_dialog->tax_type_combo_text);
-    ti_dialog->entity_type_combo = NULL;
+        label = glade_xml_get_widget (xml, "entity_type");
+        ti_dialog->entity_type_display = label;
+        if (ti_dialog->tax_type != NULL)
+            gtk_label_set_text (GTK_LABEL (label), ti_dialog->tax_type_combo_text);
+        ti_dialog->entity_type_combo = NULL;
 
-    edit_button = glade_xml_get_widget (xml, "identity_edit_button");
-    ti_dialog->tax_identity_edit_button = edit_button;
-    g_signal_connect (G_OBJECT (edit_button), "clicked",
-                        G_CALLBACK (identity_edit_clicked_cb), ti_dialog);
-    ti_dialog->tax_type_changed = FALSE;
-  }
+        edit_button = glade_xml_get_widget (xml, "identity_edit_button");
+        ti_dialog->tax_identity_edit_button = edit_button;
+        g_signal_connect (G_OBJECT (edit_button), "clicked",
+                          G_CALLBACK (identity_edit_clicked_cb), ti_dialog);
+        ti_dialog->tax_type_changed = FALSE;
+    }
 
-  ti_dialog->income_txf_infos = load_txf_info (INCOME, ti_dialog);
-  ti_dialog->expense_txf_infos = load_txf_info (EXPENSE, ti_dialog);
-  ti_dialog->asset_txf_infos = load_txf_info (ASSET, ti_dialog);
-  ti_dialog->liab_eq_txf_infos = load_txf_info (LIAB_EQ, ti_dialog);
+    ti_dialog->income_txf_infos = load_txf_info (INCOME, ti_dialog);
+    ti_dialog->expense_txf_infos = load_txf_info (EXPENSE, ti_dialog);
+    ti_dialog->asset_txf_infos = load_txf_info (ASSET, ti_dialog);
+    ti_dialog->liab_eq_txf_infos = load_txf_info (LIAB_EQ, ti_dialog);
 
-  /* tax information */
-  {
-    GtkListStore *store;
-    GtkTreeViewColumn *column;
-    GtkCellRenderer *renderer; 
-    GtkWidget *button;
-    GtkWidget *text;
+    /* tax information */
+    {
+        GtkListStore *store;
+        GtkTreeViewColumn *column;
+        GtkCellRenderer *renderer;
+        GtkWidget *button;
+        GtkWidget *text;
 
-    ti_dialog->txf_info = glade_xml_get_widget (xml, "tax_info_vbox");
-    button = glade_xml_get_widget (xml, "tax_related_button");
-    ti_dialog->tax_related_button = button;
+        ti_dialog->txf_info = glade_xml_get_widget (xml, "tax_info_vbox");
+        button = glade_xml_get_widget (xml, "tax_related_button");
+        ti_dialog->tax_related_button = button;
 
-    g_signal_connect (G_OBJECT (button), "toggled",
-                      G_CALLBACK  (tax_related_toggled_cb), ti_dialog);
+        g_signal_connect (G_OBJECT (button), "toggled",
+                          G_CALLBACK  (tax_related_toggled_cb), ti_dialog);
 
-    text = glade_xml_get_widget (xml, "txf_help_text");
-    gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
-    ti_dialog->txf_help_text = text;
+        text = glade_xml_get_widget (xml, "txf_help_text");
+        gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+        ti_dialog->txf_help_text = text;
 
-    tree_view = GTK_TREE_VIEW(glade_xml_get_widget(xml, "txf_category_view"));
-    store =  gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
-    gtk_tree_view_set_model(tree_view, GTK_TREE_MODEL(store));
-    g_object_unref(store);
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes
-      (_("Form"), renderer, "text", 0, NULL);
-    gtk_tree_view_append_column(tree_view, GTK_TREE_VIEW_COLUMN(column));
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes
-      (_("Description"), renderer, "text", 1, NULL);
-    gtk_tree_view_append_column(tree_view, GTK_TREE_VIEW_COLUMN(column));
-    ti_dialog->txf_category_view = GTK_WIDGET(tree_view);
+        tree_view = GTK_TREE_VIEW(glade_xml_get_widget(xml, "txf_category_view"));
+        store =  gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
+        gtk_tree_view_set_model(tree_view, GTK_TREE_MODEL(store));
+        g_object_unref(store);
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes
+                 (_("Form"), renderer, "text", 0, NULL);
+        gtk_tree_view_append_column(tree_view, GTK_TREE_VIEW_COLUMN(column));
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes
+                 (_("Description"), renderer, "text", 1, NULL);
+        gtk_tree_view_append_column(tree_view, GTK_TREE_VIEW_COLUMN(column));
+        ti_dialog->txf_category_view = GTK_WIDGET(tree_view);
 
-    selection = gtk_tree_view_get_selection(tree_view);
-    g_signal_connect (G_OBJECT (selection), "changed",
-                      G_CALLBACK  (txf_code_select_row_cb), ti_dialog);
+        selection = gtk_tree_view_get_selection(tree_view);
+        g_signal_connect (G_OBJECT (selection), "changed",
+                          G_CALLBACK  (txf_code_select_row_cb), ti_dialog);
 
-    label = glade_xml_get_widget(xml, "txf_category_label");
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(tree_view));
+        label = glade_xml_get_widget(xml, "txf_category_label");
+        gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(tree_view));
 
-    button = glade_xml_get_widget (xml, "current_account_button");
-    ti_dialog->current_account_button = button;
+        button = glade_xml_get_widget (xml, "current_account_button");
+        ti_dialog->current_account_button = button;
 
-    button = glade_xml_get_widget (xml, "parent_account_button");
-    ti_dialog->parent_account_button = button;
+        button = glade_xml_get_widget (xml, "parent_account_button");
+        ti_dialog->parent_account_button = button;
 
-    g_signal_connect (G_OBJECT (button), "toggled",
-                      G_CALLBACK  (current_account_toggled_cb),
-                        ti_dialog);
+        g_signal_connect (G_OBJECT (button), "toggled",
+                          G_CALLBACK  (current_account_toggled_cb),
+                          ti_dialog);
 
-    button = glade_xml_get_widget (xml, "copy_spin_button");
-    ti_dialog->copy_spin_button = button;
+        button = glade_xml_get_widget (xml, "copy_spin_button");
+        ti_dialog->copy_spin_button = button;
 
-    g_signal_connect (G_OBJECT (button), "value-changed",
-                      G_CALLBACK  (copy_number_value_changed_cb),
-                        ti_dialog);
-  }
+        g_signal_connect (G_OBJECT (button), "value-changed",
+                          G_CALLBACK  (copy_number_value_changed_cb),
+                          ti_dialog);
+    }
 
-  /* account tree */
-  {
-    GtkWidget *income_radio, *expense_radio, *asset_radio, *liab_eq_radio, *box;
+    /* account tree */
+    {
+        GtkWidget *income_radio, *expense_radio, *asset_radio, *liab_eq_radio, *box;
 
-    ti_dialog->acct_info = glade_xml_get_widget (xml, "acct_info_vbox");
-    box = glade_xml_get_widget (xml, "account_scroll");
-    tree_view = gnc_tree_view_account_new (FALSE);
-    gnc_tree_view_account_set_filter (GNC_TREE_VIEW_ACCOUNT(tree_view), 
-				      gnc_tax_info_dialog_account_filter_func,
-				      ti_dialog, NULL);
-    ti_dialog->account_treeview = GTK_WIDGET(tree_view);
+        ti_dialog->acct_info = glade_xml_get_widget (xml, "acct_info_vbox");
+        box = glade_xml_get_widget (xml, "account_scroll");
+        tree_view = gnc_tree_view_account_new (FALSE);
+        gnc_tree_view_account_set_filter (GNC_TREE_VIEW_ACCOUNT(tree_view),
+                                          gnc_tax_info_dialog_account_filter_func,
+                                          ti_dialog, NULL);
+        ti_dialog->account_treeview = GTK_WIDGET(tree_view);
 
-    selection = gtk_tree_view_get_selection (tree_view);
-    gtk_tree_selection_set_mode (selection, GTK_SELECTION_EXTENDED);
-    g_signal_connect (G_OBJECT (selection), "changed",
-                      G_CALLBACK (gnc_tax_info_account_changed_cb),
-                      ti_dialog);
+        selection = gtk_tree_view_get_selection (tree_view);
+        gtk_tree_selection_set_mode (selection, GTK_SELECTION_EXTENDED);
+        g_signal_connect (G_OBJECT (selection), "changed",
+                          G_CALLBACK (gnc_tax_info_account_changed_cb),
+                          ti_dialog);
 
-    gtk_widget_show (ti_dialog->account_treeview);
-    gtk_container_add (GTK_CONTAINER (box), ti_dialog->account_treeview);
+        gtk_widget_show (ti_dialog->account_treeview);
+        gtk_container_add (GTK_CONTAINER (box), ti_dialog->account_treeview);
 
-    label = glade_xml_get_widget(xml, "accounts_label");
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(tree_view));
+        label = glade_xml_get_widget(xml, "accounts_label");
+        gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(tree_view));
 
-    income_radio = glade_xml_get_widget (xml, "income_radio");
-    expense_radio = glade_xml_get_widget (xml, "expense_radio");
-    ti_dialog->expense_radio = expense_radio;
-    asset_radio = glade_xml_get_widget (xml, "asset_radio");
-    ti_dialog->asset_radio = asset_radio;
-    liab_eq_radio = glade_xml_get_widget (xml, "liab_eq_radio");
-    ti_dialog->liab_eq_radio = liab_eq_radio;
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(expense_radio), TRUE);
-    ti_dialog->account_type = ACCT_TYPE_EXPENSE;
-    g_signal_connect (G_OBJECT (income_radio), "toggled",
-                      G_CALLBACK  (gnc_tax_info_acct_type_cb),
-                        ti_dialog);
-    g_signal_connect (G_OBJECT (expense_radio), "toggled",
-                      G_CALLBACK  (gnc_tax_info_acct_type_cb),
-                        ti_dialog);
-    g_signal_connect (G_OBJECT (asset_radio), "toggled",
-                      G_CALLBACK  (gnc_tax_info_acct_type_cb),
-                        ti_dialog);
-    g_signal_connect (G_OBJECT (liab_eq_radio), "toggled",
-                      G_CALLBACK  (gnc_tax_info_acct_type_cb),
-                        ti_dialog);
-  }
+        income_radio = glade_xml_get_widget (xml, "income_radio");
+        expense_radio = glade_xml_get_widget (xml, "expense_radio");
+        ti_dialog->expense_radio = expense_radio;
+        asset_radio = glade_xml_get_widget (xml, "asset_radio");
+        ti_dialog->asset_radio = asset_radio;
+        liab_eq_radio = glade_xml_get_widget (xml, "liab_eq_radio");
+        ti_dialog->liab_eq_radio = liab_eq_radio;
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(expense_radio), TRUE);
+        ti_dialog->account_type = ACCT_TYPE_EXPENSE;
+        g_signal_connect (G_OBJECT (income_radio), "toggled",
+                          G_CALLBACK  (gnc_tax_info_acct_type_cb),
+                          ti_dialog);
+        g_signal_connect (G_OBJECT (expense_radio), "toggled",
+                          G_CALLBACK  (gnc_tax_info_acct_type_cb),
+                          ti_dialog);
+        g_signal_connect (G_OBJECT (asset_radio), "toggled",
+                          G_CALLBACK  (gnc_tax_info_acct_type_cb),
+                          ti_dialog);
+        g_signal_connect (G_OBJECT (liab_eq_radio), "toggled",
+                          G_CALLBACK  (gnc_tax_info_acct_type_cb),
+                          ti_dialog);
+    }
 
-  /* select subaccounts button */
-  {
-    GtkWidget *button;
+    /* select subaccounts button */
+    {
+        GtkWidget *button;
 
-    button = glade_xml_get_widget (xml, "select_subaccounts_button");
-    ti_dialog->select_button = button;
+        button = glade_xml_get_widget (xml, "select_subaccounts_button");
+        ti_dialog->select_button = button;
 
-    g_signal_connect (G_OBJECT (button), "clicked",
-                      G_CALLBACK  (select_subaccounts_clicked),
-		      ti_dialog);
-    g_signal_connect (G_OBJECT (ti_dialog->account_treeview), "cursor_changed",
-                      G_CALLBACK  (cursor_changed_cb),
-		      ti_dialog);
-  }
+        g_signal_connect (G_OBJECT (button), "clicked",
+                          G_CALLBACK  (select_subaccounts_clicked),
+                          ti_dialog);
+        g_signal_connect (G_OBJECT (ti_dialog->account_treeview), "cursor_changed",
+                          G_CALLBACK  (cursor_changed_cb),
+                          ti_dialog);
+    }
 
-  tax_info_show_acct_type_accounts (ti_dialog);
-  gnc_tax_info_update_accounts (ti_dialog);
-  clear_gui (ti_dialog);
-  gnc_tax_info_set_changed (ti_dialog, FALSE);
+    tax_info_show_acct_type_accounts (ti_dialog);
+    gnc_tax_info_update_accounts (ti_dialog);
+    clear_gui (ti_dialog);
+    gnc_tax_info_set_changed (ti_dialog, FALSE);
 
-  gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(ti_dialog->dialog));
+    gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(ti_dialog->dialog));
 
-  if (gnc_gconf_get_bool(GCONF_GENERAL, KEY_SAVE_GEOMETRY, NULL)) {
-    GtkWidget *paned = glade_xml_get_widget(xml, "paned");
-    gint position = gnc_gconf_get_int(GCONF_SECTION, PANED_POSITION, NULL);
-    gtk_paned_set_position(GTK_PANED(paned), position);
-  }
+    if (gnc_gconf_get_bool(GCONF_GENERAL, KEY_SAVE_GEOMETRY, NULL))
+    {
+        GtkWidget *paned = glade_xml_get_widget(xml, "paned");
+        gint position = gnc_gconf_get_int(GCONF_SECTION, PANED_POSITION, NULL);
+        gtk_paned_set_position(GTK_PANED(paned), position);
+    }
 }
 
 static void
 close_handler (gpointer user_data)
 {
-  TaxInfoDialog *ti_dialog = user_data;
+    TaxInfoDialog *ti_dialog = user_data;
 
-  if (gnc_gconf_get_bool(GCONF_GENERAL, KEY_SAVE_GEOMETRY, NULL)) {
-    GtkWidget *paned = gnc_glade_lookup_widget(ti_dialog->dialog, "paned");
-    gnc_gconf_set_int(GCONF_SECTION, PANED_POSITION,
-                      gtk_paned_get_position(GTK_PANED(paned)), NULL);
-  }
+    if (gnc_gconf_get_bool(GCONF_GENERAL, KEY_SAVE_GEOMETRY, NULL))
+    {
+        GtkWidget *paned = gnc_glade_lookup_widget(ti_dialog->dialog, "paned");
+        gnc_gconf_set_int(GCONF_SECTION, PANED_POSITION,
+                          gtk_paned_get_position(GTK_PANED(paned)), NULL);
+    }
 
-  gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(ti_dialog->dialog));
-  gtk_widget_destroy (ti_dialog->dialog);
+    gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(ti_dialog->dialog));
+    gtk_widget_destroy (ti_dialog->dialog);
 }
 
 static void
 refresh_handler (GHashTable *changes, gpointer user_data)
 {
-  TaxInfoDialog *ti_dialog = user_data;
+    TaxInfoDialog *ti_dialog = user_data;
 
-  gnc_tax_info_update_accounts (ti_dialog);
+    gnc_tax_info_update_accounts (ti_dialog);
 }
 
 /********************************************************************\
  * gnc_tax_info_dialog                                              *
  *   opens up a window to set account tax information               *
- *                                                                  * 
+ *                                                                  *
  * Args:   parent  - the parent of the window to be created         *
  * Return: nothing                                                  *
 \********************************************************************/
 void
 gnc_tax_info_dialog (GtkWidget * parent)
 {
-  TaxInfoDialog *ti_dialog;
-  gint component_id;
+    TaxInfoDialog *ti_dialog;
+    gint component_id;
 
-  ti_dialog = g_new0 (TaxInfoDialog, 1);
+    ti_dialog = g_new0 (TaxInfoDialog, 1);
 
-  gnc_tax_info_dialog_create (parent, ti_dialog);
+    gnc_tax_info_dialog_create (parent, ti_dialog);
 
-  component_id = gnc_register_gui_component (DIALOG_TAX_INFO_CM_CLASS,
-                                             refresh_handler, close_handler,
-                                             ti_dialog);
-  gnc_gui_component_set_session (component_id, gnc_get_current_session ());
+    component_id = gnc_register_gui_component (DIALOG_TAX_INFO_CM_CLASS,
+                   refresh_handler, close_handler,
+                   ti_dialog);
+    gnc_gui_component_set_session (component_id, gnc_get_current_session ());
 
-  gnc_gui_component_watch_entity_type (component_id,
-                                       GNC_ID_ACCOUNT,
-                                       QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
+    gnc_gui_component_watch_entity_type (component_id,
+                                         GNC_ID_ACCOUNT,
+                                         QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
 
-  set_focus_sensitivity (ti_dialog);
+    set_focus_sensitivity (ti_dialog);
 
-  gtk_widget_show (ti_dialog->dialog);
+    gtk_widget_show (ti_dialog->dialog);
 }

Modified: gnucash/trunk/src/gnome/dialog-userpass.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-userpass.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/dialog-userpass.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -37,52 +37,52 @@
                            char **username,
                            char **password)
 {
-  GtkWidget *dialog;
-  GtkWidget *heading_label;
-  GtkWidget *username_entry;
-  GtkWidget *password_entry;
-  GladeXML *xml;
-  gint result;
+    GtkWidget *dialog;
+    GtkWidget *heading_label;
+    GtkWidget *username_entry;
+    GtkWidget *password_entry;
+    GladeXML *xml;
+    gint result;
 
-  g_return_val_if_fail (username != NULL, FALSE);
-  g_return_val_if_fail (password != NULL, FALSE);
+    g_return_val_if_fail (username != NULL, FALSE);
+    g_return_val_if_fail (password != NULL, FALSE);
 
-  xml = gnc_glade_xml_new ("userpass.glade", "Username Password Dialog");
+    xml = gnc_glade_xml_new ("userpass.glade", "Username Password Dialog");
 
-  dialog = glade_xml_get_widget (xml, "Username Password Dialog");
+    dialog = glade_xml_get_widget (xml, "Username 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");
-  username_entry = glade_xml_get_widget (xml, "username_entry");
-  password_entry = glade_xml_get_widget (xml, "password_entry");
+    heading_label  = glade_xml_get_widget (xml, "heading_label");
+    username_entry = glade_xml_get_widget (xml, "username_entry");
+    password_entry = glade_xml_get_widget (xml, "password_entry");
 
-  if (heading)
-    gtk_label_set_text (GTK_LABEL (heading_label), heading);
+    if (heading)
+        gtk_label_set_text (GTK_LABEL (heading_label), heading);
 
-  if (initial_username)
-    gtk_entry_set_text (GTK_ENTRY (username_entry), initial_username);
-  gtk_editable_select_region (GTK_EDITABLE (username_entry), 0, -1);
+    if (initial_username)
+        gtk_entry_set_text (GTK_ENTRY (username_entry), initial_username);
+    gtk_editable_select_region (GTK_EDITABLE (username_entry), 0, -1);
 
-  if (initial_password)
-    gtk_entry_set_text (GTK_ENTRY (password_entry), initial_password);
+    if (initial_password)
+        gtk_entry_set_text (GTK_ENTRY (password_entry), initial_password);
 
-  result = gtk_dialog_run(GTK_DIALOG (dialog));
-  gtk_widget_hide(dialog);
+    result = gtk_dialog_run(GTK_DIALOG (dialog));
+    gtk_widget_hide(dialog);
 
-  if (result == GTK_RESPONSE_OK)
-  {
-    *username = gtk_editable_get_chars (GTK_EDITABLE (username_entry), 0, -1);
-    *password = gtk_editable_get_chars (GTK_EDITABLE (password_entry), 0, -1);
+    if (result == GTK_RESPONSE_OK)
+    {
+        *username = gtk_editable_get_chars (GTK_EDITABLE (username_entry), 0, -1);
+        *password = gtk_editable_get_chars (GTK_EDITABLE (password_entry), 0, -1);
 
-    gtk_widget_destroy(dialog);
-    return TRUE;
-  }
+        gtk_widget_destroy(dialog);
+        return TRUE;
+    }
 
-  *username = NULL;
-  *password = NULL;
+    *username = NULL;
+    *password = NULL;
 
-  gtk_widget_destroy(dialog);
-  return FALSE;
+    gtk_widget_destroy(dialog);
+    return FALSE;
 }

Modified: gnucash/trunk/src/gnome/druid-acct-period.c
===================================================================
--- gnucash/trunk/src/gnome/druid-acct-period.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/druid-acct-period.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -53,25 +53,25 @@
 /** structures *********************************************************/
 typedef struct
 {
-  GtkWidget * window;
-  GnomeDruid * druid;
-  GnomeDruidPage *start_page;
-  GnomeDruidPage *menu_page;
-  GnomeDruidPage *book_page;
-  GnomeDruidPage *finish_page;
-  GncFrequency *period_menu;
-  GtkLabel  * period_remarks;
-  GtkLabel  * close_results;
-  GtkLabel  * book_details;
-  GtkEntry  * book_title;
-  GtkTextView * book_notes;
+    GtkWidget * window;
+    GnomeDruid * druid;
+    GnomeDruidPage *start_page;
+    GnomeDruidPage *menu_page;
+    GnomeDruidPage *book_page;
+    GnomeDruidPage *finish_page;
+    GncFrequency *period_menu;
+    GtkLabel  * period_remarks;
+    GtkLabel  * close_results;
+    GtkLabel  * book_details;
+    GtkEntry  * book_title;
+    GtkTextView * book_notes;
 
-  time_t earliest;
-  char * earliest_str;
-  GDate closing_date;
-  GDate prev_closing_date;
-  GList *period;
-  int close_status;
+    time_t earliest;
+    char * earliest_str;
+    GDate closing_date;
+    GDate prev_closing_date;
+    GList *period;
+    int close_status;
 
 } AcctPeriodInfo;
 
@@ -84,39 +84,39 @@
 static time_t
 get_earliest_in_book (QofBook *book)
 {
-  QofQuery *q;
-  GSList *p1, *p2;
-  GList *res;
-  time_t earliest;
+    QofQuery *q;
+    GSList *p1, *p2;
+    GList *res;
+    time_t earliest;
 
-  q = qof_query_create_for(GNC_ID_SPLIT);
-  qof_query_set_max_results(q, 1);
-  qof_query_set_book (q, book);
+    q = qof_query_create_for(GNC_ID_SPLIT);
+    qof_query_set_max_results(q, 1);
+    qof_query_set_book (q, book);
 
-  /* Sort by transaction date */
-  p1 = g_slist_prepend (NULL, TRANS_DATE_POSTED);
-  p1 = g_slist_prepend (p1, SPLIT_TRANS);
-  p2 = g_slist_prepend (NULL, QUERY_DEFAULT_SORT);
-  qof_query_set_sort_order (q, p1, p2, NULL);
+    /* Sort by transaction date */
+    p1 = g_slist_prepend (NULL, TRANS_DATE_POSTED);
+    p1 = g_slist_prepend (p1, SPLIT_TRANS);
+    p2 = g_slist_prepend (NULL, QUERY_DEFAULT_SORT);
+    qof_query_set_sort_order (q, p1, p2, NULL);
 
-  /* Reverse the sort order */
-  qof_query_set_sort_increasing (q, FALSE, FALSE, FALSE);
+    /* Reverse the sort order */
+    qof_query_set_sort_increasing (q, FALSE, FALSE, FALSE);
 
-  /* Run the query, find the earliest transaction date */
-  res = qof_query_run (q);
+    /* Run the query, find the earliest transaction date */
+    res = qof_query_run (q);
 
-  if (res)
-  {
-    earliest = xaccQueryGetEarliestDateFound (q);
-  }
-  else
-  {
-    /* If no results, we don't want to bomb totally */
-    earliest = time (0);
-  }
+    if (res)
+    {
+        earliest = xaccQueryGetEarliestDateFound (q);
+    }
+    else
+    {
+        /* If no results, we don't want to bomb totally */
+        earliest = time (0);
+    }
 
-  qof_query_destroy (q);
-  return earliest;
+    qof_query_destroy (q);
+    return earliest;
 }
 
 /* =============================================================== */
@@ -127,31 +127,31 @@
 static int
 get_num_xactions_before_date(QofBook *book, time_t close_date)
 {
-  QofQuery *q;
-  GSList *param;
-  QofQueryPredData *pred;
-  Timespec ts;
-  GList *res, *n;
-  int cnt = 0;
+    QofQuery *q;
+    GSList *param;
+    QofQueryPredData *pred;
+    Timespec ts;
+    GList *res, *n;
+    int cnt = 0;
 
-  q = qof_query_create_for(GNC_ID_TRANS);
-  qof_query_set_max_results(q, -1);
-  qof_query_set_book (q, book);
+    q = qof_query_create_for(GNC_ID_TRANS);
+    qof_query_set_max_results(q, -1);
+    qof_query_set_book (q, book);
 
-  /* Look for transactions earlier than the closing date */
-  param = g_slist_prepend (NULL, TRANS_DATE_POSTED);
-  timespecFromTime_t (&ts, close_date);
-  pred = qof_query_date_predicate (QOF_COMPARE_LTE, QOF_DATE_MATCH_NORMAL, ts);
-  qof_query_add_term (q,  param, pred, QOF_QUERY_FIRST_TERM);
+    /* Look for transactions earlier than the closing date */
+    param = g_slist_prepend (NULL, TRANS_DATE_POSTED);
+    timespecFromTime_t (&ts, close_date);
+    pred = qof_query_date_predicate (QOF_COMPARE_LTE, QOF_DATE_MATCH_NORMAL, ts);
+    qof_query_add_term (q,  param, pred, QOF_QUERY_FIRST_TERM);
 
-  /* Run the query, find how many transactions there are */
-  res = qof_query_run (q);
+    /* Run the query, find how many transactions there are */
+    res = qof_query_run (q);
 
-  cnt = 0;
-  for (n=res; n; n=n->next) cnt ++;
+    cnt = 0;
+    for (n = res; n; n = n->next) cnt ++;
 
-  qof_query_destroy (q);
-  return cnt;
+    qof_query_destroy (q);
+    return cnt;
 }
 
 /* =============================================================== */
@@ -159,16 +159,21 @@
 static const char *
 get_close_status_str (AcctPeriodInfo *info)
 {
-  const char * str;
+    const char * str;
 
-  /* Tell user about how the previous book closing went. */
-  switch (info->close_status)
-  {
-    case -1: str = ""; break;
-    case 0: str = _("The book was closed successfully."); break;
-    default: str = "";
-  }
-  return str;
+    /* Tell user about how the previous book closing went. */
+    switch (info->close_status)
+    {
+    case -1:
+        str = "";
+        break;
+    case 0:
+        str = _("The book was closed successfully.");
+        break;
+    default:
+        str = "";
+    }
+    return str;
 }
 
 /* =============================================================== */
@@ -176,30 +181,30 @@
 static void
 ap_window_destroy_cb (GtkObject *object, gpointer data)
 {
-  AcctPeriodInfo *info = data;
+    AcctPeriodInfo *info = data;
 
-  gnc_unregister_gui_component_by_data (DRUID_ACCT_PERIOD_CM_CLASS, info);
+    gnc_unregister_gui_component_by_data (DRUID_ACCT_PERIOD_CM_CLASS, info);
 
-  // do we need gnc_frequency_destroy or is this automatic ??
-  recurrenceListFree(&info->period);
-  g_free (info->earliest_str);
-  g_free (info);
+    // do we need gnc_frequency_destroy or is this automatic ??
+    recurrenceListFree(&info->period);
+    g_free (info->earliest_str);
+    g_free (info);
 }
 
 static void
 ap_finish (GnomeDruidPageEdge *druidpage,
-                    GtkWidget *druid,
-                    gpointer user_data)
+           GtkWidget *druid,
+           gpointer user_data)
 {
-  AcctPeriodInfo *info = user_data;
-  gnc_close_gui_component_by_data (DRUID_ACCT_PERIOD_CM_CLASS, info);
+    AcctPeriodInfo *info = user_data;
+    gnc_close_gui_component_by_data (DRUID_ACCT_PERIOD_CM_CLASS, info);
 }
 
 static void
 ap_druid_cancel (GnomeDruid *druid, gpointer user_data)
 {
-  AcctPeriodInfo *info = user_data;
-  gnc_close_gui_component_by_data (DRUID_ACCT_PERIOD_CM_CLASS, info);
+    AcctPeriodInfo *info = user_data;
+    gnc_close_gui_component_by_data (DRUID_ACCT_PERIOD_CM_CLASS, info);
 }
 
 /* =============================================================== */
@@ -207,45 +212,45 @@
 static void
 prepare_remarks (AcctPeriodInfo *info)
 {
-  int nperiods;
-  GDate period_begin, period_end, date_now;
-  const char *remarks_text;
-  char * str;
-  ENTER ("info=%p", info);
+    int nperiods;
+    GDate period_begin, period_end, date_now;
+    const char *remarks_text;
+    char * str;
+    ENTER ("info=%p", info);
 
-  /* Pull info from widget, push into freq spec */
-  //gnc_frequency_save_state (info->period_menu, info->period, &info->closing_date);
-  recurrenceListFree(&info->period);
-  gnc_frequency_save_to_recurrence(info->period_menu, &info->period, &info->closing_date);
+    /* Pull info from widget, push into freq spec */
+    //gnc_frequency_save_state (info->period_menu, info->period, &info->closing_date);
+    recurrenceListFree(&info->period);
+    gnc_frequency_save_to_recurrence(info->period_menu, &info->period, &info->closing_date);
 
-  /* Count the number of periods that would be generated. */
-  g_date_clear (&period_begin, 1);
-  g_date_clear (&period_end, 1);
-  g_date_clear (&date_now, 1);
-  nperiods = 0;
-  period_end = info->closing_date;
-  g_date_set_time_t (&date_now, time(NULL));
+    /* Count the number of periods that would be generated. */
+    g_date_clear (&period_begin, 1);
+    g_date_clear (&period_end, 1);
+    g_date_clear (&date_now, 1);
+    nperiods = 0;
+    period_end = info->closing_date;
+    g_date_set_time_t (&date_now, time(NULL));
 
-  while (0 > g_date_compare(&period_end, &date_now ))
-  {
-    nperiods ++;
-    PINFO ("period=%d end date=%d/%d/%d", nperiods,
-                      g_date_get_month(&period_end),
-                      g_date_get_day(&period_end),
-                      g_date_get_year(&period_end));
-    period_begin = period_end;
-    recurrenceListNextInstance(info->period, &period_begin, &period_end);
-  }
+    while (0 > g_date_compare(&period_end, &date_now ))
+    {
+        nperiods ++;
+        PINFO ("period=%d end date=%d/%d/%d", nperiods,
+               g_date_get_month(&period_end),
+               g_date_get_day(&period_end),
+               g_date_get_year(&period_end));
+        period_begin = period_end;
+        recurrenceListNextInstance(info->period, &period_begin, &period_end);
+    }
 
-  /* Display the results */
-  remarks_text =
-    _("The earliest transaction date found in this book is %s. "
-      "Based on the selection made above, this book will be split "
-      "into %d books.  Click on 'Forward' to start closing the "
-      "earliest book.");
-  str = g_strdup_printf (remarks_text, info->earliest_str, nperiods);
-  gtk_label_set_text (info->period_remarks, str);
-  g_free (str);
+    /* Display the results */
+    remarks_text =
+        _("The earliest transaction date found in this book is %s. "
+          "Based on the selection made above, this book will be split "
+          "into %d books.  Click on 'Forward' to start closing the "
+          "earliest book.");
+    str = g_strdup_printf (remarks_text, info->earliest_str, nperiods);
+    gtk_label_set_text (info->period_remarks, str);
+    g_free (str);
 }
 
 /* =============================================================== */
@@ -253,61 +258,61 @@
 static void
 show_book_details (AcctPeriodInfo *info)
 {
-  QofBook *currbook;
-  char close_date_str[MAX_DATE_LENGTH];
-  char prev_close_date_str[MAX_DATE_LENGTH];
-  const char *period_text;
-  char *str;
-  const char *cstr;
-  int ntrans, nacc;
+    QofBook *currbook;
+    char close_date_str[MAX_DATE_LENGTH];
+    char prev_close_date_str[MAX_DATE_LENGTH];
+    const char *period_text;
+    char *str;
+    const char *cstr;
+    int ntrans, nacc;
 
-  ENTER ("info=%p", info);
+    ENTER ("info=%p", info);
 
-  /* Tell user about how the previous book closing went. */
-  cstr = get_close_status_str (info);
-  gtk_label_set_text (info->close_results, cstr);
-  info->close_status = -1;
+    /* Tell user about how the previous book closing went. */
+    cstr = get_close_status_str (info);
+    gtk_label_set_text (info->close_results, cstr);
+    info->close_status = -1;
 
-  /* Pull info from widget, push into freq spec */
-  //gnc_frequency_save_state (info->period_menu, info->period, &info->closing_date);
-  recurrenceListFree(&info->period);
-  gnc_frequency_save_to_recurrence(info->period_menu, &info->period, &info->closing_date);
+    /* Pull info from widget, push into freq spec */
+    //gnc_frequency_save_state (info->period_menu, info->period, &info->closing_date);
+    recurrenceListFree(&info->period);
+    gnc_frequency_save_to_recurrence(info->period_menu, &info->period, &info->closing_date);
 
-  qof_print_date_dmy_buff (close_date_str, MAX_DATE_LENGTH,
-                           g_date_get_day(&info->closing_date),
-                           g_date_get_month(&info->closing_date),
-                           g_date_get_year(&info->closing_date));
+    qof_print_date_dmy_buff (close_date_str, MAX_DATE_LENGTH,
+                             g_date_get_day(&info->closing_date),
+                             g_date_get_month(&info->closing_date),
+                             g_date_get_year(&info->closing_date));
 
-  currbook = gnc_get_current_book();
-  ntrans = get_num_xactions_before_date(currbook,
-                   gnc_timet_get_day_end_gdate (&info->closing_date));
+    currbook = gnc_get_current_book();
+    ntrans = get_num_xactions_before_date(currbook,
+                                          gnc_timet_get_day_end_gdate (&info->closing_date));
 
-  nacc = gnc_account_n_descendants (gnc_book_get_root_account (currbook));
+    nacc = gnc_account_n_descendants (gnc_book_get_root_account (currbook));
 
-  /* Display the book info */
-  period_text =
-    _("You have asked for a book to be created.  This book "
-      "will contain all transactions up to midnight %s "
-      "(for a total of %d transactions spread over %d accounts). "
-      "Click on 'Forward' to create this book. "
-      "Click on 'Back' to adjust the dates.");
-  str = g_strdup_printf (period_text, close_date_str, ntrans, nacc);
-  gtk_label_set_text (info->book_details, str);
-  g_free (str);
+    /* Display the book info */
+    period_text =
+        _("You have asked for a book to be created.  This book "
+          "will contain all transactions up to midnight %s "
+          "(for a total of %d transactions spread over %d accounts). "
+          "Click on 'Forward' to create this book. "
+          "Click on 'Back' to adjust the dates.");
+    str = g_strdup_printf (period_text, close_date_str, ntrans, nacc);
+    gtk_label_set_text (info->book_details, str);
+    g_free (str);
 
-  /* Weird bug fix ! */
-  gtk_widget_show (GTK_WIDGET (info->book_details));
+    /* Weird bug fix ! */
+    gtk_widget_show (GTK_WIDGET (info->book_details));
 
-  /* Create default settings for the title, notes fields */
-  qof_print_date_dmy_buff (prev_close_date_str, MAX_DATE_LENGTH,
-                           g_date_get_day(&info->prev_closing_date),
-                           g_date_get_month(&info->prev_closing_date),
-                           g_date_get_year(&info->prev_closing_date));
+    /* Create default settings for the title, notes fields */
+    qof_print_date_dmy_buff (prev_close_date_str, MAX_DATE_LENGTH,
+                             g_date_get_day(&info->prev_closing_date),
+                             g_date_get_month(&info->prev_closing_date),
+                             g_date_get_year(&info->prev_closing_date));
 
-  str = g_strdup_printf (_("Period %s - %s"), prev_close_date_str, close_date_str);
-  gtk_entry_set_text (info->book_title, str);
-  xxxgtk_textview_set_text (info->book_notes, str);
-  g_free (str);
+    str = g_strdup_printf (_("Period %s - %s"), prev_close_date_str, close_date_str);
+    gtk_entry_set_text (info->book_title, str);
+    xxxgtk_textview_set_text (info->book_notes, str);
+    g_free (str);
 
 }
 
@@ -316,77 +321,77 @@
 static void
 ap_changed (GtkWidget *widget, gpointer user_data)
 {
-  AcctPeriodInfo *info = user_data;
+    AcctPeriodInfo *info = user_data;
 
-  ENTER ("info=%p", info);
-  prepare_remarks (info);
+    ENTER ("info=%p", info);
+    prepare_remarks (info);
 }
 
 
 static void
 ap_show_menu (GnomeDruidPage *druidpage,
-                GtkWidget *druid,
-                gpointer user_data)
+              GtkWidget *druid,
+              gpointer user_data)
 {
-  AcctPeriodInfo *info = user_data;
-  ENTER("info=%p", info);
+    AcctPeriodInfo *info = user_data;
+    ENTER("info=%p", info);
 
-  /* Find the date of the earliest transaction in the current book.
-   * Note that this could have changed since last time, since
-   * we may have closed books since last time. */
-  info->earliest = get_earliest_in_book (gnc_get_current_book());
-  info->earliest_str = qof_print_date(info->earliest);
-  PINFO ("date of earliest is %ld %s", info->earliest, ctime (&info->earliest));
+    /* Find the date of the earliest transaction in the current book.
+     * Note that this could have changed since last time, since
+     * we may have closed books since last time. */
+    info->earliest = get_earliest_in_book (gnc_get_current_book());
+    info->earliest_str = qof_print_date(info->earliest);
+    PINFO ("date of earliest is %ld %s", info->earliest, ctime (&info->earliest));
 
-  prepare_remarks (info);
+    prepare_remarks (info);
 }
 
 static gboolean
 ap_validate_menu (GnomeDruidPage *druidpage,
-                GtkWidget *druid,
-                gpointer user_data)
+                  GtkWidget *druid,
+                  gpointer user_data)
 {
-  GDate date_now;
-  AcctPeriodInfo *info = user_data;
-  ENTER("info=%p", info);
+    GDate date_now;
+    AcctPeriodInfo *info = user_data;
+    ENTER("info=%p", info);
 
-  /* Pull info from widget, push into freq spec */
-  //gnc_frequency_save_state (info->period_menu, info->period, &info->closing_date);
-  recurrenceListFree(&info->period);
-  gnc_frequency_save_to_recurrence(info->period_menu, &info->period, &info->closing_date);
+    /* Pull info from widget, push into freq spec */
+    //gnc_frequency_save_state (info->period_menu, info->period, &info->closing_date);
+    recurrenceListFree(&info->period);
+    gnc_frequency_save_to_recurrence(info->period_menu, &info->period, &info->closing_date);
 
-  if (0 <= g_date_compare(&info->prev_closing_date, &info->closing_date))
-  {
-    const char *msg = _("You must select closing date that "
-                        "is greater than the closing date "
-                        "of the previous book.");
-    gnc_error_dialog (info->window, "%s", msg);
-    return TRUE;
-  }
+    if (0 <= g_date_compare(&info->prev_closing_date, &info->closing_date))
+    {
+        const char *msg = _("You must select closing date that "
+                            "is greater than the closing date "
+                            "of the previous book.");
+        gnc_error_dialog (info->window, "%s", msg);
+        return TRUE;
+    }
 
-  g_date_clear (&date_now, 1);
-  g_date_set_time_t (&date_now, time(NULL));
-  if (0 < g_date_compare(&info->closing_date, &date_now))
-  {
-    const char *msg = _("You must select closing date "
-                        "that is not in the future.");
-    gnc_error_dialog (info->window, "%s", msg);
-    return TRUE;
-  }
-  return FALSE;
+    g_date_clear (&date_now, 1);
+    g_date_set_time_t (&date_now, time(NULL));
+    if (0 < g_date_compare(&info->closing_date, &date_now))
+    {
+        const char *msg = _("You must select closing date "
+                            "that is not in the future.");
+        gnc_error_dialog (info->window, "%s", msg);
+        return TRUE;
+    }
+    return FALSE;
 }
 
 /* =============================================================== */
 
 static void
 ap_show_book (GnomeDruidPage *druidpage,
-                GtkWidget *druid,
-                gpointer user_data)
+              GtkWidget *druid,
+              gpointer user_data)
 {
-  AcctPeriodInfo *info = user_data;
+    AcctPeriodInfo *info = user_data;
 
-  ENTER ("info=%p", info);
-  show_book_details (info);
+    ENTER ("info=%p", info);
+    show_book_details (info);
 }
 
 /* =============================================================== */
@@ -394,111 +399,111 @@
 static void
 scrub_all(void)
 {
-  Account *root = gnc_get_current_root_account ();
-  xaccAccountTreeScrubOrphans (root);
-  xaccAccountTreeScrubImbalance (root);
-  // XXX: Lots are disabled
-  // xaccAccountTreeScrubLots (root);
+    Account *root = gnc_get_current_root_account ();
+    xaccAccountTreeScrubOrphans (root);
+    xaccAccountTreeScrubImbalance (root);
+    // XXX: Lots are disabled
+    // xaccAccountTreeScrubLots (root);
 }
 
 /* =============================================================== */
 
 static gboolean
 ap_close_period (GnomeDruidPage *druidpage,
-                GtkWidget *druid,
-                gpointer user_data)
+                 GtkWidget *druid,
+                 gpointer user_data)
 {
-  AcctPeriodInfo *info = user_data;
-  QofBook *closed_book = NULL, *current_book;
-  const char *btitle;
-  char *bnotes;
-  Timespec closing_date;
-  KvpFrame *book_frame;
-  gboolean really_do_close_books = FALSE;
+    AcctPeriodInfo *info = user_data;
+    QofBook *closed_book = NULL, *current_book;
+    const char *btitle;
+    char *bnotes;
+    Timespec closing_date;
+    KvpFrame *book_frame;
+    gboolean really_do_close_books = FALSE;
 
-  ENTER("info=%p", info);
+    ENTER("info=%p", info);
 
-  current_book = gnc_get_current_book ();
+    current_book = gnc_get_current_book ();
 
-  btitle = gtk_entry_get_text (info->book_title);
-  bnotes = xxxgtk_textview_get_text (info->book_notes);
-  PINFO("book title=%s\n", btitle);
+    btitle = gtk_entry_get_text (info->book_title);
+    bnotes = xxxgtk_textview_get_text (info->book_notes);
+    PINFO("book title=%s\n", btitle);
 
-  timespecFromTime_t (&closing_date,
-          gnc_timet_get_day_end_gdate (&info->closing_date));
+    timespecFromTime_t (&closing_date,
+                        gnc_timet_get_day_end_gdate (&info->closing_date));
 
 #define REALLY_DO_CLOSE_BOOKS
 #ifdef REALLY_DO_CLOSE_BOOKS
-  really_do_close_books = TRUE;
+    really_do_close_books = TRUE;
 #endif /* REALLY_DO_CLOSE_BOOKS */
 
-  if (really_do_close_books)
-  {
-    /* Close the books ! */
-    qof_event_suspend ();
-    gnc_suspend_gui_refresh ();
+    if (really_do_close_books)
+    {
+        /* Close the books ! */
+        qof_event_suspend ();
+        gnc_suspend_gui_refresh ();
 
-    scrub_all();
-    closed_book = gnc_book_close_period (current_book, closing_date, NULL, btitle);
+        scrub_all();
+        closed_book = gnc_book_close_period (current_book, closing_date, NULL, btitle);
 
-    book_frame = qof_book_get_slots(closed_book);
-    kvp_frame_set_str (book_frame, "/book/title", btitle);
-    kvp_frame_set_str (book_frame, "/book/notes", bnotes);
+        book_frame = qof_book_get_slots(closed_book);
+        kvp_frame_set_str (book_frame, "/book/title", btitle);
+        kvp_frame_set_str (book_frame, "/book/notes", bnotes);
 
-    qof_session_add_book (gnc_get_current_session(), closed_book);
+        qof_session_add_book (gnc_get_current_session(), closed_book);
 
-    /* We must save now; if we don't, and the user bails without saving,
-     * then opening account balances will be incorrect, and this can only
-     * lead to unhappiness.
-     */
-    gnc_file_save ();
-    gnc_resume_gui_refresh ();
-    qof_event_resume ();
-    gnc_gui_refresh_all ();  /* resume above should have been enough ??? */
-  }
-  g_free(bnotes);
+        /* We must save now; if we don't, and the user bails without saving,
+         * then opening account balances will be incorrect, and this can only
+         * lead to unhappiness.
+         */
+        gnc_file_save ();
+        gnc_resume_gui_refresh ();
+        qof_event_resume ();
+        gnc_gui_refresh_all ();  /* resume above should have been enough ??? */
+    }
+    g_free(bnotes);
 
-  /* Report the status back to the user. */
-  info->close_status = 0;  /* XXX fixme success or failure? */
+    /* Report the status back to the user. */
+    info->close_status = 0;  /* XXX fixme success or failure? */
 
-  /* Find the next closing date ... */
-  info->prev_closing_date = info->closing_date;
-  recurrenceListNextInstance(info->period, &info->prev_closing_date, &info->closing_date);
+    /* Find the next closing date ... */
+    info->prev_closing_date = info->closing_date;
+    recurrenceListNextInstance(info->period, &info->prev_closing_date, &info->closing_date);
 
-  /* If the next closing date is in the future, then we are done. */
-  if (time(NULL) < gnc_timet_get_day_end_gdate (&info->closing_date))
-  {
-    return FALSE;
-  }
+    /* If the next closing date is in the future, then we are done. */
+    if (time(NULL) < gnc_timet_get_day_end_gdate (&info->closing_date))
+    {
+        return FALSE;
+    }
 
-  /* Load up the GUI for the next closing period. */
-  gnc_frequency_setup_recurrence(info->period_menu, NULL, &info->closing_date);
+    /* Load up the GUI for the next closing period. */
+    gnc_frequency_setup_recurrence(info->period_menu, NULL, &info->closing_date);
 
-  show_book_details (info);
-  return TRUE;
+    show_book_details (info);
+    return TRUE;
 }
 
 /* =============================================================== */
 
 static void
 ap_show_done (GnomeDruidPageEdge *druidpage,
-                    GtkWidget *druid,
-                    gpointer user_data)
+              GtkWidget *druid,
+              gpointer user_data)
 {
-  const char *msg;
-  char *str;
-  AcctPeriodInfo *info = user_data;
-  ENTER ("info=%p", info);
+    const char *msg;
+    char *str;
+    AcctPeriodInfo *info = user_data;
+    ENTER ("info=%p", info);
 
-  /* Translation FIXME: Can this %s-containing message please be
-     replaced by one single message? Either this closing went
-     successfully ("success", "congratulations") or something else
-     should be displayed anyway. */
-  msg = _("%s\nCongratulations! You are done closing books!");
+    /* Translation FIXME: Can this %s-containing message please be
+       replaced by one single message? Either this closing went
+       successfully ("success", "congratulations") or something else
+       should be displayed anyway. */
+    msg = _("%s\nCongratulations! You are done closing books!");
 
-  str = g_strdup_printf (msg, get_close_status_str (info));
-  gnome_druid_page_edge_set_text (druidpage, str);
-  g_free (str);
+    str = g_strdup_printf (msg, get_close_status_str (info));
+    gnome_druid_page_edge_set_text (druidpage, str);
+    g_free (str);
 }
 
 /* =============================================================== */
@@ -506,113 +511,113 @@
 static void
 ap_druid_create (AcctPeriodInfo *info)
 {
-  GladeXML *xml;
-  GtkWidget *w;
+    GladeXML *xml;
+    GtkWidget *w;
 
-  xml = gnc_glade_xml_new ("acctperiod.glade", "Acct Period Druid");
+    xml = gnc_glade_xml_new ("acctperiod.glade", "Acct Period Druid");
 
-  info->window = glade_xml_get_widget (xml, "Acct Period Druid");
+    info->window = glade_xml_get_widget (xml, "Acct Period Druid");
 
-  info->druid = GNOME_DRUID (glade_xml_get_widget (xml, "acct_period_druid"));
-  gnc_druid_set_colors (info->druid);
+    info->druid = GNOME_DRUID (glade_xml_get_widget (xml, "acct_period_druid"));
+    gnc_druid_set_colors (info->druid);
 
-  info->start_page =
+    info->start_page =
         GNOME_DRUID_PAGE(glade_xml_get_widget (xml, "start page"));
-  info->menu_page =
+    info->menu_page =
         GNOME_DRUID_PAGE(glade_xml_get_widget (xml, "menu page"));
-  info->book_page =
+    info->book_page =
         GNOME_DRUID_PAGE(glade_xml_get_widget (xml, "book page"));
-  info->finish_page =
+    info->finish_page =
         GNOME_DRUID_PAGE(glade_xml_get_widget (xml, "finish page"));
 
-  info->close_status = -1;
+    info->close_status = -1;
 
-  /* Find the date of the earliest transaction in the book.
-   * Add a year minus a day as the first guess for book closing,
-   * and use that to set up the freq spec widget. */
-  info->earliest = get_earliest_in_book (gnc_get_current_book());
-  info->earliest_str = qof_print_date(info->earliest);
-  PINFO ("date of earliest transaction is %ld %s",
-                  info->earliest, ctime (&info->earliest));
+    /* Find the date of the earliest transaction in the book.
+     * Add a year minus a day as the first guess for book closing,
+     * and use that to set up the freq spec widget. */
+    info->earliest = get_earliest_in_book (gnc_get_current_book());
+    info->earliest_str = qof_print_date(info->earliest);
+    PINFO ("date of earliest transaction is %ld %s",
+           info->earliest, ctime (&info->earliest));
 
-  g_date_clear (&info->closing_date, 1);
-  g_date_set_time_t (&info->closing_date, info->earliest);
-  g_date_clear (&info->prev_closing_date, 1);
-  info->prev_closing_date = info->closing_date;
-  g_date_add_years (&info->closing_date, 1);
+    g_date_clear (&info->closing_date, 1);
+    g_date_set_time_t (&info->closing_date, info->earliest);
+    g_date_clear (&info->prev_closing_date, 1);
+    info->prev_closing_date = info->closing_date;
+    g_date_add_years (&info->closing_date, 1);
 
-  {
-      Recurrence *r = g_new0(Recurrence, 1);
-      recurrenceSet(r, 1, PERIOD_MONTH, &info->closing_date, WEEKEND_ADJ_NONE);
-      info->period = NULL;
-      info->period = g_list_append(info->period, r);
-  }
+    {
+        Recurrence *r = g_new0(Recurrence, 1);
+        recurrenceSet(r, 1, PERIOD_MONTH, &info->closing_date, WEEKEND_ADJ_NONE);
+        info->period = NULL;
+        info->period = g_list_append(info->period, r);
+    }
 
-  info->period_menu = GNC_FREQUENCY(
-          gnc_frequency_new_from_recurrence(info->period, &info->closing_date));
+    info->period_menu = GNC_FREQUENCY(
+                            gnc_frequency_new_from_recurrence(info->period, &info->closing_date));
 
-  /* Change the text so that its more mainingful for this druid */
-  gnc_frequency_set_frequency_label_text(info->period_menu, _("Period:"));
-  gnc_frequency_set_date_label_text(info->period_menu, _("Closing Date:"));
+    /* Change the text so that its more mainingful for this druid */
+    gnc_frequency_set_frequency_label_text(info->period_menu, _("Period:"));
+    gnc_frequency_set_date_label_text(info->period_menu, _("Closing Date:"));
 
-  /* Reparent to the correct location */
-  w = glade_xml_get_widget (xml, "period box");
-  gtk_box_pack_start (GTK_BOX (w), GTK_WIDGET (info->period_menu),
-         TRUE, TRUE, 0);
+    /* Reparent to the correct location */
+    w = glade_xml_get_widget (xml, "period box");
+    gtk_box_pack_start (GTK_BOX (w), GTK_WIDGET (info->period_menu),
+                        TRUE, TRUE, 0);
 
-  /* Get handles to all of the other widgets we'll need */
-  info->period_remarks =
+    /* Get handles to all of the other widgets we'll need */
+    info->period_remarks =
         GTK_LABEL (glade_xml_get_widget (xml, "remarks label"));
 
-  info->close_results =
+    info->close_results =
         GTK_LABEL (glade_xml_get_widget (xml, "results label"));
 
-  info->book_details =
+    info->book_details =
         GTK_LABEL (glade_xml_get_widget (xml, "book label"));
 
-  info->book_title =
+    info->book_title =
         GTK_ENTRY (glade_xml_get_widget (xml, "book title entry"));
 
-  info->book_notes =
+    info->book_notes =
         GTK_TEXT_VIEW (glade_xml_get_widget (xml, "book notes text"));
 
-  /* generic finished/close/abort signals */
-  g_signal_connect (info->window, "destroy",
-		    G_CALLBACK (ap_window_destroy_cb), info);
+    /* generic finished/close/abort signals */
+    g_signal_connect (info->window, "destroy",
+                      G_CALLBACK (ap_window_destroy_cb), info);
 
-  g_signal_connect (info->druid, "cancel",
-		    G_CALLBACK (ap_druid_cancel), info);
+    g_signal_connect (info->druid, "cancel",
+                      G_CALLBACK (ap_druid_cancel), info);
 
-  g_signal_connect (info->menu_page, "prepare",
-		    G_CALLBACK (ap_show_menu), info);
+    g_signal_connect (info->menu_page, "prepare",
+                      G_CALLBACK (ap_show_menu), info);
 
-  g_signal_connect (info->menu_page, "next",
-		    G_CALLBACK (ap_validate_menu), info);
+    g_signal_connect (info->menu_page, "next",
+                      G_CALLBACK (ap_validate_menu), info);
 
-  g_signal_connect (info->book_page, "prepare",
-		    G_CALLBACK (ap_show_book), info);
+    g_signal_connect (info->book_page, "prepare",
+                      G_CALLBACK (ap_show_book), info);
 
-  g_signal_connect (info->book_page, "next",
-		    G_CALLBACK (ap_close_period), info);
+    g_signal_connect (info->book_page, "next",
+                      G_CALLBACK (ap_close_period), info);
 
-  g_signal_connect (info->finish_page, "prepare",
-		    G_CALLBACK (ap_show_done), info);
+    g_signal_connect (info->finish_page, "prepare",
+                      G_CALLBACK (ap_show_done), info);
 
-  g_signal_connect (info->finish_page, "finish",
-		    G_CALLBACK (ap_finish), info);
+    g_signal_connect (info->finish_page, "finish",
+                      G_CALLBACK (ap_finish), info);
 
-  /* User changes the accouting period or date signals */
-  g_signal_connect (info->period_menu, "changed",
-		    G_CALLBACK (ap_changed), info);
+    /* User changes the accouting period or date signals */
+    g_signal_connect (info->period_menu, "changed",
+                      G_CALLBACK (ap_changed), info);
 }
 
 
 static void
 ap_close_handler (gpointer user_data)
 {
-  AcctPeriodInfo *info = user_data;
+    AcctPeriodInfo *info = user_data;
 
-  gtk_widget_destroy (info->window);
+    gtk_widget_destroy (info->window);
 }
 
 /********************************************************************\
@@ -626,18 +631,18 @@
 void
 gnc_acct_period_dialog (void)
 {
-  AcctPeriodInfo *info;
-  gint component_id;
+    AcctPeriodInfo *info;
+    gint component_id;
 
-  info = g_new0 (AcctPeriodInfo, 1);
+    info = g_new0 (AcctPeriodInfo, 1);
 
-  ap_druid_create (info);
+    ap_druid_create (info);
 
-  component_id = gnc_register_gui_component (DRUID_ACCT_PERIOD_CM_CLASS,
-                                             NULL, ap_close_handler,
-                                             info);
+    component_id = gnc_register_gui_component (DRUID_ACCT_PERIOD_CM_CLASS,
+                   NULL, ap_close_handler,
+                   info);
 
-  gtk_widget_show_all (info->window);
+    gtk_widget_show_all (info->window);
 
-  gnc_window_adjust_for_screen (GTK_WINDOW(info->window));
+    gnc_window_adjust_for_screen (GTK_WINDOW(info->window));
 }

Modified: gnucash/trunk/src/gnome/druid-acct-period.h
===================================================================
--- gnucash/trunk/src/gnome/druid-acct-period.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/druid-acct-period.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -26,7 +26,7 @@
 /********************************************************************\
  * gnc_acct_period_dialog                                           *
  *   opens up a window to set up accounting period                  *
- *                                                                  * 
+ *                                                                  *
  * Args:   none                                                     *
  * Return: nothing                                                  *
 \********************************************************************/

Modified: gnucash/trunk/src/gnome/druid-hierarchy.c
===================================================================
--- gnucash/trunk/src/gnome/druid-hierarchy.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/druid-hierarchy.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -53,61 +53,63 @@
 #include "gnc-plugin-page-account-tree.h"
 
 #include "gnc-engine.h"
-static QofLogModule log_module = GNC_MOD_IMPORT; 
+static QofLogModule log_module = GNC_MOD_IMPORT;
 
 #define GCONF_SECTION "dialogs/new_hierarchy"
 
-typedef enum {
-  COL_CHECKED,
-  COL_TITLE,
-  COL_SHORT_DESCRIPTION,
-  COL_LONG_DESCRIPTION,
-  COL_ACCOUNT,
-  NUM_COLUMNS
+typedef enum
+{
+    COL_CHECKED,
+    COL_TITLE,
+    COL_SHORT_DESCRIPTION,
+    COL_LONG_DESCRIPTION,
+    COL_ACCOUNT,
+    NUM_COLUMNS
 } ColumnNames;
 
 
-typedef struct {
-  GtkWidget *dialog;
-  GtkWidget *druid;
-  gboolean next_ok;
+typedef struct
+{
+    GtkWidget *dialog;
+    GtkWidget *druid;
+    gboolean next_ok;
 
-  GtkWidget *currency_selector;
+    GtkWidget *currency_selector;
 
-  GtkTreeView *categories_tree;
-  GtkTreeRowReference *initial_category;
-  GtkTextView *category_description;
-  GtkWidget *category_accounts_container;
-  GtkLabel *category_accounts_label;
-  GtkTreeView *category_accounts_tree;
-  gboolean category_set_changed;
+    GtkTreeView *categories_tree;
+    GtkTreeRowReference *initial_category;
+    GtkTextView *category_description;
+    GtkWidget *category_accounts_container;
+    GtkLabel *category_accounts_label;
+    GtkTreeView *category_accounts_tree;
+    gboolean category_set_changed;
 
-  GncTreeViewAccount *final_account_tree;
-  GtkWidget *final_account_tree_container;
-  Account *selected_account;
-  /** Map<Account*,gnc_numeric*> **/
-  GHashTable *balance_hash;
+    GncTreeViewAccount *final_account_tree;
+    GtkWidget *final_account_tree_container;
+    Account *selected_account;
+    /** Map<Account*,gnc_numeric*> **/
+    GHashTable *balance_hash;
 
-  Account *our_account_tree;
-  QofBook *temporary;
+    Account *our_account_tree;
+    QofBook *temporary;
 
-  gboolean account_list_added;
-  gboolean use_defaults;
+    gboolean account_list_added;
+    gboolean use_defaults;
 
-  GncHierarchyDruidFinishedCallback when_completed;
+    GncHierarchyDruidFinishedCallback when_completed;
 
 } hierarchy_data;
 
 void on_choose_account_categories_prepare (GnomeDruidPage  *gnomedruidpage,
-					   gpointer         arg1,
-					   hierarchy_data  *data);
+        gpointer         arg1,
+        hierarchy_data  *data);
 void select_all_clicked (GtkButton       *button,
-			 hierarchy_data  *data);
+                         hierarchy_data  *data);
 void clear_all_clicked (GtkButton       *button,
-			hierarchy_data  *data);
+                        hierarchy_data  *data);
 void on_final_account_prepare (GnomeDruidPage  *gnomedruidpage,
-			       gpointer         arg1,
-			       hierarchy_data  *data);
+                               gpointer         arg1,
+                               hierarchy_data  *data);
 void on_cancel (GnomeDruid      *gnomedruid, hierarchy_data *data);
 void on_finish (GnomeDruidPage  *gnomedruidpage, gpointer arg1, hierarchy_data *data);
 
@@ -116,61 +118,62 @@
 static void
 delete_hierarchy_dialog (hierarchy_data *data)
 {
-  gtk_widget_destroy (data->dialog);
+    gtk_widget_destroy (data->dialog);
 }
 
 static void
 destroy_hash_helper (gpointer key, gpointer value, gpointer user_data)
 {
-  gnc_numeric *balance = value;
-  g_free (balance);
+    gnc_numeric *balance = value;
+    g_free (balance);
 }
 
 static void
 gnc_hierarchy_destroy_cb (GtkObject *obj,   hierarchy_data *data)
 {
-  GHashTable *hash;
+    GHashTable *hash;
 
-  hash = data->balance_hash;
-  if (hash)
-  {
-    g_hash_table_foreach (hash, destroy_hash_helper, NULL);
-    g_hash_table_destroy (hash);
-    data->balance_hash = NULL;
-  }
+    hash = data->balance_hash;
+    if (hash)
+    {
+        g_hash_table_foreach (hash, destroy_hash_helper, NULL);
+        g_hash_table_destroy (hash);
+        data->balance_hash = NULL;
+    }
 }
 
 static gnc_numeric
 get_final_balance (GHashTable *hash, Account *account)
 {
-  gnc_numeric *balance;
+    gnc_numeric *balance;
 
-  if (!hash || !account)
+    if (!hash || !account)
+        return gnc_numeric_zero ();
+
+    balance = g_hash_table_lookup(hash, account);
+    if (balance)
+        return *balance;
     return gnc_numeric_zero ();
-
-  balance = g_hash_table_lookup(hash, account);
-  if (balance)
-    return *balance;
-  return gnc_numeric_zero ();
 }
 
 static void
 set_final_balance (GHashTable *hash, Account *account, gnc_numeric in_balance)
 {
-  gnc_numeric *balance;
+    gnc_numeric *balance;
 
-  if (!hash || !account)
-    return;
+    if (!hash || !account)
+        return;
 
-  balance = g_hash_table_lookup (hash, account);
-  if (balance) {
+    balance = g_hash_table_lookup (hash, account);
+    if (balance)
+    {
+        *balance = in_balance;
+        return;
+    }
+
+    balance = g_new (gnc_numeric, 1);
     *balance = in_balance;
-    return;
-  }
-
-  balance = g_new (gnc_numeric, 1);
-  *balance = in_balance;
-  g_hash_table_insert (hash, account, balance);
+    g_hash_table_insert (hash, account, balance);
 }
 
 static gchar*
@@ -181,7 +184,7 @@
     gchar *locale;
     struct stat buf;
     int i;
-    
+
 #ifdef HAVE_LC_MESSAGES
     locale = g_strdup(setlocale(LC_MESSAGES, NULL));
 #else
@@ -194,8 +197,8 @@
      * Mac OS X 10.1 and earlier, not only doesn't have LC_MESSAGES
      * setlocale can sometimes return NULL instead of "C"
      */
-    locale = g_strdup(setlocale(LC_ALL, NULL) ? 
-		      setlocale(LC_ALL, NULL) : "C");
+    locale = g_strdup(setlocale(LC_ALL, NULL) ?
+                      setlocale(LC_ALL, NULL) : "C");
 # endif
 #endif
 
@@ -203,19 +206,19 @@
     ret = g_build_filename(top_dir, locale, (char *)NULL);
 
     while (g_stat(ret, &buf) != 0)
-    { 
-	i--;
-	if (i<1) 
-	{
-	    g_free(ret);
-	    ret = g_build_filename(top_dir, default_locale, (char *)NULL);
-	    break;
-	}
-	locale[i] = '\0';
-	g_free(ret);
-	ret = g_build_filename(top_dir, locale, (char *)NULL);
+    {
+        i--;
+        if (i < 1)
+        {
+            g_free(ret);
+            ret = g_build_filename(top_dir, default_locale, (char *)NULL);
+            break;
+        }
+        locale[i] = '\0';
+        g_free(ret);
+        ret = g_build_filename(top_dir, locale, (char *)NULL);
     }
-    
+
     g_free(locale);
 
     return ret;
@@ -240,9 +243,9 @@
 static gboolean
 delayed_enable_next_button (hierarchy_data *data)
 {
-  gnome_druid_set_buttons_sensitive(GNOME_DRUID(data->druid),
-				    TRUE, data->next_ok, TRUE, TRUE);
-  return FALSE;
+    gnome_druid_set_buttons_sensitive(GNOME_DRUID(data->druid),
+                                      TRUE, data->next_ok, TRUE, TRUE);
+    return FALSE;
 }
 
 /** This is a helper function called on each item in the GtkTreeStore
@@ -264,21 +267,22 @@
  *  be tested. */
 static gboolean
 account_set_checked_helper (GtkListStore *store,
-			    GtkTreePath  *path,
-			    GtkTreeIter  *iter,
-			    gboolean     *result)
+                            GtkTreePath  *path,
+                            GtkTreeIter  *iter,
+                            gboolean     *result)
 {
-  gboolean checked;
+    gboolean checked;
 
-  g_return_val_if_fail(GTK_IS_LIST_STORE(store), FALSE);
+    g_return_val_if_fail(GTK_IS_LIST_STORE(store), FALSE);
 
-  gtk_tree_model_get (GTK_TREE_MODEL(store), iter, COL_CHECKED, &checked, -1);
-  if (checked) {
-    *result = TRUE;
-    return TRUE; /* Stop tree walk. */
-  }
+    gtk_tree_model_get (GTK_TREE_MODEL(store), iter, COL_CHECKED, &checked, -1);
+    if (checked)
+    {
+        *result = TRUE;
+        return TRUE; /* Stop tree walk. */
+    }
 
-  return FALSE;
+    return FALSE;
 }
 
 /** This function determines if the "Next" button on the account set
@@ -290,128 +294,129 @@
 static void
 categories_page_enable_next (hierarchy_data *data)
 {
-  data->next_ok = FALSE;
-  gtk_tree_model_foreach (gtk_tree_view_get_model (data->categories_tree),
-			  (GtkTreeModelForeachFunc)account_set_checked_helper,
-			  &data->next_ok);
-  g_idle_add((GSourceFunc)delayed_enable_next_button, data);
+    data->next_ok = FALSE;
+    gtk_tree_model_foreach (gtk_tree_view_get_model (data->categories_tree),
+                            (GtkTreeModelForeachFunc)account_set_checked_helper,
+                            &data->next_ok);
+    g_idle_add((GSourceFunc)delayed_enable_next_button, data);
 }
 
 
 static void
 categories_selection_changed (GtkTreeModel *treemodel,
-			      GtkTreePath *arg1,
-			      GtkTreeIter *arg2,
-			      hierarchy_data *data)
+                              GtkTreePath *arg1,
+                              GtkTreeIter *arg2,
+                              hierarchy_data *data)
 {
-	data->category_set_changed = TRUE;
-	categories_page_enable_next(data);
+    data->category_set_changed = TRUE;
+    categories_page_enable_next(data);
 }
 
 
 static void
 add_one_category (GncExampleAccount *acc,
-		  hierarchy_data *data)
+                  hierarchy_data *data)
 {
-	GtkTreeView *view;
-	GtkListStore *store;
-	GtkTreeIter iter;
-	GtkTreePath* path;
-	gboolean use_defaults;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkTreeIter iter;
+    GtkTreePath* path;
+    gboolean use_defaults;
 
-	g_return_if_fail(acc != NULL);
-	g_return_if_fail(data != NULL);
+    g_return_if_fail(acc != NULL);
+    g_return_if_fail(data != NULL);
 
-	view = data->categories_tree;
-	store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
-	use_defaults = data->use_defaults && acc->start_selected;
+    view = data->categories_tree;
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+    use_defaults = data->use_defaults && acc->start_selected;
 
-	gtk_list_store_append(store, &iter);
-	gtk_list_store_set(store, &iter,
-			   COL_CHECKED, use_defaults,
-			   COL_TITLE, acc->title,
-			   COL_SHORT_DESCRIPTION, acc->short_description,
-			   COL_LONG_DESCRIPTION, acc->long_description,
-			   COL_ACCOUNT, acc,
-			   -1);
+    gtk_list_store_append(store, &iter);
+    gtk_list_store_set(store, &iter,
+                       COL_CHECKED, use_defaults,
+                       COL_TITLE, acc->title,
+                       COL_SHORT_DESCRIPTION, acc->short_description,
+                       COL_LONG_DESCRIPTION, acc->long_description,
+                       COL_ACCOUNT, acc,
+                       -1);
 
-	if (use_defaults) {
-	  data->category_set_changed = TRUE;
-	  path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
-	  data->initial_category = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
-	  gtk_tree_path_free(path);
-	}
+    if (use_defaults)
+    {
+        data->category_set_changed = TRUE;
+        path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+        data->initial_category = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
+        gtk_tree_path_free(path);
+    }
 }
 
 static void
 category_checkbox_toggled (GtkCellRendererToggle *toggle,
-			   gchar                 *path,
-			   GtkListStore          *store)
+                           gchar                 *path,
+                           GtkListStore          *store)
 {
-	GtkTreeIter iter;
-	gboolean active;
+    GtkTreeIter iter;
+    gboolean active;
 
-	if (!gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(store),
-						 &iter, path))
-	  return;
+    if (!gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(store),
+            &iter, path))
+        return;
 
-	/* Get current state of the category */
-	active = gtk_cell_renderer_toggle_get_active(toggle);
-	gtk_list_store_set(store, &iter, COL_CHECKED, !active, -1);
+    /* Get current state of the category */
+    active = gtk_cell_renderer_toggle_get_active(toggle);
+    gtk_list_store_set(store, &iter, COL_CHECKED, !active, -1);
 }
 
 static void
 account_categories_tree_view_prepare (hierarchy_data  *data)
 {
-	GSList *list;
-	gchar *gnc_accounts_dir;
-	gchar *locale_dir;
-	GtkTreeView *tree_view;
-	GtkListStore *model;
-	GtkTreeViewColumn *column;
-	GtkCellRenderer *renderer;
-	GtkTreeSelection *selection;
-	GtkTreePath *path;
+    GSList *list;
+    gchar *gnc_accounts_dir;
+    gchar *locale_dir;
+    GtkTreeView *tree_view;
+    GtkListStore *model;
+    GtkTreeViewColumn *column;
+    GtkCellRenderer *renderer;
+    GtkTreeSelection *selection;
+    GtkTreePath *path;
 
-	gnc_accounts_dir = gnc_path_get_accountsdir ();
-	locale_dir = gnc_get_ea_locale_dir (gnc_accounts_dir);
- 	list = gnc_load_example_account_list (locale_dir);
-	g_free (gnc_accounts_dir);
-	g_free (locale_dir);
+    gnc_accounts_dir = gnc_path_get_accountsdir ();
+    locale_dir = gnc_get_ea_locale_dir (gnc_accounts_dir);
+    list = gnc_load_example_account_list (locale_dir);
+    g_free (gnc_accounts_dir);
+    g_free (locale_dir);
 
-	/* Prepare the account_categories GtkTreeView with a model and with some columns */
-	tree_view = data->categories_tree;
-	model = gtk_list_store_new(NUM_COLUMNS, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING,
-				   G_TYPE_STRING, G_TYPE_POINTER);
-	gtk_tree_view_set_model (tree_view, GTK_TREE_MODEL(model));
-	g_object_unref (model);
+    /* Prepare the account_categories GtkTreeView with a model and with some columns */
+    tree_view = data->categories_tree;
+    model = gtk_list_store_new(NUM_COLUMNS, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING,
+                               G_TYPE_STRING, G_TYPE_POINTER);
+    gtk_tree_view_set_model (tree_view, GTK_TREE_MODEL(model));
+    g_object_unref (model);
 
-	g_slist_foreach(list, (GFunc)add_one_category, data);
+    g_slist_foreach(list, (GFunc)add_one_category, data);
 
-	g_signal_connect (G_OBJECT (model), "row_changed",
-			  G_CALLBACK (categories_selection_changed),
-			  data);
+    g_signal_connect (G_OBJECT (model), "row_changed",
+                      G_CALLBACK (categories_selection_changed),
+                      data);
 
-	renderer = gtk_cell_renderer_toggle_new ();
-	g_object_set (G_OBJECT (renderer), "activatable", TRUE, NULL);
-	column = gtk_tree_view_column_new_with_attributes (_("Selected"),
-							   renderer,
-							   "active", COL_CHECKED,
-							   NULL);
-	gtk_tree_view_append_column (tree_view, column);
-	gtk_tree_view_column_set_sort_column_id (column, COL_CHECKED);
-	g_signal_connect (G_OBJECT (renderer), "toggled",
-			  G_CALLBACK (category_checkbox_toggled),
-			  model);
+    renderer = gtk_cell_renderer_toggle_new ();
+    g_object_set (G_OBJECT (renderer), "activatable", TRUE, NULL);
+    column = gtk_tree_view_column_new_with_attributes (_("Selected"),
+             renderer,
+             "active", COL_CHECKED,
+             NULL);
+    gtk_tree_view_append_column (tree_view, column);
+    gtk_tree_view_column_set_sort_column_id (column, COL_CHECKED);
+    g_signal_connect (G_OBJECT (renderer), "toggled",
+                      G_CALLBACK (category_checkbox_toggled),
+                      model);
 
 
-	renderer = gtk_cell_renderer_text_new ();
-	column = gtk_tree_view_column_new_with_attributes (_("Account Types"),
-							   renderer,
-							   "text", COL_TITLE,
-							   NULL);
-	gtk_tree_view_append_column (tree_view, column);
-	gtk_tree_view_column_set_sort_column_id (column, COL_TITLE);
+    renderer = gtk_cell_renderer_text_new ();
+    column = gtk_tree_view_column_new_with_attributes (_("Account Types"),
+             renderer,
+             "text", COL_TITLE,
+             NULL);
+    gtk_tree_view_append_column (tree_view, column);
+    gtk_tree_view_column_set_sort_column_id (column, COL_TITLE);
 
 //	renderer = gtk_cell_renderer_text_new ();
 //	column = gtk_tree_view_column_new_with_attributes (_("Description"),
@@ -421,131 +426,136 @@
 //	gtk_tree_view_append_column (tree_view, column);
 //	gtk_tree_view_column_set_sort_column_id (column, COL_SHORT_DESCRIPTION);
 
-	gtk_tree_view_set_headers_clickable(tree_view, TRUE);
-	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE(model),
-					      COL_TITLE,
-					      GTK_SORT_ASCENDING);
+    gtk_tree_view_set_headers_clickable(tree_view, TRUE);
+    gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE(model),
+                                          COL_TITLE,
+                                          GTK_SORT_ASCENDING);
 
-	if (data->initial_category) {
-	  path = gtk_tree_row_reference_get_path(data->initial_category);
-	  selection = gtk_tree_view_get_selection(tree_view);
-	  gtk_tree_view_scroll_to_cell(tree_view, path, NULL, TRUE, 0.5, 0.5);
-	  gtk_tree_selection_select_path(selection, path);
-	  gtk_tree_path_free(path);
-	}
+    if (data->initial_category)
+    {
+        path = gtk_tree_row_reference_get_path(data->initial_category);
+        selection = gtk_tree_view_get_selection(tree_view);
+        gtk_tree_view_scroll_to_cell(tree_view, path, NULL, TRUE, 0.5, 0.5);
+        gtk_tree_selection_select_path(selection, path);
+        gtk_tree_path_free(path);
+    }
 }
 
 void
 on_choose_account_categories_prepare (GnomeDruidPage  *gnomedruidpage,
-				      gpointer         arg1,
-				      hierarchy_data  *data)
+                                      gpointer         arg1,
+                                      hierarchy_data  *data)
 {
-  GtkTextBuffer* buffer;
+    GtkTextBuffer* buffer;
 
-  if (!data->account_list_added)
-  {
-    /* clear out the description/tree */
-    if (data->category_accounts_tree)
-      gtk_widget_destroy(GTK_WIDGET(data->category_accounts_tree));
-    data->category_accounts_tree = NULL;
-    buffer = gtk_text_view_get_buffer(data->category_description);
-    gtk_text_buffer_set_text(buffer, "", -1);
+    if (!data->account_list_added)
+    {
+        /* clear out the description/tree */
+        if (data->category_accounts_tree)
+            gtk_widget_destroy(GTK_WIDGET(data->category_accounts_tree));
+        data->category_accounts_tree = NULL;
+        buffer = gtk_text_view_get_buffer(data->category_description);
+        gtk_text_buffer_set_text(buffer, "", -1);
 
-    data->account_list_added = TRUE;
+        data->account_list_added = TRUE;
 
-    /* Build the categories tree if necessary */
-    gnc_suspend_gui_refresh ();
-    account_categories_tree_view_prepare (data);
-    gnc_resume_gui_refresh ();
-  }
-  categories_page_enable_next(data);
+        /* Build the categories tree if necessary */
+        gnc_suspend_gui_refresh ();
+        account_categories_tree_view_prepare (data);
+        gnc_resume_gui_refresh ();
+    }
+    categories_page_enable_next(data);
 }
 
 static void
 categories_tree_selection_changed (GtkTreeSelection *selection,
-				   hierarchy_data *data)
+                                   hierarchy_data *data)
 {
-	GtkTreeView *tree_view;
-	GtkTreeModel *model;
-	GtkTreeViewColumn *column;
-	GtkTreeIter iter;
-	GncExampleAccount *gea;
-	GtkTextBuffer* buffer;
-	gchar *text;
+    GtkTreeView *tree_view;
+    GtkTreeModel *model;
+    GtkTreeViewColumn *column;
+    GtkTreeIter iter;
+    GncExampleAccount *gea;
+    GtkTextBuffer* buffer;
+    gchar *text;
 
-	/* Remove the old account tree */
-	if (data->category_accounts_tree)
-	  gtk_widget_destroy(GTK_WIDGET(data->category_accounts_tree));
-	data->category_accounts_tree = NULL;
+    /* Remove the old account tree */
+    if (data->category_accounts_tree)
+        gtk_widget_destroy(GTK_WIDGET(data->category_accounts_tree));
+    data->category_accounts_tree = NULL;
 
-	/* Add a new one if something selected */
-	if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
-		gchar *text2;
-		gtk_tree_model_get (model, &iter, COL_ACCOUNT, &gea, -1);
-		/* Translators: '%s' is the name of the selected account hierarchy template. */
-		text2 = g_strdup_printf(_("Accounts in '%s'"), gea->title);
-		text = g_strdup_printf("<b>%s</b>", text2);
-		gtk_label_set_markup(data->category_accounts_label, text);
-		g_free(text2);
-		g_free(text);
-		buffer = gtk_text_view_get_buffer(data->category_description);
-		gtk_text_buffer_set_text(buffer, gea->long_description, -1);
+    /* Add a new one if something selected */
+    if (gtk_tree_selection_get_selected (selection, &model, &iter))
+    {
+        gchar *text2;
+        gtk_tree_model_get (model, &iter, COL_ACCOUNT, &gea, -1);
+        /* Translators: '%s' is the name of the selected account hierarchy template. */
+        text2 = g_strdup_printf(_("Accounts in '%s'"), gea->title);
+        text = g_strdup_printf("<b>%s</b>", text2);
+        gtk_label_set_markup(data->category_accounts_label, text);
+        g_free(text2);
+        g_free(text);
+        buffer = gtk_text_view_get_buffer(data->category_description);
+        gtk_text_buffer_set_text(buffer, gea->long_description, -1);
 
-		tree_view = gnc_tree_view_account_new_with_root (gea->root, FALSE);
-		/* Override the normal fixed (user settable) sizing */
-		column = gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view), 0);
-		gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+        tree_view = gnc_tree_view_account_new_with_root (gea->root, FALSE);
+        /* Override the normal fixed (user settable) sizing */
+        column = gtk_tree_view_get_column(GTK_TREE_VIEW(tree_view), 0);
+        gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
 
-		data->category_accounts_tree = tree_view;
-		gtk_tree_view_expand_all (tree_view);
-		gtk_container_add(GTK_CONTAINER(data->category_accounts_container), GTK_WIDGET(tree_view));
-		gtk_widget_show(GTK_WIDGET(tree_view));
-	} else {
-		gchar *text;
-		text = g_strdup_printf ("<b>%s</b>", _("Accounts in Category"));
-		gtk_label_set_markup(data->category_accounts_label, text);
-		g_free (text);
-		buffer = gtk_text_view_get_buffer(data->category_description);
-		gtk_text_buffer_set_text(buffer, "", -1);
-	}
+        data->category_accounts_tree = tree_view;
+        gtk_tree_view_expand_all (tree_view);
+        gtk_container_add(GTK_CONTAINER(data->category_accounts_container), GTK_WIDGET(tree_view));
+        gtk_widget_show(GTK_WIDGET(tree_view));
+    }
+    else
+    {
+        gchar *text;
+        text = g_strdup_printf ("<b>%s</b>", _("Accounts in Category"));
+        gtk_label_set_markup(data->category_accounts_label, text);
+        g_free (text);
+        buffer = gtk_text_view_get_buffer(data->category_description);
+        gtk_text_buffer_set_text(buffer, "", -1);
+    }
 }
 
 static gboolean
 select_helper (GtkListStore *store,
-	       GtkTreePath  *path,
-	       GtkTreeIter  *iter,
-	       gpointer      data)
+               GtkTreePath  *path,
+               GtkTreeIter  *iter,
+               gpointer      data)
 {
-	GncExampleAccount *gea;
+    GncExampleAccount *gea;
 
-	g_return_val_if_fail(GTK_IS_LIST_STORE(store), FALSE);
+    g_return_val_if_fail(GTK_IS_LIST_STORE(store), FALSE);
 
-	gtk_tree_model_get (GTK_TREE_MODEL(store), iter, COL_ACCOUNT, &gea, -1);
-	if ((gea != NULL) && !gea->exclude_from_select_all) {
-	  gtk_list_store_set(store, iter,
-			     COL_CHECKED, GPOINTER_TO_INT(data),
-			     -1);
-	}
+    gtk_tree_model_get (GTK_TREE_MODEL(store), iter, COL_ACCOUNT, &gea, -1);
+    if ((gea != NULL) && !gea->exclude_from_select_all)
+    {
+        gtk_list_store_set(store, iter,
+                           COL_CHECKED, GPOINTER_TO_INT(data),
+                           -1);
+    }
 
-	return FALSE;  /* Run entire tree */
+    return FALSE;  /* Run entire tree */
 }
 
 void
 select_all_clicked (GtkButton       *button,
                     hierarchy_data  *data)
 {
-	gtk_tree_model_foreach (gtk_tree_view_get_model (data->categories_tree),
-				(GtkTreeModelForeachFunc)select_helper,
-				GINT_TO_POINTER(TRUE));
+    gtk_tree_model_foreach (gtk_tree_view_get_model (data->categories_tree),
+                            (GtkTreeModelForeachFunc)select_helper,
+                            GINT_TO_POINTER(TRUE));
 }
 
 void
 clear_all_clicked (GtkButton       *button,
-		   hierarchy_data  *data)
+                   hierarchy_data  *data)
 {
-	gtk_tree_model_foreach (gtk_tree_view_get_model (data->categories_tree),
-				(GtkTreeModelForeachFunc)select_helper,
-				GINT_TO_POINTER(FALSE));
+    gtk_tree_model_foreach (gtk_tree_view_get_model (data->categories_tree),
+                            (GtkTreeModelForeachFunc)select_helper,
+                            GINT_TO_POINTER(FALSE));
 }
 
 /************************************************************
@@ -555,205 +565,213 @@
 static void
 delete_our_account_tree (hierarchy_data *data)
 {
-  if (data->our_account_tree != NULL)
-  {
-    xaccAccountBeginEdit (data->our_account_tree);
-    xaccAccountDestroy (data->our_account_tree);
-    data->our_account_tree = NULL;
-  }
+    if (data->our_account_tree != NULL)
+    {
+        xaccAccountBeginEdit (data->our_account_tree);
+        xaccAccountDestroy (data->our_account_tree);
+        data->our_account_tree = NULL;
+    }
 }
 
 static Account*
 clone_account (const Account* from, gnc_commodity *com)
 {
-  Account *ret;
+    Account *ret;
 
-  ret = xaccCloneAccountSimple (from, gnc_get_current_book ());
+    ret = xaccCloneAccountSimple (from, gnc_get_current_book ());
 
-  xaccAccountSetCommodity (ret, com);
+    xaccAccountSetCommodity (ret, com);
 
-  return ret;
+    return ret;
 }
 
 struct add_group_data_struct
 {
-  Account *to;
-  Account *parent;
-  gnc_commodity *com;
+    Account *to;
+    Account *parent;
+    gnc_commodity *com;
 };
 
 static void
 add_groups_for_each (Account *toadd, gpointer data)
 {
-  struct add_group_data_struct *dadata = data;
-  Account *foundact;
-    
-  foundact = gnc_account_lookup_by_name(dadata->to, xaccAccountGetName(toadd));
+    struct add_group_data_struct *dadata = data;
+    Account *foundact;
 
-  if (!foundact)
-  {
-    foundact = clone_account (toadd, dadata->com);
+    foundact = gnc_account_lookup_by_name(dadata->to, xaccAccountGetName(toadd));
 
-    if (dadata->to)
-      gnc_account_append_child (dadata->to, foundact);
-    else if (dadata->parent)
-      gnc_account_append_child (dadata->parent, foundact);
-    else
+    if (!foundact)
     {
-      g_warning ("add_groups_for_each: no valid parent");
+        foundact = clone_account (toadd, dadata->com);
+
+        if (dadata->to)
+            gnc_account_append_child (dadata->to, foundact);
+        else if (dadata->parent)
+            gnc_account_append_child (dadata->parent, foundact);
+        else
+        {
+            g_warning ("add_groups_for_each: no valid parent");
+        }
     }
-  }
 
-  {
-    if (gnc_account_n_children(toadd) > 0)
     {
-      struct add_group_data_struct downdata;
+        if (gnc_account_n_children(toadd) > 0)
+        {
+            struct add_group_data_struct downdata;
 
-      downdata.to = foundact;
-      downdata.parent = foundact;
-      downdata.com = dadata->com;
+            downdata.to = foundact;
+            downdata.parent = foundact;
+            downdata.com = dadata->com;
 
-      gnc_account_foreach_child (toadd, add_groups_for_each, &downdata);
+            gnc_account_foreach_child (toadd, add_groups_for_each, &downdata);
+        }
     }
-  }
 }
 
 static void
 add_new_accounts_with_random_guids (Account *into, Account *from,
                                     gnc_commodity *com)
 {
-  struct add_group_data_struct data;
-  data.to = into;
-  data.parent = NULL;
-  data.com = com;
-    
-  gnc_account_foreach_child (from, add_groups_for_each, &data);
+    struct add_group_data_struct data;
+    data.to = into;
+    data.parent = NULL;
+    data.com = com;
+
+    gnc_account_foreach_child (from, add_groups_for_each, &data);
 }
 
 static Account *
 hierarchy_merge_accounts (GSList *dalist, gnc_commodity *com)
 {
-  GSList *mark;
-  Account *ret = xaccMallocAccount (gnc_get_current_book ());
+    GSList *mark;
+    Account *ret = xaccMallocAccount (gnc_get_current_book ());
 
-  for (mark = dalist; mark; mark = mark->next)
-  {
-    GncExampleAccount *xea = mark->data;
+    for (mark = dalist; mark; mark = mark->next)
+    {
+        GncExampleAccount *xea = mark->data;
 
-    add_new_accounts_with_random_guids (ret, xea->root, com);
-  }
+        add_new_accounts_with_random_guids (ret, xea->root, com);
+    }
 
-  return ret;
+    return ret;
 }
 
 static gboolean
 accumulate_accounts (GtkListStore *store,
-		     GtkTreePath *path,
-		     GtkTreeIter *iter,
-		     GSList **list)
+                     GtkTreePath *path,
+                     GtkTreeIter *iter,
+                     GSList **list)
 {
-	GncExampleAccount *gea;
-	gboolean active;
+    GncExampleAccount *gea;
+    gboolean active;
 
-	g_return_val_if_fail(GTK_IS_LIST_STORE(store), FALSE);
- 
-	gtk_tree_model_get (GTK_TREE_MODEL(store), iter,
-			    COL_CHECKED, &active,
-			    COL_ACCOUNT, &gea,
-			    -1);
-	if (active && gea)
-	  *list = g_slist_prepend(*list, gea);
+    g_return_val_if_fail(GTK_IS_LIST_STORE(store), FALSE);
 
-  	return FALSE;  /* Run entire list */
+    gtk_tree_model_get (GTK_TREE_MODEL(store), iter,
+                        COL_CHECKED, &active,
+                        COL_ACCOUNT, &gea,
+                        -1);
+    if (active && gea)
+        *list = g_slist_prepend(*list, gea);
+
+    return FALSE;  /* Run entire list */
 }
 
 
 static GSList *
 get_selected_account_list (GtkTreeView *tree_view)
 {
-	GSList *actlist = NULL;
-	GtkTreeModel *model;
+    GSList *actlist = NULL;
+    GtkTreeModel *model;
 
-	model = gtk_tree_view_get_model (tree_view);
-	gtk_tree_model_foreach (model,
-				(GtkTreeModelForeachFunc)accumulate_accounts,
-				&actlist);
-	return actlist;
+    model = gtk_tree_view_get_model (tree_view);
+    gtk_tree_model_foreach (model,
+                            (GtkTreeModelForeachFunc)accumulate_accounts,
+                            &actlist);
+    return actlist;
 }
 
 static void
 balance_cell_data_func (GtkTreeViewColumn *tree_column,
-	       		GtkCellRenderer *cell,
-			GtkTreeModel *model,
-			GtkTreeIter *iter,
-			gpointer user_data)
+                        GtkCellRenderer *cell,
+                        GtkTreeModel *model,
+                        GtkTreeIter *iter,
+                        gpointer user_data)
 {
-	Account *account;
-	gnc_numeric balance;
-	const gchar *string;
-	GNCPrintAmountInfo print_info;
-	hierarchy_data *data = (hierarchy_data *)user_data;
-	gboolean allow_value;
+    Account *account;
+    gnc_numeric balance;
+    const gchar *string;
+    GNCPrintAmountInfo print_info;
+    hierarchy_data *data = (hierarchy_data *)user_data;
+    gboolean allow_value;
 
-	g_return_if_fail (GTK_TREE_MODEL (model));
-	account = gnc_tree_view_account_get_account_from_iter (model, iter);
+    g_return_if_fail (GTK_TREE_MODEL (model));
+    account = gnc_tree_view_account_get_account_from_iter (model, iter);
 
-	balance = get_final_balance (data->balance_hash, account);
-	if (gnc_numeric_zero_p (balance)) {
-		string = "";
-	} else {
-		print_info = gnc_account_print_info (account, FALSE);
-		string = xaccPrintAmount (balance, print_info);
-	}
+    balance = get_final_balance (data->balance_hash, account);
+    if (gnc_numeric_zero_p (balance))
+    {
+        string = "";
+    }
+    else
+    {
+        print_info = gnc_account_print_info (account, FALSE);
+        string = xaccPrintAmount (balance, print_info);
+    }
 
- 	if (xaccAccountGetType(account) == ACCT_TYPE_EQUITY ||
- 	    xaccAccountGetType(account) == ACCT_TYPE_TRADING) {
-	  allow_value = FALSE;
-	  string=_("zero");
-	} else {
-          GncAccountMergeDisposition disp;
-          disp = determine_merge_disposition(gnc_book_get_root_account(gnc_get_current_book()), account);
-          if (disp == GNC_ACCOUNT_MERGE_DISPOSITION_CREATE_NEW)
-          {
-                  allow_value = !xaccAccountGetPlaceholder(account);
-          }
-          else
-          {
-                  allow_value = FALSE;
-                  string = _("existing account");
-          }
-	}
-	g_object_set (G_OBJECT (cell),
-		      "text", string,
-		      "editable", allow_value,
-		      "sensitive", allow_value,
-		      NULL);
+    if (xaccAccountGetType(account) == ACCT_TYPE_EQUITY ||
+            xaccAccountGetType(account) == ACCT_TYPE_TRADING)
+    {
+        allow_value = FALSE;
+        string = _("zero");
+    }
+    else
+    {
+        GncAccountMergeDisposition disp;
+        disp = determine_merge_disposition(gnc_book_get_root_account(gnc_get_current_book()), account);
+        if (disp == GNC_ACCOUNT_MERGE_DISPOSITION_CREATE_NEW)
+        {
+            allow_value = !xaccAccountGetPlaceholder(account);
+        }
+        else
+        {
+            allow_value = FALSE;
+            string = _("existing account");
+        }
+    }
+    g_object_set (G_OBJECT (cell),
+                  "text", string,
+                  "editable", allow_value,
+                  "sensitive", allow_value,
+                  NULL);
 }
 
-static void 
+static void
 balance_cell_edited (GtkCellRendererText *cell,
-		     gchar               *path,
-		     gchar               *new_text,
-		     gpointer             user_data)
+                     gchar               *path,
+                     gchar               *new_text,
+                     gpointer             user_data)
 {
-	Account *account;
-	char *error_loc;
-	gnc_numeric amount;
-	hierarchy_data *data = (hierarchy_data *)user_data;
+    Account *account;
+    char *error_loc;
+    gnc_numeric amount;
+    hierarchy_data *data = (hierarchy_data *)user_data;
 
-	g_return_if_fail(data != NULL);
+    g_return_if_fail(data != NULL);
 
-	account = gnc_tree_view_account_get_selected_account(data->final_account_tree);
-	if (account == NULL) {
-      g_critical("account is null");
-      return;
-	}
+    account = gnc_tree_view_account_get_selected_account(data->final_account_tree);
+    if (account == NULL)
+    {
+        g_critical("account is null");
+        return;
+    }
 
-	error_loc = NULL;
-	if (!gnc_exp_parser_parse (new_text, &amount, &error_loc)) {
-	  amount = gnc_numeric_zero();
-	  g_object_set (G_OBJECT(cell), "text", "", NULL);
-	}
+    error_loc = NULL;
+    if (!gnc_exp_parser_parse (new_text, &amount, &error_loc))
+    {
+        amount = gnc_numeric_zero();
+        g_object_set (G_OBJECT(cell), "text", "", NULL);
+    }
     /* Bug#348364: Emulating price-cell, we need to ensure the denominator of
      * the amount is in the SCU of the account's commodity (so
      * gnc-ui-util.c:is_decimal_fraction() on the remainder denom for
@@ -763,8 +781,8 @@
         int account_cmdty_fraction = xaccAccountGetCommoditySCU(account);
         amount = gnc_numeric_convert(amount, account_cmdty_fraction, GNC_RND_ROUND);
     }
-	set_final_balance (data->balance_hash, account, amount);
-	qof_event_gen (QOF_INSTANCE(account), QOF_EVENT_MODIFY, NULL);
+    set_final_balance (data->balance_hash, account, amount);
+    qof_event_gen (QOF_INSTANCE(account), QOF_EVENT_MODIFY, NULL);
 }
 
 static void
@@ -774,31 +792,33 @@
                             GtkTreeIter *iter,
                             gpointer user_data)
 {
-	Account *account, *root;
-	gboolean willbe_placeholder = FALSE;
-        GncAccountMergeDisposition disp;
+    Account *account, *root;
+    gboolean willbe_placeholder = FALSE;
+    GncAccountMergeDisposition disp;
 
-	g_return_if_fail (GTK_TREE_MODEL (model));
-	account = gnc_tree_view_account_get_account_from_iter (model, iter);
-        root = gnc_book_get_root_account(gnc_get_current_book());
-        disp = determine_merge_disposition(root, account);
-        switch (disp)
-        {
-        case GNC_ACCOUNT_MERGE_DISPOSITION_USE_EXISTING: {
-                /* find the existing account, do whatever it is. */
-                gchar *full_name;
-                Account *existing_acct;
-                full_name = gnc_account_get_full_name(account);
-                existing_acct = gnc_account_lookup_by_full_name(root, full_name);
-                willbe_placeholder = xaccAccountGetPlaceholder(existing_acct);
-                g_free(full_name);
-        } break;
-        case GNC_ACCOUNT_MERGE_DISPOSITION_CREATE_NEW:
-                willbe_placeholder = xaccAccountGetPlaceholder(account);
-                break;
-        }
-        
-        gtk_cell_renderer_toggle_set_active(GTK_CELL_RENDERER_TOGGLE(cell), willbe_placeholder);
+    g_return_if_fail (GTK_TREE_MODEL (model));
+    account = gnc_tree_view_account_get_account_from_iter (model, iter);
+    root = gnc_book_get_root_account(gnc_get_current_book());
+    disp = determine_merge_disposition(root, account);
+    switch (disp)
+    {
+    case GNC_ACCOUNT_MERGE_DISPOSITION_USE_EXISTING:
+    {
+        /* find the existing account, do whatever it is. */
+        gchar *full_name;
+        Account *existing_acct;
+        full_name = gnc_account_get_full_name(account);
+        existing_acct = gnc_account_lookup_by_full_name(root, full_name);
+        willbe_placeholder = xaccAccountGetPlaceholder(existing_acct);
+        g_free(full_name);
+    }
+    break;
+    case GNC_ACCOUNT_MERGE_DISPOSITION_CREATE_NEW:
+        willbe_placeholder = xaccAccountGetPlaceholder(account);
+        break;
+    }
+
+    gtk_cell_renderer_toggle_set_active(GTK_CELL_RENDERER_TOGGLE(cell), willbe_placeholder);
 }
 
 
@@ -809,32 +829,32 @@
                                GtkTreeIter *iter,
                                gpointer user_data)
 {
-  Account *new_acct;
-  Account *real_root;
-  GncAccountMergeDisposition disposition;
-  char *to_user = "(error; unknown condition)";
+    Account *new_acct;
+    Account *real_root;
+    GncAccountMergeDisposition disposition;
+    char *to_user = "(error; unknown condition)";
 
-  g_return_if_fail (GTK_TREE_MODEL (tree_model));
-  new_acct = gnc_tree_view_account_get_account_from_iter(tree_model, iter);
-  if (new_acct == NULL)
-  {
-    g_object_set (G_OBJECT(cell), "text", "(null account)", NULL);
-    return;
-  }
+    g_return_if_fail (GTK_TREE_MODEL (tree_model));
+    new_acct = gnc_tree_view_account_get_account_from_iter(tree_model, iter);
+    if (new_acct == NULL)
+    {
+        g_object_set (G_OBJECT(cell), "text", "(null account)", NULL);
+        return;
+    }
 
-  real_root = gnc_book_get_root_account(gnc_get_current_book());
-  disposition = determine_merge_disposition(real_root, new_acct);
-  switch (disposition)
-  {
-  case GNC_ACCOUNT_MERGE_DISPOSITION_USE_EXISTING:
-    to_user = _("Yes");
-    break;
-  case GNC_ACCOUNT_MERGE_DISPOSITION_CREATE_NEW:
-    to_user = _("No");
-    break;
-  }
-  
-  g_object_set(G_OBJECT(cell), "text", to_user, NULL);
+    real_root = gnc_book_get_root_account(gnc_get_current_book());
+    disposition = determine_merge_disposition(real_root, new_acct);
+    switch (disposition)
+    {
+    case GNC_ACCOUNT_MERGE_DISPOSITION_USE_EXISTING:
+        to_user = _("Yes");
+        break;
+    case GNC_ACCOUNT_MERGE_DISPOSITION_CREATE_NEW:
+        to_user = _("No");
+        break;
+    }
+
+    g_object_set(G_OBJECT(cell), "text", to_user, NULL);
 }
 
 void
@@ -842,144 +862,145 @@
                           gpointer         arg1,
                           hierarchy_data  *data)
 {
-  GSList *actlist;
-  GtkTreeView *tree_view;
-  GtkTreeSelection *selection;
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
-  gnc_commodity *com;
+    GSList *actlist;
+    GtkTreeView *tree_view;
+    GtkTreeSelection *selection;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+    gnc_commodity *com;
 
-  /* Anything to do? */
-  if (!data->category_set_changed)
-    return;
-  data->category_set_changed = FALSE;
+    /* Anything to do? */
+    if (!data->category_set_changed)
+        return;
+    data->category_set_changed = FALSE;
 
-  gnc_suspend_gui_refresh ();
+    gnc_suspend_gui_refresh ();
 
-  /* Delete any existing account tree */
-  if (data->final_account_tree) {
-    gtk_widget_destroy(GTK_WIDGET(data->final_account_tree));
-    data->final_account_tree = NULL;
-  }
-  delete_our_account_tree (data);
+    /* Delete any existing account tree */
+    if (data->final_account_tree)
+    {
+        gtk_widget_destroy(GTK_WIDGET(data->final_account_tree));
+        data->final_account_tree = NULL;
+    }
+    delete_our_account_tree (data);
 
 
-  /* Build a new account list */
-  actlist = get_selected_account_list (data->categories_tree);
-  com = gnc_currency_edit_get_currency (GNC_CURRENCY_EDIT(data->currency_selector));
-  data->our_account_tree = hierarchy_merge_accounts (actlist, com);
+    /* Build a new account list */
+    actlist = get_selected_account_list (data->categories_tree);
+    com = gnc_currency_edit_get_currency (GNC_CURRENCY_EDIT(data->currency_selector));
+    data->our_account_tree = hierarchy_merge_accounts (actlist, com);
 
 
-  /* Now build a new account tree */
-  data->final_account_tree
+    /* Now build a new account tree */
+    data->final_account_tree
     = GNC_TREE_VIEW_ACCOUNT(gnc_tree_view_account_new_with_root (data->our_account_tree, FALSE));
-  tree_view = GTK_TREE_VIEW(data->final_account_tree);
-  gnc_tree_view_account_set_name_edited(data->final_account_tree,
-                                        gnc_tree_view_account_name_edited_cb);
-  gnc_tree_view_account_set_code_edited(data->final_account_tree,
-                                        gnc_tree_view_account_code_edited_cb);
-  gnc_tree_view_account_set_description_edited(data->final_account_tree,
-                                               gnc_tree_view_account_description_edited_cb);
-  gnc_tree_view_account_set_notes_edited(data->final_account_tree,
-                                         gnc_tree_view_account_notes_edited_cb);
+    tree_view = GTK_TREE_VIEW(data->final_account_tree);
+    gnc_tree_view_account_set_name_edited(data->final_account_tree,
+                                          gnc_tree_view_account_name_edited_cb);
+    gnc_tree_view_account_set_code_edited(data->final_account_tree,
+                                          gnc_tree_view_account_code_edited_cb);
+    gnc_tree_view_account_set_description_edited(data->final_account_tree,
+            gnc_tree_view_account_description_edited_cb);
+    gnc_tree_view_account_set_notes_edited(data->final_account_tree,
+                                           gnc_tree_view_account_notes_edited_cb);
 
-  gtk_tree_view_set_headers_visible (tree_view, TRUE);
-  column = gnc_tree_view_find_column_by_name (
-      GNC_TREE_VIEW(data->final_account_tree), "type");
-  g_object_set_data(G_OBJECT(column), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
-  gnc_tree_view_configure_columns (GNC_TREE_VIEW(data->final_account_tree));
-  gnc_tree_view_set_show_column_menu (GNC_TREE_VIEW(data->final_account_tree),
-				      FALSE);
+    gtk_tree_view_set_headers_visible (tree_view, TRUE);
+    column = gnc_tree_view_find_column_by_name (
+                 GNC_TREE_VIEW(data->final_account_tree), "type");
+    g_object_set_data(G_OBJECT(column), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
+    gnc_tree_view_configure_columns (GNC_TREE_VIEW(data->final_account_tree));
+    gnc_tree_view_set_show_column_menu (GNC_TREE_VIEW(data->final_account_tree),
+                                        FALSE);
 
-  selection = gtk_tree_view_get_selection (tree_view);
-  gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
+    selection = gtk_tree_view_get_selection (tree_view);
+    gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
 
-  // This is a re-definition of the placeholder that the account-tree model
-  // provides, reflecting the to-be-created state of the account tree
-  // post-merge.
-  {
-    renderer = gtk_cell_renderer_toggle_new();
-    g_object_set(G_OBJECT (renderer),
-                 "activatable", FALSE,
-                 "sensitive", FALSE,
-                 NULL);
-    column = gtk_tree_view_column_new_with_attributes(_("Placeholder"),
-                                                      renderer, NULL);
-    gtk_tree_view_column_set_cell_data_func (column, renderer, 
-                                             placeholder_cell_data_func,
-                                             (gpointer)data, NULL);
-    gnc_tree_view_append_column (GNC_TREE_VIEW(tree_view), column);
-  }
+    // This is a re-definition of the placeholder that the account-tree model
+    // provides, reflecting the to-be-created state of the account tree
+    // post-merge.
+    {
+        renderer = gtk_cell_renderer_toggle_new();
+        g_object_set(G_OBJECT (renderer),
+                     "activatable", FALSE,
+                     "sensitive", FALSE,
+                     NULL);
+        column = gtk_tree_view_column_new_with_attributes(_("Placeholder"),
+                 renderer, NULL);
+        gtk_tree_view_column_set_cell_data_func (column, renderer,
+                placeholder_cell_data_func,
+                (gpointer)data, NULL);
+        gnc_tree_view_append_column (GNC_TREE_VIEW(tree_view), column);
+    }
 
 
-  {
-    renderer = gtk_cell_renderer_text_new ();
-    g_object_set (G_OBJECT (renderer),
-                  "xalign", 1.0,
-                  (char *)NULL);
-    g_signal_connect (G_OBJECT (renderer), "edited",
-                      G_CALLBACK (balance_cell_edited),
-                      data);
-    column = gtk_tree_view_column_new_with_attributes (_("Opening Balance"),
-                                                       renderer,
-                                                       NULL);
-    gtk_tree_view_column_set_cell_data_func (column, renderer, 
-                                             balance_cell_data_func,
-                                             (gpointer)data, NULL);
-    gnc_tree_view_append_column (GNC_TREE_VIEW(tree_view), column);
-  }
+    {
+        renderer = gtk_cell_renderer_text_new ();
+        g_object_set (G_OBJECT (renderer),
+                      "xalign", 1.0,
+                      (char *)NULL);
+        g_signal_connect (G_OBJECT (renderer), "edited",
+                          G_CALLBACK (balance_cell_edited),
+                          data);
+        column = gtk_tree_view_column_new_with_attributes (_("Opening Balance"),
+                 renderer,
+                 NULL);
+        gtk_tree_view_column_set_cell_data_func (column, renderer,
+                balance_cell_data_func,
+                (gpointer)data, NULL);
+        gnc_tree_view_append_column (GNC_TREE_VIEW(tree_view), column);
+    }
 
-  // only in the case where there *are* existing accounts...
-  if (gnc_account_n_descendants(gnc_book_get_root_account(gnc_get_current_book())) > 0)
-  {
-    GList *renderers;
-    column = gnc_tree_view_add_text_column(GNC_TREE_VIEW(tree_view),
-                                           _("Use Existing"),
-                                           NULL,
-                                           NULL,
-                                           "yes",
-                                           GNC_TREE_VIEW_COLUMN_DATA_NONE,
-                                           GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS,
-                                           NULL);
-    renderers = gtk_tree_view_column_get_cell_renderers(column);
-    g_object_set(G_OBJECT(renderer), "xalign", 1.0, (char*)NULL);
-    gtk_tree_view_column_set_cell_data_func(column, GTK_CELL_RENDERER(renderers->data),
-                                            use_existing_account_data_func, (gpointer)data, NULL);
-    g_list_free(renderers);
-  }
+    // only in the case where there *are* existing accounts...
+    if (gnc_account_n_descendants(gnc_book_get_root_account(gnc_get_current_book())) > 0)
+    {
+        GList *renderers;
+        column = gnc_tree_view_add_text_column(GNC_TREE_VIEW(tree_view),
+                                               _("Use Existing"),
+                                               NULL,
+                                               NULL,
+                                               "yes",
+                                               GNC_TREE_VIEW_COLUMN_DATA_NONE,
+                                               GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS,
+                                               NULL);
+        renderers = gtk_tree_view_column_get_cell_renderers(column);
+        g_object_set(G_OBJECT(renderer), "xalign", 1.0, (char*)NULL);
+        gtk_tree_view_column_set_cell_data_func(column, GTK_CELL_RENDERER(renderers->data),
+                                                use_existing_account_data_func, (gpointer)data, NULL);
+        g_list_free(renderers);
+    }
 
-  gtk_container_add(GTK_CONTAINER(data->final_account_tree_container),
-		    GTK_WIDGET(data->final_account_tree));
+    gtk_container_add(GTK_CONTAINER(data->final_account_tree_container),
+                      GTK_WIDGET(data->final_account_tree));
 
-  /* Expand the entire tree */
-  gtk_tree_view_expand_all (tree_view);
-  gtk_widget_show(GTK_WIDGET(data->final_account_tree));
-  gnc_resume_gui_refresh ();
+    /* Expand the entire tree */
+    gtk_tree_view_expand_all (tree_view);
+    gtk_widget_show(GTK_WIDGET(data->final_account_tree));
+    gnc_resume_gui_refresh ();
 }
 
 void
 on_cancel (GnomeDruid      *gnomedruid,
-	   hierarchy_data  *data)
+           hierarchy_data  *data)
 {
-  gnc_suspend_gui_refresh ();
-  delete_hierarchy_dialog (data);
-  delete_our_account_tree (data);
-  gncp_new_user_finish ();
-  g_free(data);
-  gnc_resume_gui_refresh ();
+    gnc_suspend_gui_refresh ();
+    delete_hierarchy_dialog (data);
+    delete_our_account_tree (data);
+    gncp_new_user_finish ();
+    g_free(data);
+    gnc_resume_gui_refresh ();
 }
 
 static void
 starting_balance_helper (Account *account, hierarchy_data *data)
 {
-  gnc_numeric balance;
+    gnc_numeric balance;
 
-  balance = get_final_balance (data->balance_hash, account);
-  if (gnc_reverse_balance(account))
-    balance = gnc_numeric_neg(balance);
-  if (!gnc_numeric_zero_p (balance))
-    gnc_account_create_opening_balance (account, balance, time (NULL),
-                                        gnc_get_current_book ());
+    balance = get_final_balance (data->balance_hash, account);
+    if (gnc_reverse_balance(account))
+        balance = gnc_numeric_neg(balance);
+    if (!gnc_numeric_zero_p (balance))
+        gnc_account_create_opening_balance (account, balance, time (NULL),
+                                            gnc_get_current_book ());
 }
 
 void
@@ -987,130 +1008,131 @@
            gpointer         arg1,
            hierarchy_data  *data)
 {
-        GncHierarchyDruidFinishedCallback when_completed;
-	ENTER (" ");
+    GncHierarchyDruidFinishedCallback when_completed;
+    ENTER (" ");
 
-	if (data->our_account_tree)
-        {
-	  gnc_account_foreach_descendant (data->our_account_tree,
-					  (AccountCb)starting_balance_helper,
-					  data);
-        }
+    if (data->our_account_tree)
+    {
+        gnc_account_foreach_descendant (data->our_account_tree,
+                                        (AccountCb)starting_balance_helper,
+                                        data);
+    }
 
-        // delete before we suspend GUI events, and then muck with the model,
-        // because the model doesn't seem to handle this correctly.
-	if (data->initial_category)
-	  gtk_tree_row_reference_free(data->initial_category);
-	delete_hierarchy_dialog (data);
+    // delete before we suspend GUI events, and then muck with the model,
+    // because the model doesn't seem to handle this correctly.
+    if (data->initial_category)
+        gtk_tree_row_reference_free(data->initial_category);
+    delete_hierarchy_dialog (data);
 
-	gnc_suspend_gui_refresh ();
+    gnc_suspend_gui_refresh ();
 
-        account_trees_merge(gnc_get_current_root_account(), data->our_account_tree);
+    account_trees_merge(gnc_get_current_root_account(), data->our_account_tree);
 
-        delete_our_account_tree (data);
+    delete_our_account_tree (data);
 
-        when_completed = data->when_completed;
-	g_free(data);
-	gnc_resume_gui_refresh ();
-        if (when_completed)
-        {
-                (*when_completed)();
-        }
+    when_completed = data->when_completed;
+    g_free(data);
+    gnc_resume_gui_refresh ();
+    if (when_completed)
+    {
+        (*when_completed)();
+    }
 
-	LEAVE (" ");
+    LEAVE (" ");
 }
 
 static GtkWidget *
 gnc_create_hierarchy_druid (gboolean use_defaults, GncHierarchyDruidFinishedCallback when_completed)
 {
-	hierarchy_data *data;
-	GtkWidget *dialog;
-	GtkTreeView *tree_view;
-	GtkWidget *box, *start_page;
-	GladeXML *xml;
-	GdkColor *color;
-	
-	data = g_new0 (hierarchy_data, 1);
-	xml = gnc_glade_xml_new ("account.glade", "Hierarchy Druid");
-	
-	dialog = glade_xml_get_widget (xml, "Hierarchy Druid");
-	data->dialog = dialog;
-	
-	data->druid = glade_xml_get_widget (xml, "hierarchy_druid");
-	gnc_druid_set_colors (GNOME_DRUID (data->druid));
-	
-	start_page = glade_xml_get_widget (xml, "start_page");
-	gtk_widget_show (start_page);
-	gtk_widget_show (glade_xml_get_widget (xml, "newUserDruidFinishPage"));
-	
-	/* Currency Page */
-	data->currency_selector = gnc_currency_edit_new();
-	gnc_currency_edit_set_currency (GNC_CURRENCY_EDIT(data->currency_selector), gnc_default_currency());
-	gtk_widget_show (data->currency_selector);
-	box = glade_xml_get_widget (xml, "currency_chooser_vbox");
-	gtk_box_pack_start(GTK_BOX(box), data->currency_selector, FALSE, FALSE, 0);
+    hierarchy_data *data;
+    GtkWidget *dialog;
+    GtkTreeView *tree_view;
+    GtkWidget *box, *start_page;
+    GladeXML *xml;
+    GdkColor *color;
 
-	/* Categories Page */
-	tree_view = GTK_TREE_VIEW(glade_xml_get_widget (xml, "account_categories_tree_view"));
-	g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (tree_view)), "changed",
-			  G_CALLBACK (categories_tree_selection_changed), data);
-	gtk_tree_selection_set_mode (gtk_tree_view_get_selection (tree_view), GTK_SELECTION_SINGLE);
-	data->categories_tree = tree_view;
+    data = g_new0 (hierarchy_data, 1);
+    xml = gnc_glade_xml_new ("account.glade", "Hierarchy Druid");
 
-	data->category_accounts_label = GTK_LABEL(glade_xml_get_widget (xml, "accounts_in_category_label"));
-	data->category_accounts_container = glade_xml_get_widget (xml, "accounts_in_category");
-	data->category_description = GTK_TEXT_VIEW(glade_xml_get_widget (xml, "account_types_description"));
-	color = &GNOME_DRUID_PAGE_EDGE(start_page)->textbox_color;
-	gtk_widget_modify_base(GTK_WIDGET(data->category_description), GTK_STATE_INSENSITIVE, color);
-	
-	/* Final Accounts Page */
-	data->final_account_tree_container = glade_xml_get_widget (xml, "final_account_tree_box");
-	data->final_account_tree = NULL;
-	
-	data->balance_hash = g_hash_table_new(NULL, NULL);
-	
-	g_signal_connect (G_OBJECT(dialog), "destroy",
-			  G_CALLBACK (gnc_hierarchy_destroy_cb), data);
-	
-	glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, data);
+    dialog = glade_xml_get_widget (xml, "Hierarchy Druid");
+    data->dialog = dialog;
 
-        data->when_completed = when_completed;
-	data->use_defaults = use_defaults;
-	return dialog;
+    data->druid = glade_xml_get_widget (xml, "hierarchy_druid");
+    gnc_druid_set_colors (GNOME_DRUID (data->druid));
+
+    start_page = glade_xml_get_widget (xml, "start_page");
+    gtk_widget_show (start_page);
+    gtk_widget_show (glade_xml_get_widget (xml, "newUserDruidFinishPage"));
+
+    /* Currency Page */
+    data->currency_selector = gnc_currency_edit_new();
+    gnc_currency_edit_set_currency (GNC_CURRENCY_EDIT(data->currency_selector), gnc_default_currency());
+    gtk_widget_show (data->currency_selector);
+    box = glade_xml_get_widget (xml, "currency_chooser_vbox");
+    gtk_box_pack_start(GTK_BOX(box), data->currency_selector, FALSE, FALSE, 0);
+
+    /* Categories Page */
+    tree_view = GTK_TREE_VIEW(glade_xml_get_widget (xml, "account_categories_tree_view"));
+    g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (tree_view)), "changed",
+                      G_CALLBACK (categories_tree_selection_changed), data);
+    gtk_tree_selection_set_mode (gtk_tree_view_get_selection (tree_view), GTK_SELECTION_SINGLE);
+    data->categories_tree = tree_view;
+
+    data->category_accounts_label = GTK_LABEL(glade_xml_get_widget (xml, "accounts_in_category_label"));
+    data->category_accounts_container = glade_xml_get_widget (xml, "accounts_in_category");
+    data->category_description = GTK_TEXT_VIEW(glade_xml_get_widget (xml, "account_types_description"));
+    color = &GNOME_DRUID_PAGE_EDGE(start_page)->textbox_color;
+    gtk_widget_modify_base(GTK_WIDGET(data->category_description), GTK_STATE_INSENSITIVE, color);
+
+    /* Final Accounts Page */
+    data->final_account_tree_container = glade_xml_get_widget (xml, "final_account_tree_box");
+    data->final_account_tree = NULL;
+
+    data->balance_hash = g_hash_table_new(NULL, NULL);
+
+    g_signal_connect (G_OBJECT(dialog), "destroy",
+                      G_CALLBACK (gnc_hierarchy_destroy_cb), data);
+
+    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, data);
+
+    data->when_completed = when_completed;
+    data->use_defaults = use_defaults;
+    return dialog;
 }
 
 GtkWidget*
 gnc_ui_hierarchy_druid(gboolean use_defaults)
 {
-  return gnc_create_hierarchy_druid(use_defaults, NULL);
+    return gnc_create_hierarchy_druid(use_defaults, NULL);
 }
 
 GtkWidget*
 gnc_ui_hierarchy_druid_with_callback(gboolean use_defaults,
-				     GncHierarchyDruidFinishedCallback when_finished)
+                                     GncHierarchyDruidFinishedCallback when_finished)
 {
-  return gnc_create_hierarchy_druid(use_defaults, when_finished);
+    return gnc_create_hierarchy_druid(use_defaults, when_finished);
 }
 
 static void
 create_account_page(void)
 {
-  GncPluginPage *page;
-  page = gnc_plugin_page_account_tree_new();
-  gnc_main_window_open_page(NULL, page);
+    GncPluginPage *page;
+    page = gnc_plugin_page_account_tree_new();
+    gnc_main_window_open_page(NULL, page);
 }
 
 static void
 gnc_ui_hierarchy_druid_hook (void)
 {
-  if (gnc_gconf_get_bool(GCONF_SECTION, "show_on_new_file", NULL)) {
-    gnc_ui_hierarchy_druid_with_callback(TRUE, create_account_page);
-  }
+    if (gnc_gconf_get_bool(GCONF_SECTION, "show_on_new_file", NULL))
+    {
+        gnc_ui_hierarchy_druid_with_callback(TRUE, create_account_page);
+    }
 }
 
 void
 gnc_ui_hierarchy_druid_initialize (void)
 {
-  gnc_hook_add_dangler(HOOK_NEW_BOOK,
-		       (GFunc)gnc_ui_hierarchy_druid_hook, NULL);
+    gnc_hook_add_dangler(HOOK_NEW_BOOK,
+                         (GFunc)gnc_ui_hierarchy_druid_hook, NULL);
 }

Modified: gnucash/trunk/src/gnome/druid-loan.c
===================================================================
--- gnucash/trunk/src/gnome/druid-loan.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/druid-loan.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -97,19 +97,21 @@
 
 #define OPT_VBOX_SPACING 2
 
-enum loan_cols {
-	LOAN_COL_DATE = 0,
-	LOAN_COL_PAYMENT,
-	LOAN_COL_PRINCIPAL,
-	LOAN_COL_INTEREST,
-	NUM_LOAN_COLS
+enum loan_cols
+{
+    LOAN_COL_DATE = 0,
+    LOAN_COL_PAYMENT,
+    LOAN_COL_PRINCIPAL,
+    LOAN_COL_INTEREST,
+    NUM_LOAN_COLS
 };
 
-typedef enum {
-        CURRENT_YEAR,
-        NOW_PLUS_ONE,
-        WHOLE_LOAN,
-        CUSTOM
+typedef enum
+{
+    CURRENT_YEAR,
+    NOW_PLUS_ONE,
+    WHOLE_LOAN,
+    CUSTOM
 } REV_RANGE_OPTS;
 
 static QofLogModule log_module = GNC_MOD_SX;
@@ -129,67 +131,73 @@
  * The data relating to a single "repayment option" -- a potential
  * [sub-]transaction in the repayment.
  **/
-typedef struct RepayOptData_ {
-        gboolean enabled;
-        char *name; /* { "insurance", "pmi", "taxes", ... } */
-        char *txnMemo;
-        float amount;
-        gboolean throughEscrowP;
-        gboolean specSrcAcctP;
-        Account *to;
-        Account *from; /* If NULL { If throughEscrowP, then through escrowAcct };
+typedef struct RepayOptData_
+{
+    gboolean enabled;
+    char *name; /* { "insurance", "pmi", "taxes", ... } */
+    char *txnMemo;
+    float amount;
+    gboolean throughEscrowP;
+    gboolean specSrcAcctP;
+    Account *to;
+    Account *from; /* If NULL { If throughEscrowP, then through escrowAcct };
                         * else: undefined. */
-        GList *schedule;
+    GList *schedule;
     /* If NULL, part of repayment; otherwise: defined
      * here. */
-        GDate *startDate;
+    GDate *startDate;
 } RepayOptData;
 
 /**
  * The default repayment options data.
  **/
-typedef struct RepayOptDataDefault_ {
-        char *name;
-        char *defaultTxnMemo;
-        gboolean escrowDefault;
-        gboolean specSrcAcctDefault;
+typedef struct RepayOptDataDefault_
+{
+    char *name;
+    char *defaultTxnMemo;
+    gboolean escrowDefault;
+    gboolean specSrcAcctDefault;
 } RepayOptDataDefault;
 
-static RepayOptDataDefault REPAY_DEFAULTS[] = {
-     /* { name, default txn memo, throughEscrowP, specSrcAcctP } */
-     { N_("Taxes"),         N_("Tax Payment"),           TRUE,  FALSE },
-     { N_("Insurance"),     N_("Insurance Payment"),     TRUE,  FALSE  },
-     /* Translators: PMI stands for Private Mortgage Insurance. */
-     { N_("PMI"),           N_("PMI Payment"),           TRUE,  FALSE  },
-     { N_("Other Expense"), N_("Miscellaneous Payment"), FALSE, FALSE },
-     { NULL }
+static RepayOptDataDefault REPAY_DEFAULTS[] =
+{
+    /* { name, default txn memo, throughEscrowP, specSrcAcctP } */
+    { N_("Taxes"),         N_("Tax Payment"),           TRUE,  FALSE },
+    { N_("Insurance"),     N_("Insurance Payment"),     TRUE,  FALSE  },
+    /* Translators: PMI stands for Private Mortgage Insurance. */
+    { N_("PMI"),           N_("PMI Payment"),           TRUE,  FALSE  },
+    { N_("Other Expense"), N_("Miscellaneous Payment"), FALSE, FALSE },
+    { NULL }
 };
 
 /**
  * The UI-side storage of the repayment options.
  **/
-typedef struct RepayOptUI_ {
-        /* must be stated this way [instead of 'LoanDruidData*'] because of
-         * forward decl. */
-        struct LoanDruidData_ *ldd;
-        GtkCheckButton *optCb;
-        GtkCheckButton *escrowCb;
-        RepayOptData *optData;
+typedef struct RepayOptUI_
+{
+    /* must be stated this way [instead of 'LoanDruidData*'] because of
+     * forward decl. */
+    struct LoanDruidData_ *ldd;
+    GtkCheckButton *optCb;
+    GtkCheckButton *escrowCb;
+    RepayOptData *optData;
 } RepayOptUIData;
 
-typedef enum {
-        GNC_FIXED = 0,
-        GNC_VARIABLE,
-        GNC_VARIABLE_3_1 = GNC_VARIABLE,
-        GNC_VARIABLE_5_1,
-        GNC_VARIABLE_7_1,
-        GNC_VARIABLE_10_1,
-        /* ... FIXME */
+typedef enum
+{
+    GNC_FIXED = 0,
+    GNC_VARIABLE,
+    GNC_VARIABLE_3_1 = GNC_VARIABLE,
+    GNC_VARIABLE_5_1,
+    GNC_VARIABLE_7_1,
+    GNC_VARIABLE_10_1,
+    /* ... FIXME */
 } LoanType;
 
-typedef enum {
-        GNC_MONTHS = 0,
-        GNC_YEARS
+typedef enum
+{
+    GNC_MONTHS = 0,
+    GNC_YEARS
 } PeriodSize;
 
 /**
@@ -197,119 +205,122 @@
  * for the repayment review schedule.  numCells is an array of gnc_numerics,
  * with a length of the LoanData.revNumPmts.
  **/
-typedef struct rev_repayment_row {
-        GDate date;
-        gnc_numeric *numCells;
+typedef struct rev_repayment_row
+{
+    GDate date;
+    gnc_numeric *numCells;
 } RevRepaymentRow;
 
 /**
  * Data about a loan repayment.
  **/
-typedef struct LoanData_ {
-        Account *primaryAcct;
-        gnc_numeric principal;
-        float interestRate;
-        LoanType type;
-        GList *loan_schedule;
-        GDate *startDate;
-        GDate *varStartDate;
-        int numPer;
-        PeriodSize perSize;
-        int numMonRemain;
+typedef struct LoanData_
+{
+    Account *primaryAcct;
+    gnc_numeric principal;
+    float interestRate;
+    LoanType type;
+    GList *loan_schedule;
+    GDate *startDate;
+    GDate *varStartDate;
+    int numPer;
+    PeriodSize perSize;
+    int numMonRemain;
 
-        char *repMemo;
-        char *repAmount;
-        Account *repFromAcct;
-        Account *repPriAcct;
-        Account *repIntAcct;
-        Account *escrowAcct;
-        GList *repayment_schedule;
-        GDate *repStartDate;
+    char *repMemo;
+    char *repAmount;
+    Account *repFromAcct;
+    Account *repPriAcct;
+    Account *repIntAcct;
+    Account *escrowAcct;
+    GList *repayment_schedule;
+    GDate *repStartDate;
 
-        int repayOptCount;
-        RepayOptData **repayOpts;
+    int repayOptCount;
+    RepayOptData **repayOpts;
 
-        /* Data concerning the review of repayments. */
-        int revNumPmts;
-        int revRepayOptToColMap[ (sizeof(REPAY_DEFAULTS)
-                                  / sizeof(RepayOptDataDefault))
-                                 - 1 ];
-        GList *revSchedule;
+    /* Data concerning the review of repayments. */
+    int revNumPmts;
+    int revRepayOptToColMap[ (sizeof(REPAY_DEFAULTS)
+                              / sizeof(RepayOptDataDefault))
+                             - 1 ];
+    GList *revSchedule;
 } LoanData;
 
 /**
  * The UI-side storage of the loan druid data.
  **/
-typedef struct LoanDruidData_ {
-        GladeXML *gxml;
-        GtkWidget *dialog;
-        GnomeDruid *druid;
+typedef struct LoanDruidData_
+{
+    GladeXML *gxml;
+    GtkWidget *dialog;
+    GnomeDruid *druid;
 
-        LoanData ld;
-        /* The UI-side storage of repayment data; this is 1:1 with the array
-         * in LoanData */
-        RepayOptUIData **repayOptsUI;
+    LoanData ld;
+    /* The UI-side storage of repayment data; this is 1:1 with the array
+     * in LoanData */
+    RepayOptUIData **repayOptsUI;
 
-        /* Current index of the payment opt for multiplexing the 'payment'
-         * page. */
-        int currentIdx;
+    /* Current index of the payment opt for multiplexing the 'payment'
+     * page. */
+    int currentIdx;
 
-        /* widgets */
-        /* prm = params */
-        GtkTable      *prmTable;
-        GNCAccountSel *prmAccountGAS;
-        GNCAmountEdit *prmOrigPrincGAE;
-        GtkSpinButton *prmIrateSpin;
-        GtkComboBox   *prmType;
-        GtkFrame      *prmVarFrame;
-        GncFrequency  *prmVarGncFreq;
-        GNCDateEdit   *prmStartDateGDE;
-        GtkSpinButton *prmLengthSpin;
-        GtkComboBox   *prmLengthType;
-        GtkSpinButton *prmRemainSpin;
+    /* widgets */
+    /* prm = params */
+    GtkTable      *prmTable;
+    GNCAccountSel *prmAccountGAS;
+    GNCAmountEdit *prmOrigPrincGAE;
+    GtkSpinButton *prmIrateSpin;
+    GtkComboBox   *prmType;
+    GtkFrame      *prmVarFrame;
+    GncFrequency  *prmVarGncFreq;
+    GNCDateEdit   *prmStartDateGDE;
+    GtkSpinButton *prmLengthSpin;
+    GtkComboBox   *prmLengthType;
+    GtkSpinButton *prmRemainSpin;
 
-        /* opt = options */
-        GtkVBox        *optVBox;
-        GtkCheckButton *optEscrowCb;
-        GtkHBox        *optEscrowHBox;
-        GNCAccountSel  *optEscrowGAS;
+    /* opt = options */
+    GtkVBox        *optVBox;
+    GtkCheckButton *optEscrowCb;
+    GtkHBox        *optEscrowHBox;
+    GNCAccountSel  *optEscrowGAS;
 
-        /* rep = repayment */
-        GtkEntry      *repTxnName;
-        GtkTable      *repTable;
-        GtkEntry      *repAmtEntry;
-        GNCAccountSel *repAssetsFromGAS;
-        GNCAccountSel *repPrincToGAS;
-        GNCAccountSel *repIntToGAS;
-        GtkFrame      *repFreqFrame;
-        GncFrequency  *repGncFreq;
+    /* rep = repayment */
+    GtkEntry      *repTxnName;
+    GtkTable      *repTable;
+    GtkEntry      *repAmtEntry;
+    GNCAccountSel *repAssetsFromGAS;
+    GNCAccountSel *repPrincToGAS;
+    GNCAccountSel *repIntToGAS;
+    GtkFrame      *repFreqFrame;
+    GncFrequency  *repGncFreq;
 
-        /* pay = payment[s] */
-        GtkEntry         *payTxnName;
-        GtkEntry         *payAmtEntry;
-        GNCAccountSel    *payAcctFromGAS;
-        GNCAccountSel    *payAcctEscToGAS;
-        GNCAccountSel    *payAcctEscFromGAS;
-        GNCAccountSel    *payAcctToGAS;
-        GtkTable         *payTable;
-        GtkCheckButton   *payUseEscrow;
-        GtkCheckButton   *paySpecSrcAcct;
-        GtkLabel         *payAcctFromLabel;
-        GtkLabel         *payEscToLabel;
-        GtkLabel         *payEscFromLabel;
-        GtkRadioButton   *payTxnFreqPartRb;
-        GtkRadioButton   *payTxnFreqUniqRb;
-        GtkAlignment     *payFreqAlign;
-        GncFrequency     *payGncFreq;
+    /* pay = payment[s] */
+    GtkEntry         *payTxnName;
+    GtkEntry         *payAmtEntry;
+    GNCAccountSel    *payAcctFromGAS;
+    GNCAccountSel    *payAcctEscToGAS;
+    GNCAccountSel    *payAcctEscFromGAS;
+    GNCAccountSel    *payAcctToGAS;
+    GtkTable         *payTable;
+    GtkCheckButton   *payUseEscrow;
+    GtkCheckButton   *paySpecSrcAcct;
+    GtkLabel         *payAcctFromLabel;
+    GtkLabel         *payEscToLabel;
+    GtkLabel         *payEscFromLabel;
+    GtkRadioButton   *payTxnFreqPartRb;
+    GtkRadioButton   *payTxnFreqUniqRb;
+    GtkAlignment     *payFreqAlign;
+    GncFrequency     *payGncFreq;
 
-        /* rev = review */
-        GtkComboBox       *revRangeOpt;
-        GtkFrame          *revDateFrame;
-        GtkTable          *revTable;
-        GNCDateEdit       *revStartDate;
-        GNCDateEdit       *revEndDate;
-        GtkScrolledWindow *revScrollWin;
-        GtkTreeView       *revView;
+    /* rev = review */
+    GtkComboBox       *revRangeOpt;
+    GtkFrame          *revDateFrame;
+    GtkTable          *revTable;
+    GNCDateEdit       *revStartDate;
+    GNCDateEdit       *revEndDate;
+    GtkScrolledWindow *revScrollWin;
+    GtkTreeView       *revView;
 } LoanDruidData;
 
 /**
@@ -317,18 +328,18 @@
  **/
 typedef struct toCreateSX_
 {
-  /** The name of the SX */
-  gchar *name;
-  /** The start, last-occurred and end dates. */
-  GDate start, last, end;
-  /** The SX schedule */
-  GList *schedule;
-  /** The current 'instance-num' count. */
-  gint instNum;
-  /** The main/source transaction being created. */
-  TTInfo *mainTxn;
-  /** The optional escrow transaction being created. */
-  TTInfo *escrowTxn;
+    /** The name of the SX */
+    gchar *name;
+    /** The start, last-occurred and end dates. */
+    GDate start, last, end;
+    /** The SX schedule */
+    GList *schedule;
+    /** The current 'instance-num' count. */
+    gint instNum;
+    /** The main/source transaction being created. */
+    TTInfo *mainTxn;
+    /** The optional escrow transaction being created. */
+    TTInfo *escrowTxn;
 } toCreateSX;
 
 static void gnc_loan_druid_data_init( LoanDruidData *ldd );
@@ -364,8 +375,8 @@
                               GDate *start,
                               GDate *end );
 static void ld_rev_update_view( LoanDruidData *ldd,
-                                 GDate *start,
-                                 GDate *end );
+                                GDate *start,
+                                GDate *end );
 static void ld_rev_sched_list_free( gpointer data, gpointer user_data );
 static void ld_rev_hash_to_list( gpointer key,
                                  gpointer val,
@@ -405,518 +416,535 @@
 struct LoanDruidData_*
 gnc_ui_sx_loan_druid_create(void)
 {
-        int i;
-        LoanDruidData *ldd;
+    int i;
+    LoanDruidData *ldd;
 
-        ldd = g_new0( LoanDruidData, 1 );
+    ldd = g_new0( LoanDruidData, 1 );
 
-        gnc_loan_druid_data_init( ldd );
+    gnc_loan_druid_data_init( ldd );
 
-        ldd->gxml   = gnc_glade_xml_new( SX_GLADE_FILE, LOAN_DRUID_WIN_GLADE_NAME );
-        ldd->dialog = glade_xml_get_widget( ldd->gxml, LOAN_DRUID_WIN_GLADE_NAME );
-        ldd->druid  = GNOME_DRUID(glade_xml_get_widget( ldd->gxml,
-                                                        LOAN_DRUID_GLADE_NAME ));
-	gnc_druid_set_colors (ldd->druid);
+    ldd->gxml   = gnc_glade_xml_new( SX_GLADE_FILE, LOAN_DRUID_WIN_GLADE_NAME );
+    ldd->dialog = glade_xml_get_widget( ldd->gxml, LOAN_DRUID_WIN_GLADE_NAME );
+    ldd->druid  = GNOME_DRUID(glade_xml_get_widget( ldd->gxml,
+                              LOAN_DRUID_GLADE_NAME ));
+    gnc_druid_set_colors (ldd->druid);
 
-        /* get pointers to the various widgets */
-        gnc_loan_druid_get_widgets( ldd );
+    /* get pointers to the various widgets */
+    gnc_loan_druid_get_widgets( ldd );
 
-        /* non-gladeable widget setup */
-        {
-                int i;
-                // ACCT_TYPE_LIABILITY
-                GList *liabilityAcct;
-                // ACCT_TYPE_BANK, ACCT_TYPE_CASH, ACCT_TYPE_CREDIT,
-                // ACCT_TYPE_ASSET + ACCT_TYPE_LIABILITY
-                GList *paymentFromAccts;
-                // ACCT_TYPE_EXPENSE, ACCT_TYPE_LIABILITY, + payment-froms.
-                GList *paymentToAccts;
-                int fromLen = 5;
-                GNCAccountType paymentFroms[] = { ACCT_TYPE_BANK, ACCT_TYPE_CASH,
-						  ACCT_TYPE_CREDIT, ACCT_TYPE_ASSET,
-						  ACCT_TYPE_LIABILITY };
-                int toLen = 1;
-                GNCAccountType paymentTos[] = { ACCT_TYPE_EXPENSE };
+    /* non-gladeable widget setup */
+    {
+        int i;
+        // ACCT_TYPE_LIABILITY
+        GList *liabilityAcct;
+        // ACCT_TYPE_BANK, ACCT_TYPE_CASH, ACCT_TYPE_CREDIT,
+        // ACCT_TYPE_ASSET + ACCT_TYPE_LIABILITY
+        GList *paymentFromAccts;
+        // ACCT_TYPE_EXPENSE, ACCT_TYPE_LIABILITY, + payment-froms.
+        GList *paymentToAccts;
+        int fromLen = 5;
+        GNCAccountType paymentFroms[] = { ACCT_TYPE_BANK, ACCT_TYPE_CASH,
+                                          ACCT_TYPE_CREDIT, ACCT_TYPE_ASSET,
+                                          ACCT_TYPE_LIABILITY
+                                        };
+        int toLen = 1;
+        GNCAccountType paymentTos[] = { ACCT_TYPE_EXPENSE };
 
-                liabilityAcct = NULL;
-                paymentFromAccts = NULL;
-                paymentToAccts = NULL;
+        liabilityAcct = NULL;
+        paymentFromAccts = NULL;
+        paymentToAccts = NULL;
 
-                liabilityAcct = g_list_append( liabilityAcct,
-                                               GINT_TO_POINTER( ACCT_TYPE_LIABILITY ) );
-                for ( i = 0; i < fromLen; i++ )
-                {
-                        paymentFromAccts
-                                = g_list_append( paymentFromAccts,
-                                                 GINT_TO_POINTER( paymentFroms[i] ) );
-                        paymentToAccts
-                                = g_list_append( paymentToAccts,
-                                                 GINT_TO_POINTER( paymentFroms[i] ) );
-                }
+        liabilityAcct = g_list_append( liabilityAcct,
+                                       GINT_TO_POINTER( ACCT_TYPE_LIABILITY ) );
+        for ( i = 0; i < fromLen; i++ )
+        {
+            paymentFromAccts
+            = g_list_append( paymentFromAccts,
+                             GINT_TO_POINTER( paymentFroms[i] ) );
+            paymentToAccts
+            = g_list_append( paymentToAccts,
+                             GINT_TO_POINTER( paymentFroms[i] ) );
+        }
 
-                for ( i = 0; i < toLen; i++ )
-                {
-                        paymentToAccts = g_list_append( paymentToAccts,
-                                                        GINT_TO_POINTER( paymentTos[i] ) );
-                }
+        for ( i = 0; i < toLen; i++ )
+        {
+            paymentToAccts = g_list_append( paymentToAccts,
+                                            GINT_TO_POINTER( paymentTos[i] ) );
+        }
 
-                /* All of the GncAccountSel[ectors]... */
-                {
-                        int i;
-                        GtkAlignment *a;
-                        /* "gas" == GncAccountSel */
-                        struct gas_in_tables_data {
-                                GNCAccountSel **loc;
-                                GtkTable *table;
-                                gboolean newAcctAbility;
-                                int left, right, top, bottom;
-                                GList *allowableAccounts;
-                        } gas_data[] = {
-                                /* These ints are the GtkTable boundries */
-                                { &ldd->prmAccountGAS,     ldd->prmTable, TRUE,  1, 4, 0, 1, liabilityAcct },
-                                { &ldd->repAssetsFromGAS,  ldd->repTable, TRUE,  1, 4, 2, 3, paymentFromAccts },
-                                { &ldd->repPrincToGAS,     ldd->repTable, TRUE,  1, 2, 3, 4, paymentToAccts  },
-                                { &ldd->repIntToGAS,       ldd->repTable, TRUE,  3, 4, 3, 4, paymentToAccts },
-                                { &ldd->payAcctFromGAS,    ldd->payTable, TRUE,  1, 2, 4, 5, paymentFromAccts },
-                                { &ldd->payAcctEscToGAS,   ldd->payTable, FALSE, 3, 4, 4, 5, paymentToAccts },
-                                { &ldd->payAcctEscFromGAS, ldd->payTable, FALSE, 1, 2, 5, 6, paymentFromAccts },
-                                { &ldd->payAcctToGAS,      ldd->payTable, TRUE,  3, 4, 5, 6, paymentToAccts },
-                                { NULL }
-                        };
+        /* All of the GncAccountSel[ectors]... */
+        {
+            int i;
+            GtkAlignment *a;
+            /* "gas" == GncAccountSel */
+            struct gas_in_tables_data
+            {
+                GNCAccountSel **loc;
+                GtkTable *table;
+                gboolean newAcctAbility;
+                int left, right, top, bottom;
+                GList *allowableAccounts;
+            } gas_data[] =
+            {
+                /* These ints are the GtkTable boundries */
+                { &ldd->prmAccountGAS,     ldd->prmTable, TRUE,  1, 4, 0, 1, liabilityAcct },
+                { &ldd->repAssetsFromGAS,  ldd->repTable, TRUE,  1, 4, 2, 3, paymentFromAccts },
+                { &ldd->repPrincToGAS,     ldd->repTable, TRUE,  1, 2, 3, 4, paymentToAccts  },
+                { &ldd->repIntToGAS,       ldd->repTable, TRUE,  3, 4, 3, 4, paymentToAccts },
+                { &ldd->payAcctFromGAS,    ldd->payTable, TRUE,  1, 2, 4, 5, paymentFromAccts },
+                { &ldd->payAcctEscToGAS,   ldd->payTable, FALSE, 3, 4, 4, 5, paymentToAccts },
+                { &ldd->payAcctEscFromGAS, ldd->payTable, FALSE, 1, 2, 5, 6, paymentFromAccts },
+                { &ldd->payAcctToGAS,      ldd->payTable, TRUE,  3, 4, 5, 6, paymentToAccts },
+                { NULL }
+            };
 
-                        /* left-aligned, 25%-width */
-                        a = GTK_ALIGNMENT(gtk_alignment_new( 0.0, 0.5, 0.25, 1.0 ));
-                        ldd->prmOrigPrincGAE = GNC_AMOUNT_EDIT(gnc_amount_edit_new());
-                        gtk_container_add( GTK_CONTAINER(a), GTK_WIDGET(ldd->prmOrigPrincGAE) );
-                        gtk_table_attach( ldd->prmTable, GTK_WIDGET(a),
-                                          1, 4, 1, 2,
-                                          GTK_EXPAND | GTK_FILL,
-                                          GTK_EXPAND | GTK_FILL, 2, 2 );
+            /* left-aligned, 25%-width */
+            a = GTK_ALIGNMENT(gtk_alignment_new( 0.0, 0.5, 0.25, 1.0 ));
+            ldd->prmOrigPrincGAE = GNC_AMOUNT_EDIT(gnc_amount_edit_new());
+            gtk_container_add( GTK_CONTAINER(a), GTK_WIDGET(ldd->prmOrigPrincGAE) );
+            gtk_table_attach( ldd->prmTable, GTK_WIDGET(a),
+                              1, 4, 1, 2,
+                              GTK_EXPAND | GTK_FILL,
+                              GTK_EXPAND | GTK_FILL, 2, 2 );
 
-                        for ( i=0; gas_data[i].loc != NULL; i++ ) {
-                                GNCAccountSel *gas;
+            for ( i = 0; gas_data[i].loc != NULL; i++ )
+            {
+                GNCAccountSel *gas;
 
-                                a = GTK_ALIGNMENT(gtk_alignment_new( 0.0, 0.5, 0.25, 1.0 ));
-                                gas = GNC_ACCOUNT_SEL(gnc_account_sel_new());
-                                gnc_account_sel_set_new_account_ability(
-                                        gas, gas_data[i].newAcctAbility );
-                                if ( gas_data[i].allowableAccounts != NULL ) {
-                                        gnc_account_sel_set_acct_filters(
-                                                gas, gas_data[i].allowableAccounts, NULL );
-                                }
-                                gtk_container_add( GTK_CONTAINER(a),
-                                                   GTK_WIDGET(gas) );
-                                gtk_table_attach( gas_data[i].table,
-                                                  GTK_WIDGET(a),
-                                                  gas_data[i].left,
-                                                  gas_data[i].right,
-                                                  gas_data[i].top,
-                                                  gas_data[i].bottom,
-                                                  GTK_EXPAND | GTK_FILL,
-                                                  GTK_EXPAND | GTK_FILL, 2, 2 );
-                                *(gas_data[i].loc) = gas;
-                        }
+                a = GTK_ALIGNMENT(gtk_alignment_new( 0.0, 0.5, 0.25, 1.0 ));
+                gas = GNC_ACCOUNT_SEL(gnc_account_sel_new());
+                gnc_account_sel_set_new_account_ability(
+                    gas, gas_data[i].newAcctAbility );
+                if ( gas_data[i].allowableAccounts != NULL )
+                {
+                    gnc_account_sel_set_acct_filters(
+                        gas, gas_data[i].allowableAccounts, NULL );
                 }
+                gtk_container_add( GTK_CONTAINER(a),
+                                   GTK_WIDGET(gas) );
+                gtk_table_attach( gas_data[i].table,
+                                  GTK_WIDGET(a),
+                                  gas_data[i].left,
+                                  gas_data[i].right,
+                                  gas_data[i].top,
+                                  gas_data[i].bottom,
+                                  GTK_EXPAND | GTK_FILL,
+                                  GTK_EXPAND | GTK_FILL, 2, 2 );
+                *(gas_data[i].loc) = gas;
+            }
+        }
 
-                /* Setup the payment page always-insensitive GASes */
-                gtk_widget_set_sensitive( GTK_WIDGET(ldd->payAcctEscToGAS),   FALSE );
-                gtk_widget_set_sensitive( GTK_WIDGET(ldd->payAcctEscFromGAS), FALSE );
+        /* Setup the payment page always-insensitive GASes */
+        gtk_widget_set_sensitive( GTK_WIDGET(ldd->payAcctEscToGAS),   FALSE );
+        gtk_widget_set_sensitive( GTK_WIDGET(ldd->payAcctEscFromGAS), FALSE );
 
-                /* The GNCDateEdit[s] */
-                {
-                        /* "gde" == GNCDateEdit */
-                        struct gde_in_tables_data {
-                                GNCDateEdit **loc;
-                                GtkTable *table;
-                                int left, right, top, bottom;
-                        } gde_data[] = {
-                                /* These ints are the GtkTable boundries */
-                                { &ldd->prmStartDateGDE, ldd->prmTable, 1, 2, 4, 5 },
-                                { &ldd->revStartDate,    ldd->revTable, 1, 2, 0, 1 },
-                                { &ldd->revEndDate,      ldd->revTable, 1, 2, 1, 2 },
-                                { NULL }
-                        };
+        /* The GNCDateEdit[s] */
+        {
+            /* "gde" == GNCDateEdit */
+            struct gde_in_tables_data
+            {
+                GNCDateEdit **loc;
+                GtkTable *table;
+                int left, right, top, bottom;
+            } gde_data[] =
+            {
+                /* These ints are the GtkTable boundries */
+                { &ldd->prmStartDateGDE, ldd->prmTable, 1, 2, 4, 5 },
+                { &ldd->revStartDate,    ldd->revTable, 1, 2, 0, 1 },
+                { &ldd->revEndDate,      ldd->revTable, 1, 2, 1, 2 },
+                { NULL }
+            };
 
-                        for ( i=0; gde_data[i].loc != NULL; i++ ) {
-                                *gde_data[i].loc =
-                                        GNC_DATE_EDIT(
-                                                gnc_date_edit_new( time(NULL),
-                                                                   FALSE, FALSE ) );
-                                gtk_table_attach( gde_data[i].table,
-                                                  GTK_WIDGET( *gde_data[i].loc ),
-                                                  gde_data[i].left,
-                                                  gde_data[i].right,
-                                                  gde_data[i].top,
-                                                  gde_data[i].bottom,
-                                                  (GTK_EXPAND | GTK_FILL),
-                                                  GTK_FILL, 0, 0 );
-                        }
+            for ( i = 0; gde_data[i].loc != NULL; i++ )
+            {
+                *gde_data[i].loc =
+                    GNC_DATE_EDIT(
+                        gnc_date_edit_new( time(NULL),
+                                           FALSE, FALSE ) );
+                gtk_table_attach( gde_data[i].table,
+                                  GTK_WIDGET( *gde_data[i].loc ),
+                                  gde_data[i].left,
+                                  gde_data[i].right,
+                                  gde_data[i].top,
+                                  gde_data[i].bottom,
+                                  (GTK_EXPAND | GTK_FILL),
+                                  GTK_FILL, 0, 0 );
+            }
 
-                }
+        }
 
-                gtk_widget_set_sensitive( GTK_WIDGET(ldd->prmVarFrame), FALSE );
-                {
-                        g_signal_connect( ldd->prmType, "changed",
-                                          G_CALLBACK( ld_prm_type_changed ),
-                                          ldd );
-                }
+        gtk_widget_set_sensitive( GTK_WIDGET(ldd->prmVarFrame), FALSE );
+        {
+            g_signal_connect( ldd->prmType, "changed",
+                              G_CALLBACK( ld_prm_type_changed ),
+                              ldd );
+        }
 
-                {
-                        GtkAdjustment *a;
+        {
+            GtkAdjustment *a;
 
-                        /* 8.0 [%], range of 0.005..100.0 with ticks at 0.001[%]. */
-                        a = GTK_ADJUSTMENT(gtk_adjustment_new( 8.0, 0.001,
-                                                               100.0, 0.001,
-                                                               1.0, 1.0 ));
-                        gtk_spin_button_set_adjustment( ldd->prmIrateSpin, a );
-                        gtk_spin_button_set_value( ldd->prmIrateSpin, 8.00 );
-                        gtk_spin_button_set_snap_to_ticks( ldd->prmIrateSpin,
-                                                           TRUE );
+            /* 8.0 [%], range of 0.005..100.0 with ticks at 0.001[%]. */
+            a = GTK_ADJUSTMENT(gtk_adjustment_new( 8.0, 0.001,
+                                                   100.0, 0.001,
+                                                   1.0, 1.0 ));
+            gtk_spin_button_set_adjustment( ldd->prmIrateSpin, a );
+            gtk_spin_button_set_value( ldd->prmIrateSpin, 8.00 );
+            gtk_spin_button_set_snap_to_ticks( ldd->prmIrateSpin,
+                                               TRUE );
 
-                        a = GTK_ADJUSTMENT(gtk_adjustment_new( 360, 1,
-                                                               9999, 1,
-                                                               12, 12 ));
-                        gtk_spin_button_set_adjustment( ldd->prmLengthSpin, a );
-                        g_signal_connect( ldd->prmLengthSpin, "changed",
-                                          G_CALLBACK( ld_calc_upd_rem_payments ),
-                                          ldd );
-                        g_signal_connect( ldd->prmStartDateGDE, "date-changed",
-                                          G_CALLBACK( ld_calc_upd_rem_payments ),
-                                          ldd );
-                        g_signal_connect( ldd->prmLengthSpin, "changed",
-                                          G_CALLBACK( ld_calc_upd_rem_payments ),
-                                          ldd );
-                        g_signal_connect( ldd->prmLengthType, "changed",
-                                          G_CALLBACK( ld_calc_upd_rem_payments ),
-                                          ldd );
+            a = GTK_ADJUSTMENT(gtk_adjustment_new( 360, 1,
+                                                   9999, 1,
+                                                   12, 12 ));
+            gtk_spin_button_set_adjustment( ldd->prmLengthSpin, a );
+            g_signal_connect( ldd->prmLengthSpin, "changed",
+                              G_CALLBACK( ld_calc_upd_rem_payments ),
+                              ldd );
+            g_signal_connect( ldd->prmStartDateGDE, "date-changed",
+                              G_CALLBACK( ld_calc_upd_rem_payments ),
+                              ldd );
+            g_signal_connect( ldd->prmLengthSpin, "changed",
+                              G_CALLBACK( ld_calc_upd_rem_payments ),
+                              ldd );
+            g_signal_connect( ldd->prmLengthType, "changed",
+                              G_CALLBACK( ld_calc_upd_rem_payments ),
+                              ldd );
 
-                        a = GTK_ADJUSTMENT(gtk_adjustment_new( 360, 1,
-                                                               9999, 1,
-                                                               12, 12 ));
-                        gtk_spin_button_set_adjustment( ldd->prmRemainSpin, a );
-                }
+            a = GTK_ADJUSTMENT(gtk_adjustment_new( 360, 1,
+                                                   9999, 1,
+                                                   12, 12 ));
+            gtk_spin_button_set_adjustment( ldd->prmRemainSpin, a );
+        }
 
-                g_signal_connect( ldd->optEscrowCb, "toggled",
-                                  G_CALLBACK(ld_escrow_toggle), ldd );
-                gtk_widget_set_sensitive( GTK_WIDGET(ldd->optEscrowHBox), FALSE );
-                ldd->optEscrowGAS = GNC_ACCOUNT_SEL(gnc_account_sel_new());
-                gnc_account_sel_set_new_account_ability( ldd->optEscrowGAS, TRUE );
-                gtk_container_add( GTK_CONTAINER(ldd->optEscrowHBox),
-                                   GTK_WIDGET(ldd->optEscrowGAS) );
+        g_signal_connect( ldd->optEscrowCb, "toggled",
+                          G_CALLBACK(ld_escrow_toggle), ldd );
+        gtk_widget_set_sensitive( GTK_WIDGET(ldd->optEscrowHBox), FALSE );
+        ldd->optEscrowGAS = GNC_ACCOUNT_SEL(gnc_account_sel_new());
+        gnc_account_sel_set_new_account_ability( ldd->optEscrowGAS, TRUE );
+        gtk_container_add( GTK_CONTAINER(ldd->optEscrowHBox),
+                           GTK_WIDGET(ldd->optEscrowGAS) );
 
-                {
-                        /* . Each RepayOpt gets an "entry" in the optContainer.
-                         * . Each "entry" is a 2-line vbox containing:
-                         *   . The checkbox for the option itself
-                         *   . an alignment-contained sub-checkbox for "through the
-                         *     escrow account".
-                         *   . Hook up each to bit-twiddling the appropriate line.
-                         */
+        {
+            /* . Each RepayOpt gets an "entry" in the optContainer.
+             * . Each "entry" is a 2-line vbox containing:
+             *   . The checkbox for the option itself
+             *   . an alignment-contained sub-checkbox for "through the
+             *     escrow account".
+             *   . Hook up each to bit-twiddling the appropriate line.
+             */
 
-                        RepayOptUIData *rouid;
-                        GtkVBox *vb;
-                        GtkAlignment *optAlign, *subOptAlign;
-                        GString *str;
+            RepayOptUIData *rouid;
+            GtkVBox *vb;
+            GtkAlignment *optAlign, *subOptAlign;
+            GString *str;
 
-                        str = g_string_sized_new( 32 );
+            str = g_string_sized_new( 32 );
 
-                        for ( i=0; i<ldd->ld.repayOptCount; i++ ) {
-                                rouid = ldd->repayOptsUI[i];
-                                vb = GTK_VBOX(gtk_vbox_new( FALSE, OPT_VBOX_SPACING ));
+            for ( i = 0; i < ldd->ld.repayOptCount; i++ )
+            {
+                rouid = ldd->repayOptsUI[i];
+                vb = GTK_VBOX(gtk_vbox_new( FALSE, OPT_VBOX_SPACING ));
 
-                                /* Add payment checkbox. */
+                /* Add payment checkbox. */
 
-                                /* Translators: %s is "Taxes",
-                                 * "Insurance", or similar. */
-                                g_string_printf( str, _("... pay \"%s\"?"),
-                                                 rouid->optData->name );
-                                rouid->optCb =
-                                        GTK_CHECK_BUTTON(
-                                                gtk_check_button_new_with_label(
-                                                        str->str ));
-                                gtk_box_pack_start( GTK_BOX(vb),
-                                                    GTK_WIDGET(rouid->optCb),
-                                                    FALSE, FALSE, 2 );
-                                rouid->escrowCb =
-                                        GTK_CHECK_BUTTON(
-                                                gtk_check_button_new_with_label(
-                                                        _("via Escrow account?") ));
-                                gtk_widget_set_sensitive(
-                                        GTK_WIDGET(rouid->escrowCb),
-                                        FALSE );
-                                subOptAlign =
-                                        GTK_ALIGNMENT(
-                                                gtk_alignment_new(
-                                                        0.5, 0.5, 0.75, 1.0 ));
-                                gtk_container_add( GTK_CONTAINER(subOptAlign),
-                                                   GTK_WIDGET(rouid->escrowCb) );
-                                gtk_box_pack_start( GTK_BOX(vb), GTK_WIDGET(subOptAlign),
-                                                    FALSE, FALSE, 2 );
+                /* Translators: %s is "Taxes",
+                 * "Insurance", or similar. */
+                g_string_printf( str, _("... pay \"%s\"?"),
+                                 rouid->optData->name );
+                rouid->optCb =
+                    GTK_CHECK_BUTTON(
+                        gtk_check_button_new_with_label(
+                            str->str ));
+                gtk_box_pack_start( GTK_BOX(vb),
+                                    GTK_WIDGET(rouid->optCb),
+                                    FALSE, FALSE, 2 );
+                rouid->escrowCb =
+                    GTK_CHECK_BUTTON(
+                        gtk_check_button_new_with_label(
+                            _("via Escrow account?") ));
+                gtk_widget_set_sensitive(
+                    GTK_WIDGET(rouid->escrowCb),
+                    FALSE );
+                subOptAlign =
+                    GTK_ALIGNMENT(
+                        gtk_alignment_new(
+                            0.5, 0.5, 0.75, 1.0 ));
+                gtk_container_add( GTK_CONTAINER(subOptAlign),
+                                   GTK_WIDGET(rouid->escrowCb) );
+                gtk_box_pack_start( GTK_BOX(vb), GTK_WIDGET(subOptAlign),
+                                    FALSE, FALSE, 2 );
 
-                                g_signal_connect( rouid->optCb, "toggled",
-                                                  G_CALLBACK(ld_opt_toggled),
-                                                  rouid );
-                                g_signal_connect( rouid->optCb, "toggled",
-                                                  G_CALLBACK(ld_opt_consistency),
-                                                  rouid );
-                                g_signal_connect( rouid->escrowCb, "toggled",
-                                                  G_CALLBACK(ld_escrow_toggled),
-                                                  rouid );
+                g_signal_connect( rouid->optCb, "toggled",
+                                  G_CALLBACK(ld_opt_toggled),
+                                  rouid );
+                g_signal_connect( rouid->optCb, "toggled",
+                                  G_CALLBACK(ld_opt_consistency),
+                                  rouid );
+                g_signal_connect( rouid->escrowCb, "toggled",
+                                  G_CALLBACK(ld_escrow_toggled),
+                                  rouid );
 
-                                optAlign = GTK_ALIGNMENT(gtk_alignment_new( 0.5, 0.5, 0.75, 1.0 ));
-                                gtk_container_add( GTK_CONTAINER(optAlign),
-                                                   GTK_WIDGET(vb) );
-                                gtk_box_pack_start( GTK_BOX(ldd->optVBox), GTK_WIDGET(optAlign),
-                                                    FALSE, FALSE, 2 );
-                                gtk_widget_show_all( GTK_WIDGET(optAlign) );
-                        }
-                        g_string_free( str, TRUE );
-                }
+                optAlign = GTK_ALIGNMENT(gtk_alignment_new( 0.5, 0.5, 0.75, 1.0 ));
+                gtk_container_add( GTK_CONTAINER(optAlign),
+                                   GTK_WIDGET(vb) );
+                gtk_box_pack_start( GTK_BOX(ldd->optVBox), GTK_WIDGET(optAlign),
+                                    FALSE, FALSE, 2 );
+                gtk_widget_show_all( GTK_WIDGET(optAlign) );
+            }
+            g_string_free( str, TRUE );
+        }
 
-                g_signal_connect( ldd->payUseEscrow, "toggled",
-                                  G_CALLBACK(ld_pay_use_esc_toggle), ldd );
-                g_signal_connect( ldd->paySpecSrcAcct, "toggled",
-                                  G_CALLBACK(ld_pay_spec_src_toggle), ldd );
-                g_signal_connect( ldd->payTxnFreqPartRb, "toggled",
-                                  G_CALLBACK(ld_pay_freq_toggle), ldd );
-                g_signal_connect( ldd->payTxnFreqUniqRb, "toggled",
-                                  G_CALLBACK(ld_pay_freq_toggle), ldd );
+        g_signal_connect( ldd->payUseEscrow, "toggled",
+                          G_CALLBACK(ld_pay_use_esc_toggle), ldd );
+        g_signal_connect( ldd->paySpecSrcAcct, "toggled",
+                          G_CALLBACK(ld_pay_spec_src_toggle), ldd );
+        g_signal_connect( ldd->payTxnFreqPartRb, "toggled",
+                          G_CALLBACK(ld_pay_freq_toggle), ldd );
+        g_signal_connect( ldd->payTxnFreqUniqRb, "toggled",
+                          G_CALLBACK(ld_pay_freq_toggle), ldd );
 
-                ldd->prmVarGncFreq =
-                        GNC_FREQUENCY(gnc_frequency_new( NULL, NULL ));
-                gtk_container_add( GTK_CONTAINER(ldd->prmVarFrame),
-                                   GTK_WIDGET(ldd->prmVarGncFreq) );
+        ldd->prmVarGncFreq =
+            GNC_FREQUENCY(gnc_frequency_new( NULL, NULL ));
+        gtk_container_add( GTK_CONTAINER(ldd->prmVarFrame),
+                           GTK_WIDGET(ldd->prmVarGncFreq) );
 
-                ldd->repGncFreq =
-                        GNC_FREQUENCY(gnc_frequency_new( NULL, NULL ));
-                gtk_container_add( GTK_CONTAINER(ldd->repFreqFrame),
-                                   GTK_WIDGET(ldd->repGncFreq) );
+        ldd->repGncFreq =
+            GNC_FREQUENCY(gnc_frequency_new( NULL, NULL ));
+        gtk_container_add( GTK_CONTAINER(ldd->repFreqFrame),
+                           GTK_WIDGET(ldd->repGncFreq) );
 
-                ldd->payGncFreq =
-                        GNC_FREQUENCY(gnc_frequency_new( NULL, NULL ));
-                gtk_container_add( GTK_CONTAINER(ldd->payFreqAlign),
-                                   GTK_WIDGET(ldd->payGncFreq) );
-        }
+        ldd->payGncFreq =
+            GNC_FREQUENCY(gnc_frequency_new( NULL, NULL ));
+        gtk_container_add( GTK_CONTAINER(ldd->payFreqAlign),
+                           GTK_WIDGET(ldd->payGncFreq) );
+    }
 
-        /* Review page widget setup. */
+    /* Review page widget setup. */
+    {
+        gtk_combo_box_set_active( ldd->revRangeOpt, 0 );
+        g_signal_connect( ldd->revRangeOpt, "changed",
+                          G_CALLBACK( ld_rev_range_opt_changed ),
+                          ldd );
+        g_signal_connect( ldd->revStartDate, "date-changed",
+                          G_CALLBACK( ld_rev_range_changed ),
+                          ldd );
+        g_signal_connect( ldd->revEndDate, "date-changed",
+                          G_CALLBACK( ld_rev_range_changed ),
+                          ldd );
+    }
+
+    {
+        static struct
         {
-		gtk_combo_box_set_active( ldd->revRangeOpt, 0 );
-                g_signal_connect( ldd->revRangeOpt, "changed",
-                                  G_CALLBACK( ld_rev_range_opt_changed ),
-                                  ldd );
-                g_signal_connect( ldd->revStartDate, "date-changed",
-                                  G_CALLBACK( ld_rev_range_changed ),
-                                  ldd );
-                g_signal_connect( ldd->revEndDate, "date-changed",
-                                  G_CALLBACK( ld_rev_range_changed ),
-                                  ldd );
-        }
+            char *pageName;
+            gboolean (*nextFn)();
+            void     (*prepFn)();
+            gboolean (*backFn)();
+            void     (*finishFn)();
+            /* cancel is handled by the druid itself. */
+        } DRUID_HANDLERS[] =
+        {
+            { PG_INFO,      ld_info_save, ld_info_prep, ld_info_save, NULL },
+            { PG_OPTS,      ld_opts_tran, ld_opts_prep, ld_opts_tran, NULL },
+            { PG_REPAYMENT, ld_rep_next,  ld_rep_prep,  ld_rep_back,  NULL },
+            { PG_PAYMENT,   ld_pay_next,  ld_pay_prep,  ld_pay_back,  NULL },
+            { PG_REVIEW,    ld_rev_next,  ld_rev_prep,  ld_rev_back,  NULL },
+            { PG_COMMIT,    ld_com_next,  ld_com_prep,  ld_com_back,  ld_com_fin },
+            { NULL }
+        };
 
+        /* setup page-transition handlers */
+        /* setup druid-global handler for cancel */
+        g_signal_connect( ldd->druid, "cancel",
+                          G_CALLBACK(ld_cancel_check), ldd );
+        /* FIXME: this is substantially similar to the code in
+         * dialog-sxsincelast.c ... it should probably be factored out
+         * somewhere. */
+        for ( i = 0; DRUID_HANDLERS[i].pageName != NULL; i++ )
         {
-                static struct {
-                        char *pageName;
-                        gboolean (*nextFn)();
-                        void     (*prepFn)();
-                        gboolean (*backFn)();
-                        void     (*finishFn)();
-                        /* cancel is handled by the druid itself. */
-                } DRUID_HANDLERS[] = {
-                        { PG_INFO,      ld_info_save, ld_info_prep, ld_info_save, NULL },
-                        { PG_OPTS,      ld_opts_tran, ld_opts_prep, ld_opts_tran, NULL },
-                        { PG_REPAYMENT, ld_rep_next,  ld_rep_prep,  ld_rep_back,  NULL },
-                        { PG_PAYMENT,   ld_pay_next,  ld_pay_prep,  ld_pay_back,  NULL },
-                        { PG_REVIEW,    ld_rev_next,  ld_rev_prep,  ld_rev_back,  NULL },
-                        { PG_COMMIT,    ld_com_next,  ld_com_prep,  ld_com_back,  ld_com_fin },
-                        { NULL }
-                };
+            GtkWidget *pg;
 
-                /* setup page-transition handlers */
-                /* setup druid-global handler for cancel */
-                g_signal_connect( ldd->druid, "cancel",
-                                  G_CALLBACK(ld_cancel_check), ldd );
-                /* FIXME: this is substantially similar to the code in
-                 * dialog-sxsincelast.c ... it should probably be factored out
-                 * somewhere. */
-                for ( i=0; DRUID_HANDLERS[i].pageName != NULL; i++ ) {
-                        GtkWidget *pg;
-
-                        pg = glade_xml_get_widget( ldd->gxml,
-                                                   DRUID_HANDLERS[i].pageName );
-                        if ( DRUID_HANDLERS[i].prepFn ) {
-                                g_signal_connect( pg, "prepare",
-                                                  G_CALLBACK(DRUID_HANDLERS[i].
-                                                             prepFn),
-                                                  ldd);
-                        }
-                        if ( DRUID_HANDLERS[i].backFn ) {
-                                g_signal_connect( pg, "back",
-                                                  G_CALLBACK(DRUID_HANDLERS[i].
-                                                             backFn),
-                                                  ldd);
-                        }
-                        if ( DRUID_HANDLERS[i].nextFn ) {
-                                g_signal_connect( pg, "next",
-                                                  G_CALLBACK(DRUID_HANDLERS[i].
-                                                             nextFn),
-                                                  ldd);
-                        }
-                        if ( DRUID_HANDLERS[i].finishFn ) {
-                                g_signal_connect( pg, "finish",
-                                                  G_CALLBACK(DRUID_HANDLERS[i].
-                                                             finishFn),
-                                                  ldd);
-                        }
-                }
+            pg = glade_xml_get_widget( ldd->gxml,
+                                       DRUID_HANDLERS[i].pageName );
+            if ( DRUID_HANDLERS[i].prepFn )
+            {
+                g_signal_connect( pg, "prepare",
+                                  G_CALLBACK(DRUID_HANDLERS[i].
+                                             prepFn),
+                                  ldd);
+            }
+            if ( DRUID_HANDLERS[i].backFn )
+            {
+                g_signal_connect( pg, "back",
+                                  G_CALLBACK(DRUID_HANDLERS[i].
+                                             backFn),
+                                  ldd);
+            }
+            if ( DRUID_HANDLERS[i].nextFn )
+            {
+                g_signal_connect( pg, "next",
+                                  G_CALLBACK(DRUID_HANDLERS[i].
+                                             nextFn),
+                                  ldd);
+            }
+            if ( DRUID_HANDLERS[i].finishFn )
+            {
+                g_signal_connect( pg, "finish",
+                                  G_CALLBACK(DRUID_HANDLERS[i].
+                                             finishFn),
+                                  ldd);
+            }
         }
+    }
 
-        gnc_register_gui_component( DIALOG_LOAN_DRUID_CM_CLASS,
-                                    NULL, /* no refresh handler */
-                                    (GNCComponentCloseHandler)ld_close_handler,
-                                    ldd );
+    gnc_register_gui_component( DIALOG_LOAN_DRUID_CM_CLASS,
+                                NULL, /* no refresh handler */
+                                (GNCComponentCloseHandler)ld_close_handler,
+                                ldd );
 
-        g_signal_connect( ldd->dialog, "destroy",
-                          G_CALLBACK(ld_destroy),
-                          ldd );
+    g_signal_connect( ldd->dialog, "destroy",
+                      G_CALLBACK(ld_destroy),
+                      ldd );
 
-        gtk_widget_show_all( ldd->dialog );
-        return ldd;
+    gtk_widget_show_all( ldd->dialog );
+    return ldd;
 }
 
 static
 void
 gnc_loan_druid_data_init( LoanDruidData *ldd )
 {
-        int i, optCount;
-        RepayOptData *optData;
+    int i, optCount;
+    RepayOptData *optData;
 
-        /* get the count of repayment defaults. */
-        for ( optCount=0; REPAY_DEFAULTS[optCount].name != NULL; optCount++ )
-                ;
+    /* get the count of repayment defaults. */
+    for ( optCount = 0; REPAY_DEFAULTS[optCount].name != NULL; optCount++ )
+        ;
 
-        ldd->currentIdx = -1;
+    ldd->currentIdx = -1;
 
-        ldd->ld.principal = gnc_numeric_zero();
-        ldd->ld.startDate = g_date_new();
-        ldd->ld.varStartDate = g_date_new();
-        g_date_set_time_t( ldd->ld.startDate, time(NULL) );
-        ldd->ld.loan_schedule= NULL;
-        ldd->ld.repayment_schedule = NULL;
-        {
-                Recurrence *r = g_new0(Recurrence, 1);
-                recurrenceSet(r, 1, PERIOD_MONTH, ldd->ld.startDate, WEEKEND_ADJ_NONE);
-                ldd->ld.repayment_schedule = g_list_append(ldd->ld.repayment_schedule, r);
-        }
+    ldd->ld.principal = gnc_numeric_zero();
+    ldd->ld.startDate = g_date_new();
+    ldd->ld.varStartDate = g_date_new();
+    g_date_set_time_t( ldd->ld.startDate, time(NULL) );
+    ldd->ld.loan_schedule = NULL;
+    ldd->ld.repayment_schedule = NULL;
+    {
+        Recurrence *r = g_new0(Recurrence, 1);
+        recurrenceSet(r, 1, PERIOD_MONTH, ldd->ld.startDate, WEEKEND_ADJ_NONE);
+        ldd->ld.repayment_schedule = g_list_append(ldd->ld.repayment_schedule, r);
+    }
 
-        ldd->ld.repMemo = g_strdup( _("Loan") );
-        ldd->ld.repAmount = NULL;
-        ldd->ld.repStartDate = g_date_new();
-        ldd->ld.repayOptCount = optCount;
-        ldd->ld.repayOpts = g_new0( RepayOptData*, optCount );
-        /* copy all the default lines into the LDD */
-        ldd->repayOptsUI = g_new0( RepayOptUIData*, optCount );
-        for ( i=0; i < optCount; i++ ) {
-                g_assert( REPAY_DEFAULTS[i].name != NULL );
+    ldd->ld.repMemo = g_strdup( _("Loan") );
+    ldd->ld.repAmount = NULL;
+    ldd->ld.repStartDate = g_date_new();
+    ldd->ld.repayOptCount = optCount;
+    ldd->ld.repayOpts = g_new0( RepayOptData*, optCount );
+    /* copy all the default lines into the LDD */
+    ldd->repayOptsUI = g_new0( RepayOptUIData*, optCount );
+    for ( i = 0; i < optCount; i++ )
+    {
+        g_assert( REPAY_DEFAULTS[i].name != NULL );
 
-                ldd->repayOptsUI[i] = g_new0( RepayOptUIData, 1 );
-                ldd->repayOptsUI[i]->ldd = ldd;
+        ldd->repayOptsUI[i] = g_new0( RepayOptUIData, 1 );
+        ldd->repayOptsUI[i]->ldd = ldd;
 
-                optData = ldd->ld.repayOpts[i]
-                        = ldd->repayOptsUI[i]->optData
-                        = g_new0( RepayOptData, 1 );
+        optData = ldd->ld.repayOpts[i]
+                  = ldd->repayOptsUI[i]->optData
+                    = g_new0( RepayOptData, 1 );
 
-                optData->enabled        = FALSE;
-                optData->name           = g_strdup( _(REPAY_DEFAULTS[i].name) );
-                optData->txnMemo        = g_strdup( _(REPAY_DEFAULTS[i].
-                                                      defaultTxnMemo) );
-                optData->amount         = 0.0;
-                optData->throughEscrowP = REPAY_DEFAULTS[i].escrowDefault;
-                optData->specSrcAcctP   = REPAY_DEFAULTS[i].specSrcAcctDefault;
-                optData->schedule       = NULL;
-                optData->startDate      = NULL;
-        }
+        optData->enabled        = FALSE;
+        optData->name           = g_strdup( _(REPAY_DEFAULTS[i].name) );
+        optData->txnMemo        = g_strdup( _(REPAY_DEFAULTS[i].
+                                              defaultTxnMemo) );
+        optData->amount         = 0.0;
+        optData->throughEscrowP = REPAY_DEFAULTS[i].escrowDefault;
+        optData->specSrcAcctP   = REPAY_DEFAULTS[i].specSrcAcctDefault;
+        optData->schedule       = NULL;
+        optData->startDate      = NULL;
+    }
 }
 
 static
 void
 gnc_loan_druid_get_widgets( LoanDruidData *ldd )
 {
-        g_assert( ldd != NULL );
-        g_assert( ldd->gxml != NULL );
+    g_assert( ldd != NULL );
+    g_assert( ldd->gxml != NULL );
 
-        /* Get all widgets */
+    /* Get all widgets */
 #define GET_CASTED_WIDGET( cast, name ) \
         (cast( glade_xml_get_widget( ldd->gxml, name ) ))
 
-        /* prm = params */
-        ldd->prmTable =
-                GET_CASTED_WIDGET( GTK_TABLE,          PARAM_TABLE );
-        ldd->prmIrateSpin =
-                GET_CASTED_WIDGET( GTK_SPIN_BUTTON,    IRATE_SPIN );
-        ldd->prmType =
-                GET_CASTED_WIDGET( GTK_COMBO_BOX,      TYPE_COMBOBOX );
-        ldd->prmVarFrame =
-                GET_CASTED_WIDGET( GTK_FRAME,          VAR_CONTAINER );
-        /* ldd->prmStartDateGDE */
-        ldd->prmLengthSpin =
-                GET_CASTED_WIDGET( GTK_SPIN_BUTTON,    LENGTH_SPIN );
-        ldd->prmLengthType =
-                GET_CASTED_WIDGET( GTK_COMBO_BOX,      LENGTH_OPT );
-        ldd->prmRemainSpin =
-                GET_CASTED_WIDGET( GTK_SPIN_BUTTON,    REMAIN_SPIN );
+    /* prm = params */
+    ldd->prmTable =
+        GET_CASTED_WIDGET( GTK_TABLE,          PARAM_TABLE );
+    ldd->prmIrateSpin =
+        GET_CASTED_WIDGET( GTK_SPIN_BUTTON,    IRATE_SPIN );
+    ldd->prmType =
+        GET_CASTED_WIDGET( GTK_COMBO_BOX,      TYPE_COMBOBOX );
+    ldd->prmVarFrame =
+        GET_CASTED_WIDGET( GTK_FRAME,          VAR_CONTAINER );
+    /* ldd->prmStartDateGDE */
+    ldd->prmLengthSpin =
+        GET_CASTED_WIDGET( GTK_SPIN_BUTTON,    LENGTH_SPIN );
+    ldd->prmLengthType =
+        GET_CASTED_WIDGET( GTK_COMBO_BOX,      LENGTH_OPT );
+    ldd->prmRemainSpin =
+        GET_CASTED_WIDGET( GTK_SPIN_BUTTON,    REMAIN_SPIN );
 
-        /* opt = options */
-        ldd->optVBox =
-                GET_CASTED_WIDGET( GTK_VBOX,           OPT_CONTAINER );
-        ldd->optEscrowCb =
-                GET_CASTED_WIDGET( GTK_CHECK_BUTTON,   OPT_ESCROW );
-        ldd->optEscrowHBox =
-                GET_CASTED_WIDGET( GTK_HBOX,           OPT_ESCROW_CONTAINER );
+    /* opt = options */
+    ldd->optVBox =
+        GET_CASTED_WIDGET( GTK_VBOX,           OPT_CONTAINER );
+    ldd->optEscrowCb =
+        GET_CASTED_WIDGET( GTK_CHECK_BUTTON,   OPT_ESCROW );
+    ldd->optEscrowHBox =
+        GET_CASTED_WIDGET( GTK_HBOX,           OPT_ESCROW_CONTAINER );
 
-        /* rep = repayment */
-        ldd->repTxnName =
-                GET_CASTED_WIDGET( GTK_ENTRY,          TXN_NAME );
-        ldd->repTable =
-                GET_CASTED_WIDGET( GTK_TABLE,          REPAY_TABLE );
-        ldd->repAmtEntry =
-                GET_CASTED_WIDGET( GTK_ENTRY,          AMOUNT_ENTRY );
-        ldd->repFreqFrame =
-                GET_CASTED_WIDGET( GTK_FRAME,          FREQ_CONTAINER );
+    /* rep = repayment */
+    ldd->repTxnName =
+        GET_CASTED_WIDGET( GTK_ENTRY,          TXN_NAME );
+    ldd->repTable =
+        GET_CASTED_WIDGET( GTK_TABLE,          REPAY_TABLE );
+    ldd->repAmtEntry =
+        GET_CASTED_WIDGET( GTK_ENTRY,          AMOUNT_ENTRY );
+    ldd->repFreqFrame =
+        GET_CASTED_WIDGET( GTK_FRAME,          FREQ_CONTAINER );
 
-        /* pay = payment[s] */
-        ldd->payTxnName =
-                GET_CASTED_WIDGET( GTK_ENTRY,          PAY_TXN_TITLE );
-        ldd->payAmtEntry =
-                GET_CASTED_WIDGET( GTK_ENTRY,          PAY_AMT_ENTRY );
-        ldd->payTable =
-                GET_CASTED_WIDGET( GTK_TABLE,          PAY_TABLE );
-        ldd->payUseEscrow =
-                GET_CASTED_WIDGET( GTK_CHECK_BUTTON,   PAY_USE_ESCROW );
-        ldd->paySpecSrcAcct =
-                GET_CASTED_WIDGET( GTK_CHECK_BUTTON,   PAY_SPEC_SRC_ACCT );
-        ldd->payAcctFromLabel =
-                GET_CASTED_WIDGET( GTK_LABEL,          PAY_FROM_ACCT_LBL );
-        ldd->payEscToLabel =
-                GET_CASTED_WIDGET( GTK_LABEL,          PAY_ESC_TO_LBL );
-        ldd->payEscFromLabel =
-                GET_CASTED_WIDGET( GTK_LABEL,          PAY_ESC_FROM_LBL );
-        ldd->payTxnFreqPartRb =
-                GET_CASTED_WIDGET( GTK_RADIO_BUTTON,   PAY_TXN_PART_RB );
-        ldd->payTxnFreqUniqRb =
-                GET_CASTED_WIDGET( GTK_RADIO_BUTTON,   PAY_UNIQ_FREQ_RB );
-        ldd->payFreqAlign =
-                GET_CASTED_WIDGET( GTK_ALIGNMENT,      PAY_FREQ_CONTAINER );
+    /* pay = payment[s] */
+    ldd->payTxnName =
+        GET_CASTED_WIDGET( GTK_ENTRY,          PAY_TXN_TITLE );
+    ldd->payAmtEntry =
+        GET_CASTED_WIDGET( GTK_ENTRY,          PAY_AMT_ENTRY );
+    ldd->payTable =
+        GET_CASTED_WIDGET( GTK_TABLE,          PAY_TABLE );
+    ldd->payUseEscrow =
+        GET_CASTED_WIDGET( GTK_CHECK_BUTTON,   PAY_USE_ESCROW );
+    ldd->paySpecSrcAcct =
+        GET_CASTED_WIDGET( GTK_CHECK_BUTTON,   PAY_SPEC_SRC_ACCT );
+    ldd->payAcctFromLabel =
+        GET_CASTED_WIDGET( GTK_LABEL,          PAY_FROM_ACCT_LBL );
+    ldd->payEscToLabel =
+        GET_CASTED_WIDGET( GTK_LABEL,          PAY_ESC_TO_LBL );
+    ldd->payEscFromLabel =
+        GET_CASTED_WIDGET( GTK_LABEL,          PAY_ESC_FROM_LBL );
+    ldd->payTxnFreqPartRb =
+        GET_CASTED_WIDGET( GTK_RADIO_BUTTON,   PAY_TXN_PART_RB );
+    ldd->payTxnFreqUniqRb =
+        GET_CASTED_WIDGET( GTK_RADIO_BUTTON,   PAY_UNIQ_FREQ_RB );
+    ldd->payFreqAlign =
+        GET_CASTED_WIDGET( GTK_ALIGNMENT,      PAY_FREQ_CONTAINER );
 
-        /* rev = review */
-        ldd->revRangeOpt =
-                GET_CASTED_WIDGET( GTK_COMBO_BOX,      REV_RANGE_OPT );
-        ldd->revDateFrame =
-                GET_CASTED_WIDGET( GTK_FRAME,          REV_DATE_FRAME );
-        ldd->revTable =
-                GET_CASTED_WIDGET( GTK_TABLE,          REV_RANGE_TABLE );
-        /* GNCDateEdit       *revStartDate */
-        /* GNCDateEdit       *revEndDate   */
-        ldd->revScrollWin =
-                GET_CASTED_WIDGET( GTK_SCROLLED_WINDOW, REV_SCROLLWIN );
+    /* rev = review */
+    ldd->revRangeOpt =
+        GET_CASTED_WIDGET( GTK_COMBO_BOX,      REV_RANGE_OPT );
+    ldd->revDateFrame =
+        GET_CASTED_WIDGET( GTK_FRAME,          REV_DATE_FRAME );
+    ldd->revTable =
+        GET_CASTED_WIDGET( GTK_TABLE,          REV_RANGE_TABLE );
+    /* GNCDateEdit       *revStartDate */
+    /* GNCDateEdit       *revEndDate   */
+    ldd->revScrollWin =
+        GET_CASTED_WIDGET( GTK_SCROLLED_WINDOW, REV_SCROLLWIN );
 
 }
 
@@ -924,115 +952,117 @@
 void
 ld_get_pmt_formula( LoanDruidData *ldd, GString *gstr )
 {
-        g_assert( ldd != NULL );
-        g_assert( gstr != NULL );
-        g_string_append_printf( gstr, "pmt( %.5f / %0.2f : %0.2f : %0.2f : 0 : 0 )",
-                                (ldd->ld.interestRate / 100),
-                                12.0,
-                                ( ldd->ld.numPer
-                                  * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) ) * 1.,
-                                gnc_numeric_to_double(ldd->ld.principal) );
+    g_assert( ldd != NULL );
+    g_assert( gstr != NULL );
+    g_string_append_printf( gstr, "pmt( %.5f / %0.2f : %0.2f : %0.2f : 0 : 0 )",
+                            (ldd->ld.interestRate / 100),
+                            12.0,
+                            ( ldd->ld.numPer
+                              * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) ) * 1.,
+                            gnc_numeric_to_double(ldd->ld.principal) );
 }
 
 static
 void
 ld_get_ppmt_formula( LoanDruidData *ldd, GString *gstr )
 {
-        g_assert( ldd != NULL );
-        g_assert( gstr != NULL );
-        g_string_printf( gstr, "ppmt( %.5f / %0.2f : i : %0.2f : %0.2f : 0 : 0 )",
-                         (ldd->ld.interestRate / 100),
-                         12.0,
-                         ( ldd->ld.numPer
-                           * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) ) * 1.,
-                         gnc_numeric_to_double(ldd->ld.principal));
+    g_assert( ldd != NULL );
+    g_assert( gstr != NULL );
+    g_string_printf( gstr, "ppmt( %.5f / %0.2f : i : %0.2f : %0.2f : 0 : 0 )",
+                     (ldd->ld.interestRate / 100),
+                     12.0,
+                     ( ldd->ld.numPer
+                       * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) ) * 1.,
+                     gnc_numeric_to_double(ldd->ld.principal));
 }
 
 static
 void
 ld_get_ipmt_formula( LoanDruidData *ldd, GString *gstr )
 {
-        g_assert( ldd != NULL );
-        g_assert( gstr != NULL );
-        g_string_printf( gstr, "ipmt( %.5f / %0.2f : i : %0.2f : %0.2f : 0 : 0 )",
-                         (ldd->ld.interestRate / 100),
-                         12.0,
-                         ( ldd->ld.numPer
-                           * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) ) * 1.,
-                         gnc_numeric_to_double( ldd->ld.principal ) );
+    g_assert( ldd != NULL );
+    g_assert( gstr != NULL );
+    g_string_printf( gstr, "ipmt( %.5f / %0.2f : i : %0.2f : %0.2f : 0 : 0 )",
+                     (ldd->ld.interestRate / 100),
+                     12.0,
+                     ( ldd->ld.numPer
+                       * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) ) * 1.,
+                     gnc_numeric_to_double( ldd->ld.principal ) );
 }
 
 static
 void
 ld_close_handler( LoanDruidData *ldd )
 {
-        gtk_widget_hide( ldd->dialog );
-        gtk_widget_destroy( ldd->dialog );
+    gtk_widget_hide( ldd->dialog );
+    gtk_widget_destroy( ldd->dialog );
 }
 
 static
 void
 ld_destroy( GtkObject *o, gpointer ud )
 {
-        LoanDruidData *ldd;
+    LoanDruidData *ldd;
 
-        ldd = (LoanDruidData*)ud;
+    ldd = (LoanDruidData*)ud;
 
-        g_assert( ldd );
+    g_assert( ldd );
 
-        gnc_unregister_gui_component_by_data
-          (DIALOG_LOAN_DRUID_CM_CLASS, ldd);
+    gnc_unregister_gui_component_by_data
+    (DIALOG_LOAN_DRUID_CM_CLASS, ldd);
 
-        /* free alloc'd mem; cleanup */
+    /* free alloc'd mem; cleanup */
 
-        /* repay opts */
-        {
-                int i;
+    /* repay opts */
+    {
+        int i;
 
-                g_date_free( ldd->ld.startDate );
-                g_date_free( ldd->ld.varStartDate );
-                recurrenceListFree(&ldd->ld.loan_schedule);
+        g_date_free( ldd->ld.startDate );
+        g_date_free( ldd->ld.varStartDate );
+        recurrenceListFree(&ldd->ld.loan_schedule);
 
-                if ( ldd->ld.repMemo )
-                        g_free( ldd->ld.repMemo );
+        if ( ldd->ld.repMemo )
+            g_free( ldd->ld.repMemo );
 
-                for ( i=0; i<ldd->ld.repayOptCount; i++ ) {
-                        RepayOptData *rod = ldd->ld.repayOpts[i];
-                        if ( rod->name )
-                                g_free( rod->name );
-                        if ( rod->txnMemo )
-                                g_free( rod->txnMemo );
+        for ( i = 0; i < ldd->ld.repayOptCount; i++ )
+        {
+            RepayOptData *rod = ldd->ld.repayOpts[i];
+            if ( rod->name )
+                g_free( rod->name );
+            if ( rod->txnMemo )
+                g_free( rod->txnMemo );
 
-                        if ( rod->startDate )
-                                g_date_free( rod->startDate );
+            if ( rod->startDate )
+                g_date_free( rod->startDate );
 
-                        if (rod->schedule != NULL)
-                                recurrenceListFree(&rod->schedule);
+            if (rod->schedule != NULL)
+                recurrenceListFree(&rod->schedule);
 
-                        g_free( ldd->ld.repayOpts[i] );
-                        g_free( ldd->repayOptsUI[i] );
-                }
-                g_free( ldd->ld.repayOpts );
-                g_free( ldd->repayOptsUI );
+            g_free( ldd->ld.repayOpts[i] );
+            g_free( ldd->repayOptsUI[i] );
+        }
+        g_free( ldd->ld.repayOpts );
+        g_free( ldd->repayOptsUI );
 
-                if ( ldd->ld.repAmount )
-                        g_free( ldd->ld.repAmount );
+        if ( ldd->ld.repAmount )
+            g_free( ldd->ld.repAmount );
 
-                g_date_free( ldd->ld.repStartDate );
-        }
+        g_date_free( ldd->ld.repStartDate );
+    }
 
-        /* review */
+    /* review */
+    {
+        if ( ldd->ld.revSchedule )
         {
-                if ( ldd->ld.revSchedule ) {
-                        g_list_foreach( ldd->ld.revSchedule,
-                                        ld_rev_sched_list_free,
-                                        NULL );
-                        g_list_free( ldd->ld.revSchedule );
-                        ldd->ld.revSchedule = NULL;
-                }
+            g_list_foreach( ldd->ld.revSchedule,
+                            ld_rev_sched_list_free,
+                            NULL );
+            g_list_free( ldd->ld.revSchedule );
+            ldd->ld.revSchedule = NULL;
         }
+    }
 
-        g_free( ldd );
+    g_free( ldd );
 }
 
 
@@ -1040,839 +1070,886 @@
 void
 ld_cancel_check( GnomeDruid *gd, LoanDruidData *ldd )
 {
-        const char *cancelMsg = _( "Are you sure you want to cancel "
-                                   "the Mortgage/Loan Setup Assistant?" );
-        if ( gnc_verify_dialog( ldd->dialog, FALSE, "%s", cancelMsg ) ) {
-                gnc_close_gui_component_by_data( DIALOG_LOAN_DRUID_CM_CLASS,
-                                                 ldd );
-        }
+    const char *cancelMsg = _( "Are you sure you want to cancel "
+                               "the Mortgage/Loan Setup Assistant?" );
+    if ( gnc_verify_dialog( ldd->dialog, FALSE, "%s", cancelMsg ) )
+    {
+        gnc_close_gui_component_by_data( DIALOG_LOAN_DRUID_CM_CLASS,
+                                         ldd );
+    }
 }
 
 static
 void
 ld_prm_type_changed( GtkWidget *w, gpointer ud )
 {
-        LoanDruidData *ldd;
-	gint index;
+    LoanDruidData *ldd;
+    gint index;
 
-        ldd = (LoanDruidData*)ud;
-        index = gtk_combo_box_get_active( ldd->prmType );
-        gtk_widget_set_sensitive( GTK_WIDGET(ldd->prmVarFrame),
-                                  index != GNC_FIXED );
+    ldd = (LoanDruidData*)ud;
+    index = gtk_combo_box_get_active( ldd->prmType );
+    gtk_widget_set_sensitive( GTK_WIDGET(ldd->prmVarFrame),
+                              index != GNC_FIXED );
 }
 
 static
 void
 ld_escrow_toggle( GtkToggleButton *tb, gpointer ud )
 {
-        int i;
-        gboolean newState;
-        RepayOptUIData *rouid;
-        LoanDruidData *ldd;
+    int i;
+    gboolean newState;
+    RepayOptUIData *rouid;
+    LoanDruidData *ldd;
 
-        ldd = (LoanDruidData*)ud;
-        newState = gtk_toggle_button_get_active(tb);
-        gtk_widget_set_sensitive( GTK_WIDGET(ldd->optEscrowHBox), newState );
-        /* deal with escrow options. */
-        for ( i=0; i<ldd->ld.repayOptCount; i++ ) {
-                rouid = ldd->repayOptsUI[i];
-                /* If we're going off, then uncheck and desensitize all escrow opts. */
-                /* If we're going on, then sensitize all escrow opts. */
+    ldd = (LoanDruidData*)ud;
+    newState = gtk_toggle_button_get_active(tb);
+    gtk_widget_set_sensitive( GTK_WIDGET(ldd->optEscrowHBox), newState );
+    /* deal with escrow options. */
+    for ( i = 0; i < ldd->ld.repayOptCount; i++ )
+    {
+        rouid = ldd->repayOptsUI[i];
+        /* If we're going off, then uncheck and desensitize all escrow opts. */
+        /* If we're going on, then sensitize all escrow opts. */
 
-                /* prevent the toggle handler from running and "trashing" the
-                 * state of the throughEscrowP selection */
-                g_signal_handlers_block_by_func( rouid->escrowCb,
-                                                 ld_escrow_toggled,
-						 rouid );
-                gtk_toggle_button_set_active(
-                        GTK_TOGGLE_BUTTON(rouid->escrowCb),
-                        ( newState
-                          && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(rouid->optCb) )
-                          && rouid->optData->throughEscrowP ) );
-                gtk_widget_set_sensitive(
-                        GTK_WIDGET(rouid->escrowCb),
-                        newState
-                        && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(rouid->optCb) ) );
-                g_signal_handlers_unblock_by_func( rouid->escrowCb,
-                                                   ld_escrow_toggled,
-                                                   rouid );
-                if ( newState ) {
-                        rouid->optData->from = ldd->ld.escrowAcct;
-                } else {
-                        rouid->optData->from = NULL;
-                }
+        /* prevent the toggle handler from running and "trashing" the
+         * state of the throughEscrowP selection */
+        g_signal_handlers_block_by_func( rouid->escrowCb,
+                                         ld_escrow_toggled,
+                                         rouid );
+        gtk_toggle_button_set_active(
+            GTK_TOGGLE_BUTTON(rouid->escrowCb),
+            ( newState
+              && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(rouid->optCb) )
+              && rouid->optData->throughEscrowP ) );
+        gtk_widget_set_sensitive(
+            GTK_WIDGET(rouid->escrowCb),
+            newState
+            && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(rouid->optCb) ) );
+        g_signal_handlers_unblock_by_func( rouid->escrowCb,
+                                           ld_escrow_toggled,
+                                           rouid );
+        if ( newState )
+        {
+            rouid->optData->from = ldd->ld.escrowAcct;
         }
+        else
+        {
+            rouid->optData->from = NULL;
+        }
+    }
 }
 
 static
 void
 ld_opt_toggled( GtkToggleButton *tb, gpointer ud )
 {
-        RepayOptUIData *rouid;
+    RepayOptUIData *rouid;
 
-        rouid = (RepayOptUIData*)ud;
-        rouid->optData->enabled = gtk_toggle_button_get_active(tb);
+    rouid = (RepayOptUIData*)ud;
+    rouid->optData->enabled = gtk_toggle_button_get_active(tb);
 }
 
 static
 void
 ld_opt_consistency( GtkToggleButton *tb, gpointer ud )
 {
-        GtkToggleButton *escrowCb;
-        RepayOptUIData *rouid;
+    GtkToggleButton *escrowCb;
+    RepayOptUIData *rouid;
 
-        rouid = (RepayOptUIData*)ud;
-        escrowCb = GTK_TOGGLE_BUTTON(rouid->escrowCb);
-        /* make sure the escrow option is only selected if we're active. */
-        gtk_toggle_button_set_active( escrowCb,
-				      gtk_toggle_button_get_active(
-                                             GTK_TOGGLE_BUTTON(
-                                                     rouid->ldd->optEscrowCb) )
-				      && rouid->optData->throughEscrowP
-				      && gtk_toggle_button_get_active(tb) );
-        /* make sure the escrow option is only sensitive if we're active, and
-         * the escrow account is enabled  */
-        gtk_widget_set_sensitive( GTK_WIDGET(escrowCb),
-                                  gtk_toggle_button_get_active(tb)
-                                  && gtk_toggle_button_get_active(
-                                          GTK_TOGGLE_BUTTON(rouid->ldd->optEscrowCb)) );
+    rouid = (RepayOptUIData*)ud;
+    escrowCb = GTK_TOGGLE_BUTTON(rouid->escrowCb);
+    /* make sure the escrow option is only selected if we're active. */
+    gtk_toggle_button_set_active( escrowCb,
+                                  gtk_toggle_button_get_active(
+                                      GTK_TOGGLE_BUTTON(
+                                          rouid->ldd->optEscrowCb) )
+                                  && rouid->optData->throughEscrowP
+                                  && gtk_toggle_button_get_active(tb) );
+    /* make sure the escrow option is only sensitive if we're active, and
+     * the escrow account is enabled  */
+    gtk_widget_set_sensitive( GTK_WIDGET(escrowCb),
+                              gtk_toggle_button_get_active(tb)
+                              && gtk_toggle_button_get_active(
+                                  GTK_TOGGLE_BUTTON(rouid->ldd->optEscrowCb)) );
 }
 
 static
 void
 ld_escrow_toggled( GtkToggleButton *tb, gpointer ud )
 {
-        RepayOptUIData *rouid;
+    RepayOptUIData *rouid;
 
-        rouid = (RepayOptUIData*)ud;
-        rouid->optData->throughEscrowP = gtk_toggle_button_get_active( tb );
+    rouid = (RepayOptUIData*)ud;
+    rouid->optData->throughEscrowP = gtk_toggle_button_get_active( tb );
 }
 
 static
 gboolean
 ld_info_save( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        LoanDruidData *ldd;
+    LoanDruidData *ldd;
 
-        ldd = (LoanDruidData*)ud;
+    ldd = (LoanDruidData*)ud;
 
-        ldd->ld.primaryAcct = gnc_account_sel_get_account( ldd->prmAccountGAS );
-        if ( ldd->ld.primaryAcct == NULL ) {
-                gnc_info_dialog( ldd->dialog, "%s",
-                                 _("Please select a valid loan account.") );
-                return TRUE;
-        }
-        if ( ! ldd->ld.repPriAcct ) {
-                ldd->ld.repPriAcct = ldd->ld.primaryAcct;
-        }
-        ldd->ld.principal = gnc_amount_edit_get_amount( ldd->prmOrigPrincGAE );
-        ldd->ld.interestRate = gtk_spin_button_get_value( ldd->prmIrateSpin );
-        ldd->ld.type = gtk_combo_box_get_active( ldd->prmType );
-        if ( ldd->ld.type != GNC_FIXED ) {
-                recurrenceListFree(&ldd->ld.loan_schedule);
-                gnc_frequency_save_to_recurrence(ldd->prmVarGncFreq,
-                                                 &ldd->ld.loan_schedule,
-                                                 ldd->ld.varStartDate);
-        }
+    ldd->ld.primaryAcct = gnc_account_sel_get_account( ldd->prmAccountGAS );
+    if ( ldd->ld.primaryAcct == NULL )
+    {
+        gnc_info_dialog( ldd->dialog, "%s",
+                         _("Please select a valid loan account.") );
+        return TRUE;
+    }
+    if ( ! ldd->ld.repPriAcct )
+    {
+        ldd->ld.repPriAcct = ldd->ld.primaryAcct;
+    }
+    ldd->ld.principal = gnc_amount_edit_get_amount( ldd->prmOrigPrincGAE );
+    ldd->ld.interestRate = gtk_spin_button_get_value( ldd->prmIrateSpin );
+    ldd->ld.type = gtk_combo_box_get_active( ldd->prmType );
+    if ( ldd->ld.type != GNC_FIXED )
+    {
+        recurrenceListFree(&ldd->ld.loan_schedule);
+        gnc_frequency_save_to_recurrence(ldd->prmVarGncFreq,
+                                         &ldd->ld.loan_schedule,
+                                         ldd->ld.varStartDate);
+    }
 
-        /* start date */
-        {
-                time_t tmpTT;
-                struct tm *tmpTm;
+    /* start date */
+    {
+        time_t tmpTT;
+        struct tm *tmpTm;
 
-                tmpTT = gnc_date_edit_get_date( ldd->prmStartDateGDE );
-                tmpTm = localtime( &tmpTT );
-                g_date_set_dmy( ldd->ld.startDate,
-                                tmpTm->tm_mday,
-                                (tmpTm->tm_mon+1),
-                                (1900 + tmpTm->tm_year) );
-        }
+        tmpTT = gnc_date_edit_get_date( ldd->prmStartDateGDE );
+        tmpTm = localtime( &tmpTT );
+        g_date_set_dmy( ldd->ld.startDate,
+                        tmpTm->tm_mday,
+                        (tmpTm->tm_mon + 1),
+                        (1900 + tmpTm->tm_year) );
+    }
 
-        /* len / periods */
-        {
-                ldd->ld.perSize =
-                        (gtk_combo_box_get_active( ldd->prmLengthType )
-                         == GNC_MONTHS) ? GNC_MONTHS : GNC_YEARS;
-                ldd->ld.numPer =
-                        gtk_spin_button_get_value_as_int( ldd->prmLengthSpin );
-                ldd->ld.numMonRemain =
-                        gtk_spin_button_get_value_as_int( ldd->prmRemainSpin );
-        }
-        return FALSE;
+    /* len / periods */
+    {
+        ldd->ld.perSize =
+            (gtk_combo_box_get_active( ldd->prmLengthType )
+             == GNC_MONTHS) ? GNC_MONTHS : GNC_YEARS;
+        ldd->ld.numPer =
+            gtk_spin_button_get_value_as_int( ldd->prmLengthSpin );
+        ldd->ld.numMonRemain =
+            gtk_spin_button_get_value_as_int( ldd->prmRemainSpin );
+    }
+    return FALSE;
 }
 
 static
 void
 ld_info_prep( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        LoanDruidData *ldd;
+    LoanDruidData *ldd;
 
-        ldd = (LoanDruidData*)ud;
-        gnc_amount_edit_set_amount( ldd->prmOrigPrincGAE, ldd->ld.principal );
-        gtk_spin_button_set_value( ldd->prmIrateSpin, ldd->ld.interestRate );
-        gtk_combo_box_set_active( ldd->prmType, ldd->ld.type );
-        if ( ldd->ld.type != GNC_FIXED ) {
-                gnc_frequency_setup_recurrence(ldd->prmVarGncFreq,
-                                               ldd->ld.loan_schedule,
-                                               ldd->ld.varStartDate);
-        }
+    ldd = (LoanDruidData*)ud;
+    gnc_amount_edit_set_amount( ldd->prmOrigPrincGAE, ldd->ld.principal );
+    gtk_spin_button_set_value( ldd->prmIrateSpin, ldd->ld.interestRate );
+    gtk_combo_box_set_active( ldd->prmType, ldd->ld.type );
+    if ( ldd->ld.type != GNC_FIXED )
+    {
+        gnc_frequency_setup_recurrence(ldd->prmVarGncFreq,
+                                       ldd->ld.loan_schedule,
+                                       ldd->ld.varStartDate);
+    }
 
-        /* start date */
-        {
-                struct tm *tmpTm;
+    /* start date */
+    {
+        struct tm *tmpTm;
 
-                tmpTm = g_new0( struct tm, 1 );
+        tmpTm = g_new0( struct tm, 1 );
 
-                g_date_to_struct_tm( ldd->ld.startDate, tmpTm );
-                gnc_date_edit_set_time( ldd->prmStartDateGDE,
-                                        mktime(tmpTm) );
-                g_free( tmpTm );
-        }
+        g_date_to_struct_tm( ldd->ld.startDate, tmpTm );
+        gnc_date_edit_set_time( ldd->prmStartDateGDE,
+                                mktime(tmpTm) );
+        g_free( tmpTm );
+    }
 
-        /* length: total and remaining */
-        {
-                gtk_spin_button_set_value( ldd->prmLengthSpin, ldd->ld.numPer );
-                gtk_combo_box_set_active( ldd->prmLengthType, ldd->ld.perSize );
-                gtk_spin_button_set_value( ldd->prmRemainSpin, ldd->ld.numMonRemain );
-        }
+    /* length: total and remaining */
+    {
+        gtk_spin_button_set_value( ldd->prmLengthSpin, ldd->ld.numPer );
+        gtk_combo_box_set_active( ldd->prmLengthType, ldd->ld.perSize );
+        gtk_spin_button_set_value( ldd->prmRemainSpin, ldd->ld.numMonRemain );
+    }
 }
 
 static
 gboolean
 ld_opts_save_state( LoanDruidData *ldd )
 {
-        if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(ldd->optEscrowCb) ) ) {
-                ldd->ld.escrowAcct =
-                        gnc_account_sel_get_account( ldd->optEscrowGAS );
-                if ( ldd->ld.escrowAcct == NULL ) {
-                        gnc_info_dialog( ldd->dialog, "%s",
-                                         _("Please select a valid "
-                                           "Escrow Account.") );
-                        return TRUE;
-                }
+    if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(ldd->optEscrowCb) ) )
+    {
+        ldd->ld.escrowAcct =
+            gnc_account_sel_get_account( ldd->optEscrowGAS );
+        if ( ldd->ld.escrowAcct == NULL )
+        {
+            gnc_info_dialog( ldd->dialog, "%s",
+                             _("Please select a valid "
+                               "Escrow Account.") );
+            return TRUE;
+        }
 
-        } else {
-                ldd->ld.escrowAcct = NULL;
-        }
-        return FALSE;
+    }
+    else
+    {
+        ldd->ld.escrowAcct = NULL;
+    }
+    return FALSE;
 }
 
 static
 gboolean
 ld_opts_tran( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        return ld_opts_save_state( (LoanDruidData*)ud );
+    return ld_opts_save_state( (LoanDruidData*)ud );
 }
 
 static
 void
 ld_opts_prep( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        int i;
-        RepayOptUIData *rouid;
-        LoanDruidData *ldd;
+    int i;
+    RepayOptUIData *rouid;
+    LoanDruidData *ldd;
 
-        ldd = (LoanDruidData*)ud;
-        if ( ldd->ld.escrowAcct ) {
-                gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->optEscrowCb),
-                                              TRUE );
-                gnc_account_sel_set_account( ldd->optEscrowGAS, ldd->ld.escrowAcct, FALSE );
-        }
-        for ( i=0; i<ldd->ld.repayOptCount; i++ ) {
-                rouid = ldd->repayOptsUI[i];
-                gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(rouid->optCb),
-                                              rouid->optData->enabled );
-                gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(rouid->escrowCb),
-                                              rouid->optData->throughEscrowP
-                                              && rouid->optData->enabled
-                                              && ldd->ld.escrowAcct );
-                gtk_widget_set_sensitive( GTK_WIDGET(rouid->escrowCb),
-                                          rouid->optData->enabled
-                                          && ldd->ld.escrowAcct );
-        }
+    ldd = (LoanDruidData*)ud;
+    if ( ldd->ld.escrowAcct )
+    {
+        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->optEscrowCb),
+                                      TRUE );
+        gnc_account_sel_set_account( ldd->optEscrowGAS, ldd->ld.escrowAcct, FALSE );
+    }
+    for ( i = 0; i < ldd->ld.repayOptCount; i++ )
+    {
+        rouid = ldd->repayOptsUI[i];
+        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(rouid->optCb),
+                                      rouid->optData->enabled );
+        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(rouid->escrowCb),
+                                      rouid->optData->throughEscrowP
+                                      && rouid->optData->enabled
+                                      && ldd->ld.escrowAcct );
+        gtk_widget_set_sensitive( GTK_WIDGET(rouid->escrowCb),
+                                  rouid->optData->enabled
+                                  && ldd->ld.escrowAcct );
+    }
 }
 
 static
 gboolean
 ld_rep_save( LoanDruidData *ldd )
 {
-        int i;
+    int i;
 
-        if ( ldd->ld.repMemo )
-                g_free( ldd->ld.repMemo );
-        ldd->ld.repMemo =
-                gtk_editable_get_chars( GTK_EDITABLE(ldd->repTxnName), 0, -1 );
+    if ( ldd->ld.repMemo )
+        g_free( ldd->ld.repMemo );
+    ldd->ld.repMemo =
+        gtk_editable_get_chars( GTK_EDITABLE(ldd->repTxnName), 0, -1 );
 
-        if ( ldd->ld.repAmount )
-                g_free( ldd->ld.repAmount );
-        ldd->ld.repAmount =
-                gtk_editable_get_chars( GTK_EDITABLE(ldd->repAmtEntry), 0, -1 );
+    if ( ldd->ld.repAmount )
+        g_free( ldd->ld.repAmount );
+    ldd->ld.repAmount =
+        gtk_editable_get_chars( GTK_EDITABLE(ldd->repAmtEntry), 0, -1 );
 
-        ldd->ld.repFromAcct =
-                gnc_account_sel_get_account( ldd->repAssetsFromGAS );
-        if ( ldd->ld.repFromAcct == NULL ) {
-                gnc_info_dialog( ldd->dialog, "%s",
-                                 _("Please select a valid \"from\" account."));
-                return TRUE;
-        }
-        ldd->ld.repPriAcct =
-                gnc_account_sel_get_account( ldd->repPrincToGAS );
-        if ( ldd->ld.repPriAcct == NULL ) {
-                gnc_info_dialog( ldd->dialog, "%s",
-                                 _("Please select a valid \"to\" account.") );
-                return TRUE;
-        }
-        ldd->ld.repIntAcct =
-                gnc_account_sel_get_account( ldd->repIntToGAS );
-        if ( ldd->ld.repIntAcct == NULL ) {
-                gnc_info_dialog( ldd->dialog, "%s",
-                                 _("Please select a valid "
-                                   "\"interest\" account.") );
-                return TRUE;
-        }
-        recurrenceListFree(&ldd->ld.repayment_schedule);
-        gnc_frequency_save_to_recurrence(ldd->repGncFreq,
-                                         &ldd->ld.repayment_schedule,
-                                         ldd->ld.repStartDate);
+    ldd->ld.repFromAcct =
+        gnc_account_sel_get_account( ldd->repAssetsFromGAS );
+    if ( ldd->ld.repFromAcct == NULL )
+    {
+        gnc_info_dialog( ldd->dialog, "%s",
+                         _("Please select a valid \"from\" account."));
+        return TRUE;
+    }
+    ldd->ld.repPriAcct =
+        gnc_account_sel_get_account( ldd->repPrincToGAS );
+    if ( ldd->ld.repPriAcct == NULL )
+    {
+        gnc_info_dialog( ldd->dialog, "%s",
+                         _("Please select a valid \"to\" account.") );
+        return TRUE;
+    }
+    ldd->ld.repIntAcct =
+        gnc_account_sel_get_account( ldd->repIntToGAS );
+    if ( ldd->ld.repIntAcct == NULL )
+    {
+        gnc_info_dialog( ldd->dialog, "%s",
+                         _("Please select a valid "
+                           "\"interest\" account.") );
+        return TRUE;
+    }
+    recurrenceListFree(&ldd->ld.repayment_schedule);
+    gnc_frequency_save_to_recurrence(ldd->repGncFreq,
+                                     &ldd->ld.repayment_schedule,
+                                     ldd->ld.repStartDate);
 
-        /* Set the 'from' accounts of the various options to be the
-         * Assets-From account, if they're not already something else. */
-        for ( i=0; i<ldd->ld.repayOptCount; i++ ) {
-                RepayOptData *rod = ldd->ld.repayOpts[i];
-                if ( ! rod->from ) {
-                        rod->from = ldd->ld.repFromAcct;
-                }
+    /* Set the 'from' accounts of the various options to be the
+     * Assets-From account, if they're not already something else. */
+    for ( i = 0; i < ldd->ld.repayOptCount; i++ )
+    {
+        RepayOptData *rod = ldd->ld.repayOpts[i];
+        if ( ! rod->from )
+        {
+            rod->from = ldd->ld.repFromAcct;
         }
-        return FALSE;
+    }
+    return FALSE;
 }
 
 static
 gboolean
 ld_rep_next( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        LoanDruidData *ldd;
+    LoanDruidData *ldd;
 
-        ldd = (LoanDruidData*)ud;
+    ldd = (LoanDruidData*)ud;
 
-        if ( ld_rep_save( ldd ) != FALSE ) {
-                DEBUG( "Couldn't save, stopping here." );
-                return TRUE;
-        }
+    if ( ld_rep_save( ldd ) != FALSE )
+    {
+        DEBUG( "Couldn't save, stopping here." );
+        return TRUE;
+    }
 
+    {
+        int i;
+        for ( i = 0; // we can always start at 0, here.
+                (i < ldd->ld.repayOptCount)
+                && !ldd->ld.repayOpts[i]->enabled;
+                i++ )
+            ;
+        if ( i < ldd->ld.repayOptCount )
         {
-                int i;
-                for ( i = 0; // we can always start at 0, here.
-                      (i < ldd->ld.repayOptCount)
-                      && !ldd->ld.repayOpts[i]->enabled;
-                      i++ )
-                        ;
-                if ( i < ldd->ld.repayOptCount ) {
-                        ldd->currentIdx = i;
-                        return FALSE;
-                }
+            ldd->currentIdx = i;
+            return FALSE;
         }
-        gnome_druid_set_page( ldd->druid,
-                              GNOME_DRUID_PAGE(
-                                      glade_xml_get_widget( ldd->gxml,
-                                                            PG_REVIEW ) ) );
-        return TRUE;
+    }
+    gnome_druid_set_page( ldd->druid,
+                          GNOME_DRUID_PAGE(
+                              glade_xml_get_widget( ldd->gxml,
+                                      PG_REVIEW ) ) );
+    return TRUE;
 }
 
 static
 gboolean
 ld_rep_back( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        LoanDruidData *ldd;
+    LoanDruidData *ldd;
 
-        ldd = (LoanDruidData*)ud;
-        return ld_rep_save(ldd);
+    ldd = (LoanDruidData*)ud;
+    return ld_rep_save(ldd);
 }
 
 static
 void
 ld_rep_prep( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        LoanDruidData *ldd;
-        GString *str;
+    LoanDruidData *ldd;
+    GString *str;
 
-        ldd = (LoanDruidData*)ud;
+    ldd = (LoanDruidData*)ud;
 
-        if ( ldd->ld.repAmount ) {
-                g_free( ldd->ld.repAmount );
-        }
+    if ( ldd->ld.repAmount )
+    {
+        g_free( ldd->ld.repAmount );
+    }
 
-        str = g_string_sized_new( 64 );
-        ld_get_pmt_formula( ldd, str );
-        ldd->ld.repAmount = str->str;
-        g_string_free( str, FALSE );
+    str = g_string_sized_new( 64 );
+    ld_get_pmt_formula( ldd, str );
+    ldd->ld.repAmount = str->str;
+    g_string_free( str, FALSE );
 
-        if ( ldd->ld.repMemo )
-                gtk_entry_set_text( ldd->repTxnName, ldd->ld.repMemo );
+    if ( ldd->ld.repMemo )
+        gtk_entry_set_text( ldd->repTxnName, ldd->ld.repMemo );
 
-        if ( ldd->ld.repAmount )
-                gtk_entry_set_text( ldd->repAmtEntry, ldd->ld.repAmount );
+    if ( ldd->ld.repAmount )
+        gtk_entry_set_text( ldd->repAmtEntry, ldd->ld.repAmount );
 
-        gnc_account_sel_set_account( ldd->repAssetsFromGAS,
-                                     ldd->ld.repFromAcct, FALSE );
-        gnc_account_sel_set_account( ldd->repPrincToGAS,
-                                     ldd->ld.repPriAcct, FALSE );
-        gnc_account_sel_set_account( ldd->repIntToGAS,
-                                     ldd->ld.repIntAcct, FALSE );
-        gnc_frequency_setup_recurrence(ldd->repGncFreq,
-                                       ldd->ld.repayment_schedule,
-                                       ldd->ld.repStartDate);
+    gnc_account_sel_set_account( ldd->repAssetsFromGAS,
+                                 ldd->ld.repFromAcct, FALSE );
+    gnc_account_sel_set_account( ldd->repPrincToGAS,
+                                 ldd->ld.repPriAcct, FALSE );
+    gnc_account_sel_set_account( ldd->repIntToGAS,
+                                 ldd->ld.repIntAcct, FALSE );
+    gnc_frequency_setup_recurrence(ldd->repGncFreq,
+                                   ldd->ld.repayment_schedule,
+                                   ldd->ld.repStartDate);
 }
 
 static
 void
 ld_pay_prep( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        LoanDruidData *ldd;
-        RepayOptData *rod;
-        GString *str;
-        gboolean uniq;
+    LoanDruidData *ldd;
+    RepayOptData *rod;
+    GString *str;
+    gboolean uniq;
 
-        ldd = (LoanDruidData*)ud;
-        g_assert( ldd->currentIdx >= 0 );
-        g_assert( ldd->currentIdx <= ldd->ld.repayOptCount );
+    ldd = (LoanDruidData*)ud;
+    g_assert( ldd->currentIdx >= 0 );
+    g_assert( ldd->currentIdx <= ldd->ld.repayOptCount );
 
-        rod = ldd->ld.repayOpts[ldd->currentIdx];
-        str = g_string_sized_new( 32 );
-        /* Translators: %s is "Taxes", or "Insurance", or similar */
-        g_string_printf( str, _("Payment: \"%s\""), rod->name );
-        gnome_druid_page_standard_set_title( GNOME_DRUID_PAGE_STANDARD(gdp),
-                                             str->str );
-        /* copy in the relevant data from the currently-indexed
-         * option. */
-        gtk_entry_set_text( ldd->payTxnName, rod->txnMemo );
-        g_string_printf( str, "%0.2f", rod->amount );
-        gtk_entry_set_text( ldd->payAmtEntry, str->str );
+    rod = ldd->ld.repayOpts[ldd->currentIdx];
+    str = g_string_sized_new( 32 );
+    /* Translators: %s is "Taxes", or "Insurance", or similar */
+    g_string_printf( str, _("Payment: \"%s\""), rod->name );
+    gnome_druid_page_standard_set_title( GNOME_DRUID_PAGE_STANDARD(gdp),
+                                         str->str );
+    /* copy in the relevant data from the currently-indexed
+     * option. */
+    gtk_entry_set_text( ldd->payTxnName, rod->txnMemo );
+    g_string_printf( str, "%0.2f", rod->amount );
+    gtk_entry_set_text( ldd->payAmtEntry, str->str );
 
-        gtk_widget_set_sensitive( GTK_WIDGET(ldd->payUseEscrow),
-                                  (ldd->ld.escrowAcct != NULL) );
+    gtk_widget_set_sensitive( GTK_WIDGET(ldd->payUseEscrow),
+                              (ldd->ld.escrowAcct != NULL) );
 
-        {
-                g_signal_handlers_block_by_func( ldd->payUseEscrow,
-                                                 ld_pay_use_esc_toggle,
-                                                 ldd );
+    {
+        g_signal_handlers_block_by_func( ldd->payUseEscrow,
+                                         ld_pay_use_esc_toggle,
+                                         ldd );
 
-                ld_pay_use_esc_setup( ldd,
-                                      (ldd->ld.escrowAcct != NULL)
-                                      && rod->throughEscrowP );
-                gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->payUseEscrow),
-                                              (rod->throughEscrowP
-                                               && ldd->ld.escrowAcct != NULL) );
+        ld_pay_use_esc_setup( ldd,
+                              (ldd->ld.escrowAcct != NULL)
+                              && rod->throughEscrowP );
+        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->payUseEscrow),
+                                      (rod->throughEscrowP
+                                       && ldd->ld.escrowAcct != NULL) );
 
-                g_signal_handlers_unblock_by_func( ldd->payUseEscrow,
-                                                   ld_pay_use_esc_toggle,
-                                                   ldd );
-        }
+        g_signal_handlers_unblock_by_func( ldd->payUseEscrow,
+                                           ld_pay_use_esc_toggle,
+                                           ldd );
+    }
 
-        {
-                g_signal_handlers_block_by_func( ldd->paySpecSrcAcct,
-                                                 ld_pay_spec_src_toggle,
-                                                 ldd );
+    {
+        g_signal_handlers_block_by_func( ldd->paySpecSrcAcct,
+                                         ld_pay_spec_src_toggle,
+                                         ldd );
 
-                ld_pay_spec_src_setup( ldd, rod->specSrcAcctP );
-                gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->paySpecSrcAcct),
-                                              rod->specSrcAcctP );
+        ld_pay_spec_src_setup( ldd, rod->specSrcAcctP );
+        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->paySpecSrcAcct),
+                                      rod->specSrcAcctP );
 
-                g_signal_handlers_unblock_by_func( ldd->paySpecSrcAcct,
-                                                   ld_pay_spec_src_toggle,
-                                                   ldd );
-        }
+        g_signal_handlers_unblock_by_func( ldd->paySpecSrcAcct,
+                                           ld_pay_spec_src_toggle,
+                                           ldd );
+    }
 
-        gnc_account_sel_set_account( ldd->payAcctToGAS,   rod->to, FALSE );
+    gnc_account_sel_set_account( ldd->payAcctToGAS,   rod->to, FALSE );
 
-        uniq = (rod->schedule != NULL);
-        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->payTxnFreqPartRb),
-                                      !uniq );
-        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->payTxnFreqUniqRb),
-                                      uniq );
-        gtk_widget_set_sensitive( GTK_WIDGET(ldd->payFreqAlign),
+    uniq = (rod->schedule != NULL);
+    gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->payTxnFreqPartRb),
+                                  !uniq );
+    gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->payTxnFreqUniqRb),
                                   uniq );
-        if ( uniq ) {
-                gnc_frequency_setup_recurrence( ldd->payGncFreq, rod->schedule, rod->startDate );
-        }
+    gtk_widget_set_sensitive( GTK_WIDGET(ldd->payFreqAlign),
+                              uniq );
+    if ( uniq )
+    {
+        gnc_frequency_setup_recurrence( ldd->payGncFreq, rod->schedule, rod->startDate );
+    }
 
-        g_string_free( str, TRUE );
+    g_string_free( str, TRUE );
 }
 
 static
 gboolean
 ld_pay_save_current( LoanDruidData *ldd )
 {
-        gchar *tmpStr;
-        RepayOptData *rod;
+    gchar *tmpStr;
+    RepayOptData *rod;
 
-        g_assert( ldd->currentIdx >= 0 );
-        g_assert( ldd->currentIdx <= ldd->ld.repayOptCount );
-        rod = ldd->ld.repayOpts[ ldd->currentIdx ];
+    g_assert( ldd->currentIdx >= 0 );
+    g_assert( ldd->currentIdx <= ldd->ld.repayOptCount );
+    rod = ldd->ld.repayOpts[ ldd->currentIdx ];
 
-        tmpStr = gtk_editable_get_chars( GTK_EDITABLE(ldd->payTxnName),
-                                         0, -1 );
-        if ( rod->txnMemo != NULL ) {
-                g_free( rod->txnMemo );
-        }
-        rod->txnMemo = tmpStr;
-        tmpStr = NULL;
+    tmpStr = gtk_editable_get_chars( GTK_EDITABLE(ldd->payTxnName),
+                                     0, -1 );
+    if ( rod->txnMemo != NULL )
+    {
+        g_free( rod->txnMemo );
+    }
+    rod->txnMemo = tmpStr;
+    tmpStr = NULL;
 
-        tmpStr = gtk_editable_get_chars( GTK_EDITABLE(ldd->payAmtEntry),
-                                         0, -1 );
-        rod->amount = (float)strtod( tmpStr, NULL );
-        g_free( tmpStr );
+    tmpStr = gtk_editable_get_chars( GTK_EDITABLE(ldd->payAmtEntry),
+                                     0, -1 );
+    rod->amount = (float)strtod( tmpStr, NULL );
+    g_free( tmpStr );
 
-        rod->specSrcAcctP =
-                gtk_toggle_button_get_active(
-                        GTK_TOGGLE_BUTTON(ldd->paySpecSrcAcct) );
+    rod->specSrcAcctP =
+        gtk_toggle_button_get_active(
+            GTK_TOGGLE_BUTTON(ldd->paySpecSrcAcct) );
 
-        rod->from = NULL;
-        if ( rod->specSrcAcctP ) {
-                rod->from = gnc_account_sel_get_account( ldd->payAcctFromGAS );
-                if ( rod->from == NULL ) {
-                        gnc_info_dialog( ldd->dialog, "%s",
-                                         _("Please select a valid "
-                                           "\"from\" account.") );
-                        return TRUE;
-                }
+    rod->from = NULL;
+    if ( rod->specSrcAcctP )
+    {
+        rod->from = gnc_account_sel_get_account( ldd->payAcctFromGAS );
+        if ( rod->from == NULL )
+        {
+            gnc_info_dialog( ldd->dialog, "%s",
+                             _("Please select a valid "
+                               "\"from\" account.") );
+            return TRUE;
         }
+    }
 
-        rod->to   = gnc_account_sel_get_account( ldd->payAcctToGAS );
-        if ( rod->to == NULL ) {
-                gnc_info_dialog( ldd->dialog, "%s",
-                                 _("Please select a valid "
-                                   "\"to\" account.") );
-                return TRUE;
-        }
+    rod->to   = gnc_account_sel_get_account( ldd->payAcctToGAS );
+    if ( rod->to == NULL )
+    {
+        gnc_info_dialog( ldd->dialog, "%s",
+                         _("Please select a valid "
+                           "\"to\" account.") );
+        return TRUE;
+    }
 
-        /* if ( rb toggled )
-         *   ensure schedule/startdate setup
-         *   save
-         * else
-         *   if (freqspec setup)
-         *     remove schedule/startdate
-         */
+    /* if ( rb toggled )
+     *   ensure schedule/startdate setup
+     *   save
+     * else
+     *   if (freqspec setup)
+     *     remove schedule/startdate
+     */
 
-        /* neither of these should happen. */
-        g_assert( ! (rod->schedule && !rod->startDate) );
-        g_assert( ! (!rod->schedule && rod->startDate) );
+    /* neither of these should happen. */
+    g_assert( ! (rod->schedule && !rod->startDate) );
+    g_assert( ! (!rod->schedule && rod->startDate) );
 
-        if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ldd->payTxnFreqUniqRb)) ) {
-                if ( rod->startDate == NULL ) {
-                        rod->startDate = g_date_new();
-                }
-                recurrenceListFree(&rod->schedule);
-                gnc_frequency_save_to_recurrence(ldd->payGncFreq,
-                                                 &rod->schedule,
-                                                 rod->startDate);
-        } else {
-                if (rod->schedule) {
-                        recurrenceListFree(&rod->schedule);
-                }
-                if ( rod->startDate ) {
-                        g_date_free( rod->startDate );
-                        rod->startDate = NULL;
-                }
+    if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ldd->payTxnFreqUniqRb)) )
+    {
+        if ( rod->startDate == NULL )
+        {
+            rod->startDate = g_date_new();
         }
-        return FALSE;
+        recurrenceListFree(&rod->schedule);
+        gnc_frequency_save_to_recurrence(ldd->payGncFreq,
+                                         &rod->schedule,
+                                         rod->startDate);
+    }
+    else
+    {
+        if (rod->schedule)
+        {
+            recurrenceListFree(&rod->schedule);
+        }
+        if ( rod->startDate )
+        {
+            g_date_free( rod->startDate );
+            rod->startDate = NULL;
+        }
+    }
+    return FALSE;
 }
 
 static
 gboolean
 ld_pay_next( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        int i;
-        LoanDruidData *ldd;
+    int i;
+    LoanDruidData *ldd;
 
-        ldd = (LoanDruidData*)ud;
-        /* save current data */
-        if ( ld_pay_save_current( ldd ) != FALSE ) {
-                return TRUE;
-        }
+    ldd = (LoanDruidData*)ud;
+    /* save current data */
+    if ( ld_pay_save_current( ldd ) != FALSE )
+    {
+        return TRUE;
+    }
 
-        /* Go through opts list and select next enabled option. */
-        for ( i = ldd->currentIdx + 1;
-              (i < ldd->ld.repayOptCount)
-              && !ldd->ld.repayOpts[i]->enabled; i++ )
-                ;
+    /* Go through opts list and select next enabled option. */
+    for ( i = ldd->currentIdx + 1;
+            (i < ldd->ld.repayOptCount)
+            && !ldd->ld.repayOpts[i]->enabled; i++ )
+        ;
 
-        if ( i < ldd->ld.repayOptCount ) {
-                ldd->currentIdx = i;
-                ld_pay_prep( gdp, arg1, ud );
-                return TRUE;
-        }
+    if ( i < ldd->ld.repayOptCount )
+    {
+        ldd->currentIdx = i;
+        ld_pay_prep( gdp, arg1, ud );
+        return TRUE;
+    }
 
-        /* If there's no repayment options enabled, then go immediately to
-         * the review page. */
-        gnome_druid_set_page( ldd->druid,
-                              GNOME_DRUID_PAGE(
-                                      glade_xml_get_widget( ldd->gxml,
-                                                            PG_REVIEW ) ) );
-        return TRUE;
+    /* If there's no repayment options enabled, then go immediately to
+     * the review page. */
+    gnome_druid_set_page( ldd->druid,
+                          GNOME_DRUID_PAGE(
+                              glade_xml_get_widget( ldd->gxml,
+                                      PG_REVIEW ) ) );
+    return TRUE;
 }
 
 static
 gboolean
 ld_pay_back( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        int i;
-        LoanDruidData *ldd;
+    int i;
+    LoanDruidData *ldd;
 
-        ldd = (LoanDruidData*)ud;
+    ldd = (LoanDruidData*)ud;
 
-        /* save current data */
-        if ( ld_pay_save_current( ldd ) != FALSE ) {
-                return TRUE;
-        }
+    /* save current data */
+    if ( ld_pay_save_current( ldd ) != FALSE )
+    {
+        return TRUE;
+    }
 
-        /* go back through opts list and select next enabled options. */
-        for ( i = ldd->currentIdx - 1;
-              (i > -1) && !ldd->ld.repayOpts[i]->enabled;
-              i-- )
-                ;
-        if ( i >= 0 ) {
-                ldd->currentIdx = i;
-                ld_pay_prep( gdp, arg1, ud );
-                return TRUE;
-        }
-        ldd->currentIdx = -1;
-        return FALSE;
+    /* go back through opts list and select next enabled options. */
+    for ( i = ldd->currentIdx - 1;
+            (i > -1) && !ldd->ld.repayOpts[i]->enabled;
+            i-- )
+        ;
+    if ( i >= 0 )
+    {
+        ldd->currentIdx = i;
+        ld_pay_prep( gdp, arg1, ud );
+        return TRUE;
+    }
+    ldd->currentIdx = -1;
+    return FALSE;
 }
 
 static
 void
 ld_pay_freq_toggle( GtkToggleButton *tb, gpointer ud )
 {
-        LoanDruidData *ldd;
-        gboolean uniq;
+    LoanDruidData *ldd;
+    gboolean uniq;
 
-        ldd = (LoanDruidData*)ud;
+    ldd = (LoanDruidData*)ud;
 
-        g_assert( ldd->currentIdx >= 0 );
-        g_assert( ldd->currentIdx <= ldd->ld.repayOptCount );
+    g_assert( ldd->currentIdx >= 0 );
+    g_assert( ldd->currentIdx <= ldd->ld.repayOptCount );
 
-        uniq = gtk_toggle_button_get_active(
-                GTK_TOGGLE_BUTTON(ldd->payTxnFreqUniqRb) );
-        gtk_widget_set_sensitive( GTK_WIDGET(ldd->payFreqAlign), uniq );
+    uniq = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(ldd->payTxnFreqUniqRb) );
+    gtk_widget_set_sensitive( GTK_WIDGET(ldd->payFreqAlign), uniq );
 
-        if ( uniq ) {
-                RepayOptData *rod;
-                rod = ldd->ld.repayOpts[ ldd->currentIdx ];
+    if ( uniq )
+    {
+        RepayOptData *rod;
+        rod = ldd->ld.repayOpts[ ldd->currentIdx ];
 
-                if ( rod->schedule == NULL ) {
-                        Recurrence *r = g_new0(Recurrence, 1);
-                        recurrenceSet(r, 1, PERIOD_MONTH, ldd->ld.startDate, WEEKEND_ADJ_NONE);
-                        rod->schedule = g_list_append(rod->schedule, r);
-                }
-                if ( rod->startDate == NULL ) {
-                        rod->startDate = g_date_new();
-                        *rod->startDate = *ldd->ld.startDate;
-                }
-                gnc_frequency_setup_recurrence(ldd->payGncFreq,
-                                               rod->schedule,
-                                               rod->startDate);
+        if ( rod->schedule == NULL )
+        {
+            Recurrence *r = g_new0(Recurrence, 1);
+            recurrenceSet(r, 1, PERIOD_MONTH, ldd->ld.startDate, WEEKEND_ADJ_NONE);
+            rod->schedule = g_list_append(rod->schedule, r);
         }
+        if ( rod->startDate == NULL )
+        {
+            rod->startDate = g_date_new();
+            *rod->startDate = *ldd->ld.startDate;
+        }
+        gnc_frequency_setup_recurrence(ldd->payGncFreq,
+                                       rod->schedule,
+                                       rod->startDate);
+    }
 }
 
 static
 void
 ld_pay_use_esc_setup( LoanDruidData *ldd, gboolean newState )
 {
-        gtk_widget_set_sensitive( GTK_WIDGET(ldd->payEscToLabel), newState );
-        gtk_widget_set_sensitive( GTK_WIDGET(ldd->payEscFromLabel), newState );
-        if ( newState )
-        {
-                gnc_account_sel_set_account( ldd->payAcctEscToGAS,
-                                             ldd->ld.escrowAcct, FALSE );
-                gnc_account_sel_set_account( ldd->payAcctEscFromGAS,
-                                             ldd->ld.escrowAcct, FALSE );
-        }
+    gtk_widget_set_sensitive( GTK_WIDGET(ldd->payEscToLabel), newState );
+    gtk_widget_set_sensitive( GTK_WIDGET(ldd->payEscFromLabel), newState );
+    if ( newState )
+    {
+        gnc_account_sel_set_account( ldd->payAcctEscToGAS,
+                                     ldd->ld.escrowAcct, FALSE );
+        gnc_account_sel_set_account( ldd->payAcctEscFromGAS,
+                                     ldd->ld.escrowAcct, FALSE );
+    }
 }
 
 static
 void
 ld_pay_use_esc_toggle( GtkToggleButton *tb, gpointer ud )
 {
-        gboolean newState;
-        LoanDruidData *ldd = (LoanDruidData*)ud;
+    gboolean newState;
+    LoanDruidData *ldd = (LoanDruidData*)ud;
 
-        newState = gtk_toggle_button_get_active( tb );
-        ld_pay_use_esc_setup( ldd, newState );
+    newState = gtk_toggle_button_get_active( tb );
+    ld_pay_use_esc_setup( ldd, newState );
 }
 
 static
 void
 ld_pay_spec_src_setup( LoanDruidData *ldd, gboolean newState )
 {
-        gtk_widget_set_sensitive( GTK_WIDGET(ldd->payAcctFromLabel), newState );
-        gtk_widget_set_sensitive( GTK_WIDGET(ldd->payAcctFromGAS), newState );
-        if ( newState )
-        {
-                gnc_account_sel_set_account( ldd->payAcctFromGAS,
-                                             ldd->ld.repayOpts[ldd->currentIdx]
-                                             ->from, FALSE );
-        }
+    gtk_widget_set_sensitive( GTK_WIDGET(ldd->payAcctFromLabel), newState );
+    gtk_widget_set_sensitive( GTK_WIDGET(ldd->payAcctFromGAS), newState );
+    if ( newState )
+    {
+        gnc_account_sel_set_account( ldd->payAcctFromGAS,
+                                     ldd->ld.repayOpts[ldd->currentIdx]
+                                     ->from, FALSE );
+    }
 }
 
 static
 void
 ld_pay_spec_src_toggle( GtkToggleButton *tb, gpointer ud )
 {
-        gboolean newState;
-        LoanDruidData *ldd = (LoanDruidData*)ud;
+    gboolean newState;
+    LoanDruidData *ldd = (LoanDruidData*)ud;
 
-        newState = gtk_toggle_button_get_active( tb );
-        ld_pay_spec_src_setup( ldd, newState );
+    newState = gtk_toggle_button_get_active( tb );
+    ld_pay_spec_src_setup( ldd, newState );
 }
 
 static
 gboolean
 ld_rev_next( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        LoanDruidData *ldd;
+    LoanDruidData *ldd;
 
-        ldd = (LoanDruidData*)ud;
-        gnome_druid_set_page( ldd->druid,
-                              GNOME_DRUID_PAGE(
-                                      glade_xml_get_widget( ldd->gxml,
-                                                            PG_COMMIT ) ) );
-        return TRUE;
+    ldd = (LoanDruidData*)ud;
+    gnome_druid_set_page( ldd->druid,
+                          GNOME_DRUID_PAGE(
+                              glade_xml_get_widget( ldd->gxml,
+                                      PG_COMMIT ) ) );
+    return TRUE;
 }
 
 static
 void
 ld_rev_prep( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        /* 3, here, does not include the Date column. */
-        const static int BASE_COLS = 3;
-        LoanDruidData *ldd;
-	GtkListStore *store;
-	GtkCellRenderer *renderer;
-	GtkTreeViewColumn *column;
-	GType *types;
-        int i;
+    /* 3, here, does not include the Date column. */
+    const static int BASE_COLS = 3;
+    LoanDruidData *ldd;
+    GtkListStore *store;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+    GType *types;
+    int i;
 
-        ldd = (LoanDruidData*)ud;
+    ldd = (LoanDruidData*)ud;
 
-        /* Cleanup old view */
-        if ( ldd->revView != NULL ) {
-		gtk_widget_destroy( GTK_WIDGET(ldd->revView) );
-                ldd->revView = NULL;
-        }
+    /* Cleanup old view */
+    if ( ldd->revView != NULL )
+    {
+        gtk_widget_destroy( GTK_WIDGET(ldd->revView) );
+        ldd->revView = NULL;
+    }
 
-        ldd->ld.revNumPmts = BASE_COLS;
-        /* Get the correct number of repayment columns. */
-        for ( i=0; i < ldd->ld.repayOptCount; i++ ) {
-                ldd->ld.revRepayOptToColMap[i] = -1;
-                if ( ! ldd->ld.repayOpts[i]->enabled ) {
-                        continue;
-                }
-                /* not '+1' = there is no date column to be accounted for in
-                 * the mapping. */
-                ldd->ld.revRepayOptToColMap[i] = ldd->ld.revNumPmts;
-                ldd->ld.revNumPmts += 1;
+    ldd->ld.revNumPmts = BASE_COLS;
+    /* Get the correct number of repayment columns. */
+    for ( i = 0; i < ldd->ld.repayOptCount; i++ )
+    {
+        ldd->ld.revRepayOptToColMap[i] = -1;
+        if ( ! ldd->ld.repayOpts[i]->enabled )
+        {
+            continue;
         }
+        /* not '+1' = there is no date column to be accounted for in
+         * the mapping. */
+        ldd->ld.revRepayOptToColMap[i] = ldd->ld.revNumPmts;
+        ldd->ld.revNumPmts += 1;
+    }
 
-        /* '+1' for leading date col */
-	types = g_new( GType, ldd->ld.revNumPmts + 1 );
-	for ( i=0; i < ldd->ld.revNumPmts + 1; i++ )
-	  types[i] = G_TYPE_STRING;
-	store = gtk_list_store_newv(ldd->ld.revNumPmts + 1, types);
-	g_free(types);
+    /* '+1' for leading date col */
+    types = g_new( GType, ldd->ld.revNumPmts + 1 );
+    for ( i = 0; i < ldd->ld.revNumPmts + 1; i++ )
+        types[i] = G_TYPE_STRING;
+    store = gtk_list_store_newv(ldd->ld.revNumPmts + 1, types);
+    g_free(types);
 
-        ldd->revView = GTK_TREE_VIEW(
-		gtk_tree_view_new_with_model( GTK_TREE_MODEL(store) ));
-	g_object_unref(store);
+    ldd->revView = GTK_TREE_VIEW(
+                       gtk_tree_view_new_with_model( 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", LOAN_COL_DATE,
-							  NULL);
-	gtk_tree_view_append_column(ldd->revView, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Date"), renderer,
+             "text", LOAN_COL_DATE,
+             NULL);
+    gtk_tree_view_append_column(ldd->revView, column);
 
-	renderer = gtk_cell_renderer_text_new();
-	column = gtk_tree_view_column_new_with_attributes(_("Payment"), renderer,
-							  "text", LOAN_COL_PAYMENT,
-							  NULL);
-	gtk_tree_view_append_column(ldd->revView, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Payment"), renderer,
+             "text", LOAN_COL_PAYMENT,
+             NULL);
+    gtk_tree_view_append_column(ldd->revView, column);
 
-	renderer = gtk_cell_renderer_text_new();
-	column = gtk_tree_view_column_new_with_attributes(_("Principal"), renderer,
-							  "text", LOAN_COL_PRINCIPAL,
-							  NULL);
-	gtk_tree_view_append_column(ldd->revView, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Principal"), renderer,
+             "text", LOAN_COL_PRINCIPAL,
+             NULL);
+    gtk_tree_view_append_column(ldd->revView, column);
 
-	renderer = gtk_cell_renderer_text_new();
-	column = gtk_tree_view_column_new_with_attributes(_("Interest"), renderer,
-							  "text", LOAN_COL_INTEREST,
-							  NULL);
-	gtk_tree_view_append_column(ldd->revView, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Interest"), renderer,
+             "text", LOAN_COL_INTEREST,
+             NULL);
+    gtk_tree_view_append_column(ldd->revView, column);
 
-        /* move the appropriate names over into the title array */
+    /* move the appropriate names over into the title array */
+    {
+        for ( i = 0; i < ldd->ld.repayOptCount; i++ )
         {
-                for ( i=0; i < ldd->ld.repayOptCount; i++ ) {
-                        if ( ldd->ld.revRepayOptToColMap[i] == -1 ) {
-                                continue;
-                        }
+            if ( ldd->ld.revRepayOptToColMap[i] == -1 )
+            {
+                continue;
+            }
 
-			renderer = gtk_cell_renderer_text_new();
-			column = gtk_tree_view_column_new_with_attributes
-			  (ldd->ld.repayOpts[i]->name, renderer,
-			   "text", LOAN_COL_INTEREST + i,
-			   NULL);
-			gtk_tree_view_append_column(ldd->revView, column);
-                }
+            renderer = gtk_cell_renderer_text_new();
+            column = gtk_tree_view_column_new_with_attributes
+                     (ldd->ld.repayOpts[i]->name, renderer,
+                      "text", LOAN_COL_INTEREST + i,
+                      NULL);
+            gtk_tree_view_append_column(ldd->revView, column);
         }
+    }
 
-        gtk_container_add( GTK_CONTAINER(ldd->revScrollWin),
-                           GTK_WIDGET(ldd->revView) );
-        gtk_widget_show( GTK_WIDGET(ldd->revView) );
+    gtk_container_add( GTK_CONTAINER(ldd->revScrollWin),
+                       GTK_WIDGET(ldd->revView) );
+    gtk_widget_show( GTK_WIDGET(ldd->revView) );
 
-        ld_rev_recalc_schedule( ldd );
+    ld_rev_recalc_schedule( ldd );
 
-        {
-                GDate start, end;
-                g_date_clear( &start, 1 );
-                g_date_clear( &end, 1 );
-                ld_rev_get_dates( ldd, &start, &end );
-                ld_rev_update_view( ldd, &start, &end );
-        }
+    {
+        GDate start, end;
+        g_date_clear( &start, 1 );
+        g_date_clear( &end, 1 );
+        ld_rev_get_dates( ldd, &start, &end );
+        ld_rev_update_view( ldd, &start, &end );
+    }
 }
 
 static
 gboolean
 ld_rev_back( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        LoanDruidData *ldd = (LoanDruidData*)ud;
-        int i;
+    LoanDruidData *ldd = (LoanDruidData*)ud;
+    int i;
 
-        /* Get the correct page based on the repayment state. */
-        /* go back through opts list and select next enabled options. */
-        for ( i = ldd->currentIdx;
-              (i > -1) && !ldd->ld.repayOpts[i]->enabled;
-              i-- )
-                ;
-        if ( i >= 0 ) {
-                ldd->currentIdx = i;
-                /* natural transition to the payments page */
-                return FALSE;
-        }
+    /* Get the correct page based on the repayment state. */
+    /* go back through opts list and select next enabled options. */
+    for ( i = ldd->currentIdx;
+            (i > -1) && !ldd->ld.repayOpts[i]->enabled;
+            i-- )
+        ;
+    if ( i >= 0 )
+    {
+        ldd->currentIdx = i;
+        /* natural transition to the payments page */
+        return FALSE;
+    }
 
-        /* If there are no payment options, then go directly to the main
-         * repayment page. */
-        gnome_druid_set_page( ldd->druid,
-                              GNOME_DRUID_PAGE(
-                                      glade_xml_get_widget( ldd->gxml,
-                                                            PG_REPAYMENT ) ) );
-        return TRUE;
+    /* If there are no payment options, then go directly to the main
+     * repayment page. */
+    gnome_druid_set_page( ldd->druid,
+                          GNOME_DRUID_PAGE(
+                              glade_xml_get_widget( ldd->gxml,
+                                      PG_REPAYMENT ) ) );
+    return TRUE;
 }
 
 static
 gboolean
 ld_com_next( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        g_assert( FALSE );
-        return TRUE;
+    g_assert( FALSE );
+    return TRUE;
 }
 
 static
@@ -1885,21 +1962,21 @@
 gboolean
 ld_com_back( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        LoanDruidData *ldd = (LoanDruidData*)ud;
-        gnome_druid_set_page( ldd->druid,
-                              GNOME_DRUID_PAGE(
-                                      glade_xml_get_widget( ldd->gxml,
-                                                            PG_REVIEW ) ) );
-        return TRUE;
+    LoanDruidData *ldd = (LoanDruidData*)ud;
+    gnome_druid_set_page( ldd->druid,
+                          GNOME_DRUID_PAGE(
+                              glade_xml_get_widget( ldd->gxml,
+                                      PG_REVIEW ) ) );
+    return TRUE;
 }
 
 static
 void
 ld_com_fin( GnomeDruidPage *gdp, gpointer arg1, gpointer ud )
 {
-        LoanDruidData *ldd = (LoanDruidData*)ud;
-        ld_create_sxes( ldd );
-        ld_close_handler( ldd );
+    LoanDruidData *ldd = (LoanDruidData*)ud;
+    ld_create_sxes( ldd );
+    ld_close_handler( ldd );
 
 }
 
@@ -1931,13 +2008,13 @@
 void
 ld_tcSX_free( gpointer data, gpointer user_data )
 {
-        toCreateSX *tcSX = (toCreateSX*)data;
-        g_free( tcSX->name );
-        if ( tcSX->mainTxn )
-                gnc_ttinfo_free( tcSX->mainTxn );
-        if ( tcSX->escrowTxn )
-                gnc_ttinfo_free( tcSX->escrowTxn );
-        g_free( tcSX );
+    toCreateSX *tcSX = (toCreateSX*)data;
+    g_free( tcSX->name );
+    if ( tcSX->mainTxn )
+        gnc_ttinfo_free( tcSX->mainTxn );
+    if ( tcSX->escrowTxn )
+        gnc_ttinfo_free( tcSX->escrowTxn );
+    g_free( tcSX );
 }
 
 /**
@@ -1950,9 +2027,9 @@
 ld_find_ttsplit_with_acct( gconstpointer elt,
                            gconstpointer crit )
 {
-        TTSplitInfo *ttsi = (TTSplitInfo*)elt;
-        return ( (gnc_ttsplitinfo_get_account( ttsi )
-                  == (Account*)crit) ? 0 : 1 );
+    TTSplitInfo *ttsi = (TTSplitInfo*)elt;
+    return ( (gnc_ttsplitinfo_get_account( ttsi )
+              == (Account*)crit) ? 0 : 1 );
 }
 
 /**
@@ -1962,34 +2039,34 @@
 void
 ld_create_sx_from_tcSX( LoanDruidData *ldd, toCreateSX *tcSX )
 {
-        SchedXaction *sx;
-        SchedXactions *sxes;
-        GList *ttxnList;
+    SchedXaction *sx;
+    SchedXactions *sxes;
+    GList *ttxnList;
 
-        sx = xaccSchedXactionMalloc( gnc_get_current_book() );
-        xaccSchedXactionSetName( sx, tcSX->name );
-        gnc_sx_set_schedule(sx, tcSX->schedule);
-        xaccSchedXactionSetStartDate( sx, &tcSX->start );
-        xaccSchedXactionSetLastOccurDate( sx, &tcSX->last );
-        xaccSchedXactionSetEndDate( sx, &tcSX->end );
-        gnc_sx_set_instance_count( sx, tcSX->instNum );
+    sx = xaccSchedXactionMalloc( gnc_get_current_book() );
+    xaccSchedXactionSetName( sx, tcSX->name );
+    gnc_sx_set_schedule(sx, tcSX->schedule);
+    xaccSchedXactionSetStartDate( sx, &tcSX->start );
+    xaccSchedXactionSetLastOccurDate( sx, &tcSX->last );
+    xaccSchedXactionSetEndDate( sx, &tcSX->end );
+    gnc_sx_set_instance_count( sx, tcSX->instNum );
 
-        ttxnList = NULL;
-        if ( tcSX->mainTxn )
-                ttxnList = g_list_append( ttxnList, tcSX->mainTxn );
-        if ( tcSX->escrowTxn )
-                ttxnList = g_list_append( ttxnList, tcSX->escrowTxn );
+    ttxnList = NULL;
+    if ( tcSX->mainTxn )
+        ttxnList = g_list_append( ttxnList, tcSX->mainTxn );
+    if ( tcSX->escrowTxn )
+        ttxnList = g_list_append( ttxnList, tcSX->escrowTxn );
 
-        g_assert( ttxnList != NULL );
+    g_assert( ttxnList != NULL );
 
-        xaccSchedXactionSetTemplateTrans( sx, ttxnList,
-                                          gnc_get_current_book() );
+    xaccSchedXactionSetTemplateTrans( sx, ttxnList,
+                                      gnc_get_current_book() );
 
-        sxes = gnc_book_get_schedxactions(gnc_get_current_book());
-        gnc_sxes_add_sx(sxes, sx);
+    sxes = gnc_book_get_schedxactions(gnc_get_current_book());
+    gnc_sxes_add_sx(sxes, sx);
 
-        g_list_free( ttxnList );
-        ttxnList = NULL;
+    g_list_free( ttxnList );
+    ttxnList = NULL;
 }
 
 /**
@@ -2004,217 +2081,239 @@
                        toCreateSX *paymentSX,
                        toCreateSX *tcSX )
 {
-        /* In DoubleEntryAccounting-ease, this is what we're going to do,
-         * below...
-         *
-         * if ( rep->escrow ) {
-         *   if ( rep->from ) {
-         *      a: paymentSX.main.splits += split( rep->fromAcct, repAmt )
-         *      b: paymentSX.main.split( ldd->ld.escrowAcct ).debCred += repAmt
-         *         tcSX.escrow.split( rep->escrow ).debCred += repAmt
-         *     c1: tcSX.escrow.splits += split( rep->toAcct, +repAmt )
-         *   } else {
-         *      d: paymentSX.main.split( ldd->ld.repFromAcct ).debcred += -repAmt
-         *      b: paymentSX.main.split( ldd->ld.escrowAcct ).debCred += repAmt
-         *         tcSX.escrow.splits += split( rep->escrow, -repAmt )
-         *     c1: tcSX.escrow.splits += split( rep->toAcct, +repAmt )
-         *   }
-         * } else {
-         *   if ( rep->from ) {
-         *      a: paymentSX.main.splits += split( rep->fromAcct, -repAmt )
-         *     c2: paymentSX.main.splits += split( rep->toAcct,   +repAmt )
-         *   } else {
-         *      d: paymentSX.main.split( ldd->ld.payFromAcct ).debcred += -repAmt
-         *     c2: paymentSX.main.splits += split( rep->toAcct, +repAmt )
-         *   }
-         * }
-         */
+    /* In DoubleEntryAccounting-ease, this is what we're going to do,
+     * below...
+     *
+     * if ( rep->escrow ) {
+     *   if ( rep->from ) {
+     *      a: paymentSX.main.splits += split( rep->fromAcct, repAmt )
+     *      b: paymentSX.main.split( ldd->ld.escrowAcct ).debCred += repAmt
+     *         tcSX.escrow.split( rep->escrow ).debCred += repAmt
+     *     c1: tcSX.escrow.splits += split( rep->toAcct, +repAmt )
+     *   } else {
+     *      d: paymentSX.main.split( ldd->ld.repFromAcct ).debcred += -repAmt
+     *      b: paymentSX.main.split( ldd->ld.escrowAcct ).debCred += repAmt
+     *         tcSX.escrow.splits += split( rep->escrow, -repAmt )
+     *     c1: tcSX.escrow.splits += split( rep->toAcct, +repAmt )
+     *   }
+     * } else {
+     *   if ( rep->from ) {
+     *      a: paymentSX.main.splits += split( rep->fromAcct, -repAmt )
+     *     c2: paymentSX.main.splits += split( rep->toAcct,   +repAmt )
+     *   } else {
+     *      d: paymentSX.main.split( ldd->ld.payFromAcct ).debcred += -repAmt
+     *     c2: paymentSX.main.splits += split( rep->toAcct, +repAmt )
+     *   }
+     * }
+     */
 
-        /* Now, we refactor the common operations from the above out...
-         *
-         * fromSplit = NULL;
-         * if ( rep->escrow ) {
-         *   b: paymentSX.main.split( ldd->ld.escrowAcct ).debCred += repAmt
-         *  c1: ( toTTI = tcSX.escrow )
-         *   if ( rep->from ) {
-         *     a1: (fromSplit = NULL) paymentSX.main.splits += split( rep->fromAcct, repAmt )
-         *      b:
-         *         tcSX.escrow.split( rep->escrow ).debCred += repAmt
-         *     c1:
-         *   } else {
-         *     a2: (fromSplit = paymentSX.main.split( ldd->ld.repFromAcct )) .debcred += -repAmt
-         *      b:
-         *         tcSX.escrow.splits += split( rep->escrow, -repAmt )
-         *     c1:
-         *   }
-         * } else {
-         *   c2: ( toTTI = paymentSX.main )
-         *   if ( rep->from ) {
-         *     a1: (fromSplit = NULL) paymentSX.main.splits += split( rep->fromAcct, -repAmt )
-         *     c2:
-         *   } else {
-         *     a2: (fromSplit = paymentSX.main.split( ldd->ld.payFromAcct )).debcred += -repAmt
-         *     c2:
-         *   }
-         * }
-         * if ( fromSplit ) {
-         *   fromSplit.debCred += (-repAmt);
-         * } else {
-         *   fromSplit = split( rep->fromAcct, -repAmt )
-         *   paymentSX.main.splits += fromSplit
-         * }
-         * toTTI.splits += split( rep->toAcct, +repAmt );
-         */
+    /* Now, we refactor the common operations from the above out...
+     *
+     * fromSplit = NULL;
+     * if ( rep->escrow ) {
+     *   b: paymentSX.main.split( ldd->ld.escrowAcct ).debCred += repAmt
+     *  c1: ( toTTI = tcSX.escrow )
+     *   if ( rep->from ) {
+     *     a1: (fromSplit = NULL) paymentSX.main.splits += split( rep->fromAcct, repAmt )
+     *      b:
+     *         tcSX.escrow.split( rep->escrow ).debCred += repAmt
+     *     c1:
+     *   } else {
+     *     a2: (fromSplit = paymentSX.main.split( ldd->ld.repFromAcct )) .debcred += -repAmt
+     *      b:
+     *         tcSX.escrow.splits += split( rep->escrow, -repAmt )
+     *     c1:
+     *   }
+     * } else {
+     *   c2: ( toTTI = paymentSX.main )
+     *   if ( rep->from ) {
+     *     a1: (fromSplit = NULL) paymentSX.main.splits += split( rep->fromAcct, -repAmt )
+     *     c2:
+     *   } else {
+     *     a2: (fromSplit = paymentSX.main.split( ldd->ld.payFromAcct )).debcred += -repAmt
+     *     c2:
+     *   }
+     * }
+     * if ( fromSplit ) {
+     *   fromSplit.debCred += (-repAmt);
+     * } else {
+     *   fromSplit = split( rep->fromAcct, -repAmt )
+     *   paymentSX.main.splits += fromSplit
+     * }
+     * toTTI.splits += split( rep->toAcct, +repAmt );
+     */
 
-        /** Now, the actual implementation... */
+    /** Now, the actual implementation... */
 
-        GString *gstr;
-        GList *elt;
-        TTSplitInfo *fromSplit = NULL;
-        TTSplitInfo *ttsi;
-        TTInfo *toTxn = NULL;
-        GNCPrintAmountInfo pricePAI = gnc_default_price_print_info();
+    GString *gstr;
+    GList *elt;
+    TTSplitInfo *fromSplit = NULL;
+    TTSplitInfo *ttsi;
+    TTInfo *toTxn = NULL;
+    GNCPrintAmountInfo pricePAI = gnc_default_price_print_info();
 #define AMTBUF_LEN 64
-        gchar amtBuf[AMTBUF_LEN];
-        gint GNCN_HOW = (GNC_DENOM_SIGFIGS(2) | GNC_RND_ROUND);
+    gchar amtBuf[AMTBUF_LEN];
+    gint GNCN_HOW = (GNC_DENOM_SIGFIGS(2) | GNC_RND_ROUND);
 
-        /* We're going to use this a lot, below, so just create it once. */
-        xaccSPrintAmount( amtBuf,
-                          double_to_gnc_numeric( rod->amount, 100,
-                                                  GNCN_HOW ),
-                          pricePAI );
+    /* We're going to use this a lot, below, so just create it once. */
+    xaccSPrintAmount( amtBuf,
+                      double_to_gnc_numeric( rod->amount, 100,
+                              GNCN_HOW ),
+                      pricePAI );
 
-        if ( rod->throughEscrowP && ldd->ld.escrowAcct ) {
-                toTxn = tcSX->escrowTxn;
+    if ( rod->throughEscrowP && ldd->ld.escrowAcct )
+    {
+        toTxn = tcSX->escrowTxn;
 
-                /* Add the repayment amount into the string of the existing
-                 * ttsplit. */
-                {
-                        elt = g_list_find_custom(
-                                gnc_ttinfo_get_template_splits( paymentSX->mainTxn ),
-                                ldd->ld.escrowAcct,
-                                ld_find_ttsplit_with_acct );
-                        g_assert( elt );
-                        ttsi = (TTSplitInfo*)elt->data;
-                        g_assert( ttsi );
-                        gstr = g_string_new( gnc_ttsplitinfo_get_debit_formula( ttsi ) );
-                        g_string_append_printf( gstr, " + %s", amtBuf );
-                        gnc_ttsplitinfo_set_debit_formula( ttsi, gstr->str );
-                        g_string_free( gstr, TRUE );
-                        gstr = NULL;
-                        ttsi = NULL;
-                }
+        /* Add the repayment amount into the string of the existing
+         * ttsplit. */
+        {
+            elt = g_list_find_custom(
+                      gnc_ttinfo_get_template_splits( paymentSX->mainTxn ),
+                      ldd->ld.escrowAcct,
+                      ld_find_ttsplit_with_acct );
+            g_assert( elt );
+            ttsi = (TTSplitInfo*)elt->data;
+            g_assert( ttsi );
+            gstr = g_string_new( gnc_ttsplitinfo_get_debit_formula( ttsi ) );
+            g_string_append_printf( gstr, " + %s", amtBuf );
+            gnc_ttsplitinfo_set_debit_formula( ttsi, gstr->str );
+            g_string_free( gstr, TRUE );
+            gstr = NULL;
+            ttsi = NULL;
+        }
 
-                if ( rod->from != NULL ) {
-                        gchar *str;
+        if ( rod->from != NULL )
+        {
+            gchar *str;
 
-                        fromSplit = NULL;
+            fromSplit = NULL;
 
-                        /* tcSX.escrow.split( rep->escrow ).debCred += repAmt */
-                        elt = g_list_find_custom(
-                                gnc_ttinfo_get_template_splits( tcSX->escrowTxn ),
-                                ldd->ld.escrowAcct,
-                                ld_find_ttsplit_with_acct );
-                        ttsi = NULL;
-                        if ( elt ) {
-                                ttsi = (TTSplitInfo*)elt->data;
-                        }
-                        if ( !ttsi ) {
-                                /* create split */
-                                ttsi = gnc_ttsplitinfo_malloc();
-                                gnc_ttsplitinfo_set_memo( ttsi, rod->txnMemo );
-                                gnc_ttsplitinfo_set_account( ttsi, ldd->ld.escrowAcct );
-                                gnc_ttinfo_append_template_split( tcSX->escrowTxn, ttsi );
-                        }
-                        if ( (str = (gchar*)gnc_ttsplitinfo_get_credit_formula( ttsi ))
-                             == NULL ) {
-                                gstr = g_string_sized_new( 16 );
-                        } else {
-                                /* If we did get a split/didn't have to
-                                 * create a split, then we need to add our
-                                 * amount in rather than replace. */
-                                gstr = g_string_new( str );
-                                g_string_append_printf( gstr, " + " );
-                        }
-                        g_string_append_printf( gstr, "%s", amtBuf );
-                        gnc_ttsplitinfo_set_credit_formula( ttsi, gstr->str );
-                        g_string_free( gstr, TRUE );
-                        gstr = NULL;
-                        ttsi = NULL;
-                } else {
-                        /* (fromSplit = paymentSX.main.split( ldd->ld.repFromAcct )) */
-                        elt = g_list_find_custom(
-                                gnc_ttinfo_get_template_splits( paymentSX->mainTxn ),
-                                ldd->ld.repFromAcct,
-                                ld_find_ttsplit_with_acct );
-                        g_assert( elt );
-                        fromSplit = (TTSplitInfo*)elt->data;
+            /* tcSX.escrow.split( rep->escrow ).debCred += repAmt */
+            elt = g_list_find_custom(
+                      gnc_ttinfo_get_template_splits( tcSX->escrowTxn ),
+                      ldd->ld.escrowAcct,
+                      ld_find_ttsplit_with_acct );
+            ttsi = NULL;
+            if ( elt )
+            {
+                ttsi = (TTSplitInfo*)elt->data;
+            }
+            if ( !ttsi )
+            {
+                /* create split */
+                ttsi = gnc_ttsplitinfo_malloc();
+                gnc_ttsplitinfo_set_memo( ttsi, rod->txnMemo );
+                gnc_ttsplitinfo_set_account( ttsi, ldd->ld.escrowAcct );
+                gnc_ttinfo_append_template_split( tcSX->escrowTxn, ttsi );
+            }
+            if ( (str = (gchar*)gnc_ttsplitinfo_get_credit_formula( ttsi ))
+                    == NULL )
+            {
+                gstr = g_string_sized_new( 16 );
+            }
+            else
+            {
+                /* If we did get a split/didn't have to
+                 * create a split, then we need to add our
+                 * amount in rather than replace. */
+                gstr = g_string_new( str );
+                g_string_append_printf( gstr, " + " );
+            }
+            g_string_append_printf( gstr, "%s", amtBuf );
+            gnc_ttsplitinfo_set_credit_formula( ttsi, gstr->str );
+            g_string_free( gstr, TRUE );
+            gstr = NULL;
+            ttsi = NULL;
+        }
+        else
+        {
+            /* (fromSplit = paymentSX.main.split( ldd->ld.repFromAcct )) */
+            elt = g_list_find_custom(
+                      gnc_ttinfo_get_template_splits( paymentSX->mainTxn ),
+                      ldd->ld.repFromAcct,
+                      ld_find_ttsplit_with_acct );
+            g_assert( elt );
+            fromSplit = (TTSplitInfo*)elt->data;
 
-                        /* tcSX.escrow.splits += split( rep->escrow, -repAmt ) */
-                        ttsi = gnc_ttsplitinfo_malloc();
-                        gnc_ttsplitinfo_set_memo( ttsi, rod->txnMemo );
-                        gnc_ttsplitinfo_set_account( ttsi, ldd->ld.escrowAcct );
-                        gnc_ttsplitinfo_set_credit_formula( ttsi, amtBuf );
-                        gnc_ttinfo_append_template_split( tcSX->escrowTxn, ttsi );
-                        ttsi = NULL;
-                }
-        } else {
-                toTxn = tcSX->mainTxn;
+            /* tcSX.escrow.splits += split( rep->escrow, -repAmt ) */
+            ttsi = gnc_ttsplitinfo_malloc();
+            gnc_ttsplitinfo_set_memo( ttsi, rod->txnMemo );
+            gnc_ttsplitinfo_set_account( ttsi, ldd->ld.escrowAcct );
+            gnc_ttsplitinfo_set_credit_formula( ttsi, amtBuf );
+            gnc_ttinfo_append_template_split( tcSX->escrowTxn, ttsi );
+            ttsi = NULL;
+        }
+    }
+    else
+    {
+        toTxn = tcSX->mainTxn;
 
-                if ( rod->from != NULL ) {
-                        fromSplit = NULL;
-                } else {
-                        /* (fromSplit = paymentSX.main.split( ldd->ld.repFromAcct )) */
-                        elt = g_list_find_custom(
-                                gnc_ttinfo_get_template_splits( tcSX->mainTxn ),
-                                ldd->ld.repFromAcct,
-                                ld_find_ttsplit_with_acct );
-                        fromSplit = NULL;
-                        if ( elt ) {
-                                /* This is conditionally true in the case of
-                                 * a repayment on it's own schedule. */
-                                fromSplit = (TTSplitInfo*)elt->data;
-                        }
-                }
+        if ( rod->from != NULL )
+        {
+            fromSplit = NULL;
         }
+        else
+        {
+            /* (fromSplit = paymentSX.main.split( ldd->ld.repFromAcct )) */
+            elt = g_list_find_custom(
+                      gnc_ttinfo_get_template_splits( tcSX->mainTxn ),
+                      ldd->ld.repFromAcct,
+                      ld_find_ttsplit_with_acct );
+            fromSplit = NULL;
+            if ( elt )
+            {
+                /* This is conditionally true in the case of
+                 * a repayment on it's own schedule. */
+                fromSplit = (TTSplitInfo*)elt->data;
+            }
+        }
+    }
 
-        if ( fromSplit != NULL ) {
-                /* Update the existing from-split. */
-                gstr = g_string_new( gnc_ttsplitinfo_get_credit_formula( fromSplit ) );
-                g_string_append_printf( gstr, " + %s", amtBuf );
-                gnc_ttsplitinfo_set_credit_formula( fromSplit, gstr->str );
-                g_string_free( gstr, TRUE );
-                gstr = NULL;
+    if ( fromSplit != NULL )
+    {
+        /* Update the existing from-split. */
+        gstr = g_string_new( gnc_ttsplitinfo_get_credit_formula( fromSplit ) );
+        g_string_append_printf( gstr, " + %s", amtBuf );
+        gnc_ttsplitinfo_set_credit_formula( fromSplit, gstr->str );
+        g_string_free( gstr, TRUE );
+        gstr = NULL;
 
-        } else {
-                TTInfo *tti;
-                /* Create a new from-split. */
-                ttsi = gnc_ttsplitinfo_malloc();
-                gnc_ttsplitinfo_set_memo( ttsi, rod->txnMemo );
-                if ( rod->from ) {
-                        gnc_ttsplitinfo_set_account( ttsi, rod->from );
-                } else {
-                        gnc_ttsplitinfo_set_account( ttsi, ldd->ld.repFromAcct );
-                }
-                gnc_ttsplitinfo_set_credit_formula( ttsi, amtBuf );
-                tti = tcSX->mainTxn;
-                if ( rod->throughEscrowP ) {
-                        tti = paymentSX->mainTxn;
-                }
-                gnc_ttinfo_append_template_split( tti, ttsi );
-                ttsi = NULL;
-                tti  = NULL;
+    }
+    else
+    {
+        TTInfo *tti;
+        /* Create a new from-split. */
+        ttsi = gnc_ttsplitinfo_malloc();
+        gnc_ttsplitinfo_set_memo( ttsi, rod->txnMemo );
+        if ( rod->from )
+        {
+            gnc_ttsplitinfo_set_account( ttsi, rod->from );
         }
-
-        /* Add to-account split. */
+        else
         {
-                ttsi = gnc_ttsplitinfo_malloc();
-                gnc_ttsplitinfo_set_memo( ttsi, rod->txnMemo );
-                gnc_ttsplitinfo_set_account( ttsi, rod->to );
-                gnc_ttsplitinfo_set_debit_formula( ttsi, amtBuf );
-                gnc_ttinfo_append_template_split( toTxn, ttsi );
-                ttsi = NULL;
+            gnc_ttsplitinfo_set_account( ttsi, ldd->ld.repFromAcct );
         }
+        gnc_ttsplitinfo_set_credit_formula( ttsi, amtBuf );
+        tti = tcSX->mainTxn;
+        if ( rod->throughEscrowP )
+        {
+            tti = paymentSX->mainTxn;
+        }
+        gnc_ttinfo_append_template_split( tti, ttsi );
+        ttsi = NULL;
+        tti  = NULL;
+    }
+
+    /* Add to-account split. */
+    {
+        ttsi = gnc_ttsplitinfo_malloc();
+        gnc_ttsplitinfo_set_memo( ttsi, rod->txnMemo );
+        gnc_ttsplitinfo_set_account( ttsi, rod->to );
+        gnc_ttsplitinfo_set_debit_formula( ttsi, amtBuf );
+        gnc_ttinfo_append_template_split( toTxn, ttsi );
+        ttsi = NULL;
+    }
 }
 
 /**
@@ -2235,353 +2334,359 @@
 void
 ld_create_sxes( LoanDruidData *ldd )
 {
-        /* The main loan-payment SX.*/
-        toCreateSX *paymentSX = NULL;
-        /* A GList of any other repayment SXes with different schedule. */
-        GList *repaySXes = NULL;
-        /* The currently-being-referenced toCreateSX. */
-        toCreateSX *tcSX;
-        int i;
-        TTInfo *ttxn;
-        TTSplitInfo *ttsi;
-        GString *gstr;
+    /* The main loan-payment SX.*/
+    toCreateSX *paymentSX = NULL;
+    /* A GList of any other repayment SXes with different schedule. */
+    GList *repaySXes = NULL;
+    /* The currently-being-referenced toCreateSX. */
+    toCreateSX *tcSX;
+    int i;
+    TTInfo *ttxn;
+    TTSplitInfo *ttsi;
+    GString *gstr;
 
-        paymentSX = g_new0( toCreateSX, 1 );
-        paymentSX->name  = g_strdup(ldd->ld.repMemo);
-        paymentSX->start = *ldd->ld.startDate;
-        paymentSX->last  = *ldd->ld.repStartDate;
-        g_date_subtract_months( &paymentSX->last, 1 );
-        {
-                paymentSX->end = *ldd->ld.repStartDate;
-                g_date_add_months( &paymentSX->end, ldd->ld.numMonRemain - 1);
-        }
-        paymentSX->schedule = ldd->ld.repayment_schedule;
-        /* Figure out the correct current instance-count for the txns in the
-         * SX. */
-        paymentSX->instNum =
-                (ldd->ld.numPer * ( ldd->ld.perSize == GNC_YEARS ? 12 : 1 ))
-                - ldd->ld.numMonRemain + 1;
+    paymentSX = g_new0( toCreateSX, 1 );
+    paymentSX->name  = g_strdup(ldd->ld.repMemo);
+    paymentSX->start = *ldd->ld.startDate;
+    paymentSX->last  = *ldd->ld.repStartDate;
+    g_date_subtract_months( &paymentSX->last, 1 );
+    {
+        paymentSX->end = *ldd->ld.repStartDate;
+        g_date_add_months( &paymentSX->end, ldd->ld.numMonRemain - 1);
+    }
+    paymentSX->schedule = ldd->ld.repayment_schedule;
+    /* Figure out the correct current instance-count for the txns in the
+     * SX. */
+    paymentSX->instNum =
+        (ldd->ld.numPer * ( ldd->ld.perSize == GNC_YEARS ? 12 : 1 ))
+        - ldd->ld.numMonRemain + 1;
 
-        paymentSX->mainTxn = gnc_ttinfo_malloc();
-        gnc_ttinfo_set_currency( paymentSX->mainTxn,
-                                 gnc_default_currency() );
-        {
-                GString *payMainTxnDesc = g_string_sized_new( 32 );
-                g_string_printf( payMainTxnDesc,
-                                 "%s - %s",
-                                 ldd->ld.repMemo,
-                                 ( ldd->ld.escrowAcct == NULL
-                                   ? _("Payment")
-				   : _("Escrow Payment") )
-				 );
+    paymentSX->mainTxn = gnc_ttinfo_malloc();
+    gnc_ttinfo_set_currency( paymentSX->mainTxn,
+                             gnc_default_currency() );
+    {
+        GString *payMainTxnDesc = g_string_sized_new( 32 );
+        g_string_printf( payMainTxnDesc,
+                         "%s - %s",
+                         ldd->ld.repMemo,
+                         ( ldd->ld.escrowAcct == NULL
+                           ? _("Payment")
+                           : _("Escrow Payment") )
+                       );
 
-                gnc_ttinfo_set_description( paymentSX->mainTxn,
-                                            payMainTxnDesc->str );
-                g_string_free( payMainTxnDesc, TRUE );
-        }
+        gnc_ttinfo_set_description( paymentSX->mainTxn,
+                                    payMainTxnDesc->str );
+        g_string_free( payMainTxnDesc, TRUE );
+    }
 
-        /* Create the basic txns and splits...
-         *
-         * ttxn <- mainTxn
-         * srcAcct <- assets
-         * if ( escrow ) {
-         *  realSrcAcct <- srcAcct
-         *  srcAcct     <- escrow;
-         *  ttxn <- escrowTxn
-         *  main.splits += split( realSrcAcct, -pmt )
-         *  main.splits += split( escrow,       pmt )
-         * }
-         * ttxn.splits += split( escrow,            -pmt)
-         * ttxn.splits += split( liability,          ppmt )
-         * ttxn.splits += split( expenses:interest,  ipmt ) */
+    /* Create the basic txns and splits...
+     *
+     * ttxn <- mainTxn
+     * srcAcct <- assets
+     * if ( escrow ) {
+     *  realSrcAcct <- srcAcct
+     *  srcAcct     <- escrow;
+     *  ttxn <- escrowTxn
+     *  main.splits += split( realSrcAcct, -pmt )
+     *  main.splits += split( escrow,       pmt )
+     * }
+     * ttxn.splits += split( escrow,            -pmt)
+     * ttxn.splits += split( liability,          ppmt )
+     * ttxn.splits += split( expenses:interest,  ipmt ) */
 
-        {
-                Account *srcAcct;
+    {
+        Account *srcAcct;
 
-                ttxn = paymentSX->mainTxn;
-                srcAcct = ldd->ld.repFromAcct;
+        ttxn = paymentSX->mainTxn;
+        srcAcct = ldd->ld.repFromAcct;
 
-                if ( ldd->ld.escrowAcct != NULL ) {
-                        Account *realSrcAcct = srcAcct;
-                        srcAcct = ldd->ld.escrowAcct;
+        if ( ldd->ld.escrowAcct != NULL )
+        {
+            Account *realSrcAcct = srcAcct;
+            srcAcct = ldd->ld.escrowAcct;
 
-                        gstr = g_string_sized_new( 32 );
-                        ld_get_pmt_formula( ldd, gstr );
-                        /* ttxn.splits += split( realSrcAcct, -pmt ); */
-                        {
-                                ttsi = gnc_ttsplitinfo_malloc();
-                                gnc_ttsplitinfo_set_memo( ttsi, ldd->ld.repMemo );
-                                gnc_ttsplitinfo_set_account( ttsi, realSrcAcct );
-                                gnc_ttsplitinfo_set_credit_formula( ttsi, gstr->str );
-                                gnc_ttinfo_append_template_split( ttxn, ttsi );
-                                ttsi = NULL;
-                        }
+            gstr = g_string_sized_new( 32 );
+            ld_get_pmt_formula( ldd, gstr );
+            /* ttxn.splits += split( realSrcAcct, -pmt ); */
+            {
+                ttsi = gnc_ttsplitinfo_malloc();
+                gnc_ttsplitinfo_set_memo( ttsi, ldd->ld.repMemo );
+                gnc_ttsplitinfo_set_account( ttsi, realSrcAcct );
+                gnc_ttsplitinfo_set_credit_formula( ttsi, gstr->str );
+                gnc_ttinfo_append_template_split( ttxn, ttsi );
+                ttsi = NULL;
+            }
 
-                        /* ttxn.splits += split( escrowAcct, +pmt ); */
-                        {
-                                ttsi = gnc_ttsplitinfo_malloc();
-                                gnc_ttsplitinfo_set_memo( ttsi, ldd->ld.repMemo );
-                                gnc_ttsplitinfo_set_account( ttsi, ldd->ld.escrowAcct );
-                                gnc_ttsplitinfo_set_debit_formula( ttsi, gstr->str );
-                                gnc_ttinfo_append_template_split( ttxn, ttsi );
-                                ttsi = NULL;
-                        }
-                        g_string_free( gstr, TRUE );
-                        gstr = NULL;
+            /* ttxn.splits += split( escrowAcct, +pmt ); */
+            {
+                ttsi = gnc_ttsplitinfo_malloc();
+                gnc_ttsplitinfo_set_memo( ttsi, ldd->ld.repMemo );
+                gnc_ttsplitinfo_set_account( ttsi, ldd->ld.escrowAcct );
+                gnc_ttsplitinfo_set_debit_formula( ttsi, gstr->str );
+                gnc_ttinfo_append_template_split( ttxn, ttsi );
+                ttsi = NULL;
+            }
+            g_string_free( gstr, TRUE );
+            gstr = NULL;
 
-                        paymentSX->escrowTxn = gnc_ttinfo_malloc();
-                        gnc_ttinfo_set_currency( paymentSX->escrowTxn,
-                                                 gnc_default_currency() );
+            paymentSX->escrowTxn = gnc_ttinfo_malloc();
+            gnc_ttinfo_set_currency( paymentSX->escrowTxn,
+                                     gnc_default_currency() );
 
-                        {
-                                GString *escrowTxnDesc;
-                                escrowTxnDesc = g_string_new( ldd->ld.repMemo );
-                                g_string_append_printf( escrowTxnDesc, " - %s", _("Payment") );
-                                gnc_ttinfo_set_description( paymentSX->escrowTxn,
-                                                            escrowTxnDesc->str );
-                                g_string_free( escrowTxnDesc, TRUE );
-                        }
-                        ttxn = paymentSX->escrowTxn;
-                }
+            {
+                GString *escrowTxnDesc;
+                escrowTxnDesc = g_string_new( ldd->ld.repMemo );
+                g_string_append_printf( escrowTxnDesc, " - %s", _("Payment") );
+                gnc_ttinfo_set_description( paymentSX->escrowTxn,
+                                            escrowTxnDesc->str );
+                g_string_free( escrowTxnDesc, TRUE );
+            }
+            ttxn = paymentSX->escrowTxn;
+        }
 
-                /* ttxn.splits += split( srcAcct, -pmt ); */
-                {
-                        ttsi = gnc_ttsplitinfo_malloc();
-                        {
-                                gstr = g_string_new( ldd->ld.repMemo );
-                                g_string_append_printf( gstr, " - %s",
-                                                        _("Payment") );
-                                gnc_ttsplitinfo_set_memo( ttsi, gstr->str );
-                                g_string_free( gstr, TRUE );
-                                gstr = NULL;
-                        }
-                        gnc_ttsplitinfo_set_account( ttsi, srcAcct );
-                        gstr = g_string_sized_new( 32 );
-                        ld_get_pmt_formula( ldd, gstr );
-                        gnc_ttsplitinfo_set_credit_formula( ttsi, gstr->str );
-                        gnc_ttinfo_append_template_split( ttxn, ttsi );
-                        g_string_free( gstr, TRUE );
-                        gstr = NULL;
-                        ttsi = NULL;
-                }
+        /* ttxn.splits += split( srcAcct, -pmt ); */
+        {
+            ttsi = gnc_ttsplitinfo_malloc();
+            {
+                gstr = g_string_new( ldd->ld.repMemo );
+                g_string_append_printf( gstr, " - %s",
+                                        _("Payment") );
+                gnc_ttsplitinfo_set_memo( ttsi, gstr->str );
+                g_string_free( gstr, TRUE );
+                gstr = NULL;
+            }
+            gnc_ttsplitinfo_set_account( ttsi, srcAcct );
+            gstr = g_string_sized_new( 32 );
+            ld_get_pmt_formula( ldd, gstr );
+            gnc_ttsplitinfo_set_credit_formula( ttsi, gstr->str );
+            gnc_ttinfo_append_template_split( ttxn, ttsi );
+            g_string_free( gstr, TRUE );
+            gstr = NULL;
+            ttsi = NULL;
+        }
 
-                /* ttxn.splits += split( ldd->ld.repPriAcct, +ppmt ); */
-                {
-                        ttsi = gnc_ttsplitinfo_malloc();
-                        {
-                                gstr = g_string_new( ldd->ld.repMemo );
-                                g_string_append_printf( gstr, " - %s",
-                                                        _("Principal") );
-                                gnc_ttsplitinfo_set_memo( ttsi, gstr->str );
-                                g_string_free( gstr, TRUE );
-                                gstr = NULL;
-                        }
-                        gnc_ttsplitinfo_set_account( ttsi, ldd->ld.repPriAcct );
-                        gstr = g_string_sized_new( 32 );
-                        ld_get_ppmt_formula( ldd, gstr );
-                        gnc_ttsplitinfo_set_debit_formula( ttsi, gstr->str );
-                        gnc_ttinfo_append_template_split( ttxn, ttsi );
-                        g_string_free( gstr, TRUE );
-                        gstr = NULL;
-                        ttsi = NULL;
-                }
+        /* ttxn.splits += split( ldd->ld.repPriAcct, +ppmt ); */
+        {
+            ttsi = gnc_ttsplitinfo_malloc();
+            {
+                gstr = g_string_new( ldd->ld.repMemo );
+                g_string_append_printf( gstr, " - %s",
+                                        _("Principal") );
+                gnc_ttsplitinfo_set_memo( ttsi, gstr->str );
+                g_string_free( gstr, TRUE );
+                gstr = NULL;
+            }
+            gnc_ttsplitinfo_set_account( ttsi, ldd->ld.repPriAcct );
+            gstr = g_string_sized_new( 32 );
+            ld_get_ppmt_formula( ldd, gstr );
+            gnc_ttsplitinfo_set_debit_formula( ttsi, gstr->str );
+            gnc_ttinfo_append_template_split( ttxn, ttsi );
+            g_string_free( gstr, TRUE );
+            gstr = NULL;
+            ttsi = NULL;
+        }
 
-                /* ttxn.splits += split( ldd->ld.repIntAcct, +ipmt ); */
-                {
-                        ttsi = gnc_ttsplitinfo_malloc();
-                        {
-                                gstr = g_string_new( ldd->ld.repMemo );
-                                g_string_append_printf( gstr, " - %s",
-                                                        _("Interest") );
-                                gnc_ttsplitinfo_set_memo( ttsi, gstr->str );
-                                g_string_free( gstr, TRUE );
-                                gstr = NULL;
-                        }
-                        gnc_ttsplitinfo_set_account( ttsi, ldd->ld.repIntAcct );
-                        gstr = g_string_sized_new( 32 );
-                        ld_get_ipmt_formula( ldd, gstr );
-                        gnc_ttsplitinfo_set_debit_formula( ttsi, gstr->str );
-                        gnc_ttinfo_append_template_split( ttxn, ttsi );
-                        g_string_free( gstr, TRUE );
-                        gstr = NULL;
-                        ttsi = NULL;
-                }
+        /* ttxn.splits += split( ldd->ld.repIntAcct, +ipmt ); */
+        {
+            ttsi = gnc_ttsplitinfo_malloc();
+            {
+                gstr = g_string_new( ldd->ld.repMemo );
+                g_string_append_printf( gstr, " - %s",
+                                        _("Interest") );
+                gnc_ttsplitinfo_set_memo( ttsi, gstr->str );
+                g_string_free( gstr, TRUE );
+                gstr = NULL;
+            }
+            gnc_ttsplitinfo_set_account( ttsi, ldd->ld.repIntAcct );
+            gstr = g_string_sized_new( 32 );
+            ld_get_ipmt_formula( ldd, gstr );
+            gnc_ttsplitinfo_set_debit_formula( ttsi, gstr->str );
+            gnc_ttinfo_append_template_split( ttxn, ttsi );
+            g_string_free( gstr, TRUE );
+            gstr = NULL;
+            ttsi = NULL;
         }
+    }
 
-        for ( i=0; i < ldd->ld.repayOptCount; i++ ) {
-                RepayOptData *rod = ldd->ld.repayOpts[i];
-                if ( ! rod->enabled )
-                        continue;
+    for ( i = 0; i < ldd->ld.repayOptCount; i++ )
+    {
+        RepayOptData *rod = ldd->ld.repayOpts[i];
+        if ( ! rod->enabled )
+            continue;
 
-                tcSX = paymentSX;
-                if ( rod->schedule != NULL ) {
-                        tcSX = g_new0( toCreateSX, 1 );
-                        gstr = g_string_new( ldd->ld.repMemo );
-                        g_string_append_printf( gstr, " - %s",
-                                                rod->name );
-                        tcSX->name    = g_strdup(gstr->str);
-                        tcSX->start   = *ldd->ld.startDate;
-                        tcSX->last    = *ldd->ld.repStartDate;
-                        {
-                                tcSX->end = tcSX->last;
-                                g_date_add_months( &tcSX->end, ldd->ld.numMonRemain );
-                        }
-                        tcSX->schedule = rod->schedule;
-                        /* So it won't get destroyed when the close the
-                         * Druid. */
-                        tcSX->instNum =
-                            ld_calc_sx_instance_num(&tcSX->start, rod->schedule);
-                        rod->schedule = NULL;
-                        tcSX->mainTxn = gnc_ttinfo_malloc();
-                        gnc_ttinfo_set_currency( tcSX->mainTxn,
-                                                 gnc_default_currency() );
-                        gnc_ttinfo_set_description( tcSX->mainTxn,
-                                                    gstr->str );
-                        tcSX->escrowTxn = gnc_ttinfo_malloc();
-                        gnc_ttinfo_set_currency( tcSX->escrowTxn,
-                                                 gnc_default_currency() );
-                        gnc_ttinfo_set_description( tcSX->escrowTxn,
-                                                    gstr->str );
+        tcSX = paymentSX;
+        if ( rod->schedule != NULL )
+        {
+            tcSX = g_new0( toCreateSX, 1 );
+            gstr = g_string_new( ldd->ld.repMemo );
+            g_string_append_printf( gstr, " - %s",
+                                    rod->name );
+            tcSX->name    = g_strdup(gstr->str);
+            tcSX->start   = *ldd->ld.startDate;
+            tcSX->last    = *ldd->ld.repStartDate;
+            {
+                tcSX->end = tcSX->last;
+                g_date_add_months( &tcSX->end, ldd->ld.numMonRemain );
+            }
+            tcSX->schedule = rod->schedule;
+            /* So it won't get destroyed when the close the
+             * Druid. */
+            tcSX->instNum =
+                ld_calc_sx_instance_num(&tcSX->start, rod->schedule);
+            rod->schedule = NULL;
+            tcSX->mainTxn = gnc_ttinfo_malloc();
+            gnc_ttinfo_set_currency( tcSX->mainTxn,
+                                     gnc_default_currency() );
+            gnc_ttinfo_set_description( tcSX->mainTxn,
+                                        gstr->str );
+            tcSX->escrowTxn = gnc_ttinfo_malloc();
+            gnc_ttinfo_set_currency( tcSX->escrowTxn,
+                                     gnc_default_currency() );
+            gnc_ttinfo_set_description( tcSX->escrowTxn,
+                                        gstr->str );
 
-                        g_string_free( gstr, TRUE );
-                        gstr = NULL;
+            g_string_free( gstr, TRUE );
+            gstr = NULL;
 
-                        repaySXes = g_list_append( repaySXes, tcSX );
+            repaySXes = g_list_append( repaySXes, tcSX );
 
-                }
-
-                /* repayment */
-                ld_setup_repayment_sx( ldd, rod, paymentSX, tcSX );
         }
 
-        /* Create the SXes */
-        {
-                GList *l;
+        /* repayment */
+        ld_setup_repayment_sx( ldd, rod, paymentSX, tcSX );
+    }
 
-                ld_create_sx_from_tcSX( ldd, paymentSX );
+    /* Create the SXes */
+    {
+        GList *l;
 
-                for ( l=repaySXes; l; l = l->next ) {
-                        ld_create_sx_from_tcSX( ldd, (toCreateSX*)l->data );
-                }
+        ld_create_sx_from_tcSX( ldd, paymentSX );
+
+        for ( l = repaySXes; l; l = l->next )
+        {
+            ld_create_sx_from_tcSX( ldd, (toCreateSX*)l->data );
         }
+    }
 
-        /* Clean up. */
-        ld_tcSX_free( paymentSX, NULL );
-        g_list_foreach( repaySXes, ld_tcSX_free, NULL );
-        g_list_free( repaySXes );
+    /* Clean up. */
+    ld_tcSX_free( paymentSX, NULL );
+    g_list_foreach( repaySXes, ld_tcSX_free, NULL );
+    g_list_free( repaySXes );
 }
 
 static
 void
 ld_calc_upd_rem_payments( GtkWidget *w, gpointer ud )
 {
-        LoanDruidData *ldd = (LoanDruidData*)ud;
-        GDate start, now;
-        int i, totalVal, total, remain;
+    LoanDruidData *ldd = (LoanDruidData*)ud;
+    GDate start, now;
+    int i, totalVal, total, remain;
 
-        g_date_clear( &start, 1 );
-        g_date_clear( &now, 1 );
-        g_date_set_time_t( &start, gnc_date_edit_get_date( ldd->prmStartDateGDE ) );
-        g_date_set_time_t( &now, time(NULL) );
-        for ( i=0; g_date_compare( &start, &now ) < 0; i++ ) {
-                g_date_add_months( &start, 1 );
-        }
+    g_date_clear( &start, 1 );
+    g_date_clear( &now, 1 );
+    g_date_set_time_t( &start, gnc_date_edit_get_date( ldd->prmStartDateGDE ) );
+    g_date_set_time_t( &now, time(NULL) );
+    for ( i = 0; g_date_compare( &start, &now ) < 0; i++ )
+    {
+        g_date_add_months( &start, 1 );
+    }
 
-        /* Get the correct, current value of the length spin. */
-        {
-                gchar *valueStr = gtk_editable_get_chars( GTK_EDITABLE(ldd->prmLengthSpin),
-                                                          0, -1 );
-                totalVal = strtol( valueStr, NULL, 10 );
-                g_free( valueStr );
-        }
-        total = totalVal
-                * ( gtk_combo_box_get_active( ldd->prmLengthType )
-                    == 1 ? 12 : 1 );
-        remain = total - i;
-        gtk_spin_button_set_value( ldd->prmRemainSpin, remain );
-        gtk_widget_show( GTK_WIDGET(ldd->prmRemainSpin) );
+    /* Get the correct, current value of the length spin. */
+    {
+        gchar *valueStr = gtk_editable_get_chars( GTK_EDITABLE(ldd->prmLengthSpin),
+                          0, -1 );
+        totalVal = strtol( valueStr, NULL, 10 );
+        g_free( valueStr );
+    }
+    total = totalVal
+            * ( gtk_combo_box_get_active( ldd->prmLengthType )
+                == 1 ? 12 : 1 );
+    remain = total - i;
+    gtk_spin_button_set_value( ldd->prmRemainSpin, remain );
+    gtk_widget_show( GTK_WIDGET(ldd->prmRemainSpin) );
 }
 
 static
 void
 ld_rev_range_opt_changed( GtkComboBox *combo, gpointer ud )
 {
-        LoanDruidData *ldd = (LoanDruidData*)ud;
-        int opt;
+    LoanDruidData *ldd = (LoanDruidData*)ud;
+    int opt;
 
-        opt = gtk_combo_box_get_active( ldd->revRangeOpt );
-        gtk_widget_set_sensitive( GTK_WIDGET(ldd->revDateFrame),
-                                  (opt == CUSTOM) );
-        {
-                GDate start, end;
-                g_date_clear( &start, 1 );
-                g_date_clear( &end, 1 );
-                ld_rev_get_dates( ldd, &start, &end );
-                ld_rev_update_view( ldd, &start, &end );
-        }
+    opt = gtk_combo_box_get_active( ldd->revRangeOpt );
+    gtk_widget_set_sensitive( GTK_WIDGET(ldd->revDateFrame),
+                              (opt == CUSTOM) );
+    {
+        GDate start, end;
+        g_date_clear( &start, 1 );
+        g_date_clear( &end, 1 );
+        ld_rev_get_dates( ldd, &start, &end );
+        ld_rev_update_view( ldd, &start, &end );
+    }
 }
 
 static
 void
 ld_rev_range_changed( GNCDateEdit *gde, gpointer ud )
 {
-        LoanDruidData *ldd = (LoanDruidData*)ud;
-        {
-                GDate start, end;
-                g_date_clear( &start, 1 );
-                g_date_clear( &end, 1 );
-                ld_rev_get_dates( ldd, &start, &end );
-                ld_rev_update_view( ldd, &start, &end );
-        }
+    LoanDruidData *ldd = (LoanDruidData*)ud;
+    {
+        GDate start, end;
+        g_date_clear( &start, 1 );
+        g_date_clear( &end, 1 );
+        ld_rev_get_dates( ldd, &start, &end );
+        ld_rev_update_view( ldd, &start, &end );
+    }
 }
 
 static
 void
 ld_get_loan_range( LoanDruidData *ldd, GDate *start, GDate *end )
 {
-        int monthsTotal;
-        struct tm *endDateMath;
+    int monthsTotal;
+    struct tm *endDateMath;
 
-        *start = *ldd->ld.startDate;
+    *start = *ldd->ld.startDate;
 
-        endDateMath = g_new0( struct tm, 1 );
-        g_date_to_struct_tm( ldd->ld.startDate, endDateMath );
-        monthsTotal = ( (ldd->ld.numPer - 1)
-                        * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) );
-        endDateMath->tm_mon += monthsTotal;
-        g_date_set_time_t( end, mktime( endDateMath ) );
-        g_free( endDateMath );
+    endDateMath = g_new0( struct tm, 1 );
+    g_date_to_struct_tm( ldd->ld.startDate, endDateMath );
+    monthsTotal = ( (ldd->ld.numPer - 1)
+                    * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) );
+    endDateMath->tm_mon += monthsTotal;
+    g_date_set_time_t( end, mktime( endDateMath ) );
+    g_free( endDateMath );
 }
 
 static
 void
 ld_rev_get_dates( LoanDruidData *ldd, GDate *start, GDate *end )
 {
-        int range = gtk_combo_box_get_active( ldd->revRangeOpt );
-        switch ( range ) {
-        case CURRENT_YEAR:
-                g_date_set_time_t( start, time(NULL) );
-                g_date_set_dmy( start, 1, G_DATE_JANUARY, g_date_get_year( start ) );
-                g_date_set_dmy( end, 31, G_DATE_DECEMBER, g_date_get_year( start ) );
-                break;
-        case NOW_PLUS_ONE:
-                g_date_set_time_t( start, time(NULL) );
-                *end = *start;
-                g_date_add_years( end, 1 );
-                break;
-        case WHOLE_LOAN:
-                ld_get_loan_range( ldd, start, end );
-                break;
-        case CUSTOM:
-                g_date_set_time_t( start,
-				   gnc_date_edit_get_date( ldd->revStartDate ) );
-                g_date_set_time_t( end,
-				   gnc_date_edit_get_date( ldd->revEndDate ) );
-                break;
-        default:
-                PERR( "Unknown review date range option %d", range );
-                break;
-        }
+    int range = gtk_combo_box_get_active( ldd->revRangeOpt );
+    switch ( range )
+    {
+    case CURRENT_YEAR:
+        g_date_set_time_t( start, time(NULL) );
+        g_date_set_dmy( start, 1, G_DATE_JANUARY, g_date_get_year( start ) );
+        g_date_set_dmy( end, 31, G_DATE_DECEMBER, g_date_get_year( start ) );
+        break;
+    case NOW_PLUS_ONE:
+        g_date_set_time_t( start, time(NULL) );
+        *end = *start;
+        g_date_add_years( end, 1 );
+        break;
+    case WHOLE_LOAN:
+        ld_get_loan_range( ldd, start, end );
+        break;
+    case CUSTOM:
+        g_date_set_time_t( start,
+                           gnc_date_edit_get_date( ldd->revStartDate ) );
+        g_date_set_time_t( end,
+                           gnc_date_edit_get_date( ldd->revEndDate ) );
+        break;
+    default:
+        PERR( "Unknown review date range option %d", range );
+        break;
+    }
 
 }
 
@@ -2589,269 +2694,278 @@
 void
 ld_rev_sched_list_free( gpointer data, gpointer user_data )
 {
-        RevRepaymentRow *rrr = (RevRepaymentRow*)data;
-        g_free( rrr->numCells );
-        g_free( rrr );
+    RevRepaymentRow *rrr = (RevRepaymentRow*)data;
+    g_free( rrr->numCells );
+    g_free( rrr );
 }
 
 static
 void
 ld_rev_hash_to_list( gpointer key, gpointer val, gpointer user_data )
 {
-        GList **l = (GList**)user_data;
-        RevRepaymentRow *rrr = g_new0( RevRepaymentRow, 1 );
-        if ( !key || !val ) {
-                DEBUG( "%.8x, %.8x",
-                       GPOINTER_TO_UINT(key),
-                       GPOINTER_TO_UINT(val));
-                return;
-        }
-        rrr->date = *(GDate*)key;
-        rrr->numCells = (gnc_numeric*)val;
-        *l = g_list_append( *l, (gpointer)rrr );
+    GList **l = (GList**)user_data;
+    RevRepaymentRow *rrr = g_new0( RevRepaymentRow, 1 );
+    if ( !key || !val )
+    {
+        DEBUG( "%.8x, %.8x",
+               GPOINTER_TO_UINT(key),
+               GPOINTER_TO_UINT(val));
+        return;
+    }
+    rrr->date = *(GDate*)key;
+    rrr->numCells = (gnc_numeric*)val;
+    *l = g_list_append( *l, (gpointer)rrr );
 }
 
 static
 void
 ld_rev_hash_free_date_keys( gpointer key, gpointer val, gpointer user_data )
 {
-        g_free( (GDate*)key );
+    g_free( (GDate*)key );
 }
 
 static
 void
 ld_rev_recalc_schedule( LoanDruidData *ldd )
 {
-        GDate start, end;
-        gnc_numeric *rowNumData;
-        GHashTable *repayment_schedule;
+    GDate start, end;
+    gnc_numeric *rowNumData;
+    GHashTable *repayment_schedule;
 
-        g_date_clear( &start, 1 );
-        g_date_clear( &end, 1 );
-        ld_get_loan_range( ldd, &start, &end );
+    g_date_clear( &start, 1 );
+    g_date_clear( &end, 1 );
+    ld_get_loan_range( ldd, &start, &end );
 
-        /* The repayment_schedule is a hash of GDates to
-         * row-of-gnc_numeric[N] data, where N is the number of columns as
-         * determined by the _prep function, and stored in
-         * LoanData::revNumPmts. */
-        repayment_schedule = g_hash_table_new(gnc_gdate_hash, gnc_gdate_equal);
+    /* The repayment_schedule is a hash of GDates to
+     * row-of-gnc_numeric[N] data, where N is the number of columns as
+     * determined by the _prep function, and stored in
+     * LoanData::revNumPmts. */
+    repayment_schedule = g_hash_table_new(gnc_gdate_hash, gnc_gdate_equal);
 
-        /* Do the master repayment */
+    /* Do the master repayment */
+    {
+        GDate curDate, nextDate;
+        GString *pmtFormula, *ppmtFormula, *ipmtFormula;
+        int i;
+        GHashTable *ivar;
+
+        pmtFormula = g_string_sized_new( 64 );
+        ld_get_pmt_formula( ldd, pmtFormula );
+        ppmtFormula = g_string_sized_new( 64 );
+        ld_get_ppmt_formula( ldd, ppmtFormula );
+        ipmtFormula = g_string_sized_new( 64 );
+        ld_get_ipmt_formula( ldd, ipmtFormula );
+
+        ivar = g_hash_table_new( g_str_hash, g_str_equal );
+        g_date_clear( &curDate, 1 );
+        curDate = start;
+        g_date_subtract_days( &curDate, 1 );
+        g_date_clear(&nextDate, 1);
+        recurrenceListNextInstance(ldd->ld.repayment_schedule, &curDate, &nextDate);
+        for ( i = 1;
+                g_date_valid( &nextDate )
+                && g_date_compare( &nextDate, &end ) <= 0 ;
+                i++,
+                curDate = nextDate,
+                recurrenceListNextInstance(ldd->ld.repayment_schedule,
+                                           &curDate, &nextDate))
         {
-                GDate curDate, nextDate;
-                GString *pmtFormula, *ppmtFormula, *ipmtFormula;
-                int i;
-                GHashTable *ivar;
+            gnc_numeric ival;
+            gnc_numeric val;
+            char *eloc;
+            rowNumData =
+                (gnc_numeric*)g_hash_table_lookup( repayment_schedule,
+                                                   &curDate );
+            if ( rowNumData == NULL)
+            {
+                int j;
+                GDate *dateKeyCopy = g_date_new();
 
-                pmtFormula = g_string_sized_new( 64 );
-                ld_get_pmt_formula( ldd, pmtFormula );
-                ppmtFormula = g_string_sized_new( 64 );
-                ld_get_ppmt_formula( ldd, ppmtFormula );
-                ipmtFormula = g_string_sized_new( 64 );
-                ld_get_ipmt_formula( ldd, ipmtFormula );
-
-                ivar = g_hash_table_new( g_str_hash, g_str_equal );
-                g_date_clear( &curDate, 1 );
-                curDate = start;
-                g_date_subtract_days( &curDate, 1 );
-                g_date_clear(&nextDate, 1);
-                recurrenceListNextInstance(ldd->ld.repayment_schedule, &curDate, &nextDate);
-                for ( i=1;
-                      g_date_valid( &nextDate )
-                      && g_date_compare( &nextDate, &end ) <= 0 ;
-                      i++,
-                      curDate = nextDate,
-                      recurrenceListNextInstance(ldd->ld.repayment_schedule,
-                                                 &curDate, &nextDate))
+                *dateKeyCopy = curDate;
+                rowNumData = g_new0( gnc_numeric, ldd->ld.revNumPmts );
+                g_assert( rowNumData != NULL );
+                for ( j = 0; j < ldd->ld.revNumPmts; j++ )
                 {
-                        gnc_numeric ival;
-                        gnc_numeric val;
-                        char *eloc;
-                        rowNumData =
-                                (gnc_numeric*)g_hash_table_lookup( repayment_schedule,
-                                                                   &curDate );
-                        if ( rowNumData == NULL) {
-                                int j;
-                                GDate *dateKeyCopy = g_date_new();
+                    rowNumData[j] = gnc_numeric_error( GNC_ERROR_ARG );
+                }
+                g_hash_table_insert( repayment_schedule,
+                                     (gpointer)dateKeyCopy,
+                                     (gpointer)rowNumData );
+            }
 
-                                *dateKeyCopy = curDate;
-                                rowNumData = g_new0( gnc_numeric, ldd->ld.revNumPmts );
-                                g_assert( rowNumData != NULL );
-                                for ( j=0; j<ldd->ld.revNumPmts; j++ ) {
-                                        rowNumData[j] = gnc_numeric_error( GNC_ERROR_ARG );
-                                }
-                                g_hash_table_insert( repayment_schedule,
-                                                     (gpointer)dateKeyCopy,
-                                                     (gpointer)rowNumData );
-                        }
+            /* evaluate the expressions given the correct
+             * sequence number i */
+            ival = gnc_numeric_create( i, 1 );
+            g_hash_table_insert( ivar, "i", &ival );
 
-                        /* evaluate the expressions given the correct
-                         * sequence number i */
-                        ival = gnc_numeric_create( i, 1 );
-                        g_hash_table_insert( ivar, "i", &ival );
+            if ( ! gnc_exp_parser_parse_separate_vars(
+                        pmtFormula->str, &val, &eloc, ivar ) )
+            {
+                PERR( "pmt Parsing error at %s", eloc );
+                continue;
+            }
+            val = gnc_numeric_convert( val, 100, GNC_RND_ROUND );
+            rowNumData[0] = val;
 
-                        if ( ! gnc_exp_parser_parse_separate_vars(
-                                     pmtFormula->str, &val, &eloc, ivar ) ) {
-                                PERR( "pmt Parsing error at %s", eloc );
-                                continue;
-                        }
-                        val = gnc_numeric_convert( val, 100, GNC_RND_ROUND );
-                        rowNumData[0] = val;
+            if ( ! gnc_exp_parser_parse_separate_vars(
+                        ppmtFormula->str, &val, &eloc, ivar ) )
+            {
+                PERR( "ppmt Parsing error at %s", eloc );
+                continue;
+            }
+            val = gnc_numeric_convert( val, 100, GNC_RND_ROUND );
+            rowNumData[1] = val;
 
-                        if ( ! gnc_exp_parser_parse_separate_vars(
-                                     ppmtFormula->str, &val, &eloc, ivar ) ) {
-                                PERR( "ppmt Parsing error at %s", eloc );
-                                continue;
-                        }
-                        val = gnc_numeric_convert( val, 100, GNC_RND_ROUND );
-                        rowNumData[1] = val;
+            if ( ! gnc_exp_parser_parse_separate_vars(
+                        ipmtFormula->str, &val, &eloc, ivar ) )
+            {
+                PERR( "ipmt Parsing error at %s", eloc );
+                continue;
+            }
+            val = gnc_numeric_convert( val, 100, GNC_RND_ROUND );
+            rowNumData[2] = val;
+        }
 
-                        if ( ! gnc_exp_parser_parse_separate_vars(
-                                     ipmtFormula->str, &val, &eloc, ivar ) ) {
-                                PERR( "ipmt Parsing error at %s", eloc );
-                                continue;
-                        }
-                        val = gnc_numeric_convert( val, 100, GNC_RND_ROUND );
-                        rowNumData[2] = val;
-                }
+        g_string_free( ipmtFormula, TRUE );
+        g_string_free( ppmtFormula, TRUE );
+        g_string_free( pmtFormula, TRUE );
 
-                g_string_free( ipmtFormula, TRUE );
-                g_string_free( ppmtFormula, TRUE );
-                g_string_free( pmtFormula, TRUE );
+        g_hash_table_destroy( ivar );
+    }
 
-                g_hash_table_destroy( ivar );
-        }
+    /* Process any other enabled payments. */
+    {
+        int i;
+        GDate curDate, nextDate;
+        GList *schedule;
 
-        /* Process any other enabled payments. */
+        for ( i = 0; i < ldd->ld.repayOptCount; i++ )
         {
-                int i;
-                GDate curDate, nextDate;
-                GList *schedule;
+            if ( ! ldd->ld.repayOpts[i]->enabled )
+                continue;
 
-                for ( i=0; i<ldd->ld.repayOptCount; i++ )
+            schedule
+            = ( ldd->ld.repayOpts[i]->schedule != NULL
+                ? ldd->ld.repayOpts[i]->schedule
+                : ldd->ld.repayment_schedule );
+
+            g_date_clear( &curDate, 1 );
+            curDate = start;
+            g_date_subtract_days( &curDate, 1 );
+            g_date_clear(&nextDate, 1);
+            recurrenceListNextInstance(schedule, &curDate, &nextDate );
+            for ( ; g_date_valid( &nextDate )
+                    && g_date_compare( &nextDate, &end ) <= 0;
+                    curDate = nextDate,
+                    recurrenceListNextInstance(
+                        schedule, &curDate, &nextDate ) )
+            {
+                gint gncn_how =
+                    GNC_DENOM_SIGFIGS(2)
+                    | GNC_RND_ROUND;
+                gnc_numeric val;
+                rowNumData = (gnc_numeric*)g_hash_table_lookup( repayment_schedule,
+                             &curDate );
+                if ( rowNumData == NULL )
                 {
-                        if ( ! ldd->ld.repayOpts[i]->enabled )
-                                continue;
+                    int j;
+                    GDate *dateKeyCopy = g_date_new();
 
-                        schedule
-                                = ( ldd->ld.repayOpts[i]->schedule != NULL
-                                    ? ldd->ld.repayOpts[i]->schedule
-                                    : ldd->ld.repayment_schedule );
+                    *dateKeyCopy = curDate;
+                    rowNumData = g_new0( gnc_numeric, ldd->ld.revNumPmts );
+                    g_assert( rowNumData != NULL );
+                    for ( j = 0; j < ldd->ld.revNumPmts; j++ )
+                    {
+                        rowNumData[j] = gnc_numeric_error( GNC_ERROR_ARG );
+                    }
+                    g_hash_table_insert( repayment_schedule,
+                                         (gpointer)dateKeyCopy,
+                                         (gpointer)rowNumData );
+                }
 
-                        g_date_clear( &curDate, 1 );
-                        curDate = start;
-                        g_date_subtract_days( &curDate, 1 );
-                        g_date_clear(&nextDate, 1);
-                        recurrenceListNextInstance(schedule, &curDate, &nextDate );
-                        for ( ; g_date_valid( &nextDate )
-                                && g_date_compare( &nextDate, &end ) <= 0;
-                              curDate = nextDate,
-                              recurrenceListNextInstance(
-                                      schedule, &curDate, &nextDate ) )
-                        {
-                                gint gncn_how =
-                                        GNC_DENOM_SIGFIGS(2)
-                                        | GNC_RND_ROUND;
-                                gnc_numeric val;
-                                rowNumData = (gnc_numeric*)g_hash_table_lookup( repayment_schedule,
-                                                                                &curDate );
-                                if ( rowNumData == NULL ) {
-                                        int j;
-                                        GDate *dateKeyCopy = g_date_new();
-
-                                        *dateKeyCopy = curDate;
-                                        rowNumData = g_new0( gnc_numeric, ldd->ld.revNumPmts );
-                                        g_assert( rowNumData != NULL );
-                                        for ( j=0; j<ldd->ld.revNumPmts; j++ ) {
-                                                rowNumData[j] = gnc_numeric_error( GNC_ERROR_ARG );
-                                        }
-                                        g_hash_table_insert( repayment_schedule,
-                                                             (gpointer)dateKeyCopy,
-                                                             (gpointer)rowNumData );
-                                }
-
-                                val = double_to_gnc_numeric( (double)ldd->ld
-                                                             .repayOpts[i]
-                                                             ->amount,
-                                                             100, gncn_how );
-                                rowNumData[ ldd->ld.revRepayOptToColMap[i] ]
-                                        = val;
-                        }
-                }
+                val = double_to_gnc_numeric( (double)ldd->ld
+                                             .repayOpts[i]
+                                             ->amount,
+                                             100, gncn_how );
+                rowNumData[ ldd->ld.revRepayOptToColMap[i] ]
+                = val;
+            }
         }
+    }
 
-        /* Convert the GHashTable into a sorted GList in the LoanData */
+    /* Convert the GHashTable into a sorted GList in the LoanData */
+    {
+        if ( ldd->ld.revSchedule != NULL )
         {
-                if ( ldd->ld.revSchedule != NULL ) {
-                        g_list_foreach( ldd->ld.revSchedule,
-                                        ld_rev_sched_list_free,
-                                        NULL );
-                        g_list_free( ldd->ld.revSchedule );
-                        ldd->ld.revSchedule = NULL;
-                }
-                g_hash_table_foreach( repayment_schedule, ld_rev_hash_to_list,
-                                      &ldd->ld.revSchedule );
-                g_hash_table_foreach( repayment_schedule, ld_rev_hash_free_date_keys,
-                                      NULL );
-                g_hash_table_destroy( repayment_schedule );
-                ldd->ld.revSchedule =
-                        g_list_sort( ldd->ld.revSchedule, (GCompareFunc)g_date_compare );
+            g_list_foreach( ldd->ld.revSchedule,
+                            ld_rev_sched_list_free,
+                            NULL );
+            g_list_free( ldd->ld.revSchedule );
+            ldd->ld.revSchedule = NULL;
         }
+        g_hash_table_foreach( repayment_schedule, ld_rev_hash_to_list,
+                              &ldd->ld.revSchedule );
+        g_hash_table_foreach( repayment_schedule, ld_rev_hash_free_date_keys,
+                              NULL );
+        g_hash_table_destroy( repayment_schedule );
+        ldd->ld.revSchedule =
+            g_list_sort( ldd->ld.revSchedule, (GCompareFunc)g_date_compare );
+    }
 }
 
 static
 void
 ld_rev_update_view( LoanDruidData *ldd, GDate *start, GDate *end )
 {
-        static gchar *NO_AMT_CELL_TEXT = " ";
-        GList *l;
-        GNCPrintAmountInfo pai;
-	GtkListStore *store;
-	GtkTreeIter iter;
+    static gchar *NO_AMT_CELL_TEXT = " ";
+    GList *l;
+    GNCPrintAmountInfo pai;
+    GtkListStore *store;
+    GtkTreeIter iter;
 
-        pai = gnc_default_price_print_info();
-        pai.min_decimal_places = 2;
+    pai = gnc_default_price_print_info();
+    pai.min_decimal_places = 2;
 
-	store = GTK_LIST_STORE(gtk_tree_view_get_model( ldd->revView ));
+    store = GTK_LIST_STORE(gtk_tree_view_get_model( ldd->revView ));
 
-        gtk_list_store_clear( store );
+    gtk_list_store_clear( store );
 
-        for ( l = ldd->ld.revSchedule; l != NULL; l = l->next )
-        {
-                int i;
-                gchar tmpBuf[50];
-                RevRepaymentRow *rrr = (RevRepaymentRow*)l->data;
+    for ( l = ldd->ld.revSchedule; l != NULL; l = l->next )
+    {
+        int i;
+        gchar tmpBuf[50];
+        RevRepaymentRow *rrr = (RevRepaymentRow*)l->data;
 
-                if ( g_date_compare( &rrr->date, start ) < 0 )
-                        continue;
-                if ( g_date_compare( &rrr->date, end ) > 0 )
-                        continue; /* though we can probably return, too. */
+        if ( g_date_compare( &rrr->date, start ) < 0 )
+            continue;
+        if ( g_date_compare( &rrr->date, end ) > 0 )
+            continue; /* though we can probably return, too. */
 
-		gtk_list_store_append(store, &iter);
+        gtk_list_store_append(store, &iter);
 
-		qof_print_gdate( tmpBuf, MAX_DATE_LENGTH, &rrr->date );
-		gtk_list_store_set( store, &iter, LOAN_COL_DATE, tmpBuf, -1 );
+        qof_print_gdate( tmpBuf, MAX_DATE_LENGTH, &rrr->date );
+        gtk_list_store_set( store, &iter, LOAN_COL_DATE, tmpBuf, -1 );
 
-                for ( i=0; i<ldd->ld.revNumPmts; i++ )
-                {
-                        int numPrinted;
-                        if ( gnc_numeric_check( rrr->numCells[i] )
-                             == GNC_ERROR_ARG )
-                        {
-				/* '+1' for the date cell */
-				gtk_list_store_set( store, &iter,
-						    i+1, NO_AMT_CELL_TEXT,
-						    -1);
-                                continue;
-                        }
+        for ( i = 0; i < ldd->ld.revNumPmts; i++ )
+        {
+            int numPrinted;
+            if ( gnc_numeric_check( rrr->numCells[i] )
+                    == GNC_ERROR_ARG )
+            {
+                /* '+1' for the date cell */
+                gtk_list_store_set( store, &iter,
+                                    i + 1, NO_AMT_CELL_TEXT,
+                                    -1);
+                continue;
+            }
 
-                        numPrinted = xaccSPrintAmount( tmpBuf, rrr->numCells[i], pai );
-                        g_assert( numPrinted < 50 );
-			/* '+1' for the date cell */
-			gtk_list_store_set( store, &iter,
-					    i+1, tmpBuf,
-					    -1);
-                }
+            numPrinted = xaccSPrintAmount( tmpBuf, rrr->numCells[i], pai );
+            g_assert( numPrinted < 50 );
+            /* '+1' for the date cell */
+            gtk_list_store_set( store, &iter,
+                                i + 1, tmpBuf,
+                                -1);
+        }
 
-        }
+    }
 }

Modified: gnucash/trunk/src/gnome/druid-merge.c
===================================================================
--- gnucash/trunk/src/gnome/druid-merge.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/druid-merge.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -55,18 +55,18 @@
 static GtkWidget*
 merge_get_widget (const char *name)
 {
-	if (!qsf_import_merge_window) return NULL;
+    if (!qsf_import_merge_window) return NULL;
 
-	return gnc_glade_lookup_widget (qsf_import_merge_window, name);
+    return gnc_glade_lookup_widget (qsf_import_merge_window, name);
 }
 
 static void
 delete_merge_window (void)
 {
-	if (!qsf_import_merge_window) return;
-	
-	gtk_widget_destroy (qsf_import_merge_window);
-	qsf_import_merge_window = NULL;
+    if (!qsf_import_merge_window) return;
+
+    gtk_widget_destroy (qsf_import_merge_window);
+    qsf_import_merge_window = NULL;
 }
 
 static void
@@ -76,312 +76,325 @@
 
 static gboolean
 on_import_start_page_next(GnomeDruidPage  *gnomedruidpage,
-                       gpointer         arg1,
-                       gpointer         user_data)
+                          gpointer         arg1,
+                          gpointer         user_data)
 {
 
-	return FALSE;
+    return FALSE;
 }
 
 
 static void
 on_MergeUpdate_clicked 	(GtkButton       *button,
-              		    gpointer         user_data)
+                         gpointer         user_data)
 {
-	GtkLabel *output;
+    GtkLabel *output;
 
-	g_return_if_fail(mergeData != NULL);
-	ENTER (" ");
-	mergeData = qof_book_merge_update_result(mergeData, MERGE_UPDATE); 
-	count = 0;
-	qof_book_merge_rule_foreach(mergeData, collision_rule_loop, MERGE_REPORT);
-	if(count == 0)
-	{
-		output = GTK_LABEL(merge_get_widget("OutPut"));
-		gtk_label_set_text(output,_("No conflicts to be resolved."));
-		gtk_widget_show(GTK_WIDGET(output));
-	}
-	LEAVE (" ");
+    g_return_if_fail(mergeData != NULL);
+    ENTER (" ");
+    mergeData = qof_book_merge_update_result(mergeData, MERGE_UPDATE);
+    count = 0;
+    qof_book_merge_rule_foreach(mergeData, collision_rule_loop, MERGE_REPORT);
+    if (count == 0)
+    {
+        output = GTK_LABEL(merge_get_widget("OutPut"));
+        gtk_label_set_text(output, _("No conflicts to be resolved."));
+        gtk_widget_show(GTK_WIDGET(output));
+    }
+    LEAVE (" ");
 }
 
 static void
 on_MergeDuplicate_clicked 	(GtkButton       *button,
-              			    gpointer         user_data)
+                             gpointer         user_data)
 {
-	QofBookMergeRule *currentRule;
-	GtkLabel *output;
-	
-	g_return_if_fail(mergeData != NULL);
-	ENTER (" ");
-	currentRule = mergeData->currentRule;
-	if(currentRule->mergeAbsolute == FALSE) { 
-		mergeData = qof_book_merge_update_result(mergeData, MERGE_DUPLICATE); 
-		count = 0;
-	}
-	if(currentRule->mergeAbsolute == TRUE) { 
-		mergeData = qof_book_merge_update_result(mergeData, MERGE_ABSOLUTE); 
-		count = 0;
-	}
- 	qof_book_merge_rule_foreach(mergeData, collision_rule_loop, MERGE_REPORT);
-	if(count == 0)
-	{
-    		output = GTK_LABEL(merge_get_widget("OutPut"));
-	    	gtk_label_set_text(output,_("No conflicts to be resolved."));
-		gtk_widget_show(GTK_WIDGET(output));
-	}
-	LEAVE (" ");
+    QofBookMergeRule *currentRule;
+    GtkLabel *output;
+
+    g_return_if_fail(mergeData != NULL);
+    ENTER (" ");
+    currentRule = mergeData->currentRule;
+    if (currentRule->mergeAbsolute == FALSE)
+    {
+        mergeData = qof_book_merge_update_result(mergeData, MERGE_DUPLICATE);
+        count = 0;
+    }
+    if (currentRule->mergeAbsolute == TRUE)
+    {
+        mergeData = qof_book_merge_update_result(mergeData, MERGE_ABSOLUTE);
+        count = 0;
+    }
+    qof_book_merge_rule_foreach(mergeData, collision_rule_loop, MERGE_REPORT);
+    if (count == 0)
+    {
+        output = GTK_LABEL(merge_get_widget("OutPut"));
+        gtk_label_set_text(output, _("No conflicts to be resolved."));
+        gtk_widget_show(GTK_WIDGET(output));
+    }
+    LEAVE (" ");
 }
 
 static void
 on_MergeNew_clicked (GtkButton       *button,
-              		gpointer         user_data)
+                     gpointer         user_data)
 {
-	QofBookMergeRule *currentRule;
-	GtkLabel *output;
+    QofBookMergeRule *currentRule;
+    GtkLabel *output;
 
-	g_return_if_fail(mergeData != NULL);
-	currentRule = mergeData->currentRule;
-	g_return_if_fail(currentRule != NULL);
-	ENTER (" ");
-	if(currentRule->mergeAbsolute == FALSE) { 
-		mergeData = qof_book_merge_update_result(mergeData, MERGE_NEW);
-	}
-	count = 0;
- 	qof_book_merge_rule_foreach(mergeData, collision_rule_loop, MERGE_REPORT);
-	if(count == 0)
-	{
-		output = GTK_LABEL(merge_get_widget("OutPut"));
-		gtk_label_set_text(output,_("No conflicts to be resolved."));
-		gtk_widget_show(GTK_WIDGET(output));
-	}
-	LEAVE (" ");
+    g_return_if_fail(mergeData != NULL);
+    currentRule = mergeData->currentRule;
+    g_return_if_fail(currentRule != NULL);
+    ENTER (" ");
+    if (currentRule->mergeAbsolute == FALSE)
+    {
+        mergeData = qof_book_merge_update_result(mergeData, MERGE_NEW);
+    }
+    count = 0;
+    qof_book_merge_rule_foreach(mergeData, collision_rule_loop, MERGE_REPORT);
+    if (count == 0)
+    {
+        output = GTK_LABEL(merge_get_widget("OutPut"));
+        gtk_label_set_text(output, _("No conflicts to be resolved."));
+        gtk_widget_show(GTK_WIDGET(output));
+    }
+    LEAVE (" ");
 }
 
 static gboolean
 on_import_next (GnomeDruidPage  *gnomedruidpage,
-                       gpointer         arg1,
-                       gpointer         user_data)
+                gpointer         arg1,
+                gpointer         user_data)
 {
-	GtkWidget *top;
-	gchar *message;
+    GtkWidget *top;
+    gchar *message;
 
-	if(count > 0)
-	{
-		message = g_strdup_printf(_("Error: Please resolve all %d "
-			"conflicts before trying to commit the data."), count);
-		top = gtk_widget_get_toplevel (GTK_WIDGET (gnomedruidpage));
-		gnc_error_dialog(top, "%s", message);
-		g_free(message);
-		return TRUE;
-	}
-	return FALSE;
+    if (count > 0)
+    {
+        message = g_strdup_printf(_("Error: Please resolve all %d "
+                                    "conflicts before trying to commit the data."), count);
+        top = gtk_widget_get_toplevel (GTK_WIDGET (gnomedruidpage));
+        gnc_error_dialog(top, "%s", message);
+        g_free(message);
+        return TRUE;
+    }
+    return FALSE;
 }
 
 static void
 on_merge_cancel (GnomeDruid *gnomedruid, gpointer user_data)
 {
-	g_return_if_fail(mergeBook != NULL);
-	gnc_suspend_gui_refresh ();
-	delete_merge_window();
-	qof_book_destroy(mergeBook);
-	qof_session_end(merge_session);	
-	gnc_resume_gui_refresh ();
+    g_return_if_fail(mergeBook != NULL);
+    gnc_suspend_gui_refresh ();
+    delete_merge_window();
+    qof_book_destroy(mergeBook);
+    qof_session_end(merge_session);
+    gnc_resume_gui_refresh ();
 }
 
 void currency_transfer_cb ( QofInstance* ent, gpointer user_data)
 {
-	if(!ent) return;
-	if(xaccAccountGetCommodity((Account*)ent) == NULL) {
-		xaccAccountSetCommodity((Account*)ent, gnc_default_currency());
-	}
+    if (!ent) return;
+    if (xaccAccountGetCommodity((Account*)ent) == NULL)
+    {
+        xaccAccountSetCommodity((Account*)ent, gnc_default_currency());
+    }
 }
 
 /* If the account has no parent, shove it into the top level under the root. */
 void reference_parent_cb ( QofInstance* ent, gpointer user_data)
 {
-	Account *root;
+    Account *root;
 
-	if(!ent) return;
-	if(gnc_account_get_parent((Account*)ent) == NULL) {
-		root = gnc_book_get_root_account(targetBook);
-		gnc_account_append_child(root, (Account*)ent);
-	}
+    if (!ent) return;
+    if (gnc_account_get_parent((Account*)ent) == NULL)
+    {
+        root = gnc_book_get_root_account(targetBook);
+        gnc_account_append_child(root, (Account*)ent);
+    }
 }
 
 static void
 on_merge_finish (GnomeDruidPage  *gnomedruidpage,
-           gpointer         arg1,
-           gpointer         user_data)
+                 gpointer         arg1,
+                 gpointer         user_data)
 {
-	gint result;
-	GtkWidget *top;
-	const char *message;
+    gint result;
+    GtkWidget *top;
+    const char *message;
 
-	ENTER (" ");
-	g_return_if_fail(mergeData != NULL);
-	gnc_suspend_gui_refresh ();
-	result = qof_book_merge_commit(mergeData);
-	if(result != 0) {
-		message = g_strdup_printf(_("Error: the Commit operation failed, error code %d."), result);
-		top = gtk_widget_get_toplevel (GTK_WIDGET (gnomedruidpage));
-		gnc_error_dialog(top, "%s", message);
-	}
-	g_return_if_fail(result == 0);
-	delete_merge_window ();
-	qof_object_foreach(GNC_ID_ACCOUNT, targetBook, currency_transfer_cb, NULL);
-	qof_object_foreach(GNC_ID_ACCOUNT, targetBook, reference_parent_cb,  NULL);
-	qof_book_destroy(mergeBook);
-	qof_session_end(merge_session);
-	gnc_resume_gui_refresh ();
-	LEAVE (" ");
+    ENTER (" ");
+    g_return_if_fail(mergeData != NULL);
+    gnc_suspend_gui_refresh ();
+    result = qof_book_merge_commit(mergeData);
+    if (result != 0)
+    {
+        message = g_strdup_printf(_("Error: the Commit operation failed, error code %d."), result);
+        top = gtk_widget_get_toplevel (GTK_WIDGET (gnomedruidpage));
+        gnc_error_dialog(top, "%s", message);
+    }
+    g_return_if_fail(result == 0);
+    delete_merge_window ();
+    qof_object_foreach(GNC_ID_ACCOUNT, targetBook, currency_transfer_cb, NULL);
+    qof_object_foreach(GNC_ID_ACCOUNT, targetBook, reference_parent_cb,  NULL);
+    qof_book_destroy(mergeBook);
+    qof_session_end(merge_session);
+    gnc_resume_gui_refresh ();
+    LEAVE (" ");
 }
 
 static void
 on_merge_prepare (GnomeDruidPage  *gnomedruidpage,
-                            gpointer         arg1,
-                            gpointer         user_data)
+                  gpointer         arg1,
+                  gpointer         user_data)
 {
-	GtkLabel *progress, *output;
+    GtkLabel *progress, *output;
 
-	gnc_suspend_gui_refresh ();
-	ENTER (" ");
-	progress = GTK_LABEL (merge_get_widget("ResultsBox"));
-	/* blank out old data */
-	gtk_label_set_text(progress, "");
-	g_return_if_fail(mergeBook || targetBook);
-	mergeData = qof_book_merge_init(mergeBook, targetBook);
-	g_return_if_fail(mergeData != NULL);
-	count = 0;
- 	qof_book_merge_rule_foreach(mergeData, collision_rule_loop, MERGE_REPORT);
-	if(count == 0)
-	{
-		output = GTK_LABEL(merge_get_widget("OutPut"));
-		gtk_label_set_text(output,_("No conflicts to be resolved."));
-		gtk_widget_show(GTK_WIDGET(output));
-	}
-	gnc_resume_gui_refresh ();
-	LEAVE (" ");
+    gnc_suspend_gui_refresh ();
+    ENTER (" ");
+    progress = GTK_LABEL (merge_get_widget("ResultsBox"));
+    /* blank out old data */
+    gtk_label_set_text(progress, "");
+    g_return_if_fail(mergeBook || targetBook);
+    mergeData = qof_book_merge_init(mergeBook, targetBook);
+    g_return_if_fail(mergeData != NULL);
+    count = 0;
+    qof_book_merge_rule_foreach(mergeData, collision_rule_loop, MERGE_REPORT);
+    if (count == 0)
+    {
+        output = GTK_LABEL(merge_get_widget("OutPut"));
+        gtk_label_set_text(output, _("No conflicts to be resolved."));
+        gtk_widget_show(GTK_WIDGET(output));
+    }
+    gnc_resume_gui_refresh ();
+    LEAVE (" ");
 }
 
 static GtkWidget *
 gnc_create_import_druid ( void )
 {
-	GtkWidget *dialog, *druid, *start_page;
-	GladeXML *xml;
+    GtkWidget *dialog, *druid, *start_page;
+    GladeXML *xml;
 
-	xml = gnc_glade_xml_new ("merge.glade", "Merge Druid");
+    xml = gnc_glade_xml_new ("merge.glade", "Merge Druid");
 
-	dialog = glade_xml_get_widget (xml, "Merge Druid");
-	druid = glade_xml_get_widget (xml, "merge_druid");
-	gnc_druid_set_colors (GNOME_DRUID (druid));
-	start_page = glade_xml_get_widget (xml, "start_page");
-	gtk_widget_show (start_page);
-	gtk_widget_show (glade_xml_get_widget (xml, "MergeDruidFinishPage"));
+    dialog = glade_xml_get_widget (xml, "Merge Druid");
+    druid = glade_xml_get_widget (xml, "merge_druid");
+    gnc_druid_set_colors (GNOME_DRUID (druid));
+    start_page = glade_xml_get_widget (xml, "start_page");
+    gtk_widget_show (start_page);
+    gtk_widget_show (glade_xml_get_widget (xml, "MergeDruidFinishPage"));
 
-	glade_xml_signal_connect(xml, "on_start_page_next",
-		G_CALLBACK (on_import_start_page_next));
-	
-	glade_xml_signal_connect(xml, "on_qof_book_merge_prepare",
-		G_CALLBACK (on_merge_prepare));
+    glade_xml_signal_connect(xml, "on_start_page_next",
+                             G_CALLBACK (on_import_start_page_next));
 
-	glade_xml_signal_connect(xml, "on_qof_book_merge_next",
-		G_CALLBACK (on_import_next));
+    glade_xml_signal_connect(xml, "on_qof_book_merge_prepare",
+                             G_CALLBACK (on_merge_prepare));
 
-	glade_xml_signal_connect (xml, "on_finish", 
-		G_CALLBACK (on_merge_finish));
+    glade_xml_signal_connect(xml, "on_qof_book_merge_next",
+                             G_CALLBACK (on_import_next));
 
-	glade_xml_signal_connect (xml, "on_cancel", 
-		G_CALLBACK (on_merge_cancel));
-	
-	glade_xml_signal_connect (xml, "on_MergeUpdate_clicked",
-		G_CALLBACK (on_MergeUpdate_clicked));
-		
-	glade_xml_signal_connect (xml, "on_MergeDuplicate_clicked",
-		G_CALLBACK (on_MergeDuplicate_clicked));
-		
-	glade_xml_signal_connect (xml, "on_MergeNew_clicked",
-		G_CALLBACK (on_MergeNew_clicked));
+    glade_xml_signal_connect (xml, "on_finish",
+                              G_CALLBACK (on_merge_finish));
 
-	g_signal_connect (dialog, "destroy",
-			  G_CALLBACK(qof_book_merge_destroy_cb), NULL);
-	return dialog;
+    glade_xml_signal_connect (xml, "on_cancel",
+                              G_CALLBACK (on_merge_cancel));
+
+    glade_xml_signal_connect (xml, "on_MergeUpdate_clicked",
+                              G_CALLBACK (on_MergeUpdate_clicked));
+
+    glade_xml_signal_connect (xml, "on_MergeDuplicate_clicked",
+                              G_CALLBACK (on_MergeDuplicate_clicked));
+
+    glade_xml_signal_connect (xml, "on_MergeNew_clicked",
+                              G_CALLBACK (on_MergeNew_clicked));
+
+    g_signal_connect (dialog, "destroy",
+                      G_CALLBACK(qof_book_merge_destroy_cb), NULL);
+    return dialog;
 }
 
-void collision_rule_loop(QofBookMergeData *mergeData, QofBookMergeRule *rule, 
-                        guint remainder)
+void collision_rule_loop(QofBookMergeData *mergeData, QofBookMergeRule *rule,
+                         guint remainder)
 {
-	GSList *user_reports;
-	QofParam *one_param;
-	gchar *importstring, *targetstring;
-	GtkLabel *output;
-	gchar *buffer, *buffer2, *buffer3;
-	
-	g_return_if_fail(rule != NULL);
-	buffer = "";
-	/* there is a rule awaiting resolution, don't print any more */
-	if(count > 0) { return; }
-	ENTER (" remainder=%d", remainder);
-	gnc_suspend_gui_refresh ();
-	user_reports = rule->mergeParam;
-	mergeData->currentRule = rule;
-	output = GTK_LABEL(merge_get_widget("OutPut"));
-	gtk_label_set_text(output, buffer);
-	gtk_widget_show(GTK_WIDGET(output));
-	gnc_resume_gui_refresh ();
-	count = 1; /* user display text counts from 1, not zero */
-	importstring = targetstring = NULL;
-	gnc_suspend_gui_refresh ();
-	/* Translators: %i is the number of conflicts. This is a
-	   ngettext(3) message. */
-	buffer2 = g_strdup_printf(ngettext("%i conflict needs to be resolved.", 
-					  "%i conflicts need to be resolved.", 
-					  remainder),
-				 remainder); 
-	/* Translators: %i is the number of values. This is a
-	   ngettext(3) message. */
-	buffer3 = g_strdup_printf(ngettext("%i parameter value for this \"%s\" object.",
-					   "%i parameter values for this \"%s\" object.",
-					   g_slist_length(user_reports)), 
-				  g_slist_length(user_reports), rule->targetEnt->e_type);
-	buffer = g_strconcat("\n", buffer2, "\n", "\n", buffer3, "\n", NULL);
-	g_free(buffer2);
-	g_free(buffer3);
-	while(user_reports != NULL) {
-		one_param = user_reports->data;
-		/* FIXME: each g_strdup_printf as well as g_strconcat
-		   will allocate a new string; all of these need to be
-		   freed later. Currently this causes a lot of memory
-		   leaks. */
-		buffer = g_strconcat(buffer, g_strdup_printf(_("%i: Parameter name: %s "), 
-			count, one_param->param_name), NULL);
-		importstring = qof_book_merge_param_as_string(one_param, rule->importEnt);
-		buffer = g_strconcat(buffer, 
-			g_strdup_printf(_("Import data : %s "), importstring), NULL);
-		targetstring = qof_book_merge_param_as_string(one_param, rule->targetEnt);
-		buffer = g_strconcat(buffer, 
-			g_strdup_printf(_("Original data : %s\n"), targetstring), NULL);
-		user_reports = g_slist_next(user_reports);
-		count++;
-	}
-	gtk_label_set_text(output,buffer);
-	gtk_widget_show(GTK_WIDGET(output));
-	gnc_resume_gui_refresh ();
-	g_free(buffer);
-	g_free(importstring);
-	g_free(targetstring);
-	LEAVE (" ");
+    GSList *user_reports;
+    QofParam *one_param;
+    gchar *importstring, *targetstring;
+    GtkLabel *output;
+    gchar *buffer, *buffer2, *buffer3;
+
+    g_return_if_fail(rule != NULL);
+    buffer = "";
+    /* there is a rule awaiting resolution, don't print any more */
+    if (count > 0)
+    {
+        return;
+    }
+    ENTER (" remainder=%d", remainder);
+    gnc_suspend_gui_refresh ();
+    user_reports = rule->mergeParam;
+    mergeData->currentRule = rule;
+    output = GTK_LABEL(merge_get_widget("OutPut"));
+    gtk_label_set_text(output, buffer);
+    gtk_widget_show(GTK_WIDGET(output));
+    gnc_resume_gui_refresh ();
+    count = 1; /* user display text counts from 1, not zero */
+    importstring = targetstring = NULL;
+    gnc_suspend_gui_refresh ();
+    /* Translators: %i is the number of conflicts. This is a
+       ngettext(3) message. */
+    buffer2 = g_strdup_printf(ngettext("%i conflict needs to be resolved.",
+                                       "%i conflicts need to be resolved.",
+                                       remainder),
+                              remainder);
+    /* Translators: %i is the number of values. This is a
+       ngettext(3) message. */
+    buffer3 = g_strdup_printf(ngettext("%i parameter value for this \"%s\" object.",
+                                       "%i parameter values for this \"%s\" object.",
+                                       g_slist_length(user_reports)),
+                              g_slist_length(user_reports), rule->targetEnt->e_type);
+    buffer = g_strconcat("\n", buffer2, "\n", "\n", buffer3, "\n", NULL);
+    g_free(buffer2);
+    g_free(buffer3);
+    while (user_reports != NULL)
+    {
+        one_param = user_reports->data;
+        /* FIXME: each g_strdup_printf as well as g_strconcat
+           will allocate a new string; all of these need to be
+           freed later. Currently this causes a lot of memory
+           leaks. */
+        buffer = g_strconcat(buffer, g_strdup_printf(_("%i: Parameter name: %s "),
+                             count, one_param->param_name), NULL);
+        importstring = qof_book_merge_param_as_string(one_param, rule->importEnt);
+        buffer = g_strconcat(buffer,
+                             g_strdup_printf(_("Import data : %s "), importstring), NULL);
+        targetstring = qof_book_merge_param_as_string(one_param, rule->targetEnt);
+        buffer = g_strconcat(buffer,
+                             g_strdup_printf(_("Original data : %s\n"), targetstring), NULL);
+        user_reports = g_slist_next(user_reports);
+        count++;
+    }
+    gtk_label_set_text(output, buffer);
+    gtk_widget_show(GTK_WIDGET(output));
+    gnc_resume_gui_refresh ();
+    g_free(buffer);
+    g_free(importstring);
+    g_free(targetstring);
+    LEAVE (" ");
 }
 
 void
 gnc_ui_qsf_import_merge_druid (QofSession *original, QofSession *import)
 {
-	if (qsf_import_merge_window) { return; }
-	qof_event_suspend ();
-	qsf_import_merge_window = gnc_create_import_druid();
-	g_return_if_fail(qsf_import_merge_window != NULL);
-	previous_session = original;
-	targetBook = qof_session_get_book(previous_session);
-	merge_session = import;
-	mergeBook = qof_session_get_book(merge_session);
-	gtk_widget_show(qsf_import_merge_window);
+    if (qsf_import_merge_window)
+    {
+        return;
+    }
+    qof_event_suspend ();
+    qsf_import_merge_window = gnc_create_import_druid();
+    g_return_if_fail(qsf_import_merge_window != NULL);
+    previous_session = original;
+    targetBook = qof_session_get_book(previous_session);
+    merge_session = import;
+    mergeBook = qof_session_get_book(merge_session);
+    gtk_widget_show(qsf_import_merge_window);
 }

Modified: gnucash/trunk/src/gnome/druid-merge.h
===================================================================
--- gnucash/trunk/src/gnome/druid-merge.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/druid-merge.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -33,7 +33,7 @@
 \n
 This druid builds a second ::QofBook in memory using ::QofSession and
 populates the book with accounts created using the usual New Account Tree
-code. The druid then uses ::qof_book_merge_init to begin the merge 
+code. The druid then uses ::qof_book_merge_init to begin the merge
 of the new book (created with QofSession) with the existing QofBook
 (loaded by the user), with user intervention and collision handling.
 
@@ -45,28 +45,28 @@
 	be ::MERGE_NEW - parameter values must be checked.
 
 - If a GUID match exists, set QofBookMergeRule::mergeAbsolute to \a TRUE.
-	-# If ALL parameters in the import object match the target object with the same \a GUID, 
+	-# If ALL parameters in the import object match the target object with the same \a GUID,
 	set ::QofBookMergeResult to \a MERGE_ABSOLUTE.
 	-# If any parameters differ, set ::MERGE_UPDATE.
 - If the import object \a GUID does not match an existing object,
 mergeAbsolute is unchanged from the default \a FALSE
 The parameter values of the object are compared to other objects of the same
 type in the target book.
-	-# If the same data exists in the target book with a different GUID, the object 
+	-# If the same data exists in the target book with a different GUID, the object
 	is tagged as DUPLICATE.
-	-# If the data has changed, the object is tagged as REPORT. 
+	-# If the data has changed, the object is tagged as REPORT.
 	-# If the data does not match, the object is tagged as NEW
 
 More information is at http://code.neil.williamsleesmill.me.uk/
 
 Each foreach function uses g_return_if_fail checks to protect the target book. If
 any essential data is missing, the loop returns without changing the target book.
-Note that this will not set or return an error value. However, g_return is only 
-used for critical errors that arise from programming errors, not for invalid import data 
+Note that this will not set or return an error value. However, g_return is only
+used for critical errors that arise from programming errors, not for invalid import data
 which should be cleaned up before creating the import QofBook.
 
-Only ::qof_book_merge_init, ::qof_book_merge_update_result and ::qof_book_merge_commit return 
-any error values to the calling process. 
+Only ::qof_book_merge_init, ::qof_book_merge_update_result and ::qof_book_merge_commit return
+any error values to the calling process.
 
 	@{ */
 /** @file  druid-merge.h

Modified: gnucash/trunk/src/gnome/druid-stock-split.c
===================================================================
--- gnucash/trunk/src/gnome/druid-stock-split.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/druid-stock-split.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -46,720 +46,727 @@
 
 #define DRUID_STOCK_SPLIT_CM_CLASS "druid-stock-split"
 
-enum split_cols {
-  SPLIT_COL_ACCOUNT = 0,
-  SPLIT_COL_FULLNAME,
-  SPLIT_COL_MNEMONIC,
-  SPLIT_COL_SHARES,
-  NUM_SPLIT_COLS
+enum split_cols
+{
+    SPLIT_COL_ACCOUNT = 0,
+    SPLIT_COL_FULLNAME,
+    SPLIT_COL_MNEMONIC,
+    SPLIT_COL_SHARES,
+    NUM_SPLIT_COLS
 };
 
 /** structures *********************************************************/
 typedef struct
 {
-  GtkWidget * window;
-  GtkWidget * druid;
+    GtkWidget * window;
+    GtkWidget * druid;
 
-  /* account page data */
-  GtkWidget * account_view;
-  Account   * acct;
+    /* account page data */
+    GtkWidget * account_view;
+    Account   * acct;
 
-  /* info page data */
-  GtkWidget * date_edit;
-  GtkWidget * distribution_edit;
-  GtkWidget * description_entry;
-  GtkWidget * price_edit;
-  GtkWidget * price_currency_edit;
+    /* info page data */
+    GtkWidget * date_edit;
+    GtkWidget * distribution_edit;
+    GtkWidget * description_entry;
+    GtkWidget * price_edit;
+    GtkWidget * price_currency_edit;
 
-  /* cash in lieu page data */
-  GtkWidget * cash_edit;
-  GtkWidget * memo_entry;
-  GtkWidget * income_tree;
-  GtkWidget * asset_tree;
+    /* cash in lieu page data */
+    GtkWidget * cash_edit;
+    GtkWidget * memo_entry;
+    GtkWidget * income_tree;
+    GtkWidget * asset_tree;
 } StockSplitInfo;
 
 
 /** declarations *******************************************************/
 void     gnc_stock_split_druid_window_destroy_cb (GtkObject *object, gpointer data);
 gboolean gnc_stock_split_druid_account_next      (GnomeDruidPage *druidpage,
-						  gpointer arg1,
-						  gpointer user_data);
+        gpointer arg1,
+        gpointer user_data);
 void     gnc_stock_split_druid_details_prepare   (GnomeDruidPage *druidpage,
-						  gpointer arg1,
-						  gpointer user_data);
+        gpointer arg1,
+        gpointer user_data);
 gboolean gnc_stock_split_druid_details_next      (GnomeDruidPage *druidpage,
-						  gpointer arg1,
-						  gpointer user_data);
+        gpointer arg1,
+        gpointer user_data);
 void     gnc_stock_split_druid_cash_prepare      (GnomeDruidPage *druidpage,
-						  gpointer arg1,
-						  gpointer user_data);
+        gpointer arg1,
+        gpointer user_data);
 gboolean gnc_stock_split_druid_cash_next         (GnomeDruidPage *druidpage,
-						  gpointer arg1,
-						  gpointer user_data);
+        gpointer arg1,
+        gpointer user_data);
 void     gnc_stock_split_druid_finish            (GnomeDruidPage *druidpage,
-						  gpointer arg1,
-						  gpointer user_data);
+        gpointer arg1,
+        gpointer user_data);
 void     gnc_stock_split_druid_cancel_druid      (GnomeDruid *druid,
-						  gpointer user_data);
+        gpointer user_data);
 
 /******* implementations ***********************************************/
 void
 gnc_stock_split_druid_window_destroy_cb (GtkObject *object, gpointer data)
 {
-  StockSplitInfo *info = data;
+    StockSplitInfo *info = data;
 
-  gnc_unregister_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
+    gnc_unregister_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
 
-  g_free (info);
+    g_free (info);
 }
 
 static int
 fill_account_list (StockSplitInfo *info, Account *selected_account)
 {
-  GtkTreeRowReference *reference = NULL;
-  GtkTreeView *view;
-  GtkListStore *list;
-  GtkTreeIter iter;
-  GtkTreePath *path;
-  GList *accounts;
-  GList *node;
-  gint rows = 0;
-  gchar *full_name;
+    GtkTreeRowReference *reference = NULL;
+    GtkTreeView *view;
+    GtkListStore *list;
+    GtkTreeIter iter;
+    GtkTreePath *path;
+    GList *accounts;
+    GList *node;
+    gint rows = 0;
+    gchar *full_name;
 
-  view = GTK_TREE_VIEW(info->account_view);
-  list = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+    view = GTK_TREE_VIEW(info->account_view);
+    list = GTK_LIST_STORE(gtk_tree_view_get_model(view));
 
-  gtk_list_store_clear (list);
+    gtk_list_store_clear (list);
 
-  accounts = gnc_account_get_descendants_sorted (gnc_get_current_root_account ());
-  for (node = accounts; node; node = node->next)
-  {
-    Account *account = node->data;
-    GNCPrintAmountInfo print_info;
-    const gnc_commodity *commodity;
-    gnc_numeric balance;
+    accounts = gnc_account_get_descendants_sorted (gnc_get_current_root_account ());
+    for (node = accounts; node; node = node->next)
+    {
+        Account *account = node->data;
+        GNCPrintAmountInfo print_info;
+        const gnc_commodity *commodity;
+        gnc_numeric balance;
 
-    if (!xaccAccountIsPriced(account))
-        continue;
+        if (!xaccAccountIsPriced(account))
+            continue;
 
-    balance = xaccAccountGetBalance (account);
-    if (gnc_numeric_zero_p (balance))
-        continue;
+        balance = xaccAccountGetBalance (account);
+        if (gnc_numeric_zero_p (balance))
+            continue;
 
-    if (xaccAccountGetPlaceholder (account))
-	continue;
+        if (xaccAccountGetPlaceholder (account))
+            continue;
 
-    commodity = xaccAccountGetCommodity (account);
+        commodity = xaccAccountGetCommodity (account);
 
-    full_name = gnc_account_get_full_name (account);
-    print_info = gnc_account_print_info (account, FALSE);
+        full_name = gnc_account_get_full_name (account);
+        print_info = gnc_account_print_info (account, FALSE);
 
-    gtk_list_store_append(list, &iter);
-    gtk_list_store_set(list, &iter,
-		       SPLIT_COL_ACCOUNT,  account,
-		       SPLIT_COL_FULLNAME, full_name,
-		       SPLIT_COL_MNEMONIC, gnc_commodity_get_mnemonic(commodity),
-		       SPLIT_COL_SHARES,   xaccPrintAmount(balance, print_info),
-		       -1);
+        gtk_list_store_append(list, &iter);
+        gtk_list_store_set(list, &iter,
+                           SPLIT_COL_ACCOUNT,  account,
+                           SPLIT_COL_FULLNAME, full_name,
+                           SPLIT_COL_MNEMONIC, gnc_commodity_get_mnemonic(commodity),
+                           SPLIT_COL_SHARES,   xaccPrintAmount(balance, print_info),
+                           -1);
 
-    if (account == selected_account) {
-      path = gtk_tree_model_get_path(GTK_TREE_MODEL(list), &iter);
-      reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(list), path);
-      gtk_tree_path_free(path);
-    }
+        if (account == selected_account)
+        {
+            path = gtk_tree_model_get_path(GTK_TREE_MODEL(list), &iter);
+            reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(list), path);
+            gtk_tree_path_free(path);
+        }
 
-    g_free (full_name);
+        g_free (full_name);
 
-    rows++;
-  }
-  g_list_free(accounts);
+        rows++;
+    }
+    g_list_free(accounts);
 
-  if (reference) {
-    GtkTreeSelection* selection = gtk_tree_view_get_selection(view);
-    path = gtk_tree_row_reference_get_path(reference);
-    gtk_tree_row_reference_free(reference);
-    if (path) {
-      gtk_tree_selection_select_path(selection, path);
-      gtk_tree_view_scroll_to_cell(view, path, NULL, TRUE, 0.5, 0.0);
-      gtk_tree_path_free(path);
+    if (reference)
+    {
+        GtkTreeSelection* selection = gtk_tree_view_get_selection(view);
+        path = gtk_tree_row_reference_get_path(reference);
+        gtk_tree_row_reference_free(reference);
+        if (path)
+        {
+            gtk_tree_selection_select_path(selection, path);
+            gtk_tree_view_scroll_to_cell(view, path, NULL, TRUE, 0.5, 0.0);
+            gtk_tree_path_free(path);
+        }
     }
-  }
 
-  return rows;
+    return rows;
 }
 
 static void
 selection_changed (GtkTreeSelection *selection,
-		   gpointer user_data)
+                   gpointer user_data)
 {
-  StockSplitInfo *info = user_data;
-  GtkTreeModel *list;
-  GtkTreeIter iter;
+    StockSplitInfo *info = user_data;
+    GtkTreeModel *list;
+    GtkTreeIter iter;
 
-  if (!gtk_tree_selection_get_selected(selection, &list, &iter))
-    return;
-  gtk_tree_model_get(list, &iter,
-		     SPLIT_COL_ACCOUNT, &info->acct,
-		     -1);
+    if (!gtk_tree_selection_get_selected(selection, &list, &iter))
+        return;
+    gtk_tree_model_get(list, &iter,
+                       SPLIT_COL_ACCOUNT, &info->acct,
+                       -1);
 }
 
 static void
 refresh_details_page (StockSplitInfo *info)
 {
-  GNCPrintAmountInfo print_info;
-  gnc_commodity *commodity, *currency;
-  Account *account;
-  QofBook *book;
-  GNCPriceDB *db;
-  GList *prices;
+    GNCPrintAmountInfo print_info;
+    gnc_commodity *commodity, *currency;
+    Account *account;
+    QofBook *book;
+    GNCPriceDB *db;
+    GList *prices;
 
-  account = info->acct;
+    account = info->acct;
 
-  g_return_if_fail (account != NULL);
+    g_return_if_fail (account != NULL);
 
-  print_info = gnc_account_print_info (account, FALSE);
+    print_info = gnc_account_print_info (account, FALSE);
 
-  gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (info->distribution_edit),
-                                  print_info);
-  gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (info->distribution_edit),
-                                xaccAccountGetCommoditySCU (account));
+    gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (info->distribution_edit),
+                                    print_info);
+    gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (info->distribution_edit),
+                                  xaccAccountGetCommoditySCU (account));
 
-  commodity = xaccAccountGetCommodity (account);
-  book = gnc_account_get_book (account);
-  db = gnc_book_get_pricedb(book);
+    commodity = xaccAccountGetCommodity (account);
+    book = gnc_account_get_book (account);
+    db = gnc_book_get_pricedb(book);
 
-  prices = gnc_pricedb_lookup_latest_any_currency(db, commodity);
-  if (prices) {
-    /* Use the first existing price */
-    currency = gnc_price_get_currency(prices->data);
-  } else {
-    /* Take a wild guess. */
-    currency = gnc_default_currency ();
- }
-  gnc_price_list_destroy(prices);
+    prices = gnc_pricedb_lookup_latest_any_currency(db, commodity);
+    if (prices)
+    {
+        /* Use the first existing price */
+        currency = gnc_price_get_currency(prices->data);
+    }
+    else
+    {
+        /* Take a wild guess. */
+        currency = gnc_default_currency ();
+    }
+    gnc_price_list_destroy(prices);
 
-  gnc_currency_edit_set_currency
+    gnc_currency_edit_set_currency
     (GNC_CURRENCY_EDIT (info->price_currency_edit),
      currency);
 }
 
 gboolean
 gnc_stock_split_druid_account_next (GnomeDruidPage *druidpage,
-				    gpointer arg1,
-				    gpointer user_data)
+                                    gpointer arg1,
+                                    gpointer user_data)
 {
-  StockSplitInfo *info = user_data;
+    StockSplitInfo *info = user_data;
 
-  g_return_val_if_fail (info->acct != NULL, TRUE);
+    g_return_val_if_fail (info->acct != NULL, TRUE);
 
-  refresh_details_page (info);
+    refresh_details_page (info);
 
-  return FALSE;
+    return FALSE;
 }
 
 static void
 gnc_parse_error_dialog (StockSplitInfo *info, const char *error_string)
 {
-  const char * parse_error_string;
+    const char * parse_error_string;
 
-  parse_error_string = gnc_exp_parser_error_string ();
-  if (parse_error_string == NULL)
-    parse_error_string = "";
+    parse_error_string = gnc_exp_parser_error_string ();
+    if (parse_error_string == NULL)
+        parse_error_string = "";
 
-  if (error_string == NULL)
-    error_string = "";
+    if (error_string == NULL)
+        error_string = "";
 
-  gnc_error_dialog (info->window,
-		    "%s.\n\n%s: %s.",
-		    error_string, _("Error"),
-		    parse_error_string);
+    gnc_error_dialog (info->window,
+                      "%s.\n\n%s: %s.",
+                      error_string, _("Error"),
+                      parse_error_string);
 }
 
 void
 gnc_stock_split_druid_details_prepare (GnomeDruidPage *druidpage,
-		 gpointer arg1,
-		 gpointer user_data)
+                                       gpointer arg1,
+                                       gpointer user_data)
 {
-  StockSplitInfo *info = user_data;
+    StockSplitInfo *info = user_data;
 
-  gtk_widget_grab_focus(info->distribution_edit);
+    gtk_widget_grab_focus(info->distribution_edit);
 }
 
 gboolean
 gnc_stock_split_druid_details_next (GnomeDruidPage *druidpage,
-				    gpointer arg1,
-				    gpointer user_data)
+                                    gpointer arg1,
+                                    gpointer user_data)
 {
-  StockSplitInfo *info = user_data;
-  gnc_numeric amount;
+    StockSplitInfo *info = user_data;
+    gnc_numeric amount;
 
-  if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (info->distribution_edit)))
-  {
-    gnc_parse_error_dialog (info,
-                            _("You must enter a valid distribution amount."));
-    return TRUE;
-  }
+    if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (info->distribution_edit)))
+    {
+        gnc_parse_error_dialog (info,
+                                _("You must enter a valid distribution amount."));
+        return TRUE;
+    }
 
-  amount = gnc_amount_edit_get_amount
-    (GNC_AMOUNT_EDIT (info->distribution_edit));
+    amount = gnc_amount_edit_get_amount
+             (GNC_AMOUNT_EDIT (info->distribution_edit));
 
-  if (gnc_numeric_zero_p (amount))
-  {
-    const char *message = _("You must enter a distribution amount.");
-    gnc_error_dialog (info->window, "%s", message);
-    return TRUE;
-  }
+    if (gnc_numeric_zero_p (amount))
+    {
+        const char *message = _("You must enter a distribution amount.");
+        gnc_error_dialog (info->window, "%s", message);
+        return TRUE;
+    }
 
-  if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (info->price_edit)))
-  {
-    gnc_parse_error_dialog (info,
-                            _("You must either enter a valid price "
-                              "or leave it blank."));
-    return TRUE;
-  }
+    if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (info->price_edit)))
+    {
+        gnc_parse_error_dialog (info,
+                                _("You must either enter a valid price "
+                                  "or leave it blank."));
+        return TRUE;
+    }
 
-  amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->price_edit));
+    amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->price_edit));
 
-  if (gnc_numeric_negative_p (amount))
-  {
-    const char *message = _("The price must be positive.");
-    gnc_error_dialog (info->window, "%s", message);
-    return TRUE;
-  }
+    if (gnc_numeric_negative_p (amount))
+    {
+        const char *message = _("The price must be positive.");
+        gnc_error_dialog (info->window, "%s", message);
+        return TRUE;
+    }
 
-  return FALSE;
+    return FALSE;
 }
 
 void
 gnc_stock_split_druid_cash_prepare (GnomeDruidPage *druidpage,
-				    gpointer arg1,
-				    gpointer user_data)
+                                    gpointer arg1,
+                                    gpointer user_data)
 {
-  StockSplitInfo *info = user_data;
-  GtkTreeSelection *selection;
+    StockSplitInfo *info = user_data;
+    GtkTreeSelection *selection;
 
-  gtk_tree_view_expand_all (GTK_TREE_VIEW(info->income_tree));
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(info->income_tree));
-  gtk_tree_selection_unselect_all (selection);
+    gtk_tree_view_expand_all (GTK_TREE_VIEW(info->income_tree));
+    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(info->income_tree));
+    gtk_tree_selection_unselect_all (selection);
 
-  gtk_tree_view_expand_all (GTK_TREE_VIEW(info->asset_tree));
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(info->asset_tree));
-  gtk_tree_selection_unselect_all (selection);
+    gtk_tree_view_expand_all (GTK_TREE_VIEW(info->asset_tree));
+    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(info->asset_tree));
+    gtk_tree_selection_unselect_all (selection);
 
-  gtk_widget_grab_focus(info->cash_edit);
+    gtk_widget_grab_focus(info->cash_edit);
 }
 
 gboolean
 gnc_stock_split_druid_cash_next (GnomeDruidPage *druidpage,
-				 gpointer arg1,
-				 gpointer user_data)
+                                 gpointer arg1,
+                                 gpointer user_data)
 {
-  StockSplitInfo *info = user_data;
-  gnc_numeric amount;
+    StockSplitInfo *info = user_data;
+    gnc_numeric amount;
 
-  if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (info->cash_edit)))
-  {
-    gnc_parse_error_dialog (info,
-                            _("You must either enter a valid cash amount "
-                              "or leave it blank."));
-    return TRUE;
-  }
+    if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (info->cash_edit)))
+    {
+        gnc_parse_error_dialog (info,
+                                _("You must either enter a valid cash amount "
+                                  "or leave it blank."));
+        return TRUE;
+    }
 
-  amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->cash_edit));
+    amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->cash_edit));
 
-  if (gnc_numeric_negative_p (amount))
-  {
-    const char *message = _("The cash distribution must be positive.");
-    gnc_error_dialog (info->window, "%s", message);
-    return TRUE;
-  }
-
-  if (gnc_numeric_positive_p (amount))
-  {
-    Account *account;
-
-    account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(info->income_tree));
-    if (!account)
+    if (gnc_numeric_negative_p (amount))
     {
-      const char *message = _("You must select an income account "
-                              "for the cash distribution.");
-      gnc_error_dialog (info->window, "%s", message);
-      return TRUE;
+        const char *message = _("The cash distribution must be positive.");
+        gnc_error_dialog (info->window, "%s", message);
+        return TRUE;
     }
 
-    account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(info->asset_tree));
-    if (!account)
+    if (gnc_numeric_positive_p (amount))
     {
-      const char *message = _("You must select an asset account "
-                              "for the cash distribution.");
-      gnc_error_dialog (info->window, "%s", message);
-      return TRUE;
+        Account *account;
+
+        account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(info->income_tree));
+        if (!account)
+        {
+            const char *message = _("You must select an income account "
+                                    "for the cash distribution.");
+            gnc_error_dialog (info->window, "%s", message);
+            return TRUE;
+        }
+
+        account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(info->asset_tree));
+        if (!account)
+        {
+            const char *message = _("You must select an asset account "
+                                    "for the cash distribution.");
+            gnc_error_dialog (info->window, "%s", message);
+            return TRUE;
+        }
     }
-  }
 
-  return FALSE;
+    return FALSE;
 }
 
 void
 gnc_stock_split_druid_finish (GnomeDruidPage *druidpage,
-			      gpointer arg1,
-			      gpointer user_data)
+                              gpointer arg1,
+                              gpointer user_data)
 {
-  StockSplitInfo *info = user_data;
-  GList *account_commits;
-  GList *node;
+    StockSplitInfo *info = user_data;
+    GList *account_commits;
+    GList *node;
 
-  gnc_numeric amount;
-  Transaction *trans;
-  Account *account;
-  Split *split;
-  time_t date;
+    gnc_numeric amount;
+    Transaction *trans;
+    Account *account;
+    Split *split;
+    time_t date;
 
-  account = info->acct;
-  g_return_if_fail (account != NULL);
+    account = info->acct;
+    g_return_if_fail (account != NULL);
 
-  amount = gnc_amount_edit_get_amount
-    (GNC_AMOUNT_EDIT (info->distribution_edit));
-  g_return_if_fail (!gnc_numeric_zero_p (amount));
+    amount = gnc_amount_edit_get_amount
+             (GNC_AMOUNT_EDIT (info->distribution_edit));
+    g_return_if_fail (!gnc_numeric_zero_p (amount));
 
-  gnc_suspend_gui_refresh ();
+    gnc_suspend_gui_refresh ();
 
-  trans = xaccMallocTransaction (gnc_get_current_book ());
+    trans = xaccMallocTransaction (gnc_get_current_book ());
 
-  xaccTransBeginEdit (trans);
+    xaccTransBeginEdit (trans);
 
-  xaccTransSetCurrency (trans, gnc_default_currency ());
+    xaccTransSetCurrency (trans, gnc_default_currency ());
 
-  date = gnc_date_edit_get_date (GNC_DATE_EDIT (info->date_edit));
-  xaccTransSetDatePostedSecs (trans, date);
+    date = gnc_date_edit_get_date (GNC_DATE_EDIT (info->date_edit));
+    xaccTransSetDatePostedSecs (trans, date);
 
-  {
-    const char *description;
+    {
+        const char *description;
 
-    description = gtk_entry_get_text (GTK_ENTRY (info->description_entry));
-    xaccTransSetDescription (trans, description);
-  }
+        description = gtk_entry_get_text (GTK_ENTRY (info->description_entry));
+        xaccTransSetDescription (trans, description);
+    }
 
-  split = xaccMallocSplit (gnc_get_current_book ());
+    split = xaccMallocSplit (gnc_get_current_book ());
 
-  xaccAccountBeginEdit (account);
-  account_commits = g_list_prepend (NULL, account);
+    xaccAccountBeginEdit (account);
+    account_commits = g_list_prepend (NULL, account);
 
-  xaccTransAppendSplit (trans, split);
+    xaccTransAppendSplit (trans, split);
 
-  xaccAccountInsertSplit (account, split);
+    xaccAccountInsertSplit (account, split);
 
-  xaccSplitSetAmount (split, amount);
-  xaccSplitMakeStockSplit (split);
-  /* Translators: This string has a disambiguation prefix */
-  xaccSplitSetAction (split, Q_("Action Column|Split"));
+    xaccSplitSetAmount (split, amount);
+    xaccSplitMakeStockSplit (split);
+    /* Translators: This string has a disambiguation prefix */
+    xaccSplitSetAction (split, Q_("Action Column|Split"));
 
-  amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->price_edit));
-  if (gnc_numeric_positive_p (amount))
-  {
-    QofBook *book;
-    GNCPrice *price;
-    GNCPriceDB *pdb;
-    GNCCurrencyEdit *ce;
-    Timespec ts;
+    amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->price_edit));
+    if (gnc_numeric_positive_p (amount))
+    {
+        QofBook *book;
+        GNCPrice *price;
+        GNCPriceDB *pdb;
+        GNCCurrencyEdit *ce;
+        Timespec ts;
 
-    ce = GNC_CURRENCY_EDIT (info->price_currency_edit);
+        ce = GNC_CURRENCY_EDIT (info->price_currency_edit);
 
-    ts.tv_sec = date;
-    ts.tv_nsec = 0;
+        ts.tv_sec = date;
+        ts.tv_nsec = 0;
 
-    price = gnc_price_create (gnc_get_current_book ());
+        price = gnc_price_create (gnc_get_current_book ());
 
-    gnc_price_begin_edit (price);
-    gnc_price_set_commodity (price, xaccAccountGetCommodity (account));
-    gnc_price_set_currency (price, gnc_currency_edit_get_currency (ce));
-    gnc_price_set_time (price, ts);
-    gnc_price_set_source (price, "user:stock-split");
-    gnc_price_set_typestr (price, "unknown");
-    gnc_price_set_value (price, amount);
-    gnc_price_commit_edit (price);
+        gnc_price_begin_edit (price);
+        gnc_price_set_commodity (price, xaccAccountGetCommodity (account));
+        gnc_price_set_currency (price, gnc_currency_edit_get_currency (ce));
+        gnc_price_set_time (price, ts);
+        gnc_price_set_source (price, "user:stock-split");
+        gnc_price_set_typestr (price, "unknown");
+        gnc_price_set_value (price, amount);
+        gnc_price_commit_edit (price);
 
-    book = gnc_get_current_book ();
-    pdb = gnc_book_get_pricedb (book);
+        book = gnc_get_current_book ();
+        pdb = gnc_book_get_pricedb (book);
 
-    if (!gnc_pricedb_add_price (pdb, price))
-      gnc_error_dialog (info->window, "%s", _("Error adding price."));
+        if (!gnc_pricedb_add_price (pdb, price))
+            gnc_error_dialog (info->window, "%s", _("Error adding price."));
 
-    gnc_price_unref (price);
-  }
+        gnc_price_unref (price);
+    }
 
-  amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->cash_edit));
-  if (gnc_numeric_positive_p (amount))
-  {
-    const char *memo;
+    amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->cash_edit));
+    if (gnc_numeric_positive_p (amount))
+    {
+        const char *memo;
 
-    memo = gtk_entry_get_text (GTK_ENTRY (info->memo_entry));
+        memo = gtk_entry_get_text (GTK_ENTRY (info->memo_entry));
 
-    /* asset split */
-    account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(info->asset_tree));
+        /* asset split */
+        account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(info->asset_tree));
 
-    split = xaccMallocSplit (gnc_get_current_book ());
+        split = xaccMallocSplit (gnc_get_current_book ());
 
-    xaccAccountBeginEdit (account);
-    account_commits = g_list_prepend (account_commits, account);
+        xaccAccountBeginEdit (account);
+        account_commits = g_list_prepend (account_commits, account);
 
-    xaccAccountInsertSplit (account, split);
+        xaccAccountInsertSplit (account, split);
 
-    xaccTransAppendSplit (trans, split);
+        xaccTransAppendSplit (trans, split);
 
-    xaccSplitSetAmount (split, amount);
-    xaccSplitSetValue (split, amount);
+        xaccSplitSetAmount (split, amount);
+        xaccSplitSetValue (split, amount);
 
-    xaccSplitSetMemo (split, memo);
+        xaccSplitSetMemo (split, memo);
 
 
-    /* income split */
-    account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(info->income_tree));
+        /* income split */
+        account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(info->income_tree));
 
-    split = xaccMallocSplit (gnc_get_current_book ());
+        split = xaccMallocSplit (gnc_get_current_book ());
 
-    xaccAccountBeginEdit (account);
-    account_commits = g_list_prepend (account_commits, account);
+        xaccAccountBeginEdit (account);
+        account_commits = g_list_prepend (account_commits, account);
 
-    xaccAccountInsertSplit (account, split);
+        xaccAccountInsertSplit (account, split);
 
-    xaccTransAppendSplit (trans, split);
+        xaccTransAppendSplit (trans, split);
 
-    xaccSplitSetAmount (split, gnc_numeric_neg (amount));
-    xaccSplitSetValue (split, gnc_numeric_neg (amount));
+        xaccSplitSetAmount (split, gnc_numeric_neg (amount));
+        xaccSplitSetValue (split, gnc_numeric_neg (amount));
 
-    xaccSplitSetMemo (split, memo);
-  }
+        xaccSplitSetMemo (split, memo);
+    }
 
-  xaccTransCommitEdit (trans);
+    xaccTransCommitEdit (trans);
 
-  for (node = account_commits; node; node = node->next)
-    xaccAccountCommitEdit (node->data);
-  g_list_free (account_commits);
+    for (node = account_commits; node; node = node->next)
+        xaccAccountCommitEdit (node->data);
+    g_list_free (account_commits);
 
-  gnc_resume_gui_refresh ();
+    gnc_resume_gui_refresh ();
 
-  gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
+    gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
 }
 
 void
 gnc_stock_split_druid_cancel_druid (GnomeDruid *druid, gpointer user_data)
 {
-  StockSplitInfo *info = user_data;
+    StockSplitInfo *info = user_data;
 
-  gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
+    gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
 }
 
 static gboolean
 gnc_stock_split_druid_view_filter_income (Account  *account,
-					  gpointer  data)
+        gpointer  data)
 {
-  GNCAccountType type;
+    GNCAccountType type;
 
-  type = xaccAccountGetType(account);
-  return (type == ACCT_TYPE_INCOME);
+    type = xaccAccountGetType(account);
+    return (type == ACCT_TYPE_INCOME);
 }
 
 static gboolean
 gnc_stock_split_druid_view_filter_asset (Account  *account,
-					 gpointer  data)
+        gpointer  data)
 {
-  GNCAccountType type;
+    GNCAccountType type;
 
-  type = xaccAccountGetType(account);
-  return ((type == ACCT_TYPE_BANK) || (type == ACCT_TYPE_CASH) ||
-	  (type == ACCT_TYPE_ASSET));
+    type = xaccAccountGetType(account);
+    return ((type == ACCT_TYPE_BANK) || (type == ACCT_TYPE_CASH) ||
+            (type == ACCT_TYPE_ASSET));
 }
 
 static void
 gnc_stock_split_druid_create (StockSplitInfo *info)
 {
-  GladeXML *xml;
+    GladeXML *xml;
 
-  xml = gnc_glade_xml_new ("stocks.glade", "Stock Split Druid");
-  info->window = glade_xml_get_widget (xml, "Stock Split Druid");
-  info->druid = glade_xml_get_widget (xml, "stock_split_druid");
+    xml = gnc_glade_xml_new ("stocks.glade", "Stock Split Druid");
+    info->window = glade_xml_get_widget (xml, "Stock Split Druid");
+    info->druid = glade_xml_get_widget (xml, "stock_split_druid");
 
-  glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, info);
+    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, info);
 
-  /* libglade2 is broken. It should read these from the glade file. */
-  gnc_druid_set_colors (GNOME_DRUID(info->druid));
-  gnc_druid_set_watermark_images (GNOME_DRUID(info->druid),
-				  "stock_split_title.png",
-				  "stock_split_watermark.png");
+    /* libglade2 is broken. It should read these from the glade file. */
+    gnc_druid_set_colors (GNOME_DRUID(info->druid));
+    gnc_druid_set_watermark_images (GNOME_DRUID(info->druid),
+                                    "stock_split_title.png",
+                                    "stock_split_watermark.png");
 
 
-  /* account list */
-  {
-    GtkTreeView *view;
-    GtkListStore *store;
-    GtkTreeSelection *selection;
-    GtkCellRenderer *renderer;
-    GtkTreeViewColumn *column;
+    /* account list */
+    {
+        GtkTreeView *view;
+        GtkListStore *store;
+        GtkTreeSelection *selection;
+        GtkCellRenderer *renderer;
+        GtkTreeViewColumn *column;
 
-    info->account_view = glade_xml_get_widget (xml, "account_view");
+        info->account_view = glade_xml_get_widget (xml, "account_view");
 
-    view = GTK_TREE_VIEW(info->account_view);
+        view = GTK_TREE_VIEW(info->account_view);
 
-    store = gtk_list_store_new(NUM_SPLIT_COLS, G_TYPE_POINTER, G_TYPE_STRING,
-			       G_TYPE_STRING, G_TYPE_STRING);
-    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
-    g_object_unref(store);
+        store = gtk_list_store_new(NUM_SPLIT_COLS, G_TYPE_POINTER, G_TYPE_STRING,
+                                   G_TYPE_STRING, 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(_("Account"), renderer,
-						      "text", SPLIT_COL_FULLNAME,
-						      NULL);
-    gtk_tree_view_append_column(view, column);
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes(_("Account"), renderer,
+                 "text", SPLIT_COL_FULLNAME,
+                 NULL);
+        gtk_tree_view_append_column(view, column);
 
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Symbol"), renderer,
-						      "text", SPLIT_COL_MNEMONIC,
-						      NULL);
-    gtk_tree_view_append_column(view, column);
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes(_("Symbol"), renderer,
+                 "text", SPLIT_COL_MNEMONIC,
+                 NULL);
+        gtk_tree_view_append_column(view, column);
 
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Shares"), renderer,
-						      "text", SPLIT_COL_SHARES,
-						      NULL);
-    gtk_tree_view_append_column(view, column);
+        renderer = gtk_cell_renderer_text_new();
+        column = gtk_tree_view_column_new_with_attributes(_("Shares"), renderer,
+                 "text", SPLIT_COL_SHARES,
+                 NULL);
+        gtk_tree_view_append_column(view, column);
 
-    selection = gtk_tree_view_get_selection(view);
-    gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
-    g_signal_connect (selection, "changed",
-		      G_CALLBACK (selection_changed), info);
-  }
+        selection = gtk_tree_view_get_selection(view);
+        gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
+        g_signal_connect (selection, "changed",
+                          G_CALLBACK (selection_changed), info);
+    }
 
-  /* info widgets */
-  {
-    GtkWidget *box;
-    GtkWidget *amount;
-    GtkWidget *date;
-    GtkWidget *ce;
-    GtkWidget *label;
+    /* info widgets */
+    {
+        GtkWidget *box;
+        GtkWidget *amount;
+        GtkWidget *date;
+        GtkWidget *ce;
+        GtkWidget *label;
 
-    info->description_entry = glade_xml_get_widget (xml, "description_entry");
+        info->description_entry = glade_xml_get_widget (xml, "description_entry");
 
-    box = glade_xml_get_widget (xml, "date_box");
-    date = gnc_date_edit_new(time(NULL), FALSE, FALSE);
-    gtk_box_pack_start (GTK_BOX (box), date, TRUE, TRUE, 0);
-    info->date_edit = date;
-    label = glade_xml_get_widget (xml, "date_label");
-    gnc_date_make_mnemonic_target (GNC_DATE_EDIT(date), label);
+        box = glade_xml_get_widget (xml, "date_box");
+        date = gnc_date_edit_new(time(NULL), FALSE, FALSE);
+        gtk_box_pack_start (GTK_BOX (box), date, TRUE, TRUE, 0);
+        info->date_edit = date;
+        label = glade_xml_get_widget (xml, "date_label");
+        gnc_date_make_mnemonic_target (GNC_DATE_EDIT(date), label);
 
-    box = glade_xml_get_widget (xml, "distribution_box");
-    amount = gnc_amount_edit_new ();
-    gtk_box_pack_start (GTK_BOX (box), amount, TRUE, TRUE, 0);
-    info->distribution_edit = amount;
-    label = glade_xml_get_widget (xml, "distribution_label");
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label), amount);
+        box = glade_xml_get_widget (xml, "distribution_box");
+        amount = gnc_amount_edit_new ();
+        gtk_box_pack_start (GTK_BOX (box), amount, TRUE, TRUE, 0);
+        info->distribution_edit = amount;
+        label = glade_xml_get_widget (xml, "distribution_label");
+        gtk_label_set_mnemonic_widget(GTK_LABEL(label), amount);
 
-    box = glade_xml_get_widget (xml, "price_box");
-    amount = gnc_amount_edit_new ();
-    gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (amount),
-                                    gnc_default_price_print_info ());
-    gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (amount), TRUE);
-    gtk_box_pack_start (GTK_BOX (box), amount, TRUE, TRUE, 0);
-    info->price_edit = amount;
-    label = glade_xml_get_widget (xml, "price_label");
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label), amount);
+        box = glade_xml_get_widget (xml, "price_box");
+        amount = gnc_amount_edit_new ();
+        gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (amount),
+                                        gnc_default_price_print_info ());
+        gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (amount), TRUE);
+        gtk_box_pack_start (GTK_BOX (box), amount, TRUE, TRUE, 0);
+        info->price_edit = amount;
+        label = glade_xml_get_widget (xml, "price_label");
+        gtk_label_set_mnemonic_widget(GTK_LABEL(label), amount);
 
-    box = glade_xml_get_widget (xml, "price_currency_box");
-    ce = gnc_currency_edit_new ();
-    gtk_box_pack_start (GTK_BOX (box), ce, TRUE, TRUE, 0);
-    info->price_currency_edit = ce;
-    label = glade_xml_get_widget (xml, "currency_label");
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label), ce);
-  }
+        box = glade_xml_get_widget (xml, "price_currency_box");
+        ce = gnc_currency_edit_new ();
+        gtk_box_pack_start (GTK_BOX (box), ce, TRUE, TRUE, 0);
+        info->price_currency_edit = ce;
+        label = glade_xml_get_widget (xml, "currency_label");
+        gtk_label_set_mnemonic_widget(GTK_LABEL(label), ce);
+    }
 
-  /* Cash in Lieu page */
-  {
-    GtkWidget *box;
-    GtkWidget *tree;
-    GtkWidget *amount;
-    GtkWidget *label;
-    GtkWidget *scroll;
+    /* Cash in Lieu page */
+    {
+        GtkWidget *box;
+        GtkWidget *tree;
+        GtkWidget *amount;
+        GtkWidget *label;
+        GtkWidget *scroll;
 
-    box = glade_xml_get_widget (xml, "cash_box");
-    amount = gnc_amount_edit_new ();
-    gtk_box_pack_start (GTK_BOX (box), amount, TRUE, TRUE, 0);
-    info->cash_edit = amount;
-    label = glade_xml_get_widget (xml, "cash_label");
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label), amount);
+        box = glade_xml_get_widget (xml, "cash_box");
+        amount = gnc_amount_edit_new ();
+        gtk_box_pack_start (GTK_BOX (box), amount, TRUE, TRUE, 0);
+        info->cash_edit = amount;
+        label = glade_xml_get_widget (xml, "cash_label");
+        gtk_label_set_mnemonic_widget(GTK_LABEL(label), amount);
 
-    info->memo_entry = glade_xml_get_widget (xml, "memo_entry");
+        info->memo_entry = glade_xml_get_widget (xml, "memo_entry");
 
-    /* income tree */
-    tree = GTK_WIDGET(gnc_tree_view_account_new (FALSE));
-    info->income_tree = tree;
-    gnc_tree_view_account_set_filter (GNC_TREE_VIEW_ACCOUNT (tree),
-				      gnc_stock_split_druid_view_filter_income,
-				      NULL, /* user data */
-				      NULL  /* destroy callback */);
+        /* income tree */
+        tree = GTK_WIDGET(gnc_tree_view_account_new (FALSE));
+        info->income_tree = tree;
+        gnc_tree_view_account_set_filter (GNC_TREE_VIEW_ACCOUNT (tree),
+                                          gnc_stock_split_druid_view_filter_income,
+                                          NULL, /* user data */
+                                          NULL  /* destroy callback */);
 
-    gtk_widget_show (tree);
+        gtk_widget_show (tree);
 
-    label = glade_xml_get_widget (xml, "income_label");
-    gtk_label_set_mnemonic_widget (GTK_LABEL(label), tree);
+        label = glade_xml_get_widget (xml, "income_label");
+        gtk_label_set_mnemonic_widget (GTK_LABEL(label), tree);
 
-    scroll = glade_xml_get_widget (xml, "income_scroll");
-    gtk_container_add (GTK_CONTAINER (scroll), tree);
+        scroll = glade_xml_get_widget (xml, "income_scroll");
+        gtk_container_add (GTK_CONTAINER (scroll), tree);
 
 
-    /* asset tree */
-    tree = GTK_WIDGET(gnc_tree_view_account_new (FALSE));
-    info->asset_tree = tree;
-    gnc_tree_view_account_set_filter (GNC_TREE_VIEW_ACCOUNT (tree),
-				      gnc_stock_split_druid_view_filter_asset,
-				      NULL /* user data */,
-				      NULL /* destroy callback */);
+        /* asset tree */
+        tree = GTK_WIDGET(gnc_tree_view_account_new (FALSE));
+        info->asset_tree = tree;
+        gnc_tree_view_account_set_filter (GNC_TREE_VIEW_ACCOUNT (tree),
+                                          gnc_stock_split_druid_view_filter_asset,
+                                          NULL /* user data */,
+                                          NULL /* destroy callback */);
 
-    gtk_widget_show (tree);
+        gtk_widget_show (tree);
 
-    label = glade_xml_get_widget (xml, "asset_label");
-    gtk_label_set_mnemonic_widget (GTK_LABEL(label), tree);
+        label = glade_xml_get_widget (xml, "asset_label");
+        gtk_label_set_mnemonic_widget (GTK_LABEL(label), tree);
 
-    scroll = glade_xml_get_widget (xml, "asset_scroll");
-    gtk_container_add (GTK_CONTAINER (scroll), tree);
-  }
+        scroll = glade_xml_get_widget (xml, "asset_scroll");
+        gtk_container_add (GTK_CONTAINER (scroll), tree);
+    }
 }
 
 static void
 refresh_handler (GHashTable *changes, gpointer user_data)
 {
-  StockSplitInfo *info = user_data;
-  Account *old_account;
-  GtkWidget *page;
-  GladeXML *xml;
+    StockSplitInfo *info = user_data;
+    Account *old_account;
+    GtkWidget *page;
+    GladeXML *xml;
 
-  old_account = info->acct;
+    old_account = info->acct;
 
-  if (fill_account_list (info, info->acct) == 0)
-  {
-    gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
-    return;
-  }
+    if (fill_account_list (info, info->acct) == 0)
+    {
+        gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
+        return;
+    }
 
-  if (NULL == info->acct || old_account == info->acct) return;
+    if (NULL == info->acct || old_account == info->acct) return;
 
-  xml = glade_get_widget_tree (info->window);
-  page = glade_xml_get_widget (xml, "account_page");
+    xml = glade_get_widget_tree (info->window);
+    page = glade_xml_get_widget (xml, "account_page");
 
-  gnome_druid_set_page (GNOME_DRUID (info->druid), GNOME_DRUID_PAGE (page));
+    gnome_druid_set_page (GNOME_DRUID (info->druid), GNOME_DRUID_PAGE (page));
 }
 
 static void
 close_handler (gpointer user_data)
 {
-  StockSplitInfo *info = user_data;
+    StockSplitInfo *info = user_data;
 
-  gtk_widget_destroy (info->window);
+    gtk_widget_destroy (info->window);
 }
 
 /********************************************************************\
  * gnc_stock_split_dialog                                           *
  *   opens up a window to record a stock split                      *
- *                                                                  * 
+ *                                                                  *
  * Args:   parent  - the parent ofthis window                       *
  *         initial - the initial account to use                     *
  * Return: nothing                                                  *
@@ -767,31 +774,31 @@
 void
 gnc_stock_split_dialog (GtkWidget *parent, Account * initial)
 {
-  StockSplitInfo *info;
-  gint component_id;
+    StockSplitInfo *info;
+    gint component_id;
 
-  info = g_new0 (StockSplitInfo, 1);
+    info = g_new0 (StockSplitInfo, 1);
 
-  info->acct = NULL;
+    info->acct = NULL;
 
-  gnc_stock_split_druid_create (info);
+    gnc_stock_split_druid_create (info);
 
-  component_id = gnc_register_gui_component (DRUID_STOCK_SPLIT_CM_CLASS,
-                                             refresh_handler, close_handler,
-                                             info);
+    component_id = gnc_register_gui_component (DRUID_STOCK_SPLIT_CM_CLASS,
+                   refresh_handler, close_handler,
+                   info);
 
-  gnc_gui_component_watch_entity_type (component_id,
-                                       GNC_ID_ACCOUNT,
-                                       QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
+    gnc_gui_component_watch_entity_type (component_id,
+                                         GNC_ID_ACCOUNT,
+                                         QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
 
-  if (fill_account_list (info, initial) == 0)
-  {
-    gnc_warning_dialog (parent, "%s", _("You don't have any stock accounts with balances!"));
-    gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
-    return;
-  }
+    if (fill_account_list (info, initial) == 0)
+    {
+        gnc_warning_dialog (parent, "%s", _("You don't have any stock accounts with balances!"));
+        gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
+        return;
+    }
 
-  gtk_widget_show_all (info->window);
+    gtk_widget_show_all (info->window);
 
-  gnc_window_adjust_for_screen (GTK_WINDOW(info->window));
+    gnc_window_adjust_for_screen (GTK_WINDOW(info->window));
 }

Modified: gnucash/trunk/src/gnome/druid-stock-split.h
===================================================================
--- gnucash/trunk/src/gnome/druid-stock-split.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/druid-stock-split.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -30,7 +30,7 @@
 /********************************************************************\
  * gnc_stock_split_dialog                                           *
  *   opens up a window to record a stock split                      *
- *                                                                  * 
+ *                                                                  *
  * Args:   parent  - the parent ofthis window                       *
  *         initial - the initial account to use                     *
  * Return: nothing                                                  *

Modified: gnucash/trunk/src/gnome/gnc-plugin-account-tree.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-account-tree.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-account-tree.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-account-tree.c -- 
+/*
+ * gnc-plugin-account-tree.c --
  *
  * Copyright (C) 2003 Jan Arne Petersen
  * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
@@ -53,10 +53,13 @@
 
 /** An array of all of the actions provided by the account tree
  *  plugin. */
-static GtkActionEntry gnc_plugin_actions [] = {
-	{ "ViewAccountTreeAction", NULL, N_("New Accounts _Page"), NULL,
-	  N_("Open a new Account Tree page"),
-	  G_CALLBACK (gnc_plugin_account_tree_cmd_new_account_tree) },
+static GtkActionEntry gnc_plugin_actions [] =
+{
+    {
+        "ViewAccountTreeAction", NULL, N_("New Accounts _Page"), NULL,
+        N_("Open a new Account Tree page"),
+        G_CALLBACK (gnc_plugin_account_tree_cmd_new_account_tree)
+    },
 };
 /** The number of actions provided by this plugin. */
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
@@ -65,7 +68,7 @@
 /** The instance private data structure for an account tree plugin. */
 typedef struct GncPluginAccountTreePrivate
 {
-	gpointer dummy;
+    gpointer dummy;
 } GncPluginAccountTreePrivate;
 
 #define GNC_PLUGIN_ACCOUNT_TREE_GET_PRIVATE(o)  \
@@ -79,27 +82,29 @@
 GType
 gnc_plugin_account_tree_get_type (void)
 {
-	static GType gnc_plugin_account_tree_type = 0;
+    static GType gnc_plugin_account_tree_type = 0;
 
-	if (gnc_plugin_account_tree_type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (GncPluginAccountTreeClass),
-			NULL,		/* base_init */
-			NULL,		/* base_finalize */
-			(GClassInitFunc) gnc_plugin_account_tree_class_init,
-			NULL,		/* class_finalize */
-			NULL,		/* class_data */
-			sizeof (GncPluginAccountTree),
-			0,		/* n_preallocs */
-			(GInstanceInitFunc) gnc_plugin_account_tree_init
-		};
-		
-		gnc_plugin_account_tree_type = g_type_register_static (GNC_TYPE_PLUGIN,
-								       "GncPluginAccountTree",
-								       &our_info, 0);
-	}
+    if (gnc_plugin_account_tree_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginAccountTreeClass),
+            NULL,		/* base_init */
+            NULL,		/* base_finalize */
+            (GClassInitFunc) gnc_plugin_account_tree_class_init,
+            NULL,		/* class_finalize */
+            NULL,		/* class_data */
+            sizeof (GncPluginAccountTree),
+            0,		/* n_preallocs */
+            (GInstanceInitFunc) gnc_plugin_account_tree_init
+        };
 
-	return gnc_plugin_account_tree_type;
+        gnc_plugin_account_tree_type = g_type_register_static (GNC_TYPE_PLUGIN,
+                                       "GncPluginAccountTree",
+                                       &our_info, 0);
+    }
+
+    return gnc_plugin_account_tree_type;
 }
 
 
@@ -107,16 +112,16 @@
 GncPlugin *
 gnc_plugin_account_tree_new (void)
 {
-	GncPluginAccountTree *plugin;
+    GncPluginAccountTree *plugin;
 
-	/* Reference the account tree page plugin to ensure it exists
-	 * in the gtk type system. */
-	GNC_TYPE_PLUGIN_PAGE_ACCOUNT_TREE;
+    /* Reference the account tree page plugin to ensure it exists
+     * in the gtk type system. */
+    GNC_TYPE_PLUGIN_PAGE_ACCOUNT_TREE;
 
-	plugin = g_object_new (GNC_TYPE_PLUGIN_ACCOUNT_TREE,
-			      NULL);
+    plugin = g_object_new (GNC_TYPE_PLUGIN_ACCOUNT_TREE,
+                           NULL);
 
-	return GNC_PLUGIN (plugin);
+    return GNC_PLUGIN (plugin);
 }
 
 
@@ -130,23 +135,23 @@
 static void
 gnc_plugin_account_tree_class_init (GncPluginAccountTreeClass *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_account_tree_finalize;
+    object_class->finalize = gnc_plugin_account_tree_finalize;
 
-	/* plugin info */
-	plugin_class->plugin_name  = GNC_PLUGIN_ACCOUNT_TREE_NAME;
+    /* plugin info */
+    plugin_class->plugin_name  = GNC_PLUGIN_ACCOUNT_TREE_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(GncPluginAccountTreePrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginAccountTreePrivate));
 }
 
 
@@ -172,15 +177,15 @@
 static void
 gnc_plugin_account_tree_finalize (GObject *object)
 {
-	GncPluginAccountTree *plugin;
-	GncPluginAccountTreePrivate *priv;
+    GncPluginAccountTree *plugin;
+    GncPluginAccountTreePrivate *priv;
 
-	g_return_if_fail (GNC_IS_PLUGIN_ACCOUNT_TREE (object));
+    g_return_if_fail (GNC_IS_PLUGIN_ACCOUNT_TREE (object));
 
-	plugin = GNC_PLUGIN_ACCOUNT_TREE (object);
-	priv = GNC_PLUGIN_ACCOUNT_TREE_GET_PRIVATE (object);
+    plugin = GNC_PLUGIN_ACCOUNT_TREE (object);
+    priv = GNC_PLUGIN_ACCOUNT_TREE_GET_PRIVATE (object);
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 /************************************************************
@@ -189,14 +194,14 @@
 
 static void
 gnc_plugin_account_tree_cmd_new_account_tree (GtkAction *action,
-					      GncMainWindowActionData *data)
+        GncMainWindowActionData *data)
 {
-	GncPluginPage *page;
+    GncPluginPage *page;
 
-	g_return_if_fail (data != NULL);
+    g_return_if_fail (data != NULL);
 
-	page = gnc_plugin_page_account_tree_new ();
-	gnc_main_window_open_page (data->window, page);
+    page = gnc_plugin_page_account_tree_new ();
+    gnc_main_window_open_page (data->window, page);
 }
 
 /** @} */

Modified: gnucash/trunk/src/gnome/gnc-plugin-account-tree.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-account-tree.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-account-tree.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-account-tree.h -- 
+/*
+ * gnc-plugin-account-tree.h --
  *
  * Copyright (C) 2003 Jan Arne Petersen
  * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
@@ -53,15 +53,17 @@
 /* typedefs & structures */
 
 /** The instance data structure for an account tree menu plugin. */
-typedef struct {
-	/** The parent object for this widget */
-	GncPlugin gnc_plugin;
+typedef struct
+{
+    /** The parent object for this widget */
+    GncPlugin gnc_plugin;
 } GncPluginAccountTree;
 
 /** The class data structure for an account tree menu plugin. */
-typedef struct {
-	/** The parent class for this widget. */
-	GncPluginClass gnc_plugin;
+typedef struct
+{
+    /** The parent class for this widget. */
+    GncPluginClass gnc_plugin;
 } GncPluginAccountTreeClass;
 
 

Modified: gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-basic-commands.c -- 
+/*
+ * gnc-plugin-basic-commands.c --
  *
  * Copyright (C) 2005 David Hampton <hampton at employees.org>
  *
@@ -94,89 +94,126 @@
 
 /** An array of all of the actions provided by the basic commands
  *  plugin. */
-static GtkActionEntry gnc_plugin_actions [] = {
+static GtkActionEntry gnc_plugin_actions [] =
+{
 
-  /* File menu */
+    /* File menu */
 
-  { "FileNewAction", GTK_STOCK_NEW, N_("New _File"), NULL,
-    N_("Create a new file"),
-    G_CALLBACK (gnc_main_window_cmd_file_new) },
-  { "FileOpenAction", GTK_STOCK_OPEN, N_("_Open..."), NULL,
-    N_("Open an existing GnuCash file"),
-    G_CALLBACK (gnc_main_window_cmd_file_open) },
-  { "FileSaveAction", GTK_STOCK_SAVE, N_("_Save"), "<control>s",
-    N_("Save the current file"),
-    G_CALLBACK (gnc_main_window_cmd_file_save) },
-  { "FileSaveAsAction", GTK_STOCK_SAVE_AS, N_("Save _As..."), "<shift><control>s",
-    NULL,
-    G_CALLBACK (gnc_main_window_cmd_file_save_as) },
+    {
+        "FileNewAction", GTK_STOCK_NEW, N_("New _File"), NULL,
+        N_("Create a new file"),
+        G_CALLBACK (gnc_main_window_cmd_file_new)
+    },
+    {
+        "FileOpenAction", GTK_STOCK_OPEN, N_("_Open..."), NULL,
+        N_("Open an existing GnuCash file"),
+        G_CALLBACK (gnc_main_window_cmd_file_open)
+    },
+    {
+        "FileSaveAction", GTK_STOCK_SAVE, N_("_Save"), "<control>s",
+        N_("Save the current file"),
+        G_CALLBACK (gnc_main_window_cmd_file_save)
+    },
+    {
+        "FileSaveAsAction", GTK_STOCK_SAVE_AS, N_("Save _As..."), "<shift><control>s",
+        NULL,
+        G_CALLBACK (gnc_main_window_cmd_file_save_as)
+    },
 #ifdef QSF_IMPORT_WORKS
-  { "FileImportQSFAction", GTK_STOCK_CONVERT,
-    N_("_QSF Import"), NULL,
-    N_("Import a QSF object file"),
-    G_CALLBACK (gnc_main_window_cmd_file_qsf_import) },
+    {
+        "FileImportQSFAction", GTK_STOCK_CONVERT,
+        N_("_QSF Import"), NULL,
+        N_("Import a QSF object file"),
+        G_CALLBACK (gnc_main_window_cmd_file_qsf_import)
+    },
 #endif // QSF_IMPORT_WORKS
-  { "FileExportAccountsAction", GTK_STOCK_CONVERT,
-    N_("Export _Accounts"), NULL,
-    N_("Export the account hierarchy to a new GnuCash datafile"),
-    G_CALLBACK (gnc_main_window_cmd_file_export_accounts) },
-  { "FileExportChartAction", GTK_STOCK_CONVERT,
-    N_("Export _Chart of Accounts to QSF"), NULL,
-    N_("Export the chart of accounts for a date with balances as QSF"),
-    G_CALLBACK (gnc_main_window_cmd_file_chart_export) },
+    {
+        "FileExportAccountsAction", GTK_STOCK_CONVERT,
+        N_("Export _Accounts"), NULL,
+        N_("Export the account hierarchy to a new GnuCash datafile"),
+        G_CALLBACK (gnc_main_window_cmd_file_export_accounts)
+    },
+    {
+        "FileExportChartAction", GTK_STOCK_CONVERT,
+        N_("Export _Chart of Accounts to QSF"), NULL,
+        N_("Export the chart of accounts for a date with balances as QSF"),
+        G_CALLBACK (gnc_main_window_cmd_file_chart_export)
+    },
 
-  /* Edit menu */
+    /* Edit menu */
 
-  { "EditFindTransactionsAction", GTK_STOCK_FIND, N_("_Find..."), "<control>f",
-    N_("Find transactions with a search"),
-    G_CALLBACK (gnc_main_window_cmd_tools_find_transactions) },
-  { "EditTaxOptionsAction", NULL, 
-    N_("Ta_x Report Options"), NULL,
-   /* Translators: currently implemented are *
-    * US: income tax and                     *
-    * DE: VAT                                *
-    * So adjust this string                  */
-    N_("Setup relevant accounts for tax reports, e.g. US income tax"),
-    G_CALLBACK (gnc_main_window_cmd_edit_tax_options) },
+    {
+        "EditFindTransactionsAction", GTK_STOCK_FIND, N_("_Find..."), "<control>f",
+        N_("Find transactions with a search"),
+        G_CALLBACK (gnc_main_window_cmd_tools_find_transactions)
+    },
+    {
+        "EditTaxOptionsAction", NULL,
+        N_("Ta_x Report Options"), NULL,
+        /* Translators: currently implemented are *
+         * US: income tax and                     *
+         * DE: VAT                                *
+         * So adjust this string                  */
+        N_("Setup relevant accounts for tax reports, e.g. US income tax"),
+        G_CALLBACK (gnc_main_window_cmd_edit_tax_options)
+    },
 
-  /* Actions menu */
+    /* Actions menu */
 
-  { "ActionsScheduledTransactionsAction", NULL, N_("_Scheduled Transactions"), NULL, NULL, NULL },
-  { "ActionsScheduledTransactionEditorAction", NULL, N_("_Scheduled Transaction Editor"), NULL,
-    N_("The list of Scheduled Transactions"),
-    G_CALLBACK (gnc_main_window_cmd_actions_scheduled_transaction_editor) },
-  { "ActionsSinceLastRunAction", NULL, N_("Since _Last Run..."), NULL,
-    N_("Create Scheduled Transactions since the last time run"),
-    G_CALLBACK (gnc_main_window_cmd_actions_since_last_run) },
-  { "ActionsMortgageLoanAction", NULL, N_("_Mortgage & Loan Repayment..."), NULL,
-    N_("Setup scheduled transactions for repayment of a loan"),
-    G_CALLBACK (gnc_main_window_cmd_actions_mortgage_loan) },
+    { "ActionsScheduledTransactionsAction", NULL, N_("_Scheduled Transactions"), NULL, NULL, NULL },
+    {
+        "ActionsScheduledTransactionEditorAction", NULL, N_("_Scheduled Transaction Editor"), NULL,
+        N_("The list of Scheduled Transactions"),
+        G_CALLBACK (gnc_main_window_cmd_actions_scheduled_transaction_editor)
+    },
+    {
+        "ActionsSinceLastRunAction", NULL, N_("Since _Last Run..."), NULL,
+        N_("Create Scheduled Transactions since the last time run"),
+        G_CALLBACK (gnc_main_window_cmd_actions_since_last_run)
+    },
+    {
+        "ActionsMortgageLoanAction", NULL, N_("_Mortgage & Loan Repayment..."), NULL,
+        N_("Setup scheduled transactions for repayment of a loan"),
+        G_CALLBACK (gnc_main_window_cmd_actions_mortgage_loan)
+    },
 #ifdef CLOSE_BOOKS_ACTUALLY_WORKS
-  { "ActionsCloseBooksAction", NULL, N_("Close _Books"), NULL,
-    N_("Archive old data using accounting periods"),
-    G_CALLBACK (gnc_main_window_cmd_actions_close_books) },
+    {
+        "ActionsCloseBooksAction", NULL, N_("Close _Books"), NULL,
+        N_("Archive old data using accounting periods"),
+        G_CALLBACK (gnc_main_window_cmd_actions_close_books)
+    },
 #endif // CLOSE_BOOKS_ACTUALLY_WORKS
 
-  /* Tools menu */
+    /* Tools menu */
 
-  { "ToolsPriceEditorAction", NULL, N_("_Price Editor"), NULL,
-    N_("View and edit the prices for stocks and mutual funds"),
-    G_CALLBACK (gnc_main_window_cmd_tools_price_editor) },
-  { "ToolsCommodityEditorAction", NULL, N_("_Security Editor"), NULL,
-    N_("View and edit the commodities for stocks and mutual funds"),
-    G_CALLBACK (gnc_main_window_cmd_tools_commodity_editor) },
-  { "ToolsFinancialCalculatorAction", NULL, N_("_Financial Calculator"), NULL,
-    N_("Use the financial calculator"),
-    G_CALLBACK (gnc_main_window_cmd_tools_financial_calculator) },
-  { "ToolsBookCloseAction", NULL, N_("_Close Book"), NULL,
-    N_("Close the Book at the end of the Period"),
-    G_CALLBACK (gnc_main_window_cmd_tools_close_book) },
+    {
+        "ToolsPriceEditorAction", NULL, N_("_Price Editor"), NULL,
+        N_("View and edit the prices for stocks and mutual funds"),
+        G_CALLBACK (gnc_main_window_cmd_tools_price_editor)
+    },
+    {
+        "ToolsCommodityEditorAction", NULL, N_("_Security Editor"), NULL,
+        N_("View and edit the commodities for stocks and mutual funds"),
+        G_CALLBACK (gnc_main_window_cmd_tools_commodity_editor)
+    },
+    {
+        "ToolsFinancialCalculatorAction", NULL, N_("_Financial Calculator"), NULL,
+        N_("Use the financial calculator"),
+        G_CALLBACK (gnc_main_window_cmd_tools_financial_calculator)
+    },
+    {
+        "ToolsBookCloseAction", NULL, N_("_Close Book"), NULL,
+        N_("Close the Book at the end of the Period"),
+        G_CALLBACK (gnc_main_window_cmd_tools_close_book)
+    },
 
-  /* Help menu */
+    /* Help menu */
 
-  { "HelpTipsOfTheDayAction", NULL, N_("_Tips Of The Day"), NULL,
-    N_("View the Tips of the Day"),
-    G_CALLBACK (gnc_main_window_cmd_help_totd) },
+    {
+        "HelpTipsOfTheDayAction", NULL, N_("_Tips Of The Day"), NULL,
+        N_("View the Tips of the Day"),
+        G_CALLBACK (gnc_main_window_cmd_help_totd)
+    },
 };
 /** The number of actions provided by this plugin. */
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
@@ -185,9 +222,10 @@
 /** These are the "important" actions provided by the basic commands
  *  plugin.  Their labels will appear when the toolbar is set to
  *  "Icons and important text" (e.g. GTK_TOOLBAR_BOTH_HORIZ) mode. */
-static const gchar *gnc_plugin_important_actions[] = {
-  "FileSaveAction",
-  NULL,
+static const gchar *gnc_plugin_important_actions[] =
+{
+    "FileSaveAction",
+    NULL,
 };
 
 
@@ -195,7 +233,7 @@
  *  plugin. */
 typedef struct GncPluginBasicCommandsPrivate
 {
-  gpointer dummy;
+    gpointer dummy;
 } GncPluginBasicCommandsPrivate;
 
 #define GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE(o)  \
@@ -209,27 +247,29 @@
 GType
 gnc_plugin_basic_commands_get_type (void)
 {
-  static GType gnc_plugin_basic_commands_type = 0;
+    static GType gnc_plugin_basic_commands_type = 0;
 
-  if (gnc_plugin_basic_commands_type == 0) {
-    static const GTypeInfo our_info = {
-      sizeof (GncPluginBasicCommandsClass),
-      NULL,		/* base_init */
-      NULL,		/* base_finalize */
-      (GClassInitFunc) gnc_plugin_basic_commands_class_init,
-      NULL,		/* class_finalize */
-      NULL,		/* class_data */
-      sizeof (GncPluginBasicCommands),
-      0,		/* n_preallocs */
-      (GInstanceInitFunc) gnc_plugin_basic_commands_init
-    };
- 
-    gnc_plugin_basic_commands_type = g_type_register_static (GNC_TYPE_PLUGIN,
-							     "GncPluginBasicCommands",
-							     &our_info, 0);
-  }
+    if (gnc_plugin_basic_commands_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginBasicCommandsClass),
+            NULL,		/* base_init */
+            NULL,		/* base_finalize */
+            (GClassInitFunc) gnc_plugin_basic_commands_class_init,
+            NULL,		/* class_finalize */
+            NULL,		/* class_data */
+            sizeof (GncPluginBasicCommands),
+            0,		/* n_preallocs */
+            (GInstanceInitFunc) gnc_plugin_basic_commands_init
+        };
 
-  return gnc_plugin_basic_commands_type;
+        gnc_plugin_basic_commands_type = g_type_register_static (GNC_TYPE_PLUGIN,
+                                         "GncPluginBasicCommands",
+                                         &our_info, 0);
+    }
+
+    return gnc_plugin_basic_commands_type;
 }
 
 
@@ -237,15 +277,15 @@
 GncPlugin *
 gnc_plugin_basic_commands_new (void)
 {
-  GncPluginBasicCommands *plugin;
+    GncPluginBasicCommands *plugin;
 
-  /* We just need to mention it, so the GType is registered and will be
-   * reflected during plugin-page restore. */
-  GNC_TYPE_PLUGIN_PAGE_SX_LIST;
+    /* We just need to mention it, so the GType is registered and will be
+     * reflected during plugin-page restore. */
+    GNC_TYPE_PLUGIN_PAGE_SX_LIST;
 
-  plugin = g_object_new (GNC_TYPE_PLUGIN_BASIC_COMMANDS, NULL);
+    plugin = g_object_new (GNC_TYPE_PLUGIN_BASIC_COMMANDS, NULL);
 
-  return GNC_PLUGIN (plugin);
+    return GNC_PLUGIN (plugin);
 }
 
 /** Initialize the basic commands menu for a window.  This function is
@@ -264,8 +304,8 @@
  */
 static void
 gnc_plugin_basic_commands_add_to_window (GncPlugin *plugin,
-				       GncMainWindow *window,
-				       GQuark type)
+        GncMainWindow *window,
+        GQuark type)
 {
 }
 
@@ -279,27 +319,27 @@
 static void
 gnc_plugin_basic_commands_class_init (GncPluginBasicCommandsClass *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_basic_commands_finalize;
+    object_class->finalize = gnc_plugin_basic_commands_finalize;
 
-  /* plugin info */
-  plugin_class->plugin_name  = GNC_PLUGIN_BASIC_COMMANDS_NAME;
+    /* plugin info */
+    plugin_class->plugin_name  = GNC_PLUGIN_BASIC_COMMANDS_NAME;
 
-  /* function overrides */
-  plugin_class->add_to_window = gnc_plugin_basic_commands_add_to_window;
+    /* function overrides */
+    plugin_class->add_to_window = gnc_plugin_basic_commands_add_to_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->important_actions = gnc_plugin_important_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->important_actions = gnc_plugin_important_actions;
+    plugin_class->ui_filename       = PLUGIN_UI_FILENAME;
 
-  g_type_class_add_private(klass, sizeof(GncPluginBasicCommandsPrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginBasicCommandsPrivate));
 }
 
 
@@ -325,15 +365,15 @@
 static void
 gnc_plugin_basic_commands_finalize (GObject *object)
 {
-  GncPluginBasicCommands *plugin;
-  GncPluginBasicCommandsPrivate *priv;
+    GncPluginBasicCommands *plugin;
+    GncPluginBasicCommandsPrivate *priv;
 
-  g_return_if_fail (GNC_IS_PLUGIN_BASIC_COMMANDS (object));
+    g_return_if_fail (GNC_IS_PLUGIN_BASIC_COMMANDS (object));
 
-  plugin = GNC_PLUGIN_BASIC_COMMANDS (object);
-  priv= GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE (plugin);
+    plugin = GNC_PLUGIN_BASIC_COMMANDS (object);
+    priv = GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE (plugin);
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 /************************************************************
@@ -343,253 +383,254 @@
 static void
 gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindowActionData *data)
 {
-  if (!gnc_main_window_all_finish_pending())
-    return;
+    if (!gnc_main_window_all_finish_pending())
+        return;
 
-  gnc_file_new ();
-  /* FIXME GNOME 2 Port (update the title etc.) */
+    gnc_file_new ();
+    /* FIXME GNOME 2 Port (update the title etc.) */
 }
 
 static void
 gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindowActionData *data)
 {
-  g_return_if_fail (data != NULL);
+    g_return_if_fail (data != NULL);
 
-  if (!gnc_main_window_all_finish_pending())
-    return;
+    if (!gnc_main_window_all_finish_pending())
+        return;
 
-  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
+    gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
 #ifdef HAVE_DBI_DBI_H
-  gnc_ui_file_access_for_open();
+    gnc_ui_file_access_for_open();
 #else
-  gnc_file_open ();
+    gnc_file_open ();
 #endif
-  gnc_window_set_progressbar_window (NULL);
+    gnc_window_set_progressbar_window (NULL);
 }
 
 static void
 gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindowActionData *data)
 {
-  g_return_if_fail (data != NULL);
+    g_return_if_fail (data != NULL);
 
-  if (!gnc_main_window_all_finish_pending())
-    return;
+    if (!gnc_main_window_all_finish_pending())
+        return;
 
-  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
-  gnc_file_save ();
-  gnc_window_set_progressbar_window (NULL);
-  /* FIXME GNOME 2 Port (update the title etc.) */
+    gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
+    gnc_file_save ();
+    gnc_window_set_progressbar_window (NULL);
+    /* FIXME GNOME 2 Port (update the title etc.) */
 }
 
 static void
 gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindowActionData *data)
 {
-  g_return_if_fail (data != NULL);
+    g_return_if_fail (data != NULL);
 
-  if (!gnc_main_window_all_finish_pending())
-    return;
+    if (!gnc_main_window_all_finish_pending())
+        return;
 
-  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
+    gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
 #ifdef HAVE_DBI_DBI_H
-  gnc_ui_file_access_for_save_as();
+    gnc_ui_file_access_for_save_as();
 #else
-  gnc_file_save_as ();
+    gnc_file_save_as ();
 #endif
-  gnc_window_set_progressbar_window (NULL);
-  /* FIXME GNOME 2 Port (update the title etc.) */
+    gnc_window_set_progressbar_window (NULL);
+    /* FIXME GNOME 2 Port (update the title etc.) */
 }
 
 static void
 qsf_file_select_ok(GtkWidget *w, GtkFileSelection *fs )
 {
-  QofSession *qsf_session, *first_session;
-  const gchar *filename, *message, *error_message;
-  QofBook *original;
-  QofBackendError err;
+    QofSession *qsf_session, *first_session;
+    const gchar *filename, *message, *error_message;
+    QofBook *original;
+    QofBackendError err;
 
-  ENTER (" ");
-  qof_event_suspend();
-  filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION (fs));
-  gtk_widget_destroy((GtkWidget*) fs);
-  first_session = gnc_get_current_session();
-  original = qof_session_get_book(first_session);
-  qsf_session = qof_session_new();
-  qof_session_begin(qsf_session, filename, TRUE, FALSE);
-  qof_session_load(qsf_session, NULL);
-  err = qof_session_get_error(qsf_session);
-  if (err != ERR_BACKEND_NO_ERR) {
-    error_message = qof_session_get_error_message(qsf_session);
-    if (!error_message)
-	error_message = "";
-    /* Translators: %d is the error number; %s is the error message as
-       text. */
-    message = g_strdup_printf(_("Error: Loading failed, error code %d - %s."), err, error_message);
-    PERR("%s", message);
-    qof_session_destroy(qsf_session);
+    ENTER (" ");
+    qof_event_suspend();
+    filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION (fs));
+    gtk_widget_destroy((GtkWidget*) fs);
+    first_session = gnc_get_current_session();
+    original = qof_session_get_book(first_session);
+    qsf_session = qof_session_new();
+    qof_session_begin(qsf_session, filename, TRUE, FALSE);
+    qof_session_load(qsf_session, NULL);
+    err = qof_session_get_error(qsf_session);
+    if (err != ERR_BACKEND_NO_ERR)
+    {
+        error_message = qof_session_get_error_message(qsf_session);
+        if (!error_message)
+            error_message = "";
+        /* Translators: %d is the error number; %s is the error message as
+           text. */
+        message = g_strdup_printf(_("Error: Loading failed, error code %d - %s."), err, error_message);
+        PERR("%s", message);
+        qof_session_destroy(qsf_session);
+        qof_event_resume();
+        gnc_error_dialog(gnc_ui_get_toplevel(), "%s", message);
+        LEAVE (" ");
+        return;
+    }
+
     qof_event_resume();
-    gnc_error_dialog(gnc_ui_get_toplevel(), "%s", message);
+    gnc_ui_qsf_import_merge_druid(first_session, qsf_session);
     LEAVE (" ");
-    return;
-  }
-
-  qof_event_resume();
-  gnc_ui_qsf_import_merge_druid(first_session, qsf_session);
-  LEAVE (" ");
 }
 
 static void
 gnc_main_window_cmd_file_qsf_import (GtkAction *action, GncMainWindowActionData *data)
 {
-  GtkWidget *file_select;
+    GtkWidget *file_select;
 
-  g_return_if_fail (data != NULL);
+    g_return_if_fail (data != NULL);
 
-  gnc_window_set_progressbar_window(GNC_WINDOW(data->window));
-  file_select = gtk_file_selection_new(_("Select the QSF file to import into GnuCash"));
-  g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (file_select)->ok_button),
-		    "clicked", G_CALLBACK (qsf_file_select_ok), (gpointer) file_select);
-  g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (file_select)->cancel_button),
-			    "clicked", G_CALLBACK (gtk_widget_destroy), G_OBJECT (file_select));
-  gtk_widget_show (file_select);
-  gnc_window_set_progressbar_window(NULL);
+    gnc_window_set_progressbar_window(GNC_WINDOW(data->window));
+    file_select = gtk_file_selection_new(_("Select the QSF file to import into GnuCash"));
+    g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (file_select)->ok_button),
+                      "clicked", G_CALLBACK (qsf_file_select_ok), (gpointer) file_select);
+    g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (file_select)->cancel_button),
+                              "clicked", G_CALLBACK (gtk_widget_destroy), G_OBJECT (file_select));
+    gtk_widget_show (file_select);
+    gnc_window_set_progressbar_window(NULL);
 }
 
 static void
 gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindowActionData *data)
 {
-  g_return_if_fail (data != NULL);
+    g_return_if_fail (data != NULL);
 
-  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
-  gnc_file_export_file (NULL);
-  gnc_window_set_progressbar_window (NULL);
-  /* FIXME GNOME 2 Port (update the title etc.) */
-  /* gnc_refresh_main_window_info (); */
+    gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
+    gnc_file_export_file (NULL);
+    gnc_window_set_progressbar_window (NULL);
+    /* FIXME GNOME 2 Port (update the title etc.) */
+    /* gnc_refresh_main_window_info (); */
 }
 
 static void
 gnc_main_window_cmd_file_chart_export (GtkAction *action, GncMainWindowActionData *data)
 {
-  g_return_if_fail (data != NULL);
+    g_return_if_fail (data != NULL);
 
-  gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
-  gnc_main_window_chart_export();
-  gnc_window_set_progressbar_window (NULL);
-  /* FIXME GNOME 2 Port (update the title etc.) */
-  /* gnc_refresh_main_window_info (); */
+    gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
+    gnc_main_window_chart_export();
+    gnc_window_set_progressbar_window (NULL);
+    /* FIXME GNOME 2 Port (update the title etc.) */
+    /* gnc_refresh_main_window_info (); */
 }
 
 static void
 gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindowActionData *data)
 {
-	g_return_if_fail (data != NULL);
+    g_return_if_fail (data != NULL);
 
-	gnc_tax_info_dialog (GTK_WIDGET (data->window));
+    gnc_tax_info_dialog (GTK_WIDGET (data->window));
 }
 
 static void
 gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindowActionData *data)
 {
-        GncPluginPage *page = gnc_plugin_page_sx_list_new();
-        gnc_main_window_open_page(NULL, page);
+    GncPluginPage *page = gnc_plugin_page_sx_list_new();
+    gnc_main_window_open_page(NULL, page);
 }
 
 static void
 gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActionData *data)
 {
-  GncMainWindow *window;
-  GncSxInstanceModel *sx_instances;
-  GncSxSummary summary;
-  GList *auto_created_txns = NULL;
-  const char *nothing_to_do_msg =
-    _( "There are no Scheduled Transactions to be entered at this time." );
-	
-  g_return_if_fail (data != NULL);
+    GncMainWindow *window;
+    GncSxInstanceModel *sx_instances;
+    GncSxSummary summary;
+    GList *auto_created_txns = NULL;
+    const char *nothing_to_do_msg =
+        _( "There are no Scheduled Transactions to be entered at this time." );
 
-  window = data->window;
+    g_return_if_fail (data != NULL);
 
-  sx_instances = gnc_sx_get_current_instances();
-  gnc_sx_instance_model_summarize(sx_instances, &summary);
-  gnc_sx_instance_model_effect_change(sx_instances, TRUE, &auto_created_txns, NULL);
-  if (summary.need_dialog)
-  {
-    gnc_ui_sx_since_last_run_dialog(sx_instances, auto_created_txns);
-    auto_created_txns = NULL;
-  }
-  else
-  {
-    if (summary.num_auto_create_no_notify_instances == 0)
+    window = data->window;
+
+    sx_instances = gnc_sx_get_current_instances();
+    gnc_sx_instance_model_summarize(sx_instances, &summary);
+    gnc_sx_instance_model_effect_change(sx_instances, TRUE, &auto_created_txns, NULL);
+    if (summary.need_dialog)
     {
-      gnc_info_dialog(GTK_WIDGET(&window->gtk_window), "%s", nothing_to_do_msg);
+        gnc_ui_sx_since_last_run_dialog(sx_instances, auto_created_txns);
+        auto_created_txns = NULL;
     }
     else
     {
-      gnc_info_dialog(GTK_WIDGET(&window->gtk_window), ngettext
-                      /* Translators: %d is the number of transactions. This is a
-                         ngettext(3) message. */
-                      ("There are no Scheduled Transactions to be entered at this time. "
-                       "(%d transaction automatically created)",
-                       "There are no Scheduled Transactions to be entered at this time. "
-                       "(%d transactions automatically created)",
-                       summary.num_auto_create_no_notify_instances),
-                      summary.num_auto_create_no_notify_instances);
+        if (summary.num_auto_create_no_notify_instances == 0)
+        {
+            gnc_info_dialog(GTK_WIDGET(&window->gtk_window), "%s", nothing_to_do_msg);
+        }
+        else
+        {
+            gnc_info_dialog(GTK_WIDGET(&window->gtk_window), ngettext
+                            /* Translators: %d is the number of transactions. This is a
+                               ngettext(3) message. */
+                            ("There are no Scheduled Transactions to be entered at this time. "
+                             "(%d transaction automatically created)",
+                             "There are no Scheduled Transactions to be entered at this time. "
+                             "(%d transactions automatically created)",
+                             summary.num_auto_create_no_notify_instances),
+                            summary.num_auto_create_no_notify_instances);
+        }
     }
-  }
-  g_list_free(auto_created_txns);
-  g_object_unref(G_OBJECT(sx_instances));
+    g_list_free(auto_created_txns);
+    g_object_unref(G_OBJECT(sx_instances));
 }
 
 static void
 gnc_main_window_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindowActionData *data)
 {
-  gnc_ui_sx_loan_druid_create ();
+    gnc_ui_sx_loan_druid_create ();
 }
 
 static void
 gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindowActionData *data)
 {
-  gnc_acct_period_dialog();
+    gnc_acct_period_dialog();
 }
 
 static void
 gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindowActionData *data)
 {
-	gnc_set_busy_cursor(NULL, TRUE);
-	gnc_prices_dialog (NULL);
-	gnc_unset_busy_cursor(NULL);
+    gnc_set_busy_cursor(NULL, TRUE);
+    gnc_prices_dialog (NULL);
+    gnc_unset_busy_cursor(NULL);
 }
 
 static void
 gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindowActionData *data)
 {
-	gnc_set_busy_cursor(NULL, TRUE);
-	gnc_commodities_dialog (NULL);
-	gnc_unset_busy_cursor(NULL);
+    gnc_set_busy_cursor(NULL, TRUE);
+    gnc_commodities_dialog (NULL);
+    gnc_unset_busy_cursor(NULL);
 }
 
 static void
 gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindowActionData *data)
 {
-  gnc_ui_fincalc_dialog_create();
+    gnc_ui_fincalc_dialog_create();
 }
 
 static void
 gnc_main_window_cmd_tools_close_book (GtkAction *action, GncMainWindowActionData *data)
 {
-  gnc_ui_close_book(gnc_get_current_book());
+    gnc_ui_close_book(gnc_get_current_book());
 }
 
 static void
 gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindowActionData *data)
 {
-  gnc_ui_find_transactions_dialog_create (NULL);
+    gnc_ui_find_transactions_dialog_create (NULL);
 }
 
 static void
 gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindowActionData *data)
 {
-  g_return_if_fail (data != NULL);
+    g_return_if_fail (data != NULL);
 
-  gnc_totd_dialog(GTK_WINDOW(data->window), FALSE);
+    gnc_totd_dialog(GTK_WINDOW(data->window), FALSE);
 }
 
 /** @} */

Modified: gnucash/trunk/src/gnome/gnc-plugin-basic-commands.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-basic-commands.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-basic-commands.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-basic-commands.h -- 
+/*
+ * gnc-plugin-basic-commands.h --
  *
  * Copyright (C) 2005 David Hampton <hampton at employees.org>
  *
@@ -52,16 +52,18 @@
 /* typedefs & structures */
 
 /** The instance data structure for an basic commands menu plugin. */
-typedef struct {
-  /** The parent object for this widget */
-  GncPlugin gnc_plugin;
+typedef struct
+{
+    /** The parent object for this widget */
+    GncPlugin gnc_plugin;
 } GncPluginBasicCommands;
 
 
 /** The class data structure for a basic commands menu plugin. */
-typedef struct {
-  /** The parent class for this widget. */
-  GncPluginClass gnc_plugin;
+typedef struct
+{
+    /** The parent class for this widget. */
+    GncPluginClass gnc_plugin;
 } GncPluginBasicCommandsClass;
 
 

Modified: gnucash/trunk/src/gnome/gnc-plugin-budget.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-budget.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-budget.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -47,22 +47,28 @@
 
 /* Command Callbacks */
 static void gnc_plugin_budget_cmd_new_budget (GtkAction *action,
-					      GncMainWindowActionData *data);
+        GncMainWindowActionData *data);
 static void gnc_plugin_budget_cmd_open_budget (GtkAction *action,
-					      GncMainWindowActionData *data);
+        GncMainWindowActionData *data);
 
-static GtkActionEntry gnc_plugin_actions [] = {
-    { "NewBudgetAction", NULL, N_("New Budget"), NULL,
-      N_("Create a new Budget"),
-      G_CALLBACK (gnc_plugin_budget_cmd_new_budget) },
+static GtkActionEntry gnc_plugin_actions [] =
+{
+    {
+        "NewBudgetAction", NULL, N_("New Budget"), NULL,
+        N_("Create a new Budget"),
+        G_CALLBACK (gnc_plugin_budget_cmd_new_budget)
+    },
 
-    { "OpenBudgetAction", NULL, N_("Open Budget"), NULL,
-      N_("Open an existing Budget"),
-      G_CALLBACK (gnc_plugin_budget_cmd_open_budget) },
+    {
+        "OpenBudgetAction", NULL, N_("Open Budget"), NULL,
+        N_("Open an existing Budget"),
+        G_CALLBACK (gnc_plugin_budget_cmd_open_budget)
+    },
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
 
-typedef struct GncPluginBudgetPrivate {
+typedef struct GncPluginBudgetPrivate
+{
     gpointer dummy;
 } GncPluginBudgetPrivate;
 
@@ -76,8 +82,10 @@
 {
     static GType gnc_plugin_budget_type = 0;
 
-    if (!gnc_plugin_budget_type) {
-        static const GTypeInfo our_info = {
+    if (!gnc_plugin_budget_type)
+    {
+        static const GTypeInfo our_info =
+        {
             sizeof (GncPluginBudgetClass),
             NULL,		/* base_init */
             NULL,		/* base_finalize */
@@ -90,7 +98,7 @@
         };
 
         gnc_plugin_budget_type = g_type_register_static(
-            GNC_TYPE_PLUGIN, "GncPluginBudget", &our_info, 0);
+                                     GNC_TYPE_PLUGIN, "GncPluginBudget", &our_info, 0);
     }
 
     return gnc_plugin_budget_type;
@@ -159,7 +167,7 @@
 /* Make a new budget; put it in a page; open the page. */
 static void
 gnc_plugin_budget_cmd_new_budget (GtkAction *action,
-				  GncMainWindowActionData *data)
+                                  GncMainWindowActionData *data)
 {
     GncBudget *budget;
     GncPluginPage *page;
@@ -185,16 +193,22 @@
     book = gnc_get_current_book();
     col = qof_book_get_collection(book, GNC_ID_BUDGET);
     count = qof_collection_count(col);
-    if (count > 0) {
-        if (count == 1) {
+    if (count > 0)
+    {
+        if (count == 1)
+        {
             bgt = gnc_budget_get_default(book);
-        } else {
+        }
+        else
+        {
             bgt = gnc_budget_gui_select_budget(book);
         }
 
         if (bgt) gnc_main_window_open_page(
-            data->window, gnc_plugin_page_budget_new(bgt));
-    } else { /* if no budgets exist yet, just open a new budget */
+                data->window, gnc_plugin_page_budget_new(bgt));
+    }
+    else     /* if no budgets exist yet, just open a new budget */
+    {
         gnc_plugin_budget_cmd_new_budget(action, data);
     }
 }
@@ -239,10 +253,12 @@
 
     bgt = NULL;
     response = gtk_dialog_run(dlg);
-    switch (response) {
+    switch (response)
+    {
     case GTK_RESPONSE_OK:
         ok = gtk_tree_selection_get_selected(sel, &tm, &iter);
-        if (ok) {
+        if (ok)
+        {
             bgt = gnc_tree_model_budget_get_budget(tm, &iter);
         }
         break;

Modified: gnucash/trunk/src/gnome/gnc-plugin-budget.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-budget.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-budget.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -45,12 +45,14 @@
 #define GNC_BUDGET_GUI_FILE    "budget.glade"
 
 /* typedefs & structures */
-typedef struct {
-  GncPlugin gnc_plugin;
+typedef struct
+{
+    GncPlugin gnc_plugin;
 } GncPluginBudget;
 
-typedef struct {
-  GncPluginClass gnc_plugin;
+typedef struct
+{
+    GncPluginClass gnc_plugin;
 } GncPluginBudgetClass;
 
 /* function prototypes */

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-page-account-tree.c -- 
+/*
+ * gnc-plugin-page-account-tree.c --
  *
  * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
  * Copyright (C) 2003,2005,2006 David Hampton <hampton at employees.org>
@@ -74,17 +74,18 @@
 #define DELETE_DIALOG_FILTER  "filter"
 #define DELETE_DIALOG_ACCOUNT "account"
 
-enum {
-  ACCOUNT_SELECTED,
-  LAST_SIGNAL
+enum
+{
+    ACCOUNT_SELECTED,
+    LAST_SIGNAL
 };
 
 typedef struct GncPluginPageAccountTreePrivate
 {
-	GtkWidget   *widget;
-	GtkTreeView *tree_view;
-	gint         component_id;
-	AccountFilterDialog fd;
+    GtkWidget   *widget;
+    GtkTreeView *tree_view;
+    gint         component_id;
+    AccountFilterDialog fd;
 } GncPluginPageAccountTreePrivate;
 
 #define GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(o)  \
@@ -107,17 +108,17 @@
 
 /* Callbacks */
 static void gnc_plugin_page_account_tree_summarybar_position_changed(GConfEntry *entry,
-								     gpointer user_data);
+        gpointer user_data);
 static gboolean gnc_plugin_page_account_tree_button_press_cb (GtkWidget *widget,
-							      GdkEventButton *event,
-			       				      GncPluginPage *page);
+        GdkEventButton *event,
+        GncPluginPage *page);
 static void gnc_plugin_page_account_tree_double_click_cb (GtkTreeView        *treeview,
-							  GtkTreePath        *path,
-							  GtkTreeViewColumn  *col,
-							  GncPluginPageAccountTree *page);
+        GtkTreePath        *path,
+        GtkTreeViewColumn  *col,
+        GncPluginPageAccountTree *page);
 
 static void gnc_plugin_page_account_tree_selection_changed_cb (GtkTreeSelection *selection,
-							       GncPluginPageAccountTree *page);
+        GncPluginPageAccountTree *page);
 void gppat_populate_tmas_list(GtkToggleButton *dmrb, gpointer tmas);
 void gppat_set_insensitive_iff_rb_active(GtkToggleButton *b, GtkWidget *widget);
 
@@ -143,65 +144,98 @@
 static guint plugin_page_signals[LAST_SIGNAL] = { 0 };
 
 
-static GtkActionEntry gnc_plugin_page_account_tree_actions [] = {
-	/* Toplevel */
-	{ "FakeToplevel", NULL, "", NULL, NULL, NULL },
+static GtkActionEntry gnc_plugin_page_account_tree_actions [] =
+{
+    /* Toplevel */
+    { "FakeToplevel", NULL, "", NULL, NULL, NULL },
 
-	/* File menu */
-	{ "FileNewAccountAction", GNC_STOCK_NEW_ACCOUNT, N_("New _Account..."), NULL,
-	  N_("Create a new Account"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_new_account) },
-	{ "FileAddAccountHierarchyDruidAction", GNC_STOCK_NEW_ACCOUNT, N_("New Account _Hierarchy..."), NULL,
-	  N_("Extend the current book by merging with new account type categories"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_file_new_hierarchy) },
-	{ "FileOpenAccountAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Account"), NULL,
-	  N_("Open the selected account"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_account) },
-	{ "FileOpenSubaccountsAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Subaccounts"), NULL,
-	  N_("Open the selected account and all its subaccounts"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_subaccounts) },
+    /* File menu */
+    {
+        "FileNewAccountAction", GNC_STOCK_NEW_ACCOUNT, N_("New _Account..."), NULL,
+        N_("Create a new Account"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_new_account)
+    },
+    {
+        "FileAddAccountHierarchyDruidAction", GNC_STOCK_NEW_ACCOUNT, N_("New Account _Hierarchy..."), NULL,
+        N_("Extend the current book by merging with new account type categories"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_file_new_hierarchy)
+    },
+    {
+        "FileOpenAccountAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Account"), NULL,
+        N_("Open the selected account"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_account)
+    },
+    {
+        "FileOpenSubaccountsAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Subaccounts"), NULL,
+        N_("Open the selected account and all its subaccounts"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_subaccounts)
+    },
 
-	/* Edit menu */
-	{ "EditEditAccountAction", GNC_STOCK_EDIT_ACCOUNT, N_("Edit _Account"), "<control>e",
-	  N_("Edit the selected account"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_edit_account) },
-	{ "EditDeleteAccountAction", GNC_STOCK_DELETE_ACCOUNT, N_("_Delete Account..."), "Delete",
-	  N_("Delete selected account"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_delete_account) },
-	{ "EditRenumberSubaccountsAction", NULL, N_("_Renumber Subaccounts..."), NULL,
-	  N_("Renumber the children of the selected account"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_renumber_accounts) },
+    /* Edit menu */
+    {
+        "EditEditAccountAction", GNC_STOCK_EDIT_ACCOUNT, N_("Edit _Account"), "<control>e",
+        N_("Edit the selected account"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_edit_account)
+    },
+    {
+        "EditDeleteAccountAction", GNC_STOCK_DELETE_ACCOUNT, N_("_Delete Account..."), "Delete",
+        N_("Delete selected account"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_delete_account)
+    },
+    {
+        "EditRenumberSubaccountsAction", NULL, N_("_Renumber Subaccounts..."), NULL,
+        N_("Renumber the children of the selected account"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_renumber_accounts)
+    },
 
-	/* View menu */
-	{ "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_view_filter_by) },
+    /* View menu */
+    {
+        "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_view_filter_by)
+    },
 
-	/* Actions menu */
-	{ "ActionsReconcileAction", NULL, N_("_Reconcile..."), NULL,
-	  N_("Reconcile the selected account"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_reconcile) },
-	{ "ActionsAutoClearAction", NULL, N_("_Auto-clear..."), NULL,
-	  N_("Automatically clear individual transactions, given a cleared amount"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_autoclear) },
-	{ "ActionsTransferAction", NULL, N_("_Transfer..."), "<control>t",
-	  N_("Transfer funds from one account to another"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_transfer) },
-	{ "ActionsStockSplitAction", NULL, N_("Stoc_k Split..."), NULL,
-	  N_("Record a stock split or a stock merger"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_stock_split) },
-	{ "ActionsLotsAction", NULL, N_("View _Lots..."), NULL,
-	  N_("Bring up the lot viewer/editor window"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_lots) },
-	{ "ScrubAction", NULL, N_("Check & Repair A_ccount"), NULL,
-	  N_("Check for and repair unbalanced transactions and orphan splits " "in this account"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_scrub) },
-	{ "ScrubSubAction", NULL, N_("Check & Repair Su_baccounts"), NULL,
-	  N_("Check for and repair unbalanced transactions and orphan splits "
-             "in this account and its subaccounts"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_scrub_sub) },
-	{ "ScrubAllAction", NULL, N_("Check & Repair A_ll"), NULL,
-	  N_("Check for and repair unbalanced transactions and orphan splits " "in all accounts"),
-	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_scrub_all) },
+    /* Actions menu */
+    {
+        "ActionsReconcileAction", NULL, N_("_Reconcile..."), NULL,
+        N_("Reconcile the selected account"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_reconcile)
+    },
+    {
+        "ActionsAutoClearAction", NULL, N_("_Auto-clear..."), NULL,
+        N_("Automatically clear individual transactions, given a cleared amount"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_autoclear)
+    },
+    {
+        "ActionsTransferAction", NULL, N_("_Transfer..."), "<control>t",
+        N_("Transfer funds from one account to another"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_transfer)
+    },
+    {
+        "ActionsStockSplitAction", NULL, N_("Stoc_k Split..."), NULL,
+        N_("Record a stock split or a stock merger"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_stock_split)
+    },
+    {
+        "ActionsLotsAction", NULL, N_("View _Lots..."), NULL,
+        N_("Bring up the lot viewer/editor window"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_lots)
+    },
+    {
+        "ScrubAction", NULL, N_("Check & Repair A_ccount"), NULL,
+        N_("Check for and repair unbalanced transactions and orphan splits " "in this account"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_scrub)
+    },
+    {
+        "ScrubSubAction", NULL, N_("Check & Repair Su_baccounts"), NULL,
+        N_("Check for and repair unbalanced transactions and orphan splits "
+        "in this account and its subaccounts"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_scrub_sub)
+    },
+    {
+        "ScrubAllAction", NULL, N_("Check & Repair A_ll"), NULL,
+        N_("Check for and repair unbalanced transactions and orphan splits " "in all accounts"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_scrub_all)
+    },
 };
 /** The number of actions provided by this plugin. */
 static guint gnc_plugin_page_account_tree_n_actions = G_N_ELEMENTS (gnc_plugin_page_account_tree_actions);
@@ -209,178 +243,184 @@
 
 /** Actions that require an account to be selected before they are
  *  enabled. */
-static const gchar *actions_requiring_account[] = {
-	"FileOpenAccountAction",
-	"FileOpenSubaccountsAction",
-	"EditEditAccountAction",
-	"EditDeleteAccountAction",
-	"ActionsReconcileAction",
-	"ActionsAutoClearAction",
-	"ActionsLotsAction",
-	NULL
+static const gchar *actions_requiring_account[] =
+{
+    "FileOpenAccountAction",
+    "FileOpenSubaccountsAction",
+    "EditEditAccountAction",
+    "EditDeleteAccountAction",
+    "ActionsReconcileAction",
+    "ActionsAutoClearAction",
+    "ActionsLotsAction",
+    NULL
 };
 
 
 /** Short labels for use on the toolbar buttons. */
-static action_toolbar_labels toolbar_labels[] = {
-  { "FileOpenAccountAction", 	    N_("Open") },
-  { "EditEditAccountAction", 	    N_("Edit") },
-  { "FileNewAccountAction",    	    N_("New") },
-  { "EditDeleteAccountAction", 	    N_("Delete") },
-  { NULL, NULL },
+static action_toolbar_labels toolbar_labels[] =
+{
+    { "FileOpenAccountAction", 	    N_("Open") },
+    { "EditEditAccountAction", 	    N_("Edit") },
+    { "FileNewAccountAction",    	    N_("New") },
+    { "EditDeleteAccountAction", 	    N_("Delete") },
+    { NULL, NULL },
 };
 
 
 GType
 gnc_plugin_page_account_tree_get_type (void)
 {
-	static GType gnc_plugin_page_account_tree_type = 0;
+    static GType gnc_plugin_page_account_tree_type = 0;
 
-	if (gnc_plugin_page_account_tree_type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (GncPluginPageAccountTreeClass),
-			NULL,
-			NULL,
-			(GClassInitFunc) gnc_plugin_page_account_tree_class_init,
-			NULL,
-			NULL,
-			sizeof (GncPluginPageAccountTree),
-			0,
-			(GInstanceInitFunc) gnc_plugin_page_account_tree_init
-		};
-		
-		gnc_plugin_page_account_tree_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
-								            GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME,
-								            &our_info, 0);
-	}
+    if (gnc_plugin_page_account_tree_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginPageAccountTreeClass),
+            NULL,
+            NULL,
+            (GClassInitFunc) gnc_plugin_page_account_tree_class_init,
+            NULL,
+            NULL,
+            sizeof (GncPluginPageAccountTree),
+            0,
+            (GInstanceInitFunc) gnc_plugin_page_account_tree_init
+        };
 
-	return gnc_plugin_page_account_tree_type;
+        gnc_plugin_page_account_tree_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
+                                            GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME,
+                                            &our_info, 0);
+    }
+
+    return gnc_plugin_page_account_tree_type;
 }
 
 GncPluginPage *
 gnc_plugin_page_account_tree_new (void)
 {
-	GncPluginPageAccountTree *plugin_page;
+    GncPluginPageAccountTree *plugin_page;
 
-	ENTER(" ");
-	plugin_page = g_object_new (GNC_TYPE_PLUGIN_PAGE_ACCOUNT_TREE,
-			      NULL);
+    ENTER(" ");
+    plugin_page = g_object_new (GNC_TYPE_PLUGIN_PAGE_ACCOUNT_TREE,
+                                NULL);
 
-	LEAVE("new account tree page %p", plugin_page);
-	return GNC_PLUGIN_PAGE (plugin_page);
+    LEAVE("new account tree page %p", plugin_page);
+    return GNC_PLUGIN_PAGE (plugin_page);
 }
 
 static void
 gnc_plugin_page_account_tree_class_init (GncPluginPageAccountTreeClass *klass)
 {
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-	GncPluginPageClass *gnc_plugin_class = GNC_PLUGIN_PAGE_CLASS(klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GncPluginPageClass *gnc_plugin_class = GNC_PLUGIN_PAGE_CLASS(klass);
 
-	parent_class = g_type_class_peek_parent (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-	object_class->finalize = gnc_plugin_page_account_tree_finalize;
+    object_class->finalize = gnc_plugin_page_account_tree_finalize;
 
-	gnc_plugin_class->tab_icon        = GNC_STOCK_ACCOUNT;
-	gnc_plugin_class->plugin_name     = GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME;
-	gnc_plugin_class->create_widget   = gnc_plugin_page_account_tree_create_widget;
-	gnc_plugin_class->destroy_widget  = gnc_plugin_page_account_tree_destroy_widget;
-	gnc_plugin_class->save_page       = gnc_plugin_page_account_tree_save_page;
-	gnc_plugin_class->recreate_page   = gnc_plugin_page_account_tree_recreate_page;
+    gnc_plugin_class->tab_icon        = GNC_STOCK_ACCOUNT;
+    gnc_plugin_class->plugin_name     = GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME;
+    gnc_plugin_class->create_widget   = gnc_plugin_page_account_tree_create_widget;
+    gnc_plugin_class->destroy_widget  = gnc_plugin_page_account_tree_destroy_widget;
+    gnc_plugin_class->save_page       = gnc_plugin_page_account_tree_save_page;
+    gnc_plugin_class->recreate_page   = gnc_plugin_page_account_tree_recreate_page;
 
-	g_type_class_add_private(klass, sizeof(GncPluginPageAccountTreePrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginPageAccountTreePrivate));
 
-	plugin_page_signals[ACCOUNT_SELECTED] =
-	  g_signal_new ("account_selected",
-			G_OBJECT_CLASS_TYPE (object_class),
-			G_SIGNAL_RUN_FIRST,
-			G_STRUCT_OFFSET (GncPluginPageAccountTreeClass, account_selected),
-			NULL, NULL,
-			g_cclosure_marshal_VOID__POINTER,
-			G_TYPE_NONE, 1,
-			G_TYPE_POINTER);
+    plugin_page_signals[ACCOUNT_SELECTED] =
+        g_signal_new ("account_selected",
+                      G_OBJECT_CLASS_TYPE (object_class),
+                      G_SIGNAL_RUN_FIRST,
+                      G_STRUCT_OFFSET (GncPluginPageAccountTreeClass, account_selected),
+                      NULL, NULL,
+                      g_cclosure_marshal_VOID__POINTER,
+                      G_TYPE_NONE, 1,
+                      G_TYPE_POINTER);
 }
 
 static void
 gnc_plugin_page_account_tree_init (GncPluginPageAccountTree *plugin_page)
 {
-	GtkActionGroup *action_group;
-	GncPluginPageAccountTreePrivate *priv;
-	GncPluginPage *parent;
-	const GList *page_list;
+    GtkActionGroup *action_group;
+    GncPluginPageAccountTreePrivate *priv;
+    GncPluginPage *parent;
+    const GList *page_list;
 
-	ENTER("page %p", plugin_page);
-	priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(plugin_page);
+    ENTER("page %p", plugin_page);
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(plugin_page);
 
-	/* Init parent declared variables */
-	parent = GNC_PLUGIN_PAGE(plugin_page);
-	g_object_set(G_OBJECT(plugin_page),
-		     "page-name",      _("Accounts"),
-		     "page-uri",       "default:",
-		     "ui-description", "gnc-plugin-page-account-tree-ui.xml",
-		     NULL);
+    /* Init parent declared variables */
+    parent = GNC_PLUGIN_PAGE(plugin_page);
+    g_object_set(G_OBJECT(plugin_page),
+                 "page-name",      _("Accounts"),
+                 "page-uri",       "default:",
+                 "ui-description", "gnc-plugin-page-account-tree-ui.xml",
+                 NULL);
 
-	/* 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());
 
-	/* Is this the first accounts page? */
-	page_list =
-	  gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME);
-	if (plugin_page == page_list->data) {
-	  g_object_set_data(G_OBJECT(plugin_page), PLUGIN_PAGE_IMMUTABLE,
-			    GINT_TO_POINTER(1));
-	}
+    /* Is this the first accounts page? */
+    page_list =
+        gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME);
+    if (plugin_page == page_list->data)
+    {
+        g_object_set_data(G_OBJECT(plugin_page), PLUGIN_PAGE_IMMUTABLE,
+                          GINT_TO_POINTER(1));
+    }
 
-	/* Create menu and toolbar information */
-	action_group =
-	  gnc_plugin_page_create_action_group(parent,
-					      "GncPluginPageAccountTreeActions");
-	gtk_action_group_add_actions(action_group,
-				     gnc_plugin_page_account_tree_actions,
-				     gnc_plugin_page_account_tree_n_actions,
-				     plugin_page);
-	gnc_plugin_init_short_names (action_group, toolbar_labels);
+    /* Create menu and toolbar information */
+    action_group =
+        gnc_plugin_page_create_action_group(parent,
+                                            "GncPluginPageAccountTreeActions");
+    gtk_action_group_add_actions(action_group,
+                                 gnc_plugin_page_account_tree_actions,
+                                 gnc_plugin_page_account_tree_n_actions,
+                                 plugin_page);
+    gnc_plugin_init_short_names (action_group, toolbar_labels);
 
-	/* Visisble types */
-	priv->fd.visible_types = -1; /* Start with all types */
-	priv->fd.show_hidden = FALSE;
-	priv->fd.show_zero_total = TRUE;
-	
-	LEAVE("page %p, priv %p, action group %p",
-	      plugin_page, priv, action_group);
+    /* Visisble types */
+    priv->fd.visible_types = -1; /* Start with all types */
+    priv->fd.show_hidden = FALSE;
+    priv->fd.show_zero_total = TRUE;
+
+    LEAVE("page %p, priv %p, action group %p",
+          plugin_page, priv, action_group);
 }
 
 static void
 gnc_plugin_page_account_tree_finalize (GObject *object)
 {
-	GncPluginPageAccountTree *page;
-	GncPluginPageAccountTreePrivate *priv;
+    GncPluginPageAccountTree *page;
+    GncPluginPageAccountTreePrivate *priv;
 
-	ENTER("object %p", object);
-	page = GNC_PLUGIN_PAGE_ACCOUNT_TREE (object);
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
-	priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
-	g_return_if_fail (priv != NULL);
+    ENTER("object %p", object);
+    page = GNC_PLUGIN_PAGE_ACCOUNT_TREE (object);
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
+    g_return_if_fail (priv != NULL);
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
-	LEAVE(" ");
+    G_OBJECT_CLASS (parent_class)->finalize (object);
+    LEAVE(" ");
 }
 
 Account *
 gnc_plugin_page_account_tree_get_current_account (GncPluginPageAccountTree *page)
 {
-	GncPluginPageAccountTreePrivate *priv;
-	Account *account;
+    GncPluginPageAccountTreePrivate *priv;
+    Account *account;
 
-	priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
-	ENTER("page %p (tree view %p)", page, priv->tree_view);
-	account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(priv->tree_view));
-	if (account == NULL) {
-		LEAVE("no account");
-		return NULL;
-	}
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
+    ENTER("page %p (tree view %p)", page, priv->tree_view);
+    account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(priv->tree_view));
+    if (account == NULL)
+    {
+        LEAVE("no account");
+        return NULL;
+    }
 
-	LEAVE("account %p", account);
-	return account;
+    LEAVE("account %p", account);
+    return account;
 }
 
 
@@ -389,145 +429,148 @@
 static void
 gnc_plugin_page_account_refresh_cb (GHashTable *changes, gpointer user_data)
 {
-  GncPluginPageAccountTree *page = user_data;
-  GncPluginPageAccountTreePrivate *priv;
+    GncPluginPageAccountTree *page = user_data;
+    GncPluginPageAccountTreePrivate *priv;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
 
-  /* We're only looking for forced updates here. */
-  if (changes)
-    return;
+    /* We're only looking for forced updates here. */
+    if (changes)
+        return;
 
-  priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
-  gtk_widget_queue_draw(priv->widget);
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
+    gtk_widget_queue_draw(priv->widget);
 }
 
 static void
 gnc_plugin_page_account_tree_close_cb (gpointer user_data)
 {
-  GncPluginPage *plugin_page;
-  GncPluginPageAccountTree *page;
+    GncPluginPage *plugin_page;
+    GncPluginPageAccountTree *page;
 
-  plugin_page = GNC_PLUGIN_PAGE(user_data);
-  page = GNC_PLUGIN_PAGE_ACCOUNT_TREE (plugin_page);
-  gnc_main_window_close_page(plugin_page);
+    plugin_page = GNC_PLUGIN_PAGE(user_data);
+    page = GNC_PLUGIN_PAGE_ACCOUNT_TREE (plugin_page);
+    gnc_main_window_close_page(plugin_page);
 }
 
 static GtkWidget *
 gnc_plugin_page_account_tree_create_widget (GncPluginPage *plugin_page)
 {
-	GncPluginPageAccountTree *page;
-	GncPluginPageAccountTreePrivate *priv;
-	GtkTreeSelection *selection;
-	GtkTreeView *tree_view;
-	GtkWidget *scrolled_window;
-	GtkTreeViewColumn *col;
+    GncPluginPageAccountTree *page;
+    GncPluginPageAccountTreePrivate *priv;
+    GtkTreeSelection *selection;
+    GtkTreeView *tree_view;
+    GtkWidget *scrolled_window;
+    GtkTreeViewColumn *col;
 
-	ENTER("page %p", plugin_page);
-	page = GNC_PLUGIN_PAGE_ACCOUNT_TREE (plugin_page);
-	priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
-	if (priv->widget != NULL) {
-		LEAVE("widget = %p", priv->widget);
-		return priv->widget;
-	}
+    ENTER("page %p", plugin_page);
+    page = GNC_PLUGIN_PAGE_ACCOUNT_TREE (plugin_page);
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
+    if (priv->widget != NULL)
+    {
+        LEAVE("widget = %p", priv->widget);
+        return priv->widget;
+    }
 
-	priv->widget = gtk_vbox_new (FALSE, 0);
-	gtk_widget_show (priv->widget);
+    priv->widget = gtk_vbox_new (FALSE, 0);
+    gtk_widget_show (priv->widget);
 
-	scrolled_window = gtk_scrolled_window_new (NULL, NULL);
-	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
-					GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-	gtk_widget_show (scrolled_window);
-	gtk_box_pack_start (GTK_BOX (priv->widget), scrolled_window,
-			    TRUE, TRUE, 0);
+    scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    gtk_widget_show (scrolled_window);
+    gtk_box_pack_start (GTK_BOX (priv->widget), scrolled_window,
+                        TRUE, TRUE, 0);
 
-	tree_view = gnc_tree_view_account_new(FALSE);
-	col = gnc_tree_view_find_column_by_name(
-	    GNC_TREE_VIEW(tree_view), "description");
-	g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
-	col = gnc_tree_view_find_column_by_name(
-	    GNC_TREE_VIEW(tree_view), "total");
-	g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
-	gnc_tree_view_configure_columns(GNC_TREE_VIEW(tree_view));
-	g_object_set(G_OBJECT(tree_view),
-		     "gconf-section", GCONF_SECTION,
-		     "show-column-menu", TRUE,
-		     NULL);
+    tree_view = gnc_tree_view_account_new(FALSE);
+    col = gnc_tree_view_find_column_by_name(
+              GNC_TREE_VIEW(tree_view), "description");
+    g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
+    col = gnc_tree_view_find_column_by_name(
+              GNC_TREE_VIEW(tree_view), "total");
+    g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
+    gnc_tree_view_configure_columns(GNC_TREE_VIEW(tree_view));
+    g_object_set(G_OBJECT(tree_view),
+                 "gconf-section", GCONF_SECTION,
+                 "show-column-menu", TRUE,
+                 NULL);
 
-        /* No name handler; then the user can't click on the name of the
-           account to open its register. */
-        gnc_tree_view_account_set_code_edited(GNC_TREE_VIEW_ACCOUNT(tree_view),
-                                              gnc_tree_view_account_code_edited_cb);
-        gnc_tree_view_account_set_description_edited(GNC_TREE_VIEW_ACCOUNT(tree_view),
-                                                     gnc_tree_view_account_description_edited_cb);
-        gnc_tree_view_account_set_notes_edited(GNC_TREE_VIEW_ACCOUNT(tree_view),
-                                               gnc_tree_view_account_notes_edited_cb);
+    /* No name handler; then the user can't click on the name of the
+       account to open its register. */
+    gnc_tree_view_account_set_code_edited(GNC_TREE_VIEW_ACCOUNT(tree_view),
+                                          gnc_tree_view_account_code_edited_cb);
+    gnc_tree_view_account_set_description_edited(GNC_TREE_VIEW_ACCOUNT(tree_view),
+            gnc_tree_view_account_description_edited_cb);
+    gnc_tree_view_account_set_notes_edited(GNC_TREE_VIEW_ACCOUNT(tree_view),
+                                           gnc_tree_view_account_notes_edited_cb);
 
-	priv->tree_view = tree_view;
-	selection = gtk_tree_view_get_selection(tree_view);
-	g_signal_connect (G_OBJECT (selection), "changed",
-			  G_CALLBACK (gnc_plugin_page_account_tree_selection_changed_cb), page);
-	g_signal_connect (G_OBJECT (tree_view), "button-press-event",
-			  G_CALLBACK (gnc_plugin_page_account_tree_button_press_cb), page);
-	g_signal_connect (G_OBJECT (tree_view), "row-activated",
-			  G_CALLBACK (gnc_plugin_page_account_tree_double_click_cb), page);
+    priv->tree_view = tree_view;
+    selection = gtk_tree_view_get_selection(tree_view);
+    g_signal_connect (G_OBJECT (selection), "changed",
+                      G_CALLBACK (gnc_plugin_page_account_tree_selection_changed_cb), page);
+    g_signal_connect (G_OBJECT (tree_view), "button-press-event",
+                      G_CALLBACK (gnc_plugin_page_account_tree_button_press_cb), page);
+    g_signal_connect (G_OBJECT (tree_view), "row-activated",
+                      G_CALLBACK (gnc_plugin_page_account_tree_double_click_cb), page);
 
-	gtk_tree_view_set_headers_visible(tree_view, TRUE);
-	gnc_plugin_page_account_tree_selection_changed_cb (NULL, page);
-	gtk_widget_show (GTK_WIDGET (tree_view));
-	gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET(tree_view));
+    gtk_tree_view_set_headers_visible(tree_view, TRUE);
+    gnc_plugin_page_account_tree_selection_changed_cb (NULL, page);
+    gtk_widget_show (GTK_WIDGET (tree_view));
+    gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET(tree_view));
 
-	priv->fd.tree_view = GNC_TREE_VIEW_ACCOUNT(priv->tree_view);
-	gnc_tree_view_account_set_filter (
-            GNC_TREE_VIEW_ACCOUNT(tree_view),
-            gnc_plugin_page_account_tree_filter_accounts, &priv->fd, NULL);
+    priv->fd.tree_view = GNC_TREE_VIEW_ACCOUNT(priv->tree_view);
+    gnc_tree_view_account_set_filter (
+        GNC_TREE_VIEW_ACCOUNT(tree_view),
+        gnc_plugin_page_account_tree_filter_accounts, &priv->fd, NULL);
 
-	priv->component_id =
-	  gnc_register_gui_component(PLUGIN_PAGE_ACCT_TREE_CM_CLASS,
-				     gnc_plugin_page_account_refresh_cb,
-				     gnc_plugin_page_account_tree_close_cb,
-				     page);
-	gnc_gui_component_set_session (priv->component_id,
-				       gnc_get_current_session());
+    priv->component_id =
+        gnc_register_gui_component(PLUGIN_PAGE_ACCT_TREE_CM_CLASS,
+                                   gnc_plugin_page_account_refresh_cb,
+                                   gnc_plugin_page_account_tree_close_cb,
+                                   page);
+    gnc_gui_component_set_session (priv->component_id,
+                                   gnc_get_current_session());
 
-	plugin_page->summarybar = gnc_main_window_summary_new();
-	gtk_box_pack_start (GTK_BOX (priv->widget), plugin_page->summarybar,
-			    FALSE, FALSE, 0);
-	gtk_widget_show(plugin_page->summarybar);
-	gnc_plugin_page_account_tree_summarybar_position_changed(NULL, page);
-	gnc_gconf_general_register_cb(KEY_SUMMARYBAR_POSITION,
-		gnc_plugin_page_account_tree_summarybar_position_changed,
-		page);
+    plugin_page->summarybar = gnc_main_window_summary_new();
+    gtk_box_pack_start (GTK_BOX (priv->widget), plugin_page->summarybar,
+                        FALSE, FALSE, 0);
+    gtk_widget_show(plugin_page->summarybar);
+    gnc_plugin_page_account_tree_summarybar_position_changed(NULL, page);
+    gnc_gconf_general_register_cb(KEY_SUMMARYBAR_POSITION,
+                                  gnc_plugin_page_account_tree_summarybar_position_changed,
+                                  page);
 
-	LEAVE("widget = %p", priv->widget);
-	return priv->widget;
+    LEAVE("widget = %p", priv->widget);
+    return priv->widget;
 }
 
 static void
 gnc_plugin_page_account_tree_destroy_widget (GncPluginPage *plugin_page)
 {
-	GncPluginPageAccountTree *page;
-	GncPluginPageAccountTreePrivate *priv;
+    GncPluginPageAccountTree *page;
+    GncPluginPageAccountTreePrivate *priv;
 
-	ENTER("page %p", plugin_page);
-	page = GNC_PLUGIN_PAGE_ACCOUNT_TREE (plugin_page);
-	priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
+    ENTER("page %p", plugin_page);
+    page = GNC_PLUGIN_PAGE_ACCOUNT_TREE (plugin_page);
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
 
-	gnc_gconf_general_remove_cb(KEY_SUMMARYBAR_POSITION,
-		gnc_plugin_page_account_tree_summarybar_position_changed,
-		page);
+    gnc_gconf_general_remove_cb(KEY_SUMMARYBAR_POSITION,
+                                gnc_plugin_page_account_tree_summarybar_position_changed,
+                                page);
 
-	if (priv->widget) {
-	  g_object_unref(G_OBJECT(priv->widget));
-	  priv->widget = NULL;
-	}
+    if (priv->widget)
+    {
+        g_object_unref(G_OBJECT(priv->widget));
+        priv->widget = NULL;
+    }
 
-	if (priv->component_id) {
-	  gnc_unregister_gui_component(priv->component_id);
-	  priv->component_id = 0;
-	}
+    if (priv->component_id)
+    {
+        gnc_unregister_gui_component(priv->component_id);
+        priv->component_id = 0;
+    }
 
-	LEAVE("widget destroyed");
+    LEAVE("widget destroyed");
 }
 
 /** Save enough information about this account tree page that it can
@@ -541,25 +584,25 @@
  *  @param group_name The group name to use when saving data. */
 static void
 gnc_plugin_page_account_tree_save_page (GncPluginPage *plugin_page,
-					GKeyFile *key_file,
-					const gchar *group_name)
+                                        GKeyFile *key_file,
+                                        const gchar *group_name)
 {
-	GncPluginPageAccountTree *account_page;
-	GncPluginPageAccountTreePrivate *priv;
-	
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(plugin_page));
-	g_return_if_fail (key_file != NULL);
-	g_return_if_fail (group_name != NULL);
+    GncPluginPageAccountTree *account_page;
+    GncPluginPageAccountTreePrivate *priv;
 
-	ENTER("page %p, key_file %p, group_name %s", plugin_page, key_file,
-	      group_name);
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(plugin_page));
+    g_return_if_fail (key_file != NULL);
+    g_return_if_fail (group_name != NULL);
 
-	account_page = GNC_PLUGIN_PAGE_ACCOUNT_TREE(plugin_page);
-	priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(account_page);
+    ENTER("page %p, key_file %p, group_name %s", plugin_page, key_file,
+          group_name);
 
-        gnc_tree_view_account_save(GNC_TREE_VIEW_ACCOUNT(priv->tree_view), 
-                                   &priv->fd, key_file, group_name);
-	LEAVE(" ");
+    account_page = GNC_PLUGIN_PAGE_ACCOUNT_TREE(plugin_page);
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(account_page);
+
+    gnc_tree_view_account_save(GNC_TREE_VIEW_ACCOUNT(priv->tree_view),
+                               &priv->fd, key_file, group_name);
+    LEAVE(" ");
 }
 
 
@@ -575,29 +618,29 @@
  *  @param group_name The group name to use when restoring data. */
 static GncPluginPage *
 gnc_plugin_page_account_tree_recreate_page (GtkWidget *window,
-					    GKeyFile *key_file,
-					    const gchar *group_name)
+        GKeyFile *key_file,
+        const gchar *group_name)
 {
-	GncPluginPageAccountTree *account_page;
-	GncPluginPageAccountTreePrivate *priv;
-	GncPluginPage *page;
-	
-	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);
+    GncPluginPageAccountTree *account_page;
+    GncPluginPageAccountTreePrivate *priv;
+    GncPluginPage *page;
 
-	/* Create the new page. */
-	page = gnc_plugin_page_account_tree_new();
-	account_page = GNC_PLUGIN_PAGE_ACCOUNT_TREE(page);
-	priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(account_page);
+    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);
 
-	/* Install it now so we can then manipulate the created widget */
-	gnc_main_window_open_page(GNC_MAIN_WINDOW(window), page);
+    /* Create the new page. */
+    page = gnc_plugin_page_account_tree_new();
+    account_page = GNC_PLUGIN_PAGE_ACCOUNT_TREE(page);
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(account_page);
 
-        gnc_tree_view_account_restore(GNC_TREE_VIEW_ACCOUNT(priv->tree_view), 
-                                      &priv->fd, key_file, group_name);
-	LEAVE(" ");
-	return page;
+    /* Install it now so we can then manipulate the created widget */
+    gnc_main_window_open_page(GNC_MAIN_WINDOW(window), page);
+
+    gnc_tree_view_account_restore(GNC_TREE_VIEW_ACCOUNT(priv->tree_view),
+                                  &priv->fd, key_file, group_name);
+    LEAVE(" ");
+    return page;
 }
 
 
@@ -605,31 +648,32 @@
 
 static void
 gnc_plugin_page_account_tree_summarybar_position_changed(GConfEntry *entry,
-							 gpointer user_data)
+        gpointer user_data)
 {
-	GncPluginPage *plugin_page;
-	GncPluginPageAccountTree *page;
-	GncPluginPageAccountTreePrivate *priv;
-	GtkPositionType position = GTK_POS_BOTTOM;
-	gchar *conf_string;
-	
-	g_return_if_fail(user_data != NULL);
-	
-	plugin_page = GNC_PLUGIN_PAGE(user_data);
-	page = GNC_PLUGIN_PAGE_ACCOUNT_TREE (user_data);
-	priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
-	
-	conf_string = gnc_gconf_get_string (GCONF_GENERAL,
-					    KEY_SUMMARYBAR_POSITION, NULL);
-	if (conf_string) {
-		position = gnc_enum_from_nick (GTK_TYPE_POSITION_TYPE,
-					       conf_string, GTK_POS_BOTTOM);
-		g_free (conf_string);
-	}
+    GncPluginPage *plugin_page;
+    GncPluginPageAccountTree *page;
+    GncPluginPageAccountTreePrivate *priv;
+    GtkPositionType position = GTK_POS_BOTTOM;
+    gchar *conf_string;
 
-	gtk_box_reorder_child(GTK_BOX(priv->widget),
-			      plugin_page->summarybar,
-			      (position == GTK_POS_TOP ? 0 : -1) );
+    g_return_if_fail(user_data != NULL);
+
+    plugin_page = GNC_PLUGIN_PAGE(user_data);
+    page = GNC_PLUGIN_PAGE_ACCOUNT_TREE (user_data);
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
+
+    conf_string = gnc_gconf_get_string (GCONF_GENERAL,
+                                        KEY_SUMMARYBAR_POSITION, NULL);
+    if (conf_string)
+    {
+        position = gnc_enum_from_nick (GTK_TYPE_POSITION_TYPE,
+                                       conf_string, GTK_POS_BOTTOM);
+        g_free (conf_string);
+    }
+
+    gtk_box_reorder_child(GTK_BOX(priv->widget),
+                          plugin_page->summarybar,
+                          (position == GTK_POS_TOP ? 0 : -1) );
 }
 
 /** This button press handler calls the common button press handler
@@ -641,144 +685,147 @@
  *  registered in gnc-main-window.c. */
 static gboolean
 gnc_plugin_page_account_tree_button_press_cb (GtkWidget *widget,
-					      GdkEventButton *event,
-	       				      GncPluginPage *page)
+        GdkEventButton *event,
+        GncPluginPage *page)
 {
-  gboolean result;
+    gboolean result;
 
-  g_return_val_if_fail(GNC_IS_PLUGIN_PAGE(page), FALSE);
+    g_return_val_if_fail(GNC_IS_PLUGIN_PAGE(page), FALSE);
 
-  ENTER("widget %p, event %p, page %p", widget, event, page);
-  result = gnc_main_window_button_press_cb(widget, event, page);
-  LEAVE(" ");
+    ENTER("widget %p, event %p, page %p", widget, event, page);
+    result = gnc_main_window_button_press_cb(widget, event, page);
+    LEAVE(" ");
 
-  /* Always return FALSE.  This will let the tree view callback run as
-   * well which will select the item under the cursor.  By the time
-   * the user sees the menu both callbacks will have run and the menu
-   * actions will operate on the just-selected account. */
-  return FALSE;
+    /* Always return FALSE.  This will let the tree view callback run as
+     * well which will select the item under the cursor.  By the time
+     * the user sees the menu both callbacks will have run and the menu
+     * actions will operate on the just-selected account. */
+    return FALSE;
 }
 
 static void
 gppat_open_account_common (GncPluginPageAccountTree *page,
-			   Account *account,
-			   gboolean include_subs)
+                           Account *account,
+                           gboolean include_subs)
 {
-	GncPluginPageAccountTreePrivate *priv;
-	GtkWidget *window;
-	GncPluginPage *new_page;
+    GncPluginPageAccountTreePrivate *priv;
+    GtkWidget *window;
+    GncPluginPage *new_page;
 
-	if (account == NULL)
-	  return;
+    if (account == NULL)
+        return;
 
-	priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
-	window = GNC_PLUGIN_PAGE (page)->window;
-	new_page = gnc_plugin_page_register_new (account, include_subs);
-	gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
+    window = GNC_PLUGIN_PAGE (page)->window;
+    new_page = gnc_plugin_page_register_new (account, include_subs);
+    gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
 }
 
 static void
 gnc_plugin_page_account_tree_double_click_cb (GtkTreeView        *treeview,
-					      GtkTreePath        *path,
-					      GtkTreeViewColumn  *col,
-					      GncPluginPageAccountTree *page)
+        GtkTreePath        *path,
+        GtkTreeViewColumn  *col,
+        GncPluginPageAccountTree *page)
 {
-	Account *account;
+    Account *account;
 
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
-	account = gnc_tree_view_account_get_account_from_path (GNC_TREE_VIEW_ACCOUNT(treeview), path);
-	gppat_open_account_common (page, account, FALSE);
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
+    account = gnc_tree_view_account_get_account_from_path (GNC_TREE_VIEW_ACCOUNT(treeview), path);
+    gppat_open_account_common (page, account, FALSE);
 }
 
 static void
 gnc_plugin_page_account_tree_selection_changed_cb (GtkTreeSelection *selection,
-						   GncPluginPageAccountTree *page)
+        GncPluginPageAccountTree *page)
 {
-	GtkActionGroup *action_group;
-	GtkAction *action;
-	GtkTreeView *view;
-	Account *account = NULL;
-	gboolean sensitive;
-	gboolean subaccounts;
+    GtkActionGroup *action_group;
+    GtkAction *action;
+    GtkTreeView *view;
+    Account *account = NULL;
+    gboolean sensitive;
+    gboolean subaccounts;
 
-	g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
 
-	if (!selection) {
-		sensitive = FALSE;
-		subaccounts = FALSE;
-	} else {
-		g_return_if_fail(GTK_IS_TREE_SELECTION(selection));
-		view = gtk_tree_selection_get_tree_view (selection);
-		account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(view));
-		sensitive = (account != NULL);
+    if (!selection)
+    {
+        sensitive = FALSE;
+        subaccounts = FALSE;
+    }
+    else
+    {
+        g_return_if_fail(GTK_IS_TREE_SELECTION(selection));
+        view = gtk_tree_selection_get_tree_view (selection);
+        account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(view));
+        sensitive = (account != NULL);
 
-		subaccounts = account && (gnc_account_n_children(account) != 0);
-		/* Check here for placeholder accounts, etc. */
-	}
+        subaccounts = account && (gnc_account_n_children(account) != 0);
+        /* Check here for placeholder accounts, etc. */
+    }
 
-	action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(page));
-	gnc_plugin_update_actions (action_group, actions_requiring_account,
-				   "sensitive", sensitive);
-	g_signal_emit (page, plugin_page_signals[ACCOUNT_SELECTED], 0, account);
+    action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(page));
+    gnc_plugin_update_actions (action_group, actions_requiring_account,
+                               "sensitive", sensitive);
+    g_signal_emit (page, plugin_page_signals[ACCOUNT_SELECTED], 0, account);
 
-	action = gtk_action_group_get_action (action_group, "EditRenumberSubaccountsAction");
-	g_object_set (G_OBJECT(action), "sensitive",
-		      sensitive && subaccounts, NULL);
+    action = gtk_action_group_get_action (action_group, "EditRenumberSubaccountsAction");
+    g_object_set (G_OBJECT(action), "sensitive",
+                  sensitive && subaccounts, NULL);
 
-	gnc_plugin_update_actions (action_group, actions_requiring_account,
-				   "sensitive", sensitive);
+    gnc_plugin_update_actions (action_group, actions_requiring_account,
+                               "sensitive", sensitive);
 }
-	
 
+
 /* Command callbacks */
 static void
 gnc_plugin_page_account_tree_cmd_new_account (GtkAction *action, GncPluginPageAccountTree *page)
 {
-	Account *account = gnc_plugin_page_account_tree_get_current_account (page);
+    Account *account = gnc_plugin_page_account_tree_get_current_account (page);
 
-	gnc_ui_new_account_window (gnc_get_current_book(), account);
+    gnc_ui_new_account_window (gnc_get_current_book(), account);
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_file_new_hierarchy (GtkAction *action, GncPluginPageAccountTree *page)
 {
-        gnc_ui_hierarchy_druid(FALSE);
+    gnc_ui_hierarchy_druid(FALSE);
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_open_account (GtkAction *action,
-					       GncPluginPageAccountTree *page)
+        GncPluginPageAccountTree *page)
 {
-	Account *account;
+    Account *account;
 
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
-	account = gnc_plugin_page_account_tree_get_current_account (page);
-	gppat_open_account_common (page, account, FALSE);
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
+    account = gnc_plugin_page_account_tree_get_current_account (page);
+    gppat_open_account_common (page, account, FALSE);
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_open_subaccounts (GtkAction *action,
-						   GncPluginPageAccountTree *page)
+        GncPluginPageAccountTree *page)
 {
-	Account *account;
+    Account *account;
 
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
-	account = gnc_plugin_page_account_tree_get_current_account (page);
-	gppat_open_account_common (page, account, TRUE);
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
+    account = gnc_plugin_page_account_tree_get_current_account (page);
+    gppat_open_account_common (page, account, TRUE);
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_edit_account (GtkAction *action, GncPluginPageAccountTree *page)
 {
-	Account *account;
+    Account *account;
 
-	ENTER("action %p, page %p", action, page);
+    ENTER("action %p, page %p", action, page);
 
-	account = gnc_plugin_page_account_tree_get_current_account (page);
-	g_return_if_fail (account != NULL);
+    account = gnc_plugin_page_account_tree_get_current_account (page);
+    g_return_if_fail (account != NULL);
 
-	gnc_ui_edit_account_window (account);
-	LEAVE(" ");
+    gnc_ui_edit_account_window (account);
+    LEAVE(" ");
 }
 
 /********************************************************************
@@ -789,31 +836,34 @@
  ********************************************************************/
 typedef struct _delete_helper
 {
-	gboolean has_splits;
-	gboolean has_ro_splits;
+    gboolean has_splits;
+    gboolean has_ro_splits;
 } delete_helper_t;
 
 static gpointer
 delete_account_helper (Account * account, gpointer data)
 {
-	delete_helper_t *helper_res = data;
-	GList *splits;
+    delete_helper_t *helper_res = data;
+    GList *splits;
 
-	splits = xaccAccountGetSplitList (account);
-	if (splits) {
-		helper_res->has_splits = TRUE;
-		while (splits) {
-			Split *s = splits->data;
-			Transaction *txn = xaccSplitGetParent (s);
-			if (xaccTransGetReadOnly (txn)) {
-				helper_res->has_ro_splits = TRUE;
-				break;
-			}
-			splits = splits->next;
-		}
-	}
+    splits = xaccAccountGetSplitList (account);
+    if (splits)
+    {
+        helper_res->has_splits = TRUE;
+        while (splits)
+        {
+            Split *s = splits->data;
+            Transaction *txn = xaccSplitGetParent (s);
+            if (xaccTransGetReadOnly (txn))
+            {
+                helper_res->has_ro_splits = TRUE;
+                break;
+            }
+            splits = splits->next;
+        }
+    }
 
-	return GINT_TO_POINTER (helper_res->has_splits || helper_res->has_ro_splits);
+    return GINT_TO_POINTER (helper_res->has_splits || helper_res->has_ro_splits);
 }
 
 /***
@@ -823,448 +873,482 @@
 static void
 set_ok_sensitivity(GtkWidget *dialog)
 {
-  GtkWidget *button;
-  gpointer dmas, tmas;
-  gint dmas_cnt, tmas_cnt;
-  gboolean sensitive;
+    GtkWidget *button;
+    gpointer dmas, tmas;
+    gint dmas_cnt, tmas_cnt;
+    gboolean sensitive;
 
-  dmas = g_object_get_data(G_OBJECT(dialog), "dmas");
-  tmas = g_object_get_data(G_OBJECT(dialog), "tmas");
-  dmas_cnt = gnc_account_sel_get_num_account(GNC_ACCOUNT_SEL(dmas));
-  tmas_cnt = gnc_account_sel_get_num_account(GNC_ACCOUNT_SEL(tmas));
+    dmas = g_object_get_data(G_OBJECT(dialog), "dmas");
+    tmas = g_object_get_data(G_OBJECT(dialog), "tmas");
+    dmas_cnt = gnc_account_sel_get_num_account(GNC_ACCOUNT_SEL(dmas));
+    tmas_cnt = gnc_account_sel_get_num_account(GNC_ACCOUNT_SEL(tmas));
 
-  sensitive = (((NULL == dmas) ||
-		(!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(dmas)) || dmas_cnt)) &&
-	       ((NULL == tmas) ||
-		(!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(tmas)) || tmas_cnt)));
+    sensitive = (((NULL == dmas) ||
+                  (!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(dmas)) || dmas_cnt)) &&
+                 ((NULL == tmas) ||
+                  (!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(tmas)) || tmas_cnt)));
 
-  button = gnc_glade_lookup_widget(dialog, "deletebutton");
-  gtk_widget_set_sensitive(button, sensitive);
+    button = gnc_glade_lookup_widget(dialog, "deletebutton");
+    gtk_widget_set_sensitive(button, sensitive);
 }
 
 static void
 gppat_populate_gas_list(GtkWidget *dialog,
-			GNCAccountSel *gas,
-			gboolean exclude_subaccounts)
+                        GNCAccountSel *gas,
+                        gboolean exclude_subaccounts)
 {
-  Account *account;
-  GList *filter;
+    Account *account;
+    GList *filter;
 
-  g_return_if_fail(GTK_IS_DIALOG(dialog));
-  if (gas == NULL)
-    return;
-  account = g_object_get_data(G_OBJECT(dialog), DELETE_DIALOG_ACCOUNT);
-  filter = g_object_get_data(G_OBJECT(dialog), DELETE_DIALOG_FILTER);
+    g_return_if_fail(GTK_IS_DIALOG(dialog));
+    if (gas == NULL)
+        return;
+    account = g_object_get_data(G_OBJECT(dialog), DELETE_DIALOG_ACCOUNT);
+    filter = g_object_get_data(G_OBJECT(dialog), DELETE_DIALOG_FILTER);
 
-  /* Setting the account type filter triggers GNCAccountSel population. */
-  gnc_account_sel_set_acct_filters (gas, filter, NULL);
+    /* Setting the account type filter triggers GNCAccountSel population. */
+    gnc_account_sel_set_acct_filters (gas, filter, NULL);
 
-  /* Accounts to be deleted must be removed. */
-  gnc_account_sel_purge_account( gas, account, exclude_subaccounts);
+    /* Accounts to be deleted must be removed. */
+    gnc_account_sel_purge_account( gas, account, exclude_subaccounts);
 
-  /* The sensitivity of the OK button needs to be reevaluated. */
-  set_ok_sensitivity(GTK_WIDGET(dialog));
+    /* The sensitivity of the OK button needs to be reevaluated. */
+    set_ok_sensitivity(GTK_WIDGET(dialog));
 }
 
 void
 gppat_populate_tmas_list(GtkToggleButton *damrb,
-			 gpointer tmas)
+                         gpointer tmas)
 {
-  GtkWidget *dialog;
+    GtkWidget *dialog;
 
-  /* Cannot move transactions to subaccounts if they are to be deleted. */
-  dialog = gnc_glade_lookup_widget(GTK_WIDGET(damrb), "Delete Account");
-  gppat_populate_gas_list(dialog, tmas, !gtk_toggle_button_get_active(damrb));
+    /* Cannot move transactions to subaccounts if they are to be deleted. */
+    dialog = gnc_glade_lookup_widget(GTK_WIDGET(damrb), "Delete Account");
+    gppat_populate_gas_list(dialog, tmas, !gtk_toggle_button_get_active(damrb));
 }
 
 void
 gppat_set_insensitive_iff_rb_active(GtkToggleButton *b, GtkWidget *widget)
 {
-  gtk_widget_set_sensitive(widget, !gtk_toggle_button_get_active(b));
-  set_ok_sensitivity(gtk_widget_get_toplevel(widget));
+    gtk_widget_set_sensitive(widget, !gtk_toggle_button_get_active(b));
+    set_ok_sensitivity(gtk_widget_get_toplevel(widget));
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_delete_account (GtkAction *action, GncPluginPageAccountTree *page)
 {
-  Account *account = gnc_plugin_page_account_tree_get_current_account (page);
-  gchar *acct_name;
-  GList *splits;
-  delete_helper_t delete_res = { FALSE, FALSE };
-  GtkWidget *widget;
-  GtkWidget *window;
-  GtkWidget *dialog = NULL;
-  GNCAccountSel *damas = NULL; /* descendant account move account selector */
-  GNCAccountSel *dtmas = NULL; /* descendant transaction move account selector */
-  GNCAccountSel *tmas = NULL; /* transaction move account selector */
-  gint response;
-  Account *ta = NULL; /* transaction adopter */
-  Account *daa = NULL; /* descendant account adopter */
-  Account *dta = NULL; /* descendant transaction adopter */
+    Account *account = gnc_plugin_page_account_tree_get_current_account (page);
+    gchar *acct_name;
+    GList *splits;
+    delete_helper_t delete_res = { FALSE, FALSE };
+    GtkWidget *widget;
+    GtkWidget *window;
+    GtkWidget *dialog = NULL;
+    GNCAccountSel *damas = NULL; /* descendant account move account selector */
+    GNCAccountSel *dtmas = NULL; /* descendant transaction move account selector */
+    GNCAccountSel *tmas = NULL; /* transaction move account selector */
+    gint response;
+    Account *ta = NULL; /* transaction adopter */
+    Account *daa = NULL; /* descendant account adopter */
+    Account *dta = NULL; /* descendant transaction adopter */
 
-  if (NULL == account)
-    return;
+    if (NULL == account)
+        return;
 
-  window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
-  acct_name = gnc_account_get_full_name(account);
-  if (!acct_name) {
-    acct_name = g_strdup (_("(no name)"));
-  }
+    window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
+    acct_name = gnc_account_get_full_name(account);
+    if (!acct_name)
+    {
+        acct_name = g_strdup (_("(no name)"));
+    }
 
-  splits = xaccAccountGetSplitList(account);
+    splits = xaccAccountGetSplitList(account);
 
-  /*
-   * If the account has transactions or child accounts then conduct a
-   * dialog to allow the user to specify what should be done with them.
-   */
-  if ((NULL != splits) || (gnc_account_n_children(account) > 0)) {
-    GList *filter;
-    GladeXML *xml;
-    GtkWidget *label;
-    gchar *message;
+    /*
+     * If the account has transactions or child accounts then conduct a
+     * dialog to allow the user to specify what should be done with them.
+     */
+    if ((NULL != splits) || (gnc_account_n_children(account) > 0))
+    {
+        GList *filter;
+        GladeXML *xml;
+        GtkWidget *label;
+        gchar *message;
 
-    xml = gnc_glade_xml_new ("account.glade", "Delete Account");
-    dialog = glade_xml_get_widget (xml, "Delete Account");
-    gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));
-    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, dialog);
+        xml = gnc_glade_xml_new ("account.glade", "Delete Account");
+        dialog = glade_xml_get_widget (xml, "Delete Account");
+        gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));
+        glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, dialog);
 
-    label = glade_xml_get_widget (xml, "header");
-    message = g_strdup_printf(_("Deleting account %s"), acct_name);
-    gtk_label_set_text(GTK_LABEL(label), message);
-    g_free(message);
+        label = glade_xml_get_widget (xml, "header");
+        message = g_strdup_printf(_("Deleting account %s"), acct_name);
+        gtk_label_set_text(GTK_LABEL(label), message);
+        g_free(message);
 
-    /*
-     * Reparent only to accounts of the same
-     * type as the one being deleted.
-     */
-    filter = g_list_prepend(NULL, (gpointer)xaccAccountGetType(account));
-    g_object_set_data(G_OBJECT(dialog), DELETE_DIALOG_FILTER, filter);
-    g_object_set_data(G_OBJECT(dialog), DELETE_DIALOG_ACCOUNT, account);
+        /*
+         * Reparent only to accounts of the same
+         * type as the one being deleted.
+         */
+        filter = g_list_prepend(NULL, (gpointer)xaccAccountGetType(account));
+        g_object_set_data(G_OBJECT(dialog), DELETE_DIALOG_FILTER, filter);
+        g_object_set_data(G_OBJECT(dialog), DELETE_DIALOG_ACCOUNT, account);
 
-    /*
-     * Adjust the dialog based on whether the account has
-     * transactions.
-     */
-    if (splits) {
-      delete_helper_t delete_res2 = { FALSE, FALSE };
+        /*
+         * Adjust the dialog based on whether the account has
+         * transactions.
+         */
+        if (splits)
+        {
+            delete_helper_t delete_res2 = { FALSE, FALSE };
 
-      tmas = GNC_ACCOUNT_SEL(glade_xml_get_widget (xml, "tmas"));
-      gppat_populate_gas_list(dialog, tmas, FALSE);
+            tmas = GNC_ACCOUNT_SEL(glade_xml_get_widget (xml, "tmas"));
+            gppat_populate_gas_list(dialog, tmas, FALSE);
 
-      delete_account_helper(account, &delete_res2);
-      if (delete_res2.has_ro_splits) {
-	gtk_widget_destroy(glade_xml_get_widget (xml, "trans_rw"));
-	widget = glade_xml_get_widget (xml, "tdrb");
-	gtk_widget_set_sensitive(widget, FALSE);
-      } else {
-	gtk_widget_destroy(glade_xml_get_widget (xml, "trans_ro"));
-      }
-    } else {
-      gtk_widget_destroy(glade_xml_get_widget (xml, "transactions"));
-    }
+            delete_account_helper(account, &delete_res2);
+            if (delete_res2.has_ro_splits)
+            {
+                gtk_widget_destroy(glade_xml_get_widget (xml, "trans_rw"));
+                widget = glade_xml_get_widget (xml, "tdrb");
+                gtk_widget_set_sensitive(widget, FALSE);
+            }
+            else
+            {
+                gtk_widget_destroy(glade_xml_get_widget (xml, "trans_ro"));
+            }
+        }
+        else
+        {
+            gtk_widget_destroy(glade_xml_get_widget (xml, "transactions"));
+        }
 
-    /*
-     * Adjust the dialog based on whether the account has children.
-     */
-    if (gnc_account_n_children(account) > 0) {
-      /*
-       * Check for RO txns in descendants
-       */
-      gnc_account_foreach_descendant_until(account, delete_account_helper,
-			      &delete_res);
-      if (delete_res.has_ro_splits) {
-	gtk_widget_destroy(glade_xml_get_widget (xml, "sa_trans_rw"));
-	widget = glade_xml_get_widget (xml, "dtdrb");
-	gtk_widget_set_sensitive(widget, FALSE);
-      } else if (delete_res.has_splits) {
-	gtk_widget_destroy(glade_xml_get_widget (xml, "sa_trans_ro"));
-      } else {
-	gtk_widget_destroy(glade_xml_get_widget (xml, "subaccount_trans"));
-      }
-      damas = GNC_ACCOUNT_SEL(glade_xml_get_widget (xml, "damas"));
-      gppat_populate_gas_list(dialog, damas, TRUE);
-      dtmas = GNC_ACCOUNT_SEL(glade_xml_get_widget (xml, "dtmas"));
-      gppat_populate_gas_list(dialog, dtmas, TRUE);
-    } else {
-      gtk_widget_destroy(glade_xml_get_widget (xml, "subaccounts"));
-      gtk_widget_destroy(glade_xml_get_widget (xml, "subaccount_trans"));
-    }
+        /*
+         * Adjust the dialog based on whether the account has children.
+         */
+        if (gnc_account_n_children(account) > 0)
+        {
+            /*
+             * Check for RO txns in descendants
+             */
+            gnc_account_foreach_descendant_until(account, delete_account_helper,
+                                                 &delete_res);
+            if (delete_res.has_ro_splits)
+            {
+                gtk_widget_destroy(glade_xml_get_widget (xml, "sa_trans_rw"));
+                widget = glade_xml_get_widget (xml, "dtdrb");
+                gtk_widget_set_sensitive(widget, FALSE);
+            }
+            else if (delete_res.has_splits)
+            {
+                gtk_widget_destroy(glade_xml_get_widget (xml, "sa_trans_ro"));
+            }
+            else
+            {
+                gtk_widget_destroy(glade_xml_get_widget (xml, "subaccount_trans"));
+            }
+            damas = GNC_ACCOUNT_SEL(glade_xml_get_widget (xml, "damas"));
+            gppat_populate_gas_list(dialog, damas, TRUE);
+            dtmas = GNC_ACCOUNT_SEL(glade_xml_get_widget (xml, "dtmas"));
+            gppat_populate_gas_list(dialog, dtmas, TRUE);
+        }
+        else
+        {
+            gtk_widget_destroy(glade_xml_get_widget (xml, "subaccounts"));
+            gtk_widget_destroy(glade_xml_get_widget (xml, "subaccount_trans"));
+        }
 
-    /* default to cancel */
-    gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
+        /* default to cancel */
+        gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
 
+        /*
+         * Note that one effect of the modal dialog is preventing
+         * the account selectors from being repopulated.
+         */
+        gtk_widget_show_all(dialog);
+        response = gtk_dialog_run(GTK_DIALOG(dialog));
+        if (GTK_RESPONSE_ACCEPT != response)
+        {
+            /* Account deletion is cancelled, so clean up and return. */
+            gtk_widget_destroy(dialog);
+            g_list_free(filter);
+            g_free(acct_name);
+            return;
+        }
+        if (tmas && GTK_WIDGET_IS_SENSITIVE(tmas))
+            ta = gnc_account_sel_get_account(tmas);
+        if (damas && GTK_WIDGET_IS_SENSITIVE(damas))
+            daa = gnc_account_sel_get_account(damas);
+        if (dtmas && GTK_WIDGET_IS_SENSITIVE(dtmas))
+            dta = gnc_account_sel_get_account(dtmas);
+        gtk_widget_destroy(dialog);
+        g_list_free(filter);
+    } /* (NULL != splits) || (NULL != children) */
+
     /*
-     * Note that one effect of the modal dialog is preventing
-     * the account selectors from being repopulated.
-     */ 
-    gtk_widget_show_all(dialog);
-    response = gtk_dialog_run(GTK_DIALOG(dialog));
-    if (GTK_RESPONSE_ACCEPT != response) {
-      /* Account deletion is cancelled, so clean up and return. */
-      gtk_widget_destroy(dialog);
-      g_list_free(filter);
-      g_free(acct_name);
-      return;
-    }
-    if (tmas && GTK_WIDGET_IS_SENSITIVE(tmas))
-      ta = gnc_account_sel_get_account(tmas);
-    if (damas && GTK_WIDGET_IS_SENSITIVE(damas))
-      daa = gnc_account_sel_get_account(damas);
-    if (dtmas && GTK_WIDGET_IS_SENSITIVE(dtmas))
-      dta = gnc_account_sel_get_account(dtmas);
-    gtk_widget_destroy(dialog);
-    g_list_free(filter);
-  } /* (NULL != splits) || (NULL != children) */
+     * Present a message to the user which specifies what will be
+     * deleted and what will be reparented, then ask for verification.
+     */
+    {
+        const char *format = _("The account %s will be deleted.");
+        char *lines[8];
+        char *message;
+        char *name;
+        int i = 0;
 
-  /*
-   * Present a message to the user which specifies what will be
-   * deleted and what will be reparented, then ask for verification.
-   */
-  {
-    const char *format = _("The account %s will be deleted.");
-    char *lines[8];
-    char *message;
-    char *name;
-    int i = 0;
+        lines[0] = g_strdup_printf(format, acct_name);
+        if (splits)
+        {
+            if (ta)
+            {
+                name = gnc_account_get_full_name(ta);
+                format = _("All transactions in this account will be moved to "
+                           "the account %s.");
+                lines[++i] = g_strdup_printf(format, name);
+            }
+            else if (splits)
+            {
+                format = _("All transactions in this account will be deleted.");
+                lines[++i] = g_strdup_printf("%s", format);
+            }
+        }
+        if (gnc_account_n_children(account) > 0)
+        {
+            if (daa)
+            {
+                name = gnc_account_get_full_name(daa);
+                format = _("All of its sub-accounts will be moved to "
+                           "the account %s.");
+                lines[++i] = g_strdup_printf(format, name);
+            }
+            else
+            {
+                format = _("All of its subaccounts will be deleted.");
+                lines[++i] = g_strdup_printf("%s", format);
+                if (dta)
+                {
+                    name = gnc_account_get_full_name(dta);
+                    format = _("All sub-account transactions will be moved to "
+                               "the account %s.");
+                    lines[++i] = g_strdup_printf(format, name);
+                }
+                else if (delete_res.has_splits)
+                {
+                    format = _("All sub-account transactions will be deleted.");
+                    lines[++i] = g_strdup_printf("%s", format);
+                }
+            }
+        }
+        lines[++i] = _("Are you sure you want to do this?");
+        lines[i] = NULL;
+        i--; /* Don't try to free the constant question. */
+        message = g_strjoinv(" ", lines);
+        while (i--)
+        {
+            g_free(lines[i]);
+        }
 
-    lines[0] = g_strdup_printf(format, acct_name);
-    if (splits) {
-      if (ta) {
-	name = gnc_account_get_full_name(ta);
-	format = _("All transactions in this account will be moved to "
-		   "the account %s.");
-	lines[++i] = g_strdup_printf(format, name);
-      } else if (splits) {
-	format = _("All transactions in this account will be deleted.");
-	lines[++i] = g_strdup_printf("%s", format);
-      }
-    }
-    if (gnc_account_n_children(account) > 0) {
-      if (daa) {
-	name = gnc_account_get_full_name(daa);
-	format = _("All of its sub-accounts will be moved to "
-		   "the account %s.");
-	lines[++i] = g_strdup_printf(format, name);
-      } else {
-	format = _("All of its subaccounts will be deleted.");
-	lines[++i] = g_strdup_printf("%s", format);
-	if (dta) {
-	  name = gnc_account_get_full_name(dta);
-	  format = _("All sub-account transactions will be moved to "
-		     "the account %s.");
-	  lines[++i] = g_strdup_printf(format, name);
-	} else if (delete_res.has_splits) {
-	  format = _("All sub-account transactions will be deleted.");
-	  lines[++i] = g_strdup_printf("%s", format);
-	}
-      }
-    }
-    lines[++i] = _("Are you sure you want to do this?");
-    lines[i] = NULL;
-    i--; /* Don't try to free the constant question. */
-    message = g_strjoinv(" ", lines);
-    while (i--) {
-	g_free(lines[i]);
-    }
+        dialog =  gtk_message_dialog_new(GTK_WINDOW(window),
+                                         GTK_DIALOG_DESTROY_WITH_PARENT,
+                                         GTK_MESSAGE_QUESTION,
+                                         GTK_BUTTONS_NONE,
+                                         "%s", message);
+        g_free(message);
+        gtk_dialog_add_buttons(GTK_DIALOG(dialog),
+                               GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                               GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT,
+                               (gchar *)NULL);
+        gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
+        response = gtk_dialog_run(GTK_DIALOG(dialog));
+        gtk_widget_destroy(dialog);
 
-    dialog =  gtk_message_dialog_new(GTK_WINDOW(window),
-				     GTK_DIALOG_DESTROY_WITH_PARENT,
-				     GTK_MESSAGE_QUESTION,
-				     GTK_BUTTONS_NONE,
-				     "%s", message);
-    g_free(message);
-    gtk_dialog_add_buttons(GTK_DIALOG(dialog),
-			     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-			     GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT,
-			     (gchar *)NULL);
-    gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
-    response = gtk_dialog_run(GTK_DIALOG(dialog));
-    gtk_widget_destroy(dialog);
+        if (GTK_RESPONSE_ACCEPT == response)
+        {
+            gnc_set_busy_cursor(NULL, TRUE);
+            gnc_suspend_gui_refresh ();
+            xaccAccountBeginEdit (account);
+            if (NULL != daa)
+            {
+                GList *acct_list, *ptr;
 
-    if (GTK_RESPONSE_ACCEPT == response) {
-      gnc_set_busy_cursor(NULL, TRUE);
-      gnc_suspend_gui_refresh ();
-      xaccAccountBeginEdit (account);
-      if (NULL != daa) {
-	GList *acct_list, *ptr;
-
-	xaccAccountBeginEdit (daa);
-	acct_list = gnc_account_get_children(account);
-	for (ptr = acct_list; ptr; ptr = g_list_next(ptr))
-	  gnc_account_append_child (daa, ptr->data);
-	g_list_free(acct_list);
-	xaccAccountCommitEdit (daa);
-      } else if (NULL != dta) {
-	/* Move the splits of its subaccounts, if any. */
-	gnc_account_foreach_descendant(account,
-				       (AccountCb)xaccAccountMoveAllSplits,
-				       dta);
-      }
-      if (NULL != ta) {
-	/* Move the splits of the account to be deleted. */
-	xaccAccountMoveAllSplits (account, ta);
-      }
-      /*
-       * Finally, delete the account, any subaccounts it may still
-       * have, and any splits it or its subaccounts may still have.
-       */
-      xaccAccountDestroy (account);
-      gnc_resume_gui_refresh ();
-      gnc_unset_busy_cursor(NULL);
+                xaccAccountBeginEdit (daa);
+                acct_list = gnc_account_get_children(account);
+                for (ptr = acct_list; ptr; ptr = g_list_next(ptr))
+                    gnc_account_append_child (daa, ptr->data);
+                g_list_free(acct_list);
+                xaccAccountCommitEdit (daa);
+            }
+            else if (NULL != dta)
+            {
+                /* Move the splits of its subaccounts, if any. */
+                gnc_account_foreach_descendant(account,
+                                               (AccountCb)xaccAccountMoveAllSplits,
+                                               dta);
+            }
+            if (NULL != ta)
+            {
+                /* Move the splits of the account to be deleted. */
+                xaccAccountMoveAllSplits (account, ta);
+            }
+            /*
+             * Finally, delete the account, any subaccounts it may still
+             * have, and any splits it or its subaccounts may still have.
+             */
+            xaccAccountDestroy (account);
+            gnc_resume_gui_refresh ();
+            gnc_unset_busy_cursor(NULL);
+        }
     }
-  }
-  g_free(acct_name);
+    g_free(acct_name);
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_renumber_accounts (GtkAction *action,
-						    GncPluginPageAccountTree *page)
+        GncPluginPageAccountTree *page)
 {
-  Account *account;
-  GtkWidget *window;
+    Account *account;
+    GtkWidget *window;
 
-  window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
-  account = gnc_plugin_page_account_tree_get_current_account(page);
-  if (!window || !account)
-    return;
+    window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
+    account = gnc_plugin_page_account_tree_get_current_account(page);
+    if (!window || !account)
+        return;
 
-  gnc_account_renumber_create_dialog(window, account);
+    gnc_account_renumber_create_dialog(window, account);
 }
 
 /*********************/
 
 static void
 gnc_plugin_page_account_tree_cmd_view_filter_by (GtkAction *action,
-						 GncPluginPageAccountTree *page)
+        GncPluginPageAccountTree *page)
 {
-  GncPluginPageAccountTreePrivate *priv;
+    GncPluginPageAccountTreePrivate *priv;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
-  ENTER("(action %p, page %p)", action, page);
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
+    ENTER("(action %p, page %p)", action, page);
 
-  priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
-  account_filter_dialog_create(&priv->fd, GNC_PLUGIN_PAGE(page));
-  LEAVE(" ");
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
+    account_filter_dialog_create(&priv->fd, GNC_PLUGIN_PAGE(page));
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_reconcile (GtkAction *action,
-					    GncPluginPageAccountTree *page)
+        GncPluginPageAccountTree *page)
 {
-	GtkWidget *window;
-	Account *account;
-	RecnWindow *recnData;
+    GtkWidget *window;
+    Account *account;
+    RecnWindow *recnData;
 
-	account = gnc_plugin_page_account_tree_get_current_account (page);
-	g_return_if_fail (account != NULL);
+    account = gnc_plugin_page_account_tree_get_current_account (page);
+    g_return_if_fail (account != NULL);
 
-	window = GNC_PLUGIN_PAGE (page)->window;
-	recnData = recnWindow (window, account);
-	gnc_ui_reconcile_window_raise (recnData);
+    window = GNC_PLUGIN_PAGE (page)->window;
+    recnData = recnWindow (window, account);
+    gnc_ui_reconcile_window_raise (recnData);
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_autoclear (GtkAction *action,
-					    GncPluginPageAccountTree *page)
+        GncPluginPageAccountTree *page)
 {
-	GtkWidget *window;
-	Account *account;
-	AutoClearWindow *autoClearData;
+    GtkWidget *window;
+    Account *account;
+    AutoClearWindow *autoClearData;
 
-	account = gnc_plugin_page_account_tree_get_current_account (page);
-	g_return_if_fail (account != NULL);
+    account = gnc_plugin_page_account_tree_get_current_account (page);
+    g_return_if_fail (account != NULL);
 
-	window = GNC_PLUGIN_PAGE (page)->window;
-	autoClearData = autoClearWindow (window, account);
-	gnc_ui_autoclear_window_raise (autoClearData);
+    window = GNC_PLUGIN_PAGE (page)->window;
+    autoClearData = autoClearWindow (window, account);
+    gnc_ui_autoclear_window_raise (autoClearData);
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_transfer (GtkAction *action,
-					   GncPluginPageAccountTree *page)
+        GncPluginPageAccountTree *page)
 {
-	GtkWidget *window;
-	Account *account;
+    GtkWidget *window;
+    Account *account;
 
-	account = gnc_plugin_page_account_tree_get_current_account (page);
-	window = GNC_PLUGIN_PAGE (page)->window;
-	gnc_xfer_dialog (window, account);
+    account = gnc_plugin_page_account_tree_get_current_account (page);
+    window = GNC_PLUGIN_PAGE (page)->window;
+    gnc_xfer_dialog (window, account);
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_stock_split (GtkAction *action,
-					      GncPluginPageAccountTree *page)
+        GncPluginPageAccountTree *page)
 {
-	GtkWidget *window;
-	Account *account;
+    GtkWidget *window;
+    Account *account;
 
-	account = gnc_plugin_page_account_tree_get_current_account (page);
-	window = GNC_PLUGIN_PAGE (page)->window;
-	gnc_stock_split_dialog (window, account);
+    account = gnc_plugin_page_account_tree_get_current_account (page);
+    window = GNC_PLUGIN_PAGE (page)->window;
+    gnc_stock_split_dialog (window, account);
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_lots (GtkAction *action,
-				       GncPluginPageAccountTree *page)
+                                       GncPluginPageAccountTree *page)
 {
-	Account *account;
+    Account *account;
 
-	account = gnc_plugin_page_account_tree_get_current_account (page);
-	gnc_lot_viewer_dialog (account);
+    account = gnc_plugin_page_account_tree_get_current_account (page);
+    gnc_lot_viewer_dialog (account);
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_scrub (GtkAction *action, GncPluginPageAccountTree *page)
 {
-	Account *account = gnc_plugin_page_account_tree_get_current_account (page);
+    Account *account = gnc_plugin_page_account_tree_get_current_account (page);
 
-	g_return_if_fail (account != NULL);
+    g_return_if_fail (account != NULL);
 
-	gnc_suspend_gui_refresh ();
+    gnc_suspend_gui_refresh ();
 
-	xaccAccountScrubOrphans (account);
-	xaccAccountScrubImbalance (account);
+    xaccAccountScrubOrphans (account);
+    xaccAccountScrubImbalance (account);
 
-	// XXX: Lots are disabled
-        if (g_getenv("GNC_AUTO_SCRUB_LOTS") != NULL)
- 	    xaccAccountScrubLots(account);
+    // XXX: Lots are disabled
+    if (g_getenv("GNC_AUTO_SCRUB_LOTS") != NULL)
+        xaccAccountScrubLots(account);
 
-	gnc_resume_gui_refresh ();
+    gnc_resume_gui_refresh ();
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_scrub_sub (GtkAction *action, GncPluginPageAccountTree *page)
 {
-	Account *account = gnc_plugin_page_account_tree_get_current_account (page);
+    Account *account = gnc_plugin_page_account_tree_get_current_account (page);
 
-	g_return_if_fail (account != NULL);
+    g_return_if_fail (account != NULL);
 
-	gnc_suspend_gui_refresh ();
+    gnc_suspend_gui_refresh ();
 
-	xaccAccountTreeScrubOrphans (account);
-	xaccAccountTreeScrubImbalance (account);
+    xaccAccountTreeScrubOrphans (account);
+    xaccAccountTreeScrubImbalance (account);
 
-	// XXX: Lots are disabled
-        if (g_getenv("GNC_AUTO_SCRUB_LOTS") != NULL)
- 	    xaccAccountTreeScrubLots(account);
+    // XXX: Lots are disabled
+    if (g_getenv("GNC_AUTO_SCRUB_LOTS") != NULL)
+        xaccAccountTreeScrubLots(account);
 
-	gnc_resume_gui_refresh ();
+    gnc_resume_gui_refresh ();
 }
 
 static void
 gnc_plugin_page_account_tree_cmd_scrub_all (GtkAction *action, GncPluginPageAccountTree *page)
 {
-	Account *root = gnc_get_current_root_account ();
+    Account *root = gnc_get_current_root_account ();
 
-	gnc_suspend_gui_refresh ();
+    gnc_suspend_gui_refresh ();
 
-	xaccAccountTreeScrubOrphans (root);
-	xaccAccountTreeScrubImbalance (root);
-	// XXX: Lots are disabled
-        if (g_getenv("GNC_AUTO_SCRUB_LOTS") != NULL)
-            xaccAccountTreeScrubLots(root);
+    xaccAccountTreeScrubOrphans (root);
+    xaccAccountTreeScrubImbalance (root);
+    // XXX: Lots are disabled
+    if (g_getenv("GNC_AUTO_SCRUB_LOTS") != NULL)
+        xaccAccountTreeScrubLots(root);
 
-	gnc_resume_gui_refresh ();
+    gnc_resume_gui_refresh ();
 }
 
 /** @} */

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin_page-account-tree.h -- 
+/*
+ * gnc-plugin_page-account-tree.h --
  *
  * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
@@ -26,7 +26,7 @@
     @{ */
 /** @addtogroup GncPluginPageAccountTree An Account Tree Plugin
     @{ */
-/** @file gnc-plugin-page-account-tree.h 
+/** @file gnc-plugin-page-account-tree.h
     @brief Functions providing a chart of account page.
     @author Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
     @author Copyright (C) 2003,2005,2006 David Hampton <hampton at employees.org>
@@ -53,16 +53,18 @@
 #define GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME "GncPluginPageAccountTree"
 
 /* typedefs & structures */
-typedef struct {
-	GncPluginPage gnc_plugin_page;
+typedef struct
+{
+    GncPluginPage gnc_plugin_page;
 } GncPluginPageAccountTree;
 
-typedef struct {
-	GncPluginPageClass gnc_plugin_page;
+typedef struct
+{
+    GncPluginPageClass gnc_plugin_page;
 
-	/* callbacks */
-	void (*account_selected) (GncPluginPage	 *page,
-				  Account	 *account);
+    /* callbacks */
+    void (*account_selected) (GncPluginPage	 *page,
+                              Account	 *account);
 
 } GncPluginPageAccountTreeClass;
 

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-budget.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-budget.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-budget.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -118,53 +118,68 @@
 
 
 
-static GtkActionEntry gnc_plugin_page_budget_actions [] = {
+static GtkActionEntry gnc_plugin_page_budget_actions [] =
+{
     /* Toplevel */
     { "FakeToplevel", "", NULL, NULL, NULL, NULL },
 
     /* File menu */
-    { "OpenAccountAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Account"), NULL,
-      N_("Open the selected account"),
-      G_CALLBACK (gnc_plugin_page_budget_cmd_open_account) },
-    { "OpenSubaccountsAction", GNC_STOCK_OPEN_ACCOUNT, 
-      N_("Open _Subaccounts"), NULL,
-      N_("Open the selected account and all its subaccounts"),
-      G_CALLBACK (gnc_plugin_page_budget_cmd_open_subaccounts) },
+    {
+        "OpenAccountAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Account"), NULL,
+        N_("Open the selected account"),
+        G_CALLBACK (gnc_plugin_page_budget_cmd_open_account)
+    },
+    {
+        "OpenSubaccountsAction", GNC_STOCK_OPEN_ACCOUNT,
+        N_("Open _Subaccounts"), NULL,
+        N_("Open the selected account and all its subaccounts"),
+        G_CALLBACK (gnc_plugin_page_budget_cmd_open_subaccounts)
+    },
 
     /* Edit menu */
-    { "DeleteBudgetAction", GNC_STOCK_DELETE_BUDGET, N_("_Delete Budget"),
-      NULL, N_("Delete this budget"),
-      G_CALLBACK (gnc_plugin_page_budget_cmd_delete_budget) },
-    { "OptionsBudgetAction", GTK_STOCK_PROPERTIES, N_("Budget Options"),
-      NULL, N_("Edit this budget's options"),
-      G_CALLBACK (gnc_plugin_page_budget_cmd_view_options) },
-    { "EstimateBudgetAction", GTK_STOCK_EXECUTE, N_("Estimate Budget"),
-      NULL,
-      N_("Estimate a budget value for the selected accounts from past transactions"),
-      G_CALLBACK (gnc_plugin_page_budget_cmd_estimate_budget) },
+    {
+        "DeleteBudgetAction", GNC_STOCK_DELETE_BUDGET, N_("_Delete Budget"),
+        NULL, N_("Delete this budget"),
+        G_CALLBACK (gnc_plugin_page_budget_cmd_delete_budget)
+    },
+    {
+        "OptionsBudgetAction", GTK_STOCK_PROPERTIES, N_("Budget Options"),
+        NULL, N_("Edit this budget's options"),
+        G_CALLBACK (gnc_plugin_page_budget_cmd_view_options)
+    },
+    {
+        "EstimateBudgetAction", GTK_STOCK_EXECUTE, N_("Estimate Budget"),
+        NULL,
+        N_("Estimate a budget value for the selected accounts from past transactions"),
+        G_CALLBACK (gnc_plugin_page_budget_cmd_estimate_budget)
+    },
 
     /* View menu */
-    { "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
-      G_CALLBACK (gnc_plugin_page_budget_cmd_view_filter_by) },
+    {
+        "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
+        G_CALLBACK (gnc_plugin_page_budget_cmd_view_filter_by)
+    },
 
 };
 
 static guint gnc_plugin_page_budget_n_actions =
     G_N_ELEMENTS (gnc_plugin_page_budget_actions);
 
-static const gchar *actions_requiring_account[] = {
-  "OpenAccountAction",
-  "OpenSubaccountsAction",
-  NULL
+static const gchar *actions_requiring_account[] =
+{
+    "OpenAccountAction",
+    "OpenSubaccountsAction",
+    NULL
 };
 
 /** Short labels for use on the toolbar buttons. */
-static action_toolbar_labels toolbar_labels[] = {
-  { "OpenAccountAction", 	    N_("Open") },
-  { "DeleteBudgetAction", 	    N_("Delete") },
-  { "OptionsBudgetAction", 	    N_("Options") },
-  { "EstimateBudgetAction", 	    N_("Estimate") },
-  { NULL, NULL },
+static action_toolbar_labels toolbar_labels[] =
+{
+    { "OpenAccountAction", 	    N_("Open") },
+    { "DeleteBudgetAction", 	    N_("Delete") },
+    { "OptionsBudgetAction", 	    N_("Options") },
+    { "EstimateBudgetAction", 	    N_("Estimate") },
+    { NULL, NULL },
 };
 
 typedef struct GncPluginPageBudgetPrivate
@@ -200,8 +215,10 @@
 {
     static GType gnc_plugin_page_budget_type = 0;
 
-    if (gnc_plugin_page_budget_type == 0) {
-        static const GTypeInfo our_info = {
+    if (gnc_plugin_page_budget_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
             sizeof (GncPluginPageBudgetClass),
             NULL,
             NULL,
@@ -271,18 +288,18 @@
     /* Init parent declared variables */
     parent = GNC_PLUGIN_PAGE(plugin_page);
     g_object_set(G_OBJECT(plugin_page),
-		 "page-name",      _("Budget"),
-		 "page-uri",       "default:",
-		 "ui-description", "gnc-plugin-page-budget-ui.xml",
-		 NULL);
+                 "page-name",      _("Budget"),
+                 "page-uri",       "default:",
+                 "ui-description", "gnc-plugin-page-budget-ui.xml",
+                 NULL);
 
     /* 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,
-					  "GncPluginPageBudgetActions");
+        gnc_plugin_page_create_action_group(parent,
+                                            "GncPluginPageBudgetActions");
     gtk_action_group_add_actions (action_group,
                                   gnc_plugin_page_budget_actions,
                                   gnc_plugin_page_budget_n_actions,
@@ -295,7 +312,7 @@
     priv->fd.show_zero_total = TRUE;
 
     priv->sigFigs = 1;
-    recurrenceSet(&priv->r, 1, PERIOD_MONTH, NULL, WEEKEND_ADJ_NONE); 
+    recurrenceSet(&priv->r, 1, PERIOD_MONTH, NULL, WEEKEND_ADJ_NONE);
 
     LEAVE("page %p, priv %p, action group %p",
           plugin_page, priv, action_group);
@@ -336,14 +353,18 @@
 
     page = GNC_PLUGIN_PAGE_BUDGET(user_data);
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
-    if (changes) {
+    if (changes)
+    {
         ei = gnc_gui_get_entity_events(changes, &priv->key);
-        if (ei) {
-            if (ei->event_mask & QOF_EVENT_DESTROY) {
+        if (ei)
+        {
+            if (ei->event_mask & QOF_EVENT_DESTROY)
+            {
                 gnc_plugin_page_budget_close_cb(user_data);
                 return;
             }
-            if (ei->event_mask & QOF_EVENT_MODIFY) {
+            if (ei->event_mask & QOF_EVENT_MODIFY)
+            {
                 DEBUG("refreshing budget view because budget was modified");
                 gnc_plugin_page_budget_view_refresh(page);
             }
@@ -367,7 +388,8 @@
     ENTER("page %p", plugin_page);
     page = GNC_PLUGIN_PAGE_BUDGET (plugin_page);
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
-    if (priv->widget != NULL) {
+    if (priv->widget != NULL)
+    {
         LEAVE("widget = %p", priv->widget);
         return priv->widget;
     }
@@ -439,14 +461,16 @@
     ENTER("page %p", plugin_page);
     page = GNC_PLUGIN_PAGE_BUDGET (plugin_page);
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(plugin_page);
-    if (priv->widget) {
+    if (priv->widget)
+    {
         g_object_unref(G_OBJECT(priv->widget));
         priv->widget = NULL;
     }
 
     gnc_gui_component_clear_watches (priv->component_id);
 
-    if (priv->component_id != NO_COMPONENT) {
+    if (priv->component_id != NO_COMPONENT)
+    {
         gnc_unregister_gui_component(priv->component_id);
         priv->component_id = NO_COMPONENT;
     }
@@ -472,7 +496,7 @@
     GncPluginPageBudget *budget_page;
     GncPluginPageBudgetPrivate *priv;
     char guid_str[GUID_ENCODING_LENGTH+1];
-    
+
     g_return_if_fail (GNC_IS_PLUGIN_PAGE_BUDGET(plugin_page));
     g_return_if_fail (key_file != NULL);
     g_return_if_fail (group_name != NULL);
@@ -482,12 +506,12 @@
 
     budget_page = GNC_PLUGIN_PAGE_BUDGET(plugin_page);
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(budget_page);
-    
+
     guid_to_string_buff(gnc_budget_get_guid(priv->budget), guid_str);
     g_key_file_set_string(key_file, group_name, BUDGET_GUID, guid_str);
-    
+
     //FIXME
-    gnc_tree_view_account_save(GNC_TREE_VIEW_ACCOUNT(priv->tree_view), 
+    gnc_tree_view_account_save(GNC_TREE_VIEW_ACCOUNT(priv->tree_view),
                                &priv->fd, key_file, group_name);
     LEAVE(" ");
 }
@@ -504,7 +528,7 @@
  *
  *  @param group_name The group name to use when restoring data. */
 static GncPluginPage *
-gnc_plugin_page_budget_recreate_page (GtkWidget *window, GKeyFile *key_file, 
+gnc_plugin_page_budget_recreate_page (GtkWidget *window, GKeyFile *key_file,
                                       const gchar *group_name)
 {
     GncPluginPageBudget *budget_page;
@@ -520,21 +544,22 @@
     g_return_val_if_fail(group_name, NULL);
     ENTER("key_file %p, group_name %s", key_file, group_name);
 
-    guid_str = g_key_file_get_string(key_file, group_name, BUDGET_GUID, 
+    guid_str = g_key_file_get_string(key_file, group_name, BUDGET_GUID,
                                      &error);
-    if (error) {
+    if (error)
+    {
         g_warning("error reading group %s key %s: %s",
                   group_name, BUDGET_GUID, error->message);
         g_error_free(error);
         error = NULL;
         return NULL;
     }
-    if (!string_to_guid(guid_str, &guid)) 
+    if (!string_to_guid(guid_str, &guid))
         return NULL;
-  
+
     book = qof_session_get_book(gnc_get_current_session());
     bgt = gnc_budget_lookup(&guid, book);
-    if (!bgt) 
+    if (!bgt)
         return NULL;
 
     /* Create the new page. */
@@ -546,7 +571,7 @@
     gnc_main_window_open_page(GNC_MAIN_WINDOW(window), page);
 
     //FIXME
-    gnc_tree_view_account_restore(GNC_TREE_VIEW_ACCOUNT(priv->tree_view), 
+    gnc_tree_view_account_restore(GNC_TREE_VIEW_ACCOUNT(priv->tree_view),
                                   &priv->fd, key_file, group_name);
     LEAVE(" ");
     return page;
@@ -563,14 +588,14 @@
 gppb_button_press_cb(GtkWidget *widget, GdkEventButton *event,
                      GncPluginPage *page)
 {
-  gboolean result;
+    gboolean result;
 
-  g_return_val_if_fail(GNC_IS_PLUGIN_PAGE(page), FALSE);
+    g_return_val_if_fail(GNC_IS_PLUGIN_PAGE(page), FALSE);
 
-  ENTER("widget %p, event %p, page %p", widget, event, page);
-  result = gnc_main_window_button_press_cb(widget, event, page);
-  LEAVE(" ");
-  return result;
+    ENTER("widget %p, event %p, page %p", widget, event, page);
+    result = gnc_main_window_button_press_cb(widget, event, page);
+    LEAVE(" ");
+    return result;
 }
 
 static gboolean
@@ -582,7 +607,8 @@
 
     if (event->type != GDK_KEY_PRESS) return TRUE;
 
-    switch (event->keyval) {
+    switch (event->keyval)
+    {
     case GDK_Tab:
     case GDK_ISO_Left_Tab:
     case GDK_KP_Tab:
@@ -592,10 +618,11 @@
         if (!path) return TRUE;
         //finish_edit(col);
         break;
-    default: return TRUE;
+    default:
+        return TRUE;
     }
     gnc_tree_view_keynav(GNC_TREE_VIEW(tv), &col, path, event);
-    
+
     if (path && gnc_tree_view_path_is_valid(GNC_TREE_VIEW(tv), path))
         gtk_tree_view_set_cursor(tv, path, col, TRUE);
     return TRUE;
@@ -611,7 +638,7 @@
 
     g_return_if_fail(GNC_IS_PLUGIN_PAGE_BUDGET (page));
     account = gnc_tree_view_account_get_account_from_path(
-        GNC_TREE_VIEW_ACCOUNT(treeview), path);
+                  GNC_TREE_VIEW_ACCOUNT(treeview), path);
     if (account == NULL)
         return;
 
@@ -631,29 +658,32 @@
 
     g_return_if_fail(GNC_IS_PLUGIN_PAGE_BUDGET(page));
 
-    if (!selection) {
+    if (!selection)
+    {
         sensitive = FALSE;
-    } else {
+    }
+    else
+    {
         g_return_if_fail(GTK_IS_TREE_SELECTION(selection));
-	view = gtk_tree_selection_get_tree_view (selection);
-	acct_list = gnc_tree_view_account_get_selected_accounts(
-            GNC_TREE_VIEW_ACCOUNT(view));
+        view = gtk_tree_selection_get_tree_view (selection);
+        acct_list = gnc_tree_view_account_get_selected_accounts(
+                        GNC_TREE_VIEW_ACCOUNT(view));
 
-	/* Check here for placeholder accounts, etc. */
-	sensitive = (g_list_length(acct_list) > 0);
-	g_list_free(acct_list);
+        /* Check here for placeholder accounts, etc. */
+        sensitive = (g_list_length(acct_list) > 0);
+        g_list_free(acct_list);
     }
 
     action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(page));
     gnc_plugin_update_actions (action_group, actions_requiring_account,
-				   "sensitive", sensitive);
+                               "sensitive", sensitive);
 }
 
 /* Command callbacks */
 
 static void
 gnc_plugin_page_budget_cmd_open_account (GtkAction *action,
-					 GncPluginPageBudget *page)
+        GncPluginPageBudget *page)
 {
     GncPluginPageBudgetPrivate *priv;
     GtkWidget *window;
@@ -664,20 +694,21 @@
     g_return_if_fail (GNC_IS_PLUGIN_PAGE_BUDGET (page));
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
     acct_list = gnc_tree_view_account_get_selected_accounts(
-        GNC_TREE_VIEW_ACCOUNT(priv->tree_view));
+                    GNC_TREE_VIEW_ACCOUNT(priv->tree_view));
 
     window = GNC_PLUGIN_PAGE (page)->window;
-    for (tmp = acct_list; tmp; tmp = g_list_next(tmp)) {
+    for (tmp = acct_list; tmp; tmp = g_list_next(tmp))
+    {
         account = tmp->data;
-	new_page = gnc_plugin_page_register_new (account, FALSE);
-	gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
+        new_page = gnc_plugin_page_register_new (account, FALSE);
+        gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
     }
     g_list_free(acct_list);
 }
 
 static void
 gnc_plugin_page_budget_cmd_open_subaccounts (GtkAction *action,
-						   GncPluginPageBudget *page)
+        GncPluginPageBudget *page)
 {
     GncPluginPageBudgetPrivate *priv;
     GtkWidget *window;
@@ -688,28 +719,29 @@
     g_return_if_fail (GNC_IS_PLUGIN_PAGE_BUDGET (page));
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
     acct_list = gnc_tree_view_account_get_selected_accounts(
-        GNC_TREE_VIEW_ACCOUNT(priv->tree_view));
+                    GNC_TREE_VIEW_ACCOUNT(priv->tree_view));
 
     window = GNC_PLUGIN_PAGE (page)->window;
-    for (tmp = acct_list; tmp; tmp = g_list_next(tmp)) {
+    for (tmp = acct_list; tmp; tmp = g_list_next(tmp))
+    {
         account = tmp->data;
-	new_page = gnc_plugin_page_register_new (account, TRUE);
-	gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
+        new_page = gnc_plugin_page_register_new (account, TRUE);
+        gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
     }
     g_list_free(acct_list);
 }
 
 static void
 gnc_plugin_page_budget_cmd_delete_budget (GtkAction *action,
-					  GncPluginPageBudget *page)
+        GncPluginPageBudget *page)
 {
-  GncPluginPageBudgetPrivate *priv;
-  GncBudget *budget;
+    GncPluginPageBudgetPrivate *priv;
+    GncBudget *budget;
 
-  priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
-  budget = priv->budget;
-  g_return_if_fail (GNC_IS_BUDGET(budget));
-  gnc_budget_gui_delete_budget(budget);
+    priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
+    budget = priv->budget;
+    g_return_if_fail (GNC_IS_BUDGET(budget));
+    gnc_budget_gui_delete_budget(budget);
 
 }
 
@@ -719,7 +751,7 @@
 
 static gboolean
 gnc_plugin_page_budget_options_apply_cb (GncDialog * d,
-					 gpointer user_data)
+        gpointer user_data)
 {
     GncPluginPageBudgetPrivate *priv = user_data;
     gchar *name;
@@ -728,12 +760,13 @@
     GncRecurrence *gr;
     const Recurrence *r;
 
-    if(!priv)
+    if (!priv)
         return TRUE;
 
     ENTER(" ");
     name = gnc_dialog_get_string(d, "BudgetName");
-    if (name) {
+    if (name)
+    {
         gnc_budget_set_name(priv->budget, name);
         DEBUG("%s", name);
         g_free(name);
@@ -756,33 +789,33 @@
 
 static gboolean
 gnc_plugin_page_budget_options_help_cb (GncDialog *d,
-					gpointer user_data)
+                                        gpointer user_data)
 {
-  GtkWidget *dialog;
+    GtkWidget *dialog;
 
-  dialog = gtk_message_dialog_new (NULL,
-				   GTK_DIALOG_DESTROY_WITH_PARENT,
-				   GTK_MESSAGE_INFO,
-				   GTK_BUTTONS_OK,
-				   "%s",
-				   _("Set the budget options using this dialog."));
+    dialog = gtk_message_dialog_new (NULL,
+                                     GTK_DIALOG_DESTROY_WITH_PARENT,
+                                     GTK_MESSAGE_INFO,
+                                     GTK_BUTTONS_OK,
+                                     "%s",
+                                     _("Set the budget options using this dialog."));
 
-  gtk_dialog_run (GTK_DIALOG (dialog));
-  gtk_widget_destroy (dialog);
-  return TRUE;
+    gtk_dialog_run (GTK_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
+    return TRUE;
 }
 
 static gboolean
 gnc_plugin_page_budget_options_close_cb (GncDialog *d,
-					 gpointer user_data)
+        gpointer user_data)
 {
-  GncPluginPageBudgetPrivate *priv = user_data;
+    GncPluginPageBudgetPrivate *priv = user_data;
 
-  g_return_val_if_fail(priv, TRUE);
+    g_return_val_if_fail(priv, TRUE);
 
-  gtk_widget_destroy(GTK_WIDGET(d));
-  priv->d = NULL;
-  return TRUE;
+    gtk_widget_destroy(GTK_WIDGET(d));
+    priv->d = NULL;
+    return TRUE;
 }
 
 
@@ -811,14 +844,15 @@
 
 static void
 gnc_plugin_page_budget_cmd_view_options (GtkAction *action,
-                                         GncPluginPageBudget *page)
+        GncPluginPageBudget *page)
 {
     GncPluginPageBudgetPrivate *priv;
 
     g_return_if_fail (GNC_IS_PLUGIN_PAGE_BUDGET (page));
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
 
-    if (!priv->d) {
+    if (!priv->d)
+    {
         priv->d = gnc_dialog_new(GNC_BUDGET_GUI_FILE, "BudgetOptions");
         gtk_window_set_title(GTK_WINDOW(priv->d), _("Budget Options"));
         gnc_dialog_set_cb(priv->d,
@@ -841,10 +875,11 @@
     g_return_if_fail(GNC_IS_BUDGET(budget));
     name = gnc_budget_get_name (budget);
     if (!name)
-       name = _("Unnamed Budget");
+        name = _("Unnamed Budget");
 
 
-    if (gnc_verify_dialog (NULL, FALSE, _("Delete %s?"), name)) {
+    if (gnc_verify_dialog (NULL, FALSE, _("Delete %s?"), name))
+    {
         gnc_suspend_gui_refresh ();
         gnc_budget_destroy(budget);
         // Views should close themselves because the CM will notify them.
@@ -867,19 +902,21 @@
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
 
     acct = gnc_tree_view_account_get_account_from_path(
-        GNC_TREE_VIEW_ACCOUNT(priv->tree_view), path);
+               GNC_TREE_VIEW_ACCOUNT(priv->tree_view), path);
 
     num_periods = g_list_length(priv->period_col_list);
 
-    for (i = 0; i < num_periods; i++) {
+    for (i = 0; i < num_periods; i++)
+    {
         num = recurrenceGetAccountPeriodValue(&priv->r, acct, i);
-        if (!gnc_numeric_check(num)) {
+        if (!gnc_numeric_check(num))
+        {
             if (gnc_reverse_balance (acct))
                 num = gnc_numeric_neg (num);
 
-            
-            num = gnc_numeric_convert(num, GNC_DENOM_AUTO, 
-                GNC_HOW_DENOM_SIGFIGS(priv->sigFigs) | GNC_HOW_RND_ROUND);
+
+            num = gnc_numeric_convert(num, GNC_DENOM_AUTO,
+                                      GNC_HOW_DENOM_SIGFIGS(priv->sigFigs) | GNC_HOW_RND_ROUND);
             gnc_budget_set_account_period_value(
                 priv->budget, acct, i, num);
         }
@@ -888,7 +925,7 @@
 
 static void
 gnc_plugin_page_budget_cmd_estimate_budget(GtkAction *action,
-                                           GncPluginPageBudget *page)
+        GncPluginPageBudget *page)
 {
     GncPluginPageBudgetPrivate *priv;
     GtkTreeSelection *sel;
@@ -903,12 +940,13 @@
 
     sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->tree_view));
 
-    if (gtk_tree_selection_count_selected_rows(sel) <= 0) {
+    if (gtk_tree_selection_count_selected_rows(sel) <= 0)
+    {
         dialog = gtk_message_dialog_new (
-            GTK_WINDOW(gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page))),
-            GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
-            GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "%s", 
-            _("You must select at least one account to estimate."));
+                     GTK_WINDOW(gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page))),
+                     GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
+                     GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "%s",
+                     _("You must select at least one account to estimate."));
         gtk_dialog_run (GTK_DIALOG(dialog));
         gtk_widget_destroy(dialog);
         return;
@@ -917,26 +955,27 @@
     xml = gnc_glade_xml_new ("budget.glade", "BudgetEstimate");
     dialog = glade_xml_get_widget (xml, "BudgetEstimate");
     gtk_window_set_transient_for(
-        GTK_WINDOW(dialog), 
+        GTK_WINDOW(dialog),
         GTK_WINDOW(gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page))));
     gde = glade_xml_get_widget(xml, "StartDate");
     date = recurrenceGetDate(&priv->r);
     gnc_date_edit_set_gdate(GNC_DATE_EDIT(gde), &date);
     dtr = glade_xml_get_widget(xml, "DigitsToRound");
-    gtk_spin_button_set_value(GTK_SPIN_BUTTON(dtr), 
+    gtk_spin_button_set_value(GTK_SPIN_BUTTON(dtr),
                               (gdouble)priv->sigFigs);
 
     gtk_widget_show_all (dialog);
     result = gtk_dialog_run(GTK_DIALOG(dialog));
-    switch (result) {
+    switch (result)
+    {
     case GTK_RESPONSE_OK:
         r = gnc_budget_get_recurrence(priv->budget);
-        
+
         gnc_date_edit_get_gdate(GNC_DATE_EDIT(gde), &date);
-        recurrenceSet(&priv->r, recurrenceGetMultiplier(r), 
+        recurrenceSet(&priv->r, recurrenceGetMultiplier(r),
                       recurrenceGetPeriodType(r), &date,
                       recurrenceGetWeekendAdjust(r));
-        priv->sigFigs = 
+        priv->sigFigs =
             gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(dtr));
 
         gtk_tree_selection_selected_foreach(sel, estimate_budget_helper, page);
@@ -958,20 +997,26 @@
 
     budget = GNC_BUDGET(g_object_get_data(G_OBJECT(col), "budget"));
     period_num = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(col),
-                                                    "period_num"));
+                                  "period_num"));
 
-    if (!gnc_budget_is_account_period_value_set(budget, account, period_num)) {
+    if (!gnc_budget_is_account_period_value_set(budget, account, period_num))
+    {
         amtbuff[0] = '\0';
-    } else {
-      numeric = gnc_budget_get_account_period_value(budget, account, 
-                                                    period_num);
-      if (gnc_numeric_check(numeric)) {
-          strcpy(amtbuff, "error");
-      } else {
-          xaccSPrintAmount(amtbuff, numeric,
-                           gnc_account_print_info(account, FALSE));
-      }
     }
+    else
+    {
+        numeric = gnc_budget_get_account_period_value(budget, account,
+                  period_num);
+        if (gnc_numeric_check(numeric))
+        {
+            strcpy(amtbuff, "error");
+        }
+        else
+        {
+            xaccSPrintAmount(amtbuff, numeric,
+                             gnc_account_print_info(account, FALSE));
+        }
+    }
 
     return g_strdup(amtbuff);
 }
@@ -985,18 +1030,18 @@
     gnc_numeric numeric = gnc_numeric_error(GNC_ERROR_ARG);
 
     if (!xaccParseAmount (new_text, TRUE, &numeric, NULL) &&
-        !(new_text && *new_text == '\0'))
+            !(new_text && *new_text == '\0'))
         return;
 
     period_num = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(col),
-                                                    "period_num"));
+                                  "period_num"));
 
     budget = GNC_BUDGET(g_object_get_data(G_OBJECT(col), "budget"));
 
     if (new_text && *new_text == '\0')
         gnc_budget_unset_account_period_value(budget, account, period_num);
     else
-        gnc_budget_set_account_period_value(budget, account, period_num, 
+        gnc_budget_set_account_period_value(budget, account, period_num,
                                             numeric);
 }
 
@@ -1019,10 +1064,11 @@
     col_list = priv->period_col_list;
     num_periods_visible = g_list_length(col_list);
 
-   /* Show the dates in column titles */
+    /* Show the dates in column titles */
     r = gnc_budget_get_recurrence(priv->budget);
     date = r->start;
-    for (i = 0; i < num_periods_visible; i++) {
+    for (i = 0; i < num_periods_visible; i++)
+    {
         col = GTK_TREE_VIEW_COLUMN(g_list_nth_data(col_list, i));
         titlelen = qof_print_gdate(title, MAX_DATE_LENGTH, &date);
         if (titlelen > 0)
@@ -1049,7 +1095,8 @@
     num_periods_visible = g_list_length(col_list);
 
     /* Hide any unneeded extra columns */
-    while (num_periods_visible > num_periods) {
+    while (num_periods_visible > num_periods)
+    {
         col = GTK_TREE_VIEW_COLUMN((g_list_last(col_list))->data);
         gtk_tree_view_remove_column(GTK_TREE_VIEW(priv->tree_view), col);
         col_list = g_list_delete_link(col_list, g_list_last(col_list));
@@ -1059,12 +1106,13 @@
     gnc_tree_view_configure_columns(GNC_TREE_VIEW(priv->tree_view));
 
     /* Create any needed columns */
-    while (num_periods_visible < num_periods) {
+    while (num_periods_visible < num_periods)
+    {
         col = gnc_tree_view_account_add_custom_column(
-            GNC_TREE_VIEW_ACCOUNT(priv->tree_view), "",
-            budget_col_source, budget_col_edited);
+                  GNC_TREE_VIEW_ACCOUNT(priv->tree_view), "",
+                  budget_col_source, budget_col_edited);
         g_object_set_data(G_OBJECT(col), "budget", priv->budget);
-        g_object_set_data(G_OBJECT(col), "period_num", 
+        g_object_set_data(G_OBJECT(col), "period_num",
                           GUINT_TO_POINTER(num_periods_visible));
         col_list = g_list_append(col_list, col);
         num_periods_visible = g_list_length(col_list);
@@ -1076,13 +1124,13 @@
 
 static void
 gnc_plugin_page_budget_cmd_view_filter_by (GtkAction *action,
-                                           GncPluginPageBudget *page)
+        GncPluginPageBudget *page)
 {
     GncPluginPageBudgetPrivate *priv;
 
     g_return_if_fail(GNC_IS_PLUGIN_PAGE_BUDGET(page));
     ENTER("(action %p, page %p)", action, page);
-    
+
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
     account_filter_dialog_create(&priv->fd, GNC_PLUGIN_PAGE(page));
 

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-budget.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-budget.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-budget.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -48,11 +48,13 @@
 #define GNC_PLUGIN_PAGE_BUDGET_NAME "GncPluginPageBudget"
 
 /* typedefs & structures */
-typedef struct {
-	GncPluginPage gnc_plugin_page;
+typedef struct
+{
+    GncPluginPage gnc_plugin_page;
 } GncPluginPageBudget;
 
-typedef struct {
+typedef struct
+{
     GncPluginPageClass gnc_plugin_page;
 } GncPluginPageBudgetClass;
 

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-page-register.c -- 
+/*
+ * gnc-plugin-page-register.c --
  *
  * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
  * Copyright (C) 2003,2005,2006 David Hampton <hampton at employees.org>
@@ -161,9 +161,9 @@
 static void gnc_plugin_page_register_ui_update (gpointer various, GncPluginPageRegister *page);
 static void gppr_account_destroy_cb (Account *account);
 static void gnc_plugin_page_register_event_handler (QofInstance *entity,
-						    QofEventId event_type,
-						    GncPluginPageRegister *page,
-						    GncEventData *ed);
+        QofEventId event_type,
+        GncPluginPageRegister *page,
+        GncEventData *ed);
 
 /************************************************************/
 /*                          Actions                         */
@@ -171,138 +171,215 @@
 
 static GtkActionEntry gnc_plugin_page_register_actions [] =
 {
-	/* File menu */
+    /* File menu */
 
-	{ "FilePrintAction", GTK_STOCK_PRINT, N_("_Print Check..."), "<control>p", NULL,
-	  G_CALLBACK (gnc_plugin_page_register_cmd_print_check) },
+    {
+        "FilePrintAction", GTK_STOCK_PRINT, N_("_Print Check..."), "<control>p", NULL,
+        G_CALLBACK (gnc_plugin_page_register_cmd_print_check)
+    },
 
-	/* Edit menu */
+    /* Edit menu */
 
-	{ "EditCutAction", GTK_STOCK_CUT, N_("Cu_t"), NULL,
-	  N_("Cut the current selection and copy it to clipboard"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_cut) },
-	{ "EditCopyAction", GTK_STOCK_COPY, N_("_Copy"), NULL,
-	  N_("Copy the current selection to clipboard"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_copy) },
-	{ "EditPasteAction", GTK_STOCK_PASTE, N_("_Paste"), NULL,
-	  N_("Paste the clipboard content at the cursor position"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_paste) },
-	{ "EditEditAccountAction", GNC_STOCK_EDIT_ACCOUNT, N_("Edit _Account"), "<control>e",
-	  N_("Edit the selected account"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_edit_account) },
-	{ "EditFindTransactionsAction", GTK_STOCK_FIND, N_("_Find..."), "<control>f",
-	  N_("Find transactions with a search"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_find_transactions) },
+    {
+        "EditCutAction", GTK_STOCK_CUT, N_("Cu_t"), NULL,
+        N_("Cut the current selection and copy it to clipboard"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_cut)
+    },
+    {
+        "EditCopyAction", GTK_STOCK_COPY, N_("_Copy"), NULL,
+        N_("Copy the current selection to clipboard"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_copy)
+    },
+    {
+        "EditPasteAction", GTK_STOCK_PASTE, N_("_Paste"), NULL,
+        N_("Paste the clipboard content at the cursor position"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_paste)
+    },
+    {
+        "EditEditAccountAction", GNC_STOCK_EDIT_ACCOUNT, N_("Edit _Account"), "<control>e",
+        N_("Edit the selected account"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_edit_account)
+    },
+    {
+        "EditFindTransactionsAction", GTK_STOCK_FIND, N_("_Find..."), "<control>f",
+        N_("Find transactions with a search"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_find_transactions)
+    },
 
-	/* Transaction menu */
+    /* Transaction menu */
 
-	{ "CutTransactionAction", GTK_STOCK_CUT, N_("Cu_t Transaction"), "",
-	  N_("Cut the selected transaction into clipboard"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_cut_transaction) },
-	{ "CopyTransactionAction", GTK_STOCK_COPY, N_("_Copy Transaction"), "",
-	  N_("Copy the selected transaction into clipboard"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_copy_transaction) },
-	{ "PasteTransactionAction", GTK_STOCK_PASTE, N_("_Paste Transaction"), "",
-	  N_("Paste the transaction from the clipboard"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_paste_transaction) },
-	{ "DuplicateTransactionAction", GTK_STOCK_COPY, N_("Dup_licate Transaction"), "",
-	  N_("Make a copy of the current transaction"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_duplicate_transaction) },
-	{ "DeleteTransactionAction", GTK_STOCK_DELETE, N_("_Delete Transaction"), NULL,
-	  N_("Delete the current transaction"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_delete_transaction) },
-	{ "RemoveTransactionSplitsAction", GTK_STOCK_CLEAR, N_("Remo_ve Transaction Splits"), NULL,
-	  N_("Remove all splits in the current transaction"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_reinitialize_transaction) },
-	{ "RecordTransactionAction", GTK_STOCK_ADD, N_("_Enter Transaction"), NULL,
-	  N_("Record the current transaction"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_enter_transaction) },
-	{ "CancelTransactionAction", GTK_STOCK_CANCEL, N_("Ca_ncel Transaction"), NULL,
-	  N_("Cancel the current transaction"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_cancel_transaction) },
-	{ "VoidTransactionAction", NULL, N_("_Void Transaction"), NULL, NULL,
-	  G_CALLBACK (gnc_plugin_page_register_cmd_void_transaction) },
-	{ "UnvoidTransactionAction", NULL, N_("_Unvoid Transaction"), NULL, NULL,
-	  G_CALLBACK (gnc_plugin_page_register_cmd_unvoid_transaction) },
-	{ "ReverseTransactionAction", NULL, N_("Add _Reversing Transaction"), NULL, NULL,
-	  G_CALLBACK (gnc_plugin_page_register_cmd_reverse_transaction) },
-	{ "ShiftTransactionForwardAction", NULL, N_("_Shift Transaction Forward"), NULL, NULL,
-	  G_CALLBACK (gnc_plugin_page_register_cmd_shift_transaction_forward) },
+    {
+        "CutTransactionAction", GTK_STOCK_CUT, N_("Cu_t Transaction"), "",
+        N_("Cut the selected transaction into clipboard"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_cut_transaction)
+    },
+    {
+        "CopyTransactionAction", GTK_STOCK_COPY, N_("_Copy Transaction"), "",
+        N_("Copy the selected transaction into clipboard"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_copy_transaction)
+    },
+    {
+        "PasteTransactionAction", GTK_STOCK_PASTE, N_("_Paste Transaction"), "",
+        N_("Paste the transaction from the clipboard"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_paste_transaction)
+    },
+    {
+        "DuplicateTransactionAction", GTK_STOCK_COPY, N_("Dup_licate Transaction"), "",
+        N_("Make a copy of the current transaction"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_duplicate_transaction)
+    },
+    {
+        "DeleteTransactionAction", GTK_STOCK_DELETE, N_("_Delete Transaction"), NULL,
+        N_("Delete the current transaction"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_delete_transaction)
+    },
+    {
+        "RemoveTransactionSplitsAction", GTK_STOCK_CLEAR, N_("Remo_ve Transaction Splits"), NULL,
+        N_("Remove all splits in the current transaction"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_reinitialize_transaction)
+    },
+    {
+        "RecordTransactionAction", GTK_STOCK_ADD, N_("_Enter Transaction"), NULL,
+        N_("Record the current transaction"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_enter_transaction)
+    },
+    {
+        "CancelTransactionAction", GTK_STOCK_CANCEL, N_("Ca_ncel Transaction"), NULL,
+        N_("Cancel the current transaction"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_cancel_transaction)
+    },
+    {
+        "VoidTransactionAction", NULL, N_("_Void Transaction"), NULL, NULL,
+        G_CALLBACK (gnc_plugin_page_register_cmd_void_transaction)
+    },
+    {
+        "UnvoidTransactionAction", NULL, N_("_Unvoid Transaction"), NULL, NULL,
+        G_CALLBACK (gnc_plugin_page_register_cmd_unvoid_transaction)
+    },
+    {
+        "ReverseTransactionAction", NULL, N_("Add _Reversing Transaction"), NULL, NULL,
+        G_CALLBACK (gnc_plugin_page_register_cmd_reverse_transaction)
+    },
+    {
+        "ShiftTransactionForwardAction", NULL, N_("_Shift Transaction Forward"), NULL, NULL,
+        G_CALLBACK (gnc_plugin_page_register_cmd_shift_transaction_forward)
+    },
 
-	/* View menu */
+    /* View menu */
 
-	{ "ViewSortByAction", NULL, N_("_Sort By..."), NULL, NULL,
-	  G_CALLBACK (gnc_plugin_page_register_cmd_view_sort_by) },
-	{ "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
-	  G_CALLBACK (gnc_plugin_page_register_cmd_view_filter_by) },
+    {
+        "ViewSortByAction", NULL, N_("_Sort By..."), NULL, NULL,
+        G_CALLBACK (gnc_plugin_page_register_cmd_view_sort_by)
+    },
+    {
+        "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
+        G_CALLBACK (gnc_plugin_page_register_cmd_view_filter_by)
+    },
 
-	/* Actions menu */
+    /* Actions menu */
 
-	{ "ActionsTransferAction", GNC_STOCK_TRANSFER, N_("_Transfer..."), "<control>t",
-	  N_("Transfer funds from one account to another"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_transfer) },
-	{ "ActionsReconcileAction", GTK_STOCK_INDEX, N_("_Reconcile..."), NULL,
-	  N_("Reconcile the selected account"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_reconcile) },
-	{ "ActionsAutoClearAction", GTK_STOCK_INDEX, N_("_Auto-clear..."), NULL,
-	  N_("Automatically clear individual transactions, so as to reach a certain cleared amount"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_autoclear) },
-	{ "ActionsStockSplitAction", NULL, N_("Stoc_k Split..."), NULL,
-	  N_("Record a stock split or a stock merger"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_stock_split) },
-	{ "ActionsLotsAction", NULL, N_("View _Lots..."), NULL,
-	  N_("Bring up the lot viewer/editor window"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_lots) },
-	{ "BlankTransactionAction", GTK_STOCK_GOTO_BOTTOM, N_("_Blank Transaction"), NULL,
-	  N_("Move to the blank transaction at the bottom of the register"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_blank_transaction) },
-	{ "EditExchangeRateAction", NULL, N_("Edit E_xchange Rate"), NULL,
-	  N_("Edit the exchange rate for the current transaction"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_exchange_rate) },
-	{ "JumpTransactionAction", GNC_STOCK_JUMP_TO, N_("_Jump"), NULL,
-	  N_("Jump to the corresponding transaction in the other account"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_jump) },
-	{ "ScheduleTransactionAction", GNC_STOCK_SCHEDULE, N_("Sche_dule..."), NULL,
-	  N_("Create a Scheduled Transaction with the current transaction as a template"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_schedule) },
-	{ "ScrubAllAction", NULL, N_("_All transactions"), NULL, NULL,
-	  G_CALLBACK (gnc_plugin_page_register_cmd_scrub_all) },
-	{ "ScrubCurrentAction", NULL, N_("_This transaction"), NULL, NULL,
-	  G_CALLBACK (gnc_plugin_page_register_cmd_scrub_current) },
+    {
+        "ActionsTransferAction", GNC_STOCK_TRANSFER, N_("_Transfer..."), "<control>t",
+        N_("Transfer funds from one account to another"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_transfer)
+    },
+    {
+        "ActionsReconcileAction", GTK_STOCK_INDEX, N_("_Reconcile..."), NULL,
+        N_("Reconcile the selected account"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_reconcile)
+    },
+    {
+        "ActionsAutoClearAction", GTK_STOCK_INDEX, N_("_Auto-clear..."), NULL,
+        N_("Automatically clear individual transactions, so as to reach a certain cleared amount"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_autoclear)
+    },
+    {
+        "ActionsStockSplitAction", NULL, N_("Stoc_k Split..."), NULL,
+        N_("Record a stock split or a stock merger"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_stock_split)
+    },
+    {
+        "ActionsLotsAction", NULL, N_("View _Lots..."), NULL,
+        N_("Bring up the lot viewer/editor window"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_lots)
+    },
+    {
+        "BlankTransactionAction", GTK_STOCK_GOTO_BOTTOM, N_("_Blank Transaction"), NULL,
+        N_("Move to the blank transaction at the bottom of the register"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_blank_transaction)
+    },
+    {
+        "EditExchangeRateAction", NULL, N_("Edit E_xchange Rate"), NULL,
+        N_("Edit the exchange rate for the current transaction"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_exchange_rate)
+    },
+    {
+        "JumpTransactionAction", GNC_STOCK_JUMP_TO, N_("_Jump"), NULL,
+        N_("Jump to the corresponding transaction in the other account"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_jump)
+    },
+    {
+        "ScheduleTransactionAction", GNC_STOCK_SCHEDULE, N_("Sche_dule..."), NULL,
+        N_("Create a Scheduled Transaction with the current transaction as a template"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_schedule)
+    },
+    {
+        "ScrubAllAction", NULL, N_("_All transactions"), NULL, NULL,
+        G_CALLBACK (gnc_plugin_page_register_cmd_scrub_all)
+    },
+    {
+        "ScrubCurrentAction", NULL, N_("_This transaction"), NULL, NULL,
+        G_CALLBACK (gnc_plugin_page_register_cmd_scrub_current)
+    },
 
-	/* Reports menu */
+    /* Reports menu */
 
-	{ "ReportsAccountReportAction", NULL, N_("Account Report"), NULL,
-	  N_("Open a register report for this Account"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_account_report) },
-	{ "ReportsAcctTransReportAction", NULL, N_("Account Transaction Report"), NULL,
-	  N_("Open a register report for the selected Transaction"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_transaction_report) },
+    {
+        "ReportsAccountReportAction", NULL, N_("Account Report"), NULL,
+        N_("Open a register report for this Account"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_account_report)
+    },
+    {
+        "ReportsAcctTransReportAction", NULL, N_("Account Transaction Report"), NULL,
+        N_("Open a register report for the selected Transaction"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_transaction_report)
+    },
 };
 static guint gnc_plugin_page_register_n_actions = G_N_ELEMENTS (gnc_plugin_page_register_actions);
 
-static GtkToggleActionEntry toggle_entries[] = {
-	{ "ViewStyleDoubleLineAction", NULL, N_("_Double Line"), NULL,
-	  N_("Show two lines of information for each transaction"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_style_double_line), FALSE },
+static GtkToggleActionEntry toggle_entries[] =
+{
+    {
+        "ViewStyleDoubleLineAction", NULL, N_("_Double Line"), NULL,
+        N_("Show two lines of information for each transaction"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_style_double_line), FALSE
+    },
 
-	{ "SplitTransactionAction", GNC_STOCK_SPLIT_TRANS, N_("S_plit Transaction"), NULL,
-	  N_("Show all splits in the current transaction"),
-	  G_CALLBACK (gnc_plugin_page_register_cmd_expand_transaction), FALSE },
+    {
+        "SplitTransactionAction", GNC_STOCK_SPLIT_TRANS, N_("S_plit Transaction"), NULL,
+        N_("Show all splits in the current transaction"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_expand_transaction), FALSE
+    },
 };
 static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries);
 
 static GtkRadioActionEntry radio_entries_2 [] =
 {
-	/* Translators: This is a menu item in the View menu */
-	{ "ViewStyleBasicAction", NULL, N_("_Basic Ledger"), NULL,
-	  N_("Show transactions on one or two lines"), REG_STYLE_LEDGER },
-	/* Translators: This is a menu item in the View menu */
-	{ "ViewStyleAutoSplitAction", NULL, N_("_Auto-Split Ledger"), NULL,
-	  N_("Show transactions on one or two lines and expand the current transaction"), REG_STYLE_AUTO_LEDGER },
-	/* Translators: This is a menu item in the View menu */
-	{ "ViewStyleJournalAction", NULL, N_("Transaction _Journal"), NULL,
-	  N_("Show expanded transactions with all splits"), REG_STYLE_JOURNAL }
+    /* Translators: This is a menu item in the View menu */
+    {
+        "ViewStyleBasicAction", NULL, N_("_Basic Ledger"), NULL,
+        N_("Show transactions on one or two lines"), REG_STYLE_LEDGER
+    },
+    /* Translators: This is a menu item in the View menu */
+    {
+        "ViewStyleAutoSplitAction", NULL, N_("_Auto-Split Ledger"), NULL,
+        N_("Show transactions on one or two lines and expand the current transaction"), REG_STYLE_AUTO_LEDGER
+    },
+    /* Translators: This is a menu item in the View menu */
+    {
+        "ViewStyleJournalAction", NULL, N_("Transaction _Journal"), NULL,
+        N_("Show expanded transactions with all splits"), REG_STYLE_JOURNAL
+    }
 };
 static guint n_radio_entries_2 = G_N_ELEMENTS (radio_entries_2);
 
@@ -310,59 +387,65 @@
 /** These are the "important" actions provided by the register page.
  *  Their labels will appear when the toolbar is set to "Icons and
  *  important text" (e.g. GTK_TOOLBAR_BOTH_HORIZ) mode. */
-static const gchar *important_actions[] = {
-	"SplitTransactionAction",
-	NULL,
+static const gchar *important_actions[] =
+{
+    "SplitTransactionAction",
+    NULL,
 };
 
 
 /** Actions that require an account to be selected before they are
  *  enabled. */
-static const gchar *actions_requiring_account[] = {
-	"EditEditAccountAction",
-	"ActionsReconcileAction",
-	"ActionsAutoClearAction",
-	"ActionsLotsAction",
-	NULL
+static const gchar *actions_requiring_account[] =
+{
+    "EditEditAccountAction",
+    "ActionsReconcileAction",
+    "ActionsAutoClearAction",
+    "ActionsLotsAction",
+    NULL
 };
 
 
 /** View Style actions */
-static const gchar *view_style_actions[] = {
-	"ViewStyleBasicAction",
-	"ViewStyleAutoSplitAction",
-	"ViewStyleJournalAction",
-	NULL
+static const gchar *view_style_actions[] =
+{
+    "ViewStyleBasicAction",
+    "ViewStyleAutoSplitAction",
+    "ViewStyleJournalAction",
+    NULL
 };
 
 
 /** Short labels for use on the toolbar buttons. */
-static action_toolbar_labels toolbar_labels[] = {
-  { "ActionsTransferAction", 	  N_("Transfer") },
-  { "RecordTransactionAction", 	  N_("Enter") },
-  { "CancelTransactionAction", 	  N_("Cancel") },
-  { "DeleteTransactionAction", 	  N_("Delete") },
-  { "DuplicateTransactionAction", N_("Duplicate") },
-  { "SplitTransactionAction",     N_("Split") },
-  { "ScheduleTransactionAction",  N_("Schedule") },
-  { "BlankTransactionAction",     N_("Blank") },
-  { "ActionsReconcileAction",     N_("Reconcile") },
-  { "ActionsAutoClearAction",     N_("Auto-clear") },
-  { NULL, NULL },
+static action_toolbar_labels toolbar_labels[] =
+{
+    { "ActionsTransferAction", 	  N_("Transfer") },
+    { "RecordTransactionAction", 	  N_("Enter") },
+    { "CancelTransactionAction", 	  N_("Cancel") },
+    { "DeleteTransactionAction", 	  N_("Delete") },
+    { "DuplicateTransactionAction", N_("Duplicate") },
+    { "SplitTransactionAction",     N_("Split") },
+    { "ScheduleTransactionAction",  N_("Schedule") },
+    { "BlankTransactionAction",     N_("Blank") },
+    { "ActionsReconcileAction",     N_("Reconcile") },
+    { "ActionsAutoClearAction",     N_("Auto-clear") },
+    { NULL, NULL },
 };
 
 
-struct status_action {
-  const char *action_name;
-  int value;
+struct status_action
+{
+    const char *action_name;
+    int value;
 };
-static struct status_action status_actions[] = {
-  { "filter_status_reconciled",   CLEARED_RECONCILED },
-  { "filter_status_cleared",      CLEARED_CLEARED },
-  { "filter_status_voided",       CLEARED_VOIDED },
-  { "filter_status_frozen",       CLEARED_FROZEN },
-  { "filter_status_unreconciled", CLEARED_NO },
-  { NULL, 0 },
+static struct status_action status_actions[] =
+{
+    { "filter_status_reconciled",   CLEARED_RECONCILED },
+    { "filter_status_cleared",      CLEARED_CLEARED },
+    { "filter_status_voided",       CLEARED_VOIDED },
+    { "filter_status_frozen",       CLEARED_FROZEN },
+    { "filter_status_unreconciled", CLEARED_NO },
+    { NULL, 0 },
 };
 #define CLEARED_VALUE "cleared_value"
 
@@ -373,34 +456,36 @@
 
 typedef struct GncPluginPageRegisterPrivate
 {
-	GNCLedgerDisplay *ledger;
-	GNCSplitReg *gsr;
+    GNCLedgerDisplay *ledger;
+    GNCSplitReg *gsr;
 
-	GtkWidget *widget;
+    GtkWidget *widget;
 
-	gint event_handler_id;
-	gint component_manager_id;
-	GUID key;  /* The guid of the Account we're watching */
+    gint event_handler_id;
+    gint component_manager_id;
+    GUID key;  /* The guid of the Account we're watching */
 
-	const char *lines_opt_section;
-	const char *lines_opt_name;
-	gint lines_default;
-        gboolean read_only;
+    const char *lines_opt_section;
+    const char *lines_opt_name;
+    gint lines_default;
+    gboolean read_only;
 
-	struct {
-	  GtkWidget *dialog;
-	  SortType original_sort_type;
-	} sd;
+    struct
+    {
+        GtkWidget *dialog;
+        SortType original_sort_type;
+    } sd;
 
-	struct {
-	  GtkWidget *dialog;
-	  cleared_match_t original_cleared_match;
-	  cleared_match_t cleared_match;
-	  time_t original_start_time;
-	  time_t original_end_time;
-	  time_t start_time;
-	  time_t end_time;
-	} fd;
+    struct
+    {
+        GtkWidget *dialog;
+        cleared_match_t original_cleared_match;
+        cleared_match_t cleared_match;
+        time_t original_start_time;
+        time_t original_end_time;
+        time_t start_time;
+        time_t end_time;
+    } fd;
 } GncPluginPageRegisterPrivate;
 
 #define GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(o)  \
@@ -415,305 +500,311 @@
 GType
 gnc_plugin_page_register_get_type (void)
 {
-	static GType gnc_plugin_page_register_type = 0;
+    static GType gnc_plugin_page_register_type = 0;
 
-	if (gnc_plugin_page_register_type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (GncPluginPageRegisterClass),
-			NULL,
-			NULL,
-			(GClassInitFunc) gnc_plugin_page_register_class_init,
-			NULL,
-			NULL,
-			sizeof (GncPluginPageRegister),
-			0,
-			(GInstanceInitFunc) gnc_plugin_page_register_init
-		};
-		
-		gnc_plugin_page_register_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
-									GNC_PLUGIN_PAGE_REGISTER_NAME,
-									&our_info, 0);
-	}
+    if (gnc_plugin_page_register_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginPageRegisterClass),
+            NULL,
+            NULL,
+            (GClassInitFunc) gnc_plugin_page_register_class_init,
+            NULL,
+            NULL,
+            sizeof (GncPluginPageRegister),
+            0,
+            (GInstanceInitFunc) gnc_plugin_page_register_init
+        };
 
-	return gnc_plugin_page_register_type;
+        gnc_plugin_page_register_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
+                                        GNC_PLUGIN_PAGE_REGISTER_NAME,
+                                        &our_info, 0);
+    }
+
+    return gnc_plugin_page_register_type;
 }
 
 static GncPluginPage *
 gnc_plugin_page_register_new_common (GNCLedgerDisplay *ledger)
 {
-	GncPluginPageRegister *register_page;
-	GncPluginPageRegisterPrivate *priv;
-	GncPluginPage *plugin_page;
-	GNCSplitReg *gsr;
-	SplitRegister *reg;
-	const GList *item;
-	GList *book_list;
-	gchar *label;
-	gchar *label_color;
-	QofQuery *q;
+    GncPluginPageRegister *register_page;
+    GncPluginPageRegisterPrivate *priv;
+    GncPluginPage *plugin_page;
+    GNCSplitReg *gsr;
+    SplitRegister *reg;
+    const GList *item;
+    GList *book_list;
+    gchar *label;
+    gchar *label_color;
+    QofQuery *q;
 
-	/* Is there an existing page? */
-	gsr = gnc_ledger_display_get_user_data (ledger);
-	if (gsr) {
-	  item = gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_REGISTER_NAME);
-	  for ( ; item; item = g_list_next(item)) {
-	    register_page = (GncPluginPageRegister *)item->data;
-	    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(register_page);
-	    if (priv->gsr == gsr)
-	      return GNC_PLUGIN_PAGE(register_page);
-	  }
-	}
+    /* Is there an existing page? */
+    gsr = gnc_ledger_display_get_user_data (ledger);
+    if (gsr)
+    {
+        item = gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_REGISTER_NAME);
+        for ( ; item; item = g_list_next(item))
+        {
+            register_page = (GncPluginPageRegister *)item->data;
+            priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(register_page);
+            if (priv->gsr == gsr)
+                return GNC_PLUGIN_PAGE(register_page);
+        }
+    }
 
-	register_page = g_object_new (GNC_TYPE_PLUGIN_PAGE_REGISTER, NULL);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(register_page);
-	priv->ledger = ledger;
-	priv->key = *guid_null();
+    register_page = g_object_new (GNC_TYPE_PLUGIN_PAGE_REGISTER, NULL);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(register_page);
+    priv->ledger = ledger;
+    priv->key = *guid_null();
 
-	plugin_page = GNC_PLUGIN_PAGE(register_page);
-	label = gnc_plugin_page_register_get_tab_name(plugin_page);
-	gnc_plugin_page_set_page_name(plugin_page, label);
-	g_free(label);
+    plugin_page = GNC_PLUGIN_PAGE(register_page);
+    label = gnc_plugin_page_register_get_tab_name(plugin_page);
+    gnc_plugin_page_set_page_name(plugin_page, label);
+    g_free(label);
 
-	label_color = gnc_plugin_page_register_get_tab_color(plugin_page);
-	gnc_plugin_page_set_page_color(plugin_page, label_color);
-	g_free(label_color);
+    label_color = gnc_plugin_page_register_get_tab_color(plugin_page);
+    gnc_plugin_page_set_page_color(plugin_page, label_color);
+    g_free(label_color);
 
-	label = gnc_plugin_page_register_get_long_name(plugin_page);
-        gnc_plugin_page_set_page_long_name(plugin_page, label);
-        g_free(label);
+    label = gnc_plugin_page_register_get_long_name(plugin_page);
+    gnc_plugin_page_set_page_long_name(plugin_page, label);
+    g_free(label);
 
-	q = gnc_ledger_display_get_query (ledger);
-	book_list = qof_query_get_books (q);
-	for (item = book_list; item; item = g_list_next(item))
-	  gnc_plugin_page_add_book (plugin_page, (QofBook *)item->data);
-	// Do not free the list. It is owned by the query.
-	
-	reg = gnc_ledger_display_get_split_register(priv->ledger);
+    q = gnc_ledger_display_get_query (ledger);
+    book_list = qof_query_get_books (q);
+    for (item = book_list; item; item = g_list_next(item))
+        gnc_plugin_page_add_book (plugin_page, (QofBook *)item->data);
+    // Do not free the list. It is owned by the query.
 
-	priv->component_manager_id = 0;
-	return plugin_page;
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+
+    priv->component_manager_id = 0;
+    return plugin_page;
 }
 
 GncPluginPage *
 gnc_plugin_page_register_new (Account *account, gboolean subaccounts)
 {
-	GNCLedgerDisplay *ledger;
-	GncPluginPage *page;
-	GncPluginPageRegisterPrivate *priv;
+    GNCLedgerDisplay *ledger;
+    GncPluginPage *page;
+    GncPluginPageRegisterPrivate *priv;
 
-	ENTER("account=%p, subaccounts=%s", account,
-	      subaccounts? "TRUE" : "FALSE");
+    ENTER("account=%p, subaccounts=%s", account,
+          subaccounts ? "TRUE" : "FALSE");
 
-	if (subaccounts)
-	  ledger = gnc_ledger_display_subaccounts (account);
-	else
-	  ledger = gnc_ledger_display_simple (account);
+    if (subaccounts)
+        ledger = gnc_ledger_display_subaccounts (account);
+    else
+        ledger = gnc_ledger_display_simple (account);
 
-	page = gnc_plugin_page_register_new_common(ledger);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-	priv->key = *xaccAccountGetGUID(account);
+    page = gnc_plugin_page_register_new_common(ledger);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    priv->key = *xaccAccountGetGUID(account);
 
-	LEAVE("%p", page);
-	return page;
+    LEAVE("%p", page);
+    return page;
 }
 
 GncPluginPage *
 gnc_plugin_page_register_new_gl (void)
 {
-	GNCLedgerDisplay *ledger;
+    GNCLedgerDisplay *ledger;
 
-	ledger = gnc_ledger_display_gl ();
-	return gnc_plugin_page_register_new_common(ledger);
+    ledger = gnc_ledger_display_gl ();
+    return gnc_plugin_page_register_new_common(ledger);
 }
 
 GncPluginPage *
 gnc_plugin_page_register_new_ledger (GNCLedgerDisplay *ledger)
 {
-	return gnc_plugin_page_register_new_common(ledger);
+    return gnc_plugin_page_register_new_common(ledger);
 }
 
 static void
 gnc_plugin_page_register_class_init (GncPluginPageRegisterClass *klass)
 {
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-	GncPluginPageClass *gnc_plugin_class = GNC_PLUGIN_PAGE_CLASS(klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GncPluginPageClass *gnc_plugin_class = GNC_PLUGIN_PAGE_CLASS(klass);
 
-	parent_class = g_type_class_peek_parent (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-	object_class->finalize = gnc_plugin_page_register_finalize;
+    object_class->finalize = gnc_plugin_page_register_finalize;
 
-	gnc_plugin_class->tab_icon        = GNC_STOCK_ACCOUNT;
-	gnc_plugin_class->plugin_name     = GNC_PLUGIN_PAGE_REGISTER_NAME;
-	gnc_plugin_class->create_widget   = gnc_plugin_page_register_create_widget;
-	gnc_plugin_class->destroy_widget  = gnc_plugin_page_register_destroy_widget;
-	gnc_plugin_class->window_changed  = gnc_plugin_page_register_window_changed;
-	gnc_plugin_class->save_page       = gnc_plugin_page_register_save_page;
-	gnc_plugin_class->recreate_page   = gnc_plugin_page_register_recreate_page;
-	gnc_plugin_class->update_edit_menu_actions = gnc_plugin_page_register_update_edit_menu;
-	gnc_plugin_class->finish_pending  = gnc_plugin_page_register_finish_pending;
+    gnc_plugin_class->tab_icon        = GNC_STOCK_ACCOUNT;
+    gnc_plugin_class->plugin_name     = GNC_PLUGIN_PAGE_REGISTER_NAME;
+    gnc_plugin_class->create_widget   = gnc_plugin_page_register_create_widget;
+    gnc_plugin_class->destroy_widget  = gnc_plugin_page_register_destroy_widget;
+    gnc_plugin_class->window_changed  = gnc_plugin_page_register_window_changed;
+    gnc_plugin_class->save_page       = gnc_plugin_page_register_save_page;
+    gnc_plugin_class->recreate_page   = gnc_plugin_page_register_recreate_page;
+    gnc_plugin_class->update_edit_menu_actions = gnc_plugin_page_register_update_edit_menu;
+    gnc_plugin_class->finish_pending  = gnc_plugin_page_register_finish_pending;
 
-	g_type_class_add_private(klass, sizeof(GncPluginPageRegisterPrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginPageRegisterPrivate));
 
-	gnc_ui_register_account_destroy_callback (gppr_account_destroy_cb);
+    gnc_ui_register_account_destroy_callback (gppr_account_destroy_cb);
 }
 
 static void
 gnc_plugin_page_register_init (GncPluginPageRegister *plugin_page)
 {
-	GncPluginPageRegisterPrivate *priv;
-	GncPluginPage *parent;
-	GtkActionGroup *action_group;
-	gboolean use_new;
+    GncPluginPageRegisterPrivate *priv;
+    GncPluginPage *parent;
+    GtkActionGroup *action_group;
+    gboolean use_new;
 
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 
-	/* Init parent declared variables */
-	parent = GNC_PLUGIN_PAGE(plugin_page);
-	use_new = gnc_gconf_get_bool(GCONF_GENERAL_REGISTER, KEY_USE_NEW, NULL);
-	g_object_set(G_OBJECT(plugin_page),
-		     "page-name",      _("General Ledger"),
-		     "page-uri",       "default:",
-		     "ui-description", "gnc-plugin-page-register-ui.xml",
-		     "use-new-window", use_new,
-		     NULL);
+    /* Init parent declared variables */
+    parent = GNC_PLUGIN_PAGE(plugin_page);
+    use_new = gnc_gconf_get_bool(GCONF_GENERAL_REGISTER, KEY_USE_NEW, NULL);
+    g_object_set(G_OBJECT(plugin_page),
+                 "page-name",      _("General Ledger"),
+                 "page-uri",       "default:",
+                 "ui-description", "gnc-plugin-page-register-ui.xml",
+                 "use-new-window", use_new,
+                 NULL);
 
-	/* Create menu and toolbar information */
-	action_group =
-	  gnc_plugin_page_create_action_group(parent,
-					      "GncPluginPageRegisterActions");
-	gtk_action_group_add_actions (action_group, gnc_plugin_page_register_actions,
-				      gnc_plugin_page_register_n_actions, plugin_page);
-	gtk_action_group_add_toggle_actions (action_group,
-					     toggle_entries, n_toggle_entries,
-					     plugin_page);
-	gtk_action_group_add_radio_actions (action_group,
-					    radio_entries_2, n_radio_entries_2,
-					    REG_STYLE_LEDGER,
-					    G_CALLBACK(gnc_plugin_page_register_cmd_style_changed),
-					    plugin_page);
+    /* Create menu and toolbar information */
+    action_group =
+        gnc_plugin_page_create_action_group(parent,
+                                            "GncPluginPageRegisterActions");
+    gtk_action_group_add_actions (action_group, gnc_plugin_page_register_actions,
+                                  gnc_plugin_page_register_n_actions, plugin_page);
+    gtk_action_group_add_toggle_actions (action_group,
+                                         toggle_entries, n_toggle_entries,
+                                         plugin_page);
+    gtk_action_group_add_radio_actions (action_group,
+                                        radio_entries_2, n_radio_entries_2,
+                                        REG_STYLE_LEDGER,
+                                        G_CALLBACK(gnc_plugin_page_register_cmd_style_changed),
+                                        plugin_page);
 
-	gnc_plugin_init_short_names (action_group, toolbar_labels);
-	gnc_plugin_set_important_actions (action_group, important_actions);
+    gnc_plugin_init_short_names (action_group, toolbar_labels);
+    gnc_plugin_set_important_actions (action_group, important_actions);
 
-	priv->lines_opt_section = DEFAULT_LINES_OPTION_SECTION;
-	priv->lines_opt_name    = DEFAULT_LINES_OPTION_NAME;
-	priv->lines_default     = DEFAULT_LINES_AMOUNT;
-        priv->read_only         = FALSE;
-	priv->fd.cleared_match  = CLEARED_ALL;
+    priv->lines_opt_section = DEFAULT_LINES_OPTION_SECTION;
+    priv->lines_opt_name    = DEFAULT_LINES_OPTION_NAME;
+    priv->lines_default     = DEFAULT_LINES_AMOUNT;
+    priv->read_only         = FALSE;
+    priv->fd.cleared_match  = CLEARED_ALL;
 }
 
 static void
 gnc_plugin_page_register_finalize (GObject *object)
 {
-	GncPluginPageRegister *page;
-	GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegister *page;
+    GncPluginPageRegisterPrivate *priv;
 
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (object));
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (object));
 
-	ENTER("object %p", object);
-	page = GNC_PLUGIN_PAGE_REGISTER (object);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
+    ENTER("object %p", object);
+    page = GNC_PLUGIN_PAGE_REGISTER (object);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
-	LEAVE(" ");
+    G_OBJECT_CLASS (parent_class)->finalize (object);
+    LEAVE(" ");
 }
 
 
 Account *
 gnc_plugin_page_register_get_account (GncPluginPageRegister *page)
-{ 
-	GncPluginPageRegisterPrivate *priv;
-	GNCLedgerDisplayType ledger_type;
-	Account *leader;
+{
+    GncPluginPageRegisterPrivate *priv;
+    GNCLedgerDisplayType ledger_type;
+    Account *leader;
 
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-	ledger_type = gnc_ledger_display_type (priv->ledger);
-	leader = gnc_ledger_display_leader (priv->ledger);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    ledger_type = gnc_ledger_display_type (priv->ledger);
+    leader = gnc_ledger_display_leader (priv->ledger);
 
-	if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
-	  return leader;
-	return NULL;
+    if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
+        return leader;
+    return NULL;
 }
 
 
 static void
 gnc_plugin_page_register_ui_update (gpointer various, GncPluginPageRegister *page)
 {
-	GncPluginPageRegisterPrivate *priv;
-	SplitRegister *reg;
-	GtkAction *action;
-	gboolean expanded, voided;
-	Transaction *trans;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
+    GtkAction *action;
+    gboolean expanded, voided;
+    Transaction *trans;
 
-	/* Set 'Split Transaction' */
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-	reg = gnc_ledger_display_get_split_register(priv->ledger);
-	expanded = gnc_split_register_current_trans_expanded(reg);
-	action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
-					     "SplitTransactionAction");
-	gtk_action_set_sensitive (action, reg->style == REG_STYLE_LEDGER);
-	g_signal_handlers_block_by_func
-	  (action, gnc_plugin_page_register_cmd_expand_transaction, page);
-	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action), expanded);
-	g_signal_handlers_unblock_by_func
-	  (action, gnc_plugin_page_register_cmd_expand_transaction, page);
+    /* Set 'Split Transaction' */
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    expanded = gnc_split_register_current_trans_expanded(reg);
+    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
+                                         "SplitTransactionAction");
+    gtk_action_set_sensitive (action, reg->style == REG_STYLE_LEDGER);
+    g_signal_handlers_block_by_func
+    (action, gnc_plugin_page_register_cmd_expand_transaction, page);
+    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action), expanded);
+    g_signal_handlers_unblock_by_func
+    (action, gnc_plugin_page_register_cmd_expand_transaction, page);
 
-	/* Set 'Void' and 'Unvoid' */
-	trans = gnc_split_register_get_current_trans(reg);
-	voided = xaccTransHasSplitsInState(trans, VREC);
-	action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
-					     "VoidTransactionAction");
-	gtk_action_set_sensitive (GTK_ACTION(action), !voided);
+    /* Set 'Void' and 'Unvoid' */
+    trans = gnc_split_register_get_current_trans(reg);
+    voided = xaccTransHasSplitsInState(trans, VREC);
+    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
+                                         "VoidTransactionAction");
+    gtk_action_set_sensitive (GTK_ACTION(action), !voided);
 
-	action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
-					     "UnvoidTransactionAction");
-	gtk_action_set_sensitive (GTK_ACTION(action), voided);
+    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
+                                         "UnvoidTransactionAction");
+    gtk_action_set_sensitive (GTK_ACTION(action), voided);
 }
 
 static void
 gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister *page)
-{ 
-	GncPluginPageRegisterPrivate *priv ;
-	GtkActionGroup *action_group;
-	GtkAction *action;
-	Account *account;
-	SplitRegister *reg;
-	GNCLedgerDisplayType ledger_type;
-	int i;
+{
+    GncPluginPageRegisterPrivate *priv ;
+    GtkActionGroup *action_group;
+    GtkAction *action;
+    Account *account;
+    SplitRegister *reg;
+    GNCLedgerDisplayType ledger_type;
+    int i;
 
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-	account = gnc_plugin_page_register_get_account (page);
-	action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(page));
-	gnc_plugin_update_actions(action_group, actions_requiring_account,
-				  "sensitive", account != NULL);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    account = gnc_plugin_page_register_get_account (page);
+    action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(page));
+    gnc_plugin_update_actions(action_group, actions_requiring_account,
+                              "sensitive", account != NULL);
 
-	/* Set "style" radio button */
-	ledger_type = gnc_ledger_display_type(priv->ledger);
-	gnc_plugin_update_actions(action_group, view_style_actions,
-				  "sensitive", ledger_type == LD_SINGLE);
+    /* Set "style" radio button */
+    ledger_type = gnc_ledger_display_type(priv->ledger);
+    gnc_plugin_update_actions(action_group, view_style_actions,
+                              "sensitive", ledger_type == LD_SINGLE);
 
-	reg = gnc_ledger_display_get_split_register(priv->ledger);
-	for (i = n_radio_entries_2 - 1; i > 0; i--) {
-	  DEBUG(" index %d: comparing %x to %x", i, radio_entries_2[i].value, 
-                reg->style);
-	  if (radio_entries_2[i].value == reg->style) {
-	    DEBUG("match");
-	    break;
-	  }
-	}
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    for (i = n_radio_entries_2 - 1; i > 0; i--)
+    {
+        DEBUG(" index %d: comparing %x to %x", i, radio_entries_2[i].value,
+              reg->style);
+        if (radio_entries_2[i].value == reg->style)
+        {
+            DEBUG("match");
+            break;
+        }
+    }
 
-	/* Either a match was found, or fell out with i = 0 */
-	action = gtk_action_group_get_action(action_group, radio_entries_2[i].name);
-	g_signal_handlers_block_by_func(action, gnc_plugin_page_register_cmd_style_changed, page);
-	gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
-	g_signal_handlers_unblock_by_func(action, gnc_plugin_page_register_cmd_style_changed, page);
+    /* Either a match was found, or fell out with i = 0 */
+    action = gtk_action_group_get_action(action_group, radio_entries_2[i].name);
+    g_signal_handlers_block_by_func(action, gnc_plugin_page_register_cmd_style_changed, page);
+    gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
+    g_signal_handlers_unblock_by_func(action, gnc_plugin_page_register_cmd_style_changed, page);
 
-	/* Set "double line" toggle button */
-	action = gtk_action_group_get_action (action_group,
-					      "ViewStyleDoubleLineAction");
-	g_signal_handlers_block_by_func(action, gnc_plugin_page_register_cmd_style_double_line, page);
-	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action), reg->use_double_line);
-	g_signal_handlers_unblock_by_func(action, gnc_plugin_page_register_cmd_style_double_line, page);
+    /* Set "double line" toggle button */
+    action = gtk_action_group_get_action (action_group,
+                                          "ViewStyleDoubleLineAction");
+    g_signal_handlers_block_by_func(action, gnc_plugin_page_register_cmd_style_double_line, page);
+    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action), reg->use_double_line);
+    g_signal_handlers_unblock_by_func(action, gnc_plugin_page_register_cmd_style_double_line, page);
 }
 
 
@@ -722,148 +813,158 @@
 static GtkWidget *
 gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
 {
-	GncPluginPageRegister *page;
-	GncPluginPageRegisterPrivate *priv;
-	GncWindow *gnc_window;
-	guint numRows;
-	GtkWidget *gsr;
-	SplitRegister *reg;
-	Account *acct;
+    GncPluginPageRegister *page;
+    GncPluginPageRegisterPrivate *priv;
+    GncWindow *gnc_window;
+    guint numRows;
+    GtkWidget *gsr;
+    SplitRegister *reg;
+    Account *acct;
 
-	ENTER("page %p", plugin_page);
-	page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-	if (priv->widget != NULL) {
-		LEAVE("existing widget %p", priv->widget);
-		return priv->widget;
-	}
+    ENTER("page %p", plugin_page);
+    page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    if (priv->widget != NULL)
+    {
+        LEAVE("existing widget %p", priv->widget);
+        return priv->widget;
+    }
 
-	priv->widget = gtk_vbox_new (FALSE, 0);
-	gtk_widget_show (priv->widget);
-	
-	if (priv->lines_opt_section) {
-	  numRows = gnc_gconf_get_float (priv->lines_opt_section,
-					 priv->lines_opt_name, NULL);
-	} else {
-	  numRows = priv->lines_default;
-	}
+    priv->widget = gtk_vbox_new (FALSE, 0);
+    gtk_widget_show (priv->widget);
 
-	numRows = MIN(numRows, 50);
-	gnc_window = GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window);
-	gsr = gnc_split_reg_new(priv->ledger,
-				gnc_window_get_gtk_window(gnc_window),
-				numRows, priv->read_only);
-	priv->gsr = (GNCSplitReg *)gsr;
-	gtk_widget_show (gsr);
-	gtk_box_pack_start (GTK_BOX (priv->widget), gsr, TRUE, TRUE, 0);
+    if (priv->lines_opt_section)
+    {
+        numRows = gnc_gconf_get_float (priv->lines_opt_section,
+                                       priv->lines_opt_name, NULL);
+    }
+    else
+    {
+        numRows = priv->lines_default;
+    }
 
-	g_signal_connect (G_OBJECT (gsr), "help-changed",
-			  G_CALLBACK ( gnc_plugin_page_help_changed_cb ),
-			  page );
+    numRows = MIN(numRows, 50);
+    gnc_window = GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window);
+    gsr = gnc_split_reg_new(priv->ledger,
+                            gnc_window_get_gtk_window(gnc_window),
+                            numRows, priv->read_only);
+    priv->gsr = (GNCSplitReg *)gsr;
+    gtk_widget_show (gsr);
+    gtk_box_pack_start (GTK_BOX (priv->widget), gsr, TRUE, TRUE, 0);
 
-	reg = gnc_ledger_display_get_split_register(priv->ledger);
-	gnc_split_register_config(reg, reg->type, reg->style, 
-                                  reg->use_double_line);
-	gnc_ledger_display_refresh(priv->ledger);
+    g_signal_connect (G_OBJECT (gsr), "help-changed",
+                      G_CALLBACK ( gnc_plugin_page_help_changed_cb ),
+                      page );
 
-	gnc_plugin_page_register_ui_initial_state (page);
-	gnc_plugin_page_register_ui_update (NULL, page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    gnc_split_register_config(reg, reg->type, reg->style,
+                              reg->use_double_line);
+    gnc_ledger_display_refresh(priv->ledger);
 
-	plugin_page->summarybar = gsr_create_summary_bar(priv->gsr);
-	if (plugin_page->summarybar) {
-	  gtk_widget_show_all(plugin_page->summarybar);
-	  gtk_box_pack_start(GTK_BOX (priv->widget), plugin_page->summarybar,
-			     FALSE, FALSE, 0);
-	  gnc_plugin_page_register_summarybar_position_changed(NULL, page);
-	  gnc_gconf_general_register_cb(KEY_SUMMARYBAR_POSITION,
-               gnc_plugin_page_register_summarybar_position_changed, page);
-	}
+    gnc_plugin_page_register_ui_initial_state (page);
+    gnc_plugin_page_register_ui_update (NULL, page);
 
-	priv->event_handler_id = qof_event_register_handler
-	  ((QofEventHandler)gnc_plugin_page_register_event_handler, page);
-	priv->component_manager_id =
-	  gnc_register_gui_component(GNC_PLUGIN_PAGE_REGISTER_NAME,
-				     gnc_plugin_page_register_refresh_cb,
-				     gnc_plugin_page_register_close_cb,
-				     page);
-	gnc_gui_component_set_session (priv->component_manager_id,
-				       gnc_get_current_session());
-	acct = gnc_plugin_page_register_get_account(page);
-	if (acct)
-	    gnc_gui_component_watch_entity (
-		priv->component_manager_id, xaccAccountGetGUID(acct),
-		QOF_EVENT_DESTROY | QOF_EVENT_MODIFY);
+    plugin_page->summarybar = gsr_create_summary_bar(priv->gsr);
+    if (plugin_page->summarybar)
+    {
+        gtk_widget_show_all(plugin_page->summarybar);
+        gtk_box_pack_start(GTK_BOX (priv->widget), plugin_page->summarybar,
+                           FALSE, FALSE, 0);
+        gnc_plugin_page_register_summarybar_position_changed(NULL, page);
+        gnc_gconf_general_register_cb(KEY_SUMMARYBAR_POSITION,
+                                      gnc_plugin_page_register_summarybar_position_changed, page);
+    }
 
-	gnc_split_reg_set_moved_cb
-	  (priv->gsr, (GFunc)gnc_plugin_page_register_ui_update, page);
+    priv->event_handler_id = qof_event_register_handler
+                             ((QofEventHandler)gnc_plugin_page_register_event_handler, page);
+    priv->component_manager_id =
+        gnc_register_gui_component(GNC_PLUGIN_PAGE_REGISTER_NAME,
+                                   gnc_plugin_page_register_refresh_cb,
+                                   gnc_plugin_page_register_close_cb,
+                                   page);
+    gnc_gui_component_set_session (priv->component_manager_id,
+                                   gnc_get_current_session());
+    acct = gnc_plugin_page_register_get_account(page);
+    if (acct)
+        gnc_gui_component_watch_entity (
+            priv->component_manager_id, xaccAccountGetGUID(acct),
+            QOF_EVENT_DESTROY | QOF_EVENT_MODIFY);
 
-	/* DRH - Probably lots of other stuff from regWindowLedger should end up here. */
-	LEAVE(" ");
-	return priv->widget;
+    gnc_split_reg_set_moved_cb
+    (priv->gsr, (GFunc)gnc_plugin_page_register_ui_update, page);
+
+    /* DRH - Probably lots of other stuff from regWindowLedger should end up here. */
+    LEAVE(" ");
+    return priv->widget;
 }
 
 static void
 gnc_plugin_page_register_destroy_widget (GncPluginPage *plugin_page)
 {
-	GncPluginPageRegister *page;
-	GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegister *page;
+    GncPluginPageRegisterPrivate *priv;
 
-	ENTER("page %p", plugin_page);
-	page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    ENTER("page %p", plugin_page);
+    page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 
-	gnc_gconf_general_remove_cb(KEY_SUMMARYBAR_POSITION,
-		gnc_plugin_page_register_summarybar_position_changed, page);
+    gnc_gconf_general_remove_cb(KEY_SUMMARYBAR_POSITION,
+                                gnc_plugin_page_register_summarybar_position_changed, page);
 
-	if (priv->widget == NULL)
-		return;
+    if (priv->widget == NULL)
+        return;
 
-	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;
+    }
 
-	if (priv->event_handler_id) {
-	  qof_event_unregister_handler(priv->event_handler_id);
-	  priv->event_handler_id = 0;
-	}
+    if (priv->event_handler_id)
+    {
+        qof_event_unregister_handler(priv->event_handler_id);
+        priv->event_handler_id = 0;
+    }
 
-	if (priv->sd.dialog) {
-	  gtk_widget_destroy(priv->sd.dialog);
-	  memset(&priv->sd, 0, sizeof(priv->sd));
-	}
+    if (priv->sd.dialog)
+    {
+        gtk_widget_destroy(priv->sd.dialog);
+        memset(&priv->sd, 0, sizeof(priv->sd));
+    }
 
-	if (priv->fd.dialog) {
-	  gtk_widget_destroy(priv->fd.dialog);
-	  memset(&priv->fd, 0, sizeof(priv->fd));
-	}
+    if (priv->fd.dialog)
+    {
+        gtk_widget_destroy(priv->fd.dialog);
+        memset(&priv->fd, 0, sizeof(priv->fd));
+    }
 
-	gtk_widget_hide(priv->widget);
-	gnc_ledger_display_close (priv->ledger);
-	priv->ledger = NULL;
-	LEAVE(" ");
+    gtk_widget_hide(priv->widget);
+    gnc_ledger_display_close (priv->ledger);
+    priv->ledger = NULL;
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_window_changed (GncPluginPage *plugin_page,
-					 GtkWidget *window)
+        GtkWidget *window)
 {
-	GncPluginPageRegister *page;
-	GncPluginPageRegisterPrivate *priv;
-	
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));
+    GncPluginPageRegister *page;
+    GncPluginPageRegisterPrivate *priv;
 
-	page = GNC_PLUGIN_PAGE_REGISTER(plugin_page);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-	priv->gsr->window = 
-	  GTK_WIDGET(gnc_window_get_gtk_window(GNC_WINDOW(window)));
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));
+
+    page = GNC_PLUGIN_PAGE_REGISTER(plugin_page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    priv->gsr->window =
+        GTK_WIDGET(gnc_window_get_gtk_window(GNC_WINDOW(window)));
 }
 
-static const gchar *style_names[] = {
-  "Ledger",
-  "Auto Ledger",
-  "Journal",
-  NULL
+static const gchar *style_names[] =
+{
+    "Ledger",
+    "Auto Ledger",
+    "Journal",
+    NULL
 };
 
 #define KEY_REGISTER_TYPE       "RegisterType"
@@ -888,55 +989,63 @@
  *  @param group_name The group name to use when saving data. */
 static void
 gnc_plugin_page_register_save_page (GncPluginPage *plugin_page,
-				    GKeyFile *key_file,
-				    const gchar *group_name)
+                                    GKeyFile *key_file,
+                                    const gchar *group_name)
 {
-  GncPluginPageRegister *page;
-  GncPluginPageRegisterPrivate *priv;
-  GNCLedgerDisplayType ledger_type;
-  SplitRegister *reg;
-  Account *leader;
+    GncPluginPageRegister *page;
+    GncPluginPageRegisterPrivate *priv;
+    GNCLedgerDisplayType ledger_type;
+    SplitRegister *reg;
+    Account *leader;
 
-  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
-  g_return_if_fail (key_file != NULL);
-  g_return_if_fail (group_name != NULL);
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail (key_file != NULL);
+    g_return_if_fail (group_name != NULL);
 
-  ENTER("page %p, key_file %p, group_name %s", plugin_page, key_file,
-	group_name);
+    ENTER("page %p, key_file %p, group_name %s", plugin_page, key_file,
+          group_name);
 
-  page = GNC_PLUGIN_PAGE_REGISTER(plugin_page);
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    page = GNC_PLUGIN_PAGE_REGISTER(plugin_page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 
-  reg = gnc_ledger_display_get_split_register(priv->ledger);
-  ledger_type = gnc_ledger_display_type(priv->ledger);
-  if (ledger_type > LD_GL) {
-    LEAVE("Unsupported ledger type");
-    return;
-  }
-  if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT)) {
-    const gchar *label;
-    label = (ledger_type == LD_SINGLE) ? LABEL_ACCOUNT : LABEL_SUBACCOUNT;
-    leader = gnc_ledger_display_leader(priv->ledger);
-    g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE, label);
-    g_key_file_set_string(key_file, group_name, KEY_ACCOUNT_NAME,
-			  gnc_account_get_full_name(leader));
-  } else if (reg->type == GENERAL_LEDGER) {
-    g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE,
-			  LABEL_GL);
-  } else if (reg->type == SEARCH_LEDGER) {
-    g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE,
-			  LABEL_SEARCH);
-  } else {
-    LEAVE("Unsupported register type");
-    return;
-  }
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    ledger_type = gnc_ledger_display_type(priv->ledger);
+    if (ledger_type > LD_GL)
+    {
+        LEAVE("Unsupported ledger type");
+        return;
+    }
+    if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
+    {
+        const gchar *label;
+        label = (ledger_type == LD_SINGLE) ? LABEL_ACCOUNT : LABEL_SUBACCOUNT;
+        leader = gnc_ledger_display_leader(priv->ledger);
+        g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE, label);
+        g_key_file_set_string(key_file, group_name, KEY_ACCOUNT_NAME,
+                              gnc_account_get_full_name(leader));
+    }
+    else if (reg->type == GENERAL_LEDGER)
+    {
+        g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE,
+                              LABEL_GL);
+    }
+    else if (reg->type == SEARCH_LEDGER)
+    {
+        g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE,
+                              LABEL_SEARCH);
+    }
+    else
+    {
+        LEAVE("Unsupported register type");
+        return;
+    }
 
-  g_key_file_set_string(key_file, group_name, KEY_REGISTER_STYLE,
-			style_names[reg->style]);
-  g_key_file_set_boolean(key_file, group_name, KEY_DOUBLE_LINE,
-			 reg->use_double_line);
+    g_key_file_set_string(key_file, group_name, KEY_REGISTER_STYLE,
+                          style_names[reg->style]);
+    g_key_file_set_boolean(key_file, group_name, KEY_DOUBLE_LINE,
+                           reg->use_double_line);
 
-  LEAVE(" ");
+    LEAVE(" ");
 }
 
 
@@ -954,45 +1063,48 @@
  *  @param group_name The group name to use when restoring data. */
 static void
 gnc_plugin_page_register_restore_edit_menu (GncPluginPage *page,
-					    GKeyFile *key_file,
-					    const gchar *group_name)
+        GKeyFile *key_file,
+        const gchar *group_name)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GtkAction *action;
-  GError *error = NULL;
-  gchar *style_name;
-  gint i;
-  gboolean use_double_line;
+    GncPluginPageRegisterPrivate *priv;
+    GtkAction *action;
+    GError *error = NULL;
+    gchar *style_name;
+    gint i;
+    gboolean use_double_line;
 
-  ENTER(" ");
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    ENTER(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 
-  /* Convert the style name to an index */
-  style_name = g_key_file_get_string(key_file, group_name,
-				     KEY_REGISTER_STYLE, &error);
-  for (i = 0 ; style_names[i]; i++) {
-    if (g_ascii_strcasecmp(style_name, style_names[i]) == 0) {
-      DEBUG("Found match for style name: %s", style_name);
-      break;
+    /* Convert the style name to an index */
+    style_name = g_key_file_get_string(key_file, group_name,
+                                       KEY_REGISTER_STYLE, &error);
+    for (i = 0 ; style_names[i]; i++)
+    {
+        if (g_ascii_strcasecmp(style_name, style_names[i]) == 0)
+        {
+            DEBUG("Found match for style name: %s", style_name);
+            break;
+        }
     }
-  }
-  g_free(style_name);
+    g_free(style_name);
 
-  /* Update the style menu action for this page */
-  if (i <= REG_STYLE_JOURNAL) {
-    DEBUG("Setting style: %d", i);
-    action = gnc_plugin_page_get_action(page, radio_entries_2[i].name);
-    gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
-  }
+    /* Update the style menu action for this page */
+    if (i <= REG_STYLE_JOURNAL)
+    {
+        DEBUG("Setting style: %d", i);
+        action = gnc_plugin_page_get_action(page, radio_entries_2[i].name);
+        gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
+    }
 
-  /* Update the  double line action on this page */
-  use_double_line =
-    g_key_file_get_boolean(key_file, group_name, KEY_DOUBLE_LINE, &error);
-  DEBUG("Setting double_line_mode: %d", use_double_line);
-  action = gnc_plugin_page_get_action(page, "ViewStyleDoubleLineAction");
-  gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), use_double_line);
+    /* Update the  double line action on this page */
+    use_double_line =
+        g_key_file_get_boolean(key_file, group_name, KEY_DOUBLE_LINE, &error);
+    DEBUG("Setting double_line_mode: %d", use_double_line);
+    action = gnc_plugin_page_get_action(page, "ViewStyleDoubleLineAction");
+    gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), use_double_line);
 
-  LEAVE(" ");
+    LEAVE(" ");
 }
 
 
@@ -1007,59 +1119,65 @@
  *  @param group_name The group name to use when restoring data. */
 static GncPluginPage *
 gnc_plugin_page_register_recreate_page (GtkWidget *window,
-					GKeyFile *key_file,
-					const gchar *group_name)
+                                        GKeyFile *key_file,
+                                        const gchar *group_name)
 {
-  GncPluginPage *page;
-  GError *error = NULL;
-  gchar *reg_type, *acct_name;
-  Account *account;
-  QofBook *book;
-  gboolean include_subs;
+    GncPluginPage *page;
+    GError *error = NULL;
+    gchar *reg_type, *acct_name;
+    Account *account;
+    QofBook *book;
+    gboolean include_subs;
 
-  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);
+    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);
 
-  /* Create the new page. */
-  reg_type = g_key_file_get_string(key_file, group_name,
-					 KEY_REGISTER_TYPE, &error);
-  DEBUG("Page type: %s", reg_type);
-  if ((g_ascii_strcasecmp(reg_type, LABEL_ACCOUNT) == 0) ||
-      (g_ascii_strcasecmp(reg_type, LABEL_SUBACCOUNT) == 0)) {
-    include_subs = (g_ascii_strcasecmp(reg_type, LABEL_SUBACCOUNT) == 0);
-    DEBUG("Include subs: %d", include_subs);
-    acct_name = g_key_file_get_string(key_file, group_name,
-				      KEY_ACCOUNT_NAME, &error);
-    book = qof_session_get_book(gnc_get_current_session());
-    account = gnc_account_lookup_by_full_name(gnc_book_get_root_account(book),
-					      acct_name);
-    g_free(acct_name);
-    if (account == NULL) {
-      LEAVE("Bad account name");
-      g_free(reg_type);
-      return NULL;
+    /* Create the new page. */
+    reg_type = g_key_file_get_string(key_file, group_name,
+                                     KEY_REGISTER_TYPE, &error);
+    DEBUG("Page type: %s", reg_type);
+    if ((g_ascii_strcasecmp(reg_type, LABEL_ACCOUNT) == 0) ||
+            (g_ascii_strcasecmp(reg_type, LABEL_SUBACCOUNT) == 0))
+    {
+        include_subs = (g_ascii_strcasecmp(reg_type, LABEL_SUBACCOUNT) == 0);
+        DEBUG("Include subs: %d", include_subs);
+        acct_name = g_key_file_get_string(key_file, group_name,
+                                          KEY_ACCOUNT_NAME, &error);
+        book = qof_session_get_book(gnc_get_current_session());
+        account = gnc_account_lookup_by_full_name(gnc_book_get_root_account(book),
+                  acct_name);
+        g_free(acct_name);
+        if (account == NULL)
+        {
+            LEAVE("Bad account name");
+            g_free(reg_type);
+            return NULL;
+        }
+        page = gnc_plugin_page_register_new (account, include_subs);
     }
-    page = gnc_plugin_page_register_new (account, include_subs);
-  } else if (g_ascii_strcasecmp(reg_type, LABEL_GL) == 0) {
-    page = gnc_plugin_page_register_new_gl();
-  } else {
-    LEAVE("Bad ledger type");
+    else if (g_ascii_strcasecmp(reg_type, LABEL_GL) == 0)
+    {
+        page = gnc_plugin_page_register_new_gl();
+    }
+    else
+    {
+        LEAVE("Bad ledger type");
+        g_free(reg_type);
+        return NULL;
+    }
     g_free(reg_type);
-    return NULL;
-  }
-  g_free(reg_type);
 
-  /* Recreate page in given window */
-  gnc_plugin_page_set_use_new_window(page, FALSE);
+    /* Recreate page in given window */
+    gnc_plugin_page_set_use_new_window(page, FALSE);
 
-  /* Install it now so we can them manipulate the created widget */
-  gnc_main_window_open_page(GNC_MAIN_WINDOW(window), page);
+    /* Install it now so we can them manipulate the created widget */
+    gnc_main_window_open_page(GNC_MAIN_WINDOW(window), page);
 
-  /* Now update the page to the last state it was in */
-  gnc_plugin_page_register_restore_edit_menu(page, key_file, group_name);
-  LEAVE(" ");
-  return page;
+    /* Now update the page to the last state it was in */
+    gnc_plugin_page_register_restore_edit_menu(page, key_file, group_name);
+    LEAVE(" ");
+    return page;
 }
 
 
@@ -1069,223 +1187,229 @@
 static void
 gnc_plugin_page_register_update_edit_menu (GncPluginPage *page, gboolean hide)
 {
-	GncPluginPageRegisterPrivate *priv;
-	GncPluginPageRegister *reg_page;
-	GtkAction *action;
-	gboolean can_copy = FALSE, can_cut = FALSE, can_paste = FALSE;
-	gboolean has_selection;
+    GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegister *reg_page;
+    GtkAction *action;
+    gboolean can_copy = FALSE, can_cut = FALSE, can_paste = FALSE;
+    gboolean has_selection;
 
-	reg_page = GNC_PLUGIN_PAGE_REGISTER(page);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(reg_page);
-	has_selection = gnucash_register_has_selection (priv->gsr->reg);
+    reg_page = GNC_PLUGIN_PAGE_REGISTER(page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(reg_page);
+    has_selection = gnucash_register_has_selection (priv->gsr->reg);
 
-	can_copy = has_selection;
-	can_cut = has_selection;
-	can_paste = TRUE;
+    can_copy = has_selection;
+    can_cut = has_selection;
+    can_paste = TRUE;
 
-	action = gnc_plugin_page_get_action (page, "EditCopyAction");
-	gtk_action_set_sensitive (action, can_copy);
-	gtk_action_set_visible (action, !hide || can_copy);
-	action = gnc_plugin_page_get_action (page, "EditCutAction");
-	gtk_action_set_sensitive (action, can_cut);
-	gtk_action_set_visible (action, !hide || can_cut);
-	action = gnc_plugin_page_get_action (page, "EditPasteAction");
-	gtk_action_set_sensitive (action, can_paste);
-	gtk_action_set_visible (action,  !hide || can_paste);
+    action = gnc_plugin_page_get_action (page, "EditCopyAction");
+    gtk_action_set_sensitive (action, can_copy);
+    gtk_action_set_visible (action, !hide || can_copy);
+    action = gnc_plugin_page_get_action (page, "EditCutAction");
+    gtk_action_set_sensitive (action, can_cut);
+    gtk_action_set_visible (action, !hide || can_cut);
+    action = gnc_plugin_page_get_action (page, "EditPasteAction");
+    gtk_action_set_sensitive (action, can_paste);
+    gtk_action_set_visible (action,  !hide || can_paste);
 }
 
 
 static gboolean
 gnc_plugin_page_register_finish_pending (GncPluginPage *page)
 {
-	GncPluginPageRegisterPrivate *priv;
-	GncPluginPageRegister *reg_page;
-	SplitRegister *reg;
-	GtkWidget *dialog, *window;
-	const gchar *name;
-	gint response;
+    GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegister *reg_page;
+    SplitRegister *reg;
+    GtkWidget *dialog, *window;
+    const gchar *name;
+    gint response;
 
-	reg_page = GNC_PLUGIN_PAGE_REGISTER(page);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(reg_page);
-	reg = gnc_ledger_display_get_split_register(priv->ledger);
+    reg_page = GNC_PLUGIN_PAGE_REGISTER(page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(reg_page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
 
-	if (!reg || !gnc_split_register_changed(reg))
-	  return TRUE;
+    if (!reg || !gnc_split_register_changed(reg))
+        return TRUE;
 
-	name = gnc_plugin_page_register_get_tab_name(page);
-	window = gnc_plugin_page_get_window(page);
-	dialog = gtk_message_dialog_new(GTK_WINDOW(window),
-					GTK_DIALOG_DESTROY_WITH_PARENT,
-					GTK_MESSAGE_WARNING,
-					GTK_BUTTONS_NONE,
-					/* Translators: %s is the name
-					   of the tab page */
-					_("Save changes to %s?"), name);
-	gtk_message_dialog_format_secondary_text
-	  (GTK_MESSAGE_DIALOG(dialog),
-	   "%s",
-	   _("This register has pending changes to a transaction.  "
-	     "Would you like to save the changes to this transaction, "
-	     "discard the transaction, or cancel the operation?"));
-	gnc_gtk_dialog_add_button(dialog, _("_Discard Transaction"),
-				  GTK_STOCK_DELETE, GTK_RESPONSE_REJECT);
-	gtk_dialog_add_button(GTK_DIALOG(dialog),
-			      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-	gnc_gtk_dialog_add_button(dialog, _("_Save Transaction"),
-				  GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT);
+    name = gnc_plugin_page_register_get_tab_name(page);
+    window = gnc_plugin_page_get_window(page);
+    dialog = gtk_message_dialog_new(GTK_WINDOW(window),
+                                    GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_WARNING,
+                                    GTK_BUTTONS_NONE,
+                                    /* Translators: %s is the name
+                                       of the tab page */
+                                    _("Save changes to %s?"), name);
+    gtk_message_dialog_format_secondary_text
+    (GTK_MESSAGE_DIALOG(dialog),
+     "%s",
+     _("This register has pending changes to a transaction.  "
+       "Would you like to save the changes to this transaction, "
+       "discard the transaction, or cancel the operation?"));
+    gnc_gtk_dialog_add_button(dialog, _("_Discard Transaction"),
+                              GTK_STOCK_DELETE, GTK_RESPONSE_REJECT);
+    gtk_dialog_add_button(GTK_DIALOG(dialog),
+                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+    gnc_gtk_dialog_add_button(dialog, _("_Save Transaction"),
+                              GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT);
 
-	response = gtk_dialog_run(GTK_DIALOG(dialog));
-	gtk_widget_destroy(dialog);
+    response = gtk_dialog_run(GTK_DIALOG(dialog));
+    gtk_widget_destroy(dialog);
 
-	switch (response) {
-	  case GTK_RESPONSE_ACCEPT:
-	    gnc_split_register_save(reg, TRUE);
-	    return TRUE;
+    switch (response)
+    {
+    case GTK_RESPONSE_ACCEPT:
+        gnc_split_register_save(reg, TRUE);
+        return TRUE;
 
-	  case GTK_RESPONSE_REJECT:
-	    gnc_split_register_cancel_cursor_trans_changes(reg);
-	    gnc_split_register_save (reg, TRUE);
-	    return TRUE;
+    case GTK_RESPONSE_REJECT:
+        gnc_split_register_cancel_cursor_trans_changes(reg);
+        gnc_split_register_save (reg, TRUE);
+        return TRUE;
 
-	  default:
-	    return FALSE;
-	}
+    default:
+        return FALSE;
+    }
 }
 
 
 static gchar *
 gnc_plugin_page_register_get_tab_name (GncPluginPage *plugin_page)
 {
-	GncPluginPageRegisterPrivate *priv;
-	GNCLedgerDisplayType ledger_type;
-  	GNCLedgerDisplay *ld;
-	SplitRegister *reg;
-	Account *leader;
+    GncPluginPageRegisterPrivate *priv;
+    GNCLedgerDisplayType ledger_type;
+    GNCLedgerDisplay *ld;
+    SplitRegister *reg;
+    Account *leader;
 
-	g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
+    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
 
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-	ld = priv->ledger;
-	reg = gnc_ledger_display_get_split_register (ld);
-	ledger_type = gnc_ledger_display_type (ld);
-	leader = gnc_ledger_display_leader (ld);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    ld = priv->ledger;
+    reg = gnc_ledger_display_get_split_register (ld);
+    ledger_type = gnc_ledger_display_type (ld);
+    leader = gnc_ledger_display_leader (ld);
 
-	switch (ledger_type) {
-	 case LD_SINGLE:
-	  return g_strdup(xaccAccountGetName (leader));
+    switch (ledger_type)
+    {
+    case LD_SINGLE:
+        return g_strdup(xaccAccountGetName (leader));
 
-	 case LD_SUBACCOUNT:
-	  return g_strdup_printf("%s+", xaccAccountGetName (leader));
+    case LD_SUBACCOUNT:
+        return g_strdup_printf("%s+", xaccAccountGetName (leader));
 
-	 case LD_GL:
-	  switch (reg->type) {
-	   case GENERAL_LEDGER:
-	   case INCOME_LEDGER:
-	    return g_strdup(_("General Ledger"));
-	   case PORTFOLIO_LEDGER:
-	    return g_strdup(_("Portfolio"));
-	   case SEARCH_LEDGER:
-	    return g_strdup(_("Search Results"));
-	   default:
-	    break;
-	  }
+    case LD_GL:
+        switch (reg->type)
+        {
+        case GENERAL_LEDGER:
+        case INCOME_LEDGER:
+            return g_strdup(_("General Ledger"));
+        case PORTFOLIO_LEDGER:
+            return g_strdup(_("Portfolio"));
+        case SEARCH_LEDGER:
+            return g_strdup(_("Search Results"));
+        default:
+            break;
+        }
 
-	 default:
-	  break;
-	}
+    default:
+        break;
+    }
 
-	return g_strdup(_("unknown"));
+    return g_strdup(_("unknown"));
 }
 
 static gchar *
 gnc_plugin_page_register_get_tab_color (GncPluginPage *plugin_page)
 {
-	GncPluginPageRegisterPrivate *priv;
-	GNCLedgerDisplayType ledger_type;
-  	GNCLedgerDisplay *ld;
-	SplitRegister *reg;
-	Account *leader;
+    GncPluginPageRegisterPrivate *priv;
+    GNCLedgerDisplayType ledger_type;
+    GNCLedgerDisplay *ld;
+    SplitRegister *reg;
+    Account *leader;
 
-	g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
+    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
 
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-	ld = priv->ledger;
-	reg = gnc_ledger_display_get_split_register (ld);
-	ledger_type = gnc_ledger_display_type (ld);
-	leader = gnc_ledger_display_leader (ld);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    ld = priv->ledger;
+    reg = gnc_ledger_display_get_split_register (ld);
+    ledger_type = gnc_ledger_display_type (ld);
+    leader = gnc_ledger_display_leader (ld);
 
-	switch (ledger_type) {
-	 case LD_SINGLE:
-	  return g_strdup(xaccAccountGetColor (leader));
+    switch (ledger_type)
+    {
+    case LD_SINGLE:
+        return g_strdup(xaccAccountGetColor (leader));
 
-	 case LD_SUBACCOUNT:
-	  return g_strdup_printf("%s+", xaccAccountGetColor (leader));
+    case LD_SUBACCOUNT:
+        return g_strdup_printf("%s+", xaccAccountGetColor (leader));
 
-	 default:
-	  break;
-	}
+    default:
+        break;
+    }
 
-	return g_strdup("Not Set");
+    return g_strdup("Not Set");
 }
 
 static gchar *
 gnc_plugin_page_register_get_long_name (GncPluginPage *plugin_page)
 {
-	GncPluginPageRegisterPrivate *priv;
-	GNCLedgerDisplayType ledger_type;
-  	GNCLedgerDisplay *ld;
-	SplitRegister *reg;
-	Account *leader;
+    GncPluginPageRegisterPrivate *priv;
+    GNCLedgerDisplayType ledger_type;
+    GNCLedgerDisplay *ld;
+    SplitRegister *reg;
+    Account *leader;
 
-	g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
+    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
 
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-	ld = priv->ledger;
-	reg = gnc_ledger_display_get_split_register (ld);
-	ledger_type = gnc_ledger_display_type (ld);
-	leader = gnc_ledger_display_leader (ld);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    ld = priv->ledger;
+    reg = gnc_ledger_display_get_split_register (ld);
+    ledger_type = gnc_ledger_display_type (ld);
+    leader = gnc_ledger_display_leader (ld);
 
-	switch (ledger_type) {
-	 case LD_SINGLE:
-	  return g_strdup(gnc_account_get_full_name (leader));
+    switch (ledger_type)
+    {
+    case LD_SINGLE:
+        return g_strdup(gnc_account_get_full_name (leader));
 
-	 case LD_SUBACCOUNT:
-	  return g_strdup_printf("%s+", gnc_account_get_full_name (leader));
+    case LD_SUBACCOUNT:
+        return g_strdup_printf("%s+", gnc_account_get_full_name (leader));
 
-	 default:
-	  break;
-	}
+    default:
+        break;
+    }
 
-        return NULL;
+    return NULL;
 }
 
 static void
 gnc_plugin_page_register_summarybar_position_changed(GConfEntry *entry,
-						     gpointer user_data)
+        gpointer user_data)
 {
-	GncPluginPage *plugin_page;
-	GncPluginPageRegister *page;
-	GncPluginPageRegisterPrivate *priv;
-	GtkPositionType position = GTK_POS_BOTTOM;
-	gchar *conf_string;
-	
-	g_return_if_fail(user_data != NULL);
-	
-	plugin_page = GNC_PLUGIN_PAGE(user_data);
-	page = GNC_PLUGIN_PAGE_REGISTER (user_data);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-	
-	conf_string = gnc_gconf_get_string (GCONF_GENERAL,
-					    KEY_SUMMARYBAR_POSITION, NULL);
-	if (conf_string) {
-		position = gnc_enum_from_nick (GTK_TYPE_POSITION_TYPE,
-					       conf_string, GTK_POS_BOTTOM);
-		g_free (conf_string);
-	}
+    GncPluginPage *plugin_page;
+    GncPluginPageRegister *page;
+    GncPluginPageRegisterPrivate *priv;
+    GtkPositionType position = GTK_POS_BOTTOM;
+    gchar *conf_string;
 
-	gtk_box_reorder_child(GTK_BOX(priv->widget),
-			      plugin_page->summarybar,
-			      (position == GTK_POS_TOP ? 0 : -1) );
+    g_return_if_fail(user_data != NULL);
+
+    plugin_page = GNC_PLUGIN_PAGE(user_data);
+    page = GNC_PLUGIN_PAGE_REGISTER (user_data);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+
+    conf_string = gnc_gconf_get_string (GCONF_GENERAL,
+                                        KEY_SUMMARYBAR_POSITION, NULL);
+    if (conf_string)
+    {
+        position = gnc_enum_from_nick (GTK_TYPE_POSITION_TYPE,
+                                       conf_string, GTK_POS_BOTTOM);
+        g_free (conf_string);
+    }
+
+    gtk_box_reorder_child(GTK_BOX(priv->widget),
+                          plugin_page->summarybar,
+                          (position == GTK_POS_TOP ? 0 : -1) );
 }
 
 /************************************************************/
@@ -1305,27 +1429,28 @@
  */
 void
 gnc_plugin_page_register_sort_response_cb (GtkDialog *dialog,
-					   gint response,
-					   GncPluginPageRegister *page)
+        gint response,
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  g_return_if_fail(GTK_IS_DIALOG(dialog));
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GTK_IS_DIALOG(dialog));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER(" ");
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  if (response != GTK_RESPONSE_OK) {
-    /* Restore the original sort order */
-    gnc_split_reg_set_sort_type(priv->gsr, priv->sd.original_sort_type);
-  }
-  priv->sd.dialog = NULL;
-  gtk_widget_destroy(GTK_WIDGET(dialog));
-  LEAVE(" ");
+    ENTER(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    if (response != GTK_RESPONSE_OK)
+    {
+        /* Restore the original sort order */
+        gnc_split_reg_set_sort_type(priv->gsr, priv->sd.original_sort_type);
+    }
+    priv->sd.dialog = NULL;
+    gtk_widget_destroy(GTK_WIDGET(dialog));
+    LEAVE(" ");
 }
 
 
-/** This function is called when a radio button in the "Sort By..." 
+/** This function is called when a radio button in the "Sort By..."
  *  dialog is clicked.
  *
  *  @param button The button that was toggled.
@@ -1335,21 +1460,21 @@
  */
 void
 gnc_plugin_page_register_sort_button_cb (GtkToggleButton *button,
-					 GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  const gchar *name;
-  SortType type;
+    GncPluginPageRegisterPrivate *priv;
+    const gchar *name;
+    SortType type;
 
-  g_return_if_fail(GTK_IS_TOGGLE_BUTTON(button));
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GTK_IS_TOGGLE_BUTTON(button));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  name = gtk_widget_get_name(GTK_WIDGET(button));
-  ENTER("button %s(%p), page %p", name, button, page);
-  type = SortTypefromString(name);
-  gnc_split_reg_set_sort_type(priv->gsr, type);
-  LEAVE(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    name = gtk_widget_get_name(GTK_WIDGET(button));
+    ENTER("button %s(%p), page %p", name, button, page);
+    type = SortTypefromString(name);
+    gnc_split_reg_set_sort_type(priv->gsr, type);
+    LEAVE(" ");
 }
 
 /************************************************************/
@@ -1371,31 +1496,33 @@
 static void
 gnc_ppr_update_status_query (GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GSList *param_list;
-  Query *query;
+    GncPluginPageRegisterPrivate *priv;
+    GSList *param_list;
+    Query *query;
 
-  ENTER(" ");
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  query = gnc_ledger_display_get_query( priv->ledger );
-  if (!query) {
-    LEAVE("no query found");
-    return;
-  }
+    ENTER(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    query = gnc_ledger_display_get_query( priv->ledger );
+    if (!query)
+    {
+        LEAVE("no query found");
+        return;
+    }
 
-  /* Remove the old status match */
-  param_list = gncQueryBuildParamList (SPLIT_RECONCILE, NULL);
-  if (param_list) {
-    gncQueryPurgeTerms (query, param_list);
-    g_slist_free(param_list);
-  }
+    /* Remove the old status match */
+    param_list = gncQueryBuildParamList (SPLIT_RECONCILE, NULL);
+    if (param_list)
+    {
+        gncQueryPurgeTerms (query, param_list);
+        g_slist_free(param_list);
+    }
 
-  /* Install the new status match */
-  if (priv->fd.cleared_match != CLEARED_ALL)
-    xaccQueryAddClearedMatch(query, priv->fd.cleared_match, QUERY_AND);
+    /* Install the new status match */
+    if (priv->fd.cleared_match != CLEARED_ALL)
+        xaccQueryAddClearedMatch(query, priv->fd.cleared_match, QUERY_AND);
 
-  gnc_ledger_display_refresh (priv->ledger);
-  LEAVE(" ");
+    gnc_ledger_display_refresh (priv->ledger);
+    LEAVE(" ");
 }
 
 
@@ -1414,40 +1541,44 @@
 static void
 gnc_ppr_update_date_query (GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GSList *param_list;
-  Query *query;
+    GncPluginPageRegisterPrivate *priv;
+    GSList *param_list;
+    Query *query;
 
-  ENTER(" ");
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  if (!priv->ledger) {
-    LEAVE("no ledger");
-    return;
-  }
+    ENTER(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    if (!priv->ledger)
+    {
+        LEAVE("no ledger");
+        return;
+    }
 
-  query = gnc_ledger_display_get_query( priv->ledger );
-  if (!query) {
-    LEAVE("no query");
-    return;
-  }
+    query = gnc_ledger_display_get_query( priv->ledger );
+    if (!query)
+    {
+        LEAVE("no query");
+        return;
+    }
 
-  /* Delete any existing old date spec. */
-  param_list = gncQueryBuildParamList(SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
-  if (param_list) {
-    gncQueryPurgeTerms (query, param_list);
-    g_slist_free(param_list);
-  }
+    /* Delete any existing old date spec. */
+    param_list = gncQueryBuildParamList(SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
+    if (param_list)
+    {
+        gncQueryPurgeTerms (query, param_list);
+        g_slist_free(param_list);
+    }
 
-  if (priv->fd.start_time || priv->fd.end_time) {
-    /* Build a new spec */
-    xaccQueryAddDateMatchTT(query,
-			    priv->fd.start_time != 0, priv->fd.start_time,
-			    priv->fd.end_time != 0,   priv->fd.end_time,
-			    QUERY_AND);
-  }
+    if (priv->fd.start_time || priv->fd.end_time)
+    {
+        /* Build a new spec */
+        xaccQueryAddDateMatchTT(query,
+                                priv->fd.start_time != 0, priv->fd.start_time,
+                                priv->fd.end_time != 0,   priv->fd.end_time,
+                                QUERY_AND);
+    }
 
-  gnc_ledger_display_refresh (priv->ledger);
-  LEAVE(" ");
+    gnc_ledger_display_refresh (priv->ledger);
+    LEAVE(" ");
 }
 
 
@@ -1463,35 +1594,37 @@
  */
 void
 gnc_plugin_page_register_filter_status_one_cb (GtkToggleButton *button,
-					       GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  const gchar *name;
-  gint i, value;
+    GncPluginPageRegisterPrivate *priv;
+    const gchar *name;
+    gint i, value;
 
-  g_return_if_fail(GTK_IS_CHECK_BUTTON(button));
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GTK_IS_CHECK_BUTTON(button));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  name = gtk_widget_get_name(GTK_WIDGET(button));
-  ENTER("toggle button %s (%p), plugin_page %p", name, button, page);
+    name = gtk_widget_get_name(GTK_WIDGET(button));
+    ENTER("toggle button %s (%p), plugin_page %p", name, button, page);
 
-  /* Determine what status bit to change */
-  value = CLEARED_NONE;
-  for (i = 0; status_actions[i].action_name; i++) {
-    if (strcmp(name, status_actions[i].action_name) == 0) {
-      value = status_actions[i].value;
-      break;
+    /* Determine what status bit to change */
+    value = CLEARED_NONE;
+    for (i = 0; status_actions[i].action_name; i++)
+    {
+        if (strcmp(name, status_actions[i].action_name) == 0)
+        {
+            value = status_actions[i].value;
+            break;
+        }
     }
-  }
 
-  /* Compute the new match status */
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  if (gtk_toggle_button_get_active(button))
-    priv->fd.cleared_match |= value;
-  else
-    priv->fd.cleared_match &= ~value;
-  gnc_ppr_update_status_query(page);
-  LEAVE(" ");
+    /* Compute the new match status */
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    if (gtk_toggle_button_get_active(button))
+        priv->fd.cleared_match |= value;
+    else
+        priv->fd.cleared_match &= ~value;
+    gnc_ppr_update_status_query(page);
+    LEAVE(" ");
 }
 
 
@@ -1506,31 +1639,32 @@
  */
 void
 gnc_plugin_page_register_filter_status_all_cb (GtkButton *button,
-					       GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GtkWidget *widget;
-  gint i;
+    GncPluginPageRegisterPrivate *priv;
+    GtkWidget *widget;
+    gint i;
 
-  g_return_if_fail(GTK_IS_BUTTON(button));
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GTK_IS_BUTTON(button));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(button %p, page %p)", button, page);
+    ENTER("(button %p, page %p)", button, page);
 
-  /* Turn on all the check menu items */
-  for (i = 0; status_actions[i].action_name; i++) {
-    widget = gnc_glade_lookup_widget(GTK_WIDGET(button),
-				     status_actions[i].action_name);
-    g_signal_handlers_block_by_func(widget, gnc_plugin_page_register_filter_status_one_cb, page);
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), TRUE);
-    g_signal_handlers_unblock_by_func(widget, gnc_plugin_page_register_filter_status_one_cb, page);
-  }
+    /* Turn on all the check menu items */
+    for (i = 0; status_actions[i].action_name; i++)
+    {
+        widget = gnc_glade_lookup_widget(GTK_WIDGET(button),
+                                         status_actions[i].action_name);
+        g_signal_handlers_block_by_func(widget, gnc_plugin_page_register_filter_status_one_cb, page);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), TRUE);
+        g_signal_handlers_unblock_by_func(widget, gnc_plugin_page_register_filter_status_one_cb, page);
+    }
 
-  /* Set the requested status */
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  priv->fd.cleared_match = CLEARED_ALL;
-  gnc_ppr_update_status_query(page);
-  LEAVE(" ");
+    /* Set the requested status */
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    priv->fd.cleared_match = CLEARED_ALL;
+    gnc_ppr_update_status_query(page);
+    LEAVE(" ");
 }
 
 
@@ -1548,40 +1682,52 @@
 static void
 get_filter_times(GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GtkWidget *button, *today, *gde;
-  time_t time_val;
+    GncPluginPageRegisterPrivate *priv;
+    GtkWidget *button, *today, *gde;
+    time_t time_val;
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  button = gnc_glade_lookup_widget(priv->fd.dialog, "start_date_choose");
-  if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) {
-    gde = gnc_glade_lookup_widget(button, "start_date");
-    time_val = gnc_date_edit_get_date(GNC_DATE_EDIT(gde));
-    time_val = gnc_timet_get_day_start(time_val);
-    priv->fd.start_time = time_val;
-  } else {
-    today = gnc_glade_lookup_widget(priv->fd.dialog, "start_date_today");
-    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(today))) {
-      priv->fd.start_time = gnc_timet_get_today_start();
-    } else {
-      priv->fd.start_time = 0;
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    button = gnc_glade_lookup_widget(priv->fd.dialog, "start_date_choose");
+    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
+    {
+        gde = gnc_glade_lookup_widget(button, "start_date");
+        time_val = gnc_date_edit_get_date(GNC_DATE_EDIT(gde));
+        time_val = gnc_timet_get_day_start(time_val);
+        priv->fd.start_time = time_val;
     }
-  }
+    else
+    {
+        today = gnc_glade_lookup_widget(priv->fd.dialog, "start_date_today");
+        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(today)))
+        {
+            priv->fd.start_time = gnc_timet_get_today_start();
+        }
+        else
+        {
+            priv->fd.start_time = 0;
+        }
+    }
 
-  button = gnc_glade_lookup_widget(priv->fd.dialog, "end_date_choose");
-  if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) {
-    gde = gnc_glade_lookup_widget(button, "end_date");
-    time_val = gnc_date_edit_get_date(GNC_DATE_EDIT(gde));
-    time_val = gnc_timet_get_day_end(time_val);
-    priv->fd.end_time = time_val;
-  } else {
-    today = gnc_glade_lookup_widget(priv->fd.dialog, "end_date_today");
-    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(today))) {
-      priv->fd.end_time = gnc_timet_get_today_end();
-    } else {
-      priv->fd.end_time = 0;
+    button = gnc_glade_lookup_widget(priv->fd.dialog, "end_date_choose");
+    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
+    {
+        gde = gnc_glade_lookup_widget(button, "end_date");
+        time_val = gnc_date_edit_get_date(GNC_DATE_EDIT(gde));
+        time_val = gnc_timet_get_day_end(time_val);
+        priv->fd.end_time = time_val;
     }
-  }
+    else
+    {
+        today = gnc_glade_lookup_widget(priv->fd.dialog, "end_date_today");
+        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(today)))
+        {
+            priv->fd.end_time = gnc_timet_get_today_end();
+        }
+        else
+        {
+            priv->fd.end_time = 0;
+        }
+    }
 }
 
 
@@ -1602,28 +1748,31 @@
  */
 void
 gnc_plugin_page_register_filter_select_range_cb (GtkRadioButton *button,
-						 GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GtkWidget *table;
-  gboolean active;
+    GncPluginPageRegisterPrivate *priv;
+    GtkWidget *table;
+    gboolean active;
 
-  g_return_if_fail(GTK_IS_RADIO_BUTTON(button));
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GTK_IS_RADIO_BUTTON(button));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(button %p, page %p)", button, page);
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  table = gnc_glade_lookup_widget(GTK_WIDGET(button), "select_range_table");
-  active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
-  gtk_widget_set_sensitive(table, active);
-  if (active) {
-    get_filter_times(page);
-  } else {
-    priv->fd.start_time = 0;
-    priv->fd.end_time = 0;
-  }
-  gnc_ppr_update_date_query(page);
-  LEAVE(" ");
+    ENTER("(button %p, page %p)", button, page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    table = gnc_glade_lookup_widget(GTK_WIDGET(button), "select_range_table");
+    active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
+    gtk_widget_set_sensitive(table, active);
+    if (active)
+    {
+        get_filter_times(page);
+    }
+    else
+    {
+        priv->fd.start_time = 0;
+        priv->fd.end_time = 0;
+    }
+    gnc_ppr_update_date_query(page);
+    LEAVE(" ");
 }
 
 
@@ -1639,14 +1788,14 @@
  */
 static void
 gnc_plugin_page_register_filter_gde_changed_cb (GtkWidget *unused,
-						GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(widget %s(%p), page %p)", gtk_widget_get_name(unused), unused, page);
-  get_filter_times(page);
-  gnc_ppr_update_date_query(page);
-  LEAVE(" ");
+    ENTER("(widget %s(%p), page %p)", gtk_widget_get_name(unused), unused, page);
+    get_filter_times(page);
+    gnc_ppr_update_date_query(page);
+    LEAVE(" ");
 }
 
 
@@ -1671,28 +1820,29 @@
  */
 void
 gnc_plugin_page_register_filter_start_cb (GtkWidget *radio,
-					  GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GtkWidget *widget, *gde;
-  gboolean active;
+    GtkWidget *widget, *gde;
+    gboolean active;
 
-  g_return_if_fail(GTK_IS_RADIO_BUTTON(radio));
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GTK_IS_RADIO_BUTTON(radio));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(radio %s(%p), page %p)", gtk_widget_get_name(radio), radio, page);
-  if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio))) {
-    LEAVE("1st callback of pair. Defer to 2nd callback.");
-    return;
-  }
+    ENTER("(radio %s(%p), page %p)", gtk_widget_get_name(radio), radio, page);
+    if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio)))
+    {
+        LEAVE("1st callback of pair. Defer to 2nd callback.");
+        return;
+    }
 
-  widget = gnc_glade_lookup_widget(radio, "start_date_choose");
-  active = (widget == radio);
-  gde = gnc_glade_lookup_widget(radio, "start_date");
-  gtk_widget_set_sensitive(gde, active);
+    widget = gnc_glade_lookup_widget(radio, "start_date_choose");
+    active = (widget == radio);
+    gde = gnc_glade_lookup_widget(radio, "start_date");
+    gtk_widget_set_sensitive(gde, active);
 
-  get_filter_times(page);
-  gnc_ppr_update_date_query(page);
-  LEAVE(" ");
+    get_filter_times(page);
+    gnc_ppr_update_date_query(page);
+    LEAVE(" ");
 }
 
 
@@ -1717,28 +1867,29 @@
  */
 void
 gnc_plugin_page_register_filter_end_cb (GtkWidget *radio,
-					GncPluginPageRegister *page)
+                                        GncPluginPageRegister *page)
 {
-  GtkWidget *widget, *gde;
-  gboolean active;
+    GtkWidget *widget, *gde;
+    gboolean active;
 
-  g_return_if_fail(GTK_IS_RADIO_BUTTON(radio));
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GTK_IS_RADIO_BUTTON(radio));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(radio %s(%p), page %p)", gtk_widget_get_name(radio), radio, page);
-  if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio))) {
-    LEAVE("1st callback of pair. Defer to 2nd callback.");
-    return;
-  }
+    ENTER("(radio %s(%p), page %p)", gtk_widget_get_name(radio), radio, page);
+    if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio)))
+    {
+        LEAVE("1st callback of pair. Defer to 2nd callback.");
+        return;
+    }
 
-  widget = gnc_glade_lookup_widget(radio, "end_date_choose");
-  active = (widget == radio);
-  gde = gnc_glade_lookup_widget(radio, "end_date");
-  gtk_widget_set_sensitive(gde, active);
+    widget = gnc_glade_lookup_widget(radio, "end_date_choose");
+    active = (widget == radio);
+    gde = gnc_glade_lookup_widget(radio, "end_date");
+    gtk_widget_set_sensitive(gde, active);
 
-  get_filter_times(page);
-  gnc_ppr_update_date_query(page);
-  LEAVE(" ");
+    get_filter_times(page);
+    gnc_ppr_update_date_query(page);
+    LEAVE(" ");
 }
 
 
@@ -1755,27 +1906,28 @@
  */
 void
 gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
-					     gint response,
-					     GncPluginPageRegister *page)
+        gint response,
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  g_return_if_fail(GTK_IS_DIALOG(dialog));
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GTK_IS_DIALOG(dialog));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER(" ");
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  if (response != GTK_RESPONSE_OK) {
-    /* Remove the old status match */
-    priv->fd.cleared_match = priv->fd.original_cleared_match;
-    gnc_ppr_update_status_query(page);
-    priv->fd.start_time = priv->fd.original_start_time;
-    priv->fd.end_time = priv->fd.original_end_time;
-    gnc_ppr_update_date_query(page);
-  }
-  priv->fd.dialog = NULL;
-  gtk_widget_destroy(GTK_WIDGET(dialog));
-  LEAVE(" ");
+    ENTER(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    if (response != GTK_RESPONSE_OK)
+    {
+        /* Remove the old status match */
+        priv->fd.cleared_match = priv->fd.original_cleared_match;
+        gnc_ppr_update_status_query(page);
+        priv->fd.start_time = priv->fd.original_start_time;
+        priv->fd.end_time = priv->fd.original_end_time;
+        gnc_ppr_update_date_query(page);
+    }
+    priv->fd.dialog = NULL;
+    gtk_widget_destroy(GTK_WIDGET(dialog));
+    LEAVE(" ");
 }
 
 
@@ -1786,145 +1938,145 @@
 static char *
 gnc_reg_get_name (GNCLedgerDisplay *ledger, gboolean for_window)
 {
-  Account *leader;
-  SplitRegister *reg;
-  gchar *account_name;
-  gchar *reg_name;
-  gchar *name;
-  GNCLedgerDisplayType ledger_type;
+    Account *leader;
+    SplitRegister *reg;
+    gchar *account_name;
+    gchar *reg_name;
+    gchar *name;
+    GNCLedgerDisplayType ledger_type;
 
-  if (ledger == NULL)
-    return NULL;
+    if (ledger == NULL)
+        return NULL;
 
-  reg = gnc_ledger_display_get_split_register (ledger);
-  ledger_type = gnc_ledger_display_type (ledger);
+    reg = gnc_ledger_display_get_split_register (ledger);
+    ledger_type = gnc_ledger_display_type (ledger);
 
-  switch (reg->type)
-  {
+    switch (reg->type)
+    {
     case GENERAL_LEDGER:
     case INCOME_LEDGER:
-      if (for_window)
-        reg_name = _("General Ledger");
-      else
-        reg_name = _("General Ledger Report");
-      break;
+        if (for_window)
+            reg_name = _("General Ledger");
+        else
+            reg_name = _("General Ledger Report");
+        break;
     case PORTFOLIO_LEDGER:
-      if (for_window)
-        reg_name = _("Portfolio");
-      else
-        reg_name = _("Portfolio Report");
-      break;
+        if (for_window)
+            reg_name = _("Portfolio");
+        else
+            reg_name = _("Portfolio Report");
+        break;
     case SEARCH_LEDGER:
-      if (for_window)
-        reg_name = _("Search Results");
-      else
-        reg_name = _("Search Results Report");
-      break;
+        if (for_window)
+            reg_name = _("Search Results");
+        else
+            reg_name = _("Search Results Report");
+        break;
     default:
-      if (for_window)
-        reg_name = _("Register");
-      else
-        reg_name = _("Register Report");
-      break;
-  }
+        if (for_window)
+            reg_name = _("Register");
+        else
+            reg_name = _("Register Report");
+        break;
+    }
 
-  leader = gnc_ledger_display_leader (ledger);
+    leader = gnc_ledger_display_leader (ledger);
 
-  if ((leader != NULL) && (ledger_type != LD_GL))
-  {
-    account_name = gnc_account_get_full_name (leader);
+    if ((leader != NULL) && (ledger_type != LD_GL))
+    {
+        account_name = gnc_account_get_full_name (leader);
 
-    if (ledger_type == LD_SINGLE)
-    {
-      name = g_strconcat (account_name, " - ", reg_name, NULL);
+        if (ledger_type == LD_SINGLE)
+        {
+            name = g_strconcat (account_name, " - ", reg_name, NULL);
+        }
+        else
+        {
+            name = g_strconcat (account_name, " ", _("and subaccounts"), " - ", reg_name, NULL);
+        }
+        g_free(account_name);
     }
-    else 
-    {
-      name = g_strconcat (account_name, " ", _("and subaccounts"), " - ", reg_name, NULL);
-    }
-    g_free(account_name);
-  }
-  else
-    name = g_strdup (reg_name);
+    else
+        name = g_strdup (reg_name);
 
-  return name;
+    return name;
 }
 
 static int
 report_helper (GNCLedgerDisplay *ledger, Split *split, Query *query)
 {
-  SplitRegister *reg = gnc_ledger_display_get_split_register (ledger);
-  Account *account;
-  char *str;
-  swig_type_info * qtype;
-  SCM args;
-  SCM func;
-  SCM arg;
+    SplitRegister *reg = gnc_ledger_display_get_split_register (ledger);
+    Account *account;
+    char *str;
+    swig_type_info * qtype;
+    SCM args;
+    SCM func;
+    SCM arg;
 
-  args = SCM_EOL;
+    args = SCM_EOL;
 
-  func = scm_c_eval_string ("gnc:register-report-create");
-  g_return_val_if_fail (scm_is_procedure (func), -1);
+    func = scm_c_eval_string ("gnc:register-report-create");
+    g_return_val_if_fail (scm_is_procedure (func), -1);
 
-  arg = scm_makfrom0str (gnc_split_register_get_credit_string (reg));
-  args = scm_cons (arg, args);
+    arg = scm_makfrom0str (gnc_split_register_get_credit_string (reg));
+    args = scm_cons (arg, args);
 
-  arg = scm_makfrom0str (gnc_split_register_get_debit_string (reg));
-  args = scm_cons (arg, args);
+    arg = scm_makfrom0str (gnc_split_register_get_debit_string (reg));
+    args = scm_cons (arg, args);
 
-  str = gnc_reg_get_name (ledger, FALSE);
-  arg = scm_makfrom0str (str);
-  args = scm_cons (arg, args);
-  g_free (str);
+    str = gnc_reg_get_name (ledger, FALSE);
+    arg = scm_makfrom0str (str);
+    args = scm_cons (arg, args);
+    g_free (str);
 
-  arg = SCM_BOOL (reg->use_double_line);
-  args = scm_cons (arg, args);
+    arg = SCM_BOOL (reg->use_double_line);
+    args = scm_cons (arg, args);
 
-  arg = SCM_BOOL (reg->style == REG_STYLE_JOURNAL);
-  args = scm_cons (arg, args);
+    arg = SCM_BOOL (reg->style == REG_STYLE_JOURNAL);
+    args = scm_cons (arg, args);
 
-  if (!query)
-  {
-    query = gnc_ledger_display_get_query (ledger);
-    g_return_val_if_fail (query != NULL, -1);
-  }
+    if (!query)
+    {
+        query = gnc_ledger_display_get_query (ledger);
+        g_return_val_if_fail (query != NULL, -1);
+    }
 
-  qtype = SWIG_TypeQuery ("_p__QofQuery");
-  g_return_val_if_fail (qtype, -1);
+    qtype = SWIG_TypeQuery ("_p__QofQuery");
+    g_return_val_if_fail (qtype, -1);
 
-  arg = SWIG_NewPointerObj (query, qtype, 0);
-  args = scm_cons (arg, args);
-  g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
+    arg = SWIG_NewPointerObj (query, qtype, 0);
+    args = scm_cons (arg, args);
+    g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 
 
-  if (split)
-  {
-    qtype = SWIG_TypeQuery ("_p_Split");
-    g_return_val_if_fail (qtype, -1);
-    arg = SWIG_NewPointerObj (split, qtype, 0);
-  }
-  else
-  {
-    arg = SCM_BOOL_F;
-  }
-  args = scm_cons (arg, args);
-  g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
+    if (split)
+    {
+        qtype = SWIG_TypeQuery ("_p_Split");
+        g_return_val_if_fail (qtype, -1);
+        arg = SWIG_NewPointerObj (split, qtype, 0);
+    }
+    else
+    {
+        arg = SCM_BOOL_F;
+    }
+    args = scm_cons (arg, args);
+    g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 
 
-  qtype = SWIG_TypeQuery ("_p_Account");
-  g_return_val_if_fail (qtype, -1);
+    qtype = SWIG_TypeQuery ("_p_Account");
+    g_return_val_if_fail (qtype, -1);
 
-  account = gnc_ledger_display_leader (ledger);
-  arg = SWIG_NewPointerObj (account, qtype, 0);
-  args = scm_cons (arg, args);
-  g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
+    account = gnc_ledger_display_leader (ledger);
+    arg = SWIG_NewPointerObj (account, qtype, 0);
+    args = scm_cons (arg, args);
+    g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 
 
-  /* Apply the function to the args */
-  arg = scm_apply (func, args, SCM_EOL);
-  g_return_val_if_fail (scm_is_exact (arg), -1);
+    /* Apply the function to the args */
+    arg = scm_apply (func, args, SCM_EOL);
+    g_return_val_if_fail (scm_is_exact (arg), -1);
 
-  return scm_num2int (arg, SCM_ARG1, G_STRFUNC);
+    return scm_num2int (arg, SCM_ARG1, G_STRFUNC);
 }
 
 /************************************************************/
@@ -1933,955 +2085,984 @@
 
 static void
 gnc_plugin_page_register_cmd_print_check (GtkAction *action,
-					  GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister * reg;
-  Split         * split;
-  Transaction   * trans;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister * reg;
+    Split         * split;
+    Transaction   * trans;
 
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  reg = gnc_ledger_display_get_split_register (priv->ledger);
-  split    = gnc_split_register_get_current_split(reg);
-  trans    = xaccSplitGetParent(split);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    reg = gnc_ledger_display_get_split_register (priv->ledger);
+    split    = gnc_split_register_get_current_split(reg);
+    trans    = xaccSplitGetParent(split);
 
-  if(split && trans)
-  {
-    gnc_ui_print_check_dialog_create(plugin_page, split);
-  }
-  LEAVE(" ");
+    if (split && trans)
+    {
+        gnc_ui_print_check_dialog_create(plugin_page, split);
+    }
+    LEAVE(" ");
 }
 
 
 static void
 gnc_plugin_page_register_cmd_cut (GtkAction *action,
-				  GncPluginPageRegister *page)
+                                  GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(action %p, page %p)", action, page);
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  gnucash_register_cut_clipboard(priv->gsr->reg);
-  LEAVE("");
+    ENTER("(action %p, page %p)", action, page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    gnucash_register_cut_clipboard(priv->gsr->reg);
+    LEAVE("");
 }
 
 
 static void
 gnc_plugin_page_register_cmd_copy (GtkAction *action,
-				   GncPluginPageRegister *page)
+                                   GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(action %p, page %p)", action, page);
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  gnucash_register_copy_clipboard(priv->gsr->reg);
-  LEAVE("");
+    ENTER("(action %p, page %p)", action, page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    gnucash_register_copy_clipboard(priv->gsr->reg);
+    LEAVE("");
 }
 
 
 static void
 gnc_plugin_page_register_cmd_paste (GtkAction *action,
-				    GncPluginPageRegister *page)
+                                    GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(action %p, page %p)", action, page);
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  gnucash_register_paste_clipboard(priv->gsr->reg);
-  LEAVE("");
+    ENTER("(action %p, page %p)", action, page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    gnucash_register_paste_clipboard(priv->gsr->reg);
+    LEAVE("");
 }
 
 
 static void
 gnc_plugin_page_register_cmd_edit_account (GtkAction *action,
-					   GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  Account *account;
+    Account *account;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(action %p, page %p)", action, page);
-  account = gnc_plugin_page_register_get_account (page);
-  if (account)
-    gnc_ui_edit_account_window (account);
-  LEAVE(" ");
+    ENTER("(action %p, page %p)", action, page);
+    account = gnc_plugin_page_register_get_account (page);
+    if (account)
+        gnc_ui_edit_account_window (account);
+    LEAVE(" ");
 }
 
 
 static void
 gnc_plugin_page_register_cmd_find_transactions (GtkAction *action,
-						GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(action %p, page %p)", action, page);
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  gnc_ui_find_transactions_dialog_create(priv->ledger);
-  LEAVE(" ");
+    ENTER("(action %p, page %p)", action, page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    gnc_ui_find_transactions_dialog_create(priv->ledger);
+    LEAVE(" ");
 }
 
 
 static void
 gnc_plugin_page_register_cmd_cut_transaction (GtkAction *action,
-					      GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister *reg;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(action %p, page %p)", action, page);
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  reg = gnc_ledger_display_get_split_register(priv->ledger);
-  gnc_split_register_cut_current(reg);
-  LEAVE(" ");
+    ENTER("(action %p, page %p)", action, page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    gnc_split_register_cut_current(reg);
+    LEAVE(" ");
 }
 
 
 static void
 gnc_plugin_page_register_cmd_copy_transaction (GtkAction *action,
-					       GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister *reg;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(action %p, page %p)", action, page);
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  reg = gnc_ledger_display_get_split_register(priv->ledger);
-  gnc_split_register_copy_current(reg);
-  LEAVE(" ");
+    ENTER("(action %p, page %p)", action, page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    gnc_split_register_copy_current(reg);
+    LEAVE(" ");
 }
 
 
 static void
 gnc_plugin_page_register_cmd_paste_transaction (GtkAction *action,
-						GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister *reg;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  ENTER("(action %p, page %p)", action, page);
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  reg = gnc_ledger_display_get_split_register(priv->ledger);
-  gnc_split_register_paste_current(reg);
-  LEAVE(" ");
+    ENTER("(action %p, page %p)", action, page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    gnc_split_register_paste_current(reg);
+    LEAVE(" ");
 }
 
 
 static void
 gnc_plugin_page_register_cmd_void_transaction (GtkAction *action,
-					       GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GtkWidget *dialog, *entry;
-  SplitRegister *reg;
-  Transaction *trans;
-  GladeXML *xml;
-  const char *reason;
-  gint result;
+    GncPluginPageRegisterPrivate *priv;
+    GtkWidget *dialog, *entry;
+    SplitRegister *reg;
+    Transaction *trans;
+    GladeXML *xml;
+    const char *reason;
+    gint result;
 
-  ENTER("(action %p, page %p)", action, page);
+    ENTER("(action %p, page %p)", action, page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  reg = gnc_ledger_display_get_split_register(priv->ledger);
-  trans = gnc_split_register_get_current_trans(reg);
-  if (trans == NULL)
-    return;
-  if (xaccTransHasSplitsInState(trans, VREC))
-    return;
-  if (xaccTransHasReconciledSplits(trans) || xaccTransHasSplitsInState(trans, CREC)) {
-    gnc_error_dialog(NULL, "%s", _("You cannot void a transaction with reconciled or cleared splits."));
-    return;
-  }
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    trans = gnc_split_register_get_current_trans(reg);
+    if (trans == NULL)
+        return;
+    if (xaccTransHasSplitsInState(trans, VREC))
+        return;
+    if (xaccTransHasReconciledSplits(trans) || xaccTransHasSplitsInState(trans, CREC))
+    {
+        gnc_error_dialog(NULL, "%s", _("You cannot void a transaction with reconciled or cleared splits."));
+        return;
+    }
 
-  if (!gnc_plugin_page_register_finish_pending(GNC_PLUGIN_PAGE(page)))
-      return;
+    if (!gnc_plugin_page_register_finish_pending(GNC_PLUGIN_PAGE(page)))
+        return;
 
-  xml = gnc_glade_xml_new("register.glade", "Void Transaction");
-  dialog = glade_xml_get_widget(xml, "Void Transaction");
-  entry = glade_xml_get_widget(xml, "reason");
+    xml = gnc_glade_xml_new("register.glade", "Void Transaction");
+    dialog = glade_xml_get_widget(xml, "Void Transaction");
+    entry = glade_xml_get_widget(xml, "reason");
 
-  result = gtk_dialog_run(GTK_DIALOG(dialog));
-  if (result == GTK_RESPONSE_OK) {
-    reason = gtk_entry_get_text(GTK_ENTRY(entry));
-    if (reason == NULL)
-      reason = "";
-    gnc_split_register_void_current_trans(reg, reason);
-  }
+    result = gtk_dialog_run(GTK_DIALOG(dialog));
+    if (result == GTK_RESPONSE_OK)
+    {
+        reason = gtk_entry_get_text(GTK_ENTRY(entry));
+        if (reason == NULL)
+            reason = "";
+        gnc_split_register_void_current_trans(reg, reason);
+    }
 
-  /* All done. Get rid of it. */
-  gtk_widget_destroy(dialog);
-  g_object_unref(xml);
+    /* All done. Get rid of it. */
+    gtk_widget_destroy(dialog);
+    g_object_unref(xml);
 }
 
 
 static void
 gnc_plugin_page_register_cmd_unvoid_transaction (GtkAction *action,
-						 GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister *reg;
-  Transaction *trans;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
+    Transaction *trans;
 
-  ENTER("(action %p, page %p)", action, page);
+    ENTER("(action %p, page %p)", action, page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  reg = gnc_ledger_display_get_split_register(priv->ledger);
-  trans = gnc_split_register_get_current_trans(reg);
-  if (!xaccTransHasSplitsInState(trans, VREC))
-    return;
-  gnc_split_register_unvoid_current_trans(reg);
-  LEAVE(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    trans = gnc_split_register_get_current_trans(reg);
+    if (!xaccTransHasSplitsInState(trans, VREC))
+        return;
+    gnc_split_register_unvoid_current_trans(reg);
+    LEAVE(" ");
 }
 
 
 static void
 gnc_plugin_page_register_cmd_reverse_transaction (GtkAction *action,
-						  GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister *reg;
-  GNCSplitReg *gsr;
-  Transaction *trans, *new_trans;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
+    GNCSplitReg *gsr;
+    Transaction *trans, *new_trans;
 
-  ENTER("(action %p, page %p)", action, page);
+    ENTER("(action %p, page %p)", action, page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  reg = gnc_ledger_display_get_split_register(priv->ledger);
-  trans = gnc_split_register_get_current_trans(reg);
-  if (trans == NULL)
-    return;
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    trans = gnc_split_register_get_current_trans(reg);
+    if (trans == NULL)
+        return;
 
-  if (xaccTransGetReversedBy(trans)) {
-      gnc_error_dialog(gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page)), "%s",
-        _("A reversing entry has already been created for this transaction."));
-      return;
-  }
+    if (xaccTransGetReversedBy(trans))
+    {
+        gnc_error_dialog(gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page)), "%s",
+                         _("A reversing entry has already been created for this transaction."));
+        return;
+    }
 
-  qof_event_suspend();
-  new_trans = xaccTransReverse(trans);
+    qof_event_suspend();
+    new_trans = xaccTransReverse(trans);
 
-  /* Clear transaction level info */
-  xaccTransSetDatePostedSecs(new_trans, time(NULL));
-  xaccTransSetDateEnteredSecs(new_trans, time(NULL));
+    /* Clear transaction level info */
+    xaccTransSetDatePostedSecs(new_trans, time(NULL));
+    xaccTransSetDateEnteredSecs(new_trans, time(NULL));
 
-  qof_event_resume();
+    qof_event_resume();
 
-  /* Now jump to new trans */
-  gsr = gnc_plugin_page_register_get_gsr(GNC_PLUGIN_PAGE(page));
-  gnc_split_reg_jump_to_split(gsr, xaccTransGetSplit(new_trans, 0));
-  LEAVE(" ");
+    /* Now jump to new trans */
+    gsr = gnc_plugin_page_register_get_gsr(GNC_PLUGIN_PAGE(page));
+    gnc_split_reg_jump_to_split(gsr, xaccTransGetSplit(new_trans, 0));
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_shift_transaction_forward (GtkAction *action,
-						  GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister *reg;
-  GNCSplitReg *gsr;
-  Transaction *trans, *new_trans;
-  Timespec entered;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
+    GNCSplitReg *gsr;
+    Transaction *trans, *new_trans;
+    Timespec entered;
 
-  ENTER("(action %p, page %p)", action, page);
+    ENTER("(action %p, page %p)", action, page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  reg = gnc_ledger_display_get_split_register(priv->ledger);
-  trans = gnc_split_register_get_current_trans(reg);
-  if (trans == NULL)
-    return;
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    trans = gnc_split_register_get_current_trans(reg);
+    if (trans == NULL)
+        return;
 
-  qof_event_suspend();
+    qof_event_suspend();
 
-  xaccTransGetDatePostedTS(trans, &entered);
-  xaccTransSetDatePostedSecs(trans, entered.tv_sec+1);
+    xaccTransGetDatePostedTS(trans, &entered);
+    xaccTransSetDatePostedSecs(trans, entered.tv_sec + 1);
 
-  qof_event_resume();
+    qof_event_resume();
 
-  LEAVE(" ");
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_view_sort_by (GtkAction *action,
-					   GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GtkWidget *dialog, *button;
-  GladeXML *xml;
-  SortType sort;
-  const gchar *name;
-  gchar *title;
+    GncPluginPageRegisterPrivate *priv;
+    GtkWidget *dialog, *button;
+    GladeXML *xml;
+    SortType sort;
+    const gchar *name;
+    gchar *title;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
-  ENTER("(action %p, page %p)", action, page);
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    ENTER("(action %p, page %p)", action, page);
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  if (priv->sd.dialog) {
-    gtk_window_present(GTK_WINDOW(priv->sd.dialog));
-    LEAVE("existing dialog");
-    return;
-  }
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    if (priv->sd.dialog)
+    {
+        gtk_window_present(GTK_WINDOW(priv->sd.dialog));
+        LEAVE("existing dialog");
+        return;
+    }
 
-  /* Create the dialog */
-  xml = gnc_glade_xml_new ("register.glade", "Sort By");
-  dialog = glade_xml_get_widget (xml, "Sort By");
-  priv->sd.dialog = dialog;
-  gtk_window_set_transient_for(GTK_WINDOW(dialog),
-			       gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window)));
-  /* Translations: The %s is the name of the plugin page */
-  title = g_strdup_printf(_("Sort %s by..."),
-			  gnc_plugin_page_get_page_name(GNC_PLUGIN_PAGE(page)));
-  gtk_window_set_title(GTK_WINDOW(dialog), title);
-  g_free(title);
+    /* Create the dialog */
+    xml = gnc_glade_xml_new ("register.glade", "Sort By");
+    dialog = glade_xml_get_widget (xml, "Sort By");
+    priv->sd.dialog = dialog;
+    gtk_window_set_transient_for(GTK_WINDOW(dialog),
+                                 gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window)));
+    /* Translations: The %s is the name of the plugin page */
+    title = g_strdup_printf(_("Sort %s by..."),
+                            gnc_plugin_page_get_page_name(GNC_PLUGIN_PAGE(page)));
+    gtk_window_set_title(GTK_WINDOW(dialog), title);
+    g_free(title);
 
-  /* Set the button for the current sort order */
-  sort = gnc_split_reg_get_sort_type(priv->gsr);
-  name = SortTypeasString(sort);
-  button = glade_xml_get_widget (xml, name);
-  DEBUG("current sort %d, button %s(%p)", sort, name, button);
-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
-  priv->sd.original_sort_type = sort;
+    /* Set the button for the current sort order */
+    sort = gnc_split_reg_get_sort_type(priv->gsr);
+    name = SortTypeasString(sort);
+    button = glade_xml_get_widget (xml, name);
+    DEBUG("current sort %d, button %s(%p)", sort, name, button);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+    priv->sd.original_sort_type = sort;
 
-  /* Wire it up */
-  glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func,
-				    page);
+    /* Wire it up */
+    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func,
+                                      page);
 
-  /* Show it */
-  gtk_widget_show(dialog);
-  LEAVE(" ");
+    /* Show it */
+    gtk_widget_show(dialog);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
-					     GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GtkWidget *dialog, *toggle, *button, *start_date, *end_date, *table;
-  time_t start_time, end_time, time_val;
-  GladeXML *xml;
-  gboolean sensitive, value;
-  Query *query;
-  gchar *title;
-  int i;
+    GncPluginPageRegisterPrivate *priv;
+    GtkWidget *dialog, *toggle, *button, *start_date, *end_date, *table;
+    time_t start_time, end_time, time_val;
+    GladeXML *xml;
+    gboolean sensitive, value;
+    Query *query;
+    gchar *title;
+    int i;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
-  ENTER("(action %p, page %p)", action, page);
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    ENTER("(action %p, page %p)", action, page);
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-  if (priv->fd.dialog) {
-    gtk_window_present(GTK_WINDOW(priv->fd.dialog));
-    LEAVE("existing dialog");
-    return;
-  }
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    if (priv->fd.dialog)
+    {
+        gtk_window_present(GTK_WINDOW(priv->fd.dialog));
+        LEAVE("existing dialog");
+        return;
+    }
 
-  /* Create the dialog */
-  xml = gnc_glade_xml_new ("register.glade", "Filter By");
-  dialog = glade_xml_get_widget (xml, "Filter By");
-  priv->fd.dialog = dialog;
-  gtk_window_set_transient_for(GTK_WINDOW(dialog),
-			       gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window)));
-  /* Translators: The %s is the name of the plugin page */
-  title = g_strdup_printf(_("Filter %s by..."),
-			  gnc_plugin_page_get_page_name(GNC_PLUGIN_PAGE(page)));
-  gtk_window_set_title(GTK_WINDOW(dialog), title);
-  g_free(title);
+    /* Create the dialog */
+    xml = gnc_glade_xml_new ("register.glade", "Filter By");
+    dialog = glade_xml_get_widget (xml, "Filter By");
+    priv->fd.dialog = dialog;
+    gtk_window_set_transient_for(GTK_WINDOW(dialog),
+                                 gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window)));
+    /* Translators: The %s is the name of the plugin page */
+    title = g_strdup_printf(_("Filter %s by..."),
+                            gnc_plugin_page_get_page_name(GNC_PLUGIN_PAGE(page)));
+    gtk_window_set_title(GTK_WINDOW(dialog), title);
+    g_free(title);
 
-  /* Set the check buttons for the current status */
-  for (i = 0; status_actions[i].action_name; i++) {
-    toggle = glade_xml_get_widget (xml, status_actions[i].action_name);
-    value = priv->fd.cleared_match & status_actions[i].value;
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), value);
-  }
-  priv->fd.original_cleared_match = priv->fd.cleared_match;
+    /* Set the check buttons for the current status */
+    for (i = 0; status_actions[i].action_name; i++)
+    {
+        toggle = glade_xml_get_widget (xml, status_actions[i].action_name);
+        value = priv->fd.cleared_match & status_actions[i].value;
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), value);
+    }
+    priv->fd.original_cleared_match = priv->fd.cleared_match;
 
-  /* Set the date info */
-  button = glade_xml_get_widget(xml, "filter_show_range");
-  query = gnc_ledger_display_get_query (priv->ledger);
-  xaccQueryGetDateMatchTT(query, &start_time, &end_time);
-  priv->fd.original_start_time = start_time;
-  priv->fd.start_time = start_time;
-  priv->fd.original_end_time = end_time;
-  priv->fd.end_time = end_time;
+    /* Set the date info */
+    button = glade_xml_get_widget(xml, "filter_show_range");
+    query = gnc_ledger_display_get_query (priv->ledger);
+    xaccQueryGetDateMatchTT(query, &start_time, &end_time);
+    priv->fd.original_start_time = start_time;
+    priv->fd.start_time = start_time;
+    priv->fd.original_end_time = end_time;
+    priv->fd.end_time = end_time;
 
-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
-			       start_time || end_time);
-  table = glade_xml_get_widget(xml, "select_range_table");
-  gtk_widget_set_sensitive(GTK_WIDGET(table), start_time || end_time);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
+                                 start_time || end_time);
+    table = glade_xml_get_widget(xml, "select_range_table");
+    gtk_widget_set_sensitive(GTK_WIDGET(table), start_time || end_time);
 
-  {
-    /* Start date info */
-    if (start_time == 0) {
-      button = glade_xml_get_widget(xml, "start_date_earliest");
-      time_val = xaccQueryGetEarliestDateFound (query); 
-      sensitive = FALSE;
-    } else {
-      time_val = start_time;
-      if ((start_time >= gnc_timet_get_today_start()) &&
-	  (start_time <= gnc_timet_get_today_end())) {
-	button = glade_xml_get_widget(xml, "start_date_today");
-	sensitive = FALSE;
-      } else {
-	button = glade_xml_get_widget(xml, "start_date_choose");
-	sensitive = TRUE;
-      }
+    {
+        /* Start date info */
+        if (start_time == 0)
+        {
+            button = glade_xml_get_widget(xml, "start_date_earliest");
+            time_val = xaccQueryGetEarliestDateFound (query);
+            sensitive = FALSE;
+        }
+        else
+        {
+            time_val = start_time;
+            if ((start_time >= gnc_timet_get_today_start()) &&
+                    (start_time <= gnc_timet_get_today_end()))
+            {
+                button = glade_xml_get_widget(xml, "start_date_today");
+                sensitive = FALSE;
+            }
+            else
+            {
+                button = glade_xml_get_widget(xml, "start_date_choose");
+                sensitive = TRUE;
+            }
+        }
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+        start_date = glade_xml_get_widget(xml, "start_date");
+        gtk_widget_set_sensitive(GTK_WIDGET(start_date), sensitive);
+        gnc_date_edit_set_time(GNC_DATE_EDIT(start_date), time_val);
+        g_signal_connect (G_OBJECT (start_date), "date-changed",
+                          G_CALLBACK (gnc_plugin_page_register_filter_gde_changed_cb),
+                          page);
     }
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
-    start_date = glade_xml_get_widget(xml, "start_date");
-    gtk_widget_set_sensitive(GTK_WIDGET(start_date), sensitive);
-    gnc_date_edit_set_time(GNC_DATE_EDIT(start_date), time_val);
-    g_signal_connect (G_OBJECT (start_date), "date-changed",
-		      G_CALLBACK (gnc_plugin_page_register_filter_gde_changed_cb),
-		      page);
-  }
 
-  {
-    /* End date info */
-    if (end_time == 0) {
-      button = glade_xml_get_widget(xml, "end_date_latest");
-      time_val = xaccQueryGetLatestDateFound (query); 
-      sensitive = FALSE;
-    } else {
-      time_val = end_time;
-      if ((end_time >= gnc_timet_get_today_start()) &&
-	  (end_time <= gnc_timet_get_today_end())) {
-	button = glade_xml_get_widget(xml, "end_date_today");
-	sensitive = FALSE;
-      } else {
-	button = glade_xml_get_widget(xml, "end_date_choose");
-	sensitive = TRUE;
-      }
+    {
+        /* End date info */
+        if (end_time == 0)
+        {
+            button = glade_xml_get_widget(xml, "end_date_latest");
+            time_val = xaccQueryGetLatestDateFound (query);
+            sensitive = FALSE;
+        }
+        else
+        {
+            time_val = end_time;
+            if ((end_time >= gnc_timet_get_today_start()) &&
+                    (end_time <= gnc_timet_get_today_end()))
+            {
+                button = glade_xml_get_widget(xml, "end_date_today");
+                sensitive = FALSE;
+            }
+            else
+            {
+                button = glade_xml_get_widget(xml, "end_date_choose");
+                sensitive = TRUE;
+            }
+        }
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+        end_date = glade_xml_get_widget(xml, "end_date");
+        gtk_widget_set_sensitive(GTK_WIDGET(end_date), sensitive);
+        gnc_date_edit_set_time(GNC_DATE_EDIT(end_date), time_val);
+        g_signal_connect (G_OBJECT (end_date), "date-changed",
+                          G_CALLBACK (gnc_plugin_page_register_filter_gde_changed_cb),
+                          page);
     }
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
-    end_date = glade_xml_get_widget(xml, "end_date");
-    gtk_widget_set_sensitive(GTK_WIDGET(end_date), sensitive);
-    gnc_date_edit_set_time(GNC_DATE_EDIT(end_date), time_val);
-    g_signal_connect (G_OBJECT (end_date), "date-changed",
-		      G_CALLBACK (gnc_plugin_page_register_filter_gde_changed_cb),
-		      page);
-  }
 
-  /* Wire it up */
-  glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, page);
+    /* Wire it up */
+    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, page);
 
-  /* Show it */
-  gtk_widget_show_all(dialog);
-  LEAVE(" ");
+    /* Show it */
+    gtk_widget_show_all(dialog);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_style_changed (GtkAction *action,
-					    GtkRadioAction *current,
-					    GncPluginPageRegister *plugin_page)
+        GtkRadioAction *current,
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegisterStyle value;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegisterStyle value;
 
-  ENTER("(action %p, radio action %p, plugin_page %p)",
-	action, current, plugin_page);
+    ENTER("(action %p, radio action %p, plugin_page %p)",
+          action, current, plugin_page);
 
-  g_return_if_fail(GTK_IS_ACTION(action));
-  g_return_if_fail(GTK_IS_RADIO_ACTION(current));
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GTK_IS_ACTION(action));
+    g_return_if_fail(GTK_IS_RADIO_ACTION(current));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  value = gtk_radio_action_get_current_value(current);
-  gnc_split_reg_change_style(priv->gsr, value);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    value = gtk_radio_action_get_current_value(current);
+    gnc_split_reg_change_style(priv->gsr, value);
 
-  gnc_plugin_page_register_ui_update (NULL, plugin_page);
-  LEAVE(" ");
+    gnc_plugin_page_register_ui_update (NULL, plugin_page);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_style_double_line (GtkToggleAction *action,
-						GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister *reg;
-  gboolean use_double_line;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
+    gboolean use_double_line;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GTK_IS_ACTION(action));
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GTK_IS_ACTION(action));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  reg = gnc_ledger_display_get_split_register (priv->ledger);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    reg = gnc_ledger_display_get_split_register (priv->ledger);
 
-  use_double_line =  gtk_toggle_action_get_active (action);
-  if (use_double_line != reg->use_double_line) {
-    gnc_split_register_config(reg, reg->type, reg->style, use_double_line);
-    gnc_ledger_display_refresh(priv->ledger);
-  }
-  LEAVE(" ");
+    use_double_line =  gtk_toggle_action_get_active (action);
+    if (use_double_line != reg->use_double_line)
+    {
+        gnc_split_register_config(reg, reg->type, reg->style, use_double_line);
+        gnc_ledger_display_refresh(priv->ledger);
+    }
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_transfer (GtkAction *action,
-				       GncPluginPageRegister *page)
+                                       GncPluginPageRegister *page)
 {
-  Account *account;
-  GncWindow *gnc_window;
-  GtkWidget *window;
+    Account *account;
+    GncWindow *gnc_window;
+    GtkWidget *window;
 
-  ENTER("(action %p, plugin_page %p)", action, page);
+    ENTER("(action %p, plugin_page %p)", action, page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  account = gnc_plugin_page_register_get_account (page);
-  gnc_window = GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window);
-  window = GTK_WIDGET(gnc_window_get_gtk_window(gnc_window));
-  gnc_xfer_dialog (window, account);
-  LEAVE(" ");
+    account = gnc_plugin_page_register_get_account (page);
+    gnc_window = GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window);
+    window = GTK_WIDGET(gnc_window_get_gtk_window(gnc_window));
+    gnc_xfer_dialog (window, account);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_reconcile (GtkAction *action,
-					GncPluginPageRegister *page)
+                                        GncPluginPageRegister *page)
 {
-  Account *account;
-  GtkWindow *window;
-  RecnWindow * recnData;
+    Account *account;
+    GtkWindow *window;
+    RecnWindow * recnData;
 
-  ENTER("(action %p, plugin_page %p)", action, page);
+    ENTER("(action %p, plugin_page %p)", action, page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  account = gnc_plugin_page_register_get_account (page);
+    account = gnc_plugin_page_register_get_account (page);
 
-  window = gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window));
-  recnData = recnWindow (GTK_WIDGET(window), account);
-  gnc_ui_reconcile_window_raise (recnData);
-  LEAVE(" ");
+    window = gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window));
+    recnData = recnWindow (GTK_WIDGET(window), account);
+    gnc_ui_reconcile_window_raise (recnData);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_autoclear (GtkAction *action,
-					GncPluginPageRegister *page)
+                                        GncPluginPageRegister *page)
 {
-  Account *account;
-  GtkWindow *window;
-  AutoClearWindow * autoClearData;
+    Account *account;
+    GtkWindow *window;
+    AutoClearWindow * autoClearData;
 
-  ENTER("(action %p, plugin_page %p)", action, page);
+    ENTER("(action %p, plugin_page %p)", action, page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  account = gnc_plugin_page_register_get_account (page);
+    account = gnc_plugin_page_register_get_account (page);
 
-  window = gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window));
-  autoClearData = autoClearWindow (GTK_WIDGET(window), account);
-  gnc_ui_autoclear_window_raise (autoClearData);
-  LEAVE(" ");
+    window = gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window));
+    autoClearData = autoClearWindow (GTK_WIDGET(window), account);
+    gnc_ui_autoclear_window_raise (autoClearData);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_stock_split (GtkAction *action,
-					  GncPluginPageRegister *page)
+        GncPluginPageRegister *page)
 {
-  Account *account;
+    Account *account;
 
-  ENTER("(action %p, plugin_page %p)", action, page);
+    ENTER("(action %p, plugin_page %p)", action, page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  account = gnc_plugin_page_register_get_account (page);
-  gnc_stock_split_dialog (NULL, account);
-  LEAVE(" ");
+    account = gnc_plugin_page_register_get_account (page);
+    gnc_stock_split_dialog (NULL, account);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_lots (GtkAction *action,
-				   GncPluginPageRegister *page)
+                                   GncPluginPageRegister *page)
 {
-  Account *account;
+    Account *account;
 
-  ENTER("(action %p, plugin_page %p)", action, page);
+    ENTER("(action %p, plugin_page %p)", action, page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 
-  account = gnc_plugin_page_register_get_account (page);
-  gnc_lot_viewer_dialog (account);
-  LEAVE(" ");
+    account = gnc_plugin_page_register_get_account (page);
+    gnc_lot_viewer_dialog (account);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_enter_transaction (GtkAction *action,
-						GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  gnc_split_reg_enter(priv->gsr, FALSE);
-  LEAVE(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    gnc_split_reg_enter(priv->gsr, FALSE);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_cancel_transaction (GtkAction *action,
-						 GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  gnc_split_register_cancel_cursor_trans_changes
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    gnc_split_register_cancel_cursor_trans_changes
     (gnc_ledger_display_get_split_register(priv->ledger));
-  LEAVE(" ");
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_delete_transaction (GtkAction *action,
-						 GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  gsr_default_delete_handler(priv->gsr, NULL);
-  LEAVE(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    gsr_default_delete_handler(priv->gsr, NULL);
+    LEAVE(" ");
 
 }
 
 static void
 gnc_plugin_page_register_cmd_blank_transaction (GtkAction *action,
-						GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister *reg;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  reg = gnc_ledger_display_get_split_register (priv->ledger);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    reg = gnc_ledger_display_get_split_register (priv->ledger);
 
-  if (gnc_split_register_save (reg, TRUE))
-    gnc_split_register_redraw (reg);
+    if (gnc_split_register_save (reg, TRUE))
+        gnc_split_register_redraw (reg);
 
-  gnc_split_reg_jump_to_blank (priv->gsr);
-  LEAVE(" ");
+    gnc_split_reg_jump_to_blank (priv->gsr);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_duplicate_transaction (GtkAction *action,
-						    GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  gnc_split_register_duplicate_current
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    gnc_split_register_duplicate_current
     (gnc_ledger_display_get_split_register(priv->ledger));
-  LEAVE(" ");
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_reinitialize_transaction (GtkAction *action,
-						       GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  gsr_default_reinit_handler(priv->gsr, NULL);
-  LEAVE(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    gsr_default_reinit_handler(priv->gsr, NULL);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_expand_transaction (GtkToggleAction *action,
-						 GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister *reg;
-  gboolean expand;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
+    gboolean expand;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  reg = gnc_ledger_display_get_split_register (priv->ledger);
-  expand = gtk_toggle_action_get_active (action);
-  gnc_split_register_expand_current_trans (reg, expand);
-  LEAVE(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    reg = gnc_ledger_display_get_split_register (priv->ledger);
+    expand = gtk_toggle_action_get_active (action);
+    gnc_split_register_expand_current_trans (reg, expand);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_exchange_rate (GtkAction *action,
-					    GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  SplitRegister *reg;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  reg = gnc_ledger_display_get_split_register (priv->ledger);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    reg = gnc_ledger_display_get_split_register (priv->ledger);
 
-  /* XXX Ignore the return value -- we don't care if this succeeds */
-  (void)gnc_split_register_handle_exchange (reg, TRUE);
-  LEAVE(" ");
+    /* XXX Ignore the return value -- we don't care if this succeeds */
+    (void)gnc_split_register_handle_exchange (reg, TRUE);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_jump (GtkAction *action,
-				   GncPluginPageRegister *plugin_page)
+                                   GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GncPluginPage *new_page;
-  GncPluginPageRegister *new_reg_page;
-  GtkWidget *window;
-  GNCSplitReg *gsr;
-  SplitRegister *reg;
-  Account *account;
-  Account *leader;
-  Split *split;
+    GncPluginPageRegisterPrivate *priv;
+    GncPluginPage *new_page;
+    GncPluginPageRegister *new_reg_page;
+    GtkWidget *window;
+    GNCSplitReg *gsr;
+    SplitRegister *reg;
+    Account *account;
+    Account *leader;
+    Split *split;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  window = GNC_PLUGIN_PAGE (plugin_page)->window;
-  if (window == NULL) {
-    LEAVE("no window");
-    return;
-  }
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    window = GNC_PLUGIN_PAGE (plugin_page)->window;
+    if (window == NULL)
+    {
+        LEAVE("no window");
+        return;
+    }
 
-  reg = gnc_ledger_display_get_split_register (priv->ledger);
-  split = gnc_split_register_get_current_split (reg);
-  if (split == NULL) {
-    LEAVE("no split (1)");
-    return;
-  }
-
-  account = xaccSplitGetAccount (split);
-  if (account == NULL) {
-    LEAVE("no account");
-    return;
-  }
-
-  leader = gnc_ledger_display_leader (priv->ledger);
-  if (account == leader)
-  {
-    split = xaccSplitGetOtherSplit (split);
-    if (split == NULL) {
-      LEAVE("no split (2)");
-      return;
+    reg = gnc_ledger_display_get_split_register (priv->ledger);
+    split = gnc_split_register_get_current_split (reg);
+    if (split == NULL)
+    {
+        LEAVE("no split (1)");
+        return;
     }
 
     account = xaccSplitGetAccount (split);
-    if (account == NULL) {
-      LEAVE("no account (2)");
-      return;
+    if (account == NULL)
+    {
+        LEAVE("no account");
+        return;
     }
 
-    if (account == leader) {
-      LEAVE("register open for account");
-      return;
+    leader = gnc_ledger_display_leader (priv->ledger);
+    if (account == leader)
+    {
+        split = xaccSplitGetOtherSplit (split);
+        if (split == NULL)
+        {
+            LEAVE("no split (2)");
+            return;
+        }
+
+        account = xaccSplitGetAccount (split);
+        if (account == NULL)
+        {
+            LEAVE("no account (2)");
+            return;
+        }
+
+        if (account == leader)
+        {
+            LEAVE("register open for account");
+            return;
+        }
     }
-  }
 
-  new_page = gnc_plugin_page_register_new (account, FALSE);
-  if (new_page == NULL) {
-    LEAVE("couldn't create new page");
-    return;
-  }
-  new_reg_page = GNC_PLUGIN_PAGE_REGISTER(new_page);
+    new_page = gnc_plugin_page_register_new (account, FALSE);
+    if (new_page == NULL)
+    {
+        LEAVE("couldn't create new page");
+        return;
+    }
+    new_reg_page = GNC_PLUGIN_PAGE_REGISTER(new_page);
 
-  gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
-  gsr = gnc_plugin_page_register_get_gsr (new_page);
-  gnc_split_reg_jump_to_split(gsr, split);
-  LEAVE(" ");
+    gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
+    gsr = gnc_plugin_page_register_get_gsr (new_page);
+    gnc_split_reg_jump_to_split(gsr, split);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_schedule (GtkAction *action,
-				       GncPluginPageRegister *plugin_page)
+                                       GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegisterPrivate *priv;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  gsr_default_schedule_handler(priv->gsr, NULL);
-  LEAVE(" ");
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    gsr_default_schedule_handler(priv->gsr, NULL);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_scrub_current (GtkAction *action,
-					    GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  Query *query;
-  Account *root;
-  Transaction *trans;
-  SplitRegister *reg;
+    GncPluginPageRegisterPrivate *priv;
+    Query *query;
+    Account *root;
+    Transaction *trans;
+    SplitRegister *reg;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  query = gnc_ledger_display_get_query( priv->ledger );
-  if (query == NULL) {
-    LEAVE("no query found");
-    return;
-  }
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    query = gnc_ledger_display_get_query( priv->ledger );
+    if (query == NULL)
+    {
+        LEAVE("no query found");
+        return;
+    }
 
-  reg = gnc_ledger_display_get_split_register(priv->ledger);
-  trans = gnc_split_register_get_current_trans(reg);
-  if (trans == NULL) {
-    LEAVE("no trans found");
-    return;
-  }
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    trans = gnc_split_register_get_current_trans(reg);
+    if (trans == NULL)
+    {
+        LEAVE("no trans found");
+        return;
+    }
 
-  gnc_suspend_gui_refresh();
-  root = gnc_get_current_root_account();
-  xaccTransScrubOrphans(trans);
-  xaccTransScrubImbalance(trans, root, NULL);
-  gnc_resume_gui_refresh();
-  LEAVE(" ");
+    gnc_suspend_gui_refresh();
+    root = gnc_get_current_root_account();
+    xaccTransScrubOrphans(trans);
+    xaccTransScrubImbalance(trans, root, NULL);
+    gnc_resume_gui_refresh();
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_scrub_all (GtkAction *action,
-					GncPluginPageRegister *plugin_page)
+                                        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  Query *query;
-  Account *root;
-  Transaction *trans;
-  Split *split;
-  GList *node;
+    GncPluginPageRegisterPrivate *priv;
+    Query *query;
+    Account *root;
+    Transaction *trans;
+    Split *split;
+    GList *node;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  query = gnc_ledger_display_get_query( priv->ledger );
-  if (!query) {
-    LEAVE("no query found");
-    return;
-  }
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    query = gnc_ledger_display_get_query( priv->ledger );
+    if (!query)
+    {
+        LEAVE("no query found");
+        return;
+    }
 
-  gnc_suspend_gui_refresh();
-  root = gnc_get_current_root_account();
+    gnc_suspend_gui_refresh();
+    root = gnc_get_current_root_account();
 
-  for (node = xaccQueryGetSplits(query); node; node = node->next)
-  {
-    split = node->data;
-    trans = xaccSplitGetParent(split);
+    for (node = xaccQueryGetSplits(query); node; node = node->next)
+    {
+        split = node->data;
+        trans = xaccSplitGetParent(split);
 
-    xaccTransScrubOrphans(trans);
-    xaccTransScrubImbalance(trans, root, NULL);
-  }
+        xaccTransScrubOrphans(trans);
+        xaccTransScrubImbalance(trans, root, NULL);
+    }
 
-  gnc_resume_gui_refresh();
-  LEAVE(" ");
+    gnc_resume_gui_refresh();
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_account_report (GtkAction *action,
-					     GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GncMainWindow *window;
-  int id;
+    GncPluginPageRegisterPrivate *priv;
+    GncMainWindow *window;
+    int id;
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  id = report_helper (priv->ledger, NULL, NULL);
-  if (id >= 0)
-    gnc_main_window_open_report(id, window);
-  LEAVE(" ");
+    window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    id = report_helper (priv->ledger, NULL, NULL);
+    if (id >= 0)
+        gnc_main_window_open_report(id, window);
+    LEAVE(" ");
 }
 
 static void
 gnc_plugin_page_register_cmd_transaction_report (GtkAction *action,
-						 GncPluginPageRegister *plugin_page)
+        GncPluginPageRegister *plugin_page)
 {
-  GncPluginPageRegisterPrivate *priv;
-  GncMainWindow *window;
-  SplitRegister *reg;
-  Split *split;
-  Query *query;
-  int id;
+    GncPluginPageRegisterPrivate *priv;
+    GncMainWindow *window;
+    SplitRegister *reg;
+    Split *split;
+    Query *query;
+    int id;
 
 
-  ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
-  reg = gnc_ledger_display_get_split_register (priv->ledger);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+    reg = gnc_ledger_display_get_split_register (priv->ledger);
 
-  split = gnc_split_register_get_current_split (reg);
-  if (!split)
-    return;
+    split = gnc_split_register_get_current_split (reg);
+    if (!split)
+        return;
 
-  query = xaccMallocQuery ();
+    query = xaccMallocQuery ();
 
-  xaccQuerySetBook (query, gnc_get_current_book ());
+    xaccQuerySetBook (query, gnc_get_current_book ());
 
-  xaccQueryAddGUIDMatch (query, xaccSplitGetGUID (split),
-                         GNC_ID_SPLIT, QUERY_AND);
+    xaccQueryAddGUIDMatch (query, xaccSplitGetGUID (split),
+                           GNC_ID_SPLIT, QUERY_AND);
 
-  window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
-  id = report_helper (priv->ledger, split, query);
-  if (id >= 0)
-    gnc_main_window_open_report(id, window);
-  LEAVE(" ");
+    window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
+    id = report_helper (priv->ledger, split, query);
+    if (id >= 0)
+        gnc_main_window_open_report(id, window);
+    LEAVE(" ");
 }
 
 /************************************************************/
@@ -2890,98 +3071,104 @@
 
 void
 gnc_plugin_page_register_set_options (GncPluginPage *plugin_page,
-				      const char *lines_opt_section,
-				      const char *lines_opt_name,
-				      gint lines_default,
+                                      const char *lines_opt_section,
+                                      const char *lines_opt_name,
+                                      gint lines_default,
                                       gboolean read_only)
 {
-	GncPluginPageRegister *page;
-	GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegister *page;
+    GncPluginPageRegisterPrivate *priv;
 
-	g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 
-	page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-	priv->lines_opt_section = lines_opt_section;
-	priv->lines_opt_name 	= lines_opt_name;
-	priv->lines_default  	= lines_default;
-        priv->read_only         = read_only;
+    page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    priv->lines_opt_section = lines_opt_section;
+    priv->lines_opt_name 	= lines_opt_name;
+    priv->lines_default  	= lines_default;
+    priv->read_only         = read_only;
 }
 
 GNCSplitReg *
 gnc_plugin_page_register_get_gsr (GncPluginPage *plugin_page)
 {
-	GncPluginPageRegister *page;
-	GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegister *page;
+    GncPluginPageRegisterPrivate *priv;
 
-	g_return_val_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page), NULL);
+    g_return_val_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page), NULL);
 
-	page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 
-	return priv->gsr;
+    return priv->gsr;
 }
 
 static void
 gnc_plugin_page_help_changed_cb (GNCSplitReg *gsr, GncPluginPageRegister *register_page)
 {
-	GncPluginPageRegisterPrivate *priv;
-	SplitRegister *reg;
-	GncWindow *window;
-	char *help;
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
+    GncWindow *window;
+    char *help;
 
-	g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(register_page));
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(register_page));
 
-	window = GNC_WINDOW(GNC_PLUGIN_PAGE(register_page)->window);
-	if (!window) {
-	  // This routine can be called before the page is added to a
-	  // window.
-	  return;
-	}
+    window = GNC_WINDOW(GNC_PLUGIN_PAGE(register_page)->window);
+    if (!window)
+    {
+        // This routine can be called before the page is added to a
+        // window.
+        return;
+    }
 
-	/* Get the text from the ledger */
-	priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(register_page);
-	reg = gnc_ledger_display_get_split_register(priv->ledger);
-	help = gnc_table_get_help(reg->table);
-	gnc_window_set_status(window, GNC_PLUGIN_PAGE(register_page), help);
-	g_free(help);
+    /* Get the text from the ledger */
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(register_page);
+    reg = gnc_ledger_display_get_split_register(priv->ledger);
+    help = gnc_table_get_help(reg->table);
+    gnc_window_set_status(window, GNC_PLUGIN_PAGE(register_page), help);
+    g_free(help);
 }
 
 static void
 gnc_plugin_page_register_refresh_cb (GHashTable *changes, gpointer user_data)
 {
-  GncPluginPageRegister *page = user_data;
-  GncPluginPageRegisterPrivate *priv;
+    GncPluginPageRegister *page = user_data;
+    GncPluginPageRegisterPrivate *priv;
 
-  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
-  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 
-  if (changes) {
-      const EventInfo* ei;
-      ei = gnc_gui_get_entity_events(changes, &priv->key);
-      if (ei) {
-          if (ei->event_mask & QOF_EVENT_DESTROY) {
-              gnc_main_window_close_page(GNC_PLUGIN_PAGE(page));
-              return;
-          }
-          if (ei->event_mask & QOF_EVENT_MODIFY) {
-          }
-      }
-  }
-  else {
-      /* forced updates */
-      gnucash_register_refresh_from_gconf(priv->gsr->reg);
-      gtk_widget_queue_draw(priv->widget);
-  }
+    if (changes)
+    {
+        const EventInfo* ei;
+        ei = gnc_gui_get_entity_events(changes, &priv->key);
+        if (ei)
+        {
+            if (ei->event_mask & QOF_EVENT_DESTROY)
+            {
+                gnc_main_window_close_page(GNC_PLUGIN_PAGE(page));
+                return;
+            }
+            if (ei->event_mask & QOF_EVENT_MODIFY)
+            {
+            }
+        }
+    }
+    else
+    {
+        /* forced updates */
+        gnucash_register_refresh_from_gconf(priv->gsr->reg);
+        gtk_widget_queue_draw(priv->widget);
+    }
 
-  gnc_plugin_page_register_ui_update(NULL, page);
+    gnc_plugin_page_register_ui_update(NULL, page);
 }
 
 static void
 gnc_plugin_page_register_close_cb (gpointer user_data)
 {
-  GncPluginPage *plugin_page = GNC_PLUGIN_PAGE(user_data);
-  gnc_main_window_close_page (plugin_page);
+    GncPluginPage *plugin_page = GNC_PLUGIN_PAGE(user_data);
+    gnc_main_window_close_page (plugin_page);
 }
 
 /** This function is called when an account has been edited and an
@@ -2995,37 +3182,43 @@
 static void
 gppr_account_destroy_cb (Account *account)
 {
-  GncPluginPageRegister *page;
-  GncPluginPageRegisterPrivate *priv;
-  GNCLedgerDisplayType ledger_type;
-  const GUID *acct_guid;
-  const GList *citem;
-  GList *item, *kill = NULL;
+    GncPluginPageRegister *page;
+    GncPluginPageRegisterPrivate *priv;
+    GNCLedgerDisplayType ledger_type;
+    const GUID *acct_guid;
+    const GList *citem;
+    GList *item, *kill = NULL;
 
-  acct_guid = xaccAccountGetGUID(account);
+    acct_guid = xaccAccountGetGUID(account);
 
-  /* Find all windows that need to be killed.  Don't kill them yet, as
-   * that would affect the list being walked.*/
-  citem = gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_REGISTER_NAME);
-  for ( ; citem; citem = g_list_next(citem)) {
-    page = (GncPluginPageRegister *)citem->data;
-    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-    ledger_type = gnc_ledger_display_type (priv->ledger);
-    if (ledger_type == LD_GL) {
-      kill = g_list_append(kill, page);
-      /* kill it */
-    } else if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT)) {
-      if (guid_compare(acct_guid, &priv->key) == 0) {
-	kill = g_list_append(kill, page);
-      }
+    /* Find all windows that need to be killed.  Don't kill them yet, as
+     * that would affect the list being walked.*/
+    citem = gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_REGISTER_NAME);
+    for ( ; citem; citem = g_list_next(citem))
+    {
+        page = (GncPluginPageRegister *)citem->data;
+        priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+        ledger_type = gnc_ledger_display_type (priv->ledger);
+        if (ledger_type == LD_GL)
+        {
+            kill = g_list_append(kill, page);
+            /* kill it */
+        }
+        else if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
+        {
+            if (guid_compare(acct_guid, &priv->key) == 0)
+            {
+                kill = g_list_append(kill, page);
+            }
+        }
     }
-  }
 
-  /* Now kill them. */
-  for (item = kill; item; item = g_list_next(item)) {
-    page = (GncPluginPageRegister *)item->data;
-    gnc_main_window_close_page(GNC_PLUGIN_PAGE(page));
-  }
+    /* Now kill them. */
+    for (item = kill; item; item = g_list_next(item))
+    {
+        page = (GncPluginPageRegister *)item->data;
+        gnc_main_window_close_page(GNC_PLUGIN_PAGE(page));
+    }
 }
 
 /** This function is the handler for all event messages from the
@@ -3044,60 +3237,66 @@
  */
 static void
 gnc_plugin_page_register_event_handler (QofInstance *entity,
-					QofEventId event_type,
-					GncPluginPageRegister *page,
-					GncEventData *ed)
+                                        QofEventId event_type,
+                                        GncPluginPageRegister *page,
+                                        GncEventData *ed)
 {
-  Transaction *trans;
-  QofBook *book;
-  GncPluginPage *visible_page;
-  GtkWidget *window;
-  gchar *label, *color;
+    Transaction *trans;
+    QofBook *book;
+    GncPluginPage *visible_page;
+    GtkWidget *window;
+    gchar *label, *color;
 
-  g_return_if_fail(page);	/* Required */
-  if (!GNC_IS_TRANS(entity) && !GNC_IS_ACCOUNT(entity))
-    return;
+    g_return_if_fail(page);	/* Required */
+    if (!GNC_IS_TRANS(entity) && !GNC_IS_ACCOUNT(entity))
+        return;
 
-  ENTER("entity %p of type %d, page %p, event data %p",
-	entity, event_type, page, ed);
+    ENTER("entity %p of type %d, page %p, event data %p",
+          entity, event_type, page, ed);
 
-  window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
+    window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
 
-  if (GNC_IS_ACCOUNT(entity)) {
-    if (GNC_IS_MAIN_WINDOW(window)) {
-      label = gnc_plugin_page_register_get_tab_name(GNC_PLUGIN_PAGE(page));
-      main_window_update_page_name(GNC_PLUGIN_PAGE(page), label);
-      color = gnc_plugin_page_register_get_tab_color(GNC_PLUGIN_PAGE(page));
-      main_window_update_page_color(GNC_PLUGIN_PAGE(page), color);
-      g_free(color);
-      g_free(label);
+    if (GNC_IS_ACCOUNT(entity))
+    {
+        if (GNC_IS_MAIN_WINDOW(window))
+        {
+            label = gnc_plugin_page_register_get_tab_name(GNC_PLUGIN_PAGE(page));
+            main_window_update_page_name(GNC_PLUGIN_PAGE(page), label);
+            color = gnc_plugin_page_register_get_tab_color(GNC_PLUGIN_PAGE(page));
+            main_window_update_page_color(GNC_PLUGIN_PAGE(page), color);
+            g_free(color);
+            g_free(label);
+        }
+        LEAVE("tab name updated");
+        return;
     }
-    LEAVE("tab name updated");
-    return;
-  }
 
-  if (!(event_type & (QOF_EVENT_MODIFY | QOF_EVENT_DESTROY))) {
-    LEAVE("not a modify");
-    return;
-  }
-  trans = GNC_TRANS(entity);
-  book = qof_instance_get_book(QOF_INSTANCE(trans));
-  if (!gnc_plugin_page_has_book(GNC_PLUGIN_PAGE(page), book)) {
-      LEAVE("not in this book");
-      return;
-  }
+    if (!(event_type & (QOF_EVENT_MODIFY | QOF_EVENT_DESTROY)))
+    {
+        LEAVE("not a modify");
+        return;
+    }
+    trans = GNC_TRANS(entity);
+    book = qof_instance_get_book(QOF_INSTANCE(trans));
+    if (!gnc_plugin_page_has_book(GNC_PLUGIN_PAGE(page), book))
+    {
+        LEAVE("not in this book");
+        return;
+    }
 
-  if (GNC_IS_MAIN_WINDOW(window)) {
-    visible_page = gnc_main_window_get_current_page(GNC_MAIN_WINDOW(window));
-    if (visible_page != GNC_PLUGIN_PAGE(page)) {
-      LEAVE("page not visible");
-      return;
+    if (GNC_IS_MAIN_WINDOW(window))
+    {
+        visible_page = gnc_main_window_get_current_page(GNC_MAIN_WINDOW(window));
+        if (visible_page != GNC_PLUGIN_PAGE(page))
+        {
+            LEAVE("page not visible");
+            return;
+        }
     }
-  }
 
-  gnc_plugin_page_register_ui_update(NULL, page);
-  LEAVE(" ");
-  return;
+    gnc_plugin_page_register_ui_update(NULL, page);
+    LEAVE(" ");
+    return;
 }
 
 

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-page-register.h -- 
+/*
+ * gnc-plugin-page-register.h --
  *
  * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
@@ -26,7 +26,7 @@
     @{ */
 /** @addtogroup RegisterPlugin Register Page
     @{ */
-/** @file gnc-plugin-page-register.h 
+/** @file gnc-plugin-page-register.h
     @brief  Functions providing a register page for the GnuCash UI
     @author Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
     @author Copyright (C) 2003 David Hampton <hampton at employees.org>
@@ -54,12 +54,14 @@
 #define GNC_PLUGIN_PAGE_REGISTER_NAME "GncPluginPageRegister"
 
 /* typedefs & structures */
-typedef struct {
-	GncPluginPage gnc_plugin_page;
+typedef struct
+{
+    GncPluginPage gnc_plugin_page;
 } GncPluginPageRegister;
 
-typedef struct {
-	GncPluginPageClass gnc_plugin_page;
+typedef struct
+{
+    GncPluginPageClass gnc_plugin_page;
 } GncPluginPageRegisterClass;
 
 /* function prototypes */
@@ -125,9 +127,9 @@
  */
 void
 gnc_plugin_page_register_set_options (GncPluginPage *plugin_page,
-				      const char *lines_opt_page,
-				      const char *lines_opt_name,
-				      gint lines_default,
+                                      const char *lines_opt_page,
+                                      const char *lines_opt_name,
+                                      gint lines_default,
                                       gboolean read_only);
 
 

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -114,14 +114,21 @@
 static void gnc_plugin_page_sx_list_cmd_delete(GtkAction *action, GncPluginPageSxList *page);
 
 /* Command callbacks */
-static GtkActionEntry gnc_plugin_page_sx_list_actions [] = {
+static GtkActionEntry gnc_plugin_page_sx_list_actions [] =
+{
     { "SxListAction", NULL, N_("_Scheduled"), NULL, NULL, NULL },
-    { "SxListNewAction", GNC_STOCK_NEW_ACCOUNT, N_("_New"), NULL,
-      N_("Create a new scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_new) },
-    { "SxListEditAction", GNC_STOCK_EDIT_ACCOUNT, N_("_Edit"), NULL,
-      N_("Edit the selected scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_edit) },
-    { "SxListDeleteAction", GNC_STOCK_DELETE_ACCOUNT, N_("_Delete"), NULL,
-      N_("Delete the selected scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_delete) },
+    {
+        "SxListNewAction", GNC_STOCK_NEW_ACCOUNT, N_("_New"), NULL,
+        N_("Create a new scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_new)
+    },
+    {
+        "SxListEditAction", GNC_STOCK_EDIT_ACCOUNT, N_("_Edit"), NULL,
+        N_("Edit the selected scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_edit)
+    },
+    {
+        "SxListDeleteAction", GNC_STOCK_DELETE_ACCOUNT, N_("_Delete"), NULL,
+        N_("Delete the selected scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_delete)
+    },
 };
 /** The number of actions provided by this plugin. */
 static guint gnc_plugin_page_sx_list_n_actions = G_N_ELEMENTS (gnc_plugin_page_sx_list_actions);
@@ -131,8 +138,10 @@
 {
     static GType gnc_plugin_page_sx_list_type = 0;
 
-    if (gnc_plugin_page_sx_list_type == 0) {
-        static const GTypeInfo our_info = {
+    if (gnc_plugin_page_sx_list_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
             sizeof (GncPluginPageSxListClass),
             NULL,
             NULL,
@@ -145,8 +154,8 @@
         };
 
         gnc_plugin_page_sx_list_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
-                                                               GNC_PLUGIN_PAGE_SX_LIST_NAME,
-                                                               &our_info, 0);
+                                       GNC_PLUGIN_PAGE_SX_LIST_NAME,
+                                       &our_info, 0);
     }
 
     return gnc_plugin_page_sx_list_type;
@@ -286,9 +295,9 @@
     edit_action = gnc_plugin_page_get_action(page, "SxListEditAction");
     delete_action = gnc_plugin_page_get_action(page, "SxListDeleteAction");
     selection_state
-        = gtk_tree_selection_count_selected_rows(selection) == 0
-        ? FALSE
-        : TRUE;
+    = gtk_tree_selection_count_selected_rows(selection) == 0
+      ? FALSE
+      : TRUE;
     gtk_action_set_sensitive(edit_action, selection_state);
     gtk_action_set_sensitive(delete_action, selection_state);
 }
@@ -364,9 +373,9 @@
     }
 
     priv->gnc_component_id = gnc_register_gui_component("plugin-page-sx-list",
-                                                        gnc_plugin_page_sx_list_refresh_cb,
-                                                        gnc_plugin_page_sx_list_close_cb,
-                                                        page);
+                             gnc_plugin_page_sx_list_refresh_cb,
+                             gnc_plugin_page_sx_list_close_cb,
+                             page);
 
     return priv->widget;
 }
@@ -380,12 +389,14 @@
     page = GNC_PLUGIN_PAGE_SX_LIST (plugin_page);
     priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);
 
-    if (priv->widget) {
+    if (priv->widget)
+    {
         g_object_unref(G_OBJECT(priv->widget));
         priv->widget = NULL;
     }
 
-    if (priv->gnc_component_id) {
+    if (priv->gnc_component_id)
+    {
         gnc_unregister_gui_component(priv->gnc_component_id);
         priv->gnc_component_id = 0;
     }
@@ -459,7 +470,7 @@
     {
         GError *err = NULL;
         gint paned_position = g_key_file_get_integer(key_file, group_name,
-                                                     "paned_position", &err);
+                              "paned_position", &err);
         if (err == NULL)
             gtk_paned_set_position(GTK_PANED(priv->widget), paned_position);
         else
@@ -551,7 +562,7 @@
     book = gnc_get_current_book();
     sxes = gnc_book_get_schedxactions(book);
     gnc_sxes_del_sx(sxes, sx);
-	gnc_sx_begin_edit(sx);
+    gnc_sx_begin_edit(sx);
     xaccSchedXactionDestroy(sx);
 }
 

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,4 +1,4 @@
-/* 
+/*
  * gnc-plugin-page-sx-list.h
  *
  * Copyright (C) 2006 Josh Sled <jsled at asynchronous.org>

Modified: gnucash/trunk/src/gnome/gnc-plugin-register.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-register.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-register.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-register.c -- 
+/*
+ * gnc-plugin-register.c --
  *
  * Copyright (C) 2003 Jan Arne Petersen
  * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
@@ -44,16 +44,19 @@
 #define PLUGIN_UI_FILENAME  "gnc-plugin-register-ui.xml"
 #define GCONF_REGISTER_SECTION "general/register"
 
-static GtkActionEntry gnc_plugin_actions [] = {
-	{ "ToolsGeneralLedgerAction", NULL, N_("_General Ledger"), NULL,
-	  N_("Open a general ledger window"),
-	  G_CALLBACK (gnc_plugin_register_cmd_general_ledger) },
+static GtkActionEntry gnc_plugin_actions [] =
+{
+    {
+        "ToolsGeneralLedgerAction", NULL, N_("_General Ledger"), NULL,
+        N_("Open a general ledger window"),
+        G_CALLBACK (gnc_plugin_register_cmd_general_ledger)
+    },
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
 
 typedef struct GncPluginRegisterPrivate
 {
-	gpointer dummy;
+    gpointer dummy;
 } GncPluginRegisterPrivate;
 
 #define GNC_PLUGIN_REGISTER_GET_PRIVATE(o)  \
@@ -82,13 +85,13 @@
  */
 static void
 gnc_plugin_register_gconf_changed (GConfClient *client,
-				   guint cnxn_id,
-				   GConfEntry *entry,
-				   gpointer user_data)
+                                   guint cnxn_id,
+                                   GConfEntry *entry,
+                                   gpointer user_data)
 {
-	ENTER("");
-	gnc_gui_refresh_all ();
-	LEAVE("");
+    ENTER("");
+    gnc_gui_refresh_all ();
+    LEAVE("");
 }
 
 /************************************************************
@@ -98,67 +101,69 @@
 GType
 gnc_plugin_register_get_type (void)
 {
-	static GType gnc_plugin_register_type = 0;
+    static GType gnc_plugin_register_type = 0;
 
-	if (gnc_plugin_register_type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (GncPluginRegisterClass),
-			NULL,		/* base_init */
-			NULL,		/* base_finalize */
-			(GClassInitFunc) gnc_plugin_register_class_init,
-			NULL,		/* class_finalize */
-			NULL,		/* class_data */
-			sizeof (GncPluginRegister),
-			0,		/* n_preallocs */
-			(GInstanceInitFunc) gnc_plugin_register_init
-		};
-		
-		gnc_plugin_register_type = g_type_register_static (GNC_TYPE_PLUGIN,
-								   "GncPluginRegister",
-								   &our_info, 0);
-	}
+    if (gnc_plugin_register_type == 0)
+    {
+        static const GTypeInfo our_info =
+        {
+            sizeof (GncPluginRegisterClass),
+            NULL,		/* base_init */
+            NULL,		/* base_finalize */
+            (GClassInitFunc) gnc_plugin_register_class_init,
+            NULL,		/* class_finalize */
+            NULL,		/* class_data */
+            sizeof (GncPluginRegister),
+            0,		/* n_preallocs */
+            (GInstanceInitFunc) gnc_plugin_register_init
+        };
 
-	return gnc_plugin_register_type;
+        gnc_plugin_register_type = g_type_register_static (GNC_TYPE_PLUGIN,
+                                   "GncPluginRegister",
+                                   &our_info, 0);
+    }
+
+    return gnc_plugin_register_type;
 }
 
 GncPlugin *
 gnc_plugin_register_new (void)
 {
-	GncPluginRegister *plugin;
+    GncPluginRegister *plugin;
 
-	/* Reference the register page plugin to ensure it exists in
-	 * the gtk type system. */
-	GNC_TYPE_PLUGIN_PAGE_REGISTER;
+    /* Reference the register page plugin to ensure it exists in
+     * the gtk type system. */
+    GNC_TYPE_PLUGIN_PAGE_REGISTER;
 
-	plugin = g_object_new (GNC_TYPE_PLUGIN_REGISTER,
-			      NULL);
+    plugin = g_object_new (GNC_TYPE_PLUGIN_REGISTER,
+                           NULL);
 
-	return GNC_PLUGIN (plugin);
+    return GNC_PLUGIN (plugin);
 }
 
 static void
 gnc_plugin_register_class_init (GncPluginRegisterClass *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_register_finalize;
+    object_class->finalize = gnc_plugin_register_finalize;
 
-	/* plugin info */
-	plugin_class->plugin_name  = GNC_PLUGIN_REGISTER_NAME;
+    /* plugin info */
+    plugin_class->plugin_name  = GNC_PLUGIN_REGISTER_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;
 
-	plugin_class->gconf_section = GCONF_REGISTER_SECTION;
-	plugin_class->gconf_notifications = gnc_plugin_register_gconf_changed;
+    plugin_class->gconf_section = GCONF_REGISTER_SECTION;
+    plugin_class->gconf_notifications = gnc_plugin_register_gconf_changed;
 
-	g_type_class_add_private(klass, sizeof(GncPluginRegisterPrivate));
+    g_type_class_add_private(klass, sizeof(GncPluginRegisterPrivate));
 }
 
 static void
@@ -169,15 +174,15 @@
 static void
 gnc_plugin_register_finalize (GObject *object)
 {
-	GncPluginRegister *plugin;
-	GncPluginRegisterPrivate *priv;
+    GncPluginRegister *plugin;
+    GncPluginRegisterPrivate *priv;
 
-	g_return_if_fail (GNC_IS_PLUGIN_REGISTER (object));
+    g_return_if_fail (GNC_IS_PLUGIN_REGISTER (object));
 
-	plugin = GNC_PLUGIN_REGISTER (object);
-	priv = GNC_PLUGIN_REGISTER_GET_PRIVATE(plugin);
+    plugin = GNC_PLUGIN_REGISTER (object);
+    priv = GNC_PLUGIN_REGISTER_GET_PRIVATE(plugin);
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 /************************************************************
@@ -186,12 +191,12 @@
 
 static void
 gnc_plugin_register_cmd_general_ledger (GtkAction *action,
-					GncMainWindowActionData *data)
+                                        GncMainWindowActionData *data)
 {
-	GncPluginPage *page;
+    GncPluginPage *page;
 
-	g_return_if_fail (data != NULL);
+    g_return_if_fail (data != NULL);
 
-	page = gnc_plugin_page_register_new_gl ();
-	gnc_main_window_open_page (data->window, page);
+    page = gnc_plugin_page_register_new_gl ();
+    gnc_main_window_open_page (data->window, page);
 }

Modified: gnucash/trunk/src/gnome/gnc-plugin-register.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-register.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-plugin-register.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -1,5 +1,5 @@
-/* 
- * gnc-plugin-register.h -- 
+/*
+ * gnc-plugin-register.h --
  *
  * Copyright (C) 2003 Jan Arne Petersen
  * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
@@ -40,12 +40,14 @@
 #define GNC_PLUGIN_REGISTER_NAME "gnc-plugin-register"
 
 /* typedefs & structures */
-typedef struct {
-	GncPlugin gnc_plugin;
+typedef struct
+{
+    GncPlugin gnc_plugin;
 } GncPluginRegister;
 
-typedef struct {
-	GncPluginClass gnc_plugin;
+typedef struct
+{
+    GncPluginClass gnc_plugin;
 } GncPluginRegisterClass;
 
 /* function prototypes */

Modified: gnucash/trunk/src/gnome/gnc-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-split-reg.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-split-reg.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -88,7 +88,7 @@
 static void gnc_split_reg_ld_destroy( GNCLedgerDisplay *ledger );
 
 static Transaction* create_balancing_transaction(QofBook *book, Account *account,
-    time_t statement_date, gnc_numeric balancing_amount);
+        time_t statement_date, gnc_numeric balancing_amount);
 
 void gsr_default_enter_handler    ( GNCSplitReg *w, gpointer ud );
 void gsr_default_cancel_handler   ( GNCSplitReg *w, gpointer ud );
@@ -175,53 +175,55 @@
 GType
 gnc_split_reg_get_type( void )
 {
-  static GType gnc_split_reg_type = 0;
+    static GType gnc_split_reg_type = 0;
 
-  if (!gnc_split_reg_type)
+    if (!gnc_split_reg_type)
     {
-      GTypeInfo type_info = {
-	sizeof(GNCSplitRegClass),      /* class_size */
-	NULL,   			/* base_init */
-	NULL,				/* base_finalize */
-	(GClassInitFunc)gnc_split_reg_class_init,
-	NULL,				/* class_finalize */
-	NULL,				/* class_data */
-	sizeof(GNCSplitReg),		/* */
-	0,				/* n_preallocs */
-	(GInstanceInitFunc)gnc_split_reg_init,
-      };
+        GTypeInfo type_info =
+        {
+            sizeof(GNCSplitRegClass),      /* class_size */
+            NULL,   			/* base_init */
+            NULL,				/* base_finalize */
+            (GClassInitFunc)gnc_split_reg_class_init,
+            NULL,				/* class_finalize */
+            NULL,				/* class_data */
+            sizeof(GNCSplitReg),		/* */
+            0,				/* n_preallocs */
+            (GInstanceInitFunc)gnc_split_reg_init,
+        };
 
-      gnc_split_reg_type = g_type_register_static( GTK_TYPE_VBOX,
-						   "GNCSplitReg",
-						   &type_info, 0 );
+        gnc_split_reg_type = g_type_register_static( GTK_TYPE_VBOX,
+                             "GNCSplitReg",
+                             &type_info, 0 );
     }
 
-  return gnc_split_reg_type;
+    return gnc_split_reg_type;
 }
 
 /* SIGNALS */
-enum gnc_split_reg_signal_enum {
-  ENTER_ENT_SIGNAL,
-  CANCEL_ENT_SIGNAL,
-  DELETE_ENT_SIGNAL,
-  REINIT_ENT_SIGNAL,
-  DUP_ENT_SIGNAL,
-  SCHEDULE_ENT_SIGNAL,
-  EXPAND_ENT_SIGNAL,
-  BLANK_SIGNAL,
-  JUMP_SIGNAL,
-  CUT_SIGNAL,
-  CUT_TXN_SIGNAL,
-  COPY_SIGNAL,
-  COPY_TXN_SIGNAL,
-  PASTE_SIGNAL,
-  PASTE_TXN_SIGNAL,
-  VOID_TXN_SIGNAL,
-  UNVOID_TXN_SIGNAL,
-  REVERSE_TXN_SIGNAL,
-  HELP_CHANGED_SIGNAL,
-  INCLUDE_DATE_SIGNAL,
-  LAST_SIGNAL
+enum gnc_split_reg_signal_enum
+{
+    ENTER_ENT_SIGNAL,
+    CANCEL_ENT_SIGNAL,
+    DELETE_ENT_SIGNAL,
+    REINIT_ENT_SIGNAL,
+    DUP_ENT_SIGNAL,
+    SCHEDULE_ENT_SIGNAL,
+    EXPAND_ENT_SIGNAL,
+    BLANK_SIGNAL,
+    JUMP_SIGNAL,
+    CUT_SIGNAL,
+    CUT_TXN_SIGNAL,
+    COPY_SIGNAL,
+    COPY_TXN_SIGNAL,
+    PASTE_SIGNAL,
+    PASTE_TXN_SIGNAL,
+    VOID_TXN_SIGNAL,
+    UNVOID_TXN_SIGNAL,
+    REVERSE_TXN_SIGNAL,
+    HELP_CHANGED_SIGNAL,
+    INCLUDE_DATE_SIGNAL,
+    LAST_SIGNAL
 };
 
 static guint gnc_split_reg_signals[LAST_SIGNAL] = { 0 };
@@ -229,83 +231,86 @@
 static void
 gnc_split_reg_class_init( GNCSplitRegClass *class )
 {
-  int i;
-  GtkObjectClass *object_class;
-  static struct similar_signal_info {
-    enum gnc_split_reg_signal_enum s;
-    const char *signal_name;
-    guint defaultOffset;
-  } signals[] = {
-    { ENTER_ENT_SIGNAL,    "enter_ent",    G_STRUCT_OFFSET( GNCSplitRegClass, enter_ent_cb ) },
-    { CANCEL_ENT_SIGNAL,   "cancel_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, cancel_ent_cb ) },
-    { DELETE_ENT_SIGNAL,   "delete_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, delete_ent_cb ) },
-    { REINIT_ENT_SIGNAL,   "reinit_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, reinit_ent_cb ) },
-    { DUP_ENT_SIGNAL,      "dup_ent",      G_STRUCT_OFFSET( GNCSplitRegClass, dup_ent_cb ) },
-    { SCHEDULE_ENT_SIGNAL, "schedule_ent", G_STRUCT_OFFSET( GNCSplitRegClass, schedule_ent_cb ) },
-    { EXPAND_ENT_SIGNAL,   "expand_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, expand_ent_cb ) },
-    { BLANK_SIGNAL,        "blank",        G_STRUCT_OFFSET( GNCSplitRegClass, blank_cb ) },
-    { JUMP_SIGNAL,         "jump",         G_STRUCT_OFFSET( GNCSplitRegClass, jump_cb ) },
-    { CUT_SIGNAL,          "cut",          G_STRUCT_OFFSET( GNCSplitRegClass, cut_cb ) },
-    { CUT_TXN_SIGNAL,      "cut_txn",      G_STRUCT_OFFSET( GNCSplitRegClass, cut_txn_cb ) },
-    { COPY_SIGNAL,         "copy",         G_STRUCT_OFFSET( GNCSplitRegClass, copy_cb ) },
-    { COPY_TXN_SIGNAL,     "copy_txn",     G_STRUCT_OFFSET( GNCSplitRegClass, copy_txn_cb ) },
-    { PASTE_SIGNAL,        "paste",        G_STRUCT_OFFSET( GNCSplitRegClass, paste_cb ) },
-    { PASTE_TXN_SIGNAL,    "paste_txn",    G_STRUCT_OFFSET( GNCSplitRegClass, paste_txn_cb ) },
-    { VOID_TXN_SIGNAL,     "void_txn",     G_STRUCT_OFFSET( GNCSplitRegClass, void_txn_cb ) },
-    { UNVOID_TXN_SIGNAL,   "unvoid_txn",   G_STRUCT_OFFSET( GNCSplitRegClass, unvoid_txn_cb ) },
-    { REVERSE_TXN_SIGNAL,  "reverse_txn",  G_STRUCT_OFFSET( GNCSplitRegClass, reverse_txn_cb ) },
-    { HELP_CHANGED_SIGNAL, "help-changed", G_STRUCT_OFFSET( GNCSplitRegClass, help_changed_cb ) },
-    { INCLUDE_DATE_SIGNAL, "include-date", G_STRUCT_OFFSET( GNCSplitRegClass, include_date_cb ) },
-    { LAST_SIGNAL, NULL, 0 }
-  };
+    int i;
+    GtkObjectClass *object_class;
+    static struct similar_signal_info
+    {
+        enum gnc_split_reg_signal_enum s;
+        const char *signal_name;
+        guint defaultOffset;
+    } signals[] =
+    {
+        { ENTER_ENT_SIGNAL,    "enter_ent",    G_STRUCT_OFFSET( GNCSplitRegClass, enter_ent_cb ) },
+        { CANCEL_ENT_SIGNAL,   "cancel_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, cancel_ent_cb ) },
+        { DELETE_ENT_SIGNAL,   "delete_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, delete_ent_cb ) },
+        { REINIT_ENT_SIGNAL,   "reinit_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, reinit_ent_cb ) },
+        { DUP_ENT_SIGNAL,      "dup_ent",      G_STRUCT_OFFSET( GNCSplitRegClass, dup_ent_cb ) },
+        { SCHEDULE_ENT_SIGNAL, "schedule_ent", G_STRUCT_OFFSET( GNCSplitRegClass, schedule_ent_cb ) },
+        { EXPAND_ENT_SIGNAL,   "expand_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, expand_ent_cb ) },
+        { BLANK_SIGNAL,        "blank",        G_STRUCT_OFFSET( GNCSplitRegClass, blank_cb ) },
+        { JUMP_SIGNAL,         "jump",         G_STRUCT_OFFSET( GNCSplitRegClass, jump_cb ) },
+        { CUT_SIGNAL,          "cut",          G_STRUCT_OFFSET( GNCSplitRegClass, cut_cb ) },
+        { CUT_TXN_SIGNAL,      "cut_txn",      G_STRUCT_OFFSET( GNCSplitRegClass, cut_txn_cb ) },
+        { COPY_SIGNAL,         "copy",         G_STRUCT_OFFSET( GNCSplitRegClass, copy_cb ) },
+        { COPY_TXN_SIGNAL,     "copy_txn",     G_STRUCT_OFFSET( GNCSplitRegClass, copy_txn_cb ) },
+        { PASTE_SIGNAL,        "paste",        G_STRUCT_OFFSET( GNCSplitRegClass, paste_cb ) },
+        { PASTE_TXN_SIGNAL,    "paste_txn",    G_STRUCT_OFFSET( GNCSplitRegClass, paste_txn_cb ) },
+        { VOID_TXN_SIGNAL,     "void_txn",     G_STRUCT_OFFSET( GNCSplitRegClass, void_txn_cb ) },
+        { UNVOID_TXN_SIGNAL,   "unvoid_txn",   G_STRUCT_OFFSET( GNCSplitRegClass, unvoid_txn_cb ) },
+        { REVERSE_TXN_SIGNAL,  "reverse_txn",  G_STRUCT_OFFSET( GNCSplitRegClass, reverse_txn_cb ) },
+        { HELP_CHANGED_SIGNAL, "help-changed", G_STRUCT_OFFSET( GNCSplitRegClass, help_changed_cb ) },
+        { INCLUDE_DATE_SIGNAL, "include-date", G_STRUCT_OFFSET( GNCSplitRegClass, include_date_cb ) },
+        { LAST_SIGNAL, NULL, 0 }
+    };
 
-  object_class = (GtkObjectClass*) class;
+    object_class = (GtkObjectClass*) class;
 
-  for ( i=0; signals[i].s != INCLUDE_DATE_SIGNAL; i++ ) {
-    gnc_split_reg_signals[ signals[i].s ] =
-      g_signal_new( signals[i].signal_name,
-                    G_TYPE_FROM_CLASS(object_class),
-                    G_SIGNAL_RUN_LAST,
-                    signals[i].defaultOffset,
-                    NULL, NULL, 
-                    g_cclosure_marshal_VOID__VOID,
-                    G_TYPE_NONE, 0 );
-  }
-  /* Setup the non-default-marshalled signals; 'i' is still valid, here. */
-  /* "include-date" */
-  gnc_split_reg_signals[ INCLUDE_DATE_SIGNAL ] =
-    g_signal_new( "include-date",
-                  G_TYPE_FROM_CLASS(object_class),
-                  G_SIGNAL_RUN_LAST,
-                  signals[i++].defaultOffset,
-                  NULL, NULL, 
-                  g_cclosure_marshal_VOID__INT, /* time_t == int */
-                  G_TYPE_NONE, 1, G_TYPE_INT );
+    for ( i = 0; signals[i].s != INCLUDE_DATE_SIGNAL; i++ )
+    {
+        gnc_split_reg_signals[ signals[i].s ] =
+            g_signal_new( signals[i].signal_name,
+                          G_TYPE_FROM_CLASS(object_class),
+                          G_SIGNAL_RUN_LAST,
+                          signals[i].defaultOffset,
+                          NULL, NULL,
+                          g_cclosure_marshal_VOID__VOID,
+                          G_TYPE_NONE, 0 );
+    }
+    /* Setup the non-default-marshalled signals; 'i' is still valid, here. */
+    /* "include-date" */
+    gnc_split_reg_signals[ INCLUDE_DATE_SIGNAL ] =
+        g_signal_new( "include-date",
+                      G_TYPE_FROM_CLASS(object_class),
+                      G_SIGNAL_RUN_LAST,
+                      signals[i++].defaultOffset,
+                      NULL, NULL,
+                      g_cclosure_marshal_VOID__INT, /* time_t == int */
+                      G_TYPE_NONE, 1, G_TYPE_INT );
 
-  g_assert( i == LAST_SIGNAL );
+    g_assert( i == LAST_SIGNAL );
 
-  /* Setup the default handlers. */
-  class->enter_ent_cb    = gsr_default_enter_handler;
-  class->cancel_ent_cb   = gsr_default_cancel_handler;
-  class->delete_ent_cb   = gsr_default_delete_handler;
-  class->reinit_ent_cb   = gsr_default_reinit_handler;
-  class->dup_ent_cb      = gsr_default_dup_handler;
-  class->schedule_ent_cb = gsr_default_schedule_handler;
-  class->expand_ent_cb   = gsr_default_expand_handler;
-  class->blank_cb        = gsr_default_blank_handler;
-  class->jump_cb         = gsr_default_jump_handler;
-  class->cut_cb          = gsr_default_cut_handler;
-  class->cut_txn_cb      = gsr_default_cut_txn_handler;
-  class->copy_cb         = gsr_default_copy_handler;
-  class->copy_txn_cb     = gsr_default_copy_txn_handler;
-  class->paste_cb        = gsr_default_paste_handler;
-  class->paste_txn_cb    = gsr_default_paste_txn_handler;
-  class->void_txn_cb     = gsr_default_void_txn_handler;
-  class->unvoid_txn_cb   = gsr_default_unvoid_txn_handler;
-  class->reverse_txn_cb  = gsr_default_reverse_txn_handler;
+    /* Setup the default handlers. */
+    class->enter_ent_cb    = gsr_default_enter_handler;
+    class->cancel_ent_cb   = gsr_default_cancel_handler;
+    class->delete_ent_cb   = gsr_default_delete_handler;
+    class->reinit_ent_cb   = gsr_default_reinit_handler;
+    class->dup_ent_cb      = gsr_default_dup_handler;
+    class->schedule_ent_cb = gsr_default_schedule_handler;
+    class->expand_ent_cb   = gsr_default_expand_handler;
+    class->blank_cb        = gsr_default_blank_handler;
+    class->jump_cb         = gsr_default_jump_handler;
+    class->cut_cb          = gsr_default_cut_handler;
+    class->cut_txn_cb      = gsr_default_cut_txn_handler;
+    class->copy_cb         = gsr_default_copy_handler;
+    class->copy_txn_cb     = gsr_default_copy_txn_handler;
+    class->paste_cb        = gsr_default_paste_handler;
+    class->paste_txn_cb    = gsr_default_paste_txn_handler;
+    class->void_txn_cb     = gsr_default_void_txn_handler;
+    class->unvoid_txn_cb   = gsr_default_unvoid_txn_handler;
+    class->reverse_txn_cb  = gsr_default_reverse_txn_handler;
 
-  class->help_changed_cb = NULL;
-  class->include_date_cb = NULL;
+    class->help_changed_cb = NULL;
+    class->include_date_cb = NULL;
 }
 
 GtkWidget*
@@ -314,115 +319,115 @@
                    gint numberOfLines,
                    gboolean read_only )
 {
-  GNCSplitReg *gsrToRet;
+    GNCSplitReg *gsrToRet;
 
-  ENTER("ld=%p, parent=%p, numberOfLines=%d, read_only=%s",
-        ld, parent, numberOfLines, read_only? "TRUE" : "FALSE");
+    ENTER("ld=%p, parent=%p, numberOfLines=%d, read_only=%s",
+          ld, parent, numberOfLines, read_only ? "TRUE" : "FALSE");
 
-  gsrToRet = g_object_new( gnc_split_reg_get_type(), NULL );
+    gsrToRet = g_object_new( gnc_split_reg_get_type(), NULL );
 
-  gsrToRet->numRows        = numberOfLines;
-  gsrToRet->read_only      = read_only;
+    gsrToRet->numRows        = numberOfLines;
+    gsrToRet->read_only      = read_only;
 
-  gsrToRet->ledger = ld;
-  gsrToRet->window = GTK_WIDGET(parent);
+    gsrToRet->ledger = ld;
+    gsrToRet->window = GTK_WIDGET(parent);
 
-  gnc_split_reg_init2( gsrToRet );
+    gnc_split_reg_init2( gsrToRet );
 
-  LEAVE("%p", gsrToRet);
-  return GTK_WIDGET( gsrToRet );
+    LEAVE("%p", gsrToRet);
+    return GTK_WIDGET( gsrToRet );
 }
 
-static void 
+static void
 gnc_split_reg_init( GNCSplitReg *gsr )
 {
-  gsr->sort_type = BY_STANDARD;
-  gsr->width = -1;
-  gsr->height = -1;
-  gsr->numRows = gnc_gconf_get_float(GCONF_GENERAL_REGISTER,
-				     KEY_NUMBER_OF_ROWS, NULL);
-  gsr->read_only = FALSE;
+    gsr->sort_type = BY_STANDARD;
+    gsr->width = -1;
+    gsr->height = -1;
+    gsr->numRows = gnc_gconf_get_float(GCONF_GENERAL_REGISTER,
+                                       KEY_NUMBER_OF_ROWS, NULL);
+    gsr->read_only = FALSE;
 
-  g_signal_connect( gsr, "destroy",
-                    G_CALLBACK (gnc_split_reg_destroy_cb), gsr );
+    g_signal_connect( gsr, "destroy",
+                      G_CALLBACK (gnc_split_reg_destroy_cb), gsr );
 }
 
-static void 
+static void
 gnc_split_reg_init2( GNCSplitReg *gsr )
 {
-  if ( !gsr ) return;
+    if ( !gsr ) return;
 
-  gnc_split_reg_determine_read_only( gsr );
+    gnc_split_reg_determine_read_only( gsr );
 
-  gsr_setup_status_widgets( gsr );
-  /* ordering is important here... setup_status before create_table */
-  gsr_create_table( gsr );
-  gsr_setup_table( gsr );
+    gsr_setup_status_widgets( gsr );
+    /* ordering is important here... setup_status before create_table */
+    gsr_create_table( gsr );
+    gsr_setup_table( gsr );
 }
 
 static
 void
 gsr_setup_table( GNCSplitReg *gsr )
 {
-  SplitRegister *sr;
+    SplitRegister *sr;
 
-  ENTER("gsr=%p", gsr);
+    ENTER("gsr=%p", gsr);
 
-  sr = gnc_ledger_display_get_split_register( gsr->ledger );
-  gnc_split_register_show_present_divider( sr, TRUE );
-  /* events should be sufficient to redraw this */
-  /* gnc_ledger_display_refresh( gsr->ledger ); */
-  gnc_split_reg_refresh_toolbar( gsr );
+    sr = gnc_ledger_display_get_split_register( gsr->ledger );
+    gnc_split_register_show_present_divider( sr, TRUE );
+    /* events should be sufficient to redraw this */
+    /* gnc_ledger_display_refresh( gsr->ledger ); */
+    gnc_split_reg_refresh_toolbar( gsr );
 
-  LEAVE(" ");
+    LEAVE(" ");
 }
 
 static
 void
 gsr_create_table( GNCSplitReg *gsr )
 {
-  GtkWidget *register_widget;
-  SplitRegister *sr;
+    GtkWidget *register_widget;
+    SplitRegister *sr;
 
-  ENTER("gsr=%p", gsr);
+    ENTER("gsr=%p", gsr);
 
-  gnc_ledger_display_set_user_data( gsr->ledger, (gpointer)gsr );
-  gnc_ledger_display_set_handlers( gsr->ledger,
-                                   gnc_split_reg_ld_destroy,
-                                   gnc_split_reg_get_parent );
+    gnc_ledger_display_set_user_data( gsr->ledger, (gpointer)gsr );
+    gnc_ledger_display_set_handlers( gsr->ledger,
+                                     gnc_split_reg_ld_destroy,
+                                     gnc_split_reg_get_parent );
 
-  /* FIXME: We'd really rather pass this down... */
-  sr = gnc_ledger_display_get_split_register( gsr->ledger );
-  gnucash_register_set_initial_rows( gsr->numRows );
-  register_widget = gnucash_register_new( sr->table );
-  gsr->reg = GNUCASH_REGISTER( register_widget );
-  gnc_table_init_gui( GTK_WIDGET(gsr->reg), sr );
+    /* FIXME: We'd really rather pass this down... */
+    sr = gnc_ledger_display_get_split_register( gsr->ledger );
+    gnucash_register_set_initial_rows( gsr->numRows );
+    register_widget = gnucash_register_new( sr->table );
+    gsr->reg = GNUCASH_REGISTER( register_widget );
+    gnc_table_init_gui( GTK_WIDGET(gsr->reg), sr );
 
-  gtk_box_pack_start (GTK_BOX (gsr), GTK_WIDGET(gsr->reg), TRUE, TRUE, 0);
-  GNUCASH_SHEET(gsr->reg->sheet)->window = gsr->window;
-  gtk_widget_show ( GTK_WIDGET(gsr->reg) );
-  g_signal_connect (gsr->reg, "activate_cursor",
-                    G_CALLBACK(gnc_split_reg_record_cb), gsr);
-  g_signal_connect (gsr->reg, "redraw_all",
-                    G_CALLBACK(gsr_redraw_all_cb), gsr);
-  g_signal_connect (gsr->reg, "redraw_help",
-                    G_CALLBACK(gsr_emit_help_changed), gsr);
+    gtk_box_pack_start (GTK_BOX (gsr), GTK_WIDGET(gsr->reg), TRUE, TRUE, 0);
+    GNUCASH_SHEET(gsr->reg->sheet)->window = gsr->window;
+    gtk_widget_show ( GTK_WIDGET(gsr->reg) );
+    g_signal_connect (gsr->reg, "activate_cursor",
+                      G_CALLBACK(gnc_split_reg_record_cb), gsr);
+    g_signal_connect (gsr->reg, "redraw_all",
+                      G_CALLBACK(gsr_redraw_all_cb), gsr);
+    g_signal_connect (gsr->reg, "redraw_help",
+                      G_CALLBACK(gsr_emit_help_changed), gsr);
 
-  LEAVE(" ");
+    LEAVE(" ");
 }
 
 static
 void
 gsr_setup_status_widgets( GNCSplitReg *gsr )
 {
-  SplitRegister *sr;
-  gboolean use_double_line;
+    SplitRegister *sr;
+    gboolean use_double_line;
 
-  sr = gnc_ledger_display_get_split_register( gsr->ledger );
-  use_double_line = gnc_ledger_display_default_double_line( gsr->ledger );
+    sr = gnc_ledger_display_get_split_register( gsr->ledger );
+    use_double_line = gnc_ledger_display_default_double_line( gsr->ledger );
 
-  /* be sure to initialize the gui elements associated with the cursor */
-  gnc_split_register_config( sr, sr->type, sr->style, use_double_line );
+    /* be sure to initialize the gui elements associated with the cursor */
+    gnc_split_register_config( sr, sr->type, sr->style, use_double_line );
 }
 
 void
@@ -436,13 +441,13 @@
 void
 gnc_split_reg_raise( GNCSplitReg *gsr )
 {
-  if (gsr == NULL)
-    return;
+    if (gsr == NULL)
+        return;
 
-  if (gsr->window == NULL)
-    return;
+    if (gsr->window == NULL)
+        return;
 
-  gtk_window_present( GTK_WINDOW(gsr->window) );
+    gtk_window_present( GTK_WINDOW(gsr->window) );
 }
 
 
@@ -460,103 +465,105 @@
                           gboolean reverse,
                           gboolean euroFlag )
 {
-  gnc_numeric amount;
-  char string[256];
+    gnc_numeric amount;
+    char string[256];
 
-  if ( label == NULL )
-    return;
+    if ( label == NULL )
+        return;
 
-  amount = (*getter)( leader );
+    amount = (*getter)( leader );
 
-  if ( reverse ) {
-    amount = gnc_numeric_neg( amount );
-  }
+    if ( reverse )
+    {
+        amount = gnc_numeric_neg( amount );
+    }
 
-  xaccSPrintAmount( string, amount, print_info );
+    xaccSPrintAmount( string, amount, print_info );
 
-  if ( euroFlag ) {
-    strcat( string, " / " );
-    xaccSPrintAmount( string + strlen( string ),
-                      gnc_convert_to_euro( cmdty, amount ),
-                      gnc_commodity_print_info( gnc_get_euro(), TRUE ) );
-  }
-  
-  gnc_set_label_color( label, amount );
-  gtk_label_set_text( GTK_LABEL(label), string );
+    if ( euroFlag )
+    {
+        strcat( string, " / " );
+        xaccSPrintAmount( string + strlen( string ),
+                          gnc_convert_to_euro( cmdty, amount ),
+                          gnc_commodity_print_info( gnc_get_euro(), TRUE ) );
+    }
+
+    gnc_set_label_color( label, amount );
+    gtk_label_set_text( GTK_LABEL(label), string );
 }
 
 static GNCPrice *
 account_latest_price (Account *account)
 {
-  QofBook *book;
-  GNCPriceDB *pdb;
-  gnc_commodity *commodity;
-  gnc_commodity *currency;
+    QofBook *book;
+    GNCPriceDB *pdb;
+    gnc_commodity *commodity;
+    gnc_commodity *currency;
 
-  if (!account) return NULL;
-  commodity = xaccAccountGetCommodity (account);
-  currency = gnc_default_currency ();
+    if (!account) return NULL;
+    commodity = xaccAccountGetCommodity (account);
+    currency = gnc_default_currency ();
 
-  book = gnc_account_get_book (account);
-  pdb = gnc_book_get_pricedb (book);
+    book = gnc_account_get_book (account);
+    pdb = gnc_book_get_pricedb (book);
 
-  return gnc_pricedb_lookup_latest (pdb, commodity, currency);
+    return gnc_pricedb_lookup_latest (pdb, commodity, currency);
 }
 
 static GNCPrice *
 account_latest_price_any_currency (Account *account)
 {
-  QofBook *book;
-  GNCPriceDB *pdb;
-  gnc_commodity *commodity;
-  GList *price_list;
-  GNCPrice *result;
+    QofBook *book;
+    GNCPriceDB *pdb;
+    gnc_commodity *commodity;
+    GList *price_list;
+    GNCPrice *result;
 
-  if (!account) return NULL;
-  commodity = xaccAccountGetCommodity (account);
+    if (!account) return NULL;
+    commodity = xaccAccountGetCommodity (account);
 
-  book = gnc_account_get_book (account);
-  pdb = gnc_book_get_pricedb (book);
+    book = gnc_account_get_book (account);
+    pdb = gnc_book_get_pricedb (book);
 
-  price_list = gnc_pricedb_lookup_latest_any_currency (pdb, commodity);
-  if (!price_list) return NULL;
+    price_list = gnc_pricedb_lookup_latest_any_currency (pdb, commodity);
+    if (!price_list) return NULL;
 
-  result = gnc_price_clone((GNCPrice *)(price_list->data), book);
+    result = gnc_price_clone((GNCPrice *)(price_list->data), book);
 
-  gnc_price_list_destroy(price_list);
+    gnc_price_list_destroy(price_list);
 
-  return result;
+    return result;
 }
 
 static
 void
 gsr_redraw_all_cb (GnucashRegister *g_reg, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_commodity * commodity;
-  GNCPrintAmountInfo print_info;
-  gnc_numeric amount;
-  char string[256];
-  Account *leader;
-  gboolean reverse;
-  gboolean euro;
+    GNCSplitReg *gsr = data;
+    gnc_commodity * commodity;
+    GNCPrintAmountInfo print_info;
+    gnc_numeric amount;
+    char string[256];
+    Account *leader;
+    gboolean reverse;
+    gboolean euro;
 
-  if ( gsr->summarybar == NULL )
-    return;
+    if ( gsr->summarybar == NULL )
+        return;
 
-  leader = gnc_ledger_display_leader( gsr->ledger );
+    leader = gnc_ledger_display_leader( gsr->ledger );
 
-  commodity = xaccAccountGetCommodity( leader );
+    commodity = xaccAccountGetCommodity( leader );
 
-  /* no EURO converson, if account is already EURO or no EURO currency */
-  if (commodity != NULL)
-    euro = (gnc_is_euro_currency( commodity ) &&
-            (strncasecmp(gnc_commodity_get_mnemonic(commodity), "EUR", 3)));
-  else
-    euro = FALSE;
+    /* no EURO converson, if account is already EURO or no EURO currency */
+    if (commodity != NULL)
+        euro = (gnc_is_euro_currency( commodity ) &&
+                (strncasecmp(gnc_commodity_get_mnemonic(commodity), "EUR", 3)));
+    else
+        euro = FALSE;
 
-  print_info = gnc_account_print_info( leader, TRUE );
-  reverse = gnc_reverse_balance( leader );
+    print_info = gnc_account_print_info( leader, TRUE );
+    reverse = gnc_reverse_balance( leader );
 
     gsr_update_summary_label( gsr->balance_label,
                               xaccAccountGetPresentBalance,
@@ -576,22 +583,22 @@
 
     /* Print the summary share amount */
     if (gsr->shares_label != NULL)
-      {
+    {
         print_info = gnc_account_print_info( leader, TRUE );
 
         amount = xaccAccountGetBalance( leader );
         if (reverse)
-          amount = gnc_numeric_neg( amount );
+            amount = gnc_numeric_neg( amount );
 
         xaccSPrintAmount( string, amount, print_info );
 
         gnc_set_label_color( gsr->shares_label, amount );
         gtk_label_set_text( GTK_LABEL(gsr->shares_label), string );
-      }
+    }
 
     /* Print the summary share value */
     if (gsr->value_label != NULL)
-      {
+    {
         GNCPrice *price;
 
         amount = xaccAccountGetBalance (leader);
@@ -599,64 +606,64 @@
 
         price = account_latest_price (leader);
         if (!price)
-          {
+        {
             /* If the balance is zero, then print zero. */
             if (gnc_numeric_equal(amount, gnc_numeric_zero()))
-              {
-                 gnc_commodity *currency = gnc_default_currency ();
-                 print_info = gnc_commodity_print_info (currency, TRUE);
-                 amount = gnc_numeric_zero ();
+            {
+                gnc_commodity *currency = gnc_default_currency ();
+                print_info = gnc_commodity_print_info (currency, TRUE);
+                amount = gnc_numeric_zero ();
 
-                 xaccSPrintAmount (string, amount, print_info);
+                xaccSPrintAmount (string, amount, print_info);
 
-                 gnc_set_label_color (gsr->value_label, amount);
-                 gtk_label_set_text (GTK_LABEL (gsr->value_label), string);
-              }
+                gnc_set_label_color (gsr->value_label, amount);
+                gtk_label_set_text (GTK_LABEL (gsr->value_label), string);
+            }
             else
-              {
+            {
                 /* else try to do a double-price-conversion :-( */
                 price = account_latest_price_any_currency (leader);
-                if(!price)
-                  {
-                     gnc_set_label_color (gsr->value_label, gnc_numeric_zero ());
-                     gtk_label_set_text (GTK_LABEL (gsr->value_label),
-                                           _("<No information>"));
-                  }
+                if (!price)
+                {
+                    gnc_set_label_color (gsr->value_label, gnc_numeric_zero ());
+                    gtk_label_set_text (GTK_LABEL (gsr->value_label),
+                                        _("<No information>"));
+                }
                 else
-                  {
+                {
                     gnc_commodity *currency = gnc_price_get_currency (price);
                     gnc_commodity *default_currency = gnc_default_currency ();
                     gnc_numeric currency_amount;
                     gnc_numeric default_currency_amount;
-    
+
                     print_info = gnc_commodity_print_info (currency, TRUE);
-    
+
                     currency_amount =
-                      xaccAccountConvertBalanceToCurrency(leader, amount,
-                                                          commodity, currency);
+                        xaccAccountConvertBalanceToCurrency(leader, amount,
+                                                            commodity, currency);
                     xaccSPrintAmount (string, currency_amount, print_info);
-    
+
                     default_currency_amount =
-                      xaccAccountConvertBalanceToCurrency(leader, amount,
-                                                          commodity,
-                                                          default_currency);
-                    if(!gnc_numeric_zero_p(default_currency_amount))
-                      {
+                        xaccAccountConvertBalanceToCurrency(leader, amount,
+                                                            commodity,
+                                                            default_currency);
+                    if (!gnc_numeric_zero_p(default_currency_amount))
+                    {
                         strcat( string, " / " );
                         print_info = gnc_commodity_print_info (default_currency, TRUE);
                         xaccSPrintAmount( string + strlen( string ), default_currency_amount,
                                           print_info);
-                      }
-    
+                    }
+
                     gnc_set_label_color (gsr->value_label, amount);
                     gtk_label_set_text (GTK_LABEL (gsr->value_label), string);
-    
+
                     gnc_price_unref (price);
-                  }
-              }
-          }
+                }
+            }
+        }
         else
-          {
+        {
             gnc_commodity *currency = gnc_price_get_currency (price);
 
             print_info = gnc_commodity_print_info (currency, TRUE);
@@ -671,96 +678,96 @@
             gtk_label_set_text (GTK_LABEL (gsr->value_label), string);
 
             gnc_price_unref (price);
-          }
-      }
+        }
+    }
 }
 
 static void
 gnc_split_reg_refresh_toolbar( GNCSplitReg *gsr )
 {
-  GtkToolbarStyle tbstyle;
+    GtkToolbarStyle tbstyle;
 
-  if ((gsr == NULL) || (gsr->toolbar == NULL))
-    return;
+    if ((gsr == NULL) || (gsr->toolbar == NULL))
+        return;
 
-  tbstyle = gnc_get_toolbar_style ();
-  gtk_toolbar_set_style( GTK_TOOLBAR(gsr->toolbar), tbstyle );
+    tbstyle = gnc_get_toolbar_style ();
+    gtk_toolbar_set_style( GTK_TOOLBAR(gsr->toolbar), tbstyle );
 }
 
 static void
 gnc_split_reg_ld_destroy( GNCLedgerDisplay *ledger )
 {
-  GNCSplitReg *gsr = gnc_ledger_display_get_user_data( ledger );
+    GNCSplitReg *gsr = gnc_ledger_display_get_user_data( ledger );
 
-  if (gsr)
-  {
-    SplitRegister *reg;
+    if (gsr)
+    {
+        SplitRegister *reg;
 
-    reg = gnc_ledger_display_get_split_register (ledger);
+        reg = gnc_ledger_display_get_split_register (ledger);
 
-    if (reg && reg->table)
-      gnc_table_save_state (reg->table);
+        if (reg && reg->table)
+            gnc_table_save_state (reg->table);
 
-    /*
-     * Don't destroy the window here any more.  The register no longer
-     * owns it.
-     */
-  }
-  gnc_ledger_display_set_user_data (ledger, NULL);
+        /*
+         * Don't destroy the window here any more.  The register no longer
+         * owns it.
+         */
+    }
+    gnc_ledger_display_set_user_data (ledger, NULL);
 }
 
 void
 gsr_default_cut_handler( GNCSplitReg *gsr, gpointer data )
 {
-  gnucash_register_cut_clipboard( gsr->reg );
+    gnucash_register_cut_clipboard( gsr->reg );
 }
 
 /**
  * Cut the selection to the clipboard.  This refers to the Split.
  **/
-void 
+void
 gnc_split_reg_cut_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "cut" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "cut" );
 }
 
 void
 gsr_default_copy_handler( GNCSplitReg *gsr, gpointer data )
 {
-  gnucash_register_copy_clipboard( gsr->reg );
+    gnucash_register_copy_clipboard( gsr->reg );
 }
 
 /**
  * Copy the selection to the clipboard.  This refers to the Split.
  **/
-void 
+void
 gnc_split_reg_copy_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "copy" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "copy" );
 }
 
 void
 gsr_default_paste_handler( GNCSplitReg *gsr, gpointer data )
 {
-  gnucash_register_paste_clipboard( gsr->reg );
+    gnucash_register_paste_clipboard( gsr->reg );
 }
 
 /**
  * Paste the clipboard to the selection.  This refers to the Split.
  **/
-void 
+void
 gnc_split_reg_paste_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "paste" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "paste" );
 }
 
 void
 gsr_default_cut_txn_handler( GNCSplitReg *gsr, gpointer data )
 {
-  gnc_split_register_cut_current
+    gnc_split_register_cut_current
     (gnc_ledger_display_get_split_register( gsr->ledger ));
 }
 
@@ -770,14 +777,14 @@
 void
 gnc_split_reg_cut_trans_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "cut_txn" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "cut_txn" );
 }
 
 void
 gsr_default_copy_txn_handler( GNCSplitReg *gsr, gpointer data )
 {
-  gnc_split_register_copy_current
+    gnc_split_register_copy_current
     (gnc_ledger_display_get_split_register( gsr->ledger ));
 }
 
@@ -787,14 +794,14 @@
 void
 gnc_split_reg_copy_trans_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "copy_txn" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "copy_txn" );
 }
 
 void
 gsr_default_paste_txn_handler( GNCSplitReg *gsr, gpointer data )
 {
-  gnc_split_register_paste_current
+    gnc_split_register_paste_current
     (gnc_ledger_display_get_split_register( gsr->ledger ));
 }
 
@@ -804,8 +811,8 @@
 void
 gnc_split_reg_paste_trans_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "paste_txn" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "paste_txn" );
 }
 
 /********************************************************************\
@@ -818,14 +825,14 @@
 void
 gsr_default_void_txn_handler (GNCSplitReg *gsr, gpointer data)
 {
-  // Override this function.
+    // Override this function.
 }
 
 void
 gnc_split_reg_void_trans_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "void_txn" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "void_txn" );
 }
 
 /********************************************************************\
@@ -838,14 +845,14 @@
 void
 gsr_default_unvoid_txn_handler (GNCSplitReg *gsr, gpointer data)
 {
-  // Override this function.
+    // Override this function.
 }
 
 void
 gnc_split_reg_unvoid_trans_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "unvoid_txn" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "unvoid_txn" );
 }
 
 /********************************************************************\
@@ -858,119 +865,124 @@
 void
 gsr_default_reverse_txn_handler (GNCSplitReg *gsr, gpointer data)
 {
-  SplitRegister *reg;
-  Transaction *trans, *new_trans;
+    SplitRegister *reg;
+    Transaction *trans, *new_trans;
 
-  reg = gnc_ledger_display_get_split_register( gsr->ledger );
-  trans = gnc_split_register_get_current_trans (reg);
-  if (trans == NULL)
-    return;
+    reg = gnc_ledger_display_get_split_register( gsr->ledger );
+    trans = gnc_split_register_get_current_trans (reg);
+    if (trans == NULL)
+        return;
 
-  if (xaccTransGetReversedBy(trans)) {
-      gnc_error_dialog(gsr->window, "%s",
-        _("A reversing entry has already been created for this transaction."));
-      return;
-  }
-  
-  new_trans = xaccTransReverse(trans);
+    if (xaccTransGetReversedBy(trans))
+    {
+        gnc_error_dialog(gsr->window, "%s",
+                         _("A reversing entry has already been created for this transaction."));
+        return;
+    }
 
-  /* Clear transaction level info */
-  xaccTransSetDatePostedSecs(new_trans, time(NULL));
-  xaccTransSetDateEnteredSecs(new_trans, time(NULL));
+    new_trans = xaccTransReverse(trans);
 
-  /* Now jump to new trans */
-  gnc_split_reg_jump_to_split(gsr, xaccTransGetSplit(new_trans, 0));
+    /* Clear transaction level info */
+    xaccTransSetDatePostedSecs(new_trans, time(NULL));
+    xaccTransSetDateEnteredSecs(new_trans, time(NULL));
+
+    /* Now jump to new trans */
+    gnc_split_reg_jump_to_split(gsr, xaccTransGetSplit(new_trans, 0));
 }
 
 void
 gnc_split_reg_reverse_trans_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "reverse_txn" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "reverse_txn" );
 }
 
 
 static gboolean
 xaccTransWarnReadOnly (const Transaction *trans)
 {
-  GtkWidget *dialog;
-  const gchar *reason;
-  const gchar *title = _("Cannot modify or delete this transaction.");
-  const gchar *message =
-    _("This transaction is marked read-only with the comment: '%s'");
+    GtkWidget *dialog;
+    const gchar *reason;
+    const gchar *title = _("Cannot modify or delete this transaction.");
+    const gchar *message =
+        _("This transaction is marked read-only with the comment: '%s'");
 
-  if (!trans) return FALSE;
+    if (!trans) return FALSE;
 
-  reason = xaccTransGetReadOnly (trans);
-  if (reason) {
-    dialog = gtk_message_dialog_new(NULL,
-				    0,
-				    GTK_MESSAGE_ERROR,
-				    GTK_BUTTONS_OK,
-				    "%s", title);
-    gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-					     message, reason);
-    gtk_dialog_run(GTK_DIALOG(dialog));
-    gtk_widget_destroy(dialog);
-    return TRUE;
-  }
-  return FALSE;
+    reason = xaccTransGetReadOnly (trans);
+    if (reason)
+    {
+        dialog = gtk_message_dialog_new(NULL,
+                                        0,
+                                        GTK_MESSAGE_ERROR,
+                                        GTK_BUTTONS_OK,
+                                        "%s", title);
+        gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+                message, reason);
+        gtk_dialog_run(GTK_DIALOG(dialog));
+        gtk_widget_destroy(dialog);
+        return TRUE;
+    }
+    return FALSE;
 }
 
 
 void
 gsr_default_reinit_handler( GNCSplitReg *gsr, gpointer data )
 {
-  VirtualCellLocation vcell_loc;
-  SplitRegister *reg;
-  Transaction *trans;
-  Split *split;
-  GtkWidget *dialog;
-  gint response;
-  const gchar *warning;
+    VirtualCellLocation vcell_loc;
+    SplitRegister *reg;
+    Transaction *trans;
+    Split *split;
+    GtkWidget *dialog;
+    gint response;
+    const gchar *warning;
 
-  const char *title = _("Remove the splits from this transaction?");
-  const char *recn_warn = _("This transaction contains reconciled splits. "
-                            "Modifying it is not a good idea because that will "
-			    "cause your reconciled balance to be off.");
+    const char *title = _("Remove the splits from this transaction?");
+    const char *recn_warn = _("This transaction contains reconciled splits. "
+                              "Modifying it is not a good idea because that will "
+                              "cause your reconciled balance to be off.");
 
-  reg = gnc_ledger_display_get_split_register( gsr->ledger );
+    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 
-  trans = gnc_split_register_get_current_trans (reg);
-  if (xaccTransWarnReadOnly(trans))
-    return;
-  dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
-				  GTK_DIALOG_DESTROY_WITH_PARENT,
-				  GTK_MESSAGE_WARNING,
-				  GTK_BUTTONS_NONE,
-				  "%s", title);
-  if (xaccTransHasReconciledSplits (trans)) {
-    gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-					     "%s", recn_warn);
-    warning = "register_remove_all_splits2";
-  } else {
-    warning = "register_remove_all_splits";
-  }
+    trans = gnc_split_register_get_current_trans (reg);
+    if (xaccTransWarnReadOnly(trans))
+        return;
+    dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
+                                    GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_WARNING,
+                                    GTK_BUTTONS_NONE,
+                                    "%s", title);
+    if (xaccTransHasReconciledSplits (trans))
+    {
+        gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+                "%s", recn_warn);
+        warning = "register_remove_all_splits2";
+    }
+    else
+    {
+        warning = "register_remove_all_splits";
+    }
 
-  gtk_dialog_add_button(GTK_DIALOG(dialog),
-			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-  gnc_gtk_dialog_add_button(dialog, _("_Remove Splits"),
-			    GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT);
-  response = gnc_dialog_run(GTK_DIALOG(dialog), warning);
-  gtk_widget_destroy (dialog);
-  if (response != GTK_RESPONSE_ACCEPT)
-    return;
+    gtk_dialog_add_button(GTK_DIALOG(dialog),
+                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+    gnc_gtk_dialog_add_button(dialog, _("_Remove Splits"),
+                              GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT);
+    response = gnc_dialog_run(GTK_DIALOG(dialog), warning);
+    gtk_widget_destroy (dialog);
+    if (response != GTK_RESPONSE_ACCEPT)
+        return;
 
-  /*
-   * Find the "transaction" split for the current transaction. This is
-   * the split that appears at the top of the transaction in the
-   * register.
-   */
-  split = gnc_split_register_get_current_split (reg);
-  if (!gnc_split_register_get_split_virt_loc(reg, split, &vcell_loc))
-    return;
-  split = gnc_split_register_get_current_trans_split (reg, &vcell_loc);
-  gnc_split_register_empty_current_trans_except_split (reg, split);
+    /*
+     * Find the "transaction" split for the current transaction. This is
+     * the split that appears at the top of the transaction in the
+     * register.
+     */
+    split = gnc_split_register_get_current_split (reg);
+    if (!gnc_split_register_get_split_virt_loc(reg, split, &vcell_loc))
+        return;
+    split = gnc_split_register_get_current_trans_split (reg, &vcell_loc);
+    gnc_split_register_empty_current_trans_except_split (reg, split);
 }
 
 /**
@@ -979,161 +991,167 @@
 void
 gnc_split_reg_reinitialize_trans_cb(GtkWidget *widget, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "reinit_ent" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "reinit_ent" );
 }
 
 void
 gsr_default_delete_handler( GNCSplitReg *gsr, gpointer data )
 {
-  SplitRegisterStyle style;
-  CursorClass cursor_class;
-  SplitRegister *reg;
-  Transaction *trans;
-  Split *split;
-  GtkWidget *dialog;
-  gint response;
-  const gchar *warning;
+    SplitRegisterStyle style;
+    CursorClass cursor_class;
+    SplitRegister *reg;
+    Transaction *trans;
+    Split *split;
+    GtkWidget *dialog;
+    gint response;
+    const gchar *warning;
 
-  reg = gnc_ledger_display_get_split_register( gsr->ledger );
+    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 
-  /* get the current split based on cursor position */
-  split = gnc_split_register_get_current_split(reg);
-  if (split == NULL)
-  {
-    gnc_split_register_cancel_cursor_split_changes (reg);
-    return;
-  }
+    /* get the current split based on cursor position */
+    split = gnc_split_register_get_current_split(reg);
+    if (split == NULL)
+    {
+        gnc_split_register_cancel_cursor_split_changes (reg);
+        return;
+    }
 
-  trans = xaccSplitGetParent(split);
-  style = reg->style;
-  cursor_class = gnc_split_register_get_current_cursor_class (reg);
+    trans = xaccSplitGetParent(split);
+    style = reg->style;
+    cursor_class = gnc_split_register_get_current_cursor_class (reg);
 
-  /* Deleting the blank split just cancels */
-  {
-    Split *blank_split = gnc_split_register_get_blank_split (reg);
+    /* Deleting the blank split just cancels */
+    {
+        Split *blank_split = gnc_split_register_get_blank_split (reg);
 
-    if (split == blank_split)
-    {
-      gnc_split_register_cancel_cursor_trans_changes (reg);
-      return;
+        if (split == blank_split)
+        {
+            gnc_split_register_cancel_cursor_trans_changes (reg);
+            return;
+        }
     }
-  }
 
-  if (cursor_class == CURSOR_CLASS_NONE)
-    return;
+    if (cursor_class == CURSOR_CLASS_NONE)
+        return;
 
-  if (xaccTransWarnReadOnly(trans))
-    return;
+    if (xaccTransWarnReadOnly(trans))
+        return;
 
-  /* On a split cursor, just delete the one split. */
-  if (cursor_class == CURSOR_CLASS_SPLIT)
-  {
-    const char *format = _("Delete the split '%s' from the transaction '%s'?");
-    const char *recn_warn = _("You would be deleting a reconciled split! "
-                              "This is not a good idea as it will cause your "
-                              "reconciled balance to be off.");
-    const char *anchor_error = _("You cannot delete this split.");
-    const char *anchor_split = _("This is the split anchoring this transaction "
-                                 "to the register. You may not delete it from "
-                                 "this register window.  You may delete the "
-				 "entire transaction from this window, or you "
-				 "may navigate to a register that shows "
-				 "another side of this same transaction and "
-				 "delete the split from that register.");
-    char *buf = NULL;
-    const char *memo;
-    const char *desc;
-    char recn;
+    /* On a split cursor, just delete the one split. */
+    if (cursor_class == CURSOR_CLASS_SPLIT)
+    {
+        const char *format = _("Delete the split '%s' from the transaction '%s'?");
+        const char *recn_warn = _("You would be deleting a reconciled split! "
+                                  "This is not a good idea as it will cause your "
+                                  "reconciled balance to be off.");
+        const char *anchor_error = _("You cannot delete this split.");
+        const char *anchor_split = _("This is the split anchoring this transaction "
+                                     "to the register. You may not delete it from "
+                                     "this register window.  You may delete the "
+                                     "entire transaction from this window, or you "
+                                     "may navigate to a register that shows "
+                                     "another side of this same transaction and "
+                                     "delete the split from that register.");
+        char *buf = NULL;
+        const char *memo;
+        const char *desc;
+        char recn;
 
-    if (split == gnc_split_register_get_current_trans_split (reg, NULL)) {
-      dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
-				      GTK_DIALOG_MODAL
-				      | GTK_DIALOG_DESTROY_WITH_PARENT,
-				      GTK_MESSAGE_ERROR,
-				      GTK_BUTTONS_OK,
-				      "%s", anchor_error);
-      gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-					       "%s", anchor_split);
-      gtk_dialog_run(GTK_DIALOG(dialog));
-      gtk_widget_destroy (dialog);
-      return;
-    }
+        if (split == gnc_split_register_get_current_trans_split (reg, NULL))
+        {
+            dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
+                                            GTK_DIALOG_MODAL
+                                            | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                            GTK_MESSAGE_ERROR,
+                                            GTK_BUTTONS_OK,
+                                            "%s", anchor_error);
+            gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+                    "%s", anchor_split);
+            gtk_dialog_run(GTK_DIALOG(dialog));
+            gtk_widget_destroy (dialog);
+            return;
+        }
 
-    memo = xaccSplitGetMemo (split);
-    memo = (memo && *memo) ? memo : _("(no memo)");
+        memo = xaccSplitGetMemo (split);
+        memo = (memo && *memo) ? memo : _("(no memo)");
 
-    desc = xaccTransGetDescription (trans);
-    desc = (desc && *desc) ? desc : _("(no description)");
+        desc = xaccTransGetDescription (trans);
+        desc = (desc && *desc) ? desc : _("(no description)");
 
-    /* ask for user confirmation before performing permanent damage */
-    buf = g_strdup_printf (format, memo, desc);
-    dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
-				    GTK_DIALOG_MODAL
-				    | GTK_DIALOG_DESTROY_WITH_PARENT,
-				    GTK_MESSAGE_QUESTION,
-				    GTK_BUTTONS_NONE,
-				    "%s", buf);
-    g_free(buf);
-    recn = xaccSplitGetReconcile (split);
-    if (recn == YREC || recn == FREC)
-    {
-      gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-					       "%s", recn_warn);
-      warning = "register_delete_split2";
-    } else {
-      warning = "register_delete_split";
+        /* ask for user confirmation before performing permanent damage */
+        buf = g_strdup_printf (format, memo, desc);
+        dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
+                                        GTK_DIALOG_MODAL
+                                        | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                        GTK_MESSAGE_QUESTION,
+                                        GTK_BUTTONS_NONE,
+                                        "%s", buf);
+        g_free(buf);
+        recn = xaccSplitGetReconcile (split);
+        if (recn == YREC || recn == FREC)
+        {
+            gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+                    "%s", recn_warn);
+            warning = "register_delete_split2";
+        }
+        else
+        {
+            warning = "register_delete_split";
+        }
+
+        gtk_dialog_add_button(GTK_DIALOG(dialog),
+                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+        gnc_gtk_dialog_add_button(dialog, _("_Delete Split"),
+                                  GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT);
+        response = gnc_dialog_run(GTK_DIALOG(dialog), warning);
+        gtk_widget_destroy (dialog);
+        if (response != GTK_RESPONSE_ACCEPT)
+            return;
+
+        gnc_split_register_delete_current_split (reg);
+        return;
     }
 
-    gtk_dialog_add_button(GTK_DIALOG(dialog),
-			  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-    gnc_gtk_dialog_add_button(dialog, _("_Delete Split"),
-			      GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT);
-    response = gnc_dialog_run(GTK_DIALOG(dialog), warning);
-    gtk_widget_destroy (dialog);
-    if (response != GTK_RESPONSE_ACCEPT)
-      return;
+    g_return_if_fail(cursor_class == CURSOR_CLASS_TRANS);
 
-    gnc_split_register_delete_current_split (reg);
-    return;
-  }
+    /* On a transaction cursor with 2 or fewer splits in single or double
+     * mode, we just delete the whole transaction, kerblooie */
+    {
+        const char *title = _("Delete the current transaction?");
+        const char *recn_warn = _("You would be deleting a transaction "
+                                  "with reconciled splits! "
+                                  "This is not a good idea as it will cause your "
+                                  "reconciled balance to be off.");
 
-  g_return_if_fail(cursor_class == CURSOR_CLASS_TRANS);
+        dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
+                                        GTK_DIALOG_MODAL
+                                        | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                        GTK_MESSAGE_WARNING,
+                                        GTK_BUTTONS_NONE,
+                                        "%s", title);
+        if (xaccTransHasReconciledSplits (trans))
+        {
+            gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+                    "%s", recn_warn);
+            warning = "register_delete_trans2";
+        }
+        else
+        {
+            warning = "register_delete_trans";
+        }
+        gtk_dialog_add_button(GTK_DIALOG(dialog),
+                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+        gnc_gtk_dialog_add_button(dialog, _("_Delete Transaction"),
+                                  GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT);
+        response =  gnc_dialog_run(GTK_DIALOG(dialog), warning);
+        gtk_widget_destroy (dialog);
+        if (response != GTK_RESPONSE_ACCEPT)
+            return;
 
-  /* On a transaction cursor with 2 or fewer splits in single or double
-   * mode, we just delete the whole transaction, kerblooie */
-  {
-    const char *title = _("Delete the current transaction?");
-    const char *recn_warn = _("You would be deleting a transaction "
-                              "with reconciled splits! "
-                              "This is not a good idea as it will cause your "
-                              "reconciled balance to be off.");
-
-    dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
-				    GTK_DIALOG_MODAL
-				    | GTK_DIALOG_DESTROY_WITH_PARENT,
-				    GTK_MESSAGE_WARNING,
-				    GTK_BUTTONS_NONE,
-				    "%s", title);
-    if (xaccTransHasReconciledSplits (trans)) {
-      gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-					       "%s", recn_warn);
-      warning = "register_delete_trans2";
-    } else {
-      warning = "register_delete_trans";
+        gnc_split_register_delete_current_trans (reg);
+        return;
     }
-    gtk_dialog_add_button(GTK_DIALOG(dialog),
-			  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-    gnc_gtk_dialog_add_button(dialog, _("_Delete Transaction"),
-			      GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT);
-    response =  gnc_dialog_run(GTK_DIALOG(dialog), warning);
-    gtk_widget_destroy (dialog);
-    if (response != GTK_RESPONSE_ACCEPT)
-      return;
-
-    gnc_split_register_delete_current_trans (reg);
-    return;
-  }
 }
 
 /**
@@ -1142,14 +1160,14 @@
 void
 gnc_split_reg_delete_trans_cb(GtkWidget *widget, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "delete_ent" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "delete_ent" );
 }
 
 void
 gsr_default_dup_handler( GNCSplitReg *gsr, gpointer data )
 {
-  gnc_split_register_duplicate_current
+    gnc_split_register_duplicate_current
     (gnc_ledger_display_get_split_register( gsr->ledger ));
 }
 
@@ -1159,8 +1177,8 @@
 void
 gnc_split_reg_duplicate_trans_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "dup_ent" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "dup_ent" );
 }
 
 /**
@@ -1171,50 +1189,54 @@
 void
 gsr_default_schedule_handler( GNCSplitReg *gsr, gpointer data )
 {
-  SplitRegister *reg = gnc_ledger_display_get_split_register( gsr->ledger );
-  Transaction *pending_trans = gnc_split_register_get_current_trans (reg);
+    SplitRegister *reg = gnc_ledger_display_get_split_register( gsr->ledger );
+    Transaction *pending_trans = gnc_split_register_get_current_trans (reg);
 
-  /* If the transaction has a sched-xact KVP frame, then go to the editor
-   * for the existing SX; otherwise, do the sx-from-trans dialog. */
-  {
-    kvp_frame *txn_frame;
-    kvp_value *kvp_val;
-    /* set a kvp-frame element in the transaction indicating and
-     * pointing-to the SX this was created from. */
-    txn_frame = xaccTransGetSlots( pending_trans );
-    if ( txn_frame != NULL ) {
-      kvp_val = kvp_frame_get_slot( txn_frame, "from-sched-xaction" );
-      if ( kvp_val ) {
-        GUID *fromSXId = kvp_value_get_guid( kvp_val );
-        SchedXaction *theSX = NULL;
-        GList *sxElts;
-        
-        /* Get the correct SX */
-        for ( sxElts = gnc_book_get_schedxactions(gnc_get_current_book())->sx_list;
-              (!theSX) && sxElts;
-              sxElts = sxElts->next ) {
-          SchedXaction *sx = (SchedXaction*)sxElts->data;
-          theSX =
-            ( ( guid_equal( xaccSchedXactionGetGUID( sx ), fromSXId ) )
-              ? sx : NULL );
-        }
+    /* If the transaction has a sched-xact KVP frame, then go to the editor
+     * for the existing SX; otherwise, do the sx-from-trans dialog. */
+    {
+        kvp_frame *txn_frame;
+        kvp_value *kvp_val;
+        /* set a kvp-frame element in the transaction indicating and
+         * pointing-to the SX this was created from. */
+        txn_frame = xaccTransGetSlots( pending_trans );
+        if ( txn_frame != NULL )
+        {
+            kvp_val = kvp_frame_get_slot( txn_frame, "from-sched-xaction" );
+            if ( kvp_val )
+            {
+                GUID *fromSXId = kvp_value_get_guid( kvp_val );
+                SchedXaction *theSX = NULL;
+                GList *sxElts;
 
-        if ( theSX ) {
-          gnc_ui_scheduled_xaction_editor_dialog_create(theSX, FALSE);
-          return;
+                /* Get the correct SX */
+                for ( sxElts = gnc_book_get_schedxactions(gnc_get_current_book())->sx_list;
+                        (!theSX) && sxElts;
+                        sxElts = sxElts->next )
+                {
+                    SchedXaction *sx = (SchedXaction*)sxElts->data;
+                    theSX =
+                        ( ( guid_equal( xaccSchedXactionGetGUID( sx ), fromSXId ) )
+                          ? sx : NULL );
+                }
+
+                if ( theSX )
+                {
+                    gnc_ui_scheduled_xaction_editor_dialog_create(theSX, FALSE);
+                    return;
+                }
+            }
         }
-      }
     }
-  }
 
-  gnc_sx_create_from_trans(pending_trans);
+    gnc_sx_create_from_trans(pending_trans);
 }
 
 void
 gnc_split_reg_recur_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "schedule_ent" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "schedule_ent" );
 }
 
 /**
@@ -1223,14 +1245,14 @@
 void
 gnc_split_reg_record_trans_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "enter_ent" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "enter_ent" );
 }
 
 void
 gsr_default_cancel_handler( GNCSplitReg *gsr, gpointer data )
 {
-  gnc_split_register_cancel_cursor_trans_changes
+    gnc_split_register_cancel_cursor_trans_changes
     (gnc_ledger_display_get_split_register( gsr->ledger ));
 }
 
@@ -1240,51 +1262,51 @@
 void
 gnc_split_reg_cancel_trans_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "cancel_ent" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "cancel_ent" );
 }
 
 void
 gsr_default_expand_handler( GNCSplitReg *gsr, gpointer data )
 {
-  gint activeCount;
-  gboolean expand;
-  SplitRegister *reg;
+    gint activeCount;
+    gboolean expand;
+    SplitRegister *reg;
 
-  if (!gsr)
-    return;
+    if (!gsr)
+        return;
 
-  reg = gnc_ledger_display_get_split_register (gsr->ledger);
+    reg = gnc_ledger_display_get_split_register (gsr->ledger);
 
-  /* These should all be in agreement. */
-  activeCount =
-    ( ( GTK_CHECK_MENU_ITEM(gsr->split_menu_check)->active ? 1 : -1 )
-      + ( GTK_CHECK_MENU_ITEM(gsr->split_popup_check)->active ? 1 : -1 )
-      + ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(gsr->split_button) )
-          ? 1 : -1 ) );
+    /* These should all be in agreement. */
+    activeCount =
+        ( ( GTK_CHECK_MENU_ITEM(gsr->split_menu_check)->active ? 1 : -1 )
+          + ( GTK_CHECK_MENU_ITEM(gsr->split_popup_check)->active ? 1 : -1 )
+          + ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(gsr->split_button) )
+              ? 1 : -1 ) );
 
-  /* If activeCount > 0, then there's more active than inactive; otherwise,
-   * more inactive than active.  Both determine which state the user is
-   * attempting to get to. */
-  expand = ( activeCount < 0 );
+    /* If activeCount > 0, then there's more active than inactive; otherwise,
+     * more inactive than active.  Both determine which state the user is
+     * attempting to get to. */
+    expand = ( activeCount < 0 );
 
-  /* The ledger's invocation of 'redraw_all' will force the agreement in the
-   * other split state widgets, so we neglect doing it here.  */
-  gnc_split_register_expand_current_trans (reg, expand);
+    /* The ledger's invocation of 'redraw_all' will force the agreement in the
+     * other split state widgets, so we neglect doing it here.  */
+    gnc_split_register_expand_current_trans (reg, expand);
 }
- 
+
 void
 gnc_split_reg_expand_trans_menu_cb (GtkWidget *widget, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "expand_ent" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "expand_ent" );
 }
 
 void
 gnc_split_reg_expand_trans_toolbar_cb (GtkWidget *widget, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "expand_ent" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "expand_ent" );
 }
 
 /**
@@ -1293,22 +1315,22 @@
 void
 gnc_split_reg_jump_to_split(GNCSplitReg *gsr, Split *split)
 {
-  Transaction *trans;
-  VirtualCellLocation vcell_loc;
-  SplitRegister *reg;
+    Transaction *trans;
+    VirtualCellLocation vcell_loc;
+    SplitRegister *reg;
 
-  if (!gsr) return;
+    if (!gsr) return;
 
-  trans = xaccSplitGetParent(split);
+    trans = xaccSplitGetParent(split);
 
-  gsr_emit_include_date_signal( gsr, xaccTransGetDate(trans) );
+    gsr_emit_include_date_signal( gsr, xaccTransGetDate(trans) );
 
-  reg = gnc_ledger_display_get_split_register( gsr->ledger );
+    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 
-  if (gnc_split_register_get_split_virt_loc(reg, split, &vcell_loc))
-    gnucash_register_goto_virt_cell( gsr->reg, vcell_loc );
+    if (gnc_split_register_get_split_virt_loc(reg, split, &vcell_loc))
+        gnucash_register_goto_virt_cell( gsr->reg, vcell_loc );
 
-  gnc_ledger_display_refresh( gsr->ledger );
+    gnc_ledger_display_refresh( gsr->ledger );
 }
 
 
@@ -1318,473 +1340,478 @@
 void
 gnc_split_reg_jump_to_split_amount(GNCSplitReg *gsr, Split *split)
 {
-  VirtualLocation virt_loc;
-  SplitRegister *reg;
-  Transaction *trans;
+    VirtualLocation virt_loc;
+    SplitRegister *reg;
+    Transaction *trans;
 
-  if (!gsr) return;
+    if (!gsr) return;
 
-  trans = xaccSplitGetParent(split);
-  gsr_emit_include_date_signal( gsr, xaccTransGetDate(trans) );
+    trans = xaccSplitGetParent(split);
+    gsr_emit_include_date_signal( gsr, xaccTransGetDate(trans) );
 
-  reg = gnc_ledger_display_get_split_register (gsr->ledger);
+    reg = gnc_ledger_display_get_split_register (gsr->ledger);
 
-  if (gnc_split_register_get_split_amount_virt_loc (reg, split, &virt_loc))
-    gnucash_register_goto_virt_loc (gsr->reg, virt_loc);
-  
-  gnc_ledger_display_refresh (gsr->ledger);
+    if (gnc_split_register_get_split_amount_virt_loc (reg, split, &virt_loc))
+        gnucash_register_goto_virt_loc (gsr->reg, virt_loc);
+
+    gnc_ledger_display_refresh (gsr->ledger);
 }
 
 void
 gnc_split_reg_jump_to_blank (GNCSplitReg *gsr)
 {
-  SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
-  VirtualCellLocation vcell_loc;
-  Split *blank;
+    SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
+    VirtualCellLocation vcell_loc;
+    Split *blank;
 
-  ENTER("gsr=%p", gsr);
+    ENTER("gsr=%p", gsr);
 
-  blank = gnc_split_register_get_blank_split (reg);
-  if (blank == NULL)
-  {
-    LEAVE("no blank split");
-    return;
-  }
+    blank = gnc_split_register_get_blank_split (reg);
+    if (blank == NULL)
+    {
+        LEAVE("no blank split");
+        return;
+    }
 
-  if (gnc_split_register_get_split_virt_loc (reg, blank, &vcell_loc))
-    gnucash_register_goto_virt_cell (gsr->reg, vcell_loc);
+    if (gnc_split_register_get_split_virt_loc (reg, blank, &vcell_loc))
+        gnucash_register_goto_virt_cell (gsr->reg, vcell_loc);
 
-  gnc_ledger_display_refresh (gsr->ledger);
-  LEAVE(" ");
+    gnc_ledger_display_refresh (gsr->ledger);
+    LEAVE(" ");
 }
 
 void
 gnc_split_reg_balancing_entry(GNCSplitReg *gsr, Account *account,
-    time_t statement_date, gnc_numeric balancing_amount) {
+                              time_t statement_date, gnc_numeric balancing_amount)
+{
 
-  Transaction *transaction;
-  Split *split;
-  
-  // create transaction
-  transaction = create_balancing_transaction(gnc_get_current_book(),
-      account, statement_date, balancing_amount);
+    Transaction *transaction;
+    Split *split;
 
-  // jump to transaction
-  split = xaccTransFindSplitByAccount(transaction, account);
-  if (split == NULL) {
-    // default behaviour: jump to blank split
-    g_warning("create_balancing_transaction failed");
-    gnc_split_reg_jump_to_blank(gsr);
-  } else {
-    // goto balancing transaction
-    gnc_split_reg_jump_to_split(gsr, split );
-  }
+    // create transaction
+    transaction = create_balancing_transaction(gnc_get_current_book(),
+                  account, statement_date, balancing_amount);
+
+    // jump to transaction
+    split = xaccTransFindSplitByAccount(transaction, account);
+    if (split == NULL)
+    {
+        // default behaviour: jump to blank split
+        g_warning("create_balancing_transaction failed");
+        gnc_split_reg_jump_to_blank(gsr);
+    }
+    else
+    {
+        // goto balancing transaction
+        gnc_split_reg_jump_to_split(gsr, split );
+    }
 }
 
 static Transaction*
 create_balancing_transaction(QofBook *book, Account *account,
-    time_t statement_date, gnc_numeric balancing_amount) {
+                             time_t statement_date, gnc_numeric balancing_amount)
+{
 
-  Transaction *trans;
-  Split *split;
+    Transaction *trans;
+    Split *split;
 
-  if (!account)
-    return NULL;
-  if (gnc_numeric_zero_p(balancing_amount))
-    return NULL;
+    if (!account)
+        return NULL;
+    if (gnc_numeric_zero_p(balancing_amount))
+        return NULL;
 
-  xaccAccountBeginEdit(account);
+    xaccAccountBeginEdit(account);
 
-  trans = xaccMallocTransaction(book);
-  
-  xaccTransBeginEdit(trans);
+    trans = xaccMallocTransaction(book);
 
-  // fill Transaction
-  xaccTransSetCurrency(trans, xaccAccountGetCommodity(account));
-  xaccTransSetDateSecs(trans, statement_date);
-  xaccTransSetDescription(trans, _("Balancing entry from reconcilation"));
+    xaccTransBeginEdit(trans);
 
-  // 1. Split
-  split = xaccMallocSplit(book);
-  xaccTransAppendSplit(trans, split);
-  xaccAccountInsertSplit(account, split);
-  xaccSplitSetAmount(split, balancing_amount);
-  xaccSplitSetValue(split, balancing_amount);
+    // fill Transaction
+    xaccTransSetCurrency(trans, xaccAccountGetCommodity(account));
+    xaccTransSetDateSecs(trans, statement_date);
+    xaccTransSetDescription(trans, _("Balancing entry from reconcilation"));
 
-  // 2. Split (no account is defined: split goes to orphan account)
-  split = xaccMallocSplit(book);
-  xaccTransAppendSplit(trans, split);
+    // 1. Split
+    split = xaccMallocSplit(book);
+    xaccTransAppendSplit(trans, split);
+    xaccAccountInsertSplit(account, split);
+    xaccSplitSetAmount(split, balancing_amount);
+    xaccSplitSetValue(split, balancing_amount);
 
-  balancing_amount = gnc_numeric_neg(balancing_amount);
-  xaccSplitSetAmount(split, balancing_amount);
-  xaccSplitSetValue(split, balancing_amount);
+    // 2. Split (no account is defined: split goes to orphan account)
+    split = xaccMallocSplit(book);
+    xaccTransAppendSplit(trans, split);
 
-  xaccTransCommitEdit(trans);
-  xaccAccountCommitEdit(account);
-  return trans;
+    balancing_amount = gnc_numeric_neg(balancing_amount);
+    xaccSplitSetAmount(split, balancing_amount);
+    xaccSplitSetValue(split, balancing_amount);
+
+    xaccTransCommitEdit(trans);
+    xaccAccountCommitEdit(account);
+    return trans;
 }
 
 void
 gsr_default_blank_handler( GNCSplitReg *gsr, gpointer data )
 {
-  SplitRegister *reg;
+    SplitRegister *reg;
 
-  ENTER("gsr=%p, gpointer=%p", gsr, data);
+    ENTER("gsr=%p, gpointer=%p", gsr, data);
 
-  reg = gnc_ledger_display_get_split_register (gsr->ledger);
+    reg = gnc_ledger_display_get_split_register (gsr->ledger);
 
-  if (gnc_split_register_save (reg, TRUE))
-    gnc_split_register_redraw (reg);
+    if (gnc_split_register_save (reg, TRUE))
+        gnc_split_register_redraw (reg);
 
-  gnc_split_reg_jump_to_blank (gsr);
-  LEAVE(" ");
+    gnc_split_reg_jump_to_blank (gsr);
+    LEAVE(" ");
 }
 
 void
 gnc_split_reg_new_trans_cb (GtkWidget *widget, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "blank" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "blank" );
 }
 
 void
 gsr_default_jump_handler( GNCSplitReg *gsr, gpointer data )
 {
-  g_assert_not_reached();
+    g_assert_not_reached();
 }
 
 void
 gnc_split_reg_jump_cb( GtkWidget *widget, gpointer data )
 {
-  GNCSplitReg *gsr = data;
-  gsr_emit_simple_signal( gsr, "jump" );
+    GNCSplitReg *gsr = data;
+    gsr_emit_simple_signal( gsr, "jump" );
 }
 
 void
 gnc_split_reg_change_style (GNCSplitReg *gsr, SplitRegisterStyle style)
 {
-  SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
+    SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
 
-  if (style == reg->style)
-    return;
+    if (style == reg->style)
+        return;
 
-  gnc_split_register_config (reg, reg->type, style, reg->use_double_line);
-  gnc_ledger_display_refresh (gsr->ledger);
+    gnc_split_register_config (reg, reg->type, style, reg->use_double_line);
+    gnc_ledger_display_refresh (gsr->ledger);
 }
 
 void
 gnc_split_reg_style_ledger_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
+    GNCSplitReg *gsr = data;
 
-  if (!GTK_CHECK_MENU_ITEM(w)->active)
-    return;
+    if (!GTK_CHECK_MENU_ITEM(w)->active)
+        return;
 
-  gnc_split_reg_change_style (gsr, REG_STYLE_LEDGER);
+    gnc_split_reg_change_style (gsr, REG_STYLE_LEDGER);
 }
 
 void
 gnc_split_reg_style_auto_ledger_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
+    GNCSplitReg *gsr = data;
 
-  if (!GTK_CHECK_MENU_ITEM(w)->active)
-    return;
+    if (!GTK_CHECK_MENU_ITEM(w)->active)
+        return;
 
-  gnc_split_reg_change_style (gsr, REG_STYLE_AUTO_LEDGER);
+    gnc_split_reg_change_style (gsr, REG_STYLE_AUTO_LEDGER);
 }
 
 void
 gnc_split_reg_style_journal_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
+    GNCSplitReg *gsr = data;
 
-  if (!GTK_CHECK_MENU_ITEM(w)->active)
-    return;
+    if (!GTK_CHECK_MENU_ITEM(w)->active)
+        return;
 
-  gnc_split_reg_change_style (gsr, REG_STYLE_JOURNAL);
+    gnc_split_reg_change_style (gsr, REG_STYLE_JOURNAL);
 }
 
 void
 gnc_split_reg_double_line_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
-  gboolean use_double_line;
+    GNCSplitReg *gsr = data;
+    SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
+    gboolean use_double_line;
 
-  use_double_line = GTK_CHECK_MENU_ITEM(w)->active;
-  if ( use_double_line == reg->use_double_line )
-    return;
+    use_double_line = GTK_CHECK_MENU_ITEM(w)->active;
+    if ( use_double_line == reg->use_double_line )
+        return;
 
-  gnc_split_register_config( reg, reg->type, reg->style, use_double_line );
-  gnc_ledger_display_refresh( gsr->ledger );
+    gnc_split_register_config( reg, reg->type, reg->style, use_double_line );
+    gnc_ledger_display_refresh( gsr->ledger );
 }
 
 static void
 gnc_split_reg_sort( GNCSplitReg *gsr, SortType sort_code )
 {
-  Query *query = gnc_ledger_display_get_query( gsr->ledger );
-  gboolean show_present_divider = FALSE;
-  GSList *p1 = NULL, *p2 = NULL, *p3 = NULL, *standard;
-  SplitRegister *reg;
+    Query *query = gnc_ledger_display_get_query( gsr->ledger );
+    gboolean show_present_divider = FALSE;
+    GSList *p1 = NULL, *p2 = NULL, *p3 = NULL, *standard;
+    SplitRegister *reg;
 
-  if (gsr->sort_type == sort_code)
-    return;
+    if (gsr->sort_type == sort_code)
+        return;
 
-  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;
-      show_present_divider = TRUE;
-      break;
+        p1 = standard;
+        show_present_divider = TRUE;
+        break;
     case BY_DATE:
-      p1 = g_slist_prepend (p1, TRANS_DATE_POSTED);
-      p1 = g_slist_prepend (p1, SPLIT_TRANS);
-      p2 = standard;
-      show_present_divider = TRUE;
-      break;
+        p1 = g_slist_prepend (p1, TRANS_DATE_POSTED);
+        p1 = g_slist_prepend (p1, SPLIT_TRANS);
+        p2 = standard;
+        show_present_divider = TRUE;
+        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_ACTION:
-      p1 = g_slist_prepend (p1, SPLIT_ACTION);
-      p2 = standard;
-      break;
+        p1 = g_slist_prepend (p1, SPLIT_ACTION);
+        p2 = standard;
+        break;
     case BY_NOTES:
-      p1 = g_slist_prepend (p1, TRANS_NOTES);
-      p1 = g_slist_prepend (p1, SPLIT_TRANS);
-      p2 = standard;
-      break;
+        p1 = g_slist_prepend (p1, TRANS_NOTES);
+        p1 = g_slist_prepend (p1, SPLIT_TRANS);
+        p2 = standard;
+        break;
     default:
-      g_slist_free (standard);
-      g_return_if_fail (FALSE);
-  }
+        g_slist_free (standard);
+        g_return_if_fail (FALSE);
+    }
 
-  gncQuerySetSortOrder( query, p1, p2, p3 );
-  reg = gnc_ledger_display_get_split_register( gsr->ledger );
-  gnc_split_register_show_present_divider( reg, show_present_divider );
-  gsr->sort_type = sort_code;
-  gnc_ledger_display_refresh( gsr->ledger );
+    gncQuerySetSortOrder( query, p1, p2, p3 );
+    reg = gnc_ledger_display_get_split_register( gsr->ledger );
+    gnc_split_register_show_present_divider( reg, show_present_divider );
+    gsr->sort_type = sort_code;
+    gnc_ledger_display_refresh( gsr->ledger );
 }
 
 void
 gnc_split_reg_sort_standard_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_split_reg_sort(gsr, BY_STANDARD);
+    GNCSplitReg *gsr = data;
+    gnc_split_reg_sort(gsr, BY_STANDARD);
 }
 
 void
 gnc_split_reg_sort_date_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_split_reg_sort(gsr, BY_DATE);
+    GNCSplitReg *gsr = data;
+    gnc_split_reg_sort(gsr, BY_DATE);
 }
 
 void
 gnc_split_reg_sort_date_entered_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_split_reg_sort(gsr, BY_DATE_ENTERED);
+    GNCSplitReg *gsr = data;
+    gnc_split_reg_sort(gsr, BY_DATE_ENTERED);
 }
 
 void
 gnc_split_reg_sort_date_reconciled_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_split_reg_sort(gsr, BY_DATE_RECONCILED);
+    GNCSplitReg *gsr = data;
+    gnc_split_reg_sort(gsr, BY_DATE_RECONCILED);
 }
 
 void
 gnc_split_reg_sort_num_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_split_reg_sort(gsr, BY_NUM);
+    GNCSplitReg *gsr = data;
+    gnc_split_reg_sort(gsr, BY_NUM);
 }
 
 void
 gnc_split_reg_sort_amount_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_split_reg_sort(gsr, BY_AMOUNT);
+    GNCSplitReg *gsr = data;
+    gnc_split_reg_sort(gsr, BY_AMOUNT);
 }
 
 void
 gnc_split_reg_sort_memo_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_split_reg_sort(gsr, BY_MEMO);
+    GNCSplitReg *gsr = data;
+    gnc_split_reg_sort(gsr, BY_MEMO);
 }
 
 void
 gnc_split_reg_sort_desc_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_split_reg_sort(gsr, BY_DESC);
+    GNCSplitReg *gsr = data;
+    gnc_split_reg_sort(gsr, BY_DESC);
 }
 
 void
 gnc_split_reg_sort_action_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_split_reg_sort(gsr, BY_ACTION);
+    GNCSplitReg *gsr = data;
+    gnc_split_reg_sort(gsr, BY_ACTION);
 }
 
 void
 gnc_split_reg_sort_notes_cb(GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  gnc_split_reg_sort(gsr, BY_NOTES);
+    GNCSplitReg *gsr = data;
+    gnc_split_reg_sort(gsr, BY_NOTES);
 }
 
 void
 gnc_split_reg_handle_exchange_cb (GtkWidget *w, gpointer data)
 {
-  GNCSplitReg *gsr = data;
-  SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
+    GNCSplitReg *gsr = data;
+    SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
 
-  /* XXX Ignore the return value -- we don't care if this succeeds */
-  (void)gnc_split_register_handle_exchange (reg, TRUE);
+    /* XXX Ignore the return value -- we don't care if this succeeds */
+    (void)gnc_split_register_handle_exchange (reg, TRUE);
 }
 
 static void
 gnc_split_reg_record (GNCSplitReg *gsr)
 {
-  SplitRegister *reg;
-  Transaction *trans;
+    SplitRegister *reg;
+    Transaction *trans;
 
-  ENTER("gsr=%p", gsr);
+    ENTER("gsr=%p", gsr);
 
-  reg = gnc_ledger_display_get_split_register (gsr->ledger);
-  trans = gnc_split_register_get_current_trans (reg);
+    reg = gnc_ledger_display_get_split_register (gsr->ledger);
+    trans = gnc_split_register_get_current_trans (reg);
 
-  if (!gnc_split_register_save (reg, TRUE))
-  {
-    LEAVE("no save");
-    return;
-  }
+    if (!gnc_split_register_save (reg, TRUE))
+    {
+        LEAVE("no save");
+        return;
+    }
 
-  gsr_emit_include_date_signal( gsr, xaccTransGetDate(trans) );
+    gsr_emit_include_date_signal( gsr, xaccTransGetDate(trans) );
 
-  /* Explicit redraw shouldn't be needed, 
-   * since gui_refresh events should handle this. */
-  /* gnc_split_register_redraw (reg); */
-  LEAVE(" ");
+    /* Explicit redraw shouldn't be needed,
+     * since gui_refresh events should handle this. */
+    /* gnc_split_register_redraw (reg); */
+    LEAVE(" ");
 }
 
 static gboolean
 gnc_split_reg_match_trans_row( VirtualLocation virt_loc,
                                gpointer user_data )
 {
-  GNCSplitReg *gsr = user_data;
-  CursorClass cursor_class;
-  SplitRegister *sr;
+    GNCSplitReg *gsr = user_data;
+    CursorClass cursor_class;
+    SplitRegister *sr;
 
-  sr = gnc_ledger_display_get_split_register (gsr->ledger);
-  cursor_class = gnc_split_register_get_cursor_class (sr, virt_loc.vcell_loc);
+    sr = gnc_ledger_display_get_split_register (gsr->ledger);
+    cursor_class = gnc_split_register_get_cursor_class (sr, virt_loc.vcell_loc);
 
-  return (cursor_class == CURSOR_CLASS_TRANS);
+    return (cursor_class == CURSOR_CLASS_TRANS);
 }
 
 static void
 gnc_split_reg_goto_next_trans_row (GNCSplitReg *gsr)
 {
-  ENTER("gsr=%p", gsr);
-  gnucash_register_goto_next_matching_row( gsr->reg,
-                                           gnc_split_reg_match_trans_row,
-                                           gsr );
-  LEAVE(" ");
+    ENTER("gsr=%p", gsr);
+    gnucash_register_goto_next_matching_row( gsr->reg,
+            gnc_split_reg_match_trans_row,
+            gsr );
+    LEAVE(" ");
 }
 
 void
 gnc_split_reg_enter( GNCSplitReg *gsr, gboolean next_transaction )
 {
-  SplitRegister *sr = gnc_ledger_display_get_split_register( gsr->ledger );
-  gboolean goto_blank;
+    SplitRegister *sr = gnc_ledger_display_get_split_register( gsr->ledger );
+    gboolean goto_blank;
 
-  ENTER("gsr=%p, next_transaction=%s", gsr, next_transaction? "TRUE" : "FALSE");
+    ENTER("gsr=%p, next_transaction=%s", gsr, next_transaction ? "TRUE" : "FALSE");
 
-  goto_blank = gnc_gconf_get_bool(GCONF_GENERAL_REGISTER,
-				  "enter_moves_to_end", NULL);
+    goto_blank = gnc_gconf_get_bool(GCONF_GENERAL_REGISTER,
+                                    "enter_moves_to_end", NULL);
 
-  /* If we are in single or double line mode and we hit enter
-   * on the blank split, go to the blank split instead of the
-   * next row. This prevents the cursor from jumping around
-   * when you are entering transactions. */
-  if ( !goto_blank && !next_transaction )
-  {
-    SplitRegisterStyle style = sr->style;
-
-    if (style == REG_STYLE_LEDGER)
+    /* If we are in single or double line mode and we hit enter
+     * on the blank split, go to the blank split instead of the
+     * next row. This prevents the cursor from jumping around
+     * when you are entering transactions. */
+    if ( !goto_blank && !next_transaction )
     {
-      Split *blank_split;
+        SplitRegisterStyle style = sr->style;
 
-      blank_split = gnc_split_register_get_blank_split(sr);
-      if (blank_split != NULL)
-      {
-        Split *current_split;
+        if (style == REG_STYLE_LEDGER)
+        {
+            Split *blank_split;
 
-        current_split = gnc_split_register_get_current_split(sr);
+            blank_split = gnc_split_register_get_blank_split(sr);
+            if (blank_split != NULL)
+            {
+                Split *current_split;
 
-        if (blank_split == current_split)
-          goto_blank = TRUE;
-      }
+                current_split = gnc_split_register_get_current_split(sr);
+
+                if (blank_split == current_split)
+                    goto_blank = TRUE;
+            }
+        }
     }
-  }
 
-  /* First record the transaction. This will perform a refresh. */
-  gnc_split_reg_record( gsr );
+    /* First record the transaction. This will perform a refresh. */
+    gnc_split_reg_record( gsr );
 
-  if (!goto_blank && next_transaction)
-    gnc_split_register_expand_current_trans (sr, FALSE);
+    if (!goto_blank && next_transaction)
+        gnc_split_register_expand_current_trans (sr, FALSE);
 
-  /* Now move. */
-  if (goto_blank)
-    gnc_split_reg_jump_to_blank( gsr );
-  else if (next_transaction)
-    gnc_split_reg_goto_next_trans_row( gsr );
-  else
-    gnucash_register_goto_next_virt_row( gsr->reg );
-  LEAVE(" ");
+    /* Now move. */
+    if (goto_blank)
+        gnc_split_reg_jump_to_blank( gsr );
+    else if (next_transaction)
+        gnc_split_reg_goto_next_trans_row( gsr );
+    else
+        gnucash_register_goto_next_virt_row( gsr->reg );
+    LEAVE(" ");
 }
 
 void
 gsr_default_enter_handler( GNCSplitReg *gsr, gpointer data )
 {
-  gnc_split_reg_enter( gsr, FALSE );
+    gnc_split_reg_enter( gsr, FALSE );
 }
 
 void
 gnc_split_reg_record_cb (GnucashRegister *reg, gpointer data)
 {
-  gsr_emit_simple_signal( (GNCSplitReg*)data, "enter_ent" );
+    gsr_emit_simple_signal( (GNCSplitReg*)data, "enter_ent" );
 }
 
 void
@@ -1792,71 +1819,72 @@
                              GtkAllocation *allocation,
                              gpointer user_data)
 {
-  GNCSplitReg *gsr = user_data;
-  gsr->width = allocation->width;
-  gtk_window_set_default_size( GTK_WINDOW(gsr->window), gsr->width, 0 );
+    GNCSplitReg *gsr = user_data;
+    gsr->width = allocation->width;
+    gtk_window_set_default_size( GTK_WINDOW(gsr->window), gsr->width, 0 );
 }
 
 static
 GtkWidget*
 add_summary_label (GtkWidget *summarybar, const char *label_str)
 {
-  GtkWidget *hbox;
-  GtkWidget *label;
+    GtkWidget *hbox;
+    GtkWidget *label;
 
-  hbox = gtk_hbox_new(FALSE, 2);
-  gtk_box_pack_start( GTK_BOX(summarybar), hbox, FALSE, FALSE, 5 );
+    hbox = gtk_hbox_new(FALSE, 2);
+    gtk_box_pack_start( GTK_BOX(summarybar), hbox, FALSE, FALSE, 5 );
 
-  label = gtk_label_new( label_str );
-  gtk_misc_set_alignment( GTK_MISC(label), 1.0, 0.5 );
-  gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
+    label = gtk_label_new( label_str );
+    gtk_misc_set_alignment( GTK_MISC(label), 1.0, 0.5 );
+    gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
 
-  label = gtk_label_new( "" );
-  gtk_misc_set_alignment( GTK_MISC(label), 1.0, 0.5 );
-  gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
+    label = gtk_label_new( "" );
+    gtk_misc_set_alignment( GTK_MISC(label), 1.0, 0.5 );
+    gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
 
-  return label;
+    return label;
 }
 
 GtkWidget *
 gsr_create_summary_bar( GNCSplitReg *gsr )
 {
-  GtkWidget *summarybar;
+    GtkWidget *summarybar;
 
-  gsr->cleared_label    = NULL;
-  gsr->balance_label    = NULL;
-  gsr->reconciled_label = NULL;
-  gsr->future_label     = NULL;
-  gsr->projectedminimum_label  = NULL;
-  gsr->shares_label     = NULL;
-  gsr->value_label      = NULL;
+    gsr->cleared_label    = NULL;
+    gsr->balance_label    = NULL;
+    gsr->reconciled_label = NULL;
+    gsr->future_label     = NULL;
+    gsr->projectedminimum_label  = NULL;
+    gsr->shares_label     = NULL;
+    gsr->value_label      = NULL;
 
-  if ( gnc_ledger_display_type(gsr->ledger) >= LD_SUBACCOUNT ) {
-    gsr->summarybar = NULL;
-    return NULL;
-  }
+    if ( gnc_ledger_display_type(gsr->ledger) >= LD_SUBACCOUNT )
+    {
+        gsr->summarybar = NULL;
+        return NULL;
+    }
 
-  summarybar = gtk_hbox_new (FALSE, 4);
+    summarybar = gtk_hbox_new (FALSE, 4);
 
-  if (!xaccAccountIsPriced(gnc_ledger_display_leader(gsr->ledger)))
-  {
-    gsr->balance_label    = add_summary_label (summarybar, _("Present:"));
-    gsr->future_label     = add_summary_label (summarybar, _("Future:"));
-    gsr->cleared_label    = add_summary_label (summarybar, _("Cleared:"));
-    gsr->reconciled_label = add_summary_label (summarybar, _("Reconciled:"));
-    gsr->projectedminimum_label  = add_summary_label (summarybar, _("Projected Minimum:"));
-  }
-  else
-  {
-    gsr->shares_label     = add_summary_label (summarybar, _("Shares:"));
-    gsr->value_label      = add_summary_label (summarybar, _("Current Value:"));
-  }
+    if (!xaccAccountIsPriced(gnc_ledger_display_leader(gsr->ledger)))
+    {
+        gsr->balance_label    = add_summary_label (summarybar, _("Present:"));
+        gsr->future_label     = add_summary_label (summarybar, _("Future:"));
+        gsr->cleared_label    = add_summary_label (summarybar, _("Cleared:"));
+        gsr->reconciled_label = add_summary_label (summarybar, _("Reconciled:"));
+        gsr->projectedminimum_label  = add_summary_label (summarybar, _("Projected Minimum:"));
+    }
+    else
+    {
+        gsr->shares_label     = add_summary_label (summarybar, _("Shares:"));
+        gsr->value_label      = add_summary_label (summarybar, _("Current Value:"));
+    }
 
-  gsr->summarybar = summarybar;
+    gsr->summarybar = summarybar;
 
-  /* Force the first update */
-  gsr_redraw_all_cb(NULL, gsr);
-  return gsr->summarybar;
+    /* Force the first update */
+    gsr_redraw_all_cb(NULL, gsr);
+    return gsr->summarybar;
 }
 
 /**
@@ -1869,46 +1897,48 @@
 GNCPlaceholderType
 gnc_split_reg_get_placeholder( GNCSplitReg *gsr )
 {
-  Account *leader;
-  SplitRegister *reg;
-  gboolean single_account;
+    Account *leader;
+    SplitRegister *reg;
+    gboolean single_account;
 
-  if (gsr == NULL)
-    return PLACEHOLDER_NONE;
+    if (gsr == NULL)
+        return PLACEHOLDER_NONE;
 
-  reg = gnc_ledger_display_get_split_register( gsr->ledger );
+    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 
-  switch (reg->type)
-  {
+    switch (reg->type)
+    {
     case GENERAL_LEDGER:
     case INCOME_LEDGER:
     case PORTFOLIO_LEDGER:
     case SEARCH_LEDGER:
-      single_account = FALSE;
-      break;
+        single_account = FALSE;
+        break;
     default:
-      single_account = TRUE;
-      break;
-  }
+        single_account = TRUE;
+        break;
+    }
 
-  leader = gnc_ledger_display_leader( gsr->ledger );
+    leader = gnc_ledger_display_leader( gsr->ledger );
 
-  if (leader == NULL)
-    return PLACEHOLDER_NONE;
-  if (single_account) {
-    if (xaccAccountGetPlaceholder( leader ))
-      return PLACEHOLDER_THIS;
-    return PLACEHOLDER_NONE;
-  }
-  return xaccAccountGetDescendantPlaceholder( leader );
+    if (leader == NULL)
+        return PLACEHOLDER_NONE;
+    if (single_account)
+    {
+        if (xaccAccountGetPlaceholder( leader ))
+            return PLACEHOLDER_THIS;
+        return PLACEHOLDER_NONE;
+    }
+    return xaccAccountGetDescendantPlaceholder( leader );
 }
 
 /**
  * @see gtk_callback_bug_workaround
  **/
-typedef struct dialog_args  {
-  GNCSplitReg *gsr;
-  gchar *string;
+typedef struct dialog_args
+{
+    GNCSplitReg *gsr;
+    gchar *string;
 } dialog_args;
 
 /**
@@ -1920,21 +1950,21 @@
 gboolean
 gtk_callback_bug_workaround (gpointer argp)
 {
-  dialog_args *args = argp;
-  const gchar *read_only = _("This account register is read-only.");
-  GtkWidget *dialog;
+    dialog_args *args = argp;
+    const gchar *read_only = _("This account register is read-only.");
+    GtkWidget *dialog;
 
-  dialog = gtk_message_dialog_new(GTK_WINDOW(args->gsr->window),
-				  GTK_DIALOG_DESTROY_WITH_PARENT,
-				  GTK_MESSAGE_WARNING,
-				  GTK_BUTTONS_CLOSE,
-				  "%s", read_only);
-  gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-					   "%s", args->string);
-  gnc_dialog_run(GTK_DIALOG(dialog), "register_read_only");
-  gtk_widget_destroy(dialog);
-  g_free(args);
-  return FALSE;
+    dialog = gtk_message_dialog_new(GTK_WINDOW(args->gsr->window),
+                                    GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_WARNING,
+                                    GTK_BUTTONS_CLOSE,
+                                    "%s", read_only);
+    gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+            "%s", args->string);
+    gnc_dialog_run(GTK_DIALOG(dialog), "register_read_only");
+    gtk_widget_destroy(dialog);
+    g_free(args);
+    return FALSE;
 }
 
 /**
@@ -1944,41 +1974,43 @@
 void
 gnc_split_reg_determine_read_only( GNCSplitReg *gsr )
 {
-  dialog_args *args = g_malloc(sizeof(dialog_args));
-  SplitRegister *reg;
+    dialog_args *args = g_malloc(sizeof(dialog_args));
+    SplitRegister *reg;
 
-  if ( !gsr->read_only ) {
+    if ( !gsr->read_only )
+    {
 
-    switch (gnc_split_reg_get_placeholder(gsr)) {
-    case PLACEHOLDER_NONE:
-      /* stay as false. */
-      return;
+        switch (gnc_split_reg_get_placeholder(gsr))
+        {
+        case PLACEHOLDER_NONE:
+            /* stay as false. */
+            return;
 
-    case PLACEHOLDER_THIS:
-      args->string = _("This account may not be edited.  If you want "
-                       "to edit transactions in this register, please "
-                       "open the account options and turn off the "
-                       "placeholder checkbox.");
-      break;
+        case PLACEHOLDER_THIS:
+            args->string = _("This account may not be edited.  If you want "
+                             "to edit transactions in this register, please "
+                             "open the account options and turn off the "
+                             "placeholder checkbox.");
+            break;
 
-    default:
-      args->string = _("One of the sub-accounts selected may not be "
-                       "edited.  If you want to edit transactions in "
-                       "this register, please open the sub-account "
-                       "options and turn off the placeholder checkbox. "
-                       "You may also open an individual account instead "
-                       "of a set of accounts.");
-      break;
+        default:
+            args->string = _("One of the sub-accounts selected may not be "
+                             "edited.  If you want to edit transactions in "
+                             "this register, please open the sub-account "
+                             "options and turn off the placeholder checkbox. "
+                             "You may also open an individual account instead "
+                             "of a set of accounts.");
+            break;
+        }
+        gsr->read_only = TRUE;
+        /* Put up a warning dialog */
+        args->gsr = gsr;
+        g_timeout_add (250, gtk_callback_bug_workaround, args); /* 0.25 seconds */
     }
-    gsr->read_only = TRUE;
-    /* Put up a warning dialog */
-    args->gsr = gsr;
-    g_timeout_add (250, gtk_callback_bug_workaround, args); /* 0.25 seconds */
-  }
 
-  /* Make the contents immutable */
-  reg = gnc_ledger_display_get_split_register( gsr->ledger );
-  gnc_split_register_set_read_only( reg, TRUE );
+    /* Make the contents immutable */
+    reg = gnc_ledger_display_get_split_register( gsr->ledger );
+    gnc_split_register_set_read_only( reg, TRUE );
 
 }
 
@@ -1986,74 +2018,74 @@
 gncUIWidget
 gnc_split_reg_get_parent( GNCLedgerDisplay *ledger )
 {
-  GNCSplitReg *gsr =
-    GNC_SPLIT_REG(gnc_ledger_display_get_user_data( ledger ));
+    GNCSplitReg *gsr =
+        GNC_SPLIT_REG(gnc_ledger_display_get_user_data( ledger ));
 
-  if (gsr == NULL)
-    return NULL;
+    if (gsr == NULL)
+        return NULL;
 
-  return gsr->window;
+    return gsr->window;
 }
 
 static
 void
 gsr_emit_help_changed( GnucashRegister *reg, gpointer user_data )
 {
-  gsr_emit_simple_signal( (GNCSplitReg*)user_data, "help-changed" );
+    gsr_emit_simple_signal( (GNCSplitReg*)user_data, "help-changed" );
 }
 
 static
 void
 gsr_emit_include_date_signal( GNCSplitReg *gsr, time_t date )
 {
-  g_signal_emit_by_name( gsr, "include-date", date, NULL );
+    g_signal_emit_by_name( gsr, "include-date", date, NULL );
 }
 
 static
 void
 gsr_emit_simple_signal( GNCSplitReg *gsr, const char *sigName )
 {
-  g_signal_emit_by_name( gsr, sigName, NULL );
+    g_signal_emit_by_name( gsr, sigName, NULL );
 }
 
 GnucashRegister*
 gnc_split_reg_get_register( GNCSplitReg *gsr )
 {
-  if ( !gsr )
-    return NULL;
+    if ( !gsr )
+        return NULL;
 
-  return gsr->reg;
+    return gsr->reg;
 }
 
 SortType
 gnc_split_reg_get_sort_type( GNCSplitReg *gsr )
 {
-  g_assert( gsr );
-  return gsr->sort_type;
+    g_assert( gsr );
+    return gsr->sort_type;
 }
 
 void
 gnc_split_reg_set_sort_type( GNCSplitReg *gsr, SortType t )
 {
-  gnc_split_reg_sort( gsr, t );
+    gnc_split_reg_sort( gsr, t );
 }
 
 GtkWidget*
 gnc_split_reg_get_summarybar( GNCSplitReg *gsr )
 {
-  if ( !gsr ) return NULL;
-  return gsr->summarybar;
+    if ( !gsr ) return NULL;
+    return gsr->summarybar;
 }
 
 gboolean
 gnc_split_reg_get_read_only( GNCSplitReg *gsr )
 {
-  g_assert( gsr );
-  return gsr->read_only;
+    g_assert( gsr );
+    return gsr->read_only;
 }
 
 void
 gnc_split_reg_set_moved_cb( GNCSplitReg *gsr, GFunc cb, gpointer cb_data )
 {
-  gnucash_register_set_moved_cb (gsr->reg, cb, cb_data);
+    gnucash_register_set_moved_cb (gsr->reg, cb, cb_data);
 }

Modified: gnucash/trunk/src/gnome/gnc-split-reg.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-split-reg.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/gnc-split-reg.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -41,100 +41,103 @@
 typedef struct _GNCSplitReg GNCSplitReg;
 typedef struct _GNCSplitRegClass GNCSplitRegClass;
 
-struct _GNCSplitReg {
-  /* The "parent" widget. */
-  GtkVBox vbox;
+struct _GNCSplitReg
+{
+    /* The "parent" widget. */
+    GtkVBox vbox;
 
-  /* The containing window. */
-  GtkWidget *window;
-  gint width;
-  gint height;
+    /* The containing window. */
+    GtkWidget *window;
+    gint width;
+    gint height;
 
-  GtkWidget *toolbar;
-  GtkWidget *summarybar; 
+    GtkWidget *toolbar;
+    GtkWidget *summarybar;
 
-  GtkWidget *popup_menu;
+    GtkWidget *popup_menu;
 
-  GtkWidget *edit_menu;
-  GtkWidget *view_menu;
-  GtkWidget *style_submenu;
-  GtkWidget *sort_submenu;
-  GtkWidget *action_menu;
+    GtkWidget *edit_menu;
+    GtkWidget *view_menu;
+    GtkWidget *style_submenu;
+    GtkWidget *sort_submenu;
+    GtkWidget *action_menu;
 
-  GtkWidget * double_line_check;
+    GtkWidget * double_line_check;
 
-  GtkWidget *split_button;
-  GtkWidget *split_menu_check;
-  GtkWidget *split_popup_check;
+    GtkWidget *split_button;
+    GtkWidget *split_menu_check;
+    GtkWidget *split_popup_check;
 
-  /* Summary Bar Labels */
-  GtkWidget *balance_label;
-  GtkWidget *cleared_label;
-  GtkWidget *reconciled_label;
-  GtkWidget *future_label;
-  GtkWidget *projectedminimum_label;
-  GtkWidget *shares_label;
-  GtkWidget *value_label;
+    /* Summary Bar Labels */
+    GtkWidget *balance_label;
+    GtkWidget *cleared_label;
+    GtkWidget *reconciled_label;
+    GtkWidget *future_label;
+    GtkWidget *projectedminimum_label;
+    GtkWidget *shares_label;
+    GtkWidget *value_label;
 
-  /** The current ledger display. **/
-  GNCLedgerDisplay *ledger;
-  /** The actual sheet widget. **/
-  GnucashRegister *reg;
+    /** The current ledger display. **/
+    GNCLedgerDisplay *ledger;
+    /** The actual sheet widget. **/
+    GnucashRegister *reg;
 
-  gint numRows;
+    gint numRows;
 
-  guint sort_type;
+    guint sort_type;
 
-  gboolean read_only;
+    gboolean read_only;
 };
 
-struct _GNCSplitRegClass {
-  GtkVBoxClass parent_class;
+struct _GNCSplitRegClass
+{
+    GtkVBoxClass parent_class;
 
-  /* Signal defaults */
-  void (*enter_ent_cb)    ( GNCSplitReg *w, gpointer user_data );
-  void (*cancel_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
-  void (*delete_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
-  void (*reinit_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
-  void (*dup_ent_cb)      ( GNCSplitReg *w, gpointer user_data );
-  void (*schedule_ent_cb) ( GNCSplitReg *w, gpointer user_data );
-  void (*expand_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
-  void (*blank_cb)        ( GNCSplitReg *w, gpointer user_data );
-  void (*jump_cb)         ( GNCSplitReg *w, gpointer user_data );
-  void (*cut_cb)          ( GNCSplitReg *w, gpointer user_data );
-  void (*cut_txn_cb)      ( GNCSplitReg *w, gpointer user_data );
-  void (*copy_cb)         ( GNCSplitReg *w, gpointer user_data );
-  void (*copy_txn_cb)     ( GNCSplitReg *w, gpointer user_data );
-  void (*paste_cb)        ( GNCSplitReg *w, gpointer user_data );
-  void (*paste_txn_cb)    ( GNCSplitReg *w, gpointer user_data );
-  void (*void_txn_cb)     ( GNCSplitReg *w, gpointer user_data );
-  void (*unvoid_txn_cb)   ( GNCSplitReg *w, gpointer user_data );
-  void (*reverse_txn_cb)  ( GNCSplitReg *w, gpointer user_data );
-  void (*help_changed_cb) ( GNCSplitReg *w, gpointer user_data );
-  void (*include_date_cb) ( GNCSplitReg *w, time_t date, gpointer user_data );
+    /* Signal defaults */
+    void (*enter_ent_cb)    ( GNCSplitReg *w, gpointer user_data );
+    void (*cancel_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
+    void (*delete_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
+    void (*reinit_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
+    void (*dup_ent_cb)      ( GNCSplitReg *w, gpointer user_data );
+    void (*schedule_ent_cb) ( GNCSplitReg *w, gpointer user_data );
+    void (*expand_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
+    void (*blank_cb)        ( GNCSplitReg *w, gpointer user_data );
+    void (*jump_cb)         ( GNCSplitReg *w, gpointer user_data );
+    void (*cut_cb)          ( GNCSplitReg *w, gpointer user_data );
+    void (*cut_txn_cb)      ( GNCSplitReg *w, gpointer user_data );
+    void (*copy_cb)         ( GNCSplitReg *w, gpointer user_data );
+    void (*copy_txn_cb)     ( GNCSplitReg *w, gpointer user_data );
+    void (*paste_cb)        ( GNCSplitReg *w, gpointer user_data );
+    void (*paste_txn_cb)    ( GNCSplitReg *w, gpointer user_data );
+    void (*void_txn_cb)     ( GNCSplitReg *w, gpointer user_data );
+    void (*unvoid_txn_cb)   ( GNCSplitReg *w, gpointer user_data );
+    void (*reverse_txn_cb)  ( GNCSplitReg *w, gpointer user_data );
+    void (*help_changed_cb) ( GNCSplitReg *w, gpointer user_data );
+    void (*include_date_cb) ( GNCSplitReg *w, time_t date, gpointer user_data );
 };
 
-typedef enum {
-  ENTER,
-  CANCEL,
-  DELETE,
-  REINIT,
-  DUPLICATE,
-  SCHEDULE,
-  SPLIT,
-  BLANK,
-  JUMP,
-  CUT,
-  CUT_TXN,
-  COPY,
-  COPY_TXN,
-  PASTE,
-  PASTE_TXN,
-  SORT_ORDER_SUBMENU,
-  STYLE_SUBMENU,
+typedef enum
+{
+    ENTER,
+    CANCEL,
+    DELETE,
+    REINIT,
+    DUPLICATE,
+    SCHEDULE,
+    SPLIT,
+    BLANK,
+    JUMP,
+    CUT,
+    CUT_TXN,
+    COPY,
+    COPY_TXN,
+    PASTE,
+    PASTE_TXN,
+    SORT_ORDER_SUBMENU,
+    STYLE_SUBMENU,
 } GNC_SPLIT_REG_ITEM;
 
-/* Easy way to pass the sort-type 
+/* Easy way to pass the sort-type
  * Note that this is STUPID -- we should be using parameter lists,
  * but this provides a simple case statement internally.  This should
  * probably not actually be exposed in the external interface....
@@ -223,14 +226,14 @@
 void gnc_split_reg_jump_to_split_amount(GNCSplitReg *gsr, Split *split);
 
 /*
- * Create a transaction entry with given amount and date. One account is 
- * specified, the other is undefined i.e. it defaults to orphan account.  
+ * Create a transaction entry with given amount and date. One account is
+ * specified, the other is undefined i.e. it defaults to orphan account.
  * Jump to the transaction entry in the register.
  * The purpose of this function to create an adjustment entry from the reconcile
- * window. 
+ * window.
  */
-void gnc_split_reg_balancing_entry (GNCSplitReg *gsr, Account *account, 
-    time_t statement_date, gnc_numeric balancing_amount);
+void gnc_split_reg_balancing_entry (GNCSplitReg *gsr, Account *account,
+                                    time_t statement_date, gnc_numeric balancing_amount);
 
 void gsr_default_delete_handler( GNCSplitReg *gsr, gpointer data );
 void gnc_split_reg_enter( GNCSplitReg *gsr, gboolean next_transaction );

Modified: gnucash/trunk/src/gnome/lot-viewer.c
===================================================================
--- gnucash/trunk/src/gnome/lot-viewer.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/lot-viewer.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -22,8 +22,8 @@
 \********************************************************************/
 
 /* XXX todo: The button "view lot in register" is not implemented.
- *   it needs to open register window showing only the splits in the 
- *     given lot ... 
+ *   it needs to open register window showing only the splits in the
+ *     given lot ...
  *
  * XXX clist should be probably be removed and replaced by the gnc_query_list
  */
@@ -50,14 +50,15 @@
 
 #define LOT_VIEWER_CM_CLASS "lot-viewer"
 
-enum lot_cols {
-  LOT_COL_OPEN = 0,
-  LOT_COL_CLOSE,
-  LOT_COL_TITLE,
-  LOT_COL_BALN,
-  LOT_COL_GAINS,
-  LOT_COL_PNTR,
-  NUM_LOT_COLS
+enum lot_cols
+{
+    LOT_COL_OPEN = 0,
+    LOT_COL_CLOSE,
+    LOT_COL_TITLE,
+    LOT_COL_BALN,
+    LOT_COL_GAINS,
+    LOT_COL_PNTR,
+    NUM_LOT_COLS
 };
 
 #define RESPONSE_VIEW          1
@@ -70,25 +71,25 @@
 #define GCONF_KEY_HPOSITION "hpane_position"
 #define GCONF_KEY_VPOSITION "vpane_position"
 
-struct _GNCLotViewer 
+struct _GNCLotViewer
 {
-   GtkWidget     * window;
+    GtkWidget     * window;
 #ifdef LOTS_READY_FOR_SHOWTIME
-   GtkButton     * regview_button;
+    GtkButton     * regview_button;
 #endif
-   GtkButton     * delete_button;
-   GtkButton     * scrub_lot_button;
-   GtkButton     * new_lot_button;
-   GtkPaned      * lot_hpaned;
-   GtkPaned      * lot_vpaned;
-   GtkTreeView   * lot_view;
-   GtkListStore  * lot_store;
-   GtkTextView   * lot_notes;
-   GtkEntry      * title_entry;
-   GtkCList      * mini_clist;
+    GtkButton     * delete_button;
+    GtkButton     * scrub_lot_button;
+    GtkButton     * new_lot_button;
+    GtkPaned      * lot_hpaned;
+    GtkPaned      * lot_vpaned;
+    GtkTreeView   * lot_view;
+    GtkListStore  * lot_store;
+    GtkTextView   * lot_notes;
+    GtkEntry      * title_entry;
+    GtkCList      * mini_clist;
 
-   Account       * account;
-   GNCLot        * selected_lot;
+    Account       * account;
+    GNCLot        * selected_lot;
 };
 
 static void gnc_lot_viewer_fill (GNCLotViewer *lv);
@@ -100,108 +101,108 @@
 void lv_response_cb (GtkDialog *dialog, gint response, gpointer data);
 void lv_window_destroy_cb (GtkObject *object, gpointer user_data);
 void lv_paned_notify_cb (GObject *gobject,
-			 GParamSpec *pspec,
-			 gpointer user_data);
+                         GParamSpec *pspec,
+                         gpointer user_data);
 
 /* ======================================================================== */
 /* Put the splits into the split clist */
 
-#define MINI_DATE_COL 0 
+#define MINI_DATE_COL 0
 #define MINI_NUM_COL  1
-#define MINI_DESC_COL 2 
-#define MINI_AMNT_COL 3 
-#define MINI_VALU_COL 4 
+#define MINI_DESC_COL 2
+#define MINI_AMNT_COL 3
+#define MINI_VALU_COL 4
 #define MINI_GAIN_COL 5
-#define MINI_BALN_COL 6 
+#define MINI_BALN_COL 6
 #define MINI_NUM_COLS 7
 
 static void
 lv_show_splits (GNCLotViewer *lv)
 {
-   GNCLot *lot = lv->selected_lot;
-   SplitList *split_list, *node;
-   gnc_numeric baln = gnc_numeric_zero();
+    GNCLot *lot = lv->selected_lot;
+    SplitList *split_list, *node;
+    gnc_numeric baln = gnc_numeric_zero();
 
-   if (NULL == lot) return;
+    if (NULL == lot) return;
 
-/* qof_event_suspend();  XXX remove when xaccSplitGetCapGains() fixed */
-   gtk_clist_freeze (lv->mini_clist);
-   gtk_clist_clear (lv->mini_clist);
-   split_list = gnc_lot_get_split_list (lot);
-   for (node = split_list; node; node=node->next)
-   {
-      Split *split = node->data;
-      char dbuff[MAX_DATE_LENGTH];
-      char amtbuff[200];
-      char valbuff[200];
-      char gainbuff[200];
-      char balnbuff[200];
-      gnc_commodity *currency;
-      Transaction *trans = xaccSplitGetParent (split);
-      time_t date = xaccTransGetDate (trans);
-      gnc_numeric amnt, valu, gains;
-      const char *row_vals[MINI_NUM_COLS];
-      int row;
+    /* qof_event_suspend();  XXX remove when xaccSplitGetCapGains() fixed */
+    gtk_clist_freeze (lv->mini_clist);
+    gtk_clist_clear (lv->mini_clist);
+    split_list = gnc_lot_get_split_list (lot);
+    for (node = split_list; node; node = node->next)
+    {
+        Split *split = node->data;
+        char dbuff[MAX_DATE_LENGTH];
+        char amtbuff[200];
+        char valbuff[200];
+        char gainbuff[200];
+        char balnbuff[200];
+        gnc_commodity *currency;
+        Transaction *trans = xaccSplitGetParent (split);
+        time_t date = xaccTransGetDate (trans);
+        gnc_numeric amnt, valu, gains;
+        const char *row_vals[MINI_NUM_COLS];
+        int row;
 
-      /* Do not show gains splits */
-      if (gnc_numeric_zero_p (xaccSplitGetAmount(split))) continue;
+        /* Do not show gains splits */
+        if (gnc_numeric_zero_p (xaccSplitGetAmount(split))) continue;
 
-      /* Opening date */
-      qof_print_date_buff (dbuff, MAX_DATE_LENGTH, date);
-      row_vals[MINI_DATE_COL] = dbuff;
+        /* Opening date */
+        qof_print_date_buff (dbuff, MAX_DATE_LENGTH, date);
+        row_vals[MINI_DATE_COL] = dbuff;
 
-      row_vals[MINI_NUM_COL]  = xaccTransGetNum (trans);
-      row_vals[MINI_DESC_COL] = xaccTransGetDescription (trans);
+        row_vals[MINI_NUM_COL]  = xaccTransGetNum (trans);
+        row_vals[MINI_DESC_COL] = xaccTransGetDescription (trans);
 
-      /* Amount */
-      amnt = xaccSplitGetAmount (split);
-      xaccSPrintAmount (amtbuff, amnt,
-                 gnc_account_print_info (lv->account, TRUE));
-      row_vals[MINI_AMNT_COL] = amtbuff;
+        /* Amount */
+        amnt = xaccSplitGetAmount (split);
+        xaccSPrintAmount (amtbuff, amnt,
+                          gnc_account_print_info (lv->account, TRUE));
+        row_vals[MINI_AMNT_COL] = amtbuff;
 
-      /* Value. Invert the sign on the first, opening entry. */
-      currency = xaccTransGetCurrency (trans);
-      valu = xaccSplitGetValue (split);
-      if (node != split_list)
-      {
-         valu = gnc_numeric_neg (valu);
-      }
-      xaccSPrintAmount (valbuff, valu,
-                 gnc_commodity_print_info (currency, TRUE));
-      row_vals[MINI_VALU_COL] = valbuff;
+        /* Value. Invert the sign on the first, opening entry. */
+        currency = xaccTransGetCurrency (trans);
+        valu = xaccSplitGetValue (split);
+        if (node != split_list)
+        {
+            valu = gnc_numeric_neg (valu);
+        }
+        xaccSPrintAmount (valbuff, valu,
+                          gnc_commodity_print_info (currency, TRUE));
+        row_vals[MINI_VALU_COL] = valbuff;
 
-      /* Gains. Blank if none. */
-      gains = xaccSplitGetCapGains (split);
-      if (gnc_numeric_zero_p(gains))
-      {
-         gainbuff[0] = 0;
-      }
-      else
-      {
-         xaccSPrintAmount (gainbuff, gains,
-                 gnc_commodity_print_info (currency, TRUE));
-      }
-      row_vals[MINI_GAIN_COL] = gainbuff;
+        /* Gains. Blank if none. */
+        gains = xaccSplitGetCapGains (split);
+        if (gnc_numeric_zero_p(gains))
+        {
+            gainbuff[0] = 0;
+        }
+        else
+        {
+            xaccSPrintAmount (gainbuff, gains,
+                              gnc_commodity_print_info (currency, TRUE));
+        }
+        row_vals[MINI_GAIN_COL] = gainbuff;
 
-      /* Balance of Gains */
-      baln = gnc_numeric_add_fixed (baln, amnt);
-      if (gnc_numeric_zero_p(baln))
-      {
-         balnbuff[0] = 0;
-      }
-      else
-      {
-         xaccSPrintAmount (balnbuff, baln,
-                 gnc_account_print_info (lv->account, TRUE));
-      }
-      row_vals[MINI_BALN_COL] = balnbuff;
+        /* Balance of Gains */
+        baln = gnc_numeric_add_fixed (baln, amnt);
+        if (gnc_numeric_zero_p(baln))
+        {
+            balnbuff[0] = 0;
+        }
+        else
+        {
+            xaccSPrintAmount (balnbuff, baln,
+                              gnc_account_print_info (lv->account, TRUE));
+        }
+        row_vals[MINI_BALN_COL] = balnbuff;
 
-      /* Self-reference */
-      row = gtk_clist_append (lv->mini_clist, (char **)row_vals);
-      gtk_clist_set_selectable (lv->mini_clist, row, FALSE);
-   }
-   gtk_clist_thaw (lv->mini_clist);
-/* qof_event_resume();  XXX remove when xaccSplitGetCapGains() fixed */
+        /* Self-reference */
+        row = gtk_clist_append (lv->mini_clist, (char **)row_vals);
+        gtk_clist_set_selectable (lv->mini_clist, row, FALSE);
+    }
+    gtk_clist_thaw (lv->mini_clist);
+    /* qof_event_resume();  XXX remove when xaccSplitGetCapGains() fixed */
 }
 
 /* ======================================================================== */
@@ -209,117 +210,120 @@
 static void
 lv_clear_splits (GNCLotViewer *lv)
 {
-   gtk_clist_clear (lv->mini_clist);
+    gtk_clist_clear (lv->mini_clist);
 }
 
-static void 
+static void
 lv_save_current_row (GNCLotViewer *lv)
 {
-   GNCLot *lot = lv->selected_lot;
-   const char * str;
-   char * notes;
+    GNCLot *lot = lv->selected_lot;
+    const char * str;
+    char * notes;
 
-   if (lot)
-   {
-	  gnc_lot_begin_edit(lot);
+    if (lot)
+    {
+        gnc_lot_begin_edit(lot);
 
-      /* Get the title, save_the_title */
-      str = gtk_entry_get_text (lv->title_entry);
-      gnc_lot_set_title (lot, str);
+        /* Get the title, save_the_title */
+        str = gtk_entry_get_text (lv->title_entry);
+        gnc_lot_set_title (lot, str);
 
-      /* Get the notes, save the notes */
-      notes = xxxgtk_textview_get_text (lv->lot_notes);
-      gnc_lot_set_notes (lot, notes);
-      g_free(notes);
+        /* Get the notes, save the notes */
+        notes = xxxgtk_textview_get_text (lv->lot_notes);
+        gnc_lot_set_notes (lot, notes);
+        g_free(notes);
 
-	  gnc_lot_commit_edit(lot);
-   }
+        gnc_lot_commit_edit(lot);
+    }
 }
 
 /* ======================================================================== */
 /* Callback for selecting a row the the list-of-list clist */
 
-static void 
+static void
 lv_select_row (GNCLotViewer *lv,
-	       GNCLot       *lot)
+               GNCLot       *lot)
 {
-   const char * str;
+    const char * str;
 
-   lv_save_current_row (lv);
+    lv_save_current_row (lv);
 
-   str = gnc_lot_get_title (lot);
-   if (!str) str = "";
-   gtk_entry_set_text (lv->title_entry, str);
-   gtk_editable_set_editable (GTK_EDITABLE(lv->title_entry), TRUE);
-   
-   /* Set the notes field */
-   str = gnc_lot_get_notes (lot);
-   if (!str) str = "";
-   xxxgtk_textview_set_text (lv->lot_notes, str);
-   gtk_text_view_set_editable (lv->lot_notes, TRUE);
+    str = gnc_lot_get_title (lot);
+    if (!str) str = "";
+    gtk_entry_set_text (lv->title_entry, str);
+    gtk_editable_set_editable (GTK_EDITABLE(lv->title_entry), TRUE);
 
-   /* Don't set until end, to avoid recursion in gtkentry "changed" cb. */
-   lv->selected_lot = lot;
-   lv_show_splits (lv);
+    /* Set the notes field */
+    str = gnc_lot_get_notes (lot);
+    if (!str) str = "";
+    xxxgtk_textview_set_text (lv->lot_notes, str);
+    gtk_text_view_set_editable (lv->lot_notes, TRUE);
 
+    /* Don't set until end, to avoid recursion in gtkentry "changed" cb. */
+    lv->selected_lot = lot;
+    lv_show_splits (lv);
+
 #ifdef LOTS_READY_FOR_SHOWTIME
-   gtk_widget_set_sensitive(GTK_WIDGET(lv->regview_button), TRUE);
+    gtk_widget_set_sensitive(GTK_WIDGET(lv->regview_button), TRUE);
 #endif
-   gtk_widget_set_sensitive(GTK_WIDGET(lv->delete_button), TRUE);
-   gtk_widget_set_sensitive(GTK_WIDGET(lv->scrub_lot_button), TRUE);
+    gtk_widget_set_sensitive(GTK_WIDGET(lv->delete_button), TRUE);
+    gtk_widget_set_sensitive(GTK_WIDGET(lv->scrub_lot_button), TRUE);
 }
 
 /* ======================================================================== */
 
-static void 
+static void
 lv_unset_lot (GNCLotViewer *lv)
 {
-   /* Set immediately, to avoid recursion in gtkentry "changed" cb. */
-   lv->selected_lot = NULL;
+    /* Set immediately, to avoid recursion in gtkentry "changed" cb. */
+    lv->selected_lot = NULL;
 
-   /* Blank the title widget */
-   gtk_entry_set_text (lv->title_entry, "");
-   gtk_editable_set_editable (GTK_EDITABLE(lv->title_entry), FALSE);
+    /* Blank the title widget */
+    gtk_entry_set_text (lv->title_entry, "");
+    gtk_editable_set_editable (GTK_EDITABLE(lv->title_entry), FALSE);
 
-   /* Blank the notes area */
-   xxxgtk_textview_set_text (lv->lot_notes, "");
-   gtk_text_view_set_editable (lv->lot_notes, FALSE);
+    /* Blank the notes area */
+    xxxgtk_textview_set_text (lv->lot_notes, "");
+    gtk_text_view_set_editable (lv->lot_notes, FALSE);
 
-   /* Erase the mini-view area */
-   lv_clear_splits (lv);
+    /* Erase the mini-view area */
+    lv_clear_splits (lv);
 
 #ifdef LOTS_READY_FOR_SHOWTIME
-   gtk_widget_set_sensitive(GTK_WIDGET(lv->regview_button), FALSE);
+    gtk_widget_set_sensitive(GTK_WIDGET(lv->regview_button), FALSE);
 #endif
-   gtk_widget_set_sensitive(GTK_WIDGET(lv->delete_button), FALSE);
-   gtk_widget_set_sensitive(GTK_WIDGET(lv->scrub_lot_button), FALSE);
+    gtk_widget_set_sensitive(GTK_WIDGET(lv->delete_button), FALSE);
+    gtk_widget_set_sensitive(GTK_WIDGET(lv->scrub_lot_button), FALSE);
 }
 
 /* ======================================================================== */
 /* Callback for un-selecting a row the the list-of-list clist */
 
-static void 
+static void
 lv_unselect_row (GNCLotViewer *lv)
 {
-   lv_save_current_row (lv);
+    lv_save_current_row (lv);
 
-   lv_unset_lot (lv);
+    lv_unset_lot (lv);
 }
 
 static void
 lv_selection_changed_cb (GtkTreeSelection *selection,
-			 GNCLotViewer *lv)  
+                         GNCLotViewer *lv)
 {
-   GNCLot *lot;
-   GtkTreeModel *model;
-   GtkTreeIter iter;
+    GNCLot *lot;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
 
-   if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
-     gtk_tree_model_get(model, &iter, LOT_COL_PNTR, &lot, -1);
-     lv_select_row(lv, lot);
-   } else {
-     lv_unselect_row(lv);
-   }
+    if (gtk_tree_selection_get_selected (selection, &model, &iter))
+    {
+        gtk_tree_model_get(model, &iter, LOT_COL_PNTR, &lot, -1);
+        lv_select_row(lv, lot);
+    }
+    else
+    {
+        lv_unselect_row(lv);
+    }
 }
 
 
@@ -329,65 +333,66 @@
 void
 lv_title_entry_changed_cb (GtkEntry *ent, gpointer user_data)
 {
-   GNCLotViewer *lv = user_data;
-   GtkTreeModel *model;
-   GtkTreeIter iter;
-   GtkTreeSelection *selection;
-   const char * title;
-   title = gtk_entry_get_text (lv->title_entry);
+    GNCLotViewer *lv = user_data;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    GtkTreeSelection *selection;
+    const char * title;
+    title = gtk_entry_get_text (lv->title_entry);
 
-   selection = gtk_tree_view_get_selection(lv->lot_view);
-   if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
-     gtk_list_store_set(GTK_LIST_STORE(model), &iter, LOT_COL_TITLE, title, -1);
-   }
+    selection = gtk_tree_view_get_selection(lv->lot_view);
+    if (gtk_tree_selection_get_selected (selection, &model, &iter))
+    {
+        gtk_list_store_set(GTK_LIST_STORE(model), &iter, LOT_COL_TITLE, title, -1);
+    }
 }
 
 /* ======================================================================== */
 /* Get the realized gains for this lot.  This routine or a varient of it
- * should probably be moved to gnc-lot.c. 
- * The conceptual difficulty here is that this works only if all of the 
- * realized gains in the lot are of the 
+ * should probably be moved to gnc-lot.c.
+ * The conceptual difficulty here is that this works only if all of the
+ * realized gains in the lot are of the
  */
 
 static gnc_commodity *
 find_first_currency (GNCLot *lot)
 {
-   SplitList *split_list, *node;
+    SplitList *split_list, *node;
 
-   split_list = gnc_lot_get_split_list(lot); 
-   for (node = split_list; node; node=node->next)
-   {
-      Split *s = node->data;
-      Transaction *trans;
-      if (FALSE == gnc_numeric_zero_p(xaccSplitGetAmount(s))) continue;
-      trans = xaccSplitGetParent (s);
-      return xaccTransGetCurrency (trans);
-   }
-   return NULL;
+    split_list = gnc_lot_get_split_list(lot);
+    for (node = split_list; node; node = node->next)
+    {
+        Split *s = node->data;
+        Transaction *trans;
+        if (FALSE == gnc_numeric_zero_p(xaccSplitGetAmount(s))) continue;
+        trans = xaccSplitGetParent (s);
+        return xaccTransGetCurrency (trans);
+    }
+    return NULL;
 }
 
 static gnc_numeric
 get_realized_gains (GNCLot *lot, gnc_commodity *currency)
 {
-   gnc_numeric zero = gnc_numeric_zero();
-   gnc_numeric gains = zero;
-   SplitList *split_list, *node;
+    gnc_numeric zero = gnc_numeric_zero();
+    gnc_numeric gains = zero;
+    SplitList *split_list, *node;
 
-   if (!currency) return zero;
+    if (!currency) return zero;
 
-   split_list = gnc_lot_get_split_list(lot); 
-   for (node = split_list; node; node=node->next)
-   {
-      Split *s = node->data;
-      Transaction *trans;
+    split_list = gnc_lot_get_split_list(lot);
+    for (node = split_list; node; node = node->next)
+    {
+        Split *s = node->data;
+        Transaction *trans;
 
-      if (FALSE == gnc_numeric_zero_p(xaccSplitGetAmount(s))) continue;
-      trans = xaccSplitGetParent (s);
-      if (FALSE == gnc_commodity_equal (xaccTransGetCurrency(trans), currency)) continue;
+        if (FALSE == gnc_numeric_zero_p(xaccSplitGetAmount(s))) continue;
+        trans = xaccSplitGetParent (s);
+        if (FALSE == gnc_commodity_equal (xaccTransGetCurrency(trans), currency)) continue;
 
-      gains = gnc_numeric_add (gains, xaccSplitGetValue (s), GNC_DENOM_AUTO, GNC_DENOM_FIXED);
-   }
-   return gains;
+        gains = gnc_numeric_add (gains, xaccSplitGetValue (s), GNC_DENOM_AUTO, GNC_DENOM_FIXED);
+    }
+    return gains;
 }
 
 /* ======================================================================== */
@@ -395,95 +400,100 @@
 static void
 gnc_lot_viewer_fill (GNCLotViewer *lv)
 {
-   LotList *lot_list, *node;
-   GNCLot *this_lot, *selected_lot = NULL;
-   GtkListStore *store;
-   GtkTreeModel *model;
-   GtkTreeIter iter;
-   GtkTreeSelection *selection;
-   gboolean found = FALSE;
+    LotList *lot_list, *node;
+    GNCLot *this_lot, *selected_lot = NULL;
+    GtkListStore *store;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    GtkTreeSelection *selection;
+    gboolean found = FALSE;
 
-   lot_list = xaccAccountGetLotList (lv->account);
+    lot_list = xaccAccountGetLotList (lv->account);
 
-   selection = gtk_tree_view_get_selection(lv->lot_view);
-   if (gtk_tree_selection_get_selected (selection, &model, &iter))
-     gtk_tree_model_get(model, &iter, LOT_COL_PNTR, &selected_lot, -1);
+    selection = gtk_tree_view_get_selection(lv->lot_view);
+    if (gtk_tree_selection_get_selected (selection, &model, &iter))
+        gtk_tree_model_get(model, &iter, LOT_COL_PNTR, &selected_lot, -1);
 
-   /* Crazy. Should update in place if possible. */
-   gtk_list_store_clear (lv->lot_store);
+    /* Crazy. Should update in place if possible. */
+    gtk_list_store_clear (lv->lot_store);
 
-   for (node = lot_list; node; node=node->next)
-   {
-      char obuff[MAX_DATE_LENGTH];
-      char cbuff[MAX_DATE_LENGTH];
-      char baln_buff[200];
-      char gain_buff[200];
-      GNCLot *lot = node->data;
-      Split *esplit = gnc_lot_get_earliest_split (lot);
-      Transaction *etrans = xaccSplitGetParent (esplit);
-      time_t open_date = xaccTransGetDate (etrans);
-      gnc_numeric amt_baln = gnc_lot_get_balance (lot);
-      gnc_commodity *currency = find_first_currency (lot);
-      gnc_numeric gains_baln = get_realized_gains (lot, currency);
+    for (node = lot_list; node; node = node->next)
+    {
+        char obuff[MAX_DATE_LENGTH];
+        char cbuff[MAX_DATE_LENGTH];
+        char baln_buff[200];
+        char gain_buff[200];
+        GNCLot *lot = node->data;
+        Split *esplit = gnc_lot_get_earliest_split (lot);
+        Transaction *etrans = xaccSplitGetParent (esplit);
+        time_t open_date = xaccTransGetDate (etrans);
+        gnc_numeric amt_baln = gnc_lot_get_balance (lot);
+        gnc_commodity *currency = find_first_currency (lot);
+        gnc_numeric gains_baln = get_realized_gains (lot, currency);
 
-      store = lv->lot_store;
-      gtk_list_store_append(store, &iter);
+        store = lv->lot_store;
+        gtk_list_store_append(store, &iter);
 
-      /* Opening date */
-      qof_print_date_buff (obuff, MAX_DATE_LENGTH, open_date);
-      gtk_list_store_set(store, &iter, LOT_COL_OPEN, obuff, -1);
+        /* Opening date */
+        qof_print_date_buff (obuff, MAX_DATE_LENGTH, open_date);
+        gtk_list_store_set(store, &iter, LOT_COL_OPEN, obuff, -1);
 
-      /* Closing date */
-      if (gnc_lot_is_closed (lot))
-      {
-         Split *fsplit = gnc_lot_get_latest_split (lot);
-         Transaction *ftrans = xaccSplitGetParent (fsplit);
-         time_t close_date = xaccTransGetDate (ftrans);
-   
-         qof_print_date_buff (cbuff, MAX_DATE_LENGTH, close_date);
-	 gtk_list_store_set(store, &iter, LOT_COL_CLOSE, cbuff, -1);
-      }
-      else
-      {
-	gtk_list_store_set(store, &iter, LOT_COL_CLOSE, _("Open"), -1);
-      }
+        /* Closing date */
+        if (gnc_lot_is_closed (lot))
+        {
+            Split *fsplit = gnc_lot_get_latest_split (lot);
+            Transaction *ftrans = xaccSplitGetParent (fsplit);
+            time_t close_date = xaccTransGetDate (ftrans);
 
-      /* Title */
-      gtk_list_store_set(store, &iter, LOT_COL_TITLE, gnc_lot_get_title(lot), -1);
-      
-      /* Amount */
-      xaccSPrintAmount (baln_buff, amt_baln, 
-                 gnc_account_print_info (lv->account, TRUE));
-      gtk_list_store_set(store, &iter, LOT_COL_BALN, baln_buff, -1);
+            qof_print_date_buff (cbuff, MAX_DATE_LENGTH, close_date);
+            gtk_list_store_set(store, &iter, LOT_COL_CLOSE, cbuff, -1);
+        }
+        else
+        {
+            gtk_list_store_set(store, &iter, LOT_COL_CLOSE, _("Open"), -1);
+        }
 
-      /* Capital Gains/Losses Appreciation/Depreciation */
-      xaccSPrintAmount (gain_buff, gains_baln, 
-                 gnc_commodity_print_info (currency, TRUE));
-      gtk_list_store_set(store, &iter, LOT_COL_GAINS, gain_buff, -1);
+        /* Title */
+        gtk_list_store_set(store, &iter, LOT_COL_TITLE, gnc_lot_get_title(lot), -1);
 
-      /* Self-reference */
-      gtk_list_store_set(store, &iter, LOT_COL_PNTR, lot, -1);
-   }
-   g_list_free(lot_list);
+        /* Amount */
+        xaccSPrintAmount (baln_buff, amt_baln,
+                          gnc_account_print_info (lv->account, TRUE));
+        gtk_list_store_set(store, &iter, LOT_COL_BALN, baln_buff, -1);
 
-   /* re-select the row that the user had previously selected, 
-    * if possible. */
-   if (selected_lot) {
-     model = GTK_TREE_MODEL(lv->lot_store);
-     if (gtk_tree_model_get_iter_first(model, &iter)) {
-       do {
-	 gtk_tree_model_get(model, &iter, LOT_COL_PNTR, &this_lot, -1);
-	 if (this_lot == selected_lot) {
-	   gtk_tree_selection_select_iter(selection, &iter);
-	   found = TRUE;
-	   break;
-	 }
-       } while (gtk_tree_model_iter_next(model, &iter));
-     }
-   }
+        /* Capital Gains/Losses Appreciation/Depreciation */
+        xaccSPrintAmount (gain_buff, gains_baln,
+                          gnc_commodity_print_info (currency, TRUE));
+        gtk_list_store_set(store, &iter, LOT_COL_GAINS, gain_buff, -1);
 
-   if (!found)
-     gtk_tree_selection_unselect_all(selection);
+        /* Self-reference */
+        gtk_list_store_set(store, &iter, LOT_COL_PNTR, lot, -1);
+    }
+    g_list_free(lot_list);
+
+    /* re-select the row that the user had previously selected,
+     * if possible. */
+    if (selected_lot)
+    {
+        model = GTK_TREE_MODEL(lv->lot_store);
+        if (gtk_tree_model_get_iter_first(model, &iter))
+        {
+            do
+            {
+                gtk_tree_model_get(model, &iter, LOT_COL_PNTR, &this_lot, -1);
+                if (this_lot == selected_lot)
+                {
+                    gtk_tree_selection_select_iter(selection, &iter);
+                    found = TRUE;
+                    break;
+                }
+            }
+            while (gtk_tree_model_iter_next(model, &iter));
+        }
+    }
+
+    if (!found)
+        gtk_tree_selection_unselect_all(selection);
 }
 
 /* ======================================================================== */
@@ -491,54 +501,57 @@
 static void
 lv_refresh_handler (GHashTable *changes, gpointer user_data)
 {
-   GNCLotViewer *lv = user_data;
-   gnc_lot_viewer_fill (lv);
-   lv_show_splits (lv);
+    GNCLotViewer *lv = user_data;
+    gnc_lot_viewer_fill (lv);
+    lv_show_splits (lv);
 }
 
 static void
 lv_close_handler (gpointer user_data)
 {
-   GNCLotViewer *lv = user_data;
-   GNCLot *lot = lv->selected_lot;
+    GNCLotViewer *lv = user_data;
+    GNCLot *lot = lv->selected_lot;
 
-   lv_save_current_row (lv);
+    lv_save_current_row (lv);
 
-   gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(lv->window));
-   gtk_widget_destroy (lv->window);
+    gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(lv->window));
+    gtk_widget_destroy (lv->window);
 }
 
 void
 lv_window_destroy_cb (GtkObject *object, gpointer user_data)
 {
-   GNCLotViewer *lv = user_data;
-   gnc_close_gui_component_by_data (LOT_VIEWER_CM_CLASS, lv);
-   gnc_unregister_gui_component_by_data (LOT_VIEWER_CM_CLASS, lv);
-   g_free (lv);
+    GNCLotViewer *lv = user_data;
+    gnc_close_gui_component_by_data (LOT_VIEWER_CM_CLASS, lv);
+    gnc_unregister_gui_component_by_data (LOT_VIEWER_CM_CLASS, lv);
+    g_free (lv);
 }
-                                                                                
 
+
 /* ======================================================================== */
 /* Divider moved */
 
 void
 lv_paned_notify_cb (GObject *gobject,
-		     GParamSpec *pspec,
-		     gpointer user_data)
+                    GParamSpec *pspec,
+                    gpointer user_data)
 {
-   const gchar *param_name;
-   gint value;
+    const gchar *param_name;
+    gint value;
 
-   param_name = g_param_spec_get_name(pspec);
-   if (strcmp(param_name, "position") != 0)
-     return;
-   g_object_get(gobject, "position", &value, NULL);
+    param_name = g_param_spec_get_name(pspec);
+    if (strcmp(param_name, "position") != 0)
+        return;
+    g_object_get(gobject, "position", &value, NULL);
 
-   if (GTK_IS_HPANED(gobject)) {
-     gnc_gconf_set_int(GCONF_SECTION, GCONF_KEY_HPOSITION, value, NULL);
-   } else {
-     gnc_gconf_set_int(GCONF_SECTION, GCONF_KEY_VPOSITION, value, NULL);
-   }
+    if (GTK_IS_HPANED(gobject))
+    {
+        gnc_gconf_set_int(GCONF_SECTION, GCONF_KEY_HPOSITION, value, NULL);
+    }
+    else
+    {
+        gnc_gconf_set_int(GCONF_SECTION, GCONF_KEY_VPOSITION, value, NULL);
+    }
 }
 
 /* ======================================================================== */
@@ -547,51 +560,52 @@
 void
 lv_response_cb (GtkDialog *dialog, gint response, gpointer data)
 {
-   GNCLotViewer *lv = data;
-   GNCLot *lot = lv->selected_lot;
+    GNCLotViewer *lv = data;
+    GNCLot *lot = lv->selected_lot;
 
-   switch (response) {
-   case GTK_RESPONSE_CLOSE:
-     lv_close_handler(lv);
-     return;
+    switch (response)
+    {
+    case GTK_RESPONSE_CLOSE:
+        lv_close_handler(lv);
+        return;
 
-   case RESPONSE_VIEW:
-     if (NULL == lot)
-       return; 
-     printf ("duude UNIMPLEMENTED: need to disply register showing only this one lot \n");
-     break;
+    case RESPONSE_VIEW:
+        if (NULL == lot)
+            return;
+        printf ("duude UNIMPLEMENTED: need to disply register showing only this one lot \n");
+        break;
 
-   case RESPONSE_DELETE:
-     if (NULL == lot)
-       return; 
-     xaccAccountRemoveLot (gnc_lot_get_account(lot), lot);
-     gnc_lot_destroy (lot);
-     lv_unset_lot (lv);
-     gnc_lot_viewer_fill (lv);
-     break;
+    case RESPONSE_DELETE:
+        if (NULL == lot)
+            return;
+        xaccAccountRemoveLot (gnc_lot_get_account(lot), lot);
+        gnc_lot_destroy (lot);
+        lv_unset_lot (lv);
+        gnc_lot_viewer_fill (lv);
+        break;
 
-   case RESPONSE_SCRUB_LOT:
-     if (NULL == lot)
-       return; 
-     xaccScrubLot (lot);
-     gnc_lot_viewer_fill (lv);
-     lv_show_splits (lv);
-     break;
+    case RESPONSE_SCRUB_LOT:
+        if (NULL == lot)
+            return;
+        xaccScrubLot (lot);
+        gnc_lot_viewer_fill (lv);
+        lv_show_splits (lv);
+        break;
 
-   case RESPONSE_SCRUB_ACCOUNT:
-     gnc_suspend_gui_refresh ();
-     xaccAccountScrubLots (lv->account);
-     gnc_resume_gui_refresh ();
-     gnc_lot_viewer_fill (lv);
-     lv_show_splits (lv);
-     break;
+    case RESPONSE_SCRUB_ACCOUNT:
+        gnc_suspend_gui_refresh ();
+        xaccAccountScrubLots (lv->account);
+        gnc_resume_gui_refresh ();
+        gnc_lot_viewer_fill (lv);
+        lv_show_splits (lv);
+        break;
 
-   case RESPONSE_NEW_LOT:
-     lv_save_current_row (lv);
-     lot = gnc_lot_make_default (lv->account);
-     xaccAccountInsertLot (lv->account, lot);
-     break;
-   }
+    case RESPONSE_NEW_LOT:
+        lv_save_current_row (lv);
+        lot = gnc_lot_make_default (lv->account);
+        xaccAccountInsertLot (lv->account, lot);
+        break;
+    }
 }
 
 /* ======================================================================== */
@@ -599,52 +613,52 @@
 static void
 lv_init_lot_view (GNCLotViewer *lv)
 {
-  GtkTreeView *view;
-  GtkListStore *store;
-  GtkTreeViewColumn *column;
-  GtkTreeSelection *selection;
-  GtkCellRenderer *renderer;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkTreeViewColumn *column;
+    GtkTreeSelection *selection;
+    GtkCellRenderer *renderer;
 
-  g_return_if_fail(GTK_IS_TREE_VIEW(lv->lot_view));
+    g_return_if_fail(GTK_IS_TREE_VIEW(lv->lot_view));
 
-  view = lv->lot_view;
-  store = gtk_list_store_new(NUM_LOT_COLS, 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);
-  lv->lot_store = store;
+    view = lv->lot_view;
+    store = gtk_list_store_new(NUM_LOT_COLS, 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);
+    lv->lot_store = store;
 
-  /* Set up the columns */
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Opened"), renderer,
-						    "text", LOT_COL_OPEN, NULL);
-  gtk_tree_view_append_column(view, column);
+    /* Set up the columns */
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Opened"), renderer,
+             "text", LOT_COL_OPEN, NULL);
+    gtk_tree_view_append_column(view, column);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Closed"), renderer,
-						    "text", LOT_COL_CLOSE, NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Closed"), renderer,
+             "text", LOT_COL_CLOSE, NULL);
+    gtk_tree_view_append_column(view, column);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Title"), renderer,
-						    "text", LOT_COL_TITLE, NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Title"), renderer,
+             "text", LOT_COL_TITLE, NULL);
+    gtk_tree_view_append_column(view, column);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Balance"), renderer,
-						    "text", LOT_COL_BALN, NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Balance"), renderer,
+             "text", LOT_COL_BALN, NULL);
+    gtk_tree_view_append_column(view, column);
 
-  renderer = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(_("Gains"), renderer,
-						    "text", LOT_COL_GAINS, NULL);
-  gtk_tree_view_append_column(view, column);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Gains"), renderer,
+             "text", LOT_COL_GAINS, NULL);
+    gtk_tree_view_append_column(view, column);
 
-  /* Set up the selection callbacks */
-  selection =  gtk_tree_view_get_selection(view);
-  g_signal_connect(selection, "changed",
-		   G_CALLBACK(lv_selection_changed_cb), lv);
+    /* Set up the selection callbacks */
+    selection =  gtk_tree_view_get_selection(view);
+    g_signal_connect(selection, "changed",
+                     G_CALLBACK(lv_selection_changed_cb), lv);
 }
 
 /* ======================================================================== */
@@ -652,79 +666,79 @@
 static void
 lv_create (GNCLotViewer *lv)
 {
-   GladeXML *xml;
-   char win_title[251];
-   gint position;
+    GladeXML *xml;
+    char win_title[251];
+    gint position;
 
-   xml = gnc_glade_xml_new ("lots.glade", "Lot Viewer Window");
-   lv->window = glade_xml_get_widget (xml, "Lot Viewer Window");
+    xml = gnc_glade_xml_new ("lots.glade", "Lot Viewer Window");
+    lv->window = glade_xml_get_widget (xml, "Lot Viewer Window");
 
-   snprintf (win_title, 250, _("Lots in Account %s"),
-                  xaccAccountGetName(lv->account));
-   gtk_window_set_title (GTK_WINDOW (lv->window), win_title);
+    snprintf (win_title, 250, _("Lots in Account %s"),
+              xaccAccountGetName(lv->account));
+    gtk_window_set_title (GTK_WINDOW (lv->window), win_title);
 
 #ifdef LOTS_READY_FOR_SHOWTIME
-   lv->regview_button = GTK_BUTTON(glade_xml_get_widget (xml, "regview button"));
+    lv->regview_button = GTK_BUTTON(glade_xml_get_widget (xml, "regview button"));
 #endif
-   lv->delete_button = GTK_BUTTON(glade_xml_get_widget (xml, "delete button"));
-   lv->scrub_lot_button = GTK_BUTTON(glade_xml_get_widget (xml, "scrub lot button"));
-   lv->new_lot_button = GTK_BUTTON(glade_xml_get_widget (xml, "new lot button"));
+    lv->delete_button = GTK_BUTTON(glade_xml_get_widget (xml, "delete button"));
+    lv->scrub_lot_button = GTK_BUTTON(glade_xml_get_widget (xml, "scrub lot button"));
+    lv->new_lot_button = GTK_BUTTON(glade_xml_get_widget (xml, "new lot button"));
 
-   lv->lot_view = GTK_TREE_VIEW(glade_xml_get_widget (xml, "lot view"));
-   lv_init_lot_view(lv);
-   lv->lot_notes = GTK_TEXT_VIEW(glade_xml_get_widget (xml, "lot notes text"));
-   lv->title_entry = GTK_ENTRY (glade_xml_get_widget (xml, "lot title entry"));
+    lv->lot_view = GTK_TREE_VIEW(glade_xml_get_widget (xml, "lot view"));
+    lv_init_lot_view(lv);
+    lv->lot_notes = GTK_TEXT_VIEW(glade_xml_get_widget (xml, "lot notes text"));
+    lv->title_entry = GTK_ENTRY (glade_xml_get_widget (xml, "lot title entry"));
 
-   lv->lot_vpaned = GTK_PANED (glade_xml_get_widget (xml, "lot vpaned"));
-   position = gnc_gconf_get_int(GCONF_SECTION, GCONF_KEY_VPOSITION, NULL);
-   if (position)
-     gtk_paned_set_position (lv->lot_vpaned, position);
+    lv->lot_vpaned = GTK_PANED (glade_xml_get_widget (xml, "lot vpaned"));
+    position = gnc_gconf_get_int(GCONF_SECTION, GCONF_KEY_VPOSITION, NULL);
+    if (position)
+        gtk_paned_set_position (lv->lot_vpaned, position);
 
-   lv->lot_hpaned = GTK_PANED (glade_xml_get_widget (xml, "lot hpaned"));
-   position = gnc_gconf_get_int(GCONF_SECTION, GCONF_KEY_HPOSITION, NULL);
-   if (position)
-     gtk_paned_set_position (lv->lot_hpaned, position);
+    lv->lot_hpaned = GTK_PANED (glade_xml_get_widget (xml, "lot hpaned"));
+    position = gnc_gconf_get_int(GCONF_SECTION, GCONF_KEY_HPOSITION, NULL);
+    if (position)
+        gtk_paned_set_position (lv->lot_hpaned, position);
 
-   lv->mini_clist = GTK_CLIST(glade_xml_get_widget (xml, "mini clist"));
+    lv->mini_clist = GTK_CLIST(glade_xml_get_widget (xml, "mini clist"));
 
-   lv->selected_lot = NULL;
-    
-   /* Setup signals */
-   glade_xml_signal_autoconnect_full( xml,
-                                     gnc_glade_autoconnect_full_func,
-                                     lv);
+    lv->selected_lot = NULL;
 
-   gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(lv->window));
+    /* Setup signals */
+    glade_xml_signal_autoconnect_full( xml,
+                                       gnc_glade_autoconnect_full_func,
+                                       lv);
+
+    gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(lv->window));
 }
 
 /* ======================================================================== */
 
-GNCLotViewer * 
+GNCLotViewer *
 gnc_lot_viewer_dialog (Account *account)
 {
-   GNCLotViewer *lv;
-   gint component_id;
+    GNCLotViewer *lv;
+    gint component_id;
 
-   if (!account) return NULL;
+    if (!account) return NULL;
 
-   lv = g_new0 (GNCLotViewer, 1);
-   lv->account = account;
-   lv_create (lv);
-   gnc_lot_viewer_fill (lv);
+    lv = g_new0 (GNCLotViewer, 1);
+    lv->account = account;
+    lv_create (lv);
+    gnc_lot_viewer_fill (lv);
 
-   component_id = gnc_register_gui_component (LOT_VIEWER_CM_CLASS,
-                                              lv_refresh_handler,
-                                              lv_close_handler,
-                                              lv);
+    component_id = gnc_register_gui_component (LOT_VIEWER_CM_CLASS,
+                   lv_refresh_handler,
+                   lv_close_handler,
+                   lv);
 
-   gnc_gui_component_watch_entity_type (component_id,
-               GNC_ID_LOT,
-               QOF_EVENT_CREATE | QOF_EVENT_ADD | QOF_EVENT_REMOVE | QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
+    gnc_gui_component_watch_entity_type (component_id,
+                                         GNC_ID_LOT,
+                                         QOF_EVENT_CREATE | QOF_EVENT_ADD | QOF_EVENT_REMOVE | QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
 
-   gtk_widget_show_all (lv->window);
-   gnc_window_adjust_for_screen (GTK_WINDOW(lv->window));
+    gtk_widget_show_all (lv->window);
+    gnc_window_adjust_for_screen (GTK_WINDOW(lv->window));
 
-   return lv;
+    return lv;
 }
 
 /* ============================ END OF FILE =============================== */

Modified: gnucash/trunk/src/gnome/reconcile-list.c
===================================================================
--- gnucash/trunk/src/gnome/reconcile-list.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/reconcile-list.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -40,9 +40,9 @@
 /* Signal codes */
 enum
 {
-  TOGGLE_RECONCILED,
-  DOUBLE_CLICK_SPLIT,
-  LAST_SIGNAL
+    TOGGLE_RECONCILED,
+    DOUBLE_CLICK_SPLIT,
+    LAST_SIGNAL
 };
 
 
@@ -57,37 +57,38 @@
 static void gnc_reconcile_list_finalize (GObject *object);
 static gpointer gnc_reconcile_list_is_reconciled(gpointer item, gpointer user_data);
 static void gnc_reconcile_list_line_toggled (GNCQueryList *list, gpointer item,
-					     gpointer user_data);
+        gpointer user_data);
 static void gnc_reconcile_list_double_click_entry (GNCQueryList *list,
-						   gpointer item,
-						   gpointer user_data);
+        gpointer item,
+        gpointer user_data);
 
 
 GType
 gnc_reconcile_list_get_type (void)
 {
-  static GType gnc_reconcile_list_type = 0;
+    static GType gnc_reconcile_list_type = 0;
 
-  if (gnc_reconcile_list_type == 0)
-  {
-    static const GTypeInfo gnc_reconcile_list_info = {
-      sizeof (GNCReconcileListClass),
-      NULL,
-      NULL,
-      (GClassInitFunc) gnc_reconcile_list_class_init,
-      NULL,
-      NULL,
-      sizeof (GNCReconcileList),
-      0,
-      (GInstanceInitFunc) gnc_reconcile_list_init
-    };
+    if (gnc_reconcile_list_type == 0)
+    {
+        static const GTypeInfo gnc_reconcile_list_info =
+        {
+            sizeof (GNCReconcileListClass),
+            NULL,
+            NULL,
+            (GClassInitFunc) gnc_reconcile_list_class_init,
+            NULL,
+            NULL,
+            sizeof (GNCReconcileList),
+            0,
+            (GInstanceInitFunc) gnc_reconcile_list_init
+        };
 
-    gnc_reconcile_list_type = g_type_register_static (GNC_TYPE_QUERY_LIST,
-						      "GncReconcileList",
-						      &gnc_reconcile_list_info, 0);
-  }
+        gnc_reconcile_list_type = g_type_register_static (GNC_TYPE_QUERY_LIST,
+                                  "GncReconcileList",
+                                  &gnc_reconcile_list_info, 0);
+    }
 
-  return gnc_reconcile_list_type;
+    return gnc_reconcile_list_type;
 }
 
 
@@ -102,323 +103,327 @@
 static void
 gnc_reconcile_list_construct(GNCReconcileList *list, Query *query)
 {
-  GNCQueryList *qlist = GNC_QUERY_LIST (list);
-  gboolean inv_sort = FALSE;
+    GNCQueryList *qlist = GNC_QUERY_LIST (list);
+    gboolean inv_sort = FALSE;
 
-  if (list->list_type == RECLIST_CREDIT)
-    inv_sort = TRUE;
+    if (list->list_type == RECLIST_CREDIT)
+        inv_sort = TRUE;
 
-  gnc_query_list_construct (qlist, list->column_list, query);
-  gnc_query_list_set_numerics (qlist, TRUE, inv_sort);
+    gnc_query_list_construct (qlist, list->column_list, query);
+    gnc_query_list_set_numerics (qlist, TRUE, inv_sort);
 
-  /* Now set up the signals for the QueryList */
-  g_signal_connect (G_OBJECT (qlist), "line_toggled",
-		    G_CALLBACK(gnc_reconcile_list_line_toggled), list);
-  g_signal_connect (G_OBJECT (qlist), "double_click_entry",
-		    G_CALLBACK(gnc_reconcile_list_double_click_entry), list);
+    /* Now set up the signals for the QueryList */
+    g_signal_connect (G_OBJECT (qlist), "line_toggled",
+                      G_CALLBACK(gnc_reconcile_list_line_toggled), list);
+    g_signal_connect (G_OBJECT (qlist), "double_click_entry",
+                      G_CALLBACK(gnc_reconcile_list_double_click_entry), list);
 }
 
 GtkWidget *
 gnc_reconcile_list_new(Account *account, GNCReconcileListType type,
                        time_t statement_date)
 {
-  GNCReconcileList *list;
-  gboolean include_children, auto_check;
-  GList *accounts = NULL;
-  GList *splits;
-  Query *query;
+    GNCReconcileList *list;
+    gboolean include_children, auto_check;
+    GList *accounts = NULL;
+    GList *splits;
+    Query *query;
 
-  g_return_val_if_fail(account, NULL);
-  g_return_val_if_fail((type == RECLIST_DEBIT) ||
-                       (type == RECLIST_CREDIT), NULL);
+    g_return_val_if_fail(account, NULL);
+    g_return_val_if_fail((type == RECLIST_DEBIT) ||
+                         (type == RECLIST_CREDIT), NULL);
 
-  list = g_object_new (GNC_TYPE_RECONCILE_LIST,
-		       "n-columns", 5,
-		       NULL);
+    list = g_object_new (GNC_TYPE_RECONCILE_LIST,
+                         "n-columns", 5,
+                         NULL);
 
-  list->account = account;
-  list->list_type = type;
-  list->statement_date = statement_date;
+    list->account = account;
+    list->list_type = type;
+    list->statement_date = statement_date;
 
-  query = xaccMallocQuery();
-  xaccQuerySetBook(query, gnc_get_current_book ());
+    query = xaccMallocQuery();
+    xaccQuerySetBook(query, gnc_get_current_book ());
 
-  include_children = xaccAccountGetReconcileChildrenStatus(account);
-  if (include_children)
-    accounts = gnc_account_get_descendants(account);
+    include_children = xaccAccountGetReconcileChildrenStatus(account);
+    if (include_children)
+        accounts = gnc_account_get_descendants(account);
 
-  /* match the account */
-  accounts = g_list_prepend (accounts, account);
+    /* match the account */
+    accounts = g_list_prepend (accounts, account);
 
-  xaccQueryAddAccountMatch (query, accounts, GUID_MATCH_ANY, QUERY_AND);
+    xaccQueryAddAccountMatch (query, accounts, GUID_MATCH_ANY, QUERY_AND);
 
-  g_list_free (accounts);
+    g_list_free (accounts);
 
-  /* limit the matches to CREDITs and DEBITs only, depending on the type */
-  if (type == RECLIST_CREDIT)
-    xaccQueryAddValueMatch(query, gnc_numeric_zero (),
-			   NUMERIC_MATCH_CREDIT,
-			   COMPARE_GTE, QUERY_AND);
-  else
-    xaccQueryAddValueMatch(query, gnc_numeric_zero (),
-			   NUMERIC_MATCH_DEBIT,
-			   COMPARE_GTE, QUERY_AND);
+    /* limit the matches to CREDITs and DEBITs only, depending on the type */
+    if (type == RECLIST_CREDIT)
+        xaccQueryAddValueMatch(query, gnc_numeric_zero (),
+                               NUMERIC_MATCH_CREDIT,
+                               COMPARE_GTE, QUERY_AND);
+    else
+        xaccQueryAddValueMatch(query, gnc_numeric_zero (),
+                               NUMERIC_MATCH_DEBIT,
+                               COMPARE_GTE, QUERY_AND);
 
-  /* limit the matches only to Cleared and Non-reconciled splits */
-  xaccQueryAddClearedMatch(query, CLEARED_NO | CLEARED_CLEARED, QUERY_AND);
+    /* limit the matches only to Cleared and Non-reconciled splits */
+    xaccQueryAddClearedMatch(query, CLEARED_NO | CLEARED_CLEARED, QUERY_AND);
 
-  /* initialize the QueryList */
-  gnc_reconcile_list_construct (list, query);
+    /* initialize the QueryList */
+    gnc_reconcile_list_construct (list, query);
 
-  /* find the list of splits to auto-reconcile */
-  auto_check = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
-				  "check_cleared", NULL);
+    /* find the list of splits to auto-reconcile */
+    auto_check = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
+                                    "check_cleared", NULL);
 
-  if (auto_check) {
-    for (splits = xaccQueryGetSplits(query); splits; splits = splits->next) {
-      Split *split = splits->data;
-      char recn = xaccSplitGetReconcile(split);
-      time_t trans_date = xaccTransGetDate(xaccSplitGetParent(split));
-    
-      /* Just an extra verification that our query is correct ;) */
-      g_assert (recn == NREC || recn == CREC);
+    if (auto_check)
+    {
+        for (splits = xaccQueryGetSplits(query); splits; splits = splits->next)
+        {
+            Split *split = splits->data;
+            char recn = xaccSplitGetReconcile(split);
+            time_t trans_date = xaccTransGetDate(xaccSplitGetParent(split));
 
-      if (recn == CREC &&
-          difftime(trans_date, statement_date) <= 0)
-	g_hash_table_insert (list->reconciled, split, split);
+            /* Just an extra verification that our query is correct ;) */
+            g_assert (recn == NREC || recn == CREC);
+
+            if (recn == CREC &&
+                    difftime(trans_date, statement_date) <= 0)
+                g_hash_table_insert (list->reconciled, split, split);
+        }
     }
-  }
 
-  /* Free the query -- we don't need it anymore */
-  xaccFreeQuery(query);
+    /* Free the query -- we don't need it anymore */
+    xaccFreeQuery(query);
 
-  return GTK_WIDGET(list);
+    return GTK_WIDGET(list);
 }
 
 static void
 gnc_reconcile_list_init (GNCReconcileList *list)
 {
-  GNCSearchParam *param;
-  GList *columns = NULL;
+    GNCSearchParam *param;
+    GList *columns = NULL;
 
-  list->reconciled = g_hash_table_new (NULL, NULL);
-  list->account = NULL;
-  list->sibling = NULL;
+    list->reconciled = g_hash_table_new (NULL, NULL);
+    list->account = NULL;
+    list->sibling = NULL;
 
-  param = gnc_search_param_new();
-  gnc_search_param_set_param_fcn (param, QUERYCORE_BOOLEAN,
-				  gnc_reconcile_list_is_reconciled, list);
-  gnc_search_param_set_title (param, _("Reconciled:R")+11);
-  gnc_search_param_set_justify (param, GTK_JUSTIFY_CENTER);
-  gnc_search_param_set_passive (param, TRUE);
-  gnc_search_param_set_non_resizeable (param, TRUE);
-  columns = g_list_prepend (columns, param);
-  columns = gnc_search_param_prepend_with_justify (columns, _("Amount"),
-						   GTK_JUSTIFY_RIGHT,
-						   NULL, GNC_ID_SPLIT,
-						   SPLIT_AMOUNT, NULL);
-  columns = gnc_search_param_prepend (columns, _("Description"), NULL,
-				      GNC_ID_SPLIT, SPLIT_TRANS,
-				      TRANS_DESCRIPTION, NULL);
-  columns = gnc_search_param_prepend_with_justify (columns, _("Num"),
-						   GTK_JUSTIFY_CENTER,
-						   NULL, GNC_ID_SPLIT,
-						   SPLIT_TRANS, TRANS_NUM, NULL);
-  columns = gnc_search_param_prepend (columns, _("Date"), NULL, GNC_ID_SPLIT,
-				      SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
+    param = gnc_search_param_new();
+    gnc_search_param_set_param_fcn (param, QUERYCORE_BOOLEAN,
+                                    gnc_reconcile_list_is_reconciled, list);
+    gnc_search_param_set_title (param, _("Reconciled:R") + 11);
+    gnc_search_param_set_justify (param, GTK_JUSTIFY_CENTER);
+    gnc_search_param_set_passive (param, TRUE);
+    gnc_search_param_set_non_resizeable (param, TRUE);
+    columns = g_list_prepend (columns, param);
+    columns = gnc_search_param_prepend_with_justify (columns, _("Amount"),
+              GTK_JUSTIFY_RIGHT,
+              NULL, GNC_ID_SPLIT,
+              SPLIT_AMOUNT, NULL);
+    columns = gnc_search_param_prepend (columns, _("Description"), NULL,
+                                        GNC_ID_SPLIT, SPLIT_TRANS,
+                                        TRANS_DESCRIPTION, NULL);
+    columns = gnc_search_param_prepend_with_justify (columns, _("Num"),
+              GTK_JUSTIFY_CENTER,
+              NULL, GNC_ID_SPLIT,
+              SPLIT_TRANS, TRANS_NUM, NULL);
+    columns = gnc_search_param_prepend (columns, _("Date"), NULL, GNC_ID_SPLIT,
+                                        SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
 
-  list->column_list = columns;
+    list->column_list = columns;
 }
 
 
 static void
 gnc_reconcile_list_class_init (GNCReconcileListClass *klass)
 {
-  GObjectClass    *object_class;
-  GtkCListClass   *clist_class;
+    GObjectClass    *object_class;
+    GtkCListClass   *clist_class;
 
-  object_class =  G_OBJECT_CLASS (klass);
-  clist_class = GTK_CLIST_CLASS (klass);
+    object_class =  G_OBJECT_CLASS (klass);
+    clist_class = GTK_CLIST_CLASS (klass);
 
-  parent_class = g_type_class_peek_parent (klass);
+    parent_class = g_type_class_peek_parent (klass);
 
-  reconcile_list_signals[TOGGLE_RECONCILED] =
-    g_signal_new("toggle_reconciled",
-		 G_OBJECT_CLASS_TYPE (object_class),
-		 G_SIGNAL_RUN_FIRST,
-		 G_STRUCT_OFFSET (GNCReconcileListClass,
-				  toggle_reconciled),
-		 NULL, NULL,
-		 g_cclosure_marshal_VOID__POINTER,
-		 G_TYPE_NONE, 1,
-		 G_TYPE_POINTER);
+    reconcile_list_signals[TOGGLE_RECONCILED] =
+        g_signal_new("toggle_reconciled",
+                     G_OBJECT_CLASS_TYPE (object_class),
+                     G_SIGNAL_RUN_FIRST,
+                     G_STRUCT_OFFSET (GNCReconcileListClass,
+                                      toggle_reconciled),
+                     NULL, NULL,
+                     g_cclosure_marshal_VOID__POINTER,
+                     G_TYPE_NONE, 1,
+                     G_TYPE_POINTER);
 
-  reconcile_list_signals[DOUBLE_CLICK_SPLIT] =
-    g_signal_new("double_click_split",
-		 G_OBJECT_CLASS_TYPE (object_class),
-		 G_SIGNAL_RUN_FIRST,
-		 G_STRUCT_OFFSET (GNCReconcileListClass,
-				  double_click_split),
-		 NULL, NULL,
-		 g_cclosure_marshal_VOID__POINTER,
-		 G_TYPE_NONE, 1,
-		 G_TYPE_POINTER);
+    reconcile_list_signals[DOUBLE_CLICK_SPLIT] =
+        g_signal_new("double_click_split",
+                     G_OBJECT_CLASS_TYPE (object_class),
+                     G_SIGNAL_RUN_FIRST,
+                     G_STRUCT_OFFSET (GNCReconcileListClass,
+                                      double_click_split),
+                     NULL, NULL,
+                     g_cclosure_marshal_VOID__POINTER,
+                     G_TYPE_NONE, 1,
+                     G_TYPE_POINTER);
 
-  object_class->finalize = gnc_reconcile_list_finalize;
+    object_class->finalize = gnc_reconcile_list_finalize;
 
-  klass->toggle_reconciled = NULL;
-  klass->double_click_split = NULL;
+    klass->toggle_reconciled = NULL;
+    klass->double_click_split = NULL;
 }
 
 static void
 gnc_reconcile_list_toggle_split(GNCReconcileList *list, Split *split)
 {
-  Split *current;
+    Split *current;
 
-  g_return_if_fail (GNC_IS_RECONCILE_LIST(list));
-  g_return_if_fail (list->reconciled != NULL);
+    g_return_if_fail (GNC_IS_RECONCILE_LIST(list));
+    g_return_if_fail (list->reconciled != NULL);
 
-  current = g_hash_table_lookup (list->reconciled, split);
+    current = g_hash_table_lookup (list->reconciled, split);
 
-  if (current == NULL)
-    g_hash_table_insert (list->reconciled, split, split);
-  else
-    g_hash_table_remove (list->reconciled, split);
+    if (current == NULL)
+        g_hash_table_insert (list->reconciled, split, split);
+    else
+        g_hash_table_remove (list->reconciled, split);
 
-  gnc_query_list_refresh_item (GNC_QUERY_LIST(list), split);
+    gnc_query_list_refresh_item (GNC_QUERY_LIST(list), split);
 }
 
 static void
 gnc_reconcile_list_toggle_children(Account *account, GNCReconcileList *list, Split *split)
 {
-  GList *child_accounts, *node;
-  Transaction *transaction;
+    GList *child_accounts, *node;
+    Transaction *transaction;
 
-  /*
-   * Need to get all splits in this transaction and identify any that are
-   * in the same heirarchy as the account being reconciled (not necessarily
-   * the account this split is from.)
-   *
-   * For each of these splits toggle them all to the same state.
-   */
-  child_accounts = gnc_account_get_descendants(account);
-  child_accounts = g_list_prepend(child_accounts, account);
-  transaction = xaccSplitGetParent(split);
-  for(node = xaccTransGetSplitList(transaction); node; node = node->next)
-  {
-    Split *other_split;
-    Account *other_account;
-    GNCReconcileList *current_list;
+    /*
+     * Need to get all splits in this transaction and identify any that are
+     * in the same heirarchy as the account being reconciled (not necessarily
+     * the account this split is from.)
+     *
+     * For each of these splits toggle them all to the same state.
+     */
+    child_accounts = gnc_account_get_descendants(account);
+    child_accounts = g_list_prepend(child_accounts, account);
+    transaction = xaccSplitGetParent(split);
+    for (node = xaccTransGetSplitList(transaction); node; node = node->next)
+    {
+        Split *other_split;
+        Account *other_account;
+        GNCReconcileList *current_list;
 
-    other_split = node->data;
-    other_account = xaccSplitGetAccount(other_split);
-    if(other_split == split)
-      continue;
-    /* Check this 'other' account in in the same heirarchy */
-    if(!g_list_find(child_accounts,other_account))
-      continue;
-    /* Search our sibling list for this split first.  We search the 
-     * sibling list first because that it where it is most likely to be.
-     */
-    current_list = list->sibling;
-    if (!gnc_query_list_item_in_list (GNC_QUERY_LIST(current_list), other_split)) {
-      /* Not in the sibling list, try this list */
-      current_list = list;
-      if (!gnc_query_list_item_in_list (GNC_QUERY_LIST(current_list), other_split))
-	/* We can't find it, nothing more I can do about it */
-	continue;
+        other_split = node->data;
+        other_account = xaccSplitGetAccount(other_split);
+        if (other_split == split)
+            continue;
+        /* Check this 'other' account in in the same heirarchy */
+        if (!g_list_find(child_accounts, other_account))
+            continue;
+        /* Search our sibling list for this split first.  We search the
+         * sibling list first because that it where it is most likely to be.
+         */
+        current_list = list->sibling;
+        if (!gnc_query_list_item_in_list (GNC_QUERY_LIST(current_list), other_split))
+        {
+            /* Not in the sibling list, try this list */
+            current_list = list;
+            if (!gnc_query_list_item_in_list (GNC_QUERY_LIST(current_list), other_split))
+                /* We can't find it, nothing more I can do about it */
+                continue;
+        }
+        gnc_reconcile_list_toggle_split(current_list, other_split);
     }
-    gnc_reconcile_list_toggle_split(current_list, other_split);
-  }
-  g_list_free(child_accounts);
+    g_list_free(child_accounts);
 }
 
 static void
 gnc_reconcile_list_toggle (GNCReconcileList *list, Split *split)
 {
-  gboolean include_children;
+    gboolean include_children;
 
-  g_return_if_fail (GNC_IS_RECONCILE_LIST(list));
-  g_return_if_fail (list->reconciled != NULL);
+    g_return_if_fail (GNC_IS_RECONCILE_LIST(list));
+    g_return_if_fail (list->reconciled != NULL);
 
-  gnc_reconcile_list_toggle_split(list, split);
+    gnc_reconcile_list_toggle_split(list, split);
 
-  include_children = xaccAccountGetReconcileChildrenStatus(list->account);
-  if(include_children)
-    gnc_reconcile_list_toggle_children(list->account, list, split);
+    include_children = xaccAccountGetReconcileChildrenStatus(list->account);
+    if (include_children)
+        gnc_reconcile_list_toggle_children(list->account, list, split);
 
-  g_signal_emit (G_OBJECT (list),
-                 reconcile_list_signals[TOGGLE_RECONCILED], 0, split);
+    g_signal_emit (G_OBJECT (list),
+                   reconcile_list_signals[TOGGLE_RECONCILED], 0, split);
 }
 
 static void
 gnc_reconcile_list_line_toggled (GNCQueryList *list, gpointer item,
-				 gpointer user_data)
+                                 gpointer user_data)
 {
-  GNCReconcileList *rlist = user_data;
+    GNCReconcileList *rlist = user_data;
 
-  g_return_if_fail(item);
-  g_return_if_fail(user_data);
-  g_return_if_fail(GNC_IS_RECONCILE_LIST(rlist));
+    g_return_if_fail(item);
+    g_return_if_fail(user_data);
+    g_return_if_fail(GNC_IS_RECONCILE_LIST(rlist));
 
-  gnc_reconcile_list_toggle (rlist, item);
+    gnc_reconcile_list_toggle (rlist, item);
 }
 
 static void gnc_reconcile_list_double_click_entry (GNCQueryList *list,
-						   gpointer item,
-						   gpointer user_data)
+        gpointer item,
+        gpointer user_data)
 {
-  GNCReconcileList *rlist = user_data;
+    GNCReconcileList *rlist = user_data;
 
-  g_return_if_fail(item);
-  g_return_if_fail(user_data);
-  g_return_if_fail(GNC_IS_RECONCILE_LIST(rlist));
+    g_return_if_fail(item);
+    g_return_if_fail(user_data);
+    g_return_if_fail(GNC_IS_RECONCILE_LIST(rlist));
 
-  g_signal_emit(G_OBJECT(rlist),
-		reconcile_list_signals[DOUBLE_CLICK_SPLIT], 0, item);
+    g_signal_emit(G_OBJECT(rlist),
+                  reconcile_list_signals[DOUBLE_CLICK_SPLIT], 0, item);
 }
 
 static void
 gnc_reconcile_list_finalize (GObject *object)
 {
-  GNCReconcileList *list = GNC_RECONCILE_LIST(object);
+    GNCReconcileList *list = GNC_RECONCILE_LIST(object);
 
-  if (list->reconciled != NULL) {
-    g_hash_table_destroy(list->reconciled);
-    list->reconciled = NULL;
-  }
+    if (list->reconciled != NULL)
+    {
+        g_hash_table_destroy(list->reconciled);
+        list->reconciled = NULL;
+    }
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 gint
 gnc_reconcile_list_get_needed_height (GNCReconcileList *list, gint num_rows)
 {
-  g_return_val_if_fail (list != NULL, 0);
-  g_return_val_if_fail (GNC_IS_RECONCILE_LIST(list), 0);
+    g_return_val_if_fail (list != NULL, 0);
+    g_return_val_if_fail (GNC_IS_RECONCILE_LIST(list), 0);
 
-  if (!GTK_WIDGET_REALIZED (list))
-    return 0;
+    if (!GTK_WIDGET_REALIZED (list))
+        return 0;
 
-  return gnc_query_list_get_needed_height (GNC_QUERY_LIST(list), num_rows);
+    return gnc_query_list_get_needed_height (GNC_QUERY_LIST(list), num_rows);
 }
 
 gint
 gnc_reconcile_list_get_num_splits (GNCReconcileList *list)
 {
-  g_return_val_if_fail (list != NULL, 0);
-  g_return_val_if_fail (GNC_IS_RECONCILE_LIST(list), 0);
+    g_return_val_if_fail (list != NULL, 0);
+    g_return_val_if_fail (GNC_IS_RECONCILE_LIST(list), 0);
 
-  return gnc_query_list_get_num_entries(GNC_QUERY_LIST(list));
+    return gnc_query_list_get_num_entries(GNC_QUERY_LIST(list));
 }
 
 Split *
 gnc_reconcile_list_get_current_split (GNCReconcileList *list)
 {
-  g_return_val_if_fail (list != NULL, NULL);
-  g_return_val_if_fail (GNC_IS_RECONCILE_LIST(list), NULL);
+    g_return_val_if_fail (list != NULL, NULL);
+    g_return_val_if_fail (GNC_IS_RECONCILE_LIST(list), NULL);
 
-  return gnc_query_list_get_current_entry(GNC_QUERY_LIST(list));
+    return gnc_query_list_get_current_entry(GNC_QUERY_LIST(list));
 }
 
 /********************************************************************\
@@ -432,28 +437,28 @@
 static gpointer
 gnc_reconcile_list_is_reconciled(gpointer item, gpointer user_data)
 {
-  GNCReconcileList *list = user_data;
-  Split *current;
+    GNCReconcileList *list = user_data;
+    Split *current;
 
-  g_return_val_if_fail(item, NULL);
-  g_return_val_if_fail(list, NULL);
-  g_return_val_if_fail(GNC_IS_RECONCILE_LIST(list), NULL);
+    g_return_val_if_fail(item, NULL);
+    g_return_val_if_fail(list, NULL);
+    g_return_val_if_fail(GNC_IS_RECONCILE_LIST(list), NULL);
 
-  if (!list->reconciled)
-    return NULL;
+    if (!list->reconciled)
+        return NULL;
 
-  current = g_hash_table_lookup(list->reconciled, item);
-  return GINT_TO_POINTER(current != NULL);
+    current = g_hash_table_lookup(list->reconciled, item);
+    return GINT_TO_POINTER(current != NULL);
 }
 
 static void
 grl_refresh_helper (gpointer key, gpointer value, gpointer user_data)
 {
-  GNCReconcileList *list = user_data;
-  GNCQueryList *qlist = GNC_QUERY_LIST(list);
+    GNCReconcileList *list = user_data;
+    GNCQueryList *qlist = GNC_QUERY_LIST(list);
 
-  if (!gnc_query_list_item_in_list(qlist, key))
-    g_hash_table_remove(list->reconciled, key);
+    if (!gnc_query_list_item_in_list(qlist, key))
+        g_hash_table_remove(list->reconciled, key);
 }
 
 /********************************************************************\
@@ -466,17 +471,17 @@
 void
 gnc_reconcile_list_refresh (GNCReconcileList *list)
 {
-  GNCQueryList *qlist;
+    GNCQueryList *qlist;
 
-  g_return_if_fail (list != NULL);
-  g_return_if_fail (GNC_IS_RECONCILE_LIST(list));
+    g_return_if_fail (list != NULL);
+    g_return_if_fail (GNC_IS_RECONCILE_LIST(list));
 
-  qlist = GNC_QUERY_LIST(list);
-  gnc_query_list_refresh(qlist);
+    qlist = GNC_QUERY_LIST(list);
+    gnc_query_list_refresh(qlist);
 
-  /* Now verify that everything in the reconcile hash is still in qlist */
-  if (list->reconciled)
-    g_hash_table_foreach(list->reconciled, grl_refresh_helper, list);
+    /* Now verify that everything in the reconcile hash is still in qlist */
+    if (list->reconciled)
+        g_hash_table_foreach(list->reconciled, grl_refresh_helper, list);
 }
 
 
@@ -490,26 +495,26 @@
 static void
 grl_balance_hash_helper (gpointer key, gpointer value, gpointer user_data)
 {
-  Split *split = key;
-  gnc_numeric *total = user_data;
+    Split *split = key;
+    gnc_numeric *total = user_data;
 
-  *total = gnc_numeric_add_fixed (*total, xaccSplitGetAmount (split));
+    *total = gnc_numeric_add_fixed (*total, xaccSplitGetAmount (split));
 }
 
 gnc_numeric
 gnc_reconcile_list_reconciled_balance (GNCReconcileList *list)
 {
-  gnc_numeric total = gnc_numeric_zero ();
+    gnc_numeric total = gnc_numeric_zero ();
 
-  g_return_val_if_fail (list != NULL, total);
-  g_return_val_if_fail (GNC_IS_RECONCILE_LIST(list), total);
+    g_return_val_if_fail (list != NULL, total);
+    g_return_val_if_fail (GNC_IS_RECONCILE_LIST(list), total);
 
-  if (list->reconciled == NULL)
-    return total;
+    if (list->reconciled == NULL)
+        return total;
 
-  g_hash_table_foreach (list->reconciled, grl_balance_hash_helper, &total);
+    g_hash_table_foreach (list->reconciled, grl_balance_hash_helper, &total);
 
-  return gnc_numeric_abs (total);
+    return gnc_numeric_abs (total);
 }
 
 
@@ -526,25 +531,25 @@
 static void
 grl_commit_hash_helper (gpointer key, gpointer value, gpointer user_data)
 {
-  Split *split = key;
-  time_t *date = user_data;
+    Split *split = key;
+    time_t *date = user_data;
 
-  xaccSplitSetReconcile (split, YREC);
-  xaccSplitSetDateReconciledSecs (split, *date);
+    xaccSplitSetReconcile (split, YREC);
+    xaccSplitSetDateReconciledSecs (split, *date);
 }
 
 void
 gnc_reconcile_list_commit (GNCReconcileList *list, time_t date)
 {
-  g_return_if_fail (list != NULL);
-  g_return_if_fail (GNC_IS_RECONCILE_LIST(list));
+    g_return_if_fail (list != NULL);
+    g_return_if_fail (GNC_IS_RECONCILE_LIST(list));
 
-  if (list->reconciled == NULL)
-    return;
+    if (list->reconciled == NULL)
+        return;
 
-  gnc_suspend_gui_refresh();
-  g_hash_table_foreach (list->reconciled, grl_commit_hash_helper, &date);
-  gnc_resume_gui_refresh();
+    gnc_suspend_gui_refresh();
+    g_hash_table_foreach (list->reconciled, grl_commit_hash_helper, &date);
+    gnc_resume_gui_refresh();
 }
 
 
@@ -559,37 +564,37 @@
 void
 gnc_reconcile_list_postpone (GNCReconcileList *list)
 {
-  GtkCList *clist = GTK_CLIST(list); /* This is cheating! */
-  Split *split;
-  int num_splits;
-  int i;
+    GtkCList *clist = GTK_CLIST(list); /* This is cheating! */
+    Split *split;
+    int num_splits;
+    int i;
 
-  g_return_if_fail(list != NULL);
-  g_return_if_fail(GNC_IS_RECONCILE_LIST(list));
+    g_return_if_fail(list != NULL);
+    g_return_if_fail(GNC_IS_RECONCILE_LIST(list));
 
-  if (list->reconciled == NULL)
-    return;
+    if (list->reconciled == NULL)
+        return;
 
-  num_splits = gnc_query_list_get_num_entries(GNC_QUERY_LIST(list));
-  gnc_suspend_gui_refresh();
-  for (i = 0; i < num_splits; i++)
-  {
-    char recn;
+    num_splits = gnc_query_list_get_num_entries(GNC_QUERY_LIST(list));
+    gnc_suspend_gui_refresh();
+    for (i = 0; i < num_splits; i++)
+    {
+        char recn;
 
-    split = gtk_clist_get_row_data (clist, i);
+        split = gtk_clist_get_row_data (clist, i);
 
-    // Don't change splits past reconciliation date that haven't been
-    // set to be reconciled
-    if ( difftime(list->statement_date,
-		  xaccTransGetDate(xaccSplitGetParent(split))) >= 0 ||
-	 g_hash_table_lookup(list->reconciled, split))
-    {
-      recn = g_hash_table_lookup (list->reconciled, split) ? CREC : NREC;
+        // Don't change splits past reconciliation date that haven't been
+        // set to be reconciled
+        if ( difftime(list->statement_date,
+                      xaccTransGetDate(xaccSplitGetParent(split))) >= 0 ||
+                g_hash_table_lookup(list->reconciled, split))
+        {
+            recn = g_hash_table_lookup (list->reconciled, split) ? CREC : NREC;
 
-      xaccSplitSetReconcile (split, recn);
+            xaccSplitSetReconcile (split, recn);
+        }
     }
-  }
-  gnc_resume_gui_refresh();
+    gnc_resume_gui_refresh();
 }
 
 
@@ -603,10 +608,10 @@
 void
 gnc_reconcile_list_unselect_all(GNCReconcileList *list)
 {
-  g_return_if_fail (list != NULL);
-  g_return_if_fail (GNC_IS_RECONCILE_LIST(list));
+    g_return_if_fail (list != NULL);
+    g_return_if_fail (GNC_IS_RECONCILE_LIST(list));
 
-  gnc_query_list_unselect_all (GNC_QUERY_LIST(list));
+    gnc_query_list_unselect_all (GNC_QUERY_LIST(list));
 }
 
 
@@ -620,82 +625,89 @@
 gboolean
 gnc_reconcile_list_changed (GNCReconcileList *list)
 {
-  g_return_val_if_fail (list != NULL, FALSE);
-  g_return_val_if_fail (GNC_IS_RECONCILE_LIST(list), FALSE);
+    g_return_val_if_fail (list != NULL, FALSE);
+    g_return_val_if_fail (GNC_IS_RECONCILE_LIST(list), FALSE);
 
-  return g_hash_table_size (list->reconciled) != 0;
+    return g_hash_table_size (list->reconciled) != 0;
 }
 
 #if 0
 static void
 gnc_reconcile_list_fill(GNCReconcileList *list)
 {
-  const gchar *strings[list->num_columns + 1];
-  GNCPrintAmountInfo print_info;
-  Transaction *trans;
-  gboolean auto_check;
-  GList *splits;
-  Split *split;
+    const gchar *strings[list->num_columns + 1];
+    GNCPrintAmountInfo print_info;
+    Transaction *trans;
+    gboolean auto_check;
+    GList *splits;
+    Split *split;
 
-  auto_check = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
-				  "check_cleared", NULL);
+    auto_check = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
+                                    "check_cleared", NULL);
 
-  strings[5] = NULL;
+    strings[5] = NULL;
 
-  print_info = gnc_account_print_info (list->account, FALSE);
+    print_info = gnc_account_print_info (list->account, FALSE);
 
-  for (splits = xaccQueryGetSplits (list->query); splits; splits=splits->next)
-  {
-    gnc_numeric amount;
-    Timespec ts;
-    const gchar *trans_num;
-    char recn;
-    int row, len;
+    for (splits = xaccQueryGetSplits (list->query); splits; splits = splits->next)
+    {
+        gnc_numeric amount;
+        Timespec ts;
+        const gchar *trans_num;
+        char recn;
+        int row, len;
 
-    split = splits->data;
-    trans = xaccSplitGetParent (split);
-    trans_num = xaccTransGetNum (trans);
+        split = splits->data;
+        trans = xaccSplitGetParent (split);
+        trans_num = xaccTransGetNum (trans);
 
-    recn = xaccSplitGetReconcile(split);
-    if ((recn != NREC) && (recn != CREC))
-      continue;
+        recn = xaccSplitGetReconcile(split);
+        if ((recn != NREC) && (recn != CREC))
+            continue;
 
-    amount = xaccSplitGetAmount (split);
+        amount = xaccSplitGetAmount (split);
 
-    if (gnc_numeric_negative_p (amount)) {
-      if (list->list_type == RECLIST_DEBIT) {
-	continue;
-      }
-    } else if (gnc_numeric_positive_p (amount)) {
-      if (list->list_type == RECLIST_CREDIT) {
-	continue;
-      }
-    } else {
-      len = trans_num ? strlen(trans_num) : 0;
-      if ((len  && (list->list_type == RECLIST_DEBIT)) ||
-	  (!len && (list->list_type == RECLIST_CREDIT)))
-	continue;
-    }
+        if (gnc_numeric_negative_p (amount))
+        {
+            if (list->list_type == RECLIST_DEBIT)
+            {
+                continue;
+            }
+        }
+        else if (gnc_numeric_positive_p (amount))
+        {
+            if (list->list_type == RECLIST_CREDIT)
+            {
+                continue;
+            }
+        }
+        else
+        {
+            len = trans_num ? strlen(trans_num) : 0;
+            if ((len  && (list->list_type == RECLIST_DEBIT)) ||
+                    (!len && (list->list_type == RECLIST_CREDIT)))
+                continue;
+        }
 
-    xaccTransGetDatePostedTS (trans, &ts);
+        xaccTransGetDatePostedTS (trans, &ts);
 
-    strings[0] = gnc_print_date (ts);
-    strings[1] = trans_num;
-    strings[2] = xaccTransGetDescription (trans);
-    strings[3] = xaccPrintAmount (gnc_numeric_abs (amount), print_info);
-    strings[4] = "";
+        strings[0] = gnc_print_date (ts);
+        strings[1] = trans_num;
+        strings[2] = xaccTransGetDescription (trans);
+        strings[3] = xaccPrintAmount (gnc_numeric_abs (amount), print_info);
+        strings[4] = "";
 
-    if (list->first_fill && auto_check && recn == CREC)
-      g_hash_table_insert (list->reconciled, split, split);
+        if (list->first_fill && auto_check && recn == CREC)
+            g_hash_table_insert (list->reconciled, split, split);
 
-    row = gtk_clist_append (GTK_CLIST(list), (gchar **) strings);
-    gtk_clist_set_row_data (GTK_CLIST(list), row, split);
+        row = gtk_clist_append (GTK_CLIST(list), (gchar **) strings);
+        gtk_clist_set_row_data (GTK_CLIST(list), row, split);
 
-    update_toggle (GTK_CLIST (list), row);
+        update_toggle (GTK_CLIST (list), row);
 
-    list->num_splits++;
-  }
+        list->num_splits++;
+    }
 
-  list->first_fill = FALSE;
+    list->first_fill = FALSE;
 }
 #endif

Modified: gnucash/trunk/src/gnome/reconcile-list.h
===================================================================
--- gnucash/trunk/src/gnome/reconcile-list.h	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/reconcile-list.h	2010-02-27 16:32:01 UTC (rev 18746)
@@ -37,32 +37,35 @@
 
 typedef struct GNCReconcileList GNCReconcileList;
 
-typedef enum {
-  RECLIST_DEBIT,
-  RECLIST_CREDIT
+typedef enum
+{
+    RECLIST_DEBIT,
+    RECLIST_CREDIT
 } GNCReconcileListType;
 
-struct GNCReconcileList {
-  GNCQueryList qlist;
+struct GNCReconcileList
+{
+    GNCQueryList qlist;
 
-  GHashTable *reconciled;
-  Account *account;
-  GList *column_list;
+    GHashTable *reconciled;
+    Account *account;
+    GList *column_list;
 
-  time_t statement_date;
+    time_t statement_date;
 
-  GNCReconcileList *sibling;
-  GNCReconcileListType list_type;
-  gboolean no_toggle;
+    GNCReconcileList *sibling;
+    GNCReconcileListType list_type;
+    gboolean no_toggle;
 };
 
-typedef struct {
-  GtkCListClass parent_class;
+typedef struct
+{
+    GtkCListClass parent_class;
 
-  void (*toggle_reconciled)  (GNCReconcileList *list,
-			      Split            *split);
-  void (*double_click_split) (GNCReconcileList *list,
-			      Split            *split);
+    void (*toggle_reconciled)  (GNCReconcileList *list,
+                                Split            *split);
+    void (*double_click_split) (GNCReconcileList *list,
+                                Split            *split);
 } GNCReconcileListClass;
 
 #define GCONF_RECONCILE_SECTION "dialogs/reconcile"
@@ -74,11 +77,11 @@
 GType gnc_reconcile_list_get_type (void);
 
 GtkWidget * gnc_reconcile_list_new (Account * account,
-				    GNCReconcileListType type,
+                                    GNCReconcileListType type,
                                     time_t date);
 
 gint gnc_reconcile_list_get_needed_height(GNCReconcileList *list,
-                                          gint num_rows);
+        gint num_rows);
 
 gint gnc_reconcile_list_get_num_splits(GNCReconcileList *list);
 

Modified: gnucash/trunk/src/gnome/top-level.c
===================================================================
--- gnucash/trunk/src/gnome/top-level.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/top-level.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -97,152 +97,155 @@
                                                location);                   \
       return FALSE;                                                         \
     }                                                                       \
+ 
 
-
 static gboolean
 gnc_html_register_url_cb (const char *location, const char *label,
                           gboolean new_window, GNCURLResult *result)
 {
-  GncPluginPage *page = NULL;
-  GNCSplitReg * gsr   = NULL;
-  Split       * split = NULL;
-  Account     * account = NULL;
-  Transaction * trans;
-  GList       * node;
-  QofBook     * book = gnc_get_current_book();
+    GncPluginPage *page = NULL;
+    GNCSplitReg * gsr   = NULL;
+    Split       * split = NULL;
+    Account     * account = NULL;
+    Transaction * trans;
+    GList       * node;
+    QofBook     * book = gnc_get_current_book();
 
-  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-register:account=My Bank Account" */
-  if (strncmp("account=", location, 8) == 0)
-  {
-    account = gnc_account_lookup_by_full_name (gnc_get_current_root_account (),
-					       location + 8);
-  }
+    /* href="gnc-register:account=My Bank Account" */
+    if (strncmp("account=", location, 8) == 0)
+    {
+        account = gnc_account_lookup_by_full_name (gnc_get_current_root_account (),
+                  location + 8);
+    }
 
-  /* href="gnc-register:guid=12345678901234567890123456789012" */
-  else IF_TYPE ("acct-guid=", GNC_ID_ACCOUNT)
-    account = GNC_ACCOUNT(entity);
-  }
+    /* href="gnc-register:guid=12345678901234567890123456789012" */
+    else IF_TYPE ("acct-guid=", GNC_ID_ACCOUNT)
+        account = GNC_ACCOUNT(entity);
+}
 
-  else IF_TYPE ("trans-guid=", GNC_ID_TRANS)
+else IF_TYPE ("trans-guid=", GNC_ID_TRANS)
     trans = (Transaction *) entity;
 
-    for (node = xaccTransGetSplitList (trans); node; node = node->next)
-    {
-      split = node->data;
-      account = xaccSplitGetAccount(split);
-      if (account) break;
-    }
+for (node = xaccTransGetSplitList (trans); node; node = node->next)
+{
+    split = node->data;
+    account = xaccSplitGetAccount(split);
+    if (account) break;
+}
 
-    if (!account)
-    {
-      result->error_message =
+if (!account)
+{
+    result->error_message =
         g_strdup_printf (_("Transaction with no Accounts: %s"), location);
-      return FALSE;
-    }
-  }
-  else IF_TYPE ("split-guid=", GNC_ID_SPLIT)
+    return FALSE;
+}
+}
+else IF_TYPE ("split-guid=", GNC_ID_SPLIT)
     split = (Split *) entity;
-    account = xaccSplitGetAccount(split);
-  }
-  else
-  {
+        account = xaccSplitGetAccount(split);
+                  }
+                  else
+{
     result->error_message =
-          g_strdup_printf (_("Unsupported entity type: %s"), location);
+        g_strdup_printf (_("Unsupported entity type: %s"), location);
     return FALSE;
-  }
+}
 
-  page = gnc_plugin_page_register_new (account, FALSE);
-  gnc_main_window_open_page (NULL, page);
-  if (split) {
-      gsr = gnc_plugin_page_register_get_gsr(page);
-      gnc_split_reg_jump_to_split( gsr, split );
-  }
-
-  return TRUE;
+page = gnc_plugin_page_register_new (account, FALSE);
+       gnc_main_window_open_page (NULL, page);
+       if (split)
+{
+    gsr = gnc_plugin_page_register_get_gsr(page);
+    gnc_split_reg_jump_to_split( gsr, split );
 }
 
-/* ============================================================== */
+return TRUE;
+       }
 
-static gboolean
-gnc_html_price_url_cb (const char *location, const char *label,
-                       gboolean new_window, GNCURLResult *result)
+       /* ============================================================== */
+
+       static gboolean
+       gnc_html_price_url_cb (const char *location, const char *label,
+                              gboolean new_window, GNCURLResult *result)
 {
-  QofBook * book = gnc_get_current_book();
-  g_return_val_if_fail (location != NULL, FALSE);
-  g_return_val_if_fail (result != NULL, FALSE);
+    QofBook * book = gnc_get_current_book();
+    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-register:guid=12345678901234567890123456789012" */
-  IF_TYPE ("price-guid=", GNC_ID_PRICE)
-    if (!gnc_price_edit_by_guid (NULL, &guid)) 
+    /* href="gnc-register:guid=12345678901234567890123456789012" */
+    IF_TYPE ("price-guid=", GNC_ID_PRICE)
+    if (!gnc_price_edit_by_guid (NULL, &guid))
     {
         result->error_message = g_strdup_printf (_("No such price: %s"),
-                                                 location);
+                                location);
         return FALSE;
     }
-  }
-  else
-  {
-      result->error_message = g_strdup_printf (_("Badly formed URL %s"),
-                                               location);
-      return FALSE;
-  }
-
-  return TRUE;
 }
+else
+{
+    result->error_message = g_strdup_printf (_("Badly formed URL %s"),
+                            location);
+    return FALSE;
+}
 
-/** Restore all persistent program state.  This function finds the
- *  "new" state file associated with a specific book guid.  It then
- *  iterates through this state information, calling a helper function
- *  to recreate each open window.
- *
- *  @note The name of the state file is based on the name of the data
- *  file, not the path name of the data file.  If there are multiple
- *  data files with the same name, the state files will be suffixed
- *  with a number.  E.G. test_account, test_account_2, test_account_3,
- *  etc.
- *
- *  @param session A pointer to the current session.
- *
- *  @param unused An unused pointer. */
-static void
-gnc_restore_all_state (gpointer session, gpointer unused)
+return TRUE;
+       }
+
+       /** Restore all persistent program state.  This function finds the
+        *  "new" state file associated with a specific book guid.  It then
+        *  iterates through this state information, calling a helper function
+        *  to recreate each open window.
+        *
+        *  @note The name of the state file is based on the name of the data
+        *  file, not the path name of the data file.  If there are multiple
+        *  data files with the same name, the state files will be suffixed
+        *  with a number.  E.G. test_account, test_account_2, test_account_3,
+        *  etc.
+        *
+        *  @param session A pointer to the current session.
+        *
+        *  @param unused An unused pointer. */
+       static void
+       gnc_restore_all_state (gpointer session, gpointer unused)
 {
     GKeyFile *keyfile = NULL;
     QofBook *book;
     const GUID *guid;
-    const gchar *url, *guid_string;    
+    const gchar *url, *guid_string;
     gchar *file_guid, *filename = NULL;
     GError *error = NULL;
-    
+
     url = qof_session_get_url(session);
     ENTER("session %p (%s)", session, url ? url : "(null)");
-    if (!url) {
+    if (!url)
+    {
         LEAVE("no url, nothing to do");
         return;
     }
-    
+
     /* Get the book GUID */
     book = qof_session_get_book(session);
     guid = qof_entity_get_guid(QOF_INSTANCE(book));
     guid_string = guid_to_string(guid);
-    
+
     keyfile = gnc_find_state_file(url, guid_string, &filename);
     if (filename)
         g_free(filename);
 
-    if (!keyfile) {
+    if (!keyfile)
+    {
         gnc_main_window_restore_default_state();
         LEAVE("no state file");
         return;
     }
-    
+
 #ifdef DEBUG
     /*  Debugging: dump a copy to stdout and the trace log */
     {
@@ -253,28 +256,30 @@
         g_free(file_data);
     }
 #endif
-    
+
     /* validate top level info */
-    file_guid = g_key_file_get_string(keyfile, STATE_FILE_TOP, 
+    file_guid = g_key_file_get_string(keyfile, STATE_FILE_TOP,
                                       STATE_FILE_BOOK_GUID, &error);
-    if (error) {
+    if (error)
+    {
         g_warning("error reading group %s key %s: %s",
                   STATE_FILE_TOP, STATE_FILE_BOOK_GUID, error->message);
         LEAVE("can't read guid");
         goto cleanup;
     }
-    if (!file_guid || strcmp(guid_string, file_guid)) {
+    if (!file_guid || strcmp(guid_string, file_guid))
+    {
         g_warning("guid mismatch: book guid %s, state file guid %s",
                   guid_string, file_guid);
         LEAVE("guid values do not match");
         goto cleanup;
     }
-    
+
     gnc_main_window_restore_all_windows(keyfile);
-    
+
     /* Clean up */
     LEAVE("ok");
- cleanup:
+cleanup:
     if (error)
         g_error_free(error);
     if (file_guid)
@@ -306,11 +311,12 @@
     const GUID *guid;
     GError *error = NULL;
     GKeyFile *keyfile = NULL;
-    
-    
+
+
     url = qof_session_get_url(session);
     ENTER("session %p (%s)", session, url ? url : "(null)");
-    if (!url) {
+    if (!url)
+    {
         LEAVE("no url, nothing to do");
         return;
     }
@@ -335,7 +341,7 @@
                           guid_string);
 
     gnc_main_window_save_all_windows(keyfile);
-    
+
 #ifdef DEBUG
     /*  Debugging: dump a copy to the trace log */
     {
@@ -349,13 +355,14 @@
 
     /* Write it all out to disk */
     gnc_key_file_save_to_file(filename, keyfile, &error);
-    if (error) {
-        g_critical(_("Error: Failure saving state file.\n  %s"), 
+    if (error)
+    {
+        g_critical(_("Error: Failure saving state file.\n  %s"),
                    error->message);
         g_error_free(error);
     }
     g_free(filename);
-    
+
     /* Clean up */
     g_key_file_free(keyfile);
     LEAVE("");
@@ -367,7 +374,7 @@
     ENTER(" ");
 
     if (!gnucash_style_init())
-      gnc_shutdown(1);
+        gnc_shutdown(1);
     gnucash_color_init();
 
     gnc_html_register_url_handler (URL_TYPE_REGISTER,

Modified: gnucash/trunk/src/gnome/window-autoclear.c
===================================================================
--- gnucash/trunk/src/gnome/window-autoclear.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/window-autoclear.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -48,15 +48,15 @@
 /** STRUCTS *********************************************************/
 struct _AutoClearWindow
 {
-  Account *account;        /* The account that we are auto-clearing */
+    Account *account;        /* The account that we are auto-clearing */
 
-  gint component_id;       /* id of component                       */
+    gint component_id;       /* id of component                       */
 
-  GtkWidget *window;       /* The auto-clear window                 */
-  GNCAmountEdit *end_value;/* The ending value                      */
-  GtkWidget *ok_button;
-  GtkWidget *cancel_button;
-  GtkLabel *status_label;
+    GtkWidget *window;       /* The auto-clear window                 */
+    GNCAmountEdit *end_value;/* The ending value                      */
+    GtkWidget *ok_button;
+    GtkWidget *cancel_button;
+    GtkLabel *status_label;
 };
 
 /********************************************************************\
@@ -68,209 +68,209 @@
 void
 gnc_ui_autoclear_window_raise(AutoClearWindow * autoClearData)
 {
-  if (autoClearData == NULL)
-    return;
+    if (autoClearData == NULL)
+        return;
 
-  if (autoClearData->window == NULL)
-    return;
+    if (autoClearData->window == NULL)
+        return;
 
-  gtk_window_present(GTK_WINDOW(autoClearData->window));
+    gtk_window_present(GTK_WINDOW(autoClearData->window));
 }
 
 static char *
 gnc_autoclear_make_window_name(Account *account)
 {
-  char *fullname;
-  char *title;
+    char *fullname;
+    char *title;
 
-  fullname = gnc_account_get_full_name(account);
-  title = g_strconcat(fullname, " - ", _("Auto-clear"), NULL);
+    fullname = gnc_account_get_full_name(account);
+    title = g_strconcat(fullname, " - ", _("Auto-clear"), NULL);
 
-  g_free(fullname);
+    g_free(fullname);
 
-  return title;
+    return title;
 }
 
 static gboolean
 ght_gnc_numeric_equal(gconstpointer v1, gconstpointer v2)
 {
-  gnc_numeric n1 = *(gnc_numeric *)v1, n2 = *(gnc_numeric *)v2;
-  return gnc_numeric_equal(n1, n2);
+    gnc_numeric n1 = *(gnc_numeric *)v1, n2 = *(gnc_numeric *)v2;
+    return gnc_numeric_equal(n1, n2);
 }
 
 static guint
 ght_gnc_numeric_hash(gconstpointer v1)
 {
-  gnc_numeric n1 = *(gnc_numeric *)v1;
-  gdouble d1 = gnc_numeric_to_double(n1);
-  return g_str_hash(&d1);
+    gnc_numeric n1 = *(gnc_numeric *)v1;
+    gdouble d1 = gnc_numeric_to_double(n1);
+    return g_str_hash(&d1);
 }
 
 static void
 gnc_autoclear_window_ok_cb (GtkWidget *widget,
-				    AutoClearWindow *data)
+                            AutoClearWindow *data)
 {
-  GList *node, *nc_list = 0, *toclear_list = 0;
-  gnc_numeric toclear_value;
-  GHashTable *sack;
+    GList *node, *nc_list = 0, *toclear_list = 0;
+    gnc_numeric toclear_value;
+    GHashTable *sack;
 
-  gtk_label_set_text(data->status_label, "Searching for splits to clear ...");
+    gtk_label_set_text(data->status_label, "Searching for splits to clear ...");
 
-  /* Value we have to reach */
-  toclear_value = gnc_amount_edit_get_amount(data->end_value);
-  toclear_value = gnc_numeric_convert(toclear_value, xaccAccountGetCommoditySCU(data->account), GNC_RND_NEVER);
+    /* Value we have to reach */
+    toclear_value = gnc_amount_edit_get_amount(data->end_value);
+    toclear_value = gnc_numeric_convert(toclear_value, xaccAccountGetCommoditySCU(data->account), GNC_RND_NEVER);
 
-  /* Extract which splits are not cleared and compute the amount we have to clear */
-  for (node = xaccAccountGetSplitList(data->account); node; node = node->next)
-  {
-    Split *split = (Split *)node->data;
-    char recn;
-    gnc_numeric value;
+    /* Extract which splits are not cleared and compute the amount we have to clear */
+    for (node = xaccAccountGetSplitList(data->account); node; node = node->next)
+    {
+        Split *split = (Split *)node->data;
+        char recn;
+        gnc_numeric value;
 
-    recn = xaccSplitGetReconcile (split);
-    value = xaccSplitGetAmount (split);
+        recn = xaccSplitGetReconcile (split);
+        value = xaccSplitGetAmount (split);
 
-    if (recn == NREC)
-      nc_list = g_list_append(nc_list, split);
-    else
-      toclear_value = gnc_numeric_sub_fixed(toclear_value, value);
-  }
+        if (recn == NREC)
+            nc_list = g_list_append(nc_list, split);
+        else
+            toclear_value = gnc_numeric_sub_fixed(toclear_value, value);
+    }
 
-  /* Pretty print information */
-  printf("Amount to clear: %s\n", gnc_numeric_to_string(toclear_value));
-  printf("Available splits:\n");
-  for (node = nc_list; node; node = node->next)
-  {
-    Split *split = (Split *)node->data;
-    gnc_numeric value = xaccSplitGetAmount (split);
-    printf("  %s\n", gnc_numeric_to_string(value));
-  }
+    /* Pretty print information */
+    printf("Amount to clear: %s\n", gnc_numeric_to_string(toclear_value));
+    printf("Available splits:\n");
+    for (node = nc_list; node; node = node->next)
+    {
+        Split *split = (Split *)node->data;
+        gnc_numeric value = xaccSplitGetAmount (split);
+        printf("  %s\n", gnc_numeric_to_string(value));
+    }
 
-  /* Run knapsack */
-  /* Entries in the hash table are:
-   *  - key   = amount to which we know how to clear (freed by GHashTable)
-   *  - value = last split we used to clear this amount (not managed by GHashTable)
-   */
-  printf("Knapsacking ...\n");
-  sack = g_hash_table_new_full (ght_gnc_numeric_hash, ght_gnc_numeric_equal, g_free, NULL);
-  for (node = nc_list; node; node = node->next)
-  {
-    Split *split = (Split *)node->data;
-    gnc_numeric split_value = xaccSplitGetAmount(split);
+    /* Run knapsack */
+    /* Entries in the hash table are:
+     *  - key   = amount to which we know how to clear (freed by GHashTable)
+     *  - value = last split we used to clear this amount (not managed by GHashTable)
+     */
+    printf("Knapsacking ...\n");
+    sack = g_hash_table_new_full (ght_gnc_numeric_hash, ght_gnc_numeric_equal, g_free, NULL);
+    for (node = nc_list; node; node = node->next)
+    {
+        Split *split = (Split *)node->data;
+        gnc_numeric split_value = xaccSplitGetAmount(split);
 
-    GHashTableIter iter;
-	gpointer pkey = NULL;
-    GList *reachable_list = 0, *node;
+        GHashTableIter iter;
+        gpointer pkey = NULL;
+        GList *reachable_list = 0, *node;
 
-    printf("  Split value: %s\n", gnc_numeric_to_string(split_value));
+        printf("  Split value: %s\n", gnc_numeric_to_string(split_value));
 
-    /* For each value in the sack */
-    g_hash_table_iter_init (&iter, sack);
-    while (g_hash_table_iter_next (&iter, &pkey, NULL))
-    {
-	  /* Cast the gpointer to the kind of pointer we actually need. */
-	  gnc_numeric *key = (gnc_numeric *)pkey;
-      /* Compute a new reachable value */
-      gnc_numeric reachable_value = gnc_numeric_add_fixed(*key, split_value);
-      reachable_list = g_list_append(reachable_list, g_memdup(&reachable_value, sizeof(gnc_numeric)));
-      printf("    Sack: found %s, added %s\n", gnc_numeric_to_string(*key), gnc_numeric_to_string(reachable_value));
-    }
+        /* For each value in the sack */
+        g_hash_table_iter_init (&iter, sack);
+        while (g_hash_table_iter_next (&iter, &pkey, NULL))
+        {
+            /* Cast the gpointer to the kind of pointer we actually need. */
+            gnc_numeric *key = (gnc_numeric *)pkey;
+            /* Compute a new reachable value */
+            gnc_numeric reachable_value = gnc_numeric_add_fixed(*key, split_value);
+            reachable_list = g_list_append(reachable_list, g_memdup(&reachable_value, sizeof(gnc_numeric)));
+            printf("    Sack: found %s, added %s\n", gnc_numeric_to_string(*key), gnc_numeric_to_string(reachable_value));
+        }
 
-    /* Add the value of the split itself to the reachable_list */
-    reachable_list = g_list_append(reachable_list, g_memdup(&split_value, sizeof(gnc_numeric)));
+        /* Add the value of the split itself to the reachable_list */
+        reachable_list = g_list_append(reachable_list, g_memdup(&split_value, sizeof(gnc_numeric)));
 
-    /* Add everything to the sack, looking out for duplicates */
-    for (node = reachable_list; node; node = node->next)
-    {
-      gnc_numeric *reachable_value = node->data;
-      Split *toinsert_split = split;
+        /* Add everything to the sack, looking out for duplicates */
+        for (node = reachable_list; node; node = node->next)
+        {
+            gnc_numeric *reachable_value = node->data;
+            Split *toinsert_split = split;
 
-      printf("    Reachable value: %s ", gnc_numeric_to_string(*reachable_value));
+            printf("    Reachable value: %s ", gnc_numeric_to_string(*reachable_value));
 
-      /* Check if it already exists */
-      if (g_hash_table_lookup_extended(sack, reachable_value, NULL, NULL))
-      {
-        /* If yes, we are in trouble, we reached an amount using two solutions */
-        toinsert_split = NULL;
-	printf("dup");
-      }
-      g_hash_table_insert (sack, reachable_value, toinsert_split);
-      printf("\n");
+            /* Check if it already exists */
+            if (g_hash_table_lookup_extended(sack, reachable_value, NULL, NULL))
+            {
+                /* If yes, we are in trouble, we reached an amount using two solutions */
+                toinsert_split = NULL;
+                printf("dup");
+            }
+            g_hash_table_insert (sack, reachable_value, toinsert_split);
+            printf("\n");
+        }
+        g_list_free(reachable_list);
     }
-    g_list_free(reachable_list);
-  }
 
-  /* Check solution */
-  printf("Rebuilding solution ...\n");
-  while (!gnc_numeric_zero_p(toclear_value))
-  {
-	gpointer psplit = NULL;
+    /* Check solution */
+    printf("Rebuilding solution ...\n");
+    while (!gnc_numeric_zero_p(toclear_value))
+    {
+        gpointer psplit = NULL;
 
-    printf("  Left to clear: %s\n", gnc_numeric_to_string(toclear_value));
-    if (g_hash_table_lookup_extended(sack, &toclear_value, NULL, &psplit))
-    {
-      if (psplit != NULL)
-      {
-		/* Cast the gpointer to the kind of pointer we actually need */
-		Split *split = (Split *)psplit;
-        toclear_list = g_list_prepend(toclear_list, split);
-		toclear_value = gnc_numeric_sub_fixed(toclear_value,
-											  xaccSplitGetAmount(split));
-        printf("    Cleared: %s -> %s\n",
-			   gnc_numeric_to_string(xaccSplitGetAmount(split)),
-			   gnc_numeric_to_string(toclear_value));
-      }
-      else
-      {
-        /* We couldn't reconstruct the solution */
-        printf("    Solution not unique.\n");
-        gtk_label_set_text(data->status_label, "Cannot uniquely clear splits. Found multiple possibilities.");
-		return;
-      }
+        printf("  Left to clear: %s\n", gnc_numeric_to_string(toclear_value));
+        if (g_hash_table_lookup_extended(sack, &toclear_value, NULL, &psplit))
+        {
+            if (psplit != NULL)
+            {
+                /* Cast the gpointer to the kind of pointer we actually need */
+                Split *split = (Split *)psplit;
+                toclear_list = g_list_prepend(toclear_list, split);
+                toclear_value = gnc_numeric_sub_fixed(toclear_value,
+                                                      xaccSplitGetAmount(split));
+                printf("    Cleared: %s -> %s\n",
+                       gnc_numeric_to_string(xaccSplitGetAmount(split)),
+                       gnc_numeric_to_string(toclear_value));
+            }
+            else
+            {
+                /* We couldn't reconstruct the solution */
+                printf("    Solution not unique.\n");
+                gtk_label_set_text(data->status_label, "Cannot uniquely clear splits. Found multiple possibilities.");
+                return;
+            }
+        }
+        else
+        {
+            printf("    No solution found.\n");
+            gtk_label_set_text(data->status_label, "The selected amount cannot be cleared.");
+            return;
+        }
     }
-    else
+    g_hash_table_destroy (sack);
+
+    /* Show solution */
+    printf("Clearing splits:\n");
+    for (node = toclear_list; node; node = node->next)
     {
-      printf("    No solution found.\n");
-      gtk_label_set_text(data->status_label, "The selected amount cannot be cleared.");
-      return;
-    }
-  }
-  g_hash_table_destroy (sack);
+        Split *split = node->data;
+        char recn;
+        gnc_numeric value;
 
-  /* Show solution */
-  printf("Clearing splits:\n");
-  for (node = toclear_list; node; node = node->next)
-  {
-    Split *split = node->data;
-    char recn;
-	gnc_numeric value;
+        recn = xaccSplitGetReconcile (split);
+        value = xaccSplitGetAmount (split);
 
-	recn = xaccSplitGetReconcile (split);
-	value = xaccSplitGetAmount (split);
+        printf("  %c %s\n", recn, gnc_numeric_to_string(value));
 
-	printf("  %c %s\n", recn, gnc_numeric_to_string(value));
-
         xaccSplitSetReconcile (split, CREC);
-  }
-  if (toclear_list == 0)
-    printf("  None\n");
+    }
+    if (toclear_list == 0)
+        printf("  None\n");
 
-  /* Free lists */
-  g_list_free(nc_list);
-  g_list_free(toclear_list);
+    /* Free lists */
+    g_list_free(nc_list);
+    g_list_free(toclear_list);
 
-  /* Close window */
-  gtk_widget_destroy(data->window);
-  g_free(data);
+    /* Close window */
+    gtk_widget_destroy(data->window);
+    g_free(data);
 }
 
 static void
 gnc_autoclear_window_cancel_cb (GtkWidget *widget,
-				    AutoClearWindow *data)
+                                AutoClearWindow *data)
 {
-  /* Close window */
-  gtk_widget_destroy(data->window);
-  g_free(data);
+    /* Close window */
+    gtk_widget_destroy(data->window);
+    g_free(data);
 }
 
 /********************************************************************\
@@ -284,45 +284,45 @@
 AutoClearWindow *
 autoClearWindow (GtkWidget *parent, Account *account)
 {
-  GtkWidget *dialog, *box, *label, *end_value;
-  GladeXML *xml;
-  AutoClearWindow *data;
-  char *title;
+    GtkWidget *dialog, *box, *label, *end_value;
+    GladeXML *xml;
+    AutoClearWindow *data;
+    char *title;
 
-  data = g_new0 (AutoClearWindow, 1);
-  data->account = account;
+    data = g_new0 (AutoClearWindow, 1);
+    data->account = account;
 
-  /* Create the dialog box */
-  xml = gnc_glade_xml_new ("autoclear.glade", "Auto-clear Start Dialog");
-  dialog = glade_xml_get_widget (xml, "Auto-clear Start Dialog");
-  title = gnc_autoclear_make_window_name (account);
-  gtk_window_set_title(GTK_WINDOW(dialog), title);
-  g_free (title);
+    /* Create the dialog box */
+    xml = gnc_glade_xml_new ("autoclear.glade", "Auto-clear Start Dialog");
+    dialog = glade_xml_get_widget (xml, "Auto-clear Start Dialog");
+    title = gnc_autoclear_make_window_name (account);
+    gtk_window_set_title(GTK_WINDOW(dialog), title);
+    g_free (title);
 
-  /* Add amount edit box */
-  end_value = gnc_amount_edit_new();
-  data->end_value = GNC_AMOUNT_EDIT(end_value);
-  box = glade_xml_get_widget(xml, "end_value_box");
-  gtk_box_pack_start(GTK_BOX(box), end_value, TRUE, TRUE, 0);
-  label = glade_xml_get_widget(xml, "end_label");
-  gtk_label_set_mnemonic_widget(GTK_LABEL(label), end_value);
-  gtk_widget_grab_focus(GTK_WIDGET(end_value));
+    /* Add amount edit box */
+    end_value = gnc_amount_edit_new();
+    data->end_value = GNC_AMOUNT_EDIT(end_value);
+    box = glade_xml_get_widget(xml, "end_value_box");
+    gtk_box_pack_start(GTK_BOX(box), end_value, TRUE, TRUE, 0);
+    label = glade_xml_get_widget(xml, "end_label");
+    gtk_label_set_mnemonic_widget(GTK_LABEL(label), end_value);
+    gtk_widget_grab_focus(GTK_WIDGET(end_value));
 
-  data->window = GTK_WIDGET(dialog);
+    data->window = GTK_WIDGET(dialog);
 
-  if (parent != NULL)
-    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
-  data->ok_button = glade_xml_get_widget(xml, "ok_button");
-  data->cancel_button = glade_xml_get_widget(xml, "cancel_button");
-  data->status_label = GTK_LABEL(glade_xml_get_widget(xml, "status_label"));
+    if (parent != NULL)
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+    data->ok_button = glade_xml_get_widget(xml, "ok_button");
+    data->cancel_button = glade_xml_get_widget(xml, "cancel_button");
+    data->status_label = GTK_LABEL(glade_xml_get_widget(xml, "status_label"));
 
-  g_signal_connect(data->ok_button, "clicked",
-      G_CALLBACK(gnc_autoclear_window_ok_cb), data);
-  g_signal_connect(data->end_value, "activate",
-      G_CALLBACK(gnc_autoclear_window_ok_cb), data);
-  g_signal_connect(data->cancel_button, "clicked",
-      G_CALLBACK(gnc_autoclear_window_cancel_cb), data);
+    g_signal_connect(data->ok_button, "clicked",
+                     G_CALLBACK(gnc_autoclear_window_ok_cb), data);
+    g_signal_connect(data->end_value, "activate",
+                     G_CALLBACK(gnc_autoclear_window_ok_cb), data);
+    g_signal_connect(data->cancel_button, "clicked",
+                     G_CALLBACK(gnc_autoclear_window_cancel_cb), data);
 
-  return data;
+    return data;
 }
 

Modified: gnucash/trunk/src/gnome/window-reconcile.c
===================================================================
--- gnucash/trunk/src/gnome/window-reconcile.c	2010-02-27 15:54:20 UTC (rev 18745)
+++ gnucash/trunk/src/gnome/window-reconcile.c	2010-02-27 16:32:01 UTC (rev 18746)
@@ -57,36 +57,36 @@
 /** STRUCTS *********************************************************/
 struct _RecnWindow
 {
-  GUID account;             /* The account that we are reconciling  */
-  gnc_numeric new_ending;   /* The new ending balance               */
-  time_t statement_date;    /* The statement date                   */
+    GUID account;             /* The account that we are reconciling  */
+    gnc_numeric new_ending;   /* The new ending balance               */
+    time_t statement_date;    /* The statement date                   */
 
-  gint component_id;        /* id of component                      */
+    gint component_id;        /* id of component                      */
 
-  GtkWidget *window;        /* The reconcile window                 */
+    GtkWidget *window;        /* The reconcile window                 */
 
-  GtkUIManager *ui_merge;
-  GtkActionGroup *action_group;
-  GtkWidget *toolbar;       /* Toolbar widget                       */
-  gint toolbar_change_cb_id;  /* id for toolbar preference change cb  */
-  gint toolbar_change_cb_id2; /* id for toolbar preference change cb  */
+    GtkUIManager *ui_merge;
+    GtkActionGroup *action_group;
+    GtkWidget *toolbar;       /* Toolbar widget                       */
+    gint toolbar_change_cb_id;  /* id for toolbar preference change cb  */
+    gint toolbar_change_cb_id2; /* id for toolbar preference change cb  */
 
-  GtkWidget *starting;      /* The starting balance                 */
-  GtkWidget *ending;        /* The ending balance                   */
-  GtkWidget *recn_date;     /* The statement date                   */
-  GtkWidget *reconciled;    /* The reconciled balance               */
-  GtkWidget *difference;    /* Text field, amount left to reconcile */
+    GtkWidget *starting;      /* The starting balance                 */
+    GtkWidget *ending;        /* The ending balance                   */
+    GtkWidget *recn_date;     /* The statement date                   */
+    GtkWidget *reconciled;    /* The reconciled balance               */
+    GtkWidget *difference;    /* Text field, amount left to reconcile */
 
-  GtkWidget *total_debit;   /* Text field, total debit reconciled   */
-  GtkWidget *total_credit;  /* Text field, total credit reconciled  */
+    GtkWidget *total_debit;   /* Text field, total debit reconciled   */
+    GtkWidget *total_credit;  /* Text field, total credit reconciled  */
 
-  GtkWidget *debit;         /* Debit matrix show unreconciled debit */
-  GtkWidget *credit;        /* Credit matrix, shows credits...      */
+    GtkWidget *debit;         /* Debit matrix show unreconciled debit */
+    GtkWidget *credit;        /* Credit matrix, shows credits...      */
 
-  GtkWidget *debit_frame;   /* Frame around debit matrix            */
-  GtkWidget *credit_frame;  /* Frame around credit matrix           */
+    GtkWidget *debit_frame;   /* Frame around debit matrix            */
+    GtkWidget *credit_frame;  /* Frame around credit matrix           */
 
-  gboolean delete_refresh;  /* do a refresh upon a window deletion  */
+    gboolean delete_refresh;  /* do a refresh upon a window deletion  */
 };
 
 /* This structure doesn't contain everything involved in the
@@ -96,20 +96,20 @@
  */
 typedef struct _startRecnWindowData
 {
-  Account       *account;         /* the account being reconciled            */
-  GNCAccountType account_type;    /* the type of the account                 */
+    Account       *account;         /* the account being reconciled            */
+    GNCAccountType account_type;    /* the type of the account                 */
 
-  GtkWidget     *startRecnWindow; /* the startRecnWindow dialog              */
-  GtkWidget     *xfer_button;     /* the dialog's interest transfer button   */
-  GtkWidget     *date_value;      /* the dialog's ending date field          */
-  GNCAmountEdit *end_value;       /* the dialog's ending balance amount edit */
-  gnc_numeric    original_value;  /* the dialog's original ending balance    */
-  gboolean       user_set_value;  /* the user changed the ending value       */
+    GtkWidget     *startRecnWindow; /* the startRecnWindow dialog              */
+    GtkWidget     *xfer_button;     /* the dialog's interest transfer button   */
+    GtkWidget     *date_value;      /* the dialog's ending date field          */
+    GNCAmountEdit *end_value;       /* the dialog's ending balance amount edit */
+    gnc_numeric    original_value;  /* the dialog's original ending balance    */
+    gboolean       user_set_value;  /* the user changed the ending value       */
 
-  XferDialog    *xferData;        /* the interest xfer dialog (if it exists) */
-  gboolean       include_children;
+    XferDialog    *xferData;        /* the interest xfer dialog (if it exists) */
+    gboolean       include_children;
 
-  time_t         date;            /* the interest xfer reconcile date        */
+    time_t         date;            /* the interest xfer reconcile date        */
 } startRecnWindowData;
 
 
@@ -177,29 +177,29 @@
 static void
 recnRefresh (RecnWindow *recnData)
 {
-  if (recnData == NULL)
-    return;
+    if (recnData == NULL)
+        return;
 
-  gnc_reconcile_list_refresh(GNC_RECONCILE_LIST(recnData->debit));
-  gnc_reconcile_list_refresh(GNC_RECONCILE_LIST(recnData->credit));
+    gnc_reconcile_list_refresh(GNC_RECONCILE_LIST(recnData->debit));
+    gnc_reconcile_list_refresh(GNC_RECONCILE_LIST(recnData->credit));
 
-  gnc_reconcile_window_set_sensitivity(recnData);
+    gnc_reconcile_window_set_sensitivity(recnData);
 
-  gnc_recn_set_window_name(recnData);
+    gnc_recn_set_window_name(recnData);
 
-  recnRecalculateBalance(recnData);
+    recnRecalculateBalance(recnData);
 
-  gtk_widget_queue_resize(recnData->window);
+    gtk_widget_queue_resize(recnData->window);
 }
 
 
 static Account *
 recn_get_account (RecnWindow *recnData)
 {
-  if (!recnData)
-    return NULL;
+    if (!recnData)
+        return NULL;
 
-  return xaccAccountLookup (&recnData->account, gnc_get_current_book ());
+    return xaccAccountLookup (&recnData->account, gnc_get_current_book ());
 }
 
 /********************************************************************\
@@ -213,113 +213,113 @@
 static gnc_numeric
 recnRecalculateBalance (RecnWindow *recnData)
 {
-  Account *account;
-  const char *amount;
-  gnc_numeric debit;
-  gnc_numeric credit;
-  gnc_numeric starting;
-  gnc_numeric ending;
-  gnc_numeric reconciled;
-  gnc_numeric diff;
-  GNCPrintAmountInfo print_info;
-  gboolean reverse_balance, include_children;
-  GtkAction *action;
+    Account *account;
+    const char *amount;
+    gnc_numeric debit;
+    gnc_numeric credit;
+    gnc_numeric starting;
+    gnc_numeric ending;
+    gnc_numeric reconciled;
+    gnc_numeric diff;
+    GNCPrintAmountInfo print_info;
+    gboolean reverse_balance, include_children;
+    GtkAction *action;
 
-  account = recn_get_account (recnData);
-  if (!account)
-    return gnc_numeric_zero ();
+    account = recn_get_account (recnData);
+    if (!account)
+        return gnc_numeric_zero ();
 
-  reverse_balance = gnc_reverse_balance(account);
+    reverse_balance = gnc_reverse_balance(account);
 
-  /* update the starting balance */
-  include_children = xaccAccountGetReconcileChildrenStatus(account);
-  starting = gnc_ui_account_get_reconciled_balance(account, include_children);
-  print_info = gnc_account_print_info (account, TRUE);
+    /* update the starting balance */
+    include_children = xaccAccountGetReconcileChildrenStatus(account);
+    starting = gnc_ui_account_get_reconciled_balance(account, include_children);
+    print_info = gnc_account_print_info (account, TRUE);
 
-  /*
-   * Do not reverse the balance here.  It messes up the math in the
-   * reconciliation window.  Also, the balance should show up as a
-   * positive number in the reconciliation window to match the positive
-   * number that shows in the register window.
-   */
+    /*
+     * Do not reverse the balance here.  It messes up the math in the
+     * reconciliation window.  Also, the balance should show up as a
+     * positive number in the reconciliation window to match the positive
+     * number that shows in the register window.
+     */
 
-  amount = xaccPrintAmount(starting, print_info);
-  gnc_set_label_color(recnData->starting, starting);
-  gtk_label_set_text(GTK_LABEL(recnData->starting), amount);
-  if (reverse_balance)
-    starting = gnc_numeric_neg (starting);
+    amount = xaccPrintAmount(starting, print_info);
+    gnc_set_label_color(recnData->starting, starting);
+    gtk_label_set_text(GTK_LABEL(recnData->starting), amount);
+    if (reverse_balance)
+        starting = gnc_numeric_neg (starting);
 
-  /* update the statement date */
-  amount = qof_print_date(recnData->statement_date);
-  gtk_label_set_text(GTK_LABEL(recnData->recn_date), amount);
+    /* update the statement date */
+    amount = qof_print_date(recnData->statement_date);
+    gtk_label_set_text(GTK_LABEL(recnData->recn_date), amount);
 
-  /* update the ending balance */
-  ending = recnData->new_ending;
-  if (reverse_balance)
-    ending = gnc_numeric_neg (ending);
-  amount = xaccPrintAmount(ending, print_info);
-  gnc_set_label_color(recnData->ending, ending);
-  gtk_label_set_text(GTK_LABEL(recnData->ending), amount);
-  if (reverse_balance)
-    ending = gnc_numeric_neg (ending);
+    /* update the ending balance */
+    ending = recnData->new_ending;
+    if (reverse_balance)
+        ending = gnc_numeric_neg (ending);
+    amount = xaccPrintAmount(ending, print_info);
+    gnc_set_label_color(recnData->ending, ending);
+    gtk_label_set_text(GTK_LABEL(recnData->ending), amount);
+    if (reverse_balance)
+        ending = gnc_numeric_neg (ending);
 
-  debit = gnc_reconcile_list_reconciled_balance
-    (GNC_RECONCILE_LIST(recnData->debit));
+    debit = gnc_reconcile_list_reconciled_balance
+            (GNC_RECONCILE_LIST(recnData->debit));
 
-  credit = gnc_reconcile_list_reconciled_balance
-    (GNC_RECONCILE_LIST(recnData->credit));
+    credit = gnc_reconcile_list_reconciled_balance
+             (GNC_RECONCILE_LIST(recnData->credit));
 
-  /* Update the total debit and credit fields */
-  amount = xaccPrintAmount(debit, print_info);
-  gtk_label_set_text(GTK_LABEL(recnData->total_debit), amount);
+    /* Update the total debit and credit fields */
+    amount = xaccPrintAmount(debit, print_info);
+    gtk_label_set_text(GTK_LABEL(recnData->total_debit), amount);
 
-  amount = xaccPrintAmount(credit, print_info);
+    amount = xaccPrintAmount(credit, print_info);
 
-  gtk_label_set_text(GTK_LABEL(recnData->total_credit), amount);
+    gtk_label_set_text(GTK_LABEL(recnData->total_credit), amount);
 
-  /* update the reconciled balance */
-  reconciled = gnc_numeric_add_fixed (starting,
-                                      gnc_numeric_sub_fixed (debit, credit));
-  if (reverse_balance)
-    reconciled = gnc_numeric_neg (reconciled);
-  amount = xaccPrintAmount(reconciled, print_info);
-  gnc_set_label_color(recnData->reconciled, reconciled);
-  gtk_label_set_text(GTK_LABEL(recnData->reconciled), amount);
-  if (reverse_balance)
-    reconciled = gnc_numeric_neg (reconciled);
+    /* update the reconciled balance */
+    reconciled = gnc_numeric_add_fixed (starting,
+                                        gnc_numeric_sub_fixed (debit, credit));
+    if (reverse_balance)
+        reconciled = gnc_numeric_neg (reconciled);
+    amount = xaccPrintAmount(reconciled, print_info);
+    gnc_set_label_color(recnData->reconciled, reconciled);
+    gtk_label_set_text(GTK_LABEL(recnData->reconciled), amount);
+    if (reverse_balance)
+        reconciled = gnc_numeric_neg (reconciled);
 
-  /* update the difference */
-  diff = gnc_numeric_sub_fixed (ending, reconciled);
-  if (reverse_balance)
-    diff = gnc_numeric_neg (diff);
-  amount = xaccPrintAmount(diff, print_info);
-  gnc_set_label_color(recnData->difference, diff);
-  gtk_label_set_text(GTK_LABEL(recnData->difference), amount);
-  if (reverse_balance)
-    diff = gnc_numeric_neg (diff);
+    /* update the difference */
+    diff = gnc_numeric_sub_fixed (ending, reconciled);
+    if (reverse_balance)
+        diff = gnc_numeric_neg (diff);
+    amount = xaccPrintAmount(diff, print_info);
+    gnc_set_label_color(recnData->difference, diff);
+    gtk_label_set_text(GTK_LABEL(recnData->difference), amount);
+    if (reverse_balance)
+        diff = gnc_numeric_neg (diff);
 
-  action = gtk_action_group_get_action (recnData->action_group,
-					"RecnFinishAction");
-  gtk_action_set_sensitive(action, gnc_numeric_zero_p (diff));
+    action = gtk_action_group_get_action (recnData->action_group,
+                                          "RecnFinishAction");
+    gtk_action_set_sensitive(action, gnc_numeric_zero_p (diff));
 
-  action = gtk_action_group_get_action (recnData->action_group,
-          "TransBalanceAction");
-  gtk_action_set_sensitive(action, !gnc_numeric_zero_p (diff));
+    action = gtk_action_group_get_action (recnData->action_group,
+                                          "TransBalanceAction");
+    gtk_action_set_sensitive(action, !gnc_numeric_zero_p (diff));
 
-  return diff;
+    return diff;
 }
 
 static gboolean
 gnc_start_recn_update_cb(GtkWidget *widget, GdkEventFocus *event,
                          startRecnWindowData *data)
 {
-  gnc_numeric value;
+    gnc_numeric value;
 
-  gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT(data->end_value));
+    gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT(data->end_value));
 
-  value = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT(data->end_value));
-  data->user_set_value = !gnc_numeric_equal(value, data->original_value);
-  return FALSE;
+    value = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT(data->end_value));
+    data->user_set_value = !gnc_numeric_equal(value, data->original_value);
+    return FALSE;
 }
 
 /* If the user changed the date edit widget, update the
@@ -329,32 +329,32 @@
 static void
 gnc_start_recn_date_changed (GtkWidget *widget, startRecnWindowData *data)
 {
-  GNCDateEdit *gde = GNC_DATE_EDIT (widget);
-  gnc_numeric new_balance;
-  time_t new_date;
+    GNCDateEdit *gde = GNC_DATE_EDIT (widget);
+    gnc_numeric new_balance;
+    time_t new_date;
 
-  if (data->user_set_value)
-    return;
+    if (data->user_set_value)
+        return;
 
-  new_date = gnc_date_edit_get_date_end (gde);
+    new_date = gnc_date_edit_get_date_end (gde);
 
-  /* get the balance for the account as of the new date */
-  new_balance = gnc_ui_account_get_balance_as_of_date (data->account, new_date,
-						       data->include_children);
+    /* get the balance for the account as of the new date */
+    new_balance = gnc_ui_account_get_balance_as_of_date (data->account, new_date,
+                  data->include_children);
 
-  /* update the amount edit with the amount */
-  gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value),
-                              new_balance);
+    /* update the amount edit with the amount */
+    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value),
+                                new_balance);
 }
 
 void
 gnc_start_recn_children_changed (GtkWidget *widget, startRecnWindowData *data)
 {
-  data->include_children =
-    gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+    data->include_children =
+        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 
-  /* Force an update of the ending balance */
-  gnc_start_recn_date_changed (data->date_value, data);
+    /* Force an update of the ending balance */
+    gnc_start_recn_date_changed (data->date_value, data);
 }
 
 /* For a given account, determine if an auto interest xfer dialog should be
@@ -365,11 +365,11 @@
 static gboolean
 gnc_recn_interest_xfer_get_auto_interest_xfer_allowed( Account *account )
 {
-  gboolean auto_xfer;
+    gboolean auto_xfer;
 
-  auto_xfer = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
-				 "auto_interest_transfer", NULL);
-  return xaccAccountGetAutoInterestXfer( account, auto_xfer );
+    auto_xfer = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
+                                   "auto_interest_transfer", NULL);
+    return xaccAccountGetAutoInterestXfer( account, auto_xfer );
 }
 
 /********************************************************************\
@@ -393,15 +393,15 @@
 static char *
 gnc_recn_make_interest_window_name(Account *account, char *text)
 {
-  char *fullname;
-  char *title;
+    char *fullname;
+    char *title;
 
-  fullname = gnc_account_get_full_name(account);
-  title = g_strconcat(fullname, " - ", text && *text ? _(text) : "", NULL);
+    fullname = gnc_account_get_full_name(account);
+    title = g_strconcat(fullname, " - ", text && *text ? _(text) : "", NULL);
 
-  g_free(fullname);
+    g_free(fullname);
 
-  return title;
+    return title;
 }
 
 /* user clicked button in the interest xfer dialog entitled
@@ -409,116 +409,116 @@
  */
 static void
 gnc_recn_interest_xfer_no_auto_clicked_cb(GtkButton *button,
-                                          startRecnWindowData *data)
+        startRecnWindowData *data)
 {
-  /* Indicate that the user doesn't want
-   * an auto interest xfer for this account.
-   */
-  xaccAccountSetAutoInterestXfer( data->account, FALSE );
+    /* Indicate that the user doesn't want
+     * an auto interest xfer for this account.
+     */
+    xaccAccountSetAutoInterestXfer( data->account, FALSE );
 
-  /* shut down the interest xfer dialog */
-  gnc_xfer_dialog_close( data->xferData );
+    /* shut down the interest xfer dialog */
+    gnc_xfer_dialog_close( data->xferData );
 
-  /* make the button clickable again */
-  if( data->xfer_button )
-    gtk_widget_set_sensitive(GTK_WIDGET(data->xfer_button), TRUE);
+    /* make the button clickable again */
+    if ( data->xfer_button )
+        gtk_widget_set_sensitive(GTK_WIDGET(data->xfer_button), TRUE);
 }
 
 static void
 recnInterestXferWindow( startRecnWindowData *data)
 {
-  gchar *title;
+    gchar *title;
 
-  if( !account_type_has_auto_interest_xfer( data->account_type ) ) return;
+    if ( !account_type_has_auto_interest_xfer( data->account_type ) ) return;
 
-  /* get a normal transfer dialog... */
-  data->xferData = gnc_xfer_dialog( GTK_WIDGET(data->startRecnWindow),
-                                    data->account );
+    /* get a normal transfer dialog... */
+    data->xferData = gnc_xfer_dialog( GTK_WIDGET(data->startRecnWindow),
+                                      data->account );
 
-  /* ...and start changing things: */
+    /* ...and start changing things: */
 
-  /* change title */
-  if( account_type_has_auto_interest_payment( data->account_type ) )
-    title = gnc_recn_make_interest_window_name( data->account,
-                                                _("Interest Payment") );
-  else
-    title = gnc_recn_make_interest_window_name( data->account,
-                                                _("Interest Charge") );
+    /* change title */
+    if ( account_type_has_auto_interest_payment( data->account_type ) )
+        title = gnc_recn_make_interest_window_name( data->account,
+                _("Interest Payment") );
+    else
+        title = gnc_recn_make_interest_window_name( data->account,
+                _("Interest Charge") );
 
-  gnc_xfer_dialog_set_title( data->xferData, title );
-  g_free( title );
+    gnc_xfer_dialog_set_title( data->xferData, title );
+    g_free( title );
 
 
-  /* change frame labels */
-  gnc_xfer_dialog_set_information_label( data->xferData,
-					 _("Payment Information") );
+    /* change frame labels */
+    gnc_xfer_dialog_set_information_label( data->xferData,
+                                           _("Payment Information") );
 
-  /* Interest accrued is a transaction from an income account
-   * to a bank account.  Interest charged is a transaction from
-   * a credit account to an expense account.  The user isn't allowed
-   * to change the account (bank or credit) being reconciled.
-   */
-  if( account_type_has_auto_interest_payment( data->account_type ) )
-  {
-    gnc_xfer_dialog_set_from_account_label( data->xferData,
-		    			    _("Payment From") );
-    gnc_xfer_dialog_set_from_show_button_active( data->xferData, TRUE );
+    /* Interest accrued is a transaction from an income account
+     * to a bank account.  Interest charged is a transaction from
+     * a credit account to an expense account.  The user isn't allowed
+     * to change the account (bank or credit) being reconciled.
+     */
+    if ( account_type_has_auto_interest_payment( data->account_type ) )
+    {
+        gnc_xfer_dialog_set_from_account_label( data->xferData,
+                                                _("Payment From") );
+        gnc_xfer_dialog_set_from_show_button_active( data->xferData, TRUE );
 
-    // XXX: Set "from" account from previous interest payment.
+        // XXX: Set "from" account from previous interest payment.
 
-    gnc_xfer_dialog_set_to_account_label( data->xferData,
-		    			  _("Reconcile Account") );
-    gnc_xfer_dialog_select_to_account( data->xferData, data->account );
-    gnc_xfer_dialog_lock_to_account_tree( data->xferData );
+        gnc_xfer_dialog_set_to_account_label( data->xferData,
+                                              _("Reconcile Account") );
+        gnc_xfer_dialog_select_to_account( data->xferData, data->account );
+        gnc_xfer_dialog_lock_to_account_tree( data->xferData );
 
-    /* Quickfill based on the reconcile account, which is the "To" acct. */
-    gnc_xfer_dialog_quickfill_to_account( data->xferData, TRUE );
-  }
-  else  /* interest charged to account rather than paid to it */
-  {
-    gnc_xfer_dialog_set_from_account_label( data->xferData,
-		    			    _("Reconcile Account") );
-    gnc_xfer_dialog_select_from_account( data->xferData, data->account );
-    gnc_xfer_dialog_lock_from_account_tree( data->xferData );
+        /* Quickfill based on the reconcile account, which is the "To" acct. */
+        gnc_xfer_dialog_quickfill_to_account( data->xferData, TRUE );
+    }
+    else  /* interest charged to account rather than paid to it */
+    {
+        gnc_xfer_dialog_set_from_account_label( data->xferData,
+                                                _("Reconcile Account") );
+        gnc_xfer_dialog_select_from_account( data->xferData, data->account );
+        gnc_xfer_dialog_lock_from_account_tree( data->xferData );
 
-    gnc_xfer_dialog_set_to_account_label( data->xferData,
-		    			  _("Payment To") );
-    gnc_xfer_dialog_set_to_show_button_active( data->xferData, TRUE );
+        gnc_xfer_dialog_set_to_account_label( data->xferData,
+                                              _("Payment To") );
+        gnc_xfer_dialog_set_to_show_button_active( data->xferData, TRUE );
 
-    // XXX: Set "to" account from previous interest payment.
+        // XXX: Set "to" account from previous interest payment.
 
-    /* Quickfill based on the reconcile account, which is the "From" acct. */
-    gnc_xfer_dialog_quickfill_to_account( data->xferData, FALSE );
-  }
+        /* Quickfill based on the reconcile account, which is the "From" acct. */
+        gnc_xfer_dialog_quickfill_to_account( data->xferData, FALSE );
+    }
 
 
-  /* add a button to disable auto interest payments for this account */
-  gnc_xfer_dialog_add_user_specified_button( data->xferData,
-    ( account_type_has_auto_interest_payment( data->account_type ) ?
-        _("No Auto Interest Payments for this Account")
-       : _("No Auto Interest Charges for this Account") ),
-    G_CALLBACK(gnc_recn_interest_xfer_no_auto_clicked_cb),
-    (gpointer) data );
+    /* add a button to disable auto interest payments for this account */
+    gnc_xfer_dialog_add_user_specified_button( data->xferData,
+            ( account_type_has_auto_interest_payment( data->account_type ) ?
+              _("No Auto Interest Payments for this Account")
+              : _("No Auto Interest Charges for this Account") ),
+            G_CALLBACK(gnc_recn_interest_xfer_no_auto_clicked_cb),
+            (gpointer) data );
 
-  /* no currency frame */
-  gnc_xfer_dialog_toggle_currency_table( data->xferData, FALSE );
+    /* no currency frame */
+    gnc_xfer_dialog_toggle_currency_table( data->xferData, FALSE );
 
-  /* set the reconcile date for the transaction date */
-  gnc_xfer_dialog_set_date( data->xferData, data->date );
+    /* set the reconcile date for the transaction date */
+    gnc_xfer_dialog_set_date( data->xferData, data->date );
 
-  /* Now run the transfer dialog.  This blocks until done.
-   * If the user hit Cancel, make the button clickable so that
-   * the user can retry if they want.  We don't make the button
-   * clickable if they successfully entered a transaction, since
-   * the fact that the button was clickable again might make
-   * the user think that the transaction didn't actually go through.
-   */
-  if( ! gnc_xfer_dialog_run_until_done( data->xferData ) )
-    if( data->xfer_button )
-      gtk_widget_set_sensitive(GTK_WIDGET(data->xfer_button), TRUE);
+    /* Now run the transfer dialog.  This blocks until done.
+     * If the user hit Cancel, make the button clickable so that
+     * the user can retry if they want.  We don't make the button
+     * clickable if they successfully entered a transaction, since
+     * the fact that the button was clickable again might make
+     * the user think that the transaction didn't actually go through.
+     */
+    if ( ! gnc_xfer_dialog_run_until_done( data->xferData ) )
+        if ( data->xfer_button )
+            gtk_widget_set_sensitive(GTK_WIDGET(data->xfer_button), TRUE);
 
-  /* done with the XferDialog */
-  data->xferData = NULL;
+    /* done with the XferDialog */
+    data->xferData = NULL;
 }
 
 /* Set up for the interest xfer window, run the window, and update
@@ -527,89 +527,93 @@
 static void
 gnc_reconcile_interest_xfer_run(startRecnWindowData *data)
 {
-  GtkWidget *entry = gnc_amount_edit_gtk_entry(
+    GtkWidget *entry = gnc_amount_edit_gtk_entry(
                            GNC_AMOUNT_EDIT(data->end_value) );
-  gnc_numeric before = gnc_amount_edit_get_amount(
-                           GNC_AMOUNT_EDIT(data->end_value) );
-  gnc_numeric after = gnc_numeric_zero();
+    gnc_numeric before = gnc_amount_edit_get_amount(
+                             GNC_AMOUNT_EDIT(data->end_value) );
+    gnc_numeric after = gnc_numeric_zero();
 
-  recnInterestXferWindow( data );
+    recnInterestXferWindow( data );
 
-  /* recompute the ending balance */
-  after = xaccAccountGetBalanceAsOfDate(data->account, data->date);
+    /* recompute the ending balance */
+    after = xaccAccountGetBalanceAsOfDate(data->account, data->date);
 
-  /* update the ending balance in the startRecnWindow if it has changed. */
-  if( gnc_numeric_compare( before, after ) )
-  {
-    if (gnc_reverse_balance(data->account))
-      after = gnc_numeric_neg (after);
+    /* update the ending balance in the startRecnWindow if it has changed. */
+    if ( gnc_numeric_compare( before, after ) )
+    {
+        if (gnc_reverse_balance(data->account))
+            after = gnc_numeric_neg (after);
 
-    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value), after);
-    gtk_widget_grab_focus(GTK_WIDGET(entry));
-    gtk_editable_select_region (GTK_EDITABLE(entry), 0, -1);
-    data->original_value = after;
-    data->user_set_value = FALSE;
-  }
+        gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value), after);
+        gtk_widget_grab_focus(GTK_WIDGET(entry));
+        gtk_editable_select_region (GTK_EDITABLE(entry), 0, -1);
+        data->original_value = after;
+        data->user_set_value = FALSE;
+    }
 }
 
 void
 gnc_start_recn_interest_clicked_cb(GtkButton *button, startRecnWindowData *data)
 {
-  /* indicate in account that user wants
-   * an auto interest xfer for this account */
-  xaccAccountSetAutoInterestXfer( data->account, TRUE );
+    /* indicate in account that user wants
+     * an auto interest xfer for this account */
+    xaccAccountSetAutoInterestXfer( data->account, TRUE );
 
-  /* make the button unclickable since we're popping up the window */
-  if( data->xfer_button )
-    gtk_widget_set_sensitive(GTK_WIDGET(data->xfer_button), FALSE);
+    /* make the button unclickable since we're popping up the window */
+    if ( data->xfer_button )
+        gtk_widget_set_sensitive(GTK_WIDGET(data->xfer_button), FALSE);
 
-  /* run the account window */
-  gnc_reconcile_interest_xfer_run( data );
+    /* run the account window */
+    gnc_reconcile_interest_xfer_run( data );
 }
 
 static void
 gnc_save_reconcile_interval(Account *account, time_t statement_date)
 {
-  time_t prev_statement_date;
-  int days = 0, months = 0;
-  double seconds;
+    time_t prev_statement_date;
+    int days = 0, months = 0;
+    double seconds;
 
-  if (!xaccAccountGetReconcileLastDate (account, &prev_statement_date))
-    return;
+    if (!xaccAccountGetReconcileLastDate (account, &prev_statement_date))
+        return;
 
-  /*
-   * Compute the number of days difference.
-   */
-  seconds = difftime(statement_date, prev_statement_date);
-  days = (int)(seconds / 60 / 60 / 24);
+    /*
+     * Compute the number of days difference.
+     */
+    seconds = difftime(statement_date, prev_statement_date);
+    days = (int)(seconds / 60 / 60 / 24);
 
-  /*
-   * See if we need to remember days(weeks) or months.  The only trick
-   * value is 28 days which could be wither 4 weeks or 1 month.
-   */
-  if (days == 28) {
-    int prev_days = 0, prev_months = 1;
+    /*
+     * See if we need to remember days(weeks) or months.  The only trick
+     * value is 28 days which could be wither 4 weeks or 1 month.
+     */
+    if (days == 28)
+    {
+        int prev_days = 0, prev_months = 1;
 
-    /* What was it last time? */
-    xaccAccountGetReconcileLastInterval (account, &prev_months, &prev_days);
-    if (prev_months == 1) {
-      months = 1;
-      days = 0;
+        /* What was it last time? */
+        xaccAccountGetReconcileLastInterval (account, &prev_months, &prev_days);
+        if (prev_months == 1)
+        {
+            months = 1;
+            days = 0;
+        }
     }
-  } else if (days > 28) {
-    struct tm current, prev;
+    else if (days > 28)
+    {
+        struct tm current, prev;
 
-    current = * localtime(&statement_date);
-    prev = * localtime(&prev_statement_date);
-    months = ((12 * current.tm_year + current.tm_mon) -
-	      (12 * prev.tm_year + prev.tm_mon));
-    days = 0;
-  }
+        current = * localtime(&statement_date);
+        prev = * localtime(&prev_statement_date);
+        months = ((12 * current.tm_year + current.tm_mon) -
+                  (12 * prev.tm_year + prev.tm_mon));
+        days = 0;
+    }
 
-  /*
-   * Remember for next time.
-   */
-  xaccAccountSetReconcileLastInterval(account, months, days);
+    /*
+     * Remember for next time.
+     */
+    xaccAccountSetReconcileLastInterval(account, months, days);
 }
 
 /********************************************************************\
@@ -629,190 +633,191 @@
 static gboolean
 startRecnWindow(GtkWidget *parent, Account *account,
                 gnc_numeric *new_ending, time_t *statement_date,
-		gboolean enable_subaccount)
+                gboolean enable_subaccount)
 {
-  GtkWidget *dialog, *end_value, *date_value, *include_children_button;
-  GladeXML *xml;
-  startRecnWindowData data = { NULL };
-  gboolean auto_interest_xfer_option;
-  GNCPrintAmountInfo print_info;
-  gnc_numeric ending;
-  char *title;
-  int result;
+    GtkWidget *dialog, *end_value, *date_value, *include_children_button;
+    GladeXML *xml;
+    startRecnWindowData data = { NULL };
+    gboolean auto_interest_xfer_option;
+    GNCPrintAmountInfo print_info;
+    gnc_numeric ending;
+    char *title;
+    int result;
 
-  /* Initialize the data structure that will be used for several callbacks
-   * throughout this file with the relevant info.  Some initialization is
-   * done below as well.  Note that local storage should be OK for this,
-   * since any callbacks using it will only work while the startRecnWindow
-   * is running.
-   */
-  data.account = account;
-  data.account_type = xaccAccountGetType(account);
-  data.date = *statement_date;
+    /* Initialize the data structure that will be used for several callbacks
+     * throughout this file with the relevant info.  Some initialization is
+     * done below as well.  Note that local storage should be OK for this,
+     * since any callbacks using it will only work while the startRecnWindow
+     * is running.
+     */
+    data.account = account;
+    data.account_type = xaccAccountGetType(account);
+    data.date = *statement_date;
 
-  /* whether to have an automatic interest xfer dialog or not */
-  auto_interest_xfer_option =
-     gnc_recn_interest_xfer_get_auto_interest_xfer_allowed( account );
+    /* whether to have an automatic interest xfer dialog or not */
+    auto_interest_xfer_option =
+        gnc_recn_interest_xfer_get_auto_interest_xfer_allowed( account );
 
-  data.include_children = xaccAccountGetReconcileChildrenStatus(account);
+    data.include_children = xaccAccountGetReconcileChildrenStatus(account);
 
-  ending = gnc_ui_account_get_reconciled_balance(account,
-                                                 data.include_children);
-  print_info = gnc_account_print_info (account, TRUE);
+    ending = gnc_ui_account_get_reconciled_balance(account,
+             data.include_children);
+    print_info = gnc_account_print_info (account, TRUE);
 
-  /*
-   * Do not reverse the balance here.  It messes up the math in the
-   * reconciliation window.  Also, the balance should show up as a
-   * positive number in the reconciliation window to match the positive
-   * number that shows in the register window.
-   */
+    /*
+     * Do not reverse the balance here.  It messes up the math in the
+     * reconciliation window.  Also, the balance should show up as a
+     * positive number in the reconciliation window to match the positive
+     * number that shows in the register window.
+     */
 
-  /* Create the dialog box */
-  xml = gnc_glade_xml_new ("reconcile.glade", "Reconcile Start Dialog");
-  dialog = glade_xml_get_widget (xml, "Reconcile Start Dialog");
-  glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, &data);
-  title = gnc_recn_make_window_name (account);
-  gtk_window_set_title(GTK_WINDOW(dialog), title);
-  g_free (title);
+    /* Create the dialog box */
+    xml = gnc_glade_xml_new ("reconcile.glade", "Reconcile Start Dialog");
+    dialog = glade_xml_get_widget (xml, "Reconcile Start Dialog");
+    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, &data);
+    title = gnc_recn_make_window_name (account);
+    gtk_window_set_title(GTK_WINDOW(dialog), title);
+    g_free (title);
 
-  data.startRecnWindow = GTK_WIDGET(dialog);
+    data.startRecnWindow = GTK_WIDGET(dialog);
 
-  if (parent != NULL)
-    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+    if (parent != NULL)
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
 
-  {
-    GtkWidget *start_value, *box;
-    GtkWidget *entry, *label;
-    GtkWidget *interest = NULL;
+    {
+        GtkWidget *start_value, *box;
+        GtkWidget *entry, *label;
+        GtkWidget *interest = NULL;
 
-    start_value = glade_xml_get_widget(xml, "start_value");
-    gtk_label_set_text(GTK_LABEL(start_value), xaccPrintAmount (ending, print_info));
+        start_value = glade_xml_get_widget(xml, "start_value");
+        gtk_label_set_text(GTK_LABEL(start_value), xaccPrintAmount (ending, print_info));
 
-    include_children_button = glade_xml_get_widget(xml, "subaccount_check");
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(include_children_button),
-                                 data.include_children);
-    gtk_widget_set_sensitive(include_children_button, enable_subaccount);
+        include_children_button = glade_xml_get_widget(xml, "subaccount_check");
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(include_children_button),
+                                     data.include_children);
+        gtk_widget_set_sensitive(include_children_button, enable_subaccount);
 
-    date_value = gnc_date_edit_new(*statement_date, FALSE, FALSE);
-    data.date_value = date_value;
-    box = glade_xml_get_widget(xml, "date_value_box");
-    gtk_box_pack_start(GTK_BOX(box), date_value, TRUE, TRUE, 0);
-    label = glade_xml_get_widget(xml, "date_label");
-    gnc_date_make_mnemonic_target(GNC_DATE_EDIT(date_value), label);
+        date_value = gnc_date_edit_new(*statement_date, FALSE, FALSE);
+        data.date_value = date_value;
+        box = glade_xml_get_widget(xml, "date_value_box");
+        gtk_box_pack_start(GTK_BOX(box), date_value, TRUE, TRUE, 0);
+        label = glade_xml_get_widget(xml, "date_label");
+        gnc_date_make_mnemonic_target(GNC_DATE_EDIT(date_value), label);
 
-    end_value = gnc_amount_edit_new ();
-    data.end_value = GNC_AMOUNT_EDIT(end_value);
-    data.original_value = *new_ending;
-    data.user_set_value = FALSE;
-    box = glade_xml_get_widget(xml, "ending_value_box");
-    gtk_box_pack_start(GTK_BOX(box), end_value, TRUE, TRUE, 0);
-    label = glade_xml_get_widget(xml, "end_label");
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label), end_value);
+        end_value = gnc_amount_edit_new ();
+        data.end_value = GNC_AMOUNT_EDIT(end_value);
+        data.original_value = *new_ending;
+        data.user_set_value = FALSE;
+        box = glade_xml_get_widget(xml, "ending_value_box");
+        gtk_box_pack_start(GTK_BOX(box), end_value, TRUE, TRUE, 0);
+        label = glade_xml_get_widget(xml, "end_label");
+        gtk_label_set_mnemonic_widget(GTK_LABEL(label), end_value);
 
 
-    /* need to get a callback on date changes to update the recn balance */
-    g_signal_connect ( G_OBJECT (date_value), "date_changed",
-          G_CALLBACK (gnc_start_recn_date_changed), (gpointer) &data );
-    gnc_date_activates_default(GNC_DATE_EDIT(date_value), TRUE);
+        /* need to get a callback on date changes to update the recn balance */
+        g_signal_connect ( G_OBJECT (date_value), "date_changed",
+                           G_CALLBACK (gnc_start_recn_date_changed), (gpointer) &data );
+        gnc_date_activates_default(GNC_DATE_EDIT(date_value), TRUE);
 
-    print_info.use_symbol = 0;
-    gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (end_value), print_info);
-    gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (end_value),
-                                  xaccAccountGetCommoditySCU (account));
+        print_info.use_symbol = 0;
+        gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (end_value), print_info);
+        gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (end_value),
+                                      xaccAccountGetCommoditySCU (account));
 
-    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (end_value), *new_ending);
+        gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (end_value), *new_ending);
 
-    entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (end_value));
-    gtk_editable_select_region (GTK_EDITABLE(entry), 0, -1);
-    g_signal_connect(G_OBJECT(entry), "focus-out-event",
-		     G_CALLBACK(gnc_start_recn_update_cb), (gpointer) &data);
-    gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
+        entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (end_value));
+        gtk_editable_select_region (GTK_EDITABLE(entry), 0, -1);
+        g_signal_connect(G_OBJECT(entry), "focus-out-event",
+                         G_CALLBACK(gnc_start_recn_update_cb), (gpointer) &data);
+        gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
 
-    /* if it's possible to enter an interest payment or charge for this
-     * account, add a button so that the user can pop up the appropriate
-     * dialog if it isn't automatically popping up.
-     */
-    interest = glade_xml_get_widget(xml, "interest_button");
-    if( account_type_has_auto_interest_payment( data.account_type ) )
-      gtk_button_set_label(GTK_BUTTON(interest), _("Enter _Interest Payment...") );
-    else if( account_type_has_auto_interest_charge( data.account_type ) )
-      gtk_button_set_label(GTK_BUTTON(interest), _("Enter _Interest Charge...") );
-    else {
-      gtk_widget_destroy(interest);
-      interest = NULL;
+        /* if it's possible to enter an interest payment or charge for this
+         * account, add a button so that the user can pop up the appropriate
+         * dialog if it isn't automatically popping up.
+         */
+        interest = glade_xml_get_widget(xml, "interest_button");
+        if ( account_type_has_auto_interest_payment( data.account_type ) )
+            gtk_button_set_label(GTK_BUTTON(interest), _("Enter _Interest Payment...") );
+        else if ( account_type_has_auto_interest_charge( data.account_type ) )
+            gtk_button_set_label(GTK_BUTTON(interest), _("Enter _Interest Charge...") );
+        else
+        {
+            gtk_widget_destroy(interest);
+            interest = NULL;
+        }
+
+        if ( interest )
+        {
+            data.xfer_button = interest;
+            if ( auto_interest_xfer_option )
+                gtk_widget_set_sensitive(GTK_WIDGET(interest), FALSE);
+        }
+
+        gtk_widget_show_all(dialog);
+
+        gtk_widget_grab_focus(gnc_amount_edit_gtk_entry
+                              (GNC_AMOUNT_EDIT (end_value)));
     }
 
-    if( interest )
+    /* Allow the user to enter an interest payment
+     * or charge prior to reconciling */
+    if ( account_type_has_auto_interest_xfer( data.account_type )
+            && auto_interest_xfer_option )
     {
-      data.xfer_button = interest;
-      if( auto_interest_xfer_option )
-       gtk_widget_set_sensitive(GTK_WIDGET(interest), FALSE);
+        gnc_reconcile_interest_xfer_run( &data );
     }
 
-    gtk_widget_show_all(dialog);
+    result = gtk_dialog_run(GTK_DIALOG(dialog));
+    if (result == GTK_RESPONSE_OK)
+    {
+        *new_ending = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (end_value));
+        *statement_date = gnc_date_edit_get_date_end(GNC_DATE_EDIT(date_value));
 
-    gtk_widget_grab_focus(gnc_amount_edit_gtk_entry
-                          (GNC_AMOUNT_EDIT (end_value)));
-  }
+        if (gnc_reverse_balance(account))
+            *new_ending = gnc_numeric_neg (*new_ending);
 
-  /* Allow the user to enter an interest payment
-   * or charge prior to reconciling */
-  if( account_type_has_auto_interest_xfer( data.account_type )
-      && auto_interest_xfer_option )
-  {
-    gnc_reconcile_interest_xfer_run( &data );
-  }
+        xaccAccountSetReconcileChildrenStatus(account, data.include_children);
 
-  result = gtk_dialog_run(GTK_DIALOG(dialog));
-  if (result == GTK_RESPONSE_OK)
-  {
-    *new_ending = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (end_value));
-    *statement_date = gnc_date_edit_get_date_end(GNC_DATE_EDIT(date_value));
+        gnc_save_reconcile_interval(account, *statement_date);
+    }
+    gtk_widget_destroy (dialog);
 
-    if (gnc_reverse_balance(account))
-      *new_ending = gnc_numeric_neg (*new_ending);
-
-    xaccAccountSetReconcileChildrenStatus(account, data.include_children);
-
-    gnc_save_reconcile_interval(account, *statement_date);
-  }
-  gtk_widget_destroy (dialog);
-
-  return (result == GTK_RESPONSE_OK);
+    return (result == GTK_RESPONSE_OK);
 }
 
 
 static void
 gnc_reconcile_window_set_sensitivity(RecnWindow *recnData)
 {
-  gboolean sensitive = FALSE;
-  GNCReconcileList *list;
-  GtkAction *action;
+    gboolean sensitive = FALSE;
+    GNCReconcileList *list;
+    GtkAction *action;
 
-  list = GNC_RECONCILE_LIST(recnData->debit);
-  if (gnc_reconcile_list_get_current_split(list) != NULL)
-    sensitive = TRUE;
+    list = GNC_RECONCILE_LIST(recnData->debit);
+    if (gnc_reconcile_list_get_current_split(list) != NULL)
+        sensitive = TRUE;
 
-  list = GNC_RECONCILE_LIST(recnData->credit);
-  if (gnc_reconcile_list_get_current_split(list) != NULL)
-    sensitive = TRUE;
+    list = GNC_RECONCILE_LIST(recnData->credit);
+    if (gnc_reconcile_list_get_current_split(list) != NULL)
+        sensitive = TRUE;
 
-  action = gtk_action_group_get_action (recnData->action_group,
-					"TransEditAction");
-  gtk_action_set_sensitive(action, sensitive);
-  action = gtk_action_group_get_action (recnData->action_group,
-					"TransDeleteAction");
-  gtk_action_set_sensitive(action, sensitive);
+    action = gtk_action_group_get_action (recnData->action_group,
+                                          "TransEditAction");
+    gtk_action_set_sensitive(action, sensitive);
+    action = gtk_action_group_get_action (recnData->action_group,
+                                          "TransDeleteAction");
+    gtk_action_set_sensitive(action, sensitive);
 }
 
 static void
 gnc_reconcile_window_list_cb(GNCReconcileList *list, Split *split,
                              gpointer data)
 {
-  RecnWindow *recnData = data;
+    RecnWindow *recnData = data;
 
-  gnc_reconcile_window_set_sensitivity(recnData);
-  recnRecalculateBalance(recnData);
+    gnc_reconcile_window_set_sensitivity(recnData);
+    recnRecalculateBalance(recnData);
 }
 
 /** Popup a contextual menu.  This function ends up being called when
@@ -830,23 +835,27 @@
 static void
 do_popup_menu(RecnWindow *recnData, GdkEventButton *event)
 {
-  GtkWidget *menu;
-  int button, event_time;
+    GtkWidget *menu;
+    int button, event_time;
 
-  menu = gtk_ui_manager_get_widget(recnData->ui_merge, "/MainPopup");
-  if (!menu) {
-    return;
-  }
+    menu = gtk_ui_manager_get_widget(recnData->ui_merge, "/MainPopup");
+    if (!menu)
+    {
+        return;
+    }
 
-  if (event) {
-    button = event->button;
-    event_time = event->time;
-  } else {
-    button = 0;
-    event_time = gtk_get_current_event_time ();
-  }
+    if (event)
+    {
+        button = event->button;
+        event_time = event->time;
+    }
+    else
+    {
+        button = 0;
+        event_time = gtk_get_current_event_time ();
+    }
 
-  gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, button, event_time);
+    gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, button, event_time);
 }
 
 
@@ -865,10 +874,10 @@
  */
 static gboolean
 gnc_reconcile_window_popup_menu_cb (GtkWidget *widget,
-				    RecnWindow *recnData)
+                                    RecnWindow *recnData)
 {
-  do_popup_menu(recnData, NULL);
-  return TRUE;
+    do_popup_menu(recnData, NULL);
+    return TRUE;
 }
 
 
@@ -878,137 +887,138 @@
  */
 static gboolean
 gnc_reconcile_window_button_press_cb (GtkWidget *widget,
-				      GdkEventButton *event,
-				      RecnWindow *recnData)
+                                      GdkEventButton *event,
+                                      RecnWindow *recnData)
 {
-  GtkCList *this_list;
-  gint row, column;
+    GtkCList *this_list;
+    gint row, column;
 
-  if (event->button == 3 && event->type == GDK_BUTTON_PRESS) {
-    this_list = GTK_CLIST(widget);
-    gtk_clist_get_selection_info(this_list, event->x, event->y, &row, &column);
-    gtk_clist_select_row(this_list, row, column);
-    do_popup_menu(recnData, event);
-    return TRUE;
-  }
+    if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
+    {
+        this_list = GTK_CLIST(widget);
+        gtk_clist_get_selection_info(this_list, event->x, event->y, &row, &column);
+        gtk_clist_select_row(this_list, row, column);
+        do_popup_menu(recnData, event);
+        return TRUE;
+    }
 
-  return FALSE;
+    return FALSE;
 }
 
 static GNCSplitReg *
 gnc_reconcile_window_open_register(RecnWindow *recnData)
 {
-  Account *account = recn_get_account (recnData);
-  GncPluginPage *page;
-  GNCSplitReg *gsr;
-  gboolean include_children;
+    Account *account = recn_get_account (recnData);
+    GncPluginPage *page;
+    GNCSplitReg *gsr;
+    gboolean include_children;
 
-  if (!account)
-    return(NULL);
+    if (!account)
+        return(NULL);
 
-  include_children = xaccAccountGetReconcileChildrenStatus (account);
-  page = gnc_plugin_page_register_new (account, include_children);
-  gnc_main_window_open_page (NULL, page);
-  gsr = gnc_plugin_page_register_get_gsr(page);
-  gnc_split_reg_raise(gsr);
-  return gsr;
+    include_children = xaccAccountGetReconcileChildrenStatus (account);
+    page = gnc_plugin_page_register_new (account, include_children);
+    gnc_main_window_open_page (NULL, page);
+    gsr = gnc_plugin_page_register_get_gsr(page);
+    gnc_split_reg_raise(gsr);
+    return gsr;
 }
 
 static void
 gnc_reconcile_window_double_click_cb(GNCReconcileList *list, Split *split,
                                      gpointer data)
 {
-  RecnWindow *recnData = data;
-  GNCSplitReg *gsr;
+    RecnWindow *recnData = data;
+    GNCSplitReg *gsr;
 
-  /* This should never be true, but be paranoid */
-  if (split == NULL)
-    return;
+    /* This should never be true, but be paranoid */
+    if (split == NULL)
+        return;
 
-  gsr = gnc_reconcile_window_open_register(recnData);
-  if (gsr == NULL)
-    return;
-  gnc_split_reg_jump_to_split( gsr, split );
+    gsr = gnc_reconcile_window_open_register(recnData);
+    if (gsr == NULL)
+        return;
+    gnc_split_reg_jump_to_split( gsr, split );
 }
 
 static void
 gnc_reconcile_window_focus_cb(GtkWidget *widget, GdkEventFocus *event,
                               gpointer data)
 {
-  RecnWindow *recnData = data;
-  GNCReconcileList *this_list, *other_list;
-  GNCReconcileList *debit, *credit;
+    RecnWindow *recnData = data;
+    GNCReconcileList *this_list, *other_list;
+    GNCReconcileList *debit, *credit;
 
-  this_list = GNC_RECONCILE_LIST(widget);
+    this_list = GNC_RECONCILE_LIST(widget);
 
-  debit  = GNC_RECONCILE_LIST(recnData->debit);
-  credit = GNC_RECONCILE_LIST(recnData->credit);
+    debit  = GNC_RECONCILE_LIST(recnData->debit);
+    credit = GNC_RECONCILE_LIST(recnData->credit);
 
-  other_list = GNC_RECONCILE_LIST(this_list == debit ? credit : debit);
+    other_list = GNC_RECONCILE_LIST(this_list == debit ? credit : debit);
 
-  /* clear the *other* list so we always have no more than one selection */
-  gnc_reconcile_list_unselect_all(other_list);
+    /* clear the *other* list so we always have no more than one selection */
+    gnc_reconcile_list_unselect_all(other_list);
 }
 
 static gboolean
 gnc_reconcile_key_press_cb (GtkWidget *widget, GdkEventKey *event,
                             gpointer data)
 {
-  RecnWindow *recnData = data;
-  GtkWidget *this_list, *other_list;
-  GtkWidget *debit, *credit;
+    RecnWindow *recnData = data;
+    GtkWidget *this_list, *other_list;
+    GtkWidget *debit, *credit;
 
-  switch (event->keyval)
-  {
+    switch (event->keyval)
+    {
     case GDK_Tab:
     case GDK_ISO_Left_Tab:
-      break;
+        break;
 
     default:
-      return FALSE;
-  }
+        return FALSE;
+    }
 
-  g_signal_stop_emission_by_name (widget, "key_press_event");
+    g_signal_stop_emission_by_name (widget, "key_press_event");
 
-  this_list = widget;
+    this_list = widget;
 
-  debit  = recnData->debit;
-  credit = recnData->credit;
+    debit  = recnData->debit;
+    credit = recnData->credit;
 
-  other_list = (this_list == debit ? credit : debit);
+    other_list = (this_list == debit ? credit : debit);
 
-  gtk_widget_grab_focus (other_list);
+    gtk_widget_grab_focus (other_list);
 
-  return TRUE;
+    return TRUE;
 }
 
 static void
 gnc_reconcile_window_set_titles(RecnWindow *recnData)
 {
-  gboolean formal;
-  gchar *title;
+    gboolean formal;
+    gchar *title;
 
-  formal = gnc_gconf_get_bool(GCONF_GENERAL, KEY_ACCOUNTING_LABELS, NULL);
+    formal = gnc_gconf_get_bool(GCONF_GENERAL, KEY_ACCOUNTING_LABELS, NULL);
 
-  if (formal)
-    title = _("Debits");
-  else
-    title = gnc_get_debit_string(ACCT_TYPE_NONE);
+    if (formal)
+        title = _("Debits");
+    else
+        title = gnc_get_debit_string(ACCT_TYPE_NONE);
 
-  gtk_frame_set_label(GTK_FRAME(recnData->debit_frame), title);
+    gtk_frame_set_label(GTK_FRAME(recnData->debit_frame), title);
 
-  if (!formal)
-    g_free(title);
+    if (!formal)
+        g_free(title);
 
-  if (formal)
-    title = _("Credits");
-  else
-    title = gnc_get_credit_string(ACCT_TYPE_NONE);
+    if (formal)
+        title = _("Credits");
+    else
+        title = gnc_get_credit_string(ACCT_TYPE_NONE);
 
-  gtk_frame_set_label(GTK_FRAME(recnData->credit_frame), title);
+    gtk_frame_set_label(GTK_FRAME(recnData->credit_frame), title);
 
-  if (!formal)
-    g_free(title);
+    if (!formal)
+        g_free(title);
 }
 
 static GtkWidget *
@@ -1018,309 +1028,310 @@
                                      GtkWidget **list_save,
                                      GtkWidget **total_save)
 {
-  GtkWidget *frame, *scrollWin, *list, *vbox, *label, *hbox;
+    GtkWidget *frame, *scrollWin, *list, *vbox, *label, *hbox;
 
-  frame = gtk_frame_new(NULL);
+    frame = gtk_frame_new(NULL);
 
-  if (type == RECLIST_DEBIT)
-    recnData->debit_frame = frame;
-  else
-    recnData->credit_frame = frame;
+    if (type == RECLIST_DEBIT)
+        recnData->debit_frame = frame;
+    else
+        recnData->credit_frame = frame;
 
-  vbox = gtk_vbox_new(FALSE, 5);
+    vbox = gtk_vbox_new(FALSE, 5);
 
-  list = gnc_reconcile_list_new(account, type, recnData->statement_date);
-  *list_save = list;
+    list = gnc_reconcile_list_new(account, type, recnData->statement_date);
+    *list_save = list;
 
-  g_signal_connect(list, "toggle_reconciled",
-                   G_CALLBACK(gnc_reconcile_window_list_cb),
-                   recnData);
-  g_signal_connect(list, "button_press_event",
-                   G_CALLBACK(gnc_reconcile_window_button_press_cb),
-                   recnData);
-  g_signal_connect(list, "double_click_split",
-                   G_CALLBACK(gnc_reconcile_window_double_click_cb),
-                   recnData);
-  g_signal_connect(list, "focus_in_event",
-                   G_CALLBACK(gnc_reconcile_window_focus_cb),
-                   recnData);
-  g_signal_connect(list, "key_press_event",
-                   G_CALLBACK(gnc_reconcile_key_press_cb),
-                   recnData);
+    g_signal_connect(list, "toggle_reconciled",
+                     G_CALLBACK(gnc_reconcile_window_list_cb),
+                     recnData);
+    g_signal_connect(list, "button_press_event",
+                     G_CALLBACK(gnc_reconcile_window_button_press_cb),
+                     recnData);
+    g_signal_connect(list, "double_click_split",
+                     G_CALLBACK(gnc_reconcile_window_double_click_cb),
+                     recnData);
+    g_signal_connect(list, "focus_in_event",
+                     G_CALLBACK(gnc_reconcile_window_focus_cb),
+                     recnData);
+    g_signal_connect(list, "key_press_event",
+                     G_CALLBACK(gnc_reconcile_key_press_cb),
+                     recnData);
 
-  scrollWin = gtk_scrolled_window_new (NULL, NULL);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrollWin),
-				 GTK_POLICY_AUTOMATIC,
-				 GTK_POLICY_AUTOMATIC);
-  gtk_container_set_border_width(GTK_CONTAINER(scrollWin), 5);
+    scrollWin = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrollWin),
+                                   GTK_POLICY_AUTOMATIC,
+                                   GTK_POLICY_AUTOMATIC);
+    gtk_container_set_border_width(GTK_CONTAINER(scrollWin), 5);
 
-  gtk_container_add(GTK_CONTAINER(frame), scrollWin);
-  gtk_container_add(GTK_CONTAINER(scrollWin), list);
-  gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+    gtk_container_add(GTK_CONTAINER(frame), scrollWin);
+    gtk_container_add(GTK_CONTAINER(scrollWin), list);
+    gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
 
-  hbox = gtk_hbox_new(FALSE, 5);
-  gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+    hbox = gtk_hbox_new(FALSE, 5);
+    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
-  label = gtk_label_new(_("Total:"));
-  gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
-  gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
+    label = gtk_label_new(_("Total:"));
+    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+    gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
 
-  label = gtk_label_new("");
-  gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-  *total_save = label;
+    label = gtk_label_new("");
+    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+    *total_save = label;
 
-  return vbox;
+    return vbox;
 }
 
 
 static Split *
 gnc_reconcile_window_get_current_split(RecnWindow *recnData)
 {
-  GNCReconcileList *list;
-  Split *split;
+    GNCReconcileList *list;
+    Split *split;
 
-  list = GNC_RECONCILE_LIST(recnData->debit);
-  split = gnc_reconcile_list_get_current_split(list);
-  if (split != NULL)
-    return split;
+    list = GNC_RECONCILE_LIST(recnData->debit);
+    split = gnc_reconcile_list_get_current_split(list);
+    if (split != NULL)
+        return split;
 
-  list = GNC_RECONCILE_LIST(recnData->credit);
-  split = gnc_reconcile_list_get_current_split(list);
+    list = GNC_RECONCILE_LIST(recnData->credit);
+    split = gnc_reconcile_list_get_current_split(list);
 
-  return split;
+    return split;
 }
 
 static void
 gnc_ui_reconcile_window_help_cb(GtkWidget *widget, gpointer data)
 {
-  gnc_gnome_help(HF_HELP, HL_RECNWIN);
+    gnc_gnome_help(HF_HELP, HL_RECNWIN);
 }
 
 static void
 gnc_ui_reconcile_window_change_cb(GtkAction *action, gpointer data)
 {
-  RecnWindow *recnData = data;
-  Account *account = recn_get_account (recnData);
-  gnc_numeric new_ending = recnData->new_ending;
-  time_t statement_date = recnData->statement_date;
+    RecnWindow *recnData = data;
+    Account *account = recn_get_account (recnData);
+    gnc_numeric new_ending = recnData->new_ending;
+    time_t statement_date = recnData->statement_date;
 
-  if (gnc_reverse_balance (account))
-    new_ending = gnc_numeric_neg (new_ending);
-  if (startRecnWindow (recnData->window, account, &new_ending, &statement_date,
-		       FALSE))
-  {
-    recnData->new_ending = new_ending;
-    recnData->statement_date = statement_date;
-    recnRecalculateBalance (recnData);
-  }
+    if (gnc_reverse_balance (account))
+        new_ending = gnc_numeric_neg (new_ending);
+    if (startRecnWindow (recnData->window, account, &new_ending, &statement_date,
+                         FALSE))
+    {
+        recnData->new_ending = new_ending;
+        recnData->statement_date = statement_date;
+        recnRecalculateBalance (recnData);
+    }
 }
 
 static void
 gnc_ui_reconcile_window_new_cb(GtkButton *button, gpointer data)
 {
-  RecnWindow *recnData = data;
-  GNCSplitReg *gsr;
+    RecnWindow *recnData = data;
+    GNCSplitReg *gsr;
 
-  gsr = gnc_reconcile_window_open_register(recnData);
-  if (gsr == NULL)
-    return;
-  gnc_split_reg_jump_to_blank( gsr );
+    gsr = gnc_reconcile_window_open_register(recnData);
+    if (gsr == NULL)
+        return;
+    gnc_split_reg_jump_to_blank( gsr );
 }
 
 static void
 gnc_ui_reconcile_window_balance_cb(GtkButton *button, gpointer data)
 {
-  RecnWindow *recnData = data;
-  GNCSplitReg *gsr;
-  Account *account;
-  gnc_numeric balancing_amount;
-  time_t statement_date;
+    RecnWindow *recnData = data;
+    GNCSplitReg *gsr;
+    Account *account;
+    gnc_numeric balancing_amount;
+    time_t statement_date;
 
 
-  gsr = gnc_reconcile_window_open_register(recnData);
-  if (gsr == NULL)
-    return;
+    gsr = gnc_reconcile_window_open_register(recnData);
+    if (gsr == NULL)
+        return;
 
-  account = recn_get_account(recnData);
-  if (account == NULL)
-    return;
+    account = recn_get_account(recnData);
+    if (account == NULL)
+        return;
 
-  balancing_amount = recnRecalculateBalance(recnData);
-  if (gnc_numeric_zero_p(balancing_amount))
-    return;
+    balancing_amount = recnRecalculateBalance(recnData);
+    if (gnc_numeric_zero_p(balancing_amount))
+        return;
 
-  statement_date = recnData->statement_date;
-  if (statement_date == 0)
-    statement_date = time(NULL); // default to 'now'
+    statement_date = recnData->statement_date;
+    if (statement_date == 0)
+        statement_date = time(NULL); // default to 'now'
 
-  gnc_split_reg_balancing_entry(gsr, account, statement_date, balancing_amount);
+    gnc_split_reg_balancing_entry(gsr, account, statement_date, balancing_amount);
 }
 
 static void
 gnc_ui_reconcile_window_delete_cb(GtkButton *button, gpointer data)
 {
-  RecnWindow *recnData = data;
-  Transaction *trans;
-  Split *split;
+    RecnWindow *recnData = data;
+    Transaction *trans;
+    Split *split;
 
-  split = gnc_reconcile_window_get_current_split(recnData);
-  /* This should never be true, but be paranoid */
-  if (split == NULL)
-    return;
+    split = gnc_reconcile_window_get_current_split(recnData);
+    /* This should never be true, but be paranoid */
+    if (split == NULL)
+        return;
 
-  {
-    const char *message = _("Are you sure you want to delete the selected "
-                            "transaction?");
-    gboolean result;
+    {
+        const char *message = _("Are you sure you want to delete the selected "
+                                "transaction?");
+        gboolean result;
 
-    result = gnc_verify_dialog(recnData->window, FALSE, "%s", message);
+        result = gnc_verify_dialog(recnData->window, FALSE, "%s", message);
 
-    if (!result)
-      return;
-  }
+        if (!result)
+            return;
+    }
 
-  gnc_suspend_gui_refresh ();
+    gnc_suspend_gui_refresh ();
 
-  trans = xaccSplitGetParent(split);
-  xaccTransDestroy(trans);
+    trans = xaccSplitGetParent(split);
+    xaccTransDestroy(trans);
 
-  gnc_resume_gui_refresh ();
+    gnc_resume_gui_refresh ();
 }
 
 static void
 gnc_ui_reconcile_window_edit_cb(GtkButton *button, gpointer data)
 {
-  RecnWindow *recnData = data;
-  GNCSplitReg *gsr;
-  Split *split;
+    RecnWindow *recnData = data;
+    GNCSplitReg *gsr;
+    Split *split;
 
-  split = gnc_reconcile_window_get_current_split (recnData);
-  /* This should never be true, but be paranoid */
-  if (split == NULL)
-    return;
+    split = gnc_reconcile_window_get_current_split (recnData);
+    /* This should never be true, but be paranoid */
+    if (split == NULL)
+        return;
 
-  gsr = gnc_reconcile_window_open_register(recnData);
-  if (gsr == NULL)
-    return;
-  gnc_split_reg_jump_to_split_amount( gsr, split );
+    gsr = gnc_reconcile_window_open_register(recnData);
+    if (gsr == NULL)
+        return;
+    gnc_split_reg_jump_to_split_amount( gsr, split );
 }
 
 
 static char *
 gnc_recn_make_window_name(Account *account)
 {
-  char *fullname;
-  char *title;
+    char *fullname;
+    char *title;
 
-  fullname = gnc_account_get_full_name(account);
-  title = g_strconcat(fullname, " - ", _("Reconcile"), NULL);
+    fullname = gnc_account_get_full_name(account);
+    title = g_strconcat(fullname, " - ", _("Reconcile"), NULL);
 
-  g_free(fullname);
+    g_free(fullname);
 
-  return title;
+    return title;
 }
 
 static void
 gnc_recn_set_window_name(RecnWindow *recnData)
 {
-  char *title;
+    char *title;
 
-  title = gnc_recn_make_window_name (recn_get_account (recnData));
+    title = gnc_recn_make_window_name (recn_get_account (recnData));
 
-  gtk_window_set_title (GTK_WINDOW (recnData->window), title);
+    gtk_window_set_title (GTK_WINDOW (recnData->window), title);
 
-  g_free (title);
+    g_free (title);
 }
 
 static void
 gnc_recn_edit_account_cb(GtkAction *action, gpointer data)
 {
-  RecnWindow *recnData = data;
-  Account *account = recn_get_account (recnData);
+    RecnWindow *recnData = data;
+    Account *account = recn_get_account (recnData);
 
-  if (account == NULL)
-    return;
+    if (account == NULL)
+        return;
 
-  gnc_ui_edit_account_window (account);
+    gnc_ui_edit_account_window (account);
 }
 
 static void
 gnc_recn_xfer_cb(GtkAction *action, gpointer data)
 {
-  RecnWindow *recnData = data;
-  Account *account = recn_get_account (recnData);
+    RecnWindow *recnData = data;
+    Account *account = recn_get_account (recnData);
 
-  if (account == NULL)
-    return;
+    if (account == NULL)
+        return;
 
-  gnc_xfer_dialog (recnData->window, account);
+    gnc_xfer_dialog (recnData->window, account);
 }
 
 static void
 gnc_recn_scrub_cb(GtkAction *action, gpointer data)
 {
-  RecnWindow *recnData = data;
-  Account *account = recn_get_account (recnData);
+    RecnWindow *recnData = data;
+    Account *account = recn_get_account (recnData);
 
-  if (account == NULL)
-    return;
+    if (account == NULL)
+        return;
 
-  gnc_suspend_gui_refresh ();
+    gnc_suspend_gui_refresh ();
 
-  xaccAccountTreeScrubOrphans (account);
-  xaccAccountTreeScrubImbalance (account);
+    xaccAccountTreeScrubOrphans (account);
+    xaccAccountTreeScrubImbalance (account);
 
-  // XXX: Lots are disabled.
-  if (g_getenv("GNC_AUTO_SCRUB_LOTS") != NULL)
-      xaccAccountTreeScrubLots(account);
+    // XXX: Lots are disabled.
+    if (g_getenv("GNC_AUTO_SCRUB_LOTS") != NULL)
+        xaccAccountTreeScrubLots(account);
 
-  gnc_resume_gui_refresh ();
+    gnc_resume_gui_refresh ();
 }
 
 static void
 gnc_recn_open_cb(GtkAction *action, gpointer data)
 {
-  RecnWindow *recnData = data;
+    RecnWindow *recnData = data;
 
-  gnc_reconcile_window_open_register(recnData);
+    gnc_reconcile_window_open_register(recnData);
 }
 
 static void
 gnc_recn_refresh_toolbar(RecnWindow *recnData)
 {
-  GtkToolbarStyle style;
-  GSList *list;
+    GtkToolbarStyle style;
+    GSList *list;
 
-  if ((recnData == NULL) || (recnData->toolbar == NULL))
-    return;
+    if ((recnData == NULL) || (recnData->toolbar == NULL))
+        return;
 
-  style = gnc_get_toolbar_style();
-  list = gtk_ui_manager_get_toplevels(recnData->ui_merge, GTK_UI_MANAGER_TOOLBAR);
-  g_slist_foreach(list, (GFunc)gtk_toolbar_set_style, GINT_TO_POINTER(style));
-  g_slist_free(list);
+    style = gnc_get_toolbar_style();
+    list = gtk_ui_manager_get_toplevels(recnData->ui_merge, GTK_UI_MANAGER_TOOLBAR);
+    g_slist_foreach(list, (GFunc)gtk_toolbar_set_style, GINT_TO_POINTER(style));
+    g_slist_free(list);
 }
 
 static void
 gnc_toolbar_change_cb (GConfClient *client,
-		       guint cnxn_id,
-		       GConfEntry *entry,
-		       gpointer data)
+                       guint cnxn_id,
+                       GConfEntry *entry,
+                       gpointer data)
 {
-  RecnWindow *recnData = data;
-  GConfValue *value;
-  const gchar *key, *key_tail;
+    RecnWindow *recnData = data;
+    GConfValue *value;
+    const gchar *key, *key_tail;
 
-  key = gconf_entry_get_key(entry);
-  value = gconf_entry_get_value(entry);
-  if (!key || !value)
-    return;
+    key = gconf_entry_get_key(entry);
+    value = gconf_entry_get_value(entry);
+    if (!key || !value)
+        return;
 
-  key_tail = strrchr(key, '/');
-  if (key_tail != NULL)
-    key_tail++;
-  if (strcmp(key_tail, KEY_TOOLBAR_STYLE) == 0) {
-    gnc_recn_refresh_toolbar(recnData);
-  }
+    key_tail = strrchr(key, '/');
+    if (key_tail != NULL)
+        key_tail++;
+    if (strcmp(key_tail, KEY_TOOLBAR_STYLE) == 0)
+    {
+        gnc_recn_refresh_toolbar(recnData);
+    }
 }
 
 static void
@@ -1328,173 +1339,179 @@
                         gnc_numeric *new_ending,
                         time_t *statement_date)
 {
-  gboolean always_today;
-  GDate date;
-  time_t today;
-  struct tm tm;
+    gboolean always_today;
+    GDate date;
+    time_t today;
+    struct tm tm;
 
-  g_date_clear(&date, 1);
+    g_date_clear(&date, 1);
 
-  always_today = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
-                    "always_reconcile_to_today", NULL);
+    always_today = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
+                                      "always_reconcile_to_today", NULL);
 
-  if (!always_today &&
-      xaccAccountGetReconcileLastDate (account, statement_date))
-  {
-    int months = 1, days = 0;
+    if (!always_today &&
+            xaccAccountGetReconcileLastDate (account, statement_date))
+    {
+        int months = 1, days = 0;
 
-    g_date_set_time_t(&date, *statement_date);
+        g_date_set_time_t(&date, *statement_date);
 
-    xaccAccountGetReconcileLastInterval (account, &months, &days);
+        xaccAccountGetReconcileLastInterval (account, &months, &days);
 
-    if (months) {
-      gboolean was_last_day_of_month = g_date_is_last_of_month(&date);
+        if (months)
+        {
+            gboolean was_last_day_of_month = g_date_is_last_of_month(&date);
 
-      g_date_add_months(&date, months);
+            g_date_add_months(&date, months);
 
-      /* Track last day of the month, i.e. 1/31 -> 2/28 -> 3/31 */
-      if (was_last_day_of_month)
-      {
-        g_date_set_day(&date, g_date_get_days_in_month(g_date_get_month(&date),
-                                                       g_date_get_year(&date)));
-      }
-    } else {
-      g_date_add_days(&date, days);
-    }
+            /* Track last day of the month, i.e. 1/31 -> 2/28 -> 3/31 */
+            if (was_last_day_of_month)
+            {
+                g_date_set_day(&date, g_date_get_days_in_month(g_date_get_month(&date),
+                               g_date_get_year(&date)));
+            }
+        }
+        else
+        {
+            g_date_add_days(&date, days);
+        }
 
-    g_date_to_struct_tm(&date, &tm);
-    gnc_tm_set_day_end (&tm);
-    *statement_date = mktime (&tm);
+        g_date_to_struct_tm(&date, &tm);
+        gnc_tm_set_day_end (&tm);
+        *statement_date = mktime (&tm);
 
-    today = gnc_timet_get_day_end(time(NULL));
-    if (*statement_date > today)
-      *statement_date = today;
-  }
+        today = gnc_timet_get_day_end(time(NULL));
+        if (*statement_date > today)
+            *statement_date = today;
+    }
 
-  xaccAccountGetReconcilePostponeDate (account, statement_date);
+    xaccAccountGetReconcilePostponeDate (account, statement_date);
 
-  if (xaccAccountGetReconcilePostponeBalance(account, new_ending)) {
-    if (gnc_reverse_balance(account))
-      *new_ending = gnc_numeric_neg(*new_ending);
-  } else {
-    /* if the account wasn't previously postponed, try to predict
-     * the statement balance based on the statement date.
-     */
-    *new_ending =
-      gnc_ui_account_get_balance_as_of_date
-      (account, *statement_date,
-       xaccAccountGetReconcileChildrenStatus(account));
-  }
+    if (xaccAccountGetReconcilePostponeBalance(account, new_ending))
+    {
+        if (gnc_reverse_balance(account))
+            *new_ending = gnc_numeric_neg(*new_ending);
+    }
+    else
+    {
+        /* if the account wasn't previously postponed, try to predict
+         * the statement balance based on the statement date.
+         */
+        *new_ending =
+            gnc_ui_account_get_balance_as_of_date
+            (account, *statement_date,
+             xaccAccountGetReconcileChildrenStatus(account));
+    }
 }
 
 static gboolean
 find_by_account (gpointer find_data, gpointer user_data)
 {
-  Account *account = find_data;
-  RecnWindow *recnData = user_data;
+    Account *account = find_data;
+    RecnWindow *recnData = user_data;
 
-  if (!recnData)
-    return FALSE;
+    if (!recnData)
+        return FALSE;
 
-  return guid_equal (&recnData->account, xaccAccountGetGUID (account));
+    return guid_equal (&recnData->account, xaccAccountGetGUID (account));
 }
 
 static void
 recn_set_watches_one_account (gpointer data, gpointer user_data)
 {
-  Account *account = (Account *)data;
-  RecnWindow *recnData = (RecnWindow *)user_data;
-  GList *node;
+    Account *account = (Account *)data;
+    RecnWindow *recnData = (RecnWindow *)user_data;
+    GList *node;
 
-  for (node = xaccAccountGetSplitList (account); node; node = node->next)
-  {
-    Split *split = node->data;
-    Transaction *trans;
-    char recn;
-
-    recn = xaccSplitGetReconcile (split);
-    switch (recn)
+    for (node = xaccAccountGetSplitList (account); node; node = node->next)
     {
-      case NREC:
-      case CREC:
-        trans = xaccSplitGetParent (split);
+        Split *split = node->data;
+        Transaction *trans;
+        char recn;
 
-        gnc_gui_component_watch_entity (recnData->component_id,
-                                        xaccTransGetGUID (trans),
-                                        QOF_EVENT_MODIFY
-					| QOF_EVENT_DESTROY
-					| GNC_EVENT_ITEM_CHANGED);
-        break;
+        recn = xaccSplitGetReconcile (split);
+        switch (recn)
+        {
+        case NREC:
+        case CREC:
+            trans = xaccSplitGetParent (split);
 
-      default:
-        break;
+            gnc_gui_component_watch_entity (recnData->component_id,
+                                            xaccTransGetGUID (trans),
+                                            QOF_EVENT_MODIFY
+                                            | QOF_EVENT_DESTROY
+                                            | GNC_EVENT_ITEM_CHANGED);
+            break;
+
+        default:
+            break;
+        }
     }
-  }
 }
 
 static void
 recn_set_watches (RecnWindow *recnData)
 {
-  gboolean include_children;
-  Account *account;
-  GList *accounts = NULL;
+    gboolean include_children;
+    Account *account;
+    GList *accounts = NULL;
 
-  gnc_gui_component_clear_watches (recnData->component_id);
+    gnc_gui_component_clear_watches (recnData->component_id);
 
-  gnc_gui_component_watch_entity (recnData->component_id,
-                                  &recnData->account,
-                                  QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
+    gnc_gui_component_watch_entity (recnData->component_id,
+                                    &recnData->account,
+                                    QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
 
-  account = recn_get_account (recnData);
+    account = recn_get_account (recnData);
 
-  include_children = xaccAccountGetReconcileChildrenStatus(account);
-  if (include_children)
-    accounts = gnc_account_get_descendants(account);
+    include_children = xaccAccountGetReconcileChildrenStatus(account);
+    if (include_children)
+        accounts = gnc_account_get_descendants(account);
 
-  /* match the account */
-  accounts = g_list_prepend (accounts, account);
+    /* match the account */
+    accounts = g_list_prepend (accounts, account);
 
-  g_list_foreach(accounts, recn_set_watches_one_account, recnData);
+    g_list_foreach(accounts, recn_set_watches_one_account, recnData);
 
-  g_list_free (accounts);
+    g_list_free (accounts);
 }
 
 static void
 refresh_handler (GHashTable *changes, gpointer user_data)
 {
-  RecnWindow *recnData = user_data;
-  const EventInfo *info;
-  Account *account;
+    RecnWindow *recnData = user_data;
+    const EventInfo *info;
+    Account *account;
 
-  account = recn_get_account (recnData);
-  if (!account)
-  {
-    gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
-    return;
-  }
+    account = recn_get_account (recnData);
+    if (!account)
+    {
+        gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
+        return;
+    }
 
-  if (changes)
-  {
-    info = gnc_gui_get_entity_events (changes, &recnData->account);
-    if (info && (info->event_mask & QOF_EVENT_DESTROY))
+    if (changes)
     {
-      gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
-      return;
+        info = gnc_gui_get_entity_events (changes, &recnData->account);
+        if (info && (info->event_mask & QOF_EVENT_DESTROY))
+        {
+            gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
+            return;
+        }
     }
-  }
 
-  gnc_reconcile_window_set_titles(recnData);
-  recn_set_watches (recnData);
+    gnc_reconcile_window_set_titles(recnData);
+    recn_set_watches (recnData);
 
-  recnRefresh (recnData);
+    recnRefresh (recnData);
 }
 
 static void
 close_handler (gpointer user_data)
 {
-  RecnWindow *recnData = user_data;
+    RecnWindow *recnData = user_data;
 
-  gtk_widget_destroy (recnData->window);
+    gtk_widget_destroy (recnData->window);
 }
 
 /********************************************************************\
@@ -1508,39 +1525,39 @@
 RecnWindow *
 recnWindow (GtkWidget *parent, Account *account)
 {
-  gnc_numeric new_ending;
-  time_t statement_date;
+    gnc_numeric new_ending;
+    time_t statement_date;
 
-  if (account == NULL)
-    return NULL;
+    if (account == NULL)
+        return NULL;
 
-  /* The last time reconciliation was attempted during the current
-   * execution of gnucash, the date was stored. Use that date if
-   * possible. This helps with balancing multiple accounts for which
-   * statements are issued at the same time, like multiple bank
-   * accounts on a single statement. */
-  if (!gnc_reconcile_last_statement_date)
-     statement_date = time (NULL);
-  else
-     statement_date = gnc_reconcile_last_statement_date;
+    /* The last time reconciliation was attempted during the current
+     * execution of gnucash, the date was stored. Use that date if
+     * possible. This helps with balancing multiple accounts for which
+     * statements are issued at the same time, like multiple bank
+     * accounts on a single statement. */
+    if (!gnc_reconcile_last_statement_date)
+        statement_date = time (NULL);
+    else
+        statement_date = gnc_reconcile_last_statement_date;
 
-  gnc_get_reconcile_info (account, &new_ending, &statement_date);
+    gnc_get_reconcile_info (account, &new_ending, &statement_date);
 
-  /* Popup a little window to prompt the user to enter the
-   * ending balance for his/her bank statement */
-  if (!startRecnWindow (parent, account, &new_ending, &statement_date, TRUE))
-    return NULL;
+    /* Popup a little window to prompt the user to enter the
+     * ending balance for his/her bank statement */
+    if (!startRecnWindow (parent, account, &new_ending, &statement_date, TRUE))
+        return NULL;
 
-  return recnWindowWithBalance (parent, account, new_ending, statement_date);
+    return recnWindowWithBalance (parent, account, new_ending, statement_date);
 }
 
 static void
 recnWindow_add_widget (GtkUIManager *merge,
-		       GtkWidget *widget,
-		       GtkVBox *dock)
+                       GtkWidget *widget,
+                       GtkVBox *dock)
 {
-  gtk_box_pack_start (GTK_BOX (dock), widget, FALSE, FALSE, 0);
-  gtk_widget_show (widget);
+    gtk_box_pack_start (GTK_BOX (dock), widget, FALSE, FALSE, 0);
+    gtk_widget_show (widget);
 }
 
 /********************************************************************\
@@ -1557,263 +1574,266 @@
 \********************************************************************/
 RecnWindow *
 recnWindowWithBalance (GtkWidget *parent, Account *account,
-		       gnc_numeric new_ending, time_t statement_date)
+                       gnc_numeric new_ending, time_t statement_date)
 {
-  RecnWindow *recnData;
-  GtkWidget *statusbar;
-  GtkWidget *vbox;
-  GtkWidget *dock;
+    RecnWindow *recnData;
+    GtkWidget *statusbar;
+    GtkWidget *vbox;
+    GtkWidget *dock;
 
-  if (account == NULL)
-    return NULL;
+    if (account == NULL)
+        return NULL;
 
-  recnData = gnc_find_first_gui_component (WINDOW_RECONCILE_CM_CLASS,
-                                           find_by_account, account);
-  if (recnData)
-    return recnData;
+    recnData = gnc_find_first_gui_component (WINDOW_RECONCILE_CM_CLASS,
+               find_by_account, account);
+    if (recnData)
+        return recnData;
 
-  recnData = g_new0 (RecnWindow, 1);
+    recnData = g_new0 (RecnWindow, 1);
 
-  recnData->account = *xaccAccountGetGUID (account);
+    recnData->account = *xaccAccountGetGUID (account);
 
 
-  recnData->component_id =
-    gnc_register_gui_component (WINDOW_RECONCILE_CM_CLASS,
-                                refresh_handler, close_handler,
-                                recnData);
+    recnData->component_id =
+        gnc_register_gui_component (WINDOW_RECONCILE_CM_CLASS,
+                                    refresh_handler, close_handler,
+                                    recnData);
 
-  recn_set_watches (recnData);
+    recn_set_watches (recnData);
 
-  gnc_reconcile_last_statement_date = statement_date;
+    gnc_reconcile_last_statement_date = statement_date;
 
-  recnData->new_ending = new_ending;
-  recnData->statement_date = statement_date;
-  recnData->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-  recnData->delete_refresh = FALSE;
+    recnData->new_ending = new_ending;
+    recnData->statement_date = statement_date;
+    recnData->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    recnData->delete_refresh = FALSE;
 
-  gnc_recn_set_window_name(recnData);
+    gnc_recn_set_window_name(recnData);
 
-  vbox = gtk_vbox_new(FALSE, 0);
-  gtk_container_add(GTK_CONTAINER(recnData->window), vbox);
+    vbox = gtk_vbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(recnData->window), vbox);
 
-  dock = gtk_vbox_new (FALSE, 0);
-  gtk_widget_show(dock);
-  gtk_box_pack_start(GTK_BOX (vbox), dock, FALSE, TRUE, 0);
+    dock = gtk_vbox_new (FALSE, 0);
+    gtk_widget_show(dock);
+    gtk_box_pack_start(GTK_BOX (vbox), dock, FALSE, TRUE, 0);
 
-  {
-    gchar *filename;
-    gint merge_id;
-    GtkAction *action;
-    GtkActionGroup *action_group;
-    GError *error = NULL;
+    {
+        gchar *filename;
+        gint merge_id;
+        GtkAction *action;
+        GtkActionGroup *action_group;
+        GError *error = NULL;
 
-    recnData->ui_merge = gtk_ui_manager_new ();
-    g_signal_connect (recnData->ui_merge, "add_widget",
-		      G_CALLBACK (recnWindow_add_widget), dock);
+        recnData->ui_merge = gtk_ui_manager_new ();
+        g_signal_connect (recnData->ui_merge, "add_widget",
+                          G_CALLBACK (recnWindow_add_widget), dock);
 
-    action_group = gtk_action_group_new ("ReconcileWindowActions");
-    recnData->action_group = action_group;
-    gnc_gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE);
-    gtk_action_group_add_actions (action_group, recnWindow_actions,
-				  recnWindow_n_actions, recnData);
-    action =
-      gtk_action_group_get_action (action_group, "AccountOpenAccountAction");
-    g_object_set (G_OBJECT(action), "short_label", _("Open"), NULL);
+        action_group = gtk_action_group_new ("ReconcileWindowActions");
+        recnData->action_group = action_group;
+        gnc_gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE);
+        gtk_action_group_add_actions (action_group, recnWindow_actions,
+                                      recnWindow_n_actions, recnData);
+        action =
+            gtk_action_group_get_action (action_group, "AccountOpenAccountAction");
+        g_object_set (G_OBJECT(action), "short_label", _("Open"), NULL);
 
-    gtk_ui_manager_insert_action_group (recnData->ui_merge, action_group, 0);
+        gtk_ui_manager_insert_action_group (recnData->ui_merge, action_group, 0);
 
-    filename = gnc_gnome_locate_ui_file("gnc-reconcile-window-ui.xml");
-    /* Can't do much without a ui. */
-    g_assert (filename);
+        filename = gnc_gnome_locate_ui_file("gnc-reconcile-window-ui.xml");
+        /* Can't do much without a ui. */
+        g_assert (filename);
 
-    merge_id = gtk_ui_manager_add_ui_from_file (recnData->ui_merge,
-						filename, &error);
-    g_assert(merge_id || error);
-    if (merge_id) {
-      gtk_window_add_accel_group (GTK_WINDOW (recnData->window),
-				  gtk_ui_manager_get_accel_group(recnData->ui_merge));
-      gtk_ui_manager_ensure_update (recnData->ui_merge);
-    } else {
-      g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
-		 filename, error->message);
-      g_error_free(error);
-      g_assert(merge_id != 0);
+        merge_id = gtk_ui_manager_add_ui_from_file (recnData->ui_merge,
+                   filename, &error);
+        g_assert(merge_id || error);
+        if (merge_id)
+        {
+            gtk_window_add_accel_group (GTK_WINDOW (recnData->window),
+                                        gtk_ui_manager_get_accel_group(recnData->ui_merge));
+            gtk_ui_manager_ensure_update (recnData->ui_merge);
+        }
+        else
+        {
+            g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
+                       filename, error->message);
+            g_error_free(error);
+            g_assert(merge_id != 0);
+        }
+        g_free(filename);
+
+        recnData->toolbar_change_cb_id =
+            gnc_gconf_add_anon_notification(GCONF_GENERAL,
+                                            gnc_toolbar_change_cb, recnData);
+        recnData->toolbar_change_cb_id2 =
+            gnc_gconf_add_anon_notification(DESKTOP_GNOME_INTERFACE,
+                                            gnc_toolbar_change_cb, recnData);
     }
-    g_free(filename);
 
-    recnData->toolbar_change_cb_id =
-      gnc_gconf_add_anon_notification(GCONF_GENERAL,
-				      gnc_toolbar_change_cb, recnData);
-    recnData->toolbar_change_cb_id2 =
-      gnc_gconf_add_anon_notification(DESKTOP_GNOME_INTERFACE,
-				      gnc_toolbar_change_cb, recnData);
-  }
+    g_signal_connect(recnData->window, "popup-menu",
+                     G_CALLBACK(gnc_reconcile_window_popup_menu_cb), recnData);
 
-  g_signal_connect(recnData->window, "popup-menu",
-		   G_CALLBACK(gnc_reconcile_window_popup_menu_cb), recnData);
+    statusbar = gtk_statusbar_new();
+    gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(statusbar), TRUE);
+    gtk_box_pack_end(GTK_BOX(vbox), statusbar, FALSE, FALSE, 0);
 
-  statusbar = gtk_statusbar_new();
-  gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(statusbar), TRUE);
-  gtk_box_pack_end(GTK_BOX(vbox), statusbar, FALSE, FALSE, 0);
+    g_signal_connect (recnData->window, "destroy",
+                      G_CALLBACK(recn_destroy_cb), recnData);
+    g_signal_connect (recnData->window, "delete_event",
+                      G_CALLBACK(recn_delete_cb), recnData);
+    g_signal_connect (recnData->window, "key_press_event",
+                      G_CALLBACK(recn_key_press_cb), recnData);
 
-  g_signal_connect (recnData->window, "destroy",
-                    G_CALLBACK(recn_destroy_cb), recnData);
-  g_signal_connect (recnData->window, "delete_event",
-                    G_CALLBACK(recn_delete_cb), recnData);
-  g_signal_connect (recnData->window, "key_press_event",
-                    G_CALLBACK(recn_key_press_cb), recnData);
 
+    /* The main area */
+    {
+        GtkWidget *frame = gtk_frame_new(NULL);
+        GtkWidget *main_area = gtk_vbox_new(FALSE, 10);
+        GtkWidget *debcred_area = gtk_table_new(1, 2, TRUE);
+        GtkWidget *debits_box;
+        GtkWidget *credits_box;
 
-  /* The main area */
-  {
-    GtkWidget *frame = gtk_frame_new(NULL);
-    GtkWidget *main_area = gtk_vbox_new(FALSE, 10);
-    GtkWidget *debcred_area = gtk_table_new(1, 2, TRUE);
-    GtkWidget *debits_box;
-    GtkWidget *credits_box;
+        gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
 
-    gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+        /* Force a reasonable starting size */
+        gtk_window_set_default_size(GTK_WINDOW(recnData->window), 800, 600);
 
-    /* Force a reasonable starting size */
-    gtk_window_set_default_size(GTK_WINDOW(recnData->window), 800, 600);
+        gtk_container_add(GTK_CONTAINER(frame), main_area);
+        gtk_container_set_border_width(GTK_CONTAINER(main_area), 10);
 
-    gtk_container_add(GTK_CONTAINER(frame), main_area);
-    gtk_container_set_border_width(GTK_CONTAINER(main_area), 10);
+        debits_box = gnc_reconcile_window_create_list_box
+                     (account, RECLIST_DEBIT, recnData,
+                      &recnData->debit, &recnData->total_debit);
 
-    debits_box = gnc_reconcile_window_create_list_box
-      (account, RECLIST_DEBIT, recnData,
-       &recnData->debit, &recnData->total_debit);
+        credits_box = gnc_reconcile_window_create_list_box
+                      (account, RECLIST_CREDIT, recnData,
+                       &recnData->credit, &recnData->total_credit);
 
-    credits_box = gnc_reconcile_window_create_list_box
-      (account, RECLIST_CREDIT, recnData,
-       &recnData->credit, &recnData->total_credit);
+        GNC_RECONCILE_LIST(recnData->debit)->sibling = GNC_RECONCILE_LIST(recnData->credit);
+        GNC_RECONCILE_LIST(recnData->credit)->sibling = GNC_RECONCILE_LIST(recnData->debit);
 
-    GNC_RECONCILE_LIST(recnData->debit)->sibling = GNC_RECONCILE_LIST(recnData->credit);
-    GNC_RECONCILE_LIST(recnData->credit)->sibling = GNC_RECONCILE_LIST(recnData->debit);
+        gtk_box_pack_start(GTK_BOX(main_area), debcred_area, TRUE, TRUE, 0);
+        gtk_table_set_col_spacings(GTK_TABLE(debcred_area), 15);
+        gtk_table_attach_defaults(GTK_TABLE(debcred_area), debits_box, 0, 1, 0, 1);
+        gtk_table_attach_defaults(GTK_TABLE(debcred_area), credits_box, 1, 2, 0, 1);
 
-    gtk_box_pack_start(GTK_BOX(main_area), debcred_area, TRUE, TRUE, 0);
-    gtk_table_set_col_spacings(GTK_TABLE(debcred_area), 15);
-    gtk_table_attach_defaults(GTK_TABLE(debcred_area), debits_box, 0, 1, 0, 1);
-    gtk_table_attach_defaults(GTK_TABLE(debcred_area), credits_box, 1, 2, 0, 1);
+        {
+            GtkWidget *hbox, *title_vbox, *value_vbox;
+            GtkWidget *totals_hbox, *frame, *title, *value;
 
-    {
-      GtkWidget *hbox, *title_vbox, *value_vbox;
-      GtkWidget *totals_hbox, *frame, *title, *value;
+            /* lower horizontal bar below reconcile lists */
+            hbox = gtk_hbox_new(FALSE, 5);
+            gtk_box_pack_start(GTK_BOX(main_area), hbox, FALSE, FALSE, 0);
 
-      /* lower horizontal bar below reconcile lists */
-      hbox = gtk_hbox_new(FALSE, 5);
-      gtk_box_pack_start(GTK_BOX(main_area), hbox, FALSE, FALSE, 0);
+            /* frame to hold totals */
+            frame = gtk_frame_new(NULL);
+            gtk_box_pack_end(GTK_BOX(hbox), frame, FALSE, FALSE, 0);
 
-      /* frame to hold totals */
-      frame = gtk_frame_new(NULL);
-      gtk_box_pack_end(GTK_BOX(hbox), frame, FALSE, FALSE, 0);
+            /* hbox to hold title/value vboxes */
+            totals_hbox = gtk_hbox_new(FALSE, 3);
+            gtk_container_add(GTK_CONTAINER(frame), totals_hbox);
+            gtk_container_set_border_width(GTK_CONTAINER(totals_hbox), 5);
 
-      /* hbox to hold title/value vboxes */
-      totals_hbox = gtk_hbox_new(FALSE, 3);
-      gtk_container_add(GTK_CONTAINER(frame), totals_hbox);
-      gtk_container_set_border_width(GTK_CONTAINER(totals_hbox), 5);
+            /* vbox to hold titles */
+            title_vbox = gtk_vbox_new(FALSE, 3);
+            gtk_box_pack_start(GTK_BOX(totals_hbox), title_vbox, FALSE, FALSE, 0);
 
-      /* vbox to hold titles */
-      title_vbox = gtk_vbox_new(FALSE, 3);
-      gtk_box_pack_start(GTK_BOX(totals_hbox), title_vbox, FALSE, FALSE, 0);
+            /* vbox to hold values */
+            value_vbox = gtk_vbox_new(FALSE, 3);
+            gtk_box_pack_start(GTK_BOX(totals_hbox), value_vbox, TRUE, TRUE, 0);
 
-      /* vbox to hold values */
-      value_vbox = gtk_vbox_new(FALSE, 3);
-      gtk_box_pack_start(GTK_BOX(totals_hbox), value_vbox, TRUE, TRUE, 0);
+            /* statement date title/value */
+            title = gtk_label_new(_("Statement Date:"));
+            gtk_misc_set_alignment(GTK_MISC(title), 1.0, 0.5);
+            gtk_box_pack_start(GTK_BOX(title_vbox), title, FALSE, FALSE, 0);
 
-      /* statement date title/value */
-      title = gtk_label_new(_("Statement Date:"));
-      gtk_misc_set_alignment(GTK_MISC(title), 1.0, 0.5);
-      gtk_box_pack_start(GTK_BOX(title_vbox), title, FALSE, FALSE, 0);
+            value = gtk_label_new("");
+            recnData->recn_date = value;
+            gtk_misc_set_alignment(GTK_MISC(value), 1.0, 0.5);
+            gtk_box_pack_start(GTK_BOX(value_vbox), value, FALSE, FALSE, 0);
 
-      value = gtk_label_new("");
-      recnData->recn_date = value;
-      gtk_misc_set_alignment(GTK_MISC(value), 1.0, 0.5);
-      gtk_box_pack_start(GTK_BOX(value_vbox), value, FALSE, FALSE, 0);
+            /* starting balance title/value */
+            title = gtk_label_new(_("Starting Balance:"));
+            gtk_misc_set_alignment(GTK_MISC(title), 1.0, 0.5);
+            gtk_box_pack_start(GTK_BOX(title_vbox), title, FALSE, FALSE, 3);
 
-      /* starting balance title/value */
-      title = gtk_label_new(_("Starting Balance:"));
-      gtk_misc_set_alignment(GTK_MISC(title), 1.0, 0.5);
-      gtk_box_pack_start(GTK_BOX(title_vbox), title, FALSE, FALSE, 3);
+            value = gtk_label_new("");
+            recnData->starting = value;
+            gtk_misc_set_alignment(GTK_MISC(value), 1.0, 0.5);
+            gtk_box_pack_start(GTK_BOX(value_vbox), value, FALSE, FALSE, 3);
 
-      value = gtk_label_new("");
-      recnData->starting = value;
-      gtk_misc_set_alignment(GTK_MISC(value), 1.0, 0.5);
-      gtk_box_pack_start(GTK_BOX(value_vbox), value, FALSE, FALSE, 3);
+            /* ending balance title/value */
+            title = gtk_label_new(_("Ending Balance:"));
+            gtk_misc_set_alignment(GTK_MISC(title), 1.0, 0.5);
+            gtk_box_pack_start(GTK_BOX(title_vbox), title, FALSE, FALSE, 0);
 
-      /* ending balance title/value */
-      title = gtk_label_new(_("Ending Balance:"));
-      gtk_misc_set_alignment(GTK_MISC(title), 1.0, 0.5);
-      gtk_box_pack_start(GTK_BOX(title_vbox), title, FALSE, FALSE, 0);
+            value = gtk_label_new("");
+            recnData->ending = value;
+            gtk_misc_set_alignment(GTK_MISC(value), 1.0, 0.5);
+            gtk_box_pack_start(GTK_BOX(value_vbox), value, FALSE, FALSE, 0);
 
-      value = gtk_label_new("");
-      recnData->ending = value;
-      gtk_misc_set_alignment(GTK_MISC(value), 1.0, 0.5);
-      gtk_box_pack_start(GTK_BOX(value_vbox), value, FALSE, FALSE, 0);
+            /* reconciled balance title/value */
+            title = gtk_label_new(_("Reconciled Balance:"));
+            gtk_misc_set_alignment(GTK_MISC(title), 1.0, 0.5);
+            gtk_box_pack_start(GTK_BOX(title_vbox), title, FALSE, FALSE, 0);
 
-      /* reconciled balance title/value */
-      title = gtk_label_new(_("Reconciled Balance:"));
-      gtk_misc_set_alignment(GTK_MISC(title), 1.0, 0.5);
-      gtk_box_pack_start(GTK_BOX(title_vbox), title, FALSE, FALSE, 0);
+            value = gtk_label_new("");
+            recnData->reconciled = value;
+            gtk_misc_set_alignment(GTK_MISC(value), 1.0, 0.5);
+            gtk_box_pack_start(GTK_BOX(value_vbox), value, FALSE, FALSE, 0);
 
-      value = gtk_label_new("");
-      recnData->reconciled = value;
-      gtk_misc_set_alignment(GTK_MISC(value), 1.0, 0.5);
-      gtk_box_pack_start(GTK_BOX(value_vbox), value, FALSE, FALSE, 0);
+            /* difference title/value */
+            title = gtk_label_new(_("Difference:"));
+            gtk_misc_set_alignment(GTK_MISC(title), 1.0, 0.5);
+            gtk_box_pack_start(GTK_BOX(title_vbox), title, FALSE, FALSE, 0);
 
-      /* difference title/value */
-      title = gtk_label_new(_("Difference:"));
-      gtk_misc_set_alignment(GTK_MISC(title), 1.0, 0.5);
-      gtk_box_pack_start(GTK_BOX(title_vbox), title, FALSE, FALSE, 0);
+            value = gtk_label_new("");
+            recnData->difference = value;
+            gtk_misc_set_alignment(GTK_MISC(value), 1.0, 0.5);
+            gtk_box_pack_start(GTK_BOX(value_vbox), value, FALSE, FALSE, 0);
+        }
 
-      value = gtk_label_new("");
-      recnData->difference = value;
-      gtk_misc_set_alignment(GTK_MISC(value), 1.0, 0.5);
-      gtk_box_pack_start(GTK_BOX(value_vbox), value, FALSE, FALSE, 0);
-    }
+        /* Set up the data */
+        recnRefresh (recnData);
 
-    /* Set up the data */
-    recnRefresh (recnData);
+        /* Clamp down on the size */
+        {
+            GNCReconcileList *rlist;
+            gint height, num_debits, num_credits, num_show;
 
-    /* Clamp down on the size */
-    {
-      GNCReconcileList *rlist;
-      gint height, num_debits, num_credits, num_show;
+            num_credits = gnc_reconcile_list_get_num_splits
+                          (GNC_RECONCILE_LIST(recnData->credit));
+            num_debits = gnc_reconcile_list_get_num_splits
+                         (GNC_RECONCILE_LIST(recnData->debit));
 
-      num_credits = gnc_reconcile_list_get_num_splits
-        (GNC_RECONCILE_LIST(recnData->credit));
-      num_debits = gnc_reconcile_list_get_num_splits
-        (GNC_RECONCILE_LIST(recnData->debit));
+            num_show = MAX(num_debits, num_credits);
+            num_show = MIN(num_show, 15);
+            num_show = MAX(num_show, 8);
 
-      num_show = MAX(num_debits, num_credits);
-      num_show = MIN(num_show, 15);
-      num_show = MAX(num_show, 8);
+            gtk_widget_realize(recnData->credit);
+            rlist = GNC_RECONCILE_LIST(recnData->credit);
+            height = gnc_reconcile_list_get_needed_height(rlist, num_show);
 
-      gtk_widget_realize(recnData->credit);
-      rlist = GNC_RECONCILE_LIST(recnData->credit);
-      height = gnc_reconcile_list_get_needed_height(rlist, num_show);
-
-      gtk_widget_set_size_request(recnData->credit, -1, height);
-      gtk_widget_set_size_request(recnData->debit, -1, height);
+            gtk_widget_set_size_request(recnData->credit, -1, height);
+            gtk_widget_set_size_request(recnData->debit, -1, height);
+        }
     }
-  }
 
-  /* Allow resize */
-  gtk_window_set_resizable(GTK_WINDOW(recnData->window), TRUE);
+    /* Allow resize */
+    gtk_window_set_resizable(GTK_WINDOW(recnData->window), TRUE);
 
-  gtk_widget_show_all(recnData->window);
+    gtk_widget_show_all(recnData->window);
 
-  gnc_reconcile_window_set_titles(recnData);
+    gnc_reconcile_window_set_titles(recnData);
 
-  recnRecalculateBalance(recnData);
+    recnRecalculateBalance(recnData);
 
-  gnc_recn_refresh_toolbar(recnData);
+    gnc_recn_refresh_toolbar(recnData);
 
-  gnc_window_adjust_for_screen(GTK_WINDOW(recnData->window));
+    gnc_window_adjust_for_screen(GTK_WINDOW(recnData->window));
 
-  gtk_widget_grab_focus (recnData->debit);
+    gtk_widget_grab_focus (recnData->debit);
 
-  return recnData;
+    return recnData;
 }
 
 
@@ -1826,13 +1846,13 @@
 void
 gnc_ui_reconcile_window_raise(RecnWindow * recnData)
 {
-  if (recnData == NULL)
-    return;
+    if (recnData == NULL)
+        return;
 
-  if (recnData->window == NULL)
-    return;
+    if (recnData->window == NULL)
+        return;
 
-  gtk_window_present(GTK_WINDOW(recnData->window));
+    gtk_window_present(GTK_WINDOW(recnData->window));
 }
 
 
@@ -1848,62 +1868,65 @@
 static void
 recn_destroy_cb (GtkWidget *w, gpointer data)
 {
-  RecnWindow *recnData = data;
+    RecnWindow *recnData = data;
 
-  gnc_unregister_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
+    gnc_unregister_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
 
-  gnc_gconf_remove_anon_notification(GCONF_GENERAL,
-				     recnData->toolbar_change_cb_id);
-  gnc_gconf_remove_anon_notification(DESKTOP_GNOME_INTERFACE,
-				     recnData->toolbar_change_cb_id2);
+    gnc_gconf_remove_anon_notification(GCONF_GENERAL,
+                                       recnData->toolbar_change_cb_id);
+    gnc_gconf_remove_anon_notification(DESKTOP_GNOME_INTERFACE,
+                                       recnData->toolbar_change_cb_id2);
 
-  if (recnData->delete_refresh)
-    gnc_resume_gui_refresh ();
+    if (recnData->delete_refresh)
+        gnc_resume_gui_refresh ();
 
-  g_free (recnData);
+    g_free (recnData);
 }
 
 static void
 recn_cancel(RecnWindow *recnData)
 {
-  gboolean changed = FALSE;
+    gboolean changed = FALSE;
 
-  if (gnc_reconcile_list_changed(GNC_RECONCILE_LIST(recnData->credit)))
-    changed = TRUE;
-  if (gnc_reconcile_list_changed(GNC_RECONCILE_LIST(recnData->debit)))
-    changed = TRUE;
+    if (gnc_reconcile_list_changed(GNC_RECONCILE_LIST(recnData->credit)))
+        changed = TRUE;
+    if (gnc_reconcile_list_changed(GNC_RECONCILE_LIST(recnData->debit)))
+        changed = TRUE;
 
-  if (changed)
-  {
-    const char *message = _("You have made changes to this reconcile "
-                            "window. Are you sure you want to cancel?");
-    if (!gnc_verify_dialog(recnData->window, FALSE, "%s", message))
-      return;
-  }
+    if (changed)
+    {
+        const char *message = _("You have made changes to this reconcile "
+                                "window. Are you sure you want to cancel?");
+        if (!gnc_verify_dialog(recnData->window, FALSE, "%s", message))
+            return;
+    }
 
-  gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
+    gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
 }
 
 static gboolean
 recn_delete_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
 {
-  RecnWindow *recnData = data;
+    RecnWindow *recnData = data;
 
-  recn_cancel(recnData);
-  return TRUE;
+    recn_cancel(recnData);
+    return TRUE;
 }
 
 static gboolean
 recn_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-  RecnWindow *recnData = data;
+    RecnWindow *recnData = data;
 
-  if (event->keyval == GDK_Escape) {
-    recn_cancel(recnData);
-    return TRUE;
-  } else {
-    return FALSE;
-  }
+    if (event->keyval == GDK_Escape)
+    {
+        recn_cancel(recnData);
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
 }
 
 /********************************************************************\
@@ -1918,55 +1941,55 @@
 static Account *
 find_payment_account(Account *account)
 {
-  GList *list;
-  GList *node;
+    GList *list;
+    GList *node;
 
-  if (account == NULL)
-    return NULL;
+    if (account == NULL)
+        return NULL;
 
-  list = xaccAccountGetSplitList (account);
+    list = xaccAccountGetSplitList (account);
 
-  /* Search backwards to find the latest payment */
-  for (node = g_list_last (list); node; node = node->prev)
-  {
-    Transaction *trans;
-    Split *split;
-    GList *n;
+    /* Search backwards to find the latest payment */
+    for (node = g_list_last (list); node; node = node->prev)
+    {
+        Transaction *trans;
+        Split *split;
+        GList *n;
 
-    split = node->data;
-    if (split == NULL)
-      continue;
+        split = node->data;
+        if (split == NULL)
+            continue;
 
-    /* ignore 'purchases' */
-    if (!gnc_numeric_positive_p (xaccSplitGetAmount(split)))
-      continue;
+        /* ignore 'purchases' */
+        if (!gnc_numeric_positive_p (xaccSplitGetAmount(split)))
+            continue;
 
-    trans = xaccSplitGetParent(split);
-    if (trans == NULL)
-      continue;
+        trans = xaccSplitGetParent(split);
+        if (trans == NULL)
+            continue;
 
-    for (n = xaccTransGetSplitList (trans); n; n = n->next)
-    {
-      GNCAccountType type;
-      Account *a;
-      Split *s;
+        for (n = xaccTransGetSplitList (trans); n; n = n->next)
+        {
+            GNCAccountType type;
+            Account *a;
+            Split *s;
 
-      s = n->data;
-      if ((s == NULL) || (s == split))
-        continue;
+            s = n->data;
+            if ((s == NULL) || (s == split))
+                continue;
 
-      a = xaccSplitGetAccount(s);
-      if ((a == NULL) || (a == account))
-        continue;
+            a = xaccSplitGetAccount(s);
+            if ((a == NULL) || (a == account))
+                continue;
 
-      type = xaccAccountGetType(a);
-      if ((type == ACCT_TYPE_BANK) || (type == ACCT_TYPE_CASH) ||
-	  (type == ACCT_TYPE_ASSET))
-        return a;
+            type = xaccAccountGetType(a);
+            if ((type == ACCT_TYPE_BANK) || (type == ACCT_TYPE_CASH) ||
+                    (type == ACCT_TYPE_ASSET))
+                return a;
+        }
     }
-  }
 
-  return NULL;
+    return NULL;
 }
 
 
@@ -1981,52 +2004,52 @@
 static void
 recnFinishCB (GtkAction *action, RecnWindow *recnData)
 {
-  gboolean auto_payment;
-  Account *account;
-  time_t date;
+    gboolean auto_payment;
+    Account *account;
+    time_t date;
 
-  if (!gnc_numeric_zero_p (recnRecalculateBalance(recnData)))
-  {
-    const char *message = _("The account is not balanced. "
-                            "Are you sure you want to finish?");
-    if (!gnc_verify_dialog (recnData->window, FALSE, "%s", message))
-      return;
-  }
+    if (!gnc_numeric_zero_p (recnRecalculateBalance(recnData)))
+    {
+        const char *message = _("The account is not balanced. "
+                                "Are you sure you want to finish?");
+        if (!gnc_verify_dialog (recnData->window, FALSE, "%s", message))
+            return;
+    }
 
-  date = recnData->statement_date;
+    date = recnData->statement_date;
 
-  gnc_suspend_gui_refresh ();
+    gnc_suspend_gui_refresh ();
 
-  recnData->delete_refresh = TRUE;
+    recnData->delete_refresh = TRUE;
 
-  gnc_reconcile_list_commit(GNC_RECONCILE_LIST(recnData->credit), date);
-  gnc_reconcile_list_commit(GNC_RECONCILE_LIST(recnData->debit), date);
+    gnc_reconcile_list_commit(GNC_RECONCILE_LIST(recnData->credit), date);
+    gnc_reconcile_list_commit(GNC_RECONCILE_LIST(recnData->debit), date);
 
-  auto_payment = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
-				    "auto_cc_payment", NULL);
+    auto_payment = gnc_gconf_get_bool(GCONF_RECONCILE_SECTION,
+                                      "auto_cc_payment", NULL);
 
-  account = recn_get_account (recnData);
+    account = recn_get_account (recnData);
 
-  xaccAccountClearReconcilePostpone (account);
-  xaccAccountSetReconcileLastDate (account, date);
+    xaccAccountClearReconcilePostpone (account);
+    xaccAccountSetReconcileLastDate (account, date);
 
-  if (auto_payment &&
-      (xaccAccountGetType (account) == ACCT_TYPE_CREDIT) &&
-      (gnc_numeric_negative_p (recnData->new_ending)))
-  {
-    Account *payment_account;
-    XferDialog *xfer;
+    if (auto_payment &&
+            (xaccAccountGetType (account) == ACCT_TYPE_CREDIT) &&
+            (gnc_numeric_negative_p (recnData->new_ending)))
+    {
+        Account *payment_account;
+        XferDialog *xfer;
 
-    xfer = gnc_xfer_dialog(NULL, account);
+        xfer = gnc_xfer_dialog(NULL, account);
 
-    gnc_xfer_dialog_set_amount(xfer, gnc_numeric_neg (recnData->new_ending));
+        gnc_xfer_dialog_set_amount(xfer, gnc_numeric_neg (recnData->new_ending));
 
-    payment_account = find_payment_account (account);
-    if (payment_account != NULL)
-      gnc_xfer_dialog_select_from_account (xfer, payment_account);
-  }
+        payment_account = find_payment_account (account);
+        if (payment_account != NULL)
+            gnc_xfer_dialog_select_from_account (xfer, payment_account);
+    }
 
-  gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
+    gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
 }
 
 /********************************************************************\
@@ -2040,36 +2063,36 @@
 static void
 recnPostponeCB (GtkAction *action, gpointer data)
 {
-  RecnWindow *recnData = data;
-  Account *account;
+    RecnWindow *recnData = data;
+    Account *account;
 
-  {
-    const char *message = _("Do you want to postpone this reconciliation "
-                            "and finish it later?");
-    if (!gnc_verify_dialog (recnData->window, FALSE, "%s", message))
-      return;
-  }
+    {
+        const char *message = _("Do you want to postpone this reconciliation "
+                                "and finish it later?");
+        if (!gnc_verify_dialog (recnData->window, FALSE, "%s", message))
+            return;
+    }
 
-  gnc_suspend_gui_refresh ();
+    gnc_suspend_gui_refresh ();
 
-  recnData->delete_refresh = TRUE;
+    recnData->delete_refresh = TRUE;
 
-  gnc_reconcile_list_postpone (GNC_RECONCILE_LIST(recnData->credit));
-  gnc_reconcile_list_postpone (GNC_RECONCILE_LIST(recnData->debit));
+    gnc_reconcile_list_postpone (GNC_RECONCILE_LIST(recnData->credit));
+    gnc_reconcile_list_postpone (GNC_RECONCILE_LIST(recnData->debit));
 
-  account = recn_get_account (recnData);
+    account = recn_get_account (recnData);
 
-  xaccAccountSetReconcilePostponeDate (account, recnData->statement_date);
-  xaccAccountSetReconcilePostponeBalance (account, recnData->new_ending);
+    xaccAccountSetReconcilePostponeDate (account, recnData->statement_date);
+    xaccAccountSetReconcilePostponeBalance (account, recnData->new_ending);
 
-  gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
+    gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
 }
 
 static void
 recnCancelCB (GtkAction *action, gpointer data)
 {
-  RecnWindow *recnData = data;
-  recn_cancel(recnData);
+    RecnWindow *recnData = data;
+    recn_cancel(recnData);
 }
 
 /** An array of all of the actions provided by the main window code.
@@ -2078,65 +2101,91 @@
  *  them. */
 static GtkActionEntry recnWindow_actions [] =
 {
-	/* Toplevel */
+    /* Toplevel */
 
-	{ "ReconcileMenuAction",   NULL, N_("_Reconcile"), NULL, NULL, NULL, },
-	{ "AccountMenuAction",     NULL, N_("_Account"), NULL, NULL, NULL, },
-	{ "TransactionMenuAction", NULL, N_("_Transaction"), NULL, NULL, NULL, },
-	{ "HelpMenuAction",        NULL, N_("_Help"), NULL, NULL, NULL, },
+    { "ReconcileMenuAction",   NULL, N_("_Reconcile"), NULL, NULL, NULL, },
+    { "AccountMenuAction",     NULL, N_("_Account"), NULL, NULL, NULL, },
+    { "TransactionMenuAction", NULL, N_("_Transaction"), NULL, NULL, NULL, },
+    { "HelpMenuAction",        NULL, N_("_Help"), NULL, NULL, NULL, },
 
-	/* Reconcile menu */
+    /* Reconcile menu */
 
-	{ "RecnChangeInfoAction", NULL, N_("_Reconcile Information..."),  NULL,
-	  N_("Change the reconcile information "
-	     "including statement date and ending balance."),
-	  G_CALLBACK (gnc_ui_reconcile_window_change_cb) },
-	{ "RecnFinishAction", GTK_STOCK_YES, N_("_Finish"), "<control>f",
-	  N_("Finish the reconciliation of this account"),
-	  G_CALLBACK(recnFinishCB)},
-	{ "RecnPostponeAction", GTK_STOCK_GO_BACK, N_("_Postpone"), "<control>p",
-	  N_("Postpone the reconciliation of this account"),
-	  G_CALLBACK(recnPostponeCB)},
-	{ "RecnCancelAction", GTK_STOCK_CANCEL, N_("_Cancel"), NULL,
-	  N_("Cancel the reconciliation of this account"),
-	  G_CALLBACK(recnCancelCB)},
+    {
+        "RecnChangeInfoAction", NULL, N_("_Reconcile Information..."),  NULL,
+        N_("Change the reconcile information "
+        "including statement date and ending balance."),
+        G_CALLBACK (gnc_ui_reconcile_window_change_cb)
+    },
+    {
+        "RecnFinishAction", GTK_STOCK_YES, N_("_Finish"), "<control>f",
+        N_("Finish the reconciliation of this account"),
+        G_CALLBACK(recnFinishCB)
+    },
+    {
+        "RecnPostponeAction", GTK_STOCK_GO_BACK, N_("_Postpone"), "<control>p",
+        N_("Postpone the reconciliation of this account"),
+        G_CALLBACK(recnPostponeCB)
+    },
+    {
+        "RecnCancelAction", GTK_STOCK_CANCEL, N_("_Cancel"), NULL,
+        N_("Cancel the reconciliation of this account"),
+        G_CALLBACK(recnCancelCB)
+    },
 
-	/* Account menu */
+    /* Account menu */
 
-	{ "AccountOpenAccountAction", GTK_STOCK_JUMP_TO, N_("_Open Account"), NULL,
-	  N_("Open the account"),
-	  G_CALLBACK(gnc_recn_open_cb)},
-	{ "AccountEditAccountAction", NULL, N_("_Edit Account"), NULL,
-	  N_("Edit the main account for this register"),
-	  G_CALLBACK(gnc_recn_edit_account_cb)},
-	{ "AccountTransferAction", NULL, N_("_Transfer..."), NULL,
-	  N_("Transfer funds from one account to another"),
-	  G_CALLBACK(gnc_recn_xfer_cb)},
-	{ "AccountCheckRepairAction", NULL, N_("_Check & Repair"), NULL,
-	  N_("Check for and repair unbalanced transactions and orphan splits "
-	     "in this account"),
-	  G_CALLBACK(gnc_recn_scrub_cb)},
+    {
+        "AccountOpenAccountAction", GTK_STOCK_JUMP_TO, N_("_Open Account"), NULL,
+        N_("Open the account"),
+        G_CALLBACK(gnc_recn_open_cb)
+    },
+    {
+        "AccountEditAccountAction", NULL, N_("_Edit Account"), NULL,
+        N_("Edit the main account for this register"),
+        G_CALLBACK(gnc_recn_edit_account_cb)
+    },
+    {
+        "AccountTransferAction", NULL, N_("_Transfer..."), NULL,
+        N_("Transfer funds from one account to another"),
+        G_CALLBACK(gnc_recn_xfer_cb)
+    },
+    {
+        "AccountCheckRepairAction", NULL, N_("_Check & Repair"), NULL,
+        N_("Check for and repair unbalanced transactions and orphan splits "
+        "in this account"),
+        G_CALLBACK(gnc_recn_scrub_cb)
+    },
 
-	/* Transaction menu */
+    /* Transaction menu */
 
-	{ "TransNewAction", GTK_STOCK_NEW, N_("_New"),  "<control>n",
-	  N_("Add a new transaction to the account"),
-	  G_CALLBACK(gnc_ui_reconcile_window_new_cb)},
-  {"TransBalanceAction", GTK_STOCK_EXECUTE, N_("_Balance"), "<control>b",
-	  N_("Add a new balancing entry to the account"),
-	  G_CALLBACK(gnc_ui_reconcile_window_balance_cb)},
-	{ "TransEditAction", GTK_STOCK_PROPERTIES, N_("_Edit"),  "<control>e",
-	  N_("Edit the current transaction"),
-	  G_CALLBACK(gnc_ui_reconcile_window_edit_cb)},
-	{ "TransDeleteAction", GTK_STOCK_DELETE, N_("_Delete"),  "<control>d",
-	  N_("Delete the selected transaction"),
-	  G_CALLBACK(gnc_ui_reconcile_window_delete_cb)},
+    {
+        "TransNewAction", GTK_STOCK_NEW, N_("_New"),  "<control>n",
+        N_("Add a new transaction to the account"),
+        G_CALLBACK(gnc_ui_reconcile_window_new_cb)
+    },
+    {
+        "TransBalanceAction", GTK_STOCK_EXECUTE, N_("_Balance"), "<control>b",
+        N_("Add a new balancing entry to the account"),
+        G_CALLBACK(gnc_ui_reconcile_window_balance_cb)
+    },
+    {
+        "TransEditAction", GTK_STOCK_PROPERTIES, N_("_Edit"),  "<control>e",
+        N_("Edit the current transaction"),
+        G_CALLBACK(gnc_ui_reconcile_window_edit_cb)
+    },
+    {
+        "TransDeleteAction", GTK_STOCK_DELETE, N_("_Delete"),  "<control>d",
+        N_("Delete the selected transaction"),
+        G_CALLBACK(gnc_ui_reconcile_window_delete_cb)
+    },
 
-	/* Help menu */
+    /* Help menu */
 
-	{ "HelpHelpAction", NULL, N_("_Help"), NULL,
-	  N_("Open the GnuCash help window"),
-	  G_CALLBACK(gnc_ui_reconcile_window_help_cb)},
+    {
+        "HelpHelpAction", NULL, N_("_Help"), NULL,
+        N_("Open the GnuCash help window"),
+        G_CALLBACK(gnc_ui_reconcile_window_help_cb)
+    },
 };
 
 /** The number of actions provided by the main window. */



More information about the gnucash-changes mailing list