From 006d6e0dcfade21a6952cf970c3a9b8ef5328f8e Mon Sep 17 00:00:00 2001 From: juha Date: Sat, 17 Oct 2020 16:19:13 +0000 Subject: [PATCH] LCL: In TOpenDialog.DoExecute replace testing DereferenceLinks with an assertion. git-svn-id: trunk@64037 - --- lcl/include/commondialog.inc | 2 +- lcl/include/filedialog.inc | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lcl/include/commondialog.inc b/lcl/include/commondialog.inc index c2bfbca064..8224659e33 100644 --- a/lcl/include/commondialog.inc +++ b/lcl/include/commondialog.inc @@ -184,7 +184,7 @@ begin end; Result := (FUserChoice = mrOk); {$ifdef DebugCommonDialogEvents} - debugln(['TCommonDialog.DoExecute End']); + debugln(['TCommonDialog.DoExecute End, Result=', Result]); {$endif} end; diff --git a/lcl/include/filedialog.inc b/lcl/include/filedialog.inc index 985cf16b03..05705a4896 100644 --- a/lcl/include/filedialog.inc +++ b/lcl/include/filedialog.inc @@ -248,12 +248,10 @@ var i: integer; begin if Filename<>'' then Filename:=GetPhysicalFilename(FileName,pfeOriginal); - if Files<>nil then begin - for i:=0 to Files.Count-1 do begin + if Files<>nil then + for i:=0 to Files.Count-1 do if Files[i]<>'' then Files[i]:=GetPhysicalFilename(Files[i],pfeOriginal); - end; - end; end; procedure TOpenDialog.DereferenceLinks; @@ -407,14 +405,16 @@ end; function TOpenDialog.DoExecute: boolean; begin Result:=inherited DoExecute; - if (not (ofNoResolveLinks in Options)) then begin - if TMethod(@Self.DereferenceLinks).Code <> Pointer(@TOpenDialog.DereferenceLinks) - then begin - DereferenceLinks{%H-}; // call for compatibility - end else - ResolveLinks; + if not (ofNoResolveLinks in Options) then begin + Assert(TMethod(@Self.DereferenceLinks).Code = Pointer(@TOpenDialog.DereferenceLinks), + 'TOpenDialog.DoExecute: DereferenceLinks mismatch.'); + //if TMethod(@Self.DereferenceLinks).Code <> Pointer(@TOpenDialog.DereferenceLinks) + //then begin + // DereferenceLinks{%H-}; // call for compatibility + //end else + ResolveLinks; end; - if (not (ofNoChangeDir in Options)) then begin + if not (ofNoChangeDir in Options) then begin if (ExtractFilePath(Filename)<>'') then InitialDir:=ExtractFilePath(Filename) else if (Files.Count>0) and (ExtractFilePath(Files[0])<>'') then