kooloveme / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
Other
0 stars 0 forks source link

Table width calculation bug where MinWidths become larger than MaxWidths #311

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which steps will reproduce the problem?
1. Create a HtmlViewer with Width=554, Height=379
2. Use LoadFromFile to load the attached test.html file

What is the expected output?
The table is completely visible.

What do you see instead?
The second column (with rowspan=2) in the main table isn't visible because the 
first column is too large.

Which version of the product are you using? Which compiler version are you
using? On which operating system?
svn rev. 443, Delphi 2009, Windows 7.

Please provide any additional information:
The problem is that the IncreaseMinMaxWidthsEvenly function changes the 
MinWidths to values that are larger then the MaxWidth.

The attached patch fixes this by checking the MinWidths and MaxWidths arrays 
for abnormalities and correcting them.
It also changes the IncreaseWidthsByMinMaxDelta function, so that it doesn't 
assign the all the remaining width only to the first column, but instead 
spreads it proportionally over all wtNone WidthType columns, which is the 
behavior that Chrome, Firefox and IE9 have.

Original issue reported on code.google.com by Andreas....@gmail.com on 18 Oct 2013 at 6:26

Attachments:

GoogleCodeExporter commented 9 years ago
I have updated the patch to fix a bug that was introduced by the old patch.

Original comment by Andreas....@gmail.com on 22 Oct 2013 at 7:37

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for fixing this issue!

r447 applies your fix.

Original comment by OrphanCat on 16 Nov 2013 at 3:33