mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
More register cleanup.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5186 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
9e509b4484
commit
e52d06786d
@ -1746,6 +1746,28 @@ gnc_register_record (RegWindow *regData)
|
||||
xaccSRRedrawReg (reg);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gnc_register_match_trans_row (VirtualLocation virt_loc,
|
||||
gpointer user_data)
|
||||
{
|
||||
RegWindow *regData = user_data;
|
||||
CursorClass cursor_class;
|
||||
SplitRegister *sr;
|
||||
|
||||
sr = xaccLedgerDisplayGetSR (regData->ledger);
|
||||
cursor_class = xaccSplitRegisterGetCursorClass (sr, virt_loc.vcell_loc);
|
||||
|
||||
return (cursor_class == CURSOR_CLASS_TRANS);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_register_goto_next_trans_row (RegWindow *regData)
|
||||
{
|
||||
gnucash_register_goto_next_matching_row (regData->reg,
|
||||
gnc_register_match_trans_row,
|
||||
regData);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_register_enter (RegWindow *regData, gboolean next_transaction)
|
||||
{
|
||||
@ -1791,7 +1813,7 @@ gnc_register_enter (RegWindow *regData, gboolean next_transaction)
|
||||
if (goto_blank)
|
||||
gnc_register_jump_to_blank (regData);
|
||||
else if (next_transaction)
|
||||
gnucash_register_goto_next_trans_row (regData->reg);
|
||||
gnc_register_goto_next_trans_row (regData);
|
||||
else
|
||||
gnucash_register_goto_next_virt_row (regData->reg);
|
||||
}
|
||||
|
@ -40,8 +40,6 @@
|
||||
#include "gnucash-item-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
|
||||
#include "splitreg.h"
|
||||
|
||||
#define DEFAULT_REGISTER_HEIGHT 400
|
||||
#define DEFAULT_REGISTER_WIDTH 630
|
||||
|
||||
@ -1829,17 +1827,19 @@ gnucash_register_goto_next_virt_row (GnucashRegister *reg)
|
||||
}
|
||||
|
||||
void
|
||||
gnucash_register_goto_next_trans_row (GnucashRegister *reg)
|
||||
gnucash_register_goto_next_matching_row (GnucashRegister *reg,
|
||||
VirtualLocationMatchFunc match,
|
||||
gpointer user_data)
|
||||
{
|
||||
GnucashSheet *sheet;
|
||||
SheetBlockStyle *style;
|
||||
VirtualLocation virt_loc;
|
||||
CursorClass cursor_class;
|
||||
|
||||
g_return_if_fail (reg != NULL);
|
||||
g_return_if_fail (GNUCASH_IS_REGISTER(reg));
|
||||
g_return_if_fail (match != NULL);
|
||||
|
||||
sheet = GNUCASH_SHEET(reg->sheet);
|
||||
sheet = GNUCASH_SHEET (reg->sheet);
|
||||
|
||||
gnucash_cursor_get_virt (GNUCASH_CURSOR(sheet->cursor), &virt_loc);
|
||||
|
||||
@ -1855,13 +1855,7 @@ gnucash_register_goto_next_trans_row (GnucashRegister *reg)
|
||||
style = gnucash_sheet_get_style (sheet, virt_loc.vcell_loc);
|
||||
if (!style || !style->cursor)
|
||||
return;
|
||||
|
||||
cursor_class = xaccCursorNameToClass
|
||||
(style->cursor->cursor_name);
|
||||
} while (cursor_class == CURSOR_CLASS_SPLIT);
|
||||
|
||||
if (cursor_class != CURSOR_CLASS_TRANS)
|
||||
return;
|
||||
} while (!match (virt_loc, user_data));
|
||||
|
||||
virt_loc.phys_row_offset = 0;
|
||||
virt_loc.phys_col_offset = 0;
|
||||
|
@ -187,7 +187,12 @@ void gnucash_register_goto_virt_loc (GnucashRegister *reg,
|
||||
|
||||
void gnucash_register_goto_next_virt_row (GnucashRegister *reg);
|
||||
|
||||
void gnucash_register_goto_next_trans_row (GnucashRegister *reg);
|
||||
typedef gboolean (*VirtualLocationMatchFunc) (VirtualLocation virt_loc,
|
||||
gpointer user_data);
|
||||
|
||||
void gnucash_register_goto_next_matching_row (GnucashRegister *reg,
|
||||
VirtualLocationMatchFunc match,
|
||||
gpointer user_data);
|
||||
|
||||
void gnucash_register_attach_popup(GnucashRegister *reg, GtkWidget *popup,
|
||||
gpointer data);
|
||||
|
Loading…
Reference in New Issue
Block a user