]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxCHECK instead of wxASSERT to avoid crashing later (coverity checker CID 19)
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Mar 2006 00:09:37 +0000 (00:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Mar 2006 00:09:37 +0000 (00:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextbuffer.cpp

index dd30e8ce1a66e54f20919e2c902c6c788b5d77a8..3e01cab6fdb1154e79be06168d493922031f5027 100644 (file)
@@ -589,10 +589,13 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl
         // Assume this box only contains paragraphs
 
         wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph);
-        wxASSERT (child != NULL);
+        wxCHECK_MSG( child, false, _T("Unknown object in layout") );
 
         // TODO: what if the child hasn't been laid out (e.g. involved in Undo) but still has 'old' lines
-        if (child && !forceQuickLayout && (layoutAll || child->GetLines().GetCount() == 0 || !child->GetRange().IsOutside(invalidRange)))
+        if ( !forceQuickLayout &&
+                (layoutAll ||
+                    child->GetLines().IsEmpty() ||
+                        !child->GetRange().IsOutside(invalidRange)) )
         {
             child->Layout(dc, availableSpace, style);