mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Revert "refactor: simplified if statements"
This reverts commit 6e4d0a8b2c
.
This commit is contained in:
parent
6e4d0a8b2c
commit
9d0010bf48
1 changed files with 17 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -109,8 +109,22 @@ CategorySelectionInitializer UnitConverter::SetCurrentCategory(const Category& i
|
||||||
vector<Unit>& unitVector = m_categoryToUnits[m_currentCategory];
|
vector<Unit>& unitVector = m_categoryToUnits[m_currentCategory];
|
||||||
for (unsigned int i = 0; i < unitVector.size(); i++)
|
for (unsigned int i = 0; i < unitVector.size(); i++)
|
||||||
{
|
{
|
||||||
unitVector[i].isConversionSource = unitVector[i].id == m_fromType.id;
|
if (unitVector[i].id == m_fromType.id)
|
||||||
unitVector[i].isConversionTarget = unitVector[i].id == m_toType.id;
|
{
|
||||||
|
unitVector[i].isConversionSource = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitVector[i].isConversionSource = false;
|
||||||
|
}
|
||||||
|
if (unitVector[i].id == m_toType.id)
|
||||||
|
{
|
||||||
|
unitVector[i].isConversionTarget = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitVector[i].isConversionTarget = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_currentCategory = input;
|
m_currentCategory = input;
|
||||||
if (!m_currentCategory.supportsNegative && m_currentDisplay.front() == L'-')
|
if (!m_currentCategory.supportsNegative && m_currentDisplay.front() == L'-')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue