git-svn-id: trunk@23135 -
This commit is contained in:
michael 2012-12-12 15:21:28 +00:00
parent 50f1ab686a
commit 11a531ab62
2 changed files with 13 additions and 9 deletions

View File

@ -725,6 +725,7 @@ type
FDuplicates: TDuplicates;
FCaseSensitive : Boolean;
FSorted: Boolean;
FForceSort : Boolean;
FOwnsObjects : Boolean;
procedure ExchangeItems(Index1, Index2: Integer);
procedure Grow;

View File

@ -1260,14 +1260,17 @@ end;
procedure TStringList.SetCaseSensitive(b : boolean);
begin
if b<>FCaseSensitive then
begin
FCaseSensitive:=b;
if FSorted then
sort;
end;
end;
begin
if b=FCaseSensitive then
Exit;
FCaseSensitive:=b;
if FSorted then
begin
FForceSort:=True;
sort;
FForceSort:=False;
end;
end;
Function TStringList.DoCompareText(const s1,s2 : string) : PtrInt;
@ -1338,7 +1341,7 @@ end;
Procedure TStringList.CustomSort(CompareFn: TStringListSortCompare);
begin
If Not Sorted and (FCount>1) then
If (FForceSort or (Not Sorted)) and (FCount>1) then
begin
Changing;
QuickSort(0,FCount-1, CompareFn);