OSDN Git Service

Remove ineffective code handling window text types.
authorKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Wed, 6 Jul 2011 08:04:39 +0000 (17:04 +0900)
committerKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Wed, 13 Jul 2011 05:28:12 +0000 (14:28 +0900)
xkeymacs/data.cpp
xkeymacs/data.h
xkeymacs/profile.cpp

index 44c3093..0e1eb1d 100644 (file)
@@ -25,16 +25,6 @@ CString CData::GetWindowText()
        return m_strWindowText;\r
 }\r
 \r
-void CData::SetWindowTextType(int nWindowTextType)\r
-{\r
-       m_nWindowTextType = nWindowTextType;\r
-}\r
-\r
-int CData::GetWindowTextType()\r
-{\r
-       return m_nWindowTextType;\r
-}\r
-\r
 void CData::SetApplicationName(LPCTSTR lpszApplicationName)\r
 {\r
        m_strApplicationName.Format(lpszApplicationName);\r
index 30f03ac..c0e0682 100644 (file)
@@ -11,8 +11,6 @@ public:
        void ClearAll();\r
        void Set326Compatible(BOOL b326Compatible);\r
        BOOL Get326Compatible();\r
-       int GetWindowTextType();\r
-       void SetWindowTextType(int nWindowTextType);\r
        CString GetWindowText();\r
        void SetWindowText(LPCTSTR lpszWindowText);\r
        void SetUseDialogSetting(BOOL bUseDialogSetting);\r
index f15f471..d48d2a9 100644 (file)
@@ -476,22 +476,6 @@ BOOL CALLBACK CProfile::EnumWindowsProc(const HWND hWnd, const LPARAM lParam)
        return TRUE;\r
 }\r
 \r
-struct {\r
-       int type;\r
-       CString cstr;\r
-} WindowTextTypes[] = {\r
-       { IDS_WINDOW_TEXT_MATCH, CString(MAKEINTRESOURCE(IDS_WINDOW_TEXT_MATCH)) },\r
-       { IDS_WINDOW_TEXT_MATCH_FORWARD, CString(MAKEINTRESOURCE(IDS_WINDOW_TEXT_MATCH_FORWARD)) },\r
-       { IDS_WINDOW_TEXT_MATCH_BACKWARD, CString(MAKEINTRESOURCE(IDS_WINDOW_TEXT_MATCH_BACKWARD)) },\r
-};\r
-\r
-inline int WindowTextType(const CString& cstr) {\r
-       for (int i = 0; i < _countof(WindowTextTypes); ++i)\r
-               if (WindowTextTypes[i].cstr == cstr)\r
-                       return WindowTextTypes[i].type;\r
-       return IDS_WINDOW_TEXT_IGNORE;\r
-}\r
-\r
 void CProfile::LoadRegistry()\r
 {\r
        bool bDialog = false;\r
@@ -517,7 +501,6 @@ void CProfile::LoadRegistry()
                entry.LoadString(IDS_REG_ENTRY_WINDOW_TEXT);\r
                m_Data[nAppID].SetWindowText(AfxGetApp()->GetProfileString(appName, entry, _T("*")));\r
                entry.LoadString(IDS_REG_ENTRY_WINDOW_TEXT_TYPE);\r
-               m_Data[nAppID].SetWindowTextType(WindowTextType(AfxGetApp()->GetProfileString(appName, entry)));\r
 \r
                CString regApp(MAKEINTRESOURCE(IDS_REGSUBKEY_DATA));\r
                regApp += _T("\\") + appName;\r
@@ -599,8 +582,6 @@ void CProfile::SaveRegistry()
                AfxGetApp()->WriteProfileString(appName, entry, appTitle);\r
                entry.LoadString(IDS_REG_ENTRY_WINDOW_TEXT);\r
                AfxGetApp()->WriteProfileString(appName, entry, m_Data[nAppID].GetWindowText());\r
-               entry.LoadString(IDS_REG_ENTRY_WINDOW_TEXT_TYPE);\r
-               AfxGetApp()->WriteProfileString(appName, entry, CString(MAKEINTRESOURCE(m_Data[nAppID].GetWindowTextType())));\r
 \r
                CString regApp(MAKEINTRESOURCE(IDS_REGSUBKEY_DATA));\r
                regApp += _T("\\") + appName;\r
@@ -1294,14 +1275,12 @@ void CProfile::CopyData(const CString szDestinationApplication, const CString sz
        CString szApplicationName = m_Data[nDestinationApplication].GetApplicationName();\r
        CString szApplicationTitle = m_Data[nDestinationApplication].GetApplicationTitle();\r
        CString szWindowText = m_Data[nDestinationApplication].GetWindowText();\r
-       int nWindowTextType = m_Data[nDestinationApplication].GetWindowTextType();\r
 \r
        m_Data[nDestinationApplication] = m_Data[nSourceApplication];\r
 \r
        m_Data[nDestinationApplication].SetApplicationName(szApplicationName);\r
        m_Data[nDestinationApplication].SetApplicationTitle(szApplicationTitle);\r
        m_Data[nDestinationApplication].SetWindowText(szWindowText);\r
-       m_Data[nDestinationApplication].SetWindowTextType(nWindowTextType);\r
 }\r
 \r
 // return application index\r