Default to zero when the initial value for a NumValidator is ""

Originally committed to SVN as r5922.
This commit is contained in:
Thomas Goyne 2011-11-28 22:16:33 +00:00
parent ca91097b8f
commit 303432a671

View file

@ -48,10 +48,11 @@ NumValidator::NumValidator(wxString val, bool isfloat, bool issigned)
, isSigned(issigned)
{
if (isFloat) {
val.ToDouble(&fValue);
if (!val.ToDouble(&fValue))
fValue = 0;
}
else {
long tLong;
long tLong = 0;
val.ToLong(&tLong);
iValue = tLong;
}