You've already forked lazarus-ccr
fpspreadsheet: Fix drawing of comment marker in TsWordsheetGrid for overflowing cells.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3929 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1576,7 +1576,7 @@ var
|
|||||||
sr, sr1,sc1,sr2,sc2: Cardinal; // sheet row/column
|
sr, sr1,sc1,sr2,sc2: Cardinal; // sheet row/column
|
||||||
gr, gc, gcNext, gcLast, gc1, gc2, gcLastUsed: Integer; // grid row/column
|
gr, gc, gcNext, gcLast, gc1, gc2, gcLastUsed: Integer; // grid row/column
|
||||||
i: Integer;
|
i: Integer;
|
||||||
rct, saved_rct, temp_rct: TRect;
|
rct, saved_rct, temp_rct, commentcell_rct: TRect;
|
||||||
clipArea: Trect;
|
clipArea: Trect;
|
||||||
cell: PCell;
|
cell: PCell;
|
||||||
fmt: PsCellFormat;
|
fmt: PsCellFormat;
|
||||||
@ -1712,6 +1712,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
// single cell
|
// single cell
|
||||||
FDrawingCell := cell;
|
FDrawingCell := cell;
|
||||||
|
if (cell <> nil) and (cell^.Comment <> '') then
|
||||||
|
commentcell_rct := CellRect(gc, gr)
|
||||||
|
else
|
||||||
|
commentcell_rct := Rect(0,0,0,0);
|
||||||
// Special treatment of overflowing cells
|
// Special treatment of overflowing cells
|
||||||
if FTextOverflow then
|
if FTextOverflow then
|
||||||
begin
|
begin
|
||||||
@ -1740,6 +1744,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
gds := GetGridDrawState(gc, gr);
|
gds := GetGridDrawState(gc, gr);
|
||||||
DoDrawCell(gc, gr, rct, temp_rct);
|
DoDrawCell(gc, gr, rct, temp_rct);
|
||||||
|
if (FDrawingCell <> nil) and (FDrawingCell^.Comment <> '') then
|
||||||
|
DrawCommentMarker(temp_rct);
|
||||||
end;
|
end;
|
||||||
FTextOverflowing := false;
|
FTextOverflowing := false;
|
||||||
|
|
||||||
@ -1755,6 +1761,10 @@ begin
|
|||||||
FDrawingCell := Worksheet.FindMergeBase(cell);
|
FDrawingCell := Worksheet.FindMergeBase(cell);
|
||||||
Worksheet.FindMergedRange(FDrawingCell, sr1, sc1, sr2, sc2);
|
Worksheet.FindMergedRange(FDrawingCell, sr1, sc1, sr2, sc2);
|
||||||
gr := GetGridRow(sr1);
|
gr := GetGridRow(sr1);
|
||||||
|
if (FDrawingCell <> nil) and (FDrawingCell^.Comment <> '') then
|
||||||
|
commentcell_rct := CellRect(GetGridCol(sc2), gr)
|
||||||
|
else
|
||||||
|
commentcell_rct := Rect(0,0,0,0);
|
||||||
ColRowToOffSet(False, True, gr, rct.Top, tmp);
|
ColRowToOffSet(False, True, gr, rct.Top, tmp);
|
||||||
ColRowToOffSet(False, True, gr + integer(sr2) - integer(sr1), tmp, rct.Bottom);
|
ColRowToOffSet(False, True, gr + integer(sr2) - integer(sr1), tmp, rct.Bottom);
|
||||||
gc := GetGridCol(sc1);
|
gc := GetGridCol(sc1);
|
||||||
@ -1770,8 +1780,10 @@ begin
|
|||||||
gds := GetGridDrawState(gc, gr);
|
gds := GetGridDrawState(gc, gr);
|
||||||
DoDrawCell(gc, gr, rct, rct);
|
DoDrawCell(gc, gr, rct, rct);
|
||||||
// Draw comment marker
|
// Draw comment marker
|
||||||
if (FDrawingCell <> nil) and (FDrawingCell^.Comment <> '') then
|
if (commentcell_rct.Left <> 0) and (commentcell_rct.Right <> 0) and
|
||||||
DrawCommentMarker(rct);
|
(commentcell_rct.Top <> 0) and (commentcell_rct.Bottom <> 0)
|
||||||
|
then
|
||||||
|
DrawCommentMarker(commentcell_rct);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
gc := gcNext;
|
gc := gcNext;
|
||||||
|
Reference in New Issue
Block a user