summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/contactcache.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-12-13 18:16:35 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-12-13 18:16:35 +0000
commit1eb65726f44324bc688843c9948beae0e8a16f05 (patch)
tree31e6722b2e5da1c97425c0231854ff7d10e94ed3 /plugins/TabSRMM/src/contactcache.cpp
parent5ab4a9381e75d2d6ea04ed5d55ef7d6dd343fa8c (diff)
fix for info panel's tooltip
git-svn-id: http://svn.miranda-ng.org/main/trunk@11371 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/contactcache.cpp')
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index 1cbb8bc549..488165ad14 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -538,34 +538,26 @@ int CContactCache::cacheUpdateMetaChanged(WPARAM bMetaEnabled, LPARAM)
*/
TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll)
{
- size_t k = 0, i = 0;
- TCHAR* tszResult = 0;
-
if (src == 0 || mir_tstrlen(src) < 2)
return 0;
- tstring dest;
+ CMString dest;
- for (i=0; i < _tcslen(src); i++) {
+ for (int i = 0; src[i] != 0; i++) {
if (src[i] == 0x0d || src[i] == '\t')
continue;
if (i && src[i] == (TCHAR)0x0a) {
if (fStripAll) {
- dest.append(_T(" "));
+ dest.AppendChar(' ');
continue;
}
- dest.append(_T("\n"));
+ dest.AppendChar('\n');
continue;
}
- dest += src[i];
+ dest.AppendChar(src[i]);
}
- if (i) {
- tszResult = (TCHAR*)mir_alloc((dest.length() + 1) * sizeof(TCHAR));
- _tcscpy(tszResult, dest.c_str());
- tszResult[dest.length()] = 0;
- }
- return tszResult;
+ return mir_tstrndup(dest, dest.GetLength());
}
/**