mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 05:49:30 +02:00
Grids: Dont restore backed-up value of RowCount when using InsertRowWithValues on an empty grid (Issue #0026943).
git-svn-id: trunk@46787 -
This commit is contained in:
parent
60d8f24cfb
commit
7d8ba3e55e
@ -10691,11 +10691,15 @@ end;
|
||||
procedure TCustomStringGrid.InsertRowWithValues(Index: Integer;
|
||||
Values: array of String);
|
||||
var
|
||||
i: Integer;
|
||||
i, OldRC: Integer;
|
||||
begin
|
||||
OldRC := RowCount;
|
||||
if Length(Values) > ColCount then
|
||||
ColCount := Length(Values);
|
||||
InsertColRow(false, Index);
|
||||
//if RowCount was 0, then setting ColCount restores RowCount (from FGridPropBackup)
|
||||
//which is unwanted here, so reset it (Issue #0026943)
|
||||
if (OldRc = 0) then RowCount := 1;
|
||||
for i := 0 to Length(Values)-1 do
|
||||
Cells[i, Index] := Values[i];
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user