@@ -6,7 +6,7 @@ interface
66 System.Classes, System.SysUtils, Vcl.Forms, Winapi.Windows, Winapi.Messages, System.Types, Vcl.StdCtrls, Vcl.Clipbrd,
77 SizeGrip, apphelpers, Vcl.Graphics, Vcl.Dialogs, gnugettext, Vcl.ImgList, Vcl.VirtualImageList, Vcl.ComCtrls,
88 Winapi.ShLwApi, Vcl.ExtCtrls, VirtualTrees, VirtualTrees.Types, SynRegExpr, Vcl.Controls, Winapi.ShlObj,
9- SynEditMiscClasses, SynUnicode, Vcl.Themes, Vcl.GraphUtil;
9+ SynEditMiscClasses, SynUnicode, Vcl.Themes, Vcl.GraphUtil, Math ;
1010
1111type
1212 // Form with a sizegrip in the lower right corner, without the need for a statusbar
@@ -382,7 +382,7 @@ procedure TExtForm.FilterNodesByEdit(Edit: TButtonedEdit; Tree: TVirtualStringTr
382382var
383383 rx: TRegExpr;
384384 Node: PVirtualNode;
385- i: Integer;
385+ i, ColumnCount : Integer;
386386 match: Boolean;
387387 CellText: String;
388388begin
@@ -407,8 +407,10 @@ procedure TExtForm.FilterNodesByEdit(Edit: TButtonedEdit; Tree: TVirtualStringTr
407407 if not Tree.HasChildren[Node] then begin
408408 // Don't filter anything if the filter text is empty
409409 match := rx.Expression = ' ' ;
410+ // Suport trees with 0 defined columns, like the shortcut tree in preferences
411+ ColumnCount := Max(Tree.Header.Columns.Count, 1 );
410412 // Search for given text in node's captions
411- if not match then for i := 0 to Tree.Header.Columns.Count - 1 do begin
413+ if not match then for i:= 0 to ColumnCount - 1 do begin
412414 CellText := Tree.Text[Node, i];
413415 match := rx.Exec(CellText);
414416 if match then
0 commit comments