* \brief Fills dw::Table::colExtremes in all cases. */
| 1293 | * \brief Fills dw::Table::colExtremes in all cases. |
| 1294 | */ |
| 1295 | void Table::forceCalcColumnExtremes () |
| 1296 | { |
| 1297 | DBG_OBJ_ENTER0 ("resize", 0, "forceCalcColumnExtremes"); |
| 1298 | |
| 1299 | if (numCols > 0) { |
| 1300 | lout::misc::SimpleVector<int> colSpanCells (8); |
| 1301 | colExtremes->setSize (numCols); |
| 1302 | colWidthSpecified->setSize (numCols); |
| 1303 | colWidthPercentage->setSize (numCols); |
| 1304 | |
| 1305 | // 1. cells with colspan = 1 |
| 1306 | for (int col = 0; col < numCols; col++) { |
| 1307 | DBG_OBJ_MSGF ("resize", 1, "column %d", col); |
| 1308 | DBG_OBJ_MSG_START (); |
| 1309 | |
| 1310 | colWidthSpecified->set (col, false); |
| 1311 | colWidthPercentage->set (col, false); |
| 1312 | |
| 1313 | colExtremes->getRef(col)->minWidth = 0; |
| 1314 | colExtremes->getRef(col)->minWidthIntrinsic = 0; |
| 1315 | colExtremes->getRef(col)->maxWidth = 0; |
| 1316 | colExtremes->getRef(col)->maxWidthIntrinsic = 0; |
| 1317 | colExtremes->getRef(col)->adjustmentWidth = 0; |
| 1318 | |
| 1319 | for (int row = 0; row < numRows; row++) { |
| 1320 | DBG_OBJ_MSGF ("resize", 1, "row %d", row); |
| 1321 | DBG_OBJ_MSG_START (); |
| 1322 | |
| 1323 | int n = row * numCols + col; |
| 1324 | |
| 1325 | if (childDefined (n)) { |
| 1326 | if (children->get(n)->cell.colspanEff == 1) { |
| 1327 | core::Extremes cellExtremes; |
| 1328 | children->get(n)->cell.widget->getExtremes (&cellExtremes); |
| 1329 | |
| 1330 | DBG_OBJ_MSGF ("resize", 1, "child: %d / %d", |
| 1331 | cellExtremes.minWidth, cellExtremes.maxWidth); |
| 1332 | |
| 1333 | colExtremes->getRef(col)->minWidthIntrinsic = |
| 1334 | misc::max (colExtremes->getRef(col)->minWidthIntrinsic, |
| 1335 | cellExtremes.minWidthIntrinsic); |
| 1336 | colExtremes->getRef(col)->maxWidthIntrinsic = |
| 1337 | misc::max (colExtremes->getRef(col)->minWidthIntrinsic, |
| 1338 | colExtremes->getRef(col)->maxWidthIntrinsic, |
| 1339 | cellExtremes.maxWidthIntrinsic); |
| 1340 | |
| 1341 | colExtremes->getRef(col)->minWidth = |
| 1342 | misc::max (colExtremes->getRef(col)->minWidth, |
| 1343 | cellExtremes.minWidth); |
| 1344 | colExtremes->getRef(col)->maxWidth = |
| 1345 | misc::max (colExtremes->getRef(col)->minWidth, |
| 1346 | colExtremes->getRef(col)->maxWidth, |
| 1347 | cellExtremes.maxWidth); |
| 1348 | |
| 1349 | colExtremes->getRef(col)->adjustmentWidth = |
| 1350 | misc::max (colExtremes->getRef(col)->adjustmentWidth, |
| 1351 | cellExtremes.adjustmentWidth); |
| 1352 |