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
1 changed files with 3 additions and 2 deletions

View File

@ -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;
} }