[CALC] Fix input bug when display is in error. (#5988)

CORE-19191

Reproduce the same behaviour of the calculator for Windows XP when an error condition is met.
When the result is NaN and it cannot be printed, the error condition is cleared by pressing the CLEAR button.
This commit is contained in:
Carlo Bramini 2024-04-18 11:39:46 +02:00 committed by GitHub
parent 2a2556c5d0
commit 605fa32d45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1635,7 +1635,7 @@ static INT_PTR CALLBACK DlgMainProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
case IDC_BUTTON_D:
case IDC_BUTTON_E:
case IDC_BUTTON_F:
calc.is_nan = FALSE;
if (calc.is_nan) break;
build_operand(hWnd, LOWORD(wp));
return TRUE;
case IDC_BUTTON_PERCENT:
@ -1701,6 +1701,7 @@ static INT_PTR CALLBACK DlgMainProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
}
return TRUE;
case IDC_BUTTON_BACK:
if (calc.is_nan) break;
if (calc.sci_in) {
if (calc.esp == 0) {
TCHAR *ptr;