diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-26 21:46:33 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-26 21:46:33 +0300 |
commit | dcf36bc803916561f01febeedb76501d3fe3f729 (patch) | |
tree | 904d682ba3d6077ce0c585514827b14294ff67a9 /options.cpp | |
parent | fa9565edd129e41bc45e5e7012a15de1456448eb (diff) |
modified: messages.cpp
modified: options.cpp
modified: replacer.suo
Diffstat (limited to 'options.cpp')
-rw-r--r-- | options.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/options.cpp b/options.cpp index 2c8f774..b0e640b 100644 --- a/options.cpp +++ b/options.cpp @@ -81,7 +81,7 @@ static BOOL CALLBACK DlgProcReplacerOpts(HWND hwndDlg, UINT msg, WPARAM wParam, col.cx = 80; ListView_InsertColumn(hwndList2, 0, &col); int i = 0, iRow = 0; - char *setting = new char [32]; + char setting[32]; TCHAR *buf = NULL; mir_snprintf(setting, 31, "szSourceWord%d", i); buf = UniGetContactSettingUtf(NULL, szReplacerModuleName, setting, _T("")); @@ -119,7 +119,6 @@ static BOOL CALLBACK DlgProcReplacerOpts(HWND hwndDlg, UINT msg, WPARAM wParam, EnableWindow(GetDlgItem(hwndDlg, IDC_ADD), 0); EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE), 0); EnableWindow(GetDlgItem(hwndDlg, IDC_DELETE), 0); - delete [] setting; return TRUE; } @@ -132,24 +131,12 @@ static BOOL CALLBACK DlgProcReplacerOpts(HWND hwndDlg, UINT msg, WPARAM wParam, { bEdit = false; ShowWordEditDialog(); -/* if(hwnd_list_p == hwndList1) - { - } - else if(hwnd_list_p == hwndList2) - { - } */ } break; case IDC_CHANGE: { bEdit = true; ShowWordEditDialog(); -/* if(hwnd_list_p == hwndList1) - { - } - else if(hwnd_list_p == hwndList2) - { - } */ } break; case IDC_DELETE: @@ -353,7 +340,20 @@ static BOOL CALLBACK DlgProcWordEditDialog(HWND hwndDlg, UINT msg, WPARAM wParam TCHAR str[512]; GetDlgItemText(hwndDlg, IDC_EDIT_WORD, str, 511); if(bTargetWord) - ; + { + char setting[32]; + setting[0] = '\0'; + mir_snprintf(setting, 31, "szTargetWords%d", item_num_1); + TCHAR *buf = UniGetContactSettingUtf(NULL, szReplacerModuleName, setting, _T("")); + wstring data = buf; + mir_free(buf); + TCHAR tmp[128]; + ListView_GetItemText(hwnd_list_p, item_num_2, 0,tmp, 127); + wstring::size_type p1 = data.find(tmp); + data.replace(p1, (wstring::size_type)_tcslen(tmp), str); + DBWriteContactSettingTString(NULL, szReplacerModuleName, setting, data.c_str()); + ListView_SetItemText(hwnd_list_p, item_num_2, 0, str); + } else { char setting[32]; |