mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 06:08:17 +02:00
Moves the code to set the initial dir for win32 from the LCL to the win32 widgetset. Fixes bug #17772
git-svn-id: trunk@28055 -
This commit is contained in:
parent
65fda5bbfe
commit
56f71a1c43
@ -113,7 +113,6 @@ type
|
||||
FFilterIndex: Integer;
|
||||
FHistoryList: TStrings;
|
||||
FInitialDir: string;
|
||||
FOldWorkingDir: string;
|
||||
FOnHelpClicked: TNotifyEvent;
|
||||
FOnTypeChange: TNotifyEvent;
|
||||
procedure SetDefaultExt(const AValue: string);
|
||||
|
@ -56,13 +56,7 @@ end;
|
||||
{------------------------------------------------------------------------------}
|
||||
function TFileDialog.Execute : boolean;
|
||||
begin
|
||||
FOldWorkingDir:=GetCurrentDirUTF8;
|
||||
if FInitialDir<>'' then SetCurrentDirUTF8(FInitialDir);
|
||||
try
|
||||
Result:=inherited Execute;
|
||||
finally
|
||||
SetCurrentDirUTF8(FOldWorkingDir);
|
||||
end;
|
||||
Result:=inherited Execute;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -723,11 +723,15 @@ end;
|
||||
class procedure TWin32WSOpenDialog.ShowModal(const ACommonDialog: TCommonDialog);
|
||||
var
|
||||
State: TApplicationState;
|
||||
lOldWorkingDir, lInitialDir: string;
|
||||
begin
|
||||
if ACommonDialog.Handle <> 0 then
|
||||
begin
|
||||
State := SaveApplicationState;
|
||||
lOldWorkingDir:=GetCurrentDirUTF8;
|
||||
try
|
||||
lInitialDir := TOpenDialog(ACommonDialog).InitialDir;
|
||||
if lInitialDir <>'' then SetCurrentDirUTF8(lInitialDir);
|
||||
{$ifdef WindowsUnicodeSupport}
|
||||
if UnicodeEnabledOS then
|
||||
ProcessFileDialogResult(TOpenDialog(ACommonDialog),
|
||||
@ -740,6 +744,7 @@ begin
|
||||
GetOpenFileName(LPOPENFILENAME(ACommonDialog.Handle)));
|
||||
{$endif}
|
||||
finally
|
||||
SetCurrentDirUTF8(lOldWorkingDir);
|
||||
RestoreApplicationState(State);
|
||||
end;
|
||||
end;
|
||||
@ -750,11 +755,15 @@ end;
|
||||
class procedure TWin32WSSaveDialog.ShowModal(const ACommonDialog: TCommonDialog);
|
||||
var
|
||||
State: TApplicationState;
|
||||
lOldWorkingDir, lInitialDir: string;
|
||||
begin
|
||||
if ACommonDialog.Handle <> 0 then
|
||||
begin
|
||||
State := SaveApplicationState;
|
||||
lOldWorkingDir:=GetCurrentDirUTF8;
|
||||
try
|
||||
lInitialDir := TSaveDialog(ACommonDialog).InitialDir;
|
||||
if lInitialDir <>'' then SetCurrentDirUTF8(lInitialDir);
|
||||
{$ifdef WindowsUnicodeSupport}
|
||||
if UnicodeEnabledOS then
|
||||
ProcessFileDialogResult(TOpenDialog(ACommonDialog),
|
||||
@ -767,6 +776,7 @@ begin
|
||||
GetSaveFileName(LPOPENFILENAME(ACommonDialog.Handle)));
|
||||
{$endif}
|
||||
finally
|
||||
SetCurrentDirUTF8(lOldWorkingDir);
|
||||
RestoreApplicationState(State);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user