diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 93f3b39628..c6fd538669 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -878,7 +878,7 @@ public: // Returns true if editor's value was marked modified. bool IsEditorsValueModified() const - { return ( m_iFlags & wxPG_FL_VALUE_MODIFIED ) ? true : false; } + { return ( m_iFlags & wxPG_FL_VALUE_MODIFIED ) != 0; } // Returns information about arbitrary position in the grid. // pt - Coordinates in the virtual grid space. You may need to use @@ -1136,7 +1136,7 @@ public: ///////////////////////////////////////////////////////////////// bool HasVirtualWidth() const - { return (m_iFlags & wxPG_FL_HAS_VIRTUAL_WIDTH) ? true : false; } + { return (m_iFlags & wxPG_FL_HAS_VIRTUAL_WIDTH) != 0; } const wxPGCommonValue* GetCommonValue( unsigned int i ) const { @@ -1254,7 +1254,7 @@ public: long GetInternalFlags() const { return m_iFlags; } bool HasInternalFlag( long flag ) const - { return (m_iFlags & flag) ? true : false; } + { return (m_iFlags & flag) != 0; } void SetInternalFlag( long flag ) { m_iFlags |= flag; } void ClearInternalFlag( long flag ) { m_iFlags &= ~(flag); } @@ -1293,7 +1293,7 @@ public: // wxPGProperty::OnEvent() is not even called in those cases). bool WasValueChangedInEvent() const { - return (m_iFlags & wxPG_FL_VALUE_CHANGE_IN_EVENT) ? true : false; + return (m_iFlags & wxPG_FL_VALUE_CHANGE_IN_EVENT) != 0; } // Returns true if given event is from first of an array of buttons diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index 2722911e90..f997eb1f08 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -2187,7 +2187,7 @@ wxString wxDateProperty::ValueToString( wxVariant& value, if ( ms_defaultDateFormat.empty() ) { #if wxUSE_DATEPICKCTRL - bool showCentury = m_dpStyle & wxDP_SHOWCENTURY ? true : false; + bool showCentury = (m_dpStyle & wxDP_SHOWCENTURY) != 0; #else bool showCentury = true; #endif diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 20df87208d..17b51b4bc9 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -1114,7 +1114,7 @@ wxPropertyGridPage* wxPropertyGridManager::InsertPage( int index, wxS("wxPropertyGridManager currently only supports appending pages (due to wxToolBar limitation).")); bool needInit = true; - bool isPageInserted = m_iFlags & wxPG_MAN_FL_PAGE_INSERTED ? true : false; + bool isPageInserted = (m_iFlags & wxPG_MAN_FL_PAGE_INSERTED) != 0; wxASSERT( index == 0 || isPageInserted ); diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 799227b28f..c8e7086412 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -1699,7 +1699,7 @@ void wxPGProperty::SetBackgroundColour( const wxColour& colour, int flags ) { wxPGProperty* firstProp = this; - bool recursively = flags & wxPG_RECURSE ? true : false; + bool recursively = (flags & wxPG_RECURSE) != 0; // // If category is tried to set recursively, skip it and only @@ -1735,7 +1735,7 @@ void wxPGProperty::SetTextColour( const wxColour& colour, int flags ) { wxPGProperty* firstProp = this; - bool recursively = flags & wxPG_RECURSE ? true : false; + bool recursively = (flags & wxPG_RECURSE) != 0; // // If category is tried to set recursively, skip it and only @@ -1770,7 +1770,7 @@ void wxPGProperty::SetTextColour( const wxColour& colour, void wxPGProperty::SetDefaultColours(int flags) { wxPGProperty* firstProp = this; - bool recursively = flags & wxPG_RECURSE ? true : false; + bool recursively = (flags & wxPG_RECURSE) != 0; // If category is tried to set recursively, skip it and only // affect the children. diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index cd48e2ab6a..741a237ef2 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2893,7 +2893,7 @@ bool wxPropertyGrid::CommitChangesFromEditor( wxUint32 flags ) wxWindow* oldFocus = m_curFocused; bool validationFailure = false; - bool forceSuccess = (flags & (wxPG_SEL_NOVALIDATE|wxPG_SEL_FORCE)) ? true : false; + bool forceSuccess = (flags & (wxPG_SEL_NOVALIDATE | wxPG_SEL_FORCE)) != 0; m_chgInfo_changedProperty = nullptr; diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 913cd7a9a0..2a7de29704 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -1141,7 +1141,7 @@ bool wxBoolProperty::StringToValue( wxVariant& variant, const wxString& text, in bool wxBoolProperty::IntToValue( wxVariant& variant, int value, int ) const { - bool boolValue = value ? true : false; + bool boolValue = (bool)value; if ( variant != boolValue ) {