From 88d2e56706ed5851544d957f226d4a5ec8499eb4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 24 Aug 2005 06:32:56 +0000 Subject: [PATCH] [1267725] Wrong operator for logical/bitwise operation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35295 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/univ/slider.h | 8 ++++---- src/univ/button.cpp | 2 +- src/univ/slider.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/wx/univ/slider.h b/include/wx/univ/slider.h index 634085cf51..8b6f3f95be 100644 --- a/include/wx/univ/slider.h +++ b/include/wx/univ/slider.h @@ -95,13 +95,13 @@ public: { return IsVert() ? wxVERTICAL : wxHORIZONTAL; } // do we have labels? - bool HasLabels() const - { return ((GetWindowStyle() & wxSL_LABELS) != 0) & + bool HasLabels() const + { return ((GetWindowStyle() & wxSL_LABELS) != 0) && ((GetWindowStyle() & (wxSL_TOP|wxSL_BOTTOM|wxSL_LEFT|wxSL_RIGHT)) != 0); } // do we have ticks? - bool HasTicks() const - { return ((GetWindowStyle() & wxSL_TICKS) != 0) & + bool HasTicks() const + { return ((GetWindowStyle() & wxSL_TICKS) != 0) && ((GetWindowStyle() & (wxSL_TOP|wxSL_BOTTOM|wxSL_LEFT|wxSL_RIGHT|wxSL_BOTH)) != 0); } // implement wxControlWithThumb interface diff --git a/src/univ/button.cpp b/src/univ/button.cpp index b70394dc5c..a812e9e25e 100644 --- a/src/univ/button.cpp +++ b/src/univ/button.cpp @@ -81,7 +81,7 @@ bool wxButton::Create(wxWindow *parent, if (label.empty() && wxIsStockID(id)) label = wxGetStockLabel(id); - long ctrl_style = style & !wxBU_ALIGN_MASK; + long ctrl_style = style & ~wxBU_ALIGN_MASK; wxASSERT_MSG( (ctrl_style & wxALIGN_MASK) == 0, _T("Some style conflicts with align flags") ); diff --git a/src/univ/slider.cpp b/src/univ/slider.cpp index d96bd7c500..aedda7a569 100644 --- a/src/univ/slider.cpp +++ b/src/univ/slider.cpp @@ -743,7 +743,7 @@ bool wxSlider::PerformAction(const wxControlAction& action, long numArg, const wxString& strArg) { - if ( action == wxACTION_SLIDER_START ) + if ( action == wxACTION_SLIDER_START ) { ChangeValueTo(m_min); } @@ -823,13 +823,13 @@ wxScrollThumb::Shaft wxSlider::HitTest(const wxPoint& pt) const x3 = rectThumb.GetRight(); x4 = rectShaft.GetRight(); } - if ((x1 <= x) & (x < x2)) + if ((x1 <= x) && (x < x2)) { // or to the left return wxScrollThumb::Shaft_Above; } - if ((x3 < x) & (x <= x4)) { + if ((x3 < x) && (x <= x4)) { // or to the right return wxScrollThumb::Shaft_Below; } @@ -952,7 +952,7 @@ bool wxStdSliderButtonInputHandler::HandleKey(wxInputConsumer *consumer, const wxKeyEvent& event, bool pressed) { - if ( pressed ) + if ( pressed ) { int keycode = event.GetKeyCode(); -- 2.45.2