Default to zero when the initial value for a NumValidator is ""
Originally committed to SVN as r5922.
This commit is contained in:
parent
ca91097b8f
commit
303432a671
1 changed files with 3 additions and 2 deletions
|
@ -48,10 +48,11 @@ NumValidator::NumValidator(wxString val, bool isfloat, bool issigned)
|
||||||
, isSigned(issigned)
|
, isSigned(issigned)
|
||||||
{
|
{
|
||||||
if (isFloat) {
|
if (isFloat) {
|
||||||
val.ToDouble(&fValue);
|
if (!val.ToDouble(&fValue))
|
||||||
|
fValue = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
long tLong;
|
long tLong = 0;
|
||||||
val.ToLong(&tLong);
|
val.ToLong(&tLong);
|
||||||
iValue = tLong;
|
iValue = tLong;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue