From 4b450ea4b601cdb2fe0a2ee42170a6b552738a52 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 16 Aug 2010 03:49:17 +0300 Subject: modified: main.cpp modified: new_gpg.rc modified: options.cpp --- options.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'options.cpp') diff --git a/options.cpp b/options.cpp index 989b443..61b32fe 100644 --- a/options.cpp +++ b/options.cpp @@ -458,7 +458,26 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP { TranslateDialogDefault(hwndDlg); tmp = UniGetContactSettingUtf(hContact, szModuleName, "GPGPubKey", _T("")); - SetDlgItemText(hwndDlg, IDC_PUBLIC_KEY_EDIT, (_tcslen(tmp) > 1)?tmp:_T("")); + wstring str = tmp; + mir_free(tmp); + wstring::size_type p = 0, stop = 0; + if(!str.empty()) + { + for(;;) + { + if((p = str.find(_T("\n"), p+2)) != wstring::npos) + { + if(p > stop) + { + stop = p; + str.insert(p, _T("\r")); + } + else + break; + } + } + } + SetDlgItemText(hwndDlg, IDC_PUBLIC_KEY_EDIT, !str.empty()?str.c_str():_T("")); hPubKeyEdit = GetDlgItem(hwndDlg, IDC_PUBLIC_KEY_EDIT); return TRUE; } -- cgit v1.2.3