fpspreadsheet: Make TsWorksheetGrid respect visibility of rows/columns by setting their width/height to zero.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6637 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-09-06 11:48:35 +00:00
parent 8a98b1856e
commit 119815fd39

View File

@@ -5722,11 +5722,15 @@ begin
if Worksheet <> nil then
begin
lCol := Worksheet.FindCol(ACol - FHeaderCount);
if (lCol <> nil) and lCol^.Hidden then
w := 0
else begin
if (lCol <> nil) and (lCol^.ColWidthType = cwtCustom) then
w100 := CalcColWidthFromSheet(lCol^.Width)
else
w100 := CalcColWidthFromSheet(Worksheet.ReadDefaultColWidth(Workbook.Units));
w := round(w100 * ZoomFactor);
end;
end else
w := DefaultColWidth; // Zoom factor has already been applied by getter
ColWidths[ACol] := w;
@@ -5769,12 +5773,15 @@ begin
if ARow < FHeaderCount then
exit;
h := 0;
h := DefaultRowHeight;
if Worksheet <> nil then
begin
sr := ARow - FHeaderCount; // worksheet row index
lRow := Worksheet.FindRow(sr);
if (lRow <> nil) then begin
if lRow^.Hidden then
h := 0
else begin
case lRow^.RowHeightType of
rhtCustom:
begin
@@ -5811,6 +5818,9 @@ begin
end;
end;
end; // case
if h = 0 then
h := DefaultRowHeight; // Zoom factor is applied by getter function
end;
end else
// No row record so far.
if Worksheet.GetCellCountInRow(sr) > 0 then
@@ -5818,21 +5828,21 @@ begin
// Case 1: This row does contain cells
lRow := Worksheet.AddRow(sr);
if AEnforceCalcRowHeight then
h := CalcAutoRowHeight(ARow) else
h := CalcAutoRowHeight(ARow)
else
h := DefaultRowHeight;
lRow^.Height := CalcRowHeightToSheet(round(h / ZoomFactor));
if h <> DefaultRowHeight then
lRow^.RowHeightType := rhtAuto
else
lRow^.RowHeightType := rhtDefault;
if h = 0 then
h := DefaultRowHeight; // Zoom factor is applied by getter function
end else
// Case 2: No cells in row
h := DefaultRowHeight; // Zoom factor is applied by getter function
end;
if h = 0 then
h := DefaultRowHeight; // Zoom factor is applied by getter function
inc(FZoomLock); // We don't want to modify the sheet row heights here.
RowHeights[ARow] := h;
dec(FZoomLock);