fpspreadsheet: Another fix to default compare procedure for sorting worksheets.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6932 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-05-21 14:26:52 +00:00
parent 75b60a0ffd
commit ae1719d0a3

View File

@ -4336,24 +4336,25 @@ var
begin
Result := 0;
if (ACell1 = nil) and (ACell2 = nil) then
Result := 0
else
if (ACell1 <> nil) and (ACell1^.ContentType = cctEmpty) and
(ACell2 <> nil) and (ACell2^.ContentType = cctEmpty)
then
Result := 0
else
if ((ACell1 = nil) or (ACell1^.ContentType = cctEmpty)) and
((ACell2 = nil) or (ACell2^.ContentType = cctEmpty))
then begin
Result := 0;
exit;
end;
if (ACell1 = nil) or (ACell1^.ContentType = cctEmpty) then
begin
Result := +1; // Empty cells go to the end
exit; // Avoid SortOrder to bring the empty cell to the top!
end else
end;
if (ACell2 = nil) or (ACell2^.ContentType = cctEmpty) then
begin
Result := -1; // Empty cells go to the end
exit; // Avoid SortOrder to bring the empty cell to the top!
end else
end;
if (ACell1^.ContentType = cctUTF8String) and (ACell2^.ContentType = cctUTF8String) then
begin
if ssoCaseInsensitive in ASortOptions then