Author Topic: patch vs. compile-error wxPGFlags in trunk svn13676 with wxWidgets trunk  (Read 85 times)

Offline blauzahn

  • Almost regular
  • **
  • Posts: 187
The implicit conversion of the enum is now disabled. I just added 2 static_cast instead.

Code
--- trunk_20250716_vanilla/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp	2025-07-16 20:46:08.000000000 +0200
+++ trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp 2025-07-16 21:39:08.141146237 +0200
@@ -205,7 +205,7 @@
         else
             cpv.Init( type, *wxWHITE );
 
-        m_flags |= wxPG_PROP_STATIC_CHOICES; // Colour selection cannot be changed.
+        m_flags |= static_cast<wxPGFlags>(wxPG_PROP_STATIC_CHOICES); // Colour selection cannot be changed.
         m_value << cpv;
         OnSetValue();
     }
@@ -583,7 +583,7 @@
             int index = paintdata.m_choiceItem;
             value = wxsColourValues[index];
         }
-        else if ( !(m_flags & (wxPGPropertyFlags)wxPG_PROP_UNSPECIFIED) )
+        else if ( !(m_flags & static_cast<wxPGFlags>(wxPG_PROP_UNSPECIFIED)) )
         {
             value = GetVal().m_type;
         }

I compiled it under Arch-Linux out-out-of tree using cmake, WX_PREFIX and --enable-pch=no as always.

Please feel free to correct trunk in a better way. Thank you for noticing this.