Patches from bug #17761 TShellListView Mask: duplicated items if mask is " *.ext;*.ext "

git-svn-id: trunk@30896 -
This commit is contained in:
sekelsenmat 2011-05-25 08:33:29 +00:00
parent e14704beb2
commit 82427d006f
3 changed files with 9 additions and 3 deletions

View File

@ -38,7 +38,7 @@ uses
LCLProc, Forms, Controls, GraphType, StringHashList, ButtonPanel,
Graphics, StdCtrls, Buttons, Menus, LCLType, ExtCtrls, LCLIntf,
Dialogs, Grids, EditBtn, PropertyStorage, TextTools, FrmSelectProps,
StringsPropEditDlg, ColumnDlg, FileUtil, ObjInspStrConsts,
StringsPropEditDlg, ColumnDlg, FileUtil, FileCtrl, ObjInspStrConsts,
CollectionPropEditForm, PropEditUtils;
const
@ -6254,6 +6254,7 @@ begin
RegisterPropertyEditor(TypeInfo(TComponent), nil, '', TComponentPropertyEditor);
RegisterPropertyEditor(TypeInfo(TCollection), nil, '', TCollectionPropertyEditor);
RegisterPropertyEditor(TypeInfo(AnsiString), TFileDialog, 'Filter', TFileDlgFilterProperty);
RegisterPropertyEditor(TypeInfo(AnsiString), TFilterComboBox, 'Filter', TFileDlgFilterProperty);
RegisterPropertyEditor(TypeInfo(AnsiString), TFileNameEdit, 'Filter', TFileDlgFilterProperty);
RegisterPropertyEditor(TypeInfo(AnsiString), TCustomPropertyStorage, 'Filename', TFileNamePropertyEditor);
RegisterPropertyEditor(TypeInfo(TAnchorSide), TControl, 'AnchorSideLeft', THiddenPropertyEditor);

View File

@ -564,10 +564,11 @@ begin
ParserState := 0;
Position := 1;
AFilter := AFilter + '|'; // to prevent ignoring of last filter
for i := 1 to Length(AFilter) do
begin
if Copy(AFilter, i, 1) = '|' then
if AFilter[i] = '|' then
begin
case ParserState of
0:

View File

@ -443,6 +443,7 @@ begin
for i := 0 to MaskStrings.Count - 1 do
begin
if MaskStrings.IndexOf(MaskStrings[i]) < i then Continue; // From patch from bug 17761: TShellListView Mask: duplicated items if mask is " *.ext;*.ext "
SearchStr := IncludeTrailingPathDelimiter(ABaseDir) + MaskStrings.Strings[i];
FindResult := FindFirstUTF8(SearchStr, faAnyFile, DirInfo);
@ -478,7 +479,8 @@ begin
// Mark if it is a directory (ObjectData <> nil)
if IsDirectory then ObjectData := AResult
else ObjectData := nil;
AResult.AddObject(DirInfo.Name, ObjectData)
if AResult.IndexOf(DirInfo.Name) < 0 then // From patch from bug 17761: TShellListView Mask: duplicated items if mask is " *.ext;*.ext "
AResult.AddObject(DirInfo.Name, ObjectData)
end else
Files.Add ( TFileItem.Create(DirInfo));
end;
@ -502,6 +504,8 @@ begin
for i:=0 to Files.Count-1 do begin
FileItem:=TFileItem(Files[i]);
if (i > 0) and (TFileItem(Files[i]).Name = TFileItem(Files[i - 1]).Name) then
Continue; // cause Files is sorted // From patch from bug 17761: TShellListView Mask: duplicated items if mask is " *.ext;*.ext "
if FileItem.isFolder then
AResult.AddObject(FileItem.Name, ObjectData)
else