You've already forked lazarus-ccr
fpspreadsheet: In TsWorksheetGrid, fix a minor inaccuracy of cell text overflow due to ignoring constCellPadding value so far.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3602 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -829,7 +829,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
cell := FDrawingCell;
|
cell := FDrawingCell;
|
||||||
if (cell = nil) or (cell^.ContentType <> cctUTF8String) then
|
if (cell = nil) or (cell^.ContentType <> cctUTF8String) then // non-label cells do not overflow!
|
||||||
exit;
|
exit;
|
||||||
if (uffWordWrap in cell^.UsedFormattingFields) then
|
if (uffWordWrap in cell^.UsedFormattingFields) then
|
||||||
exit;
|
exit;
|
||||||
@@ -844,7 +844,7 @@ begin
|
|||||||
else
|
else
|
||||||
txtalign := haDefault;
|
txtalign := haDefault;
|
||||||
PrepareCanvas(ACol, ARow, AState);
|
PrepareCanvas(ACol, ARow, AState);
|
||||||
len := Canvas.TextWidth(txt);
|
len := Canvas.TextWidth(txt) + 2*constCellPadding;
|
||||||
ACol1 := ACol;
|
ACol1 := ACol;
|
||||||
ACol2 := ACol;
|
ACol2 := ACol;
|
||||||
r := GetWorksheetRow(ARow);
|
r := GetWorksheetRow(ARow);
|
||||||
@@ -1546,7 +1546,6 @@ begin
|
|||||||
then
|
then
|
||||||
Continue;
|
Continue;
|
||||||
// Overflow possible from non-merged, non-right-aligned, horizontal label cells
|
// Overflow possible from non-merged, non-right-aligned, horizontal label cells
|
||||||
// if (cell^.MergedNeighbors = []) and (cell^.ContentType = cctUTF8String) and
|
|
||||||
if (cell^.MergeBase = nil) and (cell^.ContentType = cctUTF8String) and
|
if (cell^.MergeBase = nil) and (cell^.ContentType = cctUTF8String) and
|
||||||
not (uffTextRotation in cell^.UsedFormattingFields) and
|
not (uffTextRotation in cell^.UsedFormattingFields) and
|
||||||
(uffHorAlign in cell^.UsedFormattingFields) and (cell^.HorAlignment <> haRight)
|
(uffHorAlign in cell^.UsedFormattingFields) and (cell^.HorAlignment <> haRight)
|
||||||
@@ -1572,7 +1571,6 @@ begin
|
|||||||
then
|
then
|
||||||
continue;
|
continue;
|
||||||
// Overflow possible from non-merged, horizontal, non-left-aligned label cells
|
// Overflow possible from non-merged, horizontal, non-left-aligned label cells
|
||||||
// if (cell^.MergedNeighbors = []) and (cell^.ContentType = cctUTF8String) and
|
|
||||||
if (cell^.MergeBase = nil) and (cell^.ContentType = cctUTF8String) and
|
if (cell^.MergeBase = nil) and (cell^.ContentType = cctUTF8String) and
|
||||||
not (uffTextRotation in cell^.UsedFormattingFields) and
|
not (uffTextRotation in cell^.UsedFormattingFields) and
|
||||||
(uffHorAlign in cell^.UsedFormattingFields) and (cell^.HorAlignment <> haLeft)
|
(uffHorAlign in cell^.UsedFormattingFields) and (cell^.HorAlignment <> haLeft)
|
||||||
@@ -1584,6 +1582,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Here begins the drawing loop of all cells in the row
|
||||||
while (gc <= gcLast) do begin
|
while (gc <= gcLast) do begin
|
||||||
gr := ARow;
|
gr := ARow;
|
||||||
rct := saved_rct;
|
rct := saved_rct;
|
||||||
@@ -1594,7 +1593,6 @@ begin
|
|||||||
if Assigned(FWorksheet) and (gr >= FixedRows) and (gc >= FixedCols) then
|
if Assigned(FWorksheet) and (gr >= FixedRows) and (gc >= FixedCols) then
|
||||||
begin
|
begin
|
||||||
cell := FWorksheet.FindCell(GetWorksheetRow(gr), GetWorksheetCol(gc));
|
cell := FWorksheet.FindCell(GetWorksheetRow(gr), GetWorksheetCol(gc));
|
||||||
//if (cell = nil) or (cell^.MergedNeighbors = []) then begin
|
|
||||||
if (cell = nil) or (cell^.Mergebase = nil) then
|
if (cell = nil) or (cell^.Mergebase = nil) then
|
||||||
begin
|
begin
|
||||||
// single cell
|
// single cell
|
||||||
@@ -1628,8 +1626,6 @@ begin
|
|||||||
|
|
||||||
if (rct.Left < rct.Right) and HorizontalIntersect(rct, clipArea) then
|
if (rct.Left < rct.Right) and HorizontalIntersect(rct, clipArea) then
|
||||||
begin
|
begin
|
||||||
// IntersectRect(rct, rct, clipArea);
|
|
||||||
// if rct.Left < clipArea.Left then rct.Left := clipArea.Left;
|
|
||||||
Rs := (goRowSelect in Options);
|
Rs := (goRowSelect in Options);
|
||||||
gds := GetGridDrawState(gc, gr);
|
gds := GetGridDrawState(gc, gr);
|
||||||
DoDrawCell(gc, gr);
|
DoDrawCell(gc, gr);
|
||||||
|
Reference in New Issue
Block a user