lazreport: uppercase variable before comparing with hardcoded functions. Properly fix to 21624

git-svn-id: trunk@36539 -
This commit is contained in:
blikblum 2012-04-03 09:55:36 +00:00
parent aefd41ef26
commit fea7df6a87

View File

@ -8107,6 +8107,7 @@ var
Value: TfrValue; Value: TfrValue;
D: TfrTDataSet; D: TfrTDataSet;
F: TfrTField; F: TfrTField;
s1: String;
function MasterBand: TfrBand; function MasterBand: TfrBand;
begin begin
@ -8165,43 +8166,47 @@ begin
else if (D<>nil) and (roIgnoreFieldNotFound in FReportOptions) and else if (D<>nil) and (roIgnoreFieldNotFound in FReportOptions) and
lrValidFieldReference(s) then lrValidFieldReference(s) then
aValue := Null aValue := Null
else if s = 'VALUE' then
aValue:= CurValue
else if s = frSpecFuncs[0] then
aValue:= PageNo + 1
else if s = frSpecFuncs[2] then
aValue := CurDate
else if s = frSpecFuncs[3] then
aValue:= CurTime
else if s = frSpecFuncs[4] then
aValue:= MasterBand.Positions[psLocal]
else if s = frSpecFuncs[5] then
aValue:= MasterBand.Positions[psGlobal]
else if s = frSpecFuncs[6] then
aValue:= CurPage.ColPos
else if s = frSpecFuncs[7] then
aValue:= CurPage.CurPos
else if s = frSpecFuncs[8] then
aValue:= SavedAllPages
else else
begin begin
if frVariables.IndexOf(s) <> -1 then s1 := AnsiUpperCase(s);
if s1 = 'VALUE' then
aValue:= CurValue
else if s1 = frSpecFuncs[0] then
aValue:= PageNo + 1
else if s1 = frSpecFuncs[2] then
aValue := CurDate
else if s1 = frSpecFuncs[3] then
aValue:= CurTime
else if s1 = frSpecFuncs[4] then
aValue:= MasterBand.Positions[psLocal]
else if s1 = frSpecFuncs[5] then
aValue:= MasterBand.Positions[psGlobal]
else if s1 = frSpecFuncs[6] then
aValue:= CurPage.ColPos
else if s1 = frSpecFuncs[7] then
aValue:= CurPage.CurPos
else if s1 = frSpecFuncs[8] then
aValue:= SavedAllPages
else
begin begin
aValue:= frVariables[s]; if frVariables.IndexOf(s) <> -1 then
Exit; begin
end else aValue:= frVariables[s];
if CompareText(s,'REPORTTITLE')=0 then Exit;
begin end else
aValue := Title; if s1 = 'REPORTTITLE' then
Exit; begin
aValue := Title;
Exit;
end;
if s <> SubValue then
begin
SubValue := s;
aValue:= frParser.Calc(s);
SubValue := '';
end
else raise(EParserError.Create('Undefined symbol: ' + SubValue));
end; end;
if s <> SubValue then
begin
SubValue := s;
aValue:= frParser.Calc(s);
SubValue := '';
end
else raise(EParserError.Create('Undefined symbol: ' + SubValue));
end; end;
end; end;
end; end;