]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxCHECK instead of wxASSERT to avoid use of NULL pointer
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 15:39:49 +0000 (15:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 15:39:49 +0000 (15:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/dragimgg.cpp
src/motif/mdi.cpp

index 7ea5a4fabcb1a2bf923539bffb3f0734f3e5f4f8..1992db6c9bed7b07a71f1ae77de8e0bff20e0be8 100644 (file)
@@ -236,7 +236,7 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot,
                                    bool fullScreen,
                                    wxRect* rect)
 {
-    wxASSERT_MSG( (window != 0), wxT("Window must not be null in BeginDrag."));
+    wxCHECK_MSG( window, false, wxT("Window must not be null in BeginDrag."));
 
     // The image should be offset by this amount
     m_offset = hotspot;
@@ -249,15 +249,12 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot,
     m_isDirty = false;
     m_isDirty = false;
 
-    if (window)
-    {
-        window->CaptureMouse();
+    window->CaptureMouse();
 
-        if (m_cursor.Ok())
-        {
-            m_oldCursor = window->GetCursor();
-            window->SetCursor(m_cursor);
-        }
+    if (m_cursor.Ok())
+    {
+        m_oldCursor = window->GetCursor();
+        window->SetCursor(m_cursor);
     }
 
     // Make a copy of the window so we can repair damage done as the image is
index 09894eea98dfcd3f726b9d0e898bb98ab22bd1f9..1373b0b925ae39868ad3ddd39e6307ee5c17eeba 100644 (file)
@@ -349,9 +349,9 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
     wxMDIClientWindow* clientWindow = parent->GetClientWindow();
 
-    wxASSERT_MSG( (clientWindow != (wxWindow*) NULL), "Missing MDI client window.");
+    wxCHECK_MSG( clientWindow, false, "Missing MDI client window." );
 
-    if (clientWindow) clientWindow->AddChild(this);
+    clientWindow->AddChild(this);
 
     SetMDIParentFrame(parent);