void DataColumn::removeAll() { // Removes all the rows within the DataColumn if ( m_firstRow == NULL ) { return; } DataRow* rowToDelete; DataRow* currentRow = m_firstRow; while ( currentRow->getNext() != NULL ) { rowToDelete = currentRow; currentRow = currentRow->getNext(); rowToDelete->setPrev(NULL); rowToDelete->setNext(NULL); rowToDelete->setText(""); delete rowToDelete; } m_firstRow = NULL; m_lastRow = NULL; m_currentRow = NULL; }
void DataColumn::recalculateRowLength() { // Goes through the DataRow list in the DataColumn to determine // what the longest string in the DataColumn is m_rowLength = m_name.length(); DataRow* currentRow = m_firstRow; while ( currentRow != NULL ) { if ( currentRow->getText().length() > m_rowLength ) { m_rowLength = currentRow->getText().length(); } currentRow = currentRow->getNext(); } }