FIX: check int value invalid in Choise Field
Change-Id: I75cbe55b36dd75480903b6991f234c02ad8de5cc
This commit is contained in:
parent
09e1c0a1af
commit
62da568e0b
|
@ -224,9 +224,19 @@ static wxString na_value() { return _(L("N/A")); }
|
||||||
void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true*/)
|
void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true*/)
|
||||||
{
|
{
|
||||||
switch (m_opt.type) {
|
switch (m_opt.type) {
|
||||||
case coInt:
|
case coInt: {
|
||||||
m_value = wxAtoi(str);
|
long val = 0;
|
||||||
break;
|
if (!str.ToLong(&val)) {
|
||||||
|
if (!check_value) {
|
||||||
|
m_value.clear();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
show_error(m_parent, _(L("Invalid numeric.")));
|
||||||
|
set_value(int(val), true);
|
||||||
|
}
|
||||||
|
m_value = int(val);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case coPercent:
|
case coPercent:
|
||||||
case coPercents:
|
case coPercents:
|
||||||
case coFloats:
|
case coFloats:
|
||||||
|
|
Loading…
Reference in New Issue