mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Ignore None characters while parsing the clipboard
This commit is contained in:
parent
21e15c426e
commit
51bf7e5839
1 changed files with 87 additions and 84 deletions
|
@ -796,6 +796,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;
|
||||||
|
@ -817,8 +823,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
|
||||||
|
@ -887,7 +891,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…
Add table
Add a link
Reference in a new issue