Fix bug when the negate sign is before a space (#345)
* Ignore None characters while parsing the clipboard * reformat
This commit is contained in:
parent
8e1a14793a
commit
9728ccf119
@ -790,6 +790,12 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
|
|||||||
|
|
||||||
NumbersAndOperatorsEnum mappedNumOp = MapCharacterToButtonId(*it, canSendNegate);
|
NumbersAndOperatorsEnum mappedNumOp = MapCharacterToButtonId(*it, canSendNegate);
|
||||||
|
|
||||||
|
if (mappedNumOp == NumbersAndOperatorsEnum::None)
|
||||||
|
{
|
||||||
|
++it;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isFirstLegalChar || isPreviousOperator)
|
if (isFirstLegalChar || isPreviousOperator)
|
||||||
{
|
{
|
||||||
isFirstLegalChar = false;
|
isFirstLegalChar = false;
|
||||||
@ -811,8 +817,6 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mappedNumOp != NumbersAndOperatorsEnum::None)
|
|
||||||
{
|
|
||||||
switch (mappedNumOp)
|
switch (mappedNumOp)
|
||||||
{
|
{
|
||||||
// Opening parenthesis starts a new expression and pushes negation state onto the stack
|
// 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-...)
|
// Handle exponent and exponent sign (...e+... or ...e-...)
|
||||||
if (mappedNumOp == NumbersAndOperatorsEnum::Exp)
|
if (mappedNumOp == NumbersAndOperatorsEnum::Exp)
|
||||||
|
Loading…
Reference in New Issue
Block a user