Bug #435642: Correct r17853 about editing results of a find.

1. create a transaction that has two or more splits in the same account
2. open a register on that account that is in either "Basic Ledger" or
   "Auto-Split Ledger" mode
3. change some transaction other than the one with multiple splits in this
   register
4. click on the second or succeeding occurrence of the transaction with
   multiple splits in this register

This will put the cursor on the first occurrence of the transaction instead of
the one you clicked on.

Patch by Mike Alexander.
BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17920 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler
2009-02-15 17:23:08 +00:00
parent d2dc3a4915
commit 4daacc16c8
+25 -3
View File
@@ -222,22 +222,41 @@ gnc_split_register_find_split (SplitRegister *reg,
if (t == trans)
{
/* A register entry for the correct transaction. */
found_trans = TRUE;
if (cursor_class == CURSOR_CLASS_TRANS)
{
found_trans_split = TRUE;
if (find_class == CURSOR_CLASS_TRANS)
/* This row is the transaction split for this transaction. */
if (s == trans_split)
/* It's the copy of the transaction that we want. */
found_trans_split = TRUE;
else
found_trans_split = FALSE;
if (find_class == CURSOR_CLASS_TRANS &&
(s == split || reg->style == REG_STYLE_JOURNAL))
{
/* We're looking for a transaction split and this is the split we're looking for
or there is only one entry for this transaction in this register (since it's
a journal style register) so we must return the only transaction split there is. */
if (vcell_loc != NULL)
*vcell_loc = vc_loc;
return TRUE;
}
}
}
else
{
/* Not the correct transaction. We shouldn't get here if this is true, but just
to be safe reset it. */
found_trans = FALSE;
}
if (found_trans && (s == split) && s)
{
/* We're on the right transaction, but perhaps not the copy of it we want, and
this is the correct split, return it if we don't find anything better. */
if (vcell_loc != NULL)
*vcell_loc = vc_loc;
@@ -246,6 +265,9 @@ gnc_split_register_find_split (SplitRegister *reg,
if (found_trans_split && (s == split))
{
/* We're on the right copy of the right transaction, and this is the split we
want, return it (it should be the right class since if we wanted a transaction
split we would have returned it above. */
if (vcell_loc != NULL)
*vcell_loc = vc_loc;