You've already forked lazarus-ccr
fpspreadsheet: Fix reading of shared formulas in xls files (bug introduced by the new calculation engine).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6584 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1887,6 +1887,10 @@ begin
|
|||||||
// Don't call "AddCell" because, if the cell belongs to a shared formula, it
|
// Don't call "AddCell" because, if the cell belongs to a shared formula, it
|
||||||
// already has been created before, and then would exist in the tree twice.
|
// already has been created before, and then would exist in the tree twice.
|
||||||
|
|
||||||
|
// Prevent shared formulas (which already may have been written at this time)
|
||||||
|
// being erased when cell content is written
|
||||||
|
TsWorkbook(sheet.Workbook).LockFormulas;
|
||||||
|
try
|
||||||
// Now determine the type of the formula result
|
// Now determine the type of the formula result
|
||||||
if (Data[6] = $FF) and (Data[7] = $FF) then
|
if (Data[6] = $FF) and (Data[7] = $FF) then
|
||||||
case Data[0] of
|
case Data[0] of
|
||||||
@ -1915,6 +1919,9 @@ begin
|
|||||||
else
|
else
|
||||||
sheet.WriteNumber(cell, ResultFormula);
|
sheet.WriteNumber(cell, ResultFormula);
|
||||||
end;
|
end;
|
||||||
|
finally
|
||||||
|
TsWorkbook(sheet.Workbook).UnlockFormulas;
|
||||||
|
end;
|
||||||
|
|
||||||
{ Formula token array }
|
{ Formula token array }
|
||||||
if boReadFormulas in FWorkbook.Options then
|
if boReadFormulas in FWorkbook.Options then
|
||||||
|
Reference in New Issue
Block a user