From eec7ef72324ca1af0484308b90db39bb04aec428 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 19 Jan 2015 12:18:47 +0000 Subject: [PATCH] Use logical operations instead of bit-wise ones for booleans. wxUniv "Windows" theme code wrongly used bitwise operations on boolean values, fix this. Closes #16796. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/univ/themes/win32.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/univ/themes/win32.cpp b/src/univ/themes/win32.cpp index 2872959c98..09ba0fb250 100644 --- a/src/univ/themes/win32.cpp +++ b/src/univ/themes/win32.cpp @@ -2026,7 +2026,7 @@ wxRect wxWin32Renderer::GetSliderShaftRect(const wxRect& rectOrig, if (orient == wxHORIZONTAL) { rect.x += SLIDER_MARGIN; - if (left & right) + if (left && right) { rect.y += wxMax ((rect.height - 2*BORDER_THICKNESS) / 2, sizeThumb.y/2); } @@ -2044,7 +2044,7 @@ wxRect wxWin32Renderer::GetSliderShaftRect(const wxRect& rectOrig, else // == wxVERTICAL { rect.y += SLIDER_MARGIN; - if (left & right) + if (left && right) { rect.x += wxMax ((rect.width - 2*BORDER_THICKNESS) / 2, sizeThumb.x/2); } @@ -2286,21 +2286,21 @@ void wxWin32Renderer::DrawSliderTicks(wxDC& dc, { wxCoord x = x1 + (len*n) / range; - if (left & (y1 > y3)) + if (left && (y1 > y3)) { DrawLine(dc, x, y1, x, y3, orient == wxVERTICAL); } - if (right & (y4 > y2)) + if (right && (y4 > y2)) { DrawLine(dc, x, y2, x, y4, orient == wxVERTICAL); } } // always draw the line at the end position - if (left & (y1 > y3)) + if (left && (y1 > y3)) { DrawLine(dc, x2, y1, x2, y3, orient == wxVERTICAL); } - if (right & (y4 > y2)) + if (right && (y4 > y2)) { DrawLine(dc, x2, y2, x2, y4, orient == wxVERTICAL); }