From 5675ba1e845dbd9b9fae1bdcc54e207b46bb4803 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 19 Jan 2015 20:19:26 +0000 Subject: [PATCH] Function wxPGProperty::HasFlag should return Boolean value. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78392 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/propgrid/property.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index 2fb1f66c1b..7a34885a6d 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -1526,10 +1526,7 @@ public: */ bool AreChildrenComponents() const { - if ( m_flags & (wxPG_PROP_COMPOSED_VALUE|wxPG_PROP_AGGREGATE) ) - return true; - - return false; + return (m_flags & (wxPG_PROP_COMPOSED_VALUE|wxPG_PROP_AGGREGATE)) != 0; } /** @@ -1725,6 +1722,7 @@ public: return m_value.IsNull(); } +#if WXWIN_COMPATIBILITY_3_0 /** Returns non-zero if property has given flag set. @@ -1734,6 +1732,17 @@ public: { return ( m_flags & flag ); } +#else + /** + Returns true if property has given flag set. + + @see propgrid_propflags + */ + bool HasFlag(wxPGPropertyFlags flag) const + { + return (m_flags & flag) != 0; + } +#endif /** Returns comma-delimited string of property attributes. */ @@ -1802,7 +1811,7 @@ public: /** Returns true if this property is actually a wxPropertyCategory. */ - bool IsCategory() const { return HasFlag(wxPG_PROP_CATEGORY)?true:false; } + bool IsCategory() const { return (m_flags & wxPG_PROP_CATEGORY) != 0; } /** Returns true if this property is actually a wxRootProperty. */ @@ -1849,7 +1858,7 @@ public: */ bool UsesAutoUnspecified() const { - return HasFlag(wxPG_PROP_AUTO_UNSPECIFIED)?true:false; + return (m_flags & wxPG_PROP_AUTO_UNSPECIFIED) != 0; } wxBitmap* GetValueImage() const