]> git.saurik.com Git - wxWidgets.git/commitdiff
make more readable the checks for incoherent style flags
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Fri, 28 Nov 2008 17:58:39 +0000 (17:58 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Fri, 28 Nov 2008 17:58:39 +0000 (17:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msgdlg.h

index 0b9de3f1f788c613ec2cec4f9ed0a18ae9b7af27..7c372cff6fd35a06c88bcdf173ce1ec96460c35a 100644 (file)
@@ -140,6 +140,7 @@ public:
     // change the dialog style flag
     void SetMessageDialogStyle(long style)
     {
+#ifdef __WXDEBUG__
         wxASSERT_MSG( ((style & wxYES_NO) == wxYES_NO) || !(style & wxYES_NO),
                       "wxYES and wxNO may only be used together" );
 
@@ -152,14 +153,21 @@ public:
         wxASSERT_MSG( (style & wxID_OK) != wxID_OK,
                       "wxMessageBox: Did you mean wxOK (and not wxID_OK)?" );
 
-        wxASSERT_MSG( !(style & wxNO_DEFAULT) || (style & wxNO),
-                      "wxNO_DEFAULT is invalid without wxNO" );
+        if ((style & wxNO) == 0)
+            wxASSERT_MSG( !(style & wxNO_DEFAULT),
+                          "wxNO_DEFAULT is invalid without wxNO" );
 
-        wxASSERT_MSG( !(style & wxCANCEL_DEFAULT) || (style & wxCANCEL),
-                      "wxCANCEL_DEFAULT is invalid without wxCANCEL" );
+        if ((style & wxCANCEL) == 0)
+            wxASSERT_MSG( !(style & wxCANCEL_DEFAULT),
+                          "wxCANCEL_DEFAULT is invalid without wxCANCEL" );
 
-        wxASSERT_MSG( !(style & wxCANCEL_DEFAULT) || !(style & wxNO_DEFAULT),
-                      "only one default button can be specified" );
+        if ((style & wxCANCEL_DEFAULT) != 0)
+            wxASSERT_MSG( !(style & wxNO_DEFAULT),
+                          "only one default button can be specified" );
+        if ((style & wxNO_DEFAULT) != 0)
+            wxASSERT_MSG( !(style & wxCANCEL_DEFAULT),
+                          "only one default button can be specified" );
+#endif
 
         m_dialogStyle = style;
     }