You've already forked lazarus-ccr
fpspreadsheet: Fix incorrect row height when row switches from hidden to visible (https://forum.lazarus.freepascal.org/index.php?topic=58792.msg438138#msg438138).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8218 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -5967,26 +5967,30 @@ begin
|
|||||||
if h = 0 then
|
if h = 0 then
|
||||||
h := DefaultRowHeight; // Zoom factor is applied by getter function
|
h := DefaultRowHeight; // Zoom factor is applied by getter function
|
||||||
end;
|
end;
|
||||||
end else
|
end;
|
||||||
|
|
||||||
// No row record so far.
|
// No row record so far.
|
||||||
if Worksheet.GetCellCountInRow(sr) > 0 then
|
if lRow = nil then
|
||||||
begin
|
begin
|
||||||
// Case 1: This row does contain cells
|
if Worksheet.GetCellCountInRow(sr) > 0 then
|
||||||
lRow := Worksheet.AddRow(sr);
|
begin
|
||||||
if AEnforceCalcRowHeight then
|
// Case 1: This row does contain cells
|
||||||
h := CalcAutoRowHeight(ARow)
|
lRow := Worksheet.AddRow(sr);
|
||||||
else
|
if AEnforceCalcRowHeight then
|
||||||
h := DefaultRowHeight;
|
h := CalcAutoRowHeight(ARow)
|
||||||
lRow^.Height := CalcRowHeightToSheet(round(h / ZoomFactor));
|
else
|
||||||
if h <> DefaultRowHeight then
|
h := DefaultRowHeight;
|
||||||
lRow^.RowHeightType := rhtAuto
|
lRow^.Height := CalcRowHeightToSheet(round(h / ZoomFactor));
|
||||||
else
|
if h <> DefaultRowHeight then
|
||||||
lRow^.RowHeightType := rhtDefault;
|
lRow^.RowHeightType := rhtAuto
|
||||||
if h = 0 then
|
else
|
||||||
h := DefaultRowHeight; // Zoom factor is applied by getter function
|
lRow^.RowHeightType := rhtDefault;
|
||||||
end else
|
if h = 0 then
|
||||||
// Case 2: No cells in row
|
h := DefaultRowHeight; // Zoom factor is applied by getter function
|
||||||
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;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
inc(FZoomLock); // We don't want to modify the sheet row heights here.
|
inc(FZoomLock); // We don't want to modify the sheet row heights here.
|
||||||
|
@@ -326,9 +326,10 @@ function RichTextWidth(ACanvas: TCanvas; AWorkbook: TsWorkbook; ARect: TRect;
|
|||||||
var
|
var
|
||||||
painter: TsTextPainter;
|
painter: TsTextPainter;
|
||||||
begin
|
begin
|
||||||
|
// In contrast to RichTextHeight, the next two lines have no effect on col
|
||||||
|
// width when a column switches from hidden to visible.
|
||||||
if (ARect.Left = ARect.Right) or (ARect.Top = ARect.Bottom) then
|
if (ARect.Left = ARect.Right) or (ARect.Top = ARect.Bottom) then
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
painter := TsTextPainter.Create(ACanvas, AWorkbook, ARect, AText, ARichTextParams,
|
painter := TsTextPainter.Create(ACanvas, AWorkbook, ARect, AText, ARichTextParams,
|
||||||
AFontIndex, ATextRotation, haLeft, vaTop, AWordWrap, ARightToLeft, AZoomFactor);
|
AFontIndex, ATextRotation, haLeft, vaTop, AWordWrap, ARightToLeft, AZoomFactor);
|
||||||
try
|
try
|
||||||
@@ -345,9 +346,12 @@ function RichTextHeight(ACanvas: TCanvas; AWorkbook: TsWorkbook; ARect: TRect;
|
|||||||
var
|
var
|
||||||
painter: TsTextPainter;
|
painter: TsTextPainter;
|
||||||
begin
|
begin
|
||||||
|
{ -- causes incorrect row height, when row switches from hidden to visible.
|
||||||
|
// see: https://forum.lazarus.freepascal.org/index.php/topic,58792.msg438090.html#msg438090
|
||||||
|
|
||||||
if (ARect.Left = ARect.Right) or (ARect.Top = ARect.Bottom) then
|
if (ARect.Left = ARect.Right) or (ARect.Top = ARect.Bottom) then
|
||||||
exit(0);
|
exit(0);
|
||||||
|
}
|
||||||
painter := TsTextPainter.Create(ACanvas, AWorkbook, ARect, AText, ARichTextParams,
|
painter := TsTextPainter.Create(ACanvas, AWorkbook, ARect, AText, ARichTextParams,
|
||||||
AFontIndex, ATextRotation, haLeft, vaTop, AWordWrap, ARightToLeft, AZoomFactor);
|
AFontIndex, ATextRotation, haLeft, vaTop, AWordWrap, ARightToLeft, AZoomFactor);
|
||||||
try
|
try
|
||||||
|
Reference in New Issue
Block a user