You've already forked lazarus-ccr
fpspreadsheet: Display formulas instead of empty cells in WorksheetGrid when AutoCalc is off
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6542 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -1384,10 +1384,16 @@ end;
|
||||
to the workbook
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsWorkbookSource.SetOptions(AValue: TsWorkbookOptions);
|
||||
var
|
||||
AutoCalcChanged: Boolean;
|
||||
begin
|
||||
AutoCalcChanged := (FOptions * [boAutoCalc]) <> (AValue* [boAutoCalc]);
|
||||
FOptions := AValue;
|
||||
if Workbook <> nil then
|
||||
if Workbook <> nil then begin
|
||||
Workbook.Options := FOptions;
|
||||
if AutoCalcChanged and (boAutoCalc in FOptions) then
|
||||
Workbook.CalcFormulas;
|
||||
end;
|
||||
end;
|
||||
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
|
@@ -3912,6 +3912,9 @@ begin
|
||||
cell := Worksheet.FindCell(r, c);
|
||||
if cell <> nil then
|
||||
begin
|
||||
if HasFormula(cell) and not (boAutoCalc in Workbook.Options) then
|
||||
Result := '=' + Worksheet.ReadFormula(cell)
|
||||
else
|
||||
if ATrim then
|
||||
Result := TrimToCell(cell)
|
||||
else
|
||||
@@ -6221,11 +6224,13 @@ begin
|
||||
begin
|
||||
optns := WorkbookSource.Options;
|
||||
if FAutoCalc then
|
||||
Include(optns, boAutoCalc) else
|
||||
Include(optns, boAutoCalc)
|
||||
else
|
||||
Exclude(optns, boAutoCalc);
|
||||
WorkbookSource.Options := optns;
|
||||
if FInternalWorkbookSource <> nil then
|
||||
FInternalWorkbookSource.Options := optns;
|
||||
Invalidate;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user