Fix bug when the negate sign is before a space (#345)

* Ignore None characters while parsing the clipboard

* reformat
This commit is contained in:
Rudy Huyn 2019-04-26 16:07:14 -07:00 committed by Pepe Rivera
parent 8e1a14793a
commit 9728ccf119

View File

@ -790,6 +790,12 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
NumbersAndOperatorsEnum mappedNumOp = MapCharacterToButtonId(*it, canSendNegate);
if (mappedNumOp == NumbersAndOperatorsEnum::None)
{
++it;
continue;
}
if (isFirstLegalChar || isPreviousOperator)
{
isFirstLegalChar = false;
@ -811,8 +817,6 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
}
}
if (mappedNumOp != NumbersAndOperatorsEnum::None)
{
switch (mappedNumOp)
{
// Opening parenthesis starts a new expression and pushes negation state onto the stack
@ -881,7 +885,6 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
}
}
}
}
// Handle exponent and exponent sign (...e+... or ...e-...)
if (mappedNumOp == NumbersAndOperatorsEnum::Exp)