summaryrefslogtreecommitdiff
path: root/plugins/QuickSearch/sr_window.pas
diff options
context:
space:
mode:
authorAlexey Kulakov <panda75@bk.ru>2014-01-22 14:15:42 +0000
committerAlexey Kulakov <panda75@bk.ru>2014-01-22 14:15:42 +0000
commit3ed7d45f598746e4ab0495a9caff96fe4b2127d9 (patch)
tree3fba042c213dd94c13b61cfd3b39e3d5fa5e0510 /plugins/QuickSearch/sr_window.pas
parent8963ae9891a77ecffc482d059d22e03a2a1b7961 (diff)
QuickSearch: crash fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@7826 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/QuickSearch/sr_window.pas')
-rw-r--r--plugins/QuickSearch/sr_window.pas24
1 files changed, 11 insertions, 13 deletions
diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas
index 47a1e7bf8a..64aef6a95d 100644
--- a/plugins/QuickSearch/sr_window.pas
+++ b/plugins/QuickSearch/sr_window.pas
@@ -5,7 +5,7 @@ interface
uses windows,m_api;
function OpenSrWindow(apattern:PWideChar;flags:LPARAM):boolean;
-function CloseSrWindow:boolean;
+function CloseSrWindow(save:boolean=true):boolean;
procedure RegisterColors;
@@ -1906,7 +1906,7 @@ begin
WM_DESTROY: begin
if srvhandle<>0 then DestroyServiceFunction(srvhandle);
if mnuhandle<>0 then CallService(MO_REMOVEMENUITEM,mnuhandle,0);
-
+
UnhookEvent(hAdd);
UnhookEvent(hDelete);
UnhookEvent(hChange);
@@ -1922,20 +1922,15 @@ begin
CopyRect(qsopt.grrect,rc);
// save column width/order
- SaveColumnOrder;
+ if grid<>0 then
+ SaveColumnOrder
+ else
+ grid:=0;
saveopt_wnd;
ListView_SetImageList(grid,0,LVSIL_SMALL);
- tmp:=GetDC(grid);
- h:=GetCurrentObject(tmp,OBJ_FONT);
- SendMessage(grid,WM_SETFONT,0,1);
- DeleteObject(h);
- ReleaseDC(grid,tmp);
-
- grid:=0;
-
if (qsopt.flags and QSO_SAVEPATTERN)<>0 then
begin
DBWriteUnicode(0,qs_module,'pattern',pattern);
@@ -2237,14 +2232,17 @@ end;
//----- base QS window functions -----
-function CloseSrWindow:boolean;
+function CloseSrWindow(save:boolean=true):boolean;
begin
if mainwnd<>0 then
begin
result:=true;
+ //!! cheat
+ if not save then
+ grid:=0;
+
DestroyWindow(mainwnd);
- mainwnd:=0;
FreeProtoList;
end
else