| 487 | } |
| 488 | |
| 489 | void CATableView::reloadViewSizeData() |
| 490 | { |
| 491 | this->clearData(); |
| 492 | |
| 493 | m_nSections = m_pTableViewDataSource->numberOfSections(this); |
| 494 | m_nRowsInSections.resize(m_nSections); |
| 495 | for (unsigned int i=0; i<m_nSections; i++) |
| 496 | { |
| 497 | unsigned int rowsInSection = m_pTableViewDataSource->numberOfRowsInSection(this, i); |
| 498 | m_nRowsInSections[i] = rowsInSection; |
| 499 | } |
| 500 | |
| 501 | m_nSectionHeaderHeights.resize(m_nSections); |
| 502 | for (unsigned int i=0; i<m_nSections; i++) |
| 503 | { |
| 504 | unsigned int sectionHeaderHeight = m_pTableViewDataSource->tableViewHeightForHeaderInSection(this, i); |
| 505 | m_nSectionHeaderHeights[i] = sectionHeaderHeight; |
| 506 | } |
| 507 | |
| 508 | m_nSectionFooterHeights.resize(m_nSections); |
| 509 | for (unsigned int i=0; i<m_nSections; i++) |
| 510 | { |
| 511 | unsigned int sectionFooterHeight = m_pTableViewDataSource->tableViewHeightForFooterInSection(this, i); |
| 512 | m_nSectionFooterHeights[i] = sectionFooterHeight; |
| 513 | } |
| 514 | |
| 515 | m_nRowHeightss.resize(m_nSections); |
| 516 | for (unsigned int i=0; i<m_nSections; i++) |
| 517 | { |
| 518 | std::vector<unsigned int> rowHeights(m_nRowsInSections.at(i)); |
| 519 | for (unsigned int j=0; j<m_nRowsInSections.at(i); j++) |
| 520 | { |
| 521 | unsigned int rowHeight = m_pTableViewDataSource->tableViewHeightForRowAtIndexPath(this, i, j); |
| 522 | rowHeights[j] = rowHeight; |
| 523 | } |
| 524 | m_nRowHeightss[i] = rowHeights; |
| 525 | } |
| 526 | |
| 527 | unsigned int viewHeight = 0; |
| 528 | |
| 529 | m_nSectionHeights.resize(m_nSections); |
| 530 | for (unsigned int i=0; i<m_nSections; i++) |
| 531 | { |
| 532 | unsigned int sectionHeight = 0; |
| 533 | sectionHeight += m_nSectionHeaderHeights.at(i); |
| 534 | sectionHeight += m_nSectionFooterHeights.at(i); |
| 535 | for (unsigned int j=0; j<m_nRowHeightss.at(i).size(); j++) |
| 536 | { |
| 537 | sectionHeight += m_nRowHeightss.at(i).at(j); |
| 538 | sectionHeight += m_nSeparatorViewHeight; |
| 539 | } |
| 540 | m_nSectionHeights[i] = sectionHeight; |
| 541 | viewHeight += sectionHeight; |
| 542 | } |
| 543 | |
| 544 | viewHeight += m_nTableHeaderHeight; |
| 545 | viewHeight += m_nTableFooterHeight; |
| 546 |
no test coverage detected