From 6adf2efa20d36c8be253e534eb86b1fcbbd3c071 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 14 Dec 2013 15:32:58 +0000 Subject: [PATCH] Ensure a small spanned column doesn't shrink its columns too much by checking for min column sizes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 88b414700c..41a4625acb 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -10283,13 +10283,16 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const if (spanningWidth > 0) { // Now share the spanning width between columns within that span - // TODO: take into account min widths of columns within the span int spanningWidthLeft = spanningWidth; int stretchColCount = 0; for (k = i; k < (i+spans); k++) { + int minColWidth = wxMax(minColWidths[k], minColWidthsNoWrap[k]); + if (colWidths[k] > 0) // absolute or proportional width has been specified spanningWidthLeft -= colWidths[k]; + else if (minColWidth > 0) + spanningWidthLeft -= minColWidth; else stretchColCount ++; } @@ -10306,7 +10309,8 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const { for (k = i; k < (i+spans); k++) { - if (colWidths[k] <= 0) // absolute or proportional width has not been specified + int minColWidth = wxMax(minColWidths[k], minColWidthsNoWrap[k]); + if (colWidths[k] <= 0 && minColWidth <= 0) // absolute or proportional width has not been specified { int newWidth = colShare; if (k == (i+spans-1))