mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[gnc-plugin-page-register.cpp] rewrite function to avoid goto
reorder logic to avoid using goto
This commit is contained in:
parent
8090f1c5b0
commit
46aa584ab9
@ -3898,12 +3898,14 @@ gnc_plugin_page_register_cmd_reverse_transaction (GSimpleAction *simple,
|
||||
{
|
||||
const char *rev = _("A reversing entry has already been created for this transaction.");
|
||||
const char *jump = _("Jump to the transaction?");
|
||||
if (gnc_verify_dialog (GTK_WINDOW (window), TRUE, "%s\n\n%s", rev, jump))
|
||||
goto jump_to_trans;
|
||||
else
|
||||
if (!gnc_verify_dialog (GTK_WINDOW (window), TRUE, "%s\n\n%s", rev, jump))
|
||||
{
|
||||
LEAVE ("reverse cancelled");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!gnc_dup_time64_dialog (window, _("Reverse Transaction"),
|
||||
_("New Transaction Information"), &date))
|
||||
{
|
||||
@ -3919,8 +3921,8 @@ gnc_plugin_page_register_cmd_reverse_transaction (GSimpleAction *simple,
|
||||
xaccTransSetDateEnteredSecs (new_trans, gnc_time (NULL));
|
||||
|
||||
gnc_resume_gui_refresh();
|
||||
}
|
||||
|
||||
jump_to_trans:
|
||||
/* Now jump to new trans */
|
||||
gsr = gnc_plugin_page_register_get_gsr (GNC_PLUGIN_PAGE (page));
|
||||
split = xaccTransFindSplitByAccount(new_trans, account);
|
||||
|
Loading…
Reference in New Issue
Block a user