From fc63fb9aafcdebf0e5ed04c768457bf61148af0c Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 9 Aug 2013 11:56:33 +0000 Subject: [PATCH] Applied #15393 (dghart) fixing wxRichTextTable for percentage widths git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74647 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 035f00b..cc52bc9 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -9520,12 +9520,13 @@ bool wxRichTextTable::Layout(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextAttr attr(GetAttributes()); context.ApplyVirtualAttributes(attr, this); + bool tableHasPercentWidth = (attr.GetTextBoxAttr().GetWidth().GetUnits() == wxTEXT_ATTR_UNITS_PERCENTAGE); // If we have no fixed table size, and assuming we're not pushed for // space, then we don't have to try to stretch the table to fit the contents. - bool stretchToFitTableWidth = false; - + bool stretchToFitTableWidth = tableHasPercentWidth; + int tableWidth = rect.width; - if (attr.GetTextBoxAttr().GetWidth().IsValid()) + if (attr.GetTextBoxAttr().GetWidth().IsValid() && !tableHasPercentWidth) { tableWidth = converter.GetPixels(attr.GetTextBoxAttr().GetWidth()); -- 2.7.4