r22717 - gnucash/trunk/src - Remove circular dependency introduced in r22681

J. Alex Aycinena alex.aycinena at code.gnucash.org
Sat Jan 19 18:29:36 EST 2013


Author: alex.aycinena
Date: 2013-01-19 18:29:35 -0500 (Sat, 19 Jan 2013)
New Revision: 22717
Trac: http://svn.gnucash.org/trac/changeset/22717

Modified:
   gnucash/trunk/src/gnome/gnc-plugin-page-register.c
   gnucash/trunk/src/gnome/gnc-plugin-page-register.h
   gnucash/trunk/src/register/ledger-core/split-register.c
Log:
Remove circular dependency introduced in r22681

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2013-01-19 21:00:51 UTC (rev 22716)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2013-01-19 23:29:35 UTC (rev 22717)
@@ -75,7 +75,6 @@
 #include "window-reconcile.h"
 #include "window-autoclear.h"
 #include "window-report.h"
-#include "split-register-p.h"
 #include "engine-helpers.h"
 #include "qofbookslots.h"
 
@@ -3642,43 +3641,6 @@
     gnc_plugin_page_register_ui_update(NULL, page);
 }
 
-static gboolean
-find_reg_by_acct (gpointer find_data, gpointer user_data)
-{
-    GncPluginPageRegisterPrivate *priv;
-    SplitRegister *reg;
-    Account *account = find_data;
-    GncPluginPageRegister *page = user_data;
-
-    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-    reg = gnc_ledger_display_get_split_register(priv->ledger);
-
-    return (xaccAccountEqual(account,
-                             gnc_split_register_get_default_account (reg),
-                             TRUE));
-}
-
-SplitRegister *
-gnc_find_register_by_account (Account *account)
-{
-    GncPluginPageRegister *page;
-
-    if (!account) return NULL;
-
-    page = gnc_find_first_gui_component (GNC_PLUGIN_PAGE_REGISTER_NAME,
-                                            find_reg_by_acct,
-                                            (gpointer) account);
-    if (page)
-    {
-        GncPluginPageRegisterPrivate *priv;
-        SplitRegister *reg;
-
-        priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
-        return reg = gnc_ledger_display_get_split_register(priv->ledger);
-    }
-    else return NULL;
-}
-
 static void
 gnc_plugin_page_register_close_cb (gpointer user_data)
 {

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register.h	2013-01-19 21:00:51 UTC (rev 22716)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register.h	2013-01-19 23:29:35 UTC (rev 22717)
@@ -66,17 +66,6 @@
 
 /* function prototypes */
 
-/* gnc_find_register_by_account
- *   Search for an open register for the specified account.
- *
- * @param account The pointer to the account to search open register pages for;
- *              must be non-NULL
- *
- * @return The pointer to the open register of the account, or NULL if none found
- */
-SplitRegister *
-gnc_find_register_by_account (Account *account);
-
 /** Retrieve the type number for the plugin page.
  *
  *  @return The type number.

Modified: gnucash/trunk/src/register/ledger-core/split-register.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register.c	2013-01-19 21:00:51 UTC (rev 22716)
+++ gnucash/trunk/src/register/ledger-core/split-register.c	2013-01-19 23:29:35 UTC (rev 22717)
@@ -33,7 +33,6 @@
 #include "datecell.h"
 #include "dialog-utils.h"
 #include "gnc-component-manager.h"
-#include "gnome/gnc-plugin-page-register.h"
 #include "gnc-gconf-utils.h"
 #include "split-register-p.h"
 #include "gnc-ledger-display.h"
@@ -547,25 +546,7 @@
             }
             else
             {
-                SplitRegister *oth_reg = gnc_find_register_by_account(account);
-
-                /* If another register is open for split acct, use that register
-                 * to set last number */
-                if (oth_reg)
-                {
-                    NumCell *num_cell;
-
-                    num_cell = (NumCell *) gnc_table_layout_get_cell
-                                                        (oth_reg->table->layout,
-                                                            NUM_CELL);
-                    if (gnc_num_cell_set_last_num (num_cell, out_num))
-                        gnc_split_register_set_last_num (oth_reg, out_num);
-                }
-                /* else just update acct */
-                else
-                {
-                    xaccAccountSetLastNum (account, out_num);
-                }
+                xaccAccountSetLastNum (account, out_num);
             }
         }
 



More information about the gnucash-changes mailing list