2002-11-15 Joshua Sled <jsled@asynchronous.org>

* src/gnome/window-register.c (gnc_register_delete_cb): Change the
	order of window deletion to not cause a crash.

	* src/gnome/window-register.c (regWindowSimple),
	(regWindowAccGroup): Only return the GNCSplitReg, not the whole
	regData.  Fixes a bunch of existing and potential crashes.

	* src/gnome/window-main.c (gnc_main_window_gl_cb):
	* src/gnome/window-acct-tree.c
	(gnc_acct_tree_window_toolbar_open_cb)
	(gnc_acct_tree_window_menu_open_subs_cb)
	(gnc_acct_tree_window_menu_open_cb)
	(gnc_acct_tree_window_activate_cb):
	* src/gnome/top-level.c (gnc_html_register_url_cb):
	Modify to not necessarily expect a RegWindow for creation of a
	ledger view.  Fixes a bunch of existing and potential crashes.

	* src/gnome/gnc-split-reg.c (gnc_split_reg_delete_cb): Removed;
	dead.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7484 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled
2002-11-15 08:26:43 +00:00
parent 3f77e88597
commit d4f97ce2d9
8 changed files with 88 additions and 53 deletions

View File

@@ -52,6 +52,7 @@
#include "gnc-gnome-utils.h"
#include "gnc-gpg.h"
#include "gnc-report.h"
#include "gnc-split-reg.h"
#include "gnc-ui.h"
#include "gnucash-color.h"
#include "gnucash-sheet.h"
@@ -135,7 +136,7 @@ static gboolean
gnc_html_register_url_cb (const char *location, const char *label,
gboolean new_window, GNCURLResult *result)
{
RegWindow * reg = NULL;
GNCSplitReg * gsr = NULL;
Split * split = NULL;
Account * account;
Transaction * trans;
@@ -152,8 +153,8 @@ gnc_html_register_url_cb (const char *location, const char *label,
account = xaccGetAccountFromFullName (gnc_get_current_group (),
location + 8,
gnc_get_account_separator ());
reg = regWindowSimple (account);
gnc_register_raise (reg);
gsr = regWindowSimple (account);
gnc_split_reg_raise( gsr );
}
/* href="gnc-register:guid=12345678901234567890123456789012" */
else if (strncmp ("guid=", location, 5) == 0)
@@ -177,7 +178,7 @@ gnc_html_register_url_cb (const char *location, const char *label,
else if (!safe_strcmp (id_type, GNC_ID_ACCOUNT))
{
account = xaccAccountLookup (&guid, gnc_get_current_book ());
reg = regWindowSimple (account);
gsr = regWindowSimple( account );
}
else if (!safe_strcmp (id_type, GNC_ID_TRANS))
{
@@ -198,7 +199,7 @@ gnc_html_register_url_cb (const char *location, const char *label,
return FALSE;
}
reg = regWindowSimple (xaccSplitGetAccount (split));
gsr = regWindowSimple( xaccSplitGetAccount(split) );
}
else if (!safe_strcmp (id_type, GNC_ID_SPLIT))
{
@@ -210,7 +211,7 @@ gnc_html_register_url_cb (const char *location, const char *label,
return FALSE;
}
reg = regWindowSimple (xaccSplitGetAccount (split));
gsr = regWindowSimple( xaccSplitGetAccount(split) );
}
else
{
@@ -219,9 +220,9 @@ gnc_html_register_url_cb (const char *location, const char *label,
return FALSE;
}
gnc_register_raise(reg);
gnc_split_reg_raise(gsr);
if (split)
gnc_register_jump_to_split (reg, split);
gnc_split_reg_jump_to_split( gsr, split );
}
else
{