diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 2897055e68..f4a09f2474 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -4368,6 +4368,8 @@ begin {$endif} Result := False; + if Item=nil then + Exit; if FCanDoBinarySearch then BinarySearch else diff --git a/lcl/editbtn.pas b/lcl/editbtn.pas index 4e23f7d4d8..2a329cc7a3 100644 --- a/lcl/editbtn.pas +++ b/lcl/editbtn.pas @@ -2119,7 +2119,10 @@ begin case AKind of dkOpen, dkPictureOpen: begin - O := TOpenDialog.Create(Self); + if AKind = dkPictureOpen then + O := TOpenPictureDialog.Create(Self) + else + O := TOpenDialog.Create(Self); Result := O; end; dkSave, dkPictureSave: diff --git a/lcl/grids.pas b/lcl/grids.pas index b93a56c8b4..83187c2462 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -10538,8 +10538,12 @@ var ini := P; while (P^<>#0) and (P^<>#9) do Inc(P); - SetLength(St, P-Ini); - Move(Ini^,St[1],P-Ini); + if P=Ini then + St := '' + else begin + SetLength(St, P-Ini); + Move(Ini^,St[1],P-Ini); + end; SubL.Add(St); if P^<>#0 then Inc(P);