aboutsummaryrefslogtreecommitdiff
path: root/dw/table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/table.cc')
-rw-r--r--dw/table.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/dw/table.cc b/dw/table.cc
index 4259111a..ce45b7ad 100644
--- a/dw/table.cc
+++ b/dw/table.cc
@@ -753,12 +753,16 @@ 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, corrWidth)
+ - ((numCols + 1) * getStyle()->hBorderSpacing + boxDiffWidth ());
+
DBG_OBJ_MSGF ("resize", 1,
- "totalWidth = %d - ((%d - 1) * %d + %d) = <b>%d</b>",
- availWidth, numCols, getStyle()->hBorderSpacing,
+ "totalWidth = max (%d, %d) - ((%d - 1) * %d + %d) = <b>%d</b>",
+ availWidth, corrWidth, numCols, getStyle()->hBorderSpacing,
boxDiffWidth (), totalWidth);
colWidths->setSize (numCols, 0);