From f120af9d565df0ad12cddda8c8164c6d3917a11c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 8 Mar 2006 00:09:37 +0000 Subject: [PATCH] use wxCHECK instead of wxASSERT to avoid crashing later (coverity checker CID 19) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index dd30e8ce1a..3e01cab6fd 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -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); -- 2.45.2