mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 01:47:43 +02:00
lcl: fix THeaderSections.AddItem (bug #0013806 by Hans-Peter Diettrich)
git-svn-id: trunk@20162 -
This commit is contained in:
parent
a8544fc87d
commit
a67684a1a6
@ -433,10 +433,13 @@ begin
|
||||
end;
|
||||
|
||||
function THeaderSections.AddItem(Item: THeaderSection; Index: Integer): THeaderSection;
|
||||
var i:longint;
|
||||
var
|
||||
i: longint;
|
||||
begin
|
||||
if Item = nil then
|
||||
Result := FHeaderControl.CreateSection;
|
||||
Result := FHeaderControl.CreateSection
|
||||
else
|
||||
Result := Item;
|
||||
|
||||
Result.Collection := Self;
|
||||
if Index > Count then
|
||||
@ -444,11 +447,10 @@ begin
|
||||
Result.Index := Index;
|
||||
//updates OriginalIndex so that it has the value Index would have if there
|
||||
//never was a move
|
||||
for i:=0 to Count - 1 do
|
||||
if Items[i].FOriginalIndex>=Index then
|
||||
Items[i].FOriginalIndex:=Items[i].FOriginalIndex + 1;
|
||||
for i := 0 to Count - 1 do
|
||||
if Items[i].FOriginalIndex >= Index then
|
||||
Items[i].FOriginalIndex := Items[i].FOriginalIndex + 1;
|
||||
Result.FOriginalIndex := Index;
|
||||
|
||||
end;
|
||||
|
||||
function THeaderSections.Insert(Index: Integer): THeaderSection;
|
||||
|
Loading…
Reference in New Issue
Block a user