summaryrefslogtreecommitdiff
path: root/options.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-08-16 03:49:17 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-08-16 03:49:17 +0300
commit4b450ea4b601cdb2fe0a2ee42170a6b552738a52 (patch)
tree13a38638a1bcbd43b4e733e5d9a71ff909c7ff4a /options.cpp
parent6e0a54a479bbcb862df2f69945aa5e3d16ad9db2 (diff)
modified: main.cpp
modified: new_gpg.rc modified: options.cpp
Diffstat (limited to 'options.cpp')
-rw-r--r--options.cpp21
1 files changed, 20 insertions, 1 deletions
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;
}