From: Alex Bligh Date: Sat, 22 Jul 2006 12:47:44 +0000 (+0000) Subject: Clean up wxOwnerDrawnComboBox XRC handler as suggested by abxabx fixing bug X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9366ec4e1e8564cad0745fd727ffe15105e0a495?ds=inline Clean up wxOwnerDrawnComboBox XRC handler as suggested by abxabx fixing bug 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 --- diff --git a/src/xrc/xh_odcombo.cpp b/src/xrc/xh_odcombo.cpp index df1ece9ef3..ffd08373ef 100644 --- a/src/xrc/xh_odcombo.cpp +++ b/src/xrc/xh_odcombo.cpp @@ -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