resize(long R, long C = 0) Resize to R,C dimensions. Table can grow only, shrinking has to be done by deleteColumns() or deleteRows(). If R == 0 or C == 0: this dimension isn't changed */
| 58 | If R == 0 or C == 0: this dimension isn't changed |
| 59 | */ |
| 60 | void CsvDataStorage::resize(table_index_t R, table_index_t C) { |
| 61 | table_index_t old_rows = rows(); |
| 62 | table_index_t old_columns = columns(); |
| 63 | |
| 64 | if( C > old_columns ) { |
| 65 | for( table_index_t i = 0; i < old_rows; ++i) { |
| 66 | tableData.at(i) += emptyCellsString(C - old_columns); |
| 67 | } |
| 68 | } |
| 69 | if( R > 0 && R > rows() ) { |
| 70 | tableData.resize(R); |
| 71 | for( table_index_t i = old_rows; i < R; ++i) { // add empty vectors into the newly created rows |
| 72 | tableData.at(i) = emptyCellsString(C - 1); |
| 73 | } |
| 74 | } |
| 75 | if( C > old_columns ) { |
| 76 | numColumns = C; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | |
| 81 | /** |
no test coverage detected