fpspreadsheet: Fix the xxxxIF formulas (COUNTIF, SUMIF, ...) to be case-insensitive (https://forum.lazarus.freepascal.org/index.php/topic,63474.msg480757.html)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8822 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-05-25 15:33:02 +00:00
parent f5af081233
commit 4bda2d8750

View File

@@ -1306,7 +1306,7 @@ var
coGreater : if ANumber > compareNumber then ok := true; coGreater : if ANumber > compareNumber then ok := true;
coLessEqual : if ANumber <= compareNumber then ok := true; coLessEqual : if ANumber <= compareNumber then ok := true;
coGreaterEqual : if ANumber >= compareNumber then ok := true; coGreaterEqual : if ANumber >= compareNumber then ok := true;
coNotEqual : if ANumber >= compareNumber then ok := true; coNotEqual : if ANumber <> compareNumber then ok := true;
end; end;
if ok then if ok then
case AFlag of case AFlag of
@@ -1321,13 +1321,14 @@ var
ok: Boolean; ok: Boolean;
begin begin
ok := false; ok := false;
AStr := UTF8Lowercase(AStr);
case compareOp of case compareOp of
coEqual : if AStr = compareStr then ok := true; coEqual : if AStr = compareStr then ok := true;
coLess : if AStr < compareStr then ok := true; coLess : if AStr < compareStr then ok := true;
coGreater : if AStr > compareStr then ok := true; coGreater : if AStr > compareStr then ok := true;
coLessEqual : if AStr <= compareStr then ok := true; coLessEqual : if AStr <= compareStr then ok := true;
coGreaterEqual : if AStr >= compareStr then ok := true; coGreaterEqual : if AStr >= compareStr then ok := true;
coNotEqual : if AStr >= compareStr then ok := true; coNotEqual : if AStr <> compareStr then ok := true;
end; end;
if ok then if ok then
case AFlag of case AFlag of
@@ -1398,7 +1399,7 @@ begin
end; end;
cctUTF8String: cctUTF8String:
begin begin
compareStr := cell^.UTF8StringValue; compareStr := UTF8Lowercase(cell^.UTF8StringValue);
compareType := ctString; compareType := ctString;
end; end;
cctEmpty: cctEmpty:
@@ -1433,7 +1434,7 @@ begin
end end
else else
begin begin
compareStr := s; compareStr := UTF8Lowercase(s);
compareType := ctString; compareType := ctString;
end; end;
end; end;