diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-24 15:21:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-24 15:21:30 +0000 |
commit | 5e01c907bf4cace9542f880bae418f71c0fd0c07 (patch) | |
tree | 4e8b60aa99bcc10540be4b0ca09bcb313ff78677 /plugins/Clist_nicer/src/Coolsb | |
parent | 4a4b816398add26a704f13af1aa2ff5023df01af (diff) |
more warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@6608 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src/Coolsb')
-rw-r--r-- | plugins/Clist_nicer/src/Coolsb/coolsblib.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/Coolsb/coolscroll.cpp | 76 |
2 files changed, 4 insertions, 78 deletions
diff --git a/plugins/Clist_nicer/src/Coolsb/coolsblib.cpp b/plugins/Clist_nicer/src/Coolsb/coolsblib.cpp index 127d11f173..4fbe772dec 100644 --- a/plugins/Clist_nicer/src/Coolsb/coolsblib.cpp +++ b/plugins/Clist_nicer/src/Coolsb/coolsblib.cpp @@ -414,7 +414,7 @@ int WINAPI CoolSB_SetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL f if (lpsi->fMask & SIF_PAGE)
{
UINT t = (UINT)(mysi->nMax - mysi->nMin + 1);
- mysi->nPage = min(max(0, lpsi->nPage), t);
+ mysi->nPage = min(lpsi->nPage, t);
}
//The nPos member must specify a value between nMin and nMax - max(nPage - 1, 0).
@@ -527,7 +527,7 @@ BOOL WINAPI CoolSB_ShowScrollBar (HWND hwnd, int wBar, BOOL fShow) (sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))
{
sbar->fScrollFlags = sbar->fScrollFlags & ~CSBS_VISIBLE;
- sbar->fScrollFlags |= (fShow == TRUE ? CSBS_VISIBLE : 0);
+ sbar->fScrollFlags |= fShow ? CSBS_VISIBLE : 0;
//bFailed = TRUE;
if (fShow) SetWindowLongPtr(hwnd, GWL_STYLE, dwStyle | WS_HSCROLL);
@@ -538,7 +538,7 @@ BOOL WINAPI CoolSB_ShowScrollBar (HWND hwnd, int wBar, BOOL fShow) (sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))
{
sbar->fScrollFlags = sbar->fScrollFlags & ~CSBS_VISIBLE;
- sbar->fScrollFlags |= (fShow == TRUE ? CSBS_VISIBLE : 0);
+ sbar->fScrollFlags |= fShow ? CSBS_VISIBLE : 0;
//bFailed = TRUE;
if (fShow) SetWindowLongPtr(hwnd, GWL_STYLE, dwStyle | WS_VSCROLL);
diff --git a/plugins/Clist_nicer/src/Coolsb/coolscroll.cpp b/plugins/Clist_nicer/src/Coolsb/coolscroll.cpp index dcafafdd7c..c1547121d9 100644 --- a/plugins/Clist_nicer/src/Coolsb/coolscroll.cpp +++ b/plugins/Clist_nicer/src/Coolsb/coolscroll.cpp @@ -1412,21 +1412,15 @@ static LRESULT NCPaint(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam) {
SCROLLBAR *sb;
HDC hdc;
- HRGN hrgn;
RECT winrect, rect;
HRGN clip = 0;
- BOOL fUpdateAll = ((LONG)wParam == 1);
BOOL fCustomDraw = FALSE;
LRESULT ret;
DWORD dwStyle;
GetWindowRect(hwnd, &winrect);
- //if entire region needs painting, then make a region to cover the entire window
- if (fUpdateAll)
- hrgn = (HRGN)wParam;
- else
- hrgn = (HRGN)wParam;
+ HRGN hrgn = (HRGN)wParam;
//hdc = GetWindowDC(hwnd);
hdc = CoolSB_GetDC(hwnd, wParam);
@@ -1445,40 +1439,6 @@ static LRESULT NCPaint(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam) //make the coordinates relative to the window for drawing
OffsetRect(&rect, -winrect.left, -winrect.top);
-#ifdef INCLUDE_BUTTONS
-
- //work out the size of any inserted buttons so we can dra them
- sb->nButSizeBefore = GetButtonSize(sb, hwnd, SBBP_LEFT);
- sb->nButSizeAfter = GetButtonSize(sb, hwnd, SBBP_RIGHT);
-
- //make sure there is room for the buttons
- hbarwidth = rect.right - rect.left;
-
- //check that we can fit any left/right buttons in the available space
- if (sb->nButSizeAfter < (hbarwidth - MIN_COOLSB_SIZE))
- {
- //adjust the scrollbar rectangle to fit the buttons into
- sb->fButVisibleAfter = TRUE;
- rect.right -= sb->nButSizeAfter;
- leftright |= SBBP_RIGHT;
-
- //check that there is enough space for the right buttons
- if (sb->nButSizeBefore + sb->nButSizeAfter < (hbarwidth - MIN_COOLSB_SIZE))
- {
- sb->fButVisibleBefore = TRUE;
- rect.left += sb->nButSizeBefore;
- leftright |= SBBP_LEFT;
- }
- else
- sb->fButVisibleBefore = FALSE;
- }
- else
- sb->fButVisibleAfter = FALSE;
-
-
- DrawHorzButtons(sb, hdc, &rect, leftright);
-#endif// INCLUDE_BUTTONS
-
if (uCurrentScrollbar == SB_HORZ)
fCustomDraw |= NCDrawHScrollbar(sb, hwnd, hdc, &rect, uScrollTimerPortion);
else
@@ -1499,40 +1459,6 @@ static LRESULT NCPaint(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam) //make the coordinates relative to the window for drawing
OffsetRect(&rect, -winrect.left, -winrect.top);
-#ifdef INCLUDE_BUTTONS
-
- //work out the size of any inserted buttons so we can dra them
- sb->nButSizeBefore = GetButtonSize(sb, hwnd, SBBP_LEFT);
- sb->nButSizeAfter = GetButtonSize(sb, hwnd, SBBP_RIGHT);
-
- //make sure there is room for the buttons
- vbarheight = rect.bottom - rect.top;
-
- //check that we can fit any left/right buttons in the available space
- if (sb->nButSizeAfter < (vbarheight - MIN_COOLSB_SIZE))
- {
- //adjust the scrollbar rectangle to fit the buttons into
- sb->fButVisibleAfter = TRUE;
- rect.bottom -= sb->nButSizeAfter;
- updown |= SBBP_BOTTOM;
-
- //check that there is enough space for the right buttons
- if (sb->nButSizeBefore + sb->nButSizeAfter < (vbarheight - MIN_COOLSB_SIZE))
- {
- sb->fButVisibleBefore = TRUE;
- rect.top += sb->nButSizeBefore;
- updown |= SBBP_TOP;
- }
- else
- sb->fButVisibleBefore = FALSE;
- }
- else
- sb->fButVisibleAfter = FALSE;
-
-
- DrawVertButtons(sb, hdc, &rect, updown);
-#endif // INCLUDE_BUTTONS
-
if (uCurrentScrollbar == SB_VERT)
fCustomDraw |= NCDrawVScrollbar(sb, hwnd, hdc, &rect, uScrollTimerPortion);
else
|