customdrawn: Fixes an exception by an extra index check when clicking in a tab

git-svn-id: trunk@33582 -
This commit is contained in:
sekelsenmat 2011-11-17 12:47:58 +00:00
parent d8824e0700
commit 7874c0aac5

View File

@ -2105,7 +2105,7 @@ begin
end;
end
// Check if a close button was clicked
else if (nboShowCloseButtons in Options) then
else if (nboShowCloseButtons in Options) and (lTabIndex >= 0) then
begin
FTabCState.CurTabIndex := lTabIndex;
lCloseButtonPos.X := FDrawer.GetMeasuresEx(Canvas, TCDCTABCONTROL_CLOSE_BUTTON_POS_X, FState, FStateEx);