You've already forked lazarus-ccr
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:
@ -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
|
||||
|
Reference in New Issue
Block a user