Merged revision(s) 57005 #b63451bdf7 from trunk:

Grids: factor out IsEmptyRow function and correctly use the ARow paramter inside the function. Issue .
........

git-svn-id: branches/fixes_1_8@57034 -
This commit is contained in:
maxim 2018-01-09 22:41:57 +00:00
parent d53fad6c86
commit 8fd8b1ab7c

View File

@ -1075,6 +1075,7 @@ type
procedure InvalidateFocused;
function GetIsCellTitle(aCol,aRow: Integer): boolean; virtual;
function GetIsCellSelected(aCol, aRow: Integer): boolean; virtual;
function IsEmptyRow(ARow: Integer): Boolean;
function IsMouseOverCellButton(X,Y: Integer): boolean;
procedure KeyDown(var Key : Word; Shift : TShiftState); override;
procedure KeyUp(var Key : Word; Shift : TShiftState); override;
@ -5244,7 +5245,19 @@ begin
end;
end;
function TCustomGrid.GetDefColWidth: integer;
function TCustomGrid.IsEmptyRow(ARow: Integer): Boolean;
var
i: Integer;
begin
Result := False;
for i:=FixedCols to ColCount-1 do
if GetCells(i, ARow)<>'' then begin
Exit;
end;
Result := True;
end;
function TCustomGrid.GetDefColWidth: Integer;
begin
if FDefColWidth<0 then
begin
@ -5255,7 +5268,7 @@ begin
Result := FDefColWidth;
end;
function TCustomGrid.GetDefRowHeight: integer;
function TCustomGrid.GetDefRowHeight: Integer;
begin
if FDefRowHeight<0 then
begin
@ -7138,18 +7151,6 @@ var
end;
end;
function IsEmptyRow(ARow: Integer): Boolean;
var
i: Integer;
begin
Result := False;
for i:=FixedCols to ColCount-1 do
if GetCells(i, FRow)<>'' then begin
Exit;
end;
Result := True;
end;
const
cBidiMove: array[Boolean] of Integer = (1, -1);
begin
@ -7482,18 +7483,6 @@ var
NCol,NRow: Integer;
SelOk: Boolean;
function IsEmptyRow(ARow: Integer): Boolean;
var
i: Integer;
begin
Result := False;
for i:=FixedCols to ColCount-1 do
if GetCells(i, FRow)<>'' then begin
Exit;
end;
Result := True;
end;
begin
// Reference
if not Relative then begin