diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 3aa705d9df..3156a9433b 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -1692,14 +1692,15 @@ void wxRichTextCompositeObject::Invalidate(const wxRichTextRange& invalidRange) } else if (child->IsTopLevel()) { - // Not sure why we did this, but it stops updated layout happening for floating objects. -#if 0 - if (wxRichTextBuffer::GetFloatingLayoutMode() && child->IsFloating() && GetBuffer()->GetFloatCollector() && GetBuffer()->GetFloatCollector()->HasFloat(child)) + // JACS: Not sure why we did this, but it stops updated layout happening for floating objects. + // DGHART: But we must do it for floating tables, otherwise the cell layout is lost. + // JACS: this is probably still wrong. Needs further investigation. + if (wxRichTextBuffer::GetFloatingLayoutMode() && child->IsFloating() && wxDynamicCast(child, wxRichTextTable) + && GetBuffer()->GetFloatCollector() && GetBuffer()->GetFloatCollector()->HasFloat(child)) { // Don't invalidate subhierarchy if we've already been laid out } else -#endif { if (invalidRange == wxRICHTEXT_NONE) child->Invalidate(wxRICHTEXT_NONE);