numeric_t Column::getTotalValue(const CellValueRetriever* pColumn) const { numeric_t total = 0.0; ICell* pCell = nullptr; foreach(pCell, m_cells) total += pCell->getValue(pColumn); return total; }
numeric_t Sheet::totalRowValue(const RowId& rowId) const { numeric_t rowTotal = 0.0; Column* pColumn = NULL; foreach(pColumn, m_columns) { ICell* pCell = pColumn->cellAt(rowId); if (pCell && pCell->isNumeric() && pCell->isPartOfTotal()) rowTotal += pCell->getValue(NULL); //pass here the total column? useless }
numeric_t SplitComponent::getRowInputUnits(const RowId& rowId) const { numeric_t units = 0.0; const InputColumn* pInputCol = NULL; foreach(pInputCol, m_inputs) { ICell* pCell = pInputCol->cellAt(rowId); Q_ASSERT(pCell); if (pCell) units += pCell->getValue(this); }