OSDN Git Service

Use MAX_COMMAND and MAX_KEY_BIND further.
authorKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Thu, 23 Jun 2011 06:59:53 +0000 (15:59 +0900)
committerKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Thu, 23 Jun 2011 06:59:53 +0000 (15:59 +0900)
xkeymacs/propertiesbasic.cpp
xkeymacs/propertiesbasic.h
xkeymacsdll/Commands.cpp

index f7ca1c8..46cc8ad 100644 (file)
@@ -228,7 +228,7 @@ void CPropertiesBasic::UpdateDialogData(CString szApplicationName, BOOL bSaveAnd
 \r
 void CPropertiesBasic::InitChanged(BOOL bChanged)\r
 {\r
-       for (int i = 0; i < sizeof(m_bChanged)/sizeof(m_bChanged[0]); ++i) {\r
+       for (int i = 0; i < MAX_COMMAND; ++i) {\r
                if (CCommands::GetDefaultControlID(i, 0) || !bChanged) {\r
                        m_bChanged[i] = bChanged;\r
                }\r
index f1a7544..e383687 100644 (file)
@@ -122,7 +122,7 @@ private:
        CToolTipCtrl m_ToolTip;\r
        void Changed(int nObjectID);\r
        CProperties* m_pProperties;\r
-       BOOL m_bChanged[sizeof(Commands)/sizeof(Commands[0])];\r
+       BOOL m_bChanged[MAX_COMMAND];\r
        void UpdateDialogData(CString szApplicationName, BOOL bSaveAndValidate = TRUE);\r
 };\r
 \r
index f7eb89b..21d6240 100644 (file)
@@ -4043,8 +4043,8 @@ int CCommands::GetToolTipID(int nCommandID)
 \r
 int CCommands::GetDefaultCommandType(int nCommandID, int nIndex)\r
 {\r
-       if (nCommandID < 0 || sizeof(Commands) / sizeof(Commands[0]) <= nCommandID\r
-        || nIndex < 0 || sizeof(Commands[nCommandID].keybind) / sizeof(Commands[nCommandID].keybind[0]) <= nIndex) {\r
+       if (nCommandID < 0 || MAX_COMMAND <= nCommandID\r
+        || nIndex < 0 || MAX_KEY_BIND <= nIndex) {\r
                ASSERT(0);\r
                return NONE;\r
        }\r
@@ -4084,8 +4084,8 @@ int CCommands::GetDefaultCommandType(int nCommandID, int nIndex)
 \r
 int CCommands::GetDefaultCommandKey(int nCommandID, int nIndex)\r
 {\r
-       if (nCommandID < 0 || sizeof(Commands) / sizeof(Commands[0]) <= nCommandID\r
-        || nIndex < 0 || sizeof(Commands[nCommandID].keybind) / sizeof(Commands[nCommandID].keybind[0]) <= nIndex) {\r
+       if (nCommandID < 0 || MAX_COMMAND <= nCommandID\r
+        || nIndex < 0 || MAX_KEY_BIND <= nIndex) {\r
                ASSERT(0);\r
                return 0;\r
        }\r
@@ -4155,8 +4155,8 @@ int CCommands::GetDefaultCommandKey(int nCommandID, int nIndex)
 \r
 int CCommands::GetDefaultControlID(int nCommandID, int nIndex)\r
 {\r
-       if (nCommandID < 0 || sizeof(Commands) / sizeof(Commands[0]) <= nCommandID\r
-        || nIndex < 0 || sizeof(Commands[nCommandID].keybind) / sizeof(Commands[nCommandID].keybind[0]) <= nIndex) {\r
+       if (nCommandID < 0 || MAX_COMMAND <= nCommandID\r
+        || nIndex < 0 || MAX_KEY_BIND <= nIndex) {\r
                ASSERT(0);\r
                return 0;\r
        }\r