summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-07-19 13:32:57 +0000
committerRobert Pösel <robyer@seznam.cz>2012-07-19 13:32:57 +0000
commita9ba612fe47112bd476fbc42a1f232097e993b60 (patch)
tree6842cca5292c74c3e72b8424adadb9ba2c0cf854
parentb561a9d5f5054a13889b8167337b19aaecc23f5b (diff)
clist_modern
- Fix for ESC in clist_modern - Compatibility fix for searching with disabled filtering git-svn-id: http://svn.miranda-ng.org/main/trunk@1043 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index bd4b53c681..56375d2f0d 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -333,13 +333,15 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const
}
if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER)
{
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(group->cl.items[group->scanIndex]->szText));
- if (_tcsstr(lowered, dat->szQuickSearch))
-
- //if ((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)))
-
- {
+ 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));
+ 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)));
+ }
+ if (found) {
struct ClcGroup *contactGroup = group;
int contactScanIndex = group->scanIndex;
int foundindex;
@@ -651,10 +653,6 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa
dat->iInsertionMark = -1;
dat->dragStage = 0;
ReleaseCapture();
- } else if (dat->filterSearch && dat->szQuickSearch[0] != '\0') {
- dat->szQuickSearch[0] = 0;
- pcli->pfnSaveStateAndRebuildList(hwnd, dat);
- //pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
}
return 0;
}