comctl32/rebar: Don't try to access band data before it's needed.

This commit is contained in:
Nikolay Sivov 2010-02-11 22:40:15 +03:00 committed by Alexandre Julliard
parent 141e61468e
commit 70890031a3
1 changed files with 4 additions and 2 deletions

View File

@ -2919,7 +2919,6 @@ REBAR_PushChevron(const REBAR_INFO *infoPtr, UINT uBand, LPARAM lParam)
static LRESULT static LRESULT
REBAR_LButtonDown (REBAR_INFO *infoPtr, LPARAM lParam) REBAR_LButtonDown (REBAR_INFO *infoPtr, LPARAM lParam)
{ {
REBAR_BAND *lpBand;
UINT htFlags; UINT htFlags;
INT iHitBand; INT iHitBand;
POINT ptMouseDown; POINT ptMouseDown;
@ -2927,7 +2926,6 @@ REBAR_LButtonDown (REBAR_INFO *infoPtr, LPARAM lParam)
ptMouseDown.y = (short)HIWORD(lParam); ptMouseDown.y = (short)HIWORD(lParam);
REBAR_InternalHitTest(infoPtr, &ptMouseDown, &htFlags, &iHitBand); REBAR_InternalHitTest(infoPtr, &ptMouseDown, &htFlags, &iHitBand);
lpBand = REBAR_GetBand(infoPtr, iHitBand);
if (htFlags == RBHT_CHEVRON) if (htFlags == RBHT_CHEVRON)
{ {
@ -2935,8 +2933,12 @@ REBAR_LButtonDown (REBAR_INFO *infoPtr, LPARAM lParam)
} }
else if (htFlags == RBHT_GRABBER || htFlags == RBHT_CAPTION) else if (htFlags == RBHT_GRABBER || htFlags == RBHT_CAPTION)
{ {
REBAR_BAND *lpBand;
TRACE("Starting drag\n"); TRACE("Starting drag\n");
lpBand = REBAR_GetBand(infoPtr, iHitBand);
SetCapture (infoPtr->hwndSelf); SetCapture (infoPtr->hwndSelf);
infoPtr->iGrabbedBand = iHitBand; infoPtr->iGrabbedBand = iHitBand;