From ee11ef31bfd332ebc0e6018a0d502c42f2c7ede1 Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Mon, 11 Jul 2011 11:00:32 +0900 Subject: [PATCH] Rename CProfile::GetApplicaionIndex with one argument GetAppIndex and change its argument to LPCSTR. --- xkeymacs/profile.cpp | 8 ++++---- xkeymacs/profile.h | 2 +- xkeymacs/properties.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xkeymacs/profile.cpp b/xkeymacs/profile.cpp index 0f52fe4..60f9f5e 100644 --- a/xkeymacs/profile.cpp +++ b/xkeymacs/profile.cpp @@ -990,7 +990,7 @@ int CProfile::GetApplicationIndex(const CString szApplicationName, const BOOL bS { if (!bSaveAndValidate) // SetDialogData *nSettingStyle = SETTING_UNDEFINED; - int nAppID = GetApplicationIndex(szApplicationName); + int nAppID = GetAppID(szApplicationName); if (nAppID == MAX_APP) { if (bSaveAndValidate) { // GetDialogData for (nAppID = 0; nAppID < MAX_APP; ++nAppID) @@ -1200,7 +1200,7 @@ void CProfile::CopyData(const CString szDstApp, const CString szSrcApp) { int nSettingStyle = SETTING_SPECIFIC; const int nDstApp = GetApplicationIndex(szDstApp, TRUE, &nSettingStyle); - const int nSrcApp = GetApplicationIndex(szSrcApp); + const int nSrcApp = GetAppID(szSrcApp); #define CopyMember(member) CopyMemory(&m_Config. ## member ## [nDstApp], &m_Config. ## member ## [nSrcApp], sizeof(m_Config. ## member ## [nSrcApp])) CopyMember(b326Compatible); @@ -1216,11 +1216,11 @@ void CProfile::CopyData(const CString szDstApp, const CString szSrcApp) // return application index // if there is NOT the application in the data, return MAX_APP -int CProfile::GetApplicationIndex(const CString szApplicationName) +int CProfile::GetAppID(const LPCSTR szAppName) { int nAppID = 0; for (nAppID = 0; nAppID < MAX_APP; ++nAppID) - if (szApplicationName == m_Config.szSpecialApp[nAppID]) + if (!_tcscmp(szAppName, m_Config.szSpecialApp[nAppID])) break; return nAppID; } diff --git a/xkeymacs/profile.h b/xkeymacs/profile.h index 0b1c961..8687256 100644 --- a/xkeymacs/profile.h +++ b/xkeymacs/profile.h @@ -42,7 +42,7 @@ public: static BOOL IsDialog(CString sz); static BOOL GetUseDialogSetting(int nAppID); static void SetUseDialogSetting(int nAppID, BOOL bUseDialogSetting); - static int GetApplicationIndex(CString szApplicationName); + static int GetAppID(const LPCSTR szAppName); static void CopyData(CString szDestinationApplication, CString szSourceApplication); static void ReadKeyBind(int& pnCommandType, int& pnKey, LPCTSTR szKeyBind); static LPCTSTR Key2String(int nKey); diff --git a/xkeymacs/properties.cpp b/xkeymacs/properties.cpp index 226df1d..ad606cf 100644 --- a/xkeymacs/properties.cpp +++ b/xkeymacs/properties.cpp @@ -303,7 +303,7 @@ void CProperties::OnSettingSpecific() UpdateData(); EnableControl(ACTIVE_TAB); - if (CProfile::GetApplicationIndex(m_szCurrentApplication) == MAX_APP) { + if (CProfile::GetAppID(m_szCurrentApplication) == MAX_APP) { CProfile::CopyData(m_szCurrentApplication, CString(MAKEINTRESOURCE(IDS_DEFAULT))); SetDialogData(); } -- 2.11.0