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
This commit is contained in:
Julian Smart
2013-10-05 16:31:30 +00:00
parent a599b4b5d7
commit 9dc7358017

View File

@@ -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;