LCL: Minor optimization for Grid column sort.

git-svn-id: trunk@30717 -
This commit is contained in:
juha 2011-05-13 09:06:40 +00:00
parent 4ee7294cd2
commit 1e6d1a65e8

View File

@ -3257,7 +3257,6 @@ begin
with FColumns[ColOfs].Title do
ImageIndex := FOldImageIndex;
end;
FSortColumn := index;
// Show the sort glyph only if clicked column has a TGridColumn defined.
ColOfs := index - FFixedCols;
if (ColOfs > -1) and (ColOfs < FColumns.Count)
@ -3265,13 +3264,14 @@ begin
and (FDescImgInd < TitleImageList.Count) then
with FColumns[ColOfs].Title do begin
// Save previous ImageIndex of the clicked column.
if (ImageIndex <> FAscImgInd) and (ImageIndex <> FDescImgInd) then
if (index <> FSortColumn) then
FOldImageIndex := ImageIndex;
case FSortOrder of // Show the right sort glyph.
soAscending: ImageIndex := FAscImgInd;
soDescending: ImageIndex := FDescImgInd;
end;
end;
FSortColumn := index;
Sort(True, index, FFixedRows, RowCount-1);
end;
end;