You've already forked lazarus-ccr
fpspreadsheet: Fix formulas with general UTF8 sheet names in xlsx
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8942 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -654,6 +654,7 @@ type
|
|||||||
function DoDelimiter: TsTokenType;
|
function DoDelimiter: TsTokenType;
|
||||||
// function DoSquareBracket: TsTokenType;
|
// function DoSquareBracket: TsTokenType;
|
||||||
function DoString: TsTokenType;
|
function DoString: TsTokenType;
|
||||||
|
function DoTestExcelSheetName(C: Char): TsTokenType;
|
||||||
function NextPos: Char; // inline;
|
function NextPos: Char; // inline;
|
||||||
procedure SkipWhiteSpace; // inline;
|
procedure SkipWhiteSpace; // inline;
|
||||||
function IsWordDelim(C: Char): Boolean; // inline;
|
function IsWordDelim(C: Char): Boolean; // inline;
|
||||||
@@ -1365,6 +1366,32 @@ begin
|
|||||||
NextPos;
|
NextPos;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ The scanner gets into this procedure in case of invalid characters inthe
|
||||||
|
expression or - in case of Excel A1 dialect sheet names containing UTF8
|
||||||
|
codepoints. }
|
||||||
|
function TsExpressionScanner.DoTestExcelSheetName(C: Char): TsTokenType;
|
||||||
|
var
|
||||||
|
StartChar: Char;
|
||||||
|
StartPos: Integer;
|
||||||
|
begin
|
||||||
|
StartChar := C;
|
||||||
|
StartPos := FPos;
|
||||||
|
|
||||||
|
FToken := C;
|
||||||
|
C := NextPos;
|
||||||
|
while not (C in [cNull, '!']) do
|
||||||
|
begin
|
||||||
|
FToken := FToken + C;
|
||||||
|
C := NextPos;
|
||||||
|
end;
|
||||||
|
if C = '!' then
|
||||||
|
begin
|
||||||
|
Result := DoIdentifier;
|
||||||
|
FTokenType := Result;
|
||||||
|
end else
|
||||||
|
ScanError(Format(rsUnknownCharacter, [StartPos, StartChar]));
|
||||||
|
end;
|
||||||
|
|
||||||
function TsExpressionScanner.GetCurrentChar: Char;
|
function TsExpressionScanner.GetCurrentChar: Char;
|
||||||
begin
|
begin
|
||||||
if FChar <> nil then
|
if FChar <> nil then
|
||||||
@@ -1395,7 +1422,7 @@ begin
|
|||||||
else if IsAlpha(C) or (C = '$') or (C = '''') or (C = '_') then
|
else if IsAlpha(C) or (C = '$') or (C = '''') or (C = '_') then
|
||||||
Result := DoIdentifier
|
Result := DoIdentifier
|
||||||
else
|
else
|
||||||
ScanError(Format(rsUnknownCharacter, [FPos, C]));
|
Result := DoTestExcelSheetName(C);
|
||||||
FTokenType := Result;
|
FTokenType := Result;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user