summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_clcutils.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-07-19 16:53:36 +0000
committerRobert Pösel <robyer@seznam.cz>2012-07-19 16:53:36 +0000
commit3da4dd40a5437548bc4e089b85e4fa4cdfb8b728 (patch)
tree9410472031a70e0e63fac4450f97f5f737c7acf5 /plugins/Clist_modern/src/modern_clcutils.cpp
parenta9ba612fe47112bd476fbc42a1f232097e993b60 (diff)
clist_modern - another compatibility fix for old search.
git-svn-id: http://svn.miranda-ng.org/main/trunk@1044 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_clcutils.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index 4fb314fb12..ef1c374536 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -822,13 +822,15 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref
contact = group->cl.items[group->scanIndex];
if (contact->type != CLCIT_DIVIDER)
{
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(contact->szText));
- TCHAR* lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
- if (_tcsstr(lowered, lowered_text))
-
- /*if ((prefixOk && !_tcsnicmp(text, contact->szText, testlen)) ||
- (!prefixOk && !lstrcmpi(text, contact->szText))) */
- {
+ bool found;
+ if (dat->filterSearch) {
+ TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(contact->szText));
+ TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
+ found = _tcsstr(lowered_szText, lowered_text) != NULL;
+ } else {
+ found = (prefixOk && !_tcsnicmp(text, contact->szText, testlen)) || (!prefixOk && !lstrcmpi(text, contact->szText));
+ }
+ if (found) {
struct ClcGroup *contactGroup = group;
int contactScanIndex = group->scanIndex;
for (; group; group = group->parent)
@@ -853,13 +855,16 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref
for (i=0; i < contact->SubAllocated; i++)
{
struct ClcContact * subcontact = &(contact->subcontacts[i]);
-
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(subcontact->szText));
- TCHAR* lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
- if (_tcsstr(lowered, lowered_text))
-/* if ((prefixOk && !_tcsnicmp(text, subcontact->szText, testlen)) ||
- (!prefixOk && !lstrcmpi(text, subcontact->szText))) */
- {
+
+ bool found;
+ if (dat->filterSearch) {
+ TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(subcontact->szText));
+ TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
+ found = _tcsstr(lowered_szText, lowered_text) != NULL;
+ } else {
+ found = (prefixOk && !_tcsnicmp(text, subcontact->szText, testlen)) || (!prefixOk && !lstrcmpi(text, subcontact->szText));
+ }
+ if (found) {
struct ClcGroup *contactGroup = group;
int contactScanIndex = group->scanIndex;
for (; group; group = group->parent)