Commit 5741ebb8 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/pager: Reduce pointer scope so it doesn't point to inner scope vars (PVS-Studio).

parent badfdaf5
...@@ -753,7 +753,7 @@ static LRESULT ...@@ -753,7 +753,7 @@ static LRESULT
PAGER_MouseMove (PAGER_INFO* infoPtr, INT keys, INT x, INT y) PAGER_MouseMove (PAGER_INFO* infoPtr, INT keys, INT x, INT y)
{ {
POINT clpt, pt; POINT clpt, pt;
RECT wnrect, *btnrect = NULL; RECT wnrect;
BOOL topLeft = FALSE; BOOL topLeft = FALSE;
INT btnstate = 0; INT btnstate = 0;
INT hit; INT hit;
...@@ -766,8 +766,9 @@ PAGER_MouseMove (PAGER_INFO* infoPtr, INT keys, INT x, INT y) ...@@ -766,8 +766,9 @@ PAGER_MouseMove (PAGER_INFO* infoPtr, INT keys, INT x, INT y)
ClientToScreen(infoPtr->hwndSelf, &pt); ClientToScreen(infoPtr->hwndSelf, &pt);
GetWindowRect(infoPtr->hwndSelf, &wnrect); GetWindowRect(infoPtr->hwndSelf, &wnrect);
if (PtInRect(&wnrect, pt)) { if (PtInRect(&wnrect, pt)) {
RECT TLbtnrect, BRbtnrect; RECT topleft, bottomright, *rect = NULL;
PAGER_GetButtonRects(infoPtr, &TLbtnrect, &BRbtnrect, FALSE);
PAGER_GetButtonRects(infoPtr, &topleft, &bottomright, FALSE);
clpt = pt; clpt = pt;
MapWindowPoints(0, infoPtr->hwndSelf, &clpt, 1); MapWindowPoints(0, infoPtr->hwndSelf, &clpt, 1);
...@@ -775,23 +776,23 @@ PAGER_MouseMove (PAGER_INFO* infoPtr, INT keys, INT x, INT y) ...@@ -775,23 +776,23 @@ PAGER_MouseMove (PAGER_INFO* infoPtr, INT keys, INT x, INT y)
if ((hit == PGB_TOPORLEFT) && (infoPtr->TLbtnState == PGF_NORMAL)) if ((hit == PGB_TOPORLEFT) && (infoPtr->TLbtnState == PGF_NORMAL))
{ {
topLeft = TRUE; topLeft = TRUE;
btnrect = &TLbtnrect; rect = &topleft;
infoPtr->TLbtnState = PGF_HOT; infoPtr->TLbtnState = PGF_HOT;
btnstate = infoPtr->TLbtnState; btnstate = infoPtr->TLbtnState;
} }
else if ((hit == PGB_BOTTOMORRIGHT) && (infoPtr->BRbtnState == PGF_NORMAL)) else if ((hit == PGB_BOTTOMORRIGHT) && (infoPtr->BRbtnState == PGF_NORMAL))
{ {
topLeft = FALSE; topLeft = FALSE;
btnrect = &BRbtnrect; rect = &bottomright;
infoPtr->BRbtnState = PGF_HOT; infoPtr->BRbtnState = PGF_HOT;
btnstate = infoPtr->BRbtnState; btnstate = infoPtr->BRbtnState;
} }
/* If in one of the buttons the capture and draw buttons */ /* If in one of the buttons the capture and draw buttons */
if (btnrect) if (rect)
{ {
TRACE("[%p] draw btn (%s), Capture %s, style %08x\n", TRACE("[%p] draw btn (%s), Capture %s, style %08x\n",
infoPtr->hwndSelf, wine_dbgstr_rect(btnrect), infoPtr->hwndSelf, wine_dbgstr_rect(rect),
(infoPtr->bCapture) ? "TRUE" : "FALSE", (infoPtr->bCapture) ? "TRUE" : "FALSE",
infoPtr->dwStyle); infoPtr->dwStyle);
if (!infoPtr->bCapture) if (!infoPtr->bCapture)
...@@ -804,7 +805,7 @@ PAGER_MouseMove (PAGER_INFO* infoPtr, INT keys, INT x, INT y) ...@@ -804,7 +805,7 @@ PAGER_MouseMove (PAGER_INFO* infoPtr, INT keys, INT x, INT y)
SetTimer(infoPtr->hwndSelf, TIMERID1, 0x3e, 0); SetTimer(infoPtr->hwndSelf, TIMERID1, 0x3e, 0);
hdc = GetWindowDC(infoPtr->hwndSelf); hdc = GetWindowDC(infoPtr->hwndSelf);
/* OffsetRect(wnrect, 0 | 1, 0 | 1) */ /* OffsetRect(wnrect, 0 | 1, 0 | 1) */
PAGER_DrawButton(hdc, infoPtr->clrBk, *btnrect, PAGER_DrawButton(hdc, infoPtr->clrBk, *rect,
infoPtr->dwStyle & PGS_HORZ, topLeft, btnstate); infoPtr->dwStyle & PGS_HORZ, topLeft, btnstate);
ReleaseDC(infoPtr->hwndSelf, hdc); ReleaseDC(infoPtr->hwndSelf, hdc);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment