fpspreadsheet: Fix row heights incorrectly displayed in WorksheetGrid

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4045 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2015-03-17 11:42:57 +00:00
parent e36746f27d
commit 56373ed329

View File

@ -3959,8 +3959,10 @@ end;
calculating the row height from the max of the cell heights calculating the row height from the max of the cell heights
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
procedure TsCustomWorksheetGrid.UpdateRowHeights(AStartIndex: Integer = 0); procedure TsCustomWorksheetGrid.UpdateRowHeights(AStartIndex: Integer = 0);
const
DELTA = 10;
var var
i: Integer; r, r1, r2: Integer;
lRow: PRow; lRow: PRow;
h: Integer; h: Integer;
begin begin
@ -3979,14 +3981,20 @@ begin
end; end;
EndUpdate; EndUpdate;
} }
for i:=GCache.VisibleGrid.Top to GCache.VisibleGrid.Bottom do begin r1 := Max(FHeaderCount, GCache.VisibleGrid.Top - DELTA);
h := CalcAutoRowHeight(i); r2 := Min(RowCount-1, GCache.VisibleGrid.Bottom + DELTA);
for r:=r1 to r2 do
begin
if Worksheet <> nil then if Worksheet <> nil then
begin begin
lRow := Worksheet.FindRow(i - FHeaderCount); lRow := Worksheet.FindRow(r - FHeaderCount);
if (lRow <> nil) then if (lRow <> nil) then
h := CalcRowHeight(lRow^.Height); h := CalcRowHeight(lRow^.Height)
end; else
h := CalcAutoRowHeight(r);
end else
h := DefaultRowHeight;
RowHeights[r] := h;
end; end;
end; end;