You've already forked lazarus-ccr
fpspreadsheet: Fix worksheetGrid to expand itself if new cells are created beyout the current grid extent.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4234 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1519,6 +1519,7 @@ begin
|
||||
if CellUsedInFormula(ARow, ACol) then
|
||||
CalcFormulas;
|
||||
end;
|
||||
|
||||
if Assigned(FOnChangeCell) then
|
||||
FOnChangeCell(Self, ARow, ACol);
|
||||
end;
|
||||
|
@ -3491,6 +3491,7 @@ procedure TsCustomWorksheetGrid.ListenerNotification(AChangedItems: TsNotificati
|
||||
AData: Pointer = nil);
|
||||
var
|
||||
grow, gcol: Integer;
|
||||
cell: PCell;
|
||||
begin
|
||||
Unused(AData);
|
||||
|
||||
@ -3519,13 +3520,28 @@ begin
|
||||
|
||||
// Cell value or format changed
|
||||
if (lniCell in AChangedItems) then
|
||||
begin
|
||||
cell := PCell(AData);
|
||||
if (cell <> nil) then begin
|
||||
grow := GetGridRow(cell^.Row);
|
||||
gcol := GetGridCol(cell^.Col);
|
||||
if grow >= RowCount then
|
||||
RowCount := grow + 1;
|
||||
if gcol >= ColCount then
|
||||
ColCount := gcol + 1;
|
||||
end;
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
// Selection changed
|
||||
if (lniSelection in AChangedItems) and (Worksheet <> nil) then
|
||||
begin
|
||||
grow := GetGridRow(Worksheet.ActiveCellRow);
|
||||
gcol := GetGridCol(Worksheet.ActiveCellCol);
|
||||
if grow >= RowCount then
|
||||
RowCount := grow + 1;
|
||||
if gcol >= ColCount then
|
||||
ColCount := gcol + 1;
|
||||
if (grow <> Row) or (gcol <> Col) then
|
||||
MoveExtend(false, gcol, grow);
|
||||
end;
|
||||
@ -3541,6 +3557,8 @@ begin
|
||||
if (lniRow in AChangedItems) and (Worksheet <> nil) then
|
||||
begin
|
||||
grow := GetGridRow({%H-}PtrInt(AData));
|
||||
if grow >= RowCount then
|
||||
RowCount := grow + 1;
|
||||
RowHeights[grow] := CalcAutoRowHeight(grow);
|
||||
end;
|
||||
end;
|
||||
|
Reference in New Issue
Block a user