From 9dc7358017f6d3c2f40de408bcd2e21847676318 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 5 Oct 2013 16:31:30 +0000 Subject: [PATCH] wxRTC: fixed bug with columns with unspecified widths, and column spans, being sized too small git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 2c78b0e1d8..ba55ec5757 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -10003,7 +10003,6 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const } // (2) Allocate initial column widths from minimum widths, absolute values and proportions - // TODO: simply merge this into (1). for (i = 0; i < m_colCount; i++) { if (absoluteColWidths[i] > 0) @@ -10013,11 +10012,9 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const else if (percentageColWidths[i] > 0) { colWidths[i] = percentageColWidths[i]; - - // This is rubbish - we calculated the absolute widths from percentages, so - // we can't do it again here. - //colWidths[i] = (int) (double(percentageColWidths[i]) * double(tableWidth) / 100.0 + 0.5); } + else + colWidths[i] = maxUnspecifiedColumnWidths[i]; } // (3) Process absolute or proportional widths of spanning columns, @@ -10090,8 +10087,6 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const // cells to the columns later. cellWidth = cell->GetMinSize().x; - maxUnspecifiedColumnWidths[i] = wxMax(cell->GetMaxSize().x, maxUnspecifiedColumnWidths[i]); - if (cell->GetMaxSize().x > cellWidth) cellWidth = cell->GetMaxSize().x; } @@ -10142,14 +10137,6 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const } } - // (3.1) if a column has zero width, make it the maximum unspecified width (i.e. using - // the cell's contents to calculate the width) - for (i = 0; i < m_colCount; i++) - { - if (colWidths[i] == 0) - colWidths[i] = maxUnspecifiedColumnWidths[i]; - } - // (4) Next, share any remaining space out between columns that have not yet been calculated. // TODO: take into account min widths of columns within the span int tableWidthMinusPadding = internalTableWidth - (m_colCount-1)*paddingX;