Some more refactoring

This commit is contained in:
Cyril Garsaud 2019-03-08 13:03:43 +01:00
commit 874e049532
3 changed files with 44 additions and 36 deletions

View file

@ -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 //To Update the operands in the Expression according to the current Radix
void CHistoryCollector::UpdateHistoryExpression(uint32_t radix, int32_t precision) void CHistoryCollector::UpdateHistoryExpression(uint32_t radix, int32_t precision)
{ {
if (m_spTokens != nullptr) if (m_spTokens == nullptr)
{ {
return;
}
unsigned int size; unsigned int size;
IFT(m_spTokens->GetSize(&size)); IFT(m_spTokens->GetSize(&size));
@ -436,7 +439,6 @@ void CHistoryCollector::UpdateHistoryExpression(uint32_t radix, int32_t precisio
} }
} }
SetExpressionDisplay(); SetExpressionDisplay();
}
} }
void CHistoryCollector::SetDecimalSymbol(wchar_t decimalSymbol) void CHistoryCollector::SetDecimalSymbol(wchar_t decimalSymbol)

View file

@ -484,7 +484,8 @@ namespace CalculationManager
{ {
m_savedCommands.push_back(MEMORY_COMMAND_TO_UNSIGNED_CHAR(MemoryCommand::MemorizeNumber)); m_savedCommands.push_back(MEMORY_COMMAND_TO_UNSIGNED_CHAR(MemoryCommand::MemorizeNumber));
if (m_currentCalculatorEngine->FInErrorState()) { if (m_currentCalculatorEngine->FInErrorState())
{
return; return;
} }
@ -512,7 +513,8 @@ namespace CalculationManager
{ {
SaveMemoryCommand(MemoryCommand::MemorizedNumberLoad, indexOfMemory); SaveMemoryCommand(MemoryCommand::MemorizedNumberLoad, indexOfMemory);
if (m_currentCalculatorEngine->FInErrorState()) { if (m_currentCalculatorEngine->FInErrorState())
{
return; return;
} }
@ -530,7 +532,8 @@ namespace CalculationManager
{ {
SaveMemoryCommand(MemoryCommand::MemorizedNumberAdd, indexOfMemory); SaveMemoryCommand(MemoryCommand::MemorizedNumberAdd, indexOfMemory);
if (m_currentCalculatorEngine->FInErrorState()) { if (m_currentCalculatorEngine->FInErrorState())
{
return; return;
} }
@ -570,7 +573,8 @@ namespace CalculationManager
{ {
SaveMemoryCommand(MemoryCommand::MemorizedNumberSubtract, indexOfMemory); SaveMemoryCommand(MemoryCommand::MemorizedNumberSubtract, indexOfMemory);
if (m_currentCalculatorEngine->FInErrorState()) { if (m_currentCalculatorEngine->FInErrorState())
{
return; return;
} }
@ -614,7 +618,8 @@ namespace CalculationManager
/// <param name="indexOfMemory">Index of the target memory</param> /// <param name="indexOfMemory">Index of the target memory</param>
void CalculatorManager::MemorizedNumberSelect(_In_ unsigned int indexOfMemory) void CalculatorManager::MemorizedNumberSelect(_In_ unsigned int indexOfMemory)
{ {
if (m_currentCalculatorEngine->FInErrorState()) { if (m_currentCalculatorEngine->FInErrorState())
{
return; return;
} }
@ -629,7 +634,8 @@ namespace CalculationManager
/// <param name="indexOfMemory">Index of the target memory</param> /// <param name="indexOfMemory">Index of the target memory</param>
void CalculatorManager::MemorizedNumberChanged(_In_ unsigned int indexOfMemory) void CalculatorManager::MemorizedNumberChanged(_In_ unsigned int indexOfMemory)
{ {
if (m_currentCalculatorEngine->FInErrorState()) { if (m_currentCalculatorEngine->FInErrorState())
{
return; return;
} }

View file

@ -338,7 +338,7 @@ void UnitConverter::DeSerialize(const wstring& serializedData)
{ {
Reset(); Reset();
if (!serializedData.empty()) if (serializedData.empty())
{ {
return; return;
} }