You've already forked lazarus-ccr
fpspreadsheet: Fix creation of erratic sheets by XLSX reader if not-yet-existing sheets are referenced in formulas during reading.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6415 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -1774,8 +1774,6 @@ begin
|
|||||||
Result := TsCellExprNode.Create(self, FWorksheet, r1, c1, flags, false)
|
Result := TsCellExprNode.Create(self, FWorksheet, r1, c1, flags, false)
|
||||||
else begin
|
else begin
|
||||||
sheet := FWorksheet.Workbook.GetWorksheetByName(sheetName);
|
sheet := FWorksheet.Workbook.GetWorksheetByName(sheetName);
|
||||||
if sheet = nil then
|
|
||||||
sheet := FWorksheet.Workbook.AddWorksheet(sheetname, true);
|
|
||||||
Result := TsCellExprNode.Create(self, sheet, r1, c1, flags, true);
|
Result := TsCellExprNode.Create(self, sheet, r1, c1, flags, true);
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
@@ -1789,8 +1787,6 @@ begin
|
|||||||
GetToken;
|
GetToken;
|
||||||
if TokenType = ttCell then begin
|
if TokenType = ttCell then begin
|
||||||
sheet := FWorksheet.Workbook.GetWorksheetByName(sheetName);
|
sheet := FWorksheet.Workbook.GetWorksheetByName(sheetName);
|
||||||
if sheet = nil then
|
|
||||||
sheet := FWorksheet.Workbook.AddWorksheet(sheetName, true);
|
|
||||||
Result := TsCellExprNode.Create(self, sheet, CurrentToken, true)
|
Result := TsCellExprNode.Create(self, sheet, CurrentToken, true)
|
||||||
end else
|
end else
|
||||||
if TokenType = ttCellRange then begin
|
if TokenType = ttCellRange then begin
|
||||||
|
@@ -731,7 +731,8 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
// "Normal" formula
|
// "Normal" formula
|
||||||
AWorksheet.WriteFormula(cell, formulaStr);
|
cell^.FormulaValue := formulaStr;
|
||||||
|
// AWorksheet.WriteFormula(cell, formulaStr);
|
||||||
except
|
except
|
||||||
on E:EExprParser do begin
|
on E:EExprParser do begin
|
||||||
FWorkbook.AddErrorMsg(E.Message);
|
FWorkbook.AddErrorMsg(E.Message);
|
||||||
|
Reference in New Issue
Block a user