+ // increase column widths for multicolumn cells if needed
+ // FIXME: multicolumn lines are not yet considered
+ for (col_type last = 0; last < ncols(); ++last) {
+ map<col_type, int> const & widths = mcolwidths[last];
+ // We increase the width of the last column of the multicol
+ // cell (some sort of left alignment). Since we iterate through
+ // the last and the first columns from left to right, we ensure
+ // that increased widths of previous columns are correctly
+ // taken into account for later columns, thus preventing
+ // unneeded width increasing.
+ for (map<col_type, int>::const_iterator it = widths.begin();
+ it != widths.end(); ++it) {
+ int const wid = it->second;
+ col_type const first = it->first;
+ int const nextoffset =
+ colinfo_[first].offset +
+ wid +
+ displayColSpace(last) +
+ colsep() +
+ colinfo_[last+1].lines * vlinesep();
+ int const dx = nextoffset - colinfo_[last+1].offset;
+ if (dx > 0) {
+ colinfo_[last].width += dx;
+ for (col_type col = last + 1; col <= ncols(); ++col)
+ colinfo_[col].offset += dx;
+ }
+ }
+ }