[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Input-sequence editor testing
From: |
Vaclav Slavik |
Subject: |
Re: [lmi] Input-sequence editor testing |
Date: |
Sat, 10 Jul 2010 18:58:59 +0200 |
On Fri, 2010-07-09 at 18:57 +0200, Vaclav Slavik wrote:
> The patch below fixes this
...and uncovers a bug when inserting a new row that isn't the last one.
This fixes the assert:
diff --git a/input_sequence_entry.cpp b/input_sequence_entry.cpp
index db209a8..0d8020d 100755
--- a/input_sequence_entry.cpp
+++ b/input_sequence_entry.cpp
@@ -113,6 +113,19 @@ void DurationModeChoice::allow_maturity(bool allow)
}
else
{
+ if(e_maturity == value())
+ {
+ // "until maturity" is selected, but it's no longer allowed.
+ // Replace it with arbitrary other value temporarily; we pick
+ // e_retirement, because it (like e_maturity) doesn't have numeric
+ // argument.
+ //
+ // This is done only to preserve the invariant that
+ // DurationModeChoice always has a value selected; if this happens,
+ // it will be replaced by a more appropriate choice by other UI
+ // code (see UponAddRow).
+ value(e_retirement);
+ }
Delete(duration_mode_choices - 1);
}
}
Regards,
Vaclav