summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-07-19 18:18:13 +0000
committerRobert Pösel <robyer@seznam.cz>2012-07-19 18:18:13 +0000
commitc9a9db42fc216d6106e09def83a295c77ce080ab (patch)
treeb8d15482c11190cc0a8ce89cbcd0b7d3ef8d8bd4
parent5592c77cdc47f100bc705a2a51a27c737ef78b97 (diff)
clist_modern crashfix
git-svn-id: http://svn.miranda-ng.org/main/trunk@1048 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp24
3 files changed, 18 insertions, 16 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 56375d2f0d..32a9153bd2 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -335,8 +335,8 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const
{
bool found;
if (dat->filterSearch) {
- TCHAR* lowered_szText = CharLowerW(NEWTSTR_ALLOCA(group->cl.items[group->scanIndex]->szText));
- TCHAR* lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
+ TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(group->cl.items[group->scanIndex]->szText));
+ TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
found = _tcsstr(lowered_szText, lowered_search) != NULL;
} else {
found = ((prefixOk && CSTR_EQUAL == CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, text, -1, group->cl.items[group->scanIndex]->szText, testlen)) || (!prefixOk && !lstrcmpi(text, group->cl.items[group->scanIndex]->szText)));
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index d1acc918fa..2325cef988 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -758,9 +758,11 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc
BOOL fEmbedded = dat->force_in_dialog;
// always hide subcontacts (but show them on embedded contact lists)
- if (dat->filterSearch && dat->szQuickSearch) {
+ if (dat->filterSearch && dat->szQuickSearch && pdnce->tszName) {
// search filtering
- return _tcsstr(CharLowerW(pdnce->tszName), CharLowerW(dat->szQuickSearch)) ? 0 : 1;
+ TCHAR *lowered_name = CharLowerW(NEWTSTR_ALLOCA(pdnce->tszName));
+ TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
+ return _tcsstr(lowered_name, lowered_search) ? 0 : 1;
}
if (g_CluiData.bMetaAvail && dat != NULL && dat->IsMetaContactsEnabled && g_szMetaModuleName && db_get_b(hContact, g_szMetaModuleName, "IsSubcontact", 0))
return -1; //subcontact
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index 294a5c7a1d..31e2dd2386 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -949,8 +949,8 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
int idx = 0;
if ( dat->filterSearch )
{
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR* p1 = _tcsstr(lowered, dat->szQuickSearch);
+ TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
+ TCHAR *p1 = _tcsstr(lowered, dat->szQuickSearch);
if (p1)
idx = int(p1 - lowered);
}
@@ -1034,8 +1034,8 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
int idx = 0;
if ( dat->filterSearch )
{
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR* p1 = _tcsstr(lowered, dat->szQuickSearch);
+ TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
+ TCHAR *p1 = _tcsstr(lowered, dat->szQuickSearch);
if (p1)
idx = int(p1 - lowered);
}
@@ -1127,8 +1127,8 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
int idx = 0;
if ( dat->filterSearch )
{
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR* p1 = _tcsstr(lowered, dat->szQuickSearch);
+ TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
+ TCHAR *p1 = _tcsstr(lowered, dat->szQuickSearch);
if (p1)
idx = int(p1 - lowered);
}
@@ -1224,8 +1224,8 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
int idx = 0;
if ( dat->filterSearch )
{
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR* p1 = _tcsstr(lowered, dat->szQuickSearch);
+ TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
+ TCHAR *p1 = _tcsstr(lowered, dat->szQuickSearch);
if (p1)
idx = int(p1 - lowered);
}
@@ -3181,8 +3181,8 @@ void CLCPaint::_DrawContactText( HDC hdcMem, struct ClcData *dat, struct ClcCont
int idx = 0;
if ( dat->filterSearch )
{
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR* p1 = _tcsstr(lowered, dat->szQuickSearch);
+ TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
+ TCHAR *p1 = _tcsstr(lowered, dat->szQuickSearch);
if (p1)
idx = int(p1 - lowered);
}
@@ -3204,8 +3204,8 @@ void CLCPaint::_DrawContactText( HDC hdcMem, struct ClcData *dat, struct ClcCont
int idx = 0;
if ( dat->filterSearch )
{
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR* p1 = _tcsstr(lowered, dat->szQuickSearch);
+ TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
+ TCHAR *p1 = _tcsstr(lowered, dat->szQuickSearch);
if (p1)
idx = int(p1 - lowered);
}