summaryrefslogtreecommitdiff
path: root/plugins/QuickSearch/sr_optdialog.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_optdialog.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_optdialog.pas')
-rw-r--r--plugins/QuickSearch/sr_optdialog.pas66
1 files changed, 19 insertions, 47 deletions
diff --git a/plugins/QuickSearch/sr_optdialog.pas b/plugins/QuickSearch/sr_optdialog.pas
index 6c658f6ec4..68ad05a322 100644
--- a/plugins/QuickSearch/sr_optdialog.pas
+++ b/plugins/QuickSearch/sr_optdialog.pas
@@ -718,6 +718,7 @@ var
i,idx:integer;
itemsel:integer;
listhwnd:hwnd;
+ tmpbool:bool;
begin
result:=0;
@@ -785,23 +786,6 @@ begin
PSN_APPLY: begin
// checkboxes
- listhwnd:=GetDlgItem(Dialog,IDC_LIST);
-
- clear_columns(qsopt.columns);
- qsopt.numcolumns:=SendMessage(listhwnd,LVM_GETITEMCOUNT,0,0);
- for i:=0 to qsopt.numcolumns-1 do
- begin
- idx:=LV_GetLParam(listhwnd,i);
- with editcolumns[idx] do
- begin
- if ListView_GetCheckSTate(listhwnd,i)=0 then
- flags:=flags and not COL_ON
- else
- flags:=flags or COL_ON or COL_FILTER;
- end;
- CloneColumn(qsopt.columns[i],editcolumns[idx]);
- end;
-
qsopt.flags:=qsopt.flags and not QSO_MAINOPTIONS;
if IsDlgButtonChecked(Dialog,IDC_CH_SORTSTATUS)<>BST_UNCHECKED then
@@ -821,40 +805,28 @@ begin
if IsDlgButtonChecked(Dialog,IDC_CH_SAVEPATTERN)<>BST_UNCHECKED then
qsopt.flags:=qsopt.flags or QSO_SAVEPATTERN;
-{
- if IsDlgButtonChecked(Dialog,IDC_CH_SORTSTATUS)<>BST_UNCHECKED then
- qsopt.flags:=qsopt.flags or QSO_SORTBYSTATUS
- else
- qsopt.flags:=qsopt.flags and not QSO_SORTBYSTATUS;
-
- if IsDlgButtonChecked(Dialog,IDC_CH_AUTOCLOSE)<>BST_UNCHECKED then
- qsopt.flags:=qsopt.flags or QSO_AUTOCLOSE
- else
- qsopt.flags:=qsopt.flags and not QSO_AUTOCLOSE;
- if IsDlgButtonChecked(Dialog,IDC_CH_USETOOLSTYLE)<>BST_UNCHECKED then
- qsopt.flags:=qsopt.flags or QSO_TOOLSTYLE
- else
- qsopt.flags:=qsopt.flags and not QSO_TOOLSTYLE;
+ tmpbool:=CloseSrWindow(false);
- if IsDlgButtonChecked(Dialog,IDC_CH_DRAWGRID)<>BST_UNCHECKED then
- qsopt.flags:=qsopt.flags or QSO_DRAWGRID
- else
- qsopt.flags:=qsopt.flags and not QSO_DRAWGRID;
-
- if IsDlgButtonChecked(Dialog,IDC_CH_CLIENTICONS)<>BST_UNCHECKED then
- qsopt.flags:=qsopt.flags or QSO_CLIENTICONS
- else
- qsopt.flags:=qsopt.flags and not QSO_CLIENTICONS;
+ listhwnd:=GetDlgItem(Dialog,IDC_LIST);
+ clear_columns(qsopt.columns);
+ qsopt.numcolumns:=SendMessage(listhwnd,LVM_GETITEMCOUNT,0,0);
+ for i:=0 to qsopt.numcolumns-1 do
+ begin
+ idx:=LV_GetLParam(listhwnd,i);
+ with editcolumns[idx] do
+ begin
+ if ListView_GetCheckSTate(listhwnd,i)=0 then
+ flags:=flags and not COL_ON
+ else
+ flags:=flags or COL_ON or COL_FILTER;
+ end;
+ CloneColumn(qsopt.columns[i],editcolumns[idx]);
+ end;
- if IsDlgButtonChecked(Dialog,IDC_CH_SAVEPATTERN)<>BST_UNCHECKED then
- qsopt.flags:=qsopt.flags or QSO_SAVEPATTERN
- else
- qsopt.flags:=qsopt.flags and not QSO_SAVEPATTERN;
-}
saveopt_db;
- //?? refresh QS window if it was opened
- if CloseSrWindow then
+
+ if tmpbool then
OpenSrWindow(nil,qsopt.flags);
result:=1;
end;