Author: cwittich
Date: Mon Apr 13 09:53:35 2015
New Revision: 67185
URL:
http://svn.reactos.org/svn/reactos?rev=67185&view=rev
Log:
[CALC]
only update the layout when necessary
Modified:
trunk/reactos/base/applications/calc/winmain.c
Modified: trunk/reactos/base/applications/calc/winmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/win…
==============================================================================
--- trunk/reactos/base/applications/calc/winmain.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/calc/winmain.c [iso-8859-1] Mon Apr 13 09:53:35 2015
@@ -1346,40 +1346,49 @@
#endif
return TRUE;
case IDM_VIEW_STANDARD:
- calc.layout = CALC_LAYOUT_STANDARD;
- calc.action = IDM_VIEW_STANDARD;
- DestroyWindow(hWnd);
- save_config();
-
- CheckMenuRadioItem(GetMenu(hWnd),
- IDM_VIEW_STANDARD,
- IDM_VIEW_CONVERSION,
- IDM_VIEW_STANDARD,
- MF_BYCOMMAND);
+ if (calc.layout != CALC_LAYOUT_STANDARD)
+ {
+ calc.layout = CALC_LAYOUT_STANDARD;
+ calc.action = IDM_VIEW_STANDARD;
+ DestroyWindow(hWnd);
+ save_config();
+
+ CheckMenuRadioItem(GetMenu(hWnd),
+ IDM_VIEW_STANDARD,
+ IDM_VIEW_CONVERSION,
+ IDM_VIEW_STANDARD,
+ MF_BYCOMMAND);
+ }
return TRUE;
case IDM_VIEW_SCIENTIFIC:
- calc.layout = CALC_LAYOUT_SCIENTIFIC;
- calc.action = IDM_VIEW_SCIENTIFIC;
- DestroyWindow(hWnd);
- save_config();
-
- CheckMenuRadioItem(GetMenu(hWnd),
- IDM_VIEW_STANDARD,
- IDM_VIEW_CONVERSION,
- IDM_VIEW_SCIENTIFIC,
- MF_BYCOMMAND);
+ if (calc.layout != CALC_LAYOUT_SCIENTIFIC)
+ {
+ calc.layout = CALC_LAYOUT_SCIENTIFIC;
+ calc.action = IDM_VIEW_SCIENTIFIC;
+ DestroyWindow(hWnd);
+ save_config();
+
+ CheckMenuRadioItem(GetMenu(hWnd),
+ IDM_VIEW_STANDARD,
+ IDM_VIEW_CONVERSION,
+ IDM_VIEW_SCIENTIFIC,
+ MF_BYCOMMAND);
+ }
return TRUE;
case IDM_VIEW_CONVERSION:
- calc.layout = CALC_LAYOUT_CONVERSION;
- calc.action = IDM_VIEW_CONVERSION;
- DestroyWindow(hWnd);
- save_config();
-
- CheckMenuRadioItem(GetMenu(hWnd),
- IDM_VIEW_STANDARD,
- IDM_VIEW_CONVERSION,
- IDM_VIEW_CONVERSION,
- MF_BYCOMMAND);
+ if (calc.layout != CALC_LAYOUT_CONVERSION)
+ {
+ calc.layout = CALC_LAYOUT_CONVERSION;
+ calc.action = IDM_VIEW_CONVERSION;
+ DestroyWindow(hWnd);
+ save_config();
+
+ CheckMenuRadioItem(GetMenu(hWnd),
+ IDM_VIEW_STANDARD,
+ IDM_VIEW_CONVERSION,
+ IDM_VIEW_CONVERSION,
+ MF_BYCOMMAND);
+ }
return TRUE;
case IDM_VIEW_HEX:
case IDM_VIEW_DEC: