mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-18 03:09:30 +01:00
win32 interface: implemented unicode handling of old style file open dialog (bug #11593)
git-svn-id: trunk@15647 -
This commit is contained in:
parent
2a5dbf5d28
commit
23f6d38d68
@ -648,20 +648,28 @@ var
|
|||||||
procedure SetFilesPropertyForOldStyle(AFiles:TStrings);
|
procedure SetFilesPropertyForOldStyle(AFiles:TStrings);
|
||||||
var
|
var
|
||||||
SelectedStr: string;
|
SelectedStr: string;
|
||||||
|
FolderName: string;
|
||||||
I,Start: integer;
|
I,Start: integer;
|
||||||
begin
|
begin
|
||||||
SelectedStr:=StrPas(OpenFile^.lpStrFile);
|
{$ifdef WindowsUnicodeSupport}
|
||||||
I:=Pos(' ',SelectedStr);
|
if UnicodeEnabledOS then
|
||||||
if I = 0 then
|
SelectedStr:=UTF8Encode(PWideChar(OpenFile^.lpStrFile))
|
||||||
|
else
|
||||||
|
SelectedStr:=AnsiToUtf8(OpenFile^.lpStrFile);
|
||||||
|
{$else}
|
||||||
|
SelectedStr:=OpenFile^.lpStrFile;
|
||||||
|
{$endif}
|
||||||
|
if not (ofAllowMultiSelect in AOpenDialog.Options) then
|
||||||
AFiles.Add(SelectedStr)
|
AFiles.Add(SelectedStr)
|
||||||
else begin
|
else begin
|
||||||
Delete(SelectedStr,1,I);
|
Start:=Pos(' ',SelectedStr);
|
||||||
|
FolderName := copy(SelectedStr,1,start-1);
|
||||||
SelectedStr:=SelectedStr+' ';
|
SelectedStr:=SelectedStr+' ';
|
||||||
Start:=1;
|
inc(start);
|
||||||
for I:= 1 to Length(SelectedStr) do
|
for I:= Start to Length(SelectedStr) do
|
||||||
if SelectedStr[I] = ' ' then
|
if SelectedStr[I] = ' ' then
|
||||||
begin
|
begin
|
||||||
AFiles.Add(ExpandFileName(Copy(SelectedStr,Start,I - Start)));
|
AFiles.Add(ExpandFileName(FolderName+Copy(SelectedStr,Start,I - Start)));
|
||||||
Start:=Succ(I);
|
Start:=Succ(I);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user