OSDN Git Service

Change CString to LPCTSTR or const CString&.
authorKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Thu, 17 Nov 2011 05:02:50 +0000 (14:02 +0900)
committerKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Mon, 9 Jan 2012 01:45:11 +0000 (10:45 +0900)
Modify LPCSTR into LPCTSTR.

xkeymacs/profile.cpp
xkeymacs/profile.h
xkeymacs/propertiesbasic.cpp
xkeymacs/propertieslist.cpp
xkeymacsdll/Commands.cpp
xkeymacsdll/Commands.h
xkeymacsdll/Utils.cpp
xkeymacsdll/xkeymacsdll.cpp
xkeymacsdll/xkeymacsdll.h

index 3e16077..88655d6 100644 (file)
@@ -122,7 +122,7 @@ void CProfile::LevelUp()
        AfxGetApp()->WriteProfileInt(_T(""), _T("Level"), 4);\r
 }\r
 \r
-void CProfile::AddKeyBind2C_(LPCSTR appName, BYTE bVk)\r
+void CProfile::AddKeyBind2C_(LPCTSTR appName, BYTE bVk)\r
 {\r
        int nComID;\r
        for (nComID = 0; nComID < MAX_COMMAND; ++nComID)\r
@@ -459,20 +459,20 @@ void CProfile::AddIMEInfo(CProperties& cProperties)
                cProperties.AddItem(p->szDescription, p->szFileName);\r
 }\r
 \r
-void CProfile::ClearData(const CString szCurrentApplication)\r
+void CProfile::ClearData(LPCTSTR appName)\r
 {\r
        for (int nAppID = 0; nAppID < MAX_APP; ++nAppID)\r
-               if (szCurrentApplication == m_Config.szSpecialApp[nAppID]) {\r
+               if (!_tcscmp(appName, m_Config.szSpecialApp[nAppID])) {\r
                        ZeroMemory(m_Config.nCommandID[nAppID], sizeof(m_Config.nCommandID[nAppID]));\r
                        ZeroMemory(m_Config.szSpecialApp[nAppID], CLASS_NAME_LENGTH);\r
                        return;\r
                }\r
 }\r
 \r
-void CProfile::CopyData(const CString szDstApp, const CString szSrcApp)\r
+void CProfile::CopyData(LPCTSTR dst, LPCTSTR src)\r
 {\r
-       int nDstApp = AssignAppID(szDstApp);\r
-       int nSrcApp = GetAppID(szSrcApp);\r
+       int nDstApp = AssignAppID(dst);\r
+       int nSrcApp = GetAppID(src);\r
        if (nDstApp == MAX_APP || nSrcApp == MAX_APP)\r
                return;\r
        SetSettingStyle(nDstApp, SETTING_SPECIFIC);\r
@@ -489,7 +489,7 @@ void CProfile::CopyData(const CString szDstApp, const CString szSrcApp)
 #undef CopyMember\r
 }\r
 \r
-int CProfile::AssignAppID(LPCSTR appName)\r
+int CProfile::AssignAppID(LPCTSTR appName)\r
 {\r
        int nAppID = GetAppID(appName);\r
        if (nAppID != MAX_APP)\r
@@ -511,7 +511,7 @@ int CProfile::DefaultAppID()
        return MAX_APP;\r
 }\r
 \r
-int CProfile::GetAppID(LPCSTR appName)\r
+int CProfile::GetAppID(LPCTSTR appName)\r
 {\r
        int nAppID = 0;\r
        for (nAppID = 0; nAppID < MAX_APP; ++nAppID)\r
@@ -590,17 +590,17 @@ void CProfile::SetKillRingMax(int nAppID, int nKillRingMax)
        m_Config.nKillRingMax[nAppID] = static_cast<BYTE>(nKillRingMax > 255 ? 255 : nKillRingMax);\r
 }\r
 \r
-CString CProfile::GetWindowText(int nAppID)\r
+LPCTSTR CProfile::GetWindowText(int nAppID)\r
 {\r
        return m_Config.szWindowText[nAppID];\r
 }\r
 \r
-void CProfile::SetWindowText(int nAppID, const CString szWindowText)\r
+void CProfile::SetWindowText(int nAppID, const CString& text)\r
 {\r
-       if (CUtils::GetWindowTextType(szWindowText) == IDS_WINDOW_TEXT_IGNORE)\r
+       if (CUtils::GetWindowTextType(text) == IDS_WINDOW_TEXT_IGNORE)\r
                _tcscpy_s(m_Config.szWindowText[nAppID], _T("*"));\r
        else\r
-               _tcsncpy_s(m_Config.szWindowText[nAppID], szWindowText, _TRUNCATE);\r
+               _tcsncpy_s(m_Config.szWindowText[nAppID], text, _TRUNCATE);\r
 }\r
 \r
 BOOL CProfile::Is106Keyboard()\r
index 4404af0..de78955 100644 (file)
@@ -35,11 +35,11 @@ public:
        static void StringToKey(LPCTSTR str, int& type, int& key);\r
        static CString KeyToString(int type, int key);\r
        static void InitAppList(CProperties& cProperties);\r
-       static void CopyData(CString szDestinationApplication, CString szSourceApplication);\r
-       static void ClearData(CString szCurrentApplication);\r
-       static int AssignAppID(LPCSTR appName);\r
+       static void ClearData(LPCTSTR appName);\r
+       static void CopyData(LPCTSTR dstApp, LPCTSTR srcApp);\r
+       static int AssignAppID(LPCTSTR appName);\r
        static int DefaultAppID();\r
-       static int GetAppID(LPCSTR appName);\r
+       static int GetAppID(LPCTSTR appName);\r
        static int GetSettingStyle(int nAppID);\r
        static void SetSettingStyle(int nAppID, int nSettingStyle);\r
        static void SetAppTitle(int nAppID, const CString& appTitle);\r
@@ -51,8 +51,8 @@ public:
        static BOOL GetEnableCUA(int nAppID);\r
        static int GetKillRingMax(int nAppID);\r
        static void SetKillRingMax(int nAppID, int nKillRingMax);\r
-       static CString GetWindowText(int nAppID);\r
-       static void SetWindowText(int nAppID, CString szWindowText);\r
+       static LPCTSTR GetWindowText(int nAppID);\r
+       static void SetWindowText(int nAppID, const CString& text);\r
        static BOOL Is106Keyboard();\r
        static BOOL IsVistaOrLater();\r
        static void RestartComputer();\r
index 32c996e..bc4560a 100644 (file)
@@ -150,7 +150,7 @@ void CPropertiesBasic::SetDialogData()
        if (nAppID == MAX_APP)\r
                return;\r
        for (int nComID = 0; nComID < MAX_COMMAND; ++nComID) {\r
-               const LPCSTR szComName = CCommands::GetCommandName(nComID);\r
+               const LPCTSTR szComName = CCommands::GetCommandName(nComID);\r
                if (!szComName[0])\r
                        return;\r
                for (int i = 0; const int nKey = CCommands::GetDefaultCommandKey(nComID, i); ++i) {\r
@@ -189,7 +189,7 @@ void CPropertiesBasic::GetDialogData()
        if (nAppID == MAX_APP)\r
                return;\r
        for (int nComID = 0; nComID < MAX_COMMAND; ++nComID) {\r
-               const LPCSTR szComName = CCommands::GetCommandName(nComID);\r
+               const LPCTSTR szComName = CCommands::GetCommandName(nComID);\r
                if (!szComName[0])\r
                        return;\r
                for (int i = 0; const int nKey = CCommands::GetDefaultCommandKey(nComID, i); ++i) {\r
index e8f0151..7c5ba0a 100644 (file)
@@ -65,7 +65,7 @@ void CPropertiesList::SetDialogData()
 \r
        const int nAppID = m_pProperties->GetApplicationID();\r
        for (int nComID = 1; nComID < MAX_COMMAND; ++nComID) {\r
-               const LPCSTR szComName = CCommands::GetCommandName(nComID);\r
+               const LPCTSTR szComName = CCommands::GetCommandName(nComID);\r
                if (!szComName[0])\r
                        break;\r
                const CString category(MAKEINTRESOURCE(CCommands::GetCategoryID(nComID)));\r
index ba11f47..95c4bc5 100644 (file)
@@ -4005,7 +4005,7 @@ int CCommands::ExecuteExtendedCommand()
        return Reset(GOTO_HOOKX);\r
 }\r
 \r
-LPCSTR CCommands::GetCommandName(int nComID)\r
+LPCTSTR CCommands::GetCommandName(int nComID)\r
 {\r
        return Commands[nComID].szCommandName;\r
 }\r
index 89d954d..800e98c 100644 (file)
@@ -171,7 +171,7 @@ public:
        static int BackwardChar();\r
        static int BeginningOfLine();\r
        static int ForwardChar();\r
-       static LPCSTR GetCommandName(int nComID);\r
+       static LPCTSTR GetCommandName(int nComID);\r
        static int GetCategoryID(int nComID);\r
        static int GetDescriptionID(int nComID);\r
        static int GetToolTipID(int nComID);\r
index 2d628b6..b8c9756 100644 (file)
@@ -242,7 +242,7 @@ BOOL CUtils::GetClipboardText(CString& text)
        const LPVOID pMem = GlobalLock(hClipboard);\r
        if (!pMem)\r
                return FALSE;\r
-       text = reinterpret_cast<LPCSTR>(pMem);\r
+       text = reinterpret_cast<LPCTSTR>(pMem);\r
        GlobalUnlock(hClipboard);\r
        EmptyClipboard();\r
        CloseClipboard();\r
index 576f0c1..ce1058a 100644 (file)
@@ -447,8 +447,8 @@ void CXkeymacsDll::InitKeyboardProc(bool imeState)
                        if (m_nAppID < 0)\r
                                m_nAppID = nAppID;\r
                        else {\r
-                               LPCSTR curText = m_Config.szWindowText[m_nAppID];\r
-                               LPCSTR newText = m_Config.szWindowText[nAppID];\r
+                               LPCTSTR curText = m_Config.szWindowText[m_nAppID];\r
+                               LPCTSTR newText = m_Config.szWindowText[nAppID];\r
                                int curType = CUtils::GetWindowTextType(curText);\r
                                int newType = CUtils::GetWindowTextType(newText);\r
                                if (curType < newType || curType == newType && _tcscmp(curText, newText) <= 0)\r
@@ -475,7 +475,7 @@ void CXkeymacsDll::InitKeyboardProc(bool imeState)
        CCommands::Reset();\r
 }\r
 \r
-int CXkeymacsDll::GetAppID(LPCSTR szName, int fallback)\r
+int CXkeymacsDll::GetAppID(LPCTSTR szName, int fallback)\r
 {\r
        for (int i = 0; i < MAX_APP; ++i)\r
                if (!_tcsicmp(m_Config.szSpecialApp[i], szName))\r
index 0bea514..ac4a4fd 100644 (file)
@@ -67,7 +67,7 @@ private:
        static LRESULT CALLBACK ShellProc(int nCode, WPARAM wParam, LPARAM lParam);\r
        static int m_nAppID;\r
        static void InitKeyboardProc(bool imeState);\r
-       static int GetAppID(LPCSTR szName, int fallback);\r
+       static int GetAppID(LPCTSTR szName, int fallback);\r
        static BOOL m_bRightShift;\r
        static BOOL m_bRightControl;\r
        static BOOL m_bRightAlt;\r