mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
don't allow to record on history list if I press '=' button before I press the operator button #1748
This commit is contained in:
parent
c5501294a1
commit
a2bac27bcd
1 changed files with 26 additions and 3 deletions
|
@ -330,10 +330,33 @@ void CHistoryCollector::AddUnaryOpToHistory(int nOpCode, bool fInv, AngleType an
|
||||||
// history of equations
|
// history of equations
|
||||||
void CHistoryCollector::CompleteHistoryLine(wstring_view numStr)
|
void CHistoryCollector::CompleteHistoryLine(wstring_view numStr)
|
||||||
{
|
{
|
||||||
if (nullptr != m_pHistoryDisplay)
|
bool hasOperator = false;
|
||||||
|
|
||||||
|
for (auto const& token : *m_spTokens)
|
||||||
{
|
{
|
||||||
unsigned int addedItemIndex = m_pHistoryDisplay->AddToHistory(m_spTokens, m_spCommands, numStr);
|
if (token.first == L"×" || token.first == L"÷" || token.first == L"+" || token.first == L"-" || token.first == L"1/(" || token.first == L"sqr("
|
||||||
m_pCalcDisplay->OnHistoryItemAdded(addedItemIndex);
|
|| token.first == L"√(" || token.first == L"Mod" || token.first == L"fact(" || token.first == L"abs(" || token.first == L"^"
|
||||||
|
|| token.first == L"yroot" || token.first == L"log(" || token.first == L"ln(" || token.first == L"√(" || token.first == L"fact("
|
||||||
|
|| token.first == L"abs(" || token.first == L"10^(" || token.first == L"log(" || token.first == L"ln(" || token.first == L"cube("
|
||||||
|
|| token.first == L"cuberoot(" || token.first == L"yroot" || token.first == L"^(" || token.first == L"log base" || token.first == L"e^("
|
||||||
|
|| token.first == L"sin₀(" || token.first == L"cos₀(" || token.first == L"tan₀(" || token.first == L"sec₀(" || token.first == L"csc₀("
|
||||||
|
|| token.first == L"sin₀⁻¹(" || token.first == L"cos₀⁻¹(" || token.first == L"tan₀⁻¹( " || token.first == L"sec₀⁻¹(" || token.first == L"csc₀⁻¹("
|
||||||
|
|| token.first == L"cot₀⁻¹(" || token.first == L"sinh(" || token.first == L"cosh(" || token.first == L"tanh(" || token.first == L"sech("
|
||||||
|
|| token.first == L"csch(" || token.first == L"coth(" || token.first == L"sinh⁻¹(" || token.first == L"cosh⁻¹(" || token.first == L"tanh⁻¹("
|
||||||
|
|| token.first == L"sech⁻¹(" || token.first == L"csch⁻¹(" || token.first == L"coth⁻¹(" || token.first == L"floor(" || token.first == L"ceil("
|
||||||
|
|| token.first == L"dms(" || token.first == L"degrees(")
|
||||||
|
{
|
||||||
|
hasOperator = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasOperator)
|
||||||
|
{
|
||||||
|
if (nullptr != m_pHistoryDisplay)
|
||||||
|
{
|
||||||
|
unsigned int addedItemIndex = m_pHistoryDisplay->AddToHistory(m_spTokens, m_spCommands, numStr);
|
||||||
|
m_pCalcDisplay->OnHistoryItemAdded(addedItemIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_spTokens = nullptr;
|
m_spTokens = nullptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue