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,8 +5967,11 @@ 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 lRow = nil then
|
||||||
|
begin
|
||||||
if Worksheet.GetCellCountInRow(sr) > 0 then
|
if Worksheet.GetCellCountInRow(sr) > 0 then
|
||||||
begin
|
begin
|
||||||
// Case 1: This row does contain cells
|
// Case 1: This row does contain cells
|
||||||
@@ -5988,6 +5991,7 @@ begin
|
|||||||
// Case 2: No cells in row
|
// 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;
|
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.
|
||||||
RowHeights[ARow] := h;
|
RowHeights[ARow] := h;
|
||||||
|
@@ -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