win, prevent two cases of case sensitive fname comparison

This commit is contained in:
Basile Burg 2017-03-11 12:19:07 +01:00
parent 48b6a258a5
commit ff7bd9fcb2
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
2 changed files with 15 additions and 5 deletions

View File

@ -481,7 +481,7 @@ begin
for i := 0 to PageControl.PageCount-1 do
begin
result := getDocument(i);
if result.fileName = fname then
if SameFileName(result.fileName, fname) then
exit;
end;
result := nil;

View File

@ -27,7 +27,7 @@ type
published
property maxCount: Integer read fMaxCount write setMaxCount;
public
constructor Create; virtual;
constructor create; virtual;
procedure Insert(index: Integer; const value: string); override;
property objectTag: TObject read fObj write fObj;
end;
@ -39,6 +39,7 @@ type
protected
function checkItem(const value: string): boolean; override;
public
constructor create; override;
procedure assign(source: TPersistent); override;
end;
@ -106,7 +107,7 @@ end;
function TCEMruList.checkItem(const value: string): boolean;
var
i: NativeInt;
i: integer;
begin
i := indexOf(value);
if i = -1 then
@ -143,6 +144,14 @@ begin
clearOutOfRange;
end;
constructor TCEMRUFileList.create;
begin
inherited;
{$IFDEF WINDOWS}
CaseSensitive := true;
{$ENDIF}
end;
procedure TCEMRUFileList.assign(source: TPersistent);
var
i: Integer;
@ -224,8 +233,9 @@ procedure TCEMRUProjectList.projClosing(project: ICECommonProject);
var
fname: string;
begin
if project = nil then exit;
//
if project = nil then
exit;
fname := project.filename;
if fname.fileExists then
Insert(0, fname);