fpspreadsheet: Fix different listseparator used in formulas of ods files written by Excel.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5754 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2017-02-18 18:19:53 +00:00
parent 280dc39ddc
commit 7e91f6373f

View File

@ -2279,6 +2279,7 @@ var
parser: TsSpreadsheetParser;
p: Integer;
fmt: PsCellFormat;
ns: String;
begin
// Create cell and apply format
if FIsVirtualMode then
@ -2302,8 +2303,14 @@ begin
formula := GetAttrValue(ACellNode, 'table:formula');
if formula <> '' then
begin
// formulas written by Spread begin with 'of:=', our's with '=' --> remove that
// Formulas written by Spread begin with 'of:=', by Excel with 'msof:='.
// Remove that. And both use different list separators
p := pos('=', formula);
ns := Copy(formula, 1, p-2);
case ns of
'of' : FPointSeparatorSettings.ListSeparator := ';';
'msoxl': FPointSeparatorSettings.ListSeparator := ',';
end;
Delete(formula, 1, p);
end;
// ... convert to Excel "A1" dialect used by fps by defailt