mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 15:37:30 -06:00
FIX: check int value invalid in Choise Field
Change-Id: I75cbe55b36dd75480903b6991f234c02ad8de5cc
This commit is contained in:
parent
09e1c0a1af
commit
62da568e0b
1 changed files with 13 additions and 3 deletions
|
@ -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*/)
|
||||
{
|
||||
switch (m_opt.type) {
|
||||
case coInt:
|
||||
m_value = wxAtoi(str);
|
||||
break;
|
||||
case coInt: {
|
||||
long val = 0;
|
||||
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 coPercents:
|
||||
case coFloats:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue