| 613 | |
| 614 | |
| 615 | vector<size_t> getMaxWidthOfColumns(stringmatr upper, stringmatr lower) { |
| 616 | |
| 617 | if (upper.empty()) |
| 618 | return {}; |
| 619 | |
| 620 | size_t numCols = upper[0].size(); // matches lower, unless lower empty |
| 621 | vector<size_t> maxWidths(numCols, 0); |
| 622 | |
| 623 | for (size_t c=0; c<numCols; c++) |
| 624 | maxWidths[c] = std::max( |
| 625 | getMaxWidthOfColumn(upper, c), |
| 626 | getMaxWidthOfColumn(lower, c)); // 0 if lower empty |
| 627 | |
| 628 | return maxWidths; |
| 629 | } |
| 630 | |
| 631 | |
| 632 | void expandMaxWidthsAccordingToLabels(vector<size_t> &widths, vector<string> &labels) { |
no test coverage detected