]> git.saurik.com Git - wxWidgets.git/commitdiff
Clean up wxOwnerDrawnComboBox XRC handler as suggested by abxabx fixing bug
authorAlex Bligh <alex@alex.org.uk>
Sat, 22 Jul 2006 12:47:44 +0000 (12:47 +0000)
committerAlex Bligh <alex@alex.org.uk>
Sat, 22 Jul 2006 12:47:44 +0000 (12:47 +0000)
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1487463&group_id=9863

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/xrc/xh_odcombo.cpp

index df1ece9ef35b8eefde819a325db5765927637209..ffd08373efa69719b2c0f0a62f3733d09afb3ebd 100644 (file)
@@ -106,14 +106,23 @@ wxObject *wxOwnerDrawnComboBoxXmlHandler::DoCreateResource()
 
 bool wxOwnerDrawnComboBoxXmlHandler::CanHandle(wxXmlNode *node)
 {
-//  Avoid GCC bug - this fails on certain GCC 3.x builds for an unknown reason
-//  return (IsOfClass(node, wxT("wxOwnerDrawnComboBox")) ||
-//         (m_insideBox && node->GetName() == wxT("item")));
+#if wxABI_VERSION >= 20700
+
+    return (IsOfClass(node, wxT("wxOwnerDrawnComboBox")) ||
+           (m_insideBox && node->GetName() == wxT("item")));
+
+#else
+
+//  Avoid GCC bug - this fails on certain GCC 3.3 and 3.4 builds for an unknown reason
+//  it is believed to be related to the fact IsOfClass is inline, and node->GetPropVal
+//  gets passed an invalid "this" pointer. On 2.7, the function is out of line, so the
+//  above should work fine. This code is left in here so this file can easily be used
+//  in a version backported to 2.6. All we are doing here is expanding the macro
 
     bool fOurClass = node->GetPropVal(wxT("class"), wxEmptyString) == wxT("wxOwnerDrawnComboBox");
     return (fOurClass ||
           (m_insideBox && node->GetName() == wxT("item")));
-
+#endif
 }
 
 #endif // wxUSE_XRC && wxUSE_ODCOMBOBOX