mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Some more refactoring
This commit is contained in:
parent
2cfb2f2973
commit
874e049532
3 changed files with 44 additions and 36 deletions
|
@ -409,8 +409,11 @@ int CHistoryCollector::AddCommand(_In_ const std::shared_ptr<IExpressionCommand>
|
|||
//To Update the operands in the Expression according to the current Radix
|
||||
void CHistoryCollector::UpdateHistoryExpression(uint32_t radix, int32_t precision)
|
||||
{
|
||||
if (m_spTokens != nullptr)
|
||||
if (m_spTokens == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int size;
|
||||
IFT(m_spTokens->GetSize(&size));
|
||||
|
||||
|
@ -437,7 +440,6 @@ void CHistoryCollector::UpdateHistoryExpression(uint32_t radix, int32_t precisio
|
|||
}
|
||||
SetExpressionDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
void CHistoryCollector::SetDecimalSymbol(wchar_t decimalSymbol)
|
||||
{
|
||||
|
|
|
@ -484,7 +484,8 @@ namespace CalculationManager
|
|||
{
|
||||
m_savedCommands.push_back(MEMORY_COMMAND_TO_UNSIGNED_CHAR(MemoryCommand::MemorizeNumber));
|
||||
|
||||
if (m_currentCalculatorEngine->FInErrorState()) {
|
||||
if (m_currentCalculatorEngine->FInErrorState())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -512,7 +513,8 @@ namespace CalculationManager
|
|||
{
|
||||
SaveMemoryCommand(MemoryCommand::MemorizedNumberLoad, indexOfMemory);
|
||||
|
||||
if (m_currentCalculatorEngine->FInErrorState()) {
|
||||
if (m_currentCalculatorEngine->FInErrorState())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -530,7 +532,8 @@ namespace CalculationManager
|
|||
{
|
||||
SaveMemoryCommand(MemoryCommand::MemorizedNumberAdd, indexOfMemory);
|
||||
|
||||
if (m_currentCalculatorEngine->FInErrorState()) {
|
||||
if (m_currentCalculatorEngine->FInErrorState())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -570,7 +573,8 @@ namespace CalculationManager
|
|||
{
|
||||
SaveMemoryCommand(MemoryCommand::MemorizedNumberSubtract, indexOfMemory);
|
||||
|
||||
if (m_currentCalculatorEngine->FInErrorState()) {
|
||||
if (m_currentCalculatorEngine->FInErrorState())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -614,7 +618,8 @@ namespace CalculationManager
|
|||
/// <param name="indexOfMemory">Index of the target memory</param>
|
||||
void CalculatorManager::MemorizedNumberSelect(_In_ unsigned int indexOfMemory)
|
||||
{
|
||||
if (m_currentCalculatorEngine->FInErrorState()) {
|
||||
if (m_currentCalculatorEngine->FInErrorState())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -629,7 +634,8 @@ namespace CalculationManager
|
|||
/// <param name="indexOfMemory">Index of the target memory</param>
|
||||
void CalculatorManager::MemorizedNumberChanged(_In_ unsigned int indexOfMemory)
|
||||
{
|
||||
if (m_currentCalculatorEngine->FInErrorState()) {
|
||||
if (m_currentCalculatorEngine->FInErrorState())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -338,7 +338,7 @@ void UnitConverter::DeSerialize(const wstring& serializedData)
|
|||
{
|
||||
Reset();
|
||||
|
||||
if (!serializedData.empty())
|
||||
if (serializedData.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue