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 | |
parent | 44fb0ff9ca1dd52f071976e9a7a9a060695a2ba5 (diff) |
'Adjust_table_min_width' is working again.
-rw-r--r-- | dw/table.cc | 14 | ||||
-rw-r--r-- | dw/table.hh | 2 |
2 files changed, 11 insertions, 5 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); diff --git a/dw/table.hh b/dw/table.hh index a8823ca0..1e7c5268 100644 --- a/dw/table.hh +++ b/dw/table.hh @@ -488,7 +488,7 @@ public: inline static void setAdjustTableMinWidth (bool adjustTableMinWidth) { Table::adjustTableMinWidth = adjustTableMinWidth; } - inline static int getAdjustTableMinWidth () + inline static bool getAdjustTableMinWidth () { return Table::adjustTableMinWidth; } Table(bool limitTextWidth); |