Updating code to append a wchar_t instead of const wchar_t (#778)
This commit is contained in:
committed by
Matt Cooley
parent
4c81ed83c7
commit
01299a92cd
@@ -179,7 +179,7 @@ bool CalcInput::TryAddDecimalPt()
|
||||
|
||||
if (m_base.IsEmpty())
|
||||
{
|
||||
m_base.value += L"0"; // Add a leading zero
|
||||
m_base.value += L'0'; // Add a leading zero
|
||||
}
|
||||
|
||||
m_decPtIndex = m_base.value.size();
|
||||
|
@@ -640,9 +640,9 @@ namespace CalculationManager
|
||||
if (pHistory)
|
||||
{
|
||||
pHistory->ClearHistory();
|
||||
for (unsigned int i = 0; i < history.size(); ++i)
|
||||
for (auto const& historyItem : history)
|
||||
{
|
||||
pHistory->AddItem(history[i]);
|
||||
pHistory->AddItem(historyItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -275,14 +275,12 @@ const wstring& COpndCommand::GetToken(wchar_t decimalSymbol)
|
||||
|
||||
wstring COpndCommand::GetString(uint32_t radix, int32_t precision)
|
||||
{
|
||||
wstring result{};
|
||||
|
||||
if (m_fInitialized)
|
||||
{
|
||||
result = m_value.ToString(radix, eNUMOBJ_FMT::FMT_FLOAT, precision);
|
||||
return m_value.ToString(radix, eNUMOBJ_FMT::FMT_FLOAT, precision);
|
||||
}
|
||||
|
||||
return result;
|
||||
return wstring{};
|
||||
}
|
||||
|
||||
void COpndCommand::Accept(_In_ ISerializeCommandVisitor& commandVisitor)
|
||||
|
@@ -16,8 +16,7 @@ namespace CalcManager::NumberFormattingUtils
|
||||
return;
|
||||
}
|
||||
|
||||
wstring::iterator iter;
|
||||
for (iter = number.end() - 1;; iter--)
|
||||
for (auto iter = number.end() - 1;; iter--)
|
||||
{
|
||||
if (*iter != L'0')
|
||||
{
|
||||
@@ -25,9 +24,9 @@ namespace CalcManager::NumberFormattingUtils
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (*(number.end() - 1) == L'.')
|
||||
if (number.back() == L'.')
|
||||
{
|
||||
number.erase(number.end() - 1, number.end());
|
||||
number.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -401,43 +401,43 @@ void UnitConverter::SendCommand(Command command)
|
||||
switch (command)
|
||||
{
|
||||
case Command::Zero:
|
||||
m_currentDisplay += L"0";
|
||||
m_currentDisplay += L'0';
|
||||
break;
|
||||
|
||||
case Command::One:
|
||||
m_currentDisplay += L"1";
|
||||
m_currentDisplay += L'1';
|
||||
break;
|
||||
|
||||
case Command::Two:
|
||||
m_currentDisplay += L"2";
|
||||
m_currentDisplay += L'2';
|
||||
break;
|
||||
|
||||
case Command::Three:
|
||||
m_currentDisplay += L"3";
|
||||
m_currentDisplay += L'3';
|
||||
break;
|
||||
|
||||
case Command::Four:
|
||||
m_currentDisplay += L"4";
|
||||
m_currentDisplay += L'4';
|
||||
break;
|
||||
|
||||
case Command::Five:
|
||||
m_currentDisplay += L"5";
|
||||
m_currentDisplay += L'5';
|
||||
break;
|
||||
|
||||
case Command::Six:
|
||||
m_currentDisplay += L"6";
|
||||
m_currentDisplay += L'6';
|
||||
break;
|
||||
|
||||
case Command::Seven:
|
||||
m_currentDisplay += L"7";
|
||||
m_currentDisplay += L'7';
|
||||
break;
|
||||
|
||||
case Command::Eight:
|
||||
m_currentDisplay += L"8";
|
||||
m_currentDisplay += L'8';
|
||||
break;
|
||||
|
||||
case Command::Nine:
|
||||
m_currentDisplay += L"9";
|
||||
m_currentDisplay += L'9';
|
||||
break;
|
||||
|
||||
case Command::Decimal:
|
||||
@@ -445,7 +445,7 @@ void UnitConverter::SendCommand(Command command)
|
||||
clearBack = false;
|
||||
if (!m_currentHasDecimal)
|
||||
{
|
||||
m_currentDisplay += L".";
|
||||
m_currentDisplay += L'.';
|
||||
m_currentHasDecimal = true;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user