gnucash maint: Bug 688965 - Page Up, Page Down keys cause GnuCash to hang
Geert Janssens
gjanssens at code.gnucash.org
Fri May 9 05:39:29 EDT 2014
Updated via https://github.com/Gnucash/gnucash/commit/c70dde75 (commit)
from https://github.com/Gnucash/gnucash/commit/8314d960 (commit)
commit c70dde75a5354f416d5ec1727ee4b89bff4158ec
Author: Geert Janssens <janssens-geert at telenet.be>
Date: Fri May 9 11:36:46 2014 +0200
Bug 688965 - Page Up, Page Down keys cause GnuCash to hang
diff --git a/src/register/register-core/table-allgui.c b/src/register/register-core/table-allgui.c
index 3163a66..3a9041f 100644
--- a/src/register/register-core/table-allgui.c
+++ b/src/register/register-core/table-allgui.c
@@ -1762,6 +1762,8 @@ gnc_table_traverse_update(Table *table,
{
VirtualLocation new_loc = *dest_loc;
int increment;
+ int col_offset = 0;
+ gboolean second_traversal = FALSE;
/* Keep going in the specified direction until we find a valid
* row to land on, or we hit the end of the table. At the end,
@@ -1781,8 +1783,25 @@ gnc_table_traverse_update(Table *table,
if (!gnc_table_move_vertical_position (table, &new_loc, increment))
{
+ /* Special case: if there is no valid cell at all in the column
+ * we are scanning, (both up and down directions didn't work)
+ * attempt to do the same in the next column.
+ * Hack alert: there is no check to see if there really is a
+ * valid next column. However this situation so far only happens
+ * after a pagedown/pageup key event in the SX transaction editor
+ * which always tests the first column to start (which has no
+ * editable cells) and in that situation there is a valid next column.
+ */
+ if (!second_traversal)
+ second_traversal = TRUE;
+ else
+ {
+ second_traversal = FALSE;
+ col_offset++;
+ }
increment *= -1;
new_loc = *dest_loc;
+ new_loc.phys_col_offset = new_loc.phys_col_offset + col_offset;
}
}
Summary of changes:
src/register/register-core/table-allgui.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
More information about the gnucash-changes
mailing list