X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/78d14f80e9a72041ede52c30d912ec5cef21b1b3..96d24601afde917784dfdbaddf2f0e351ee92e8c:/contrib/src/xrc/xh_toolb.cpp?ds=sidebyside diff --git a/contrib/src/xrc/xh_toolb.cpp b/contrib/src/xrc/xh_toolb.cpp index e8c125341f..3cddf6f6b2 100644 --- a/contrib/src/xrc/xh_toolb.cpp +++ b/contrib/src/xrc/xh_toolb.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: xh_toolb.cpp -// Purpose: XML resource for wxBoxSizer +// Purpose: XRC resource for wxBoxSizer // Author: Vaclav Slavik // Created: 2000/08/11 // RCS-ID: $Id$ @@ -40,7 +40,7 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() { if (m_class == wxT("tool")) { - wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XML resource: tool not within a toolbar!")); + wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: tool not within a toolbar!")); m_toolbar->AddTool(GetID(), GetBitmap(wxT("bitmap")), GetBitmap(wxT("bitmap2")), @@ -55,7 +55,7 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() else if (m_class == wxT("separator")) { - wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XML resource: separator not within a toolbar!")); + wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: separator not within a toolbar!")); m_toolbar->AddSeparator(); return m_toolbar; // must return non-NULL } @@ -101,8 +101,8 @@ wxObject *wxToolBarXmlHandler::DoCreateResource() { wxObject *created = CreateResFromNode(n, toolbar, NULL); wxControl *control = wxDynamicCast(created, wxControl); - if (IsOfClass(n, wxT("tool")) && - IsOfClass(n, wxT("separator")) && + if (!IsOfClass(n, wxT("tool")) && + !IsOfClass(n, wxT("separator")) && control != NULL) toolbar->AddControl(control); }