X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4791fafb6d69dda73abc0a92c6a9ab19ce13801a..acc476c530e1730d9202b404ec0b0b87ae44ced6:/src/xrc/xh_mdi.cpp diff --git a/src/xrc/xh_mdi.cpp b/src/xrc/xh_mdi.cpp index ef69b476a2..507f49d806 100644 --- a/src/xrc/xh_mdi.cpp +++ b/src/xrc/xh_mdi.cpp @@ -8,10 +8,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "xh_mdi.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -82,7 +78,10 @@ wxWindow *wxMdiXmlHandler::CreateFrame() wxMDIParentFrame *mdiParent = wxDynamicCast(m_parent, wxMDIParentFrame); if ( !mdiParent ) - wxLogError(wxT("Parent is not of type wxMDIParentFrame.")); + { + wxLogError(wxT("Parent of wxMDIParentFrame must be wxMDIParentFrame.")); + return NULL; + } XRC_MAKE_INSTANCE(frame, wxMDIChildFrame); @@ -105,10 +104,11 @@ wxObject *wxMdiXmlHandler::DoCreateResource() frame->SetClientSize(GetSize()); if (HasParam(wxT("pos"))) frame->Move(GetPosition()); - if (HasParam(wxT("icon")) && frame->IsKindOf(CLASSINFO(wxFrame))) + if (HasParam(wxT("icon"))) { - wxFrame* f = wxDynamicCast(f, wxFrame); - f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON)); + wxFrame* f = wxDynamicCast(frame, wxFrame); + if (f) + f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON)); } SetupWindow(frame);