diff options
author | Sebastian Geerken <devnull@localhost> | 2014-10-03 01:36:39 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-10-03 01:36:39 +0200 |
commit | f8fd2e3c4cb25c37b85552fbcad0bf5fb740ab8a (patch) | |
tree | 85fd99ce71cd31f0402e840833c8b7aa6a536d3d /dw/table.cc | |
parent | 44fb0ff9ca1dd52f071976e9a7a9a060695a2ba5 (diff) |
'Adjust_table_min_width' is working again.
Diffstat (limited to 'dw/table.cc')
-rw-r--r-- | dw/table.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/dw/table.cc b/dw/table.cc index 746856c7..b4a9adb6 100644 --- a/dw/table.cc +++ b/dw/table.cc @@ -733,13 +733,19 @@ void Table::forceCalcCellSizes (bool calcHeights) getExtremes (&extremes); int availWidth = getAvailWidth (true); - int totalWidth = availWidth - - ((numCols + 1) * getStyle()->hBorderSpacing + boxDiffWidth ()); + // When adjust_table_min_width is set, use the minimal (intrinsic) + // width for correction. + int corrWidth = + Table::getAdjustTableMinWidth () ? extremes.minWidthIntrinsic : 0; + int totalWidth = + misc::max (availWidth - ((numCols + 1) * getStyle()->hBorderSpacing + + boxDiffWidth ()), + corrWidth); DBG_OBJ_MSGF ("resize", 1, - "totalWidth = %d - ((%d - 1) * %d + %d) = <b>%d</b>", + "totalWidth = max (%d - ((%d - 1) * %d + %d), %d) = <b>%d</b>", availWidth, numCols, getStyle()->hBorderSpacing, - boxDiffWidth (), totalWidth); + boxDiffWidth (), corrWidth, totalWidth); colWidths->setSize (numCols, 0); cumHeight->setSize (numRows + 1, 0); |