mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 19:49:18 +02:00
win32: fix OpenDialog.FileName retrieving when FileName already contains path (#0012364)
git-svn-id: trunk@16977 -
This commit is contained in:
parent
d15a65ac56
commit
294989aa80
@ -173,10 +173,19 @@ var
|
||||
AOpenDialog: TOpenDialog;
|
||||
|
||||
procedure SetFilesPropertyCustomFiles(AFiles:TStrings);
|
||||
|
||||
procedure AddFile(FolderName, FileName: String); inline;
|
||||
begin
|
||||
if ExtractFilePath(FileName) = '' then
|
||||
AFiles.Add(FolderName + FileName)
|
||||
else
|
||||
AFiles.Add(FileName);
|
||||
end;
|
||||
|
||||
var
|
||||
i, Start, len: integer;
|
||||
FolderName: string;
|
||||
FileNames: String;
|
||||
FileNames: string;
|
||||
begin
|
||||
{$ifdef WindowsUnicodeSupport}
|
||||
if UnicodeEnabledOS then
|
||||
@ -203,14 +212,14 @@ var
|
||||
i := Start + 1;
|
||||
while FileNames[i] <> '"' do
|
||||
inc(i);
|
||||
AFiles.Add(FolderName + Copy(FileNames, Start + 1, I - Start - 1));
|
||||
start := i+1;
|
||||
while (start <= len) and (FileNames[Start] <> #0) and (FileNames[start] <> '"') do
|
||||
AddFile(FolderName, Copy(FileNames, Start + 1, I - Start - 1));
|
||||
Start := i + 1;
|
||||
while (Start <= len) and (FileNames[Start] <> #0) and (FileNames[Start] <> '"') do
|
||||
inc(Start);
|
||||
end;
|
||||
end
|
||||
else
|
||||
AFiles.Add(FolderName + FileNames);
|
||||
AddFile(FolderName, FileNames);
|
||||
end;
|
||||
|
||||
procedure SetFilesPropertyForOldStyle(AFiles:TStrings);
|
||||
|
Loading…
Reference in New Issue
Block a user