! insert one column with integer values and one column with float numbers into an empty spreadsheet. the first column has to be converted to integer column, the second to float. */
| 107 | the first column has to be converted to integer column, the second to float. |
| 108 | */ |
| 109 | void SpreadsheetTest::testCopyPasteColumnMode02() { |
| 110 | QLocale::setDefault(QLocale::C); // . as decimal separator |
| 111 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 112 | sheet.setColumnCount(2); |
| 113 | sheet.setRowCount(100); |
| 114 | |
| 115 | const QString str = QStringLiteral("10 100.0\n20 200.0"); |
| 116 | QApplication::clipboard()->setText(str); |
| 117 | |
| 118 | SpreadsheetView view(&sheet, false); |
| 119 | view.pasteIntoSelection(); |
| 120 | |
| 121 | // spreadsheet size |
| 122 | QCOMPARE(sheet.columnCount(), 2); |
| 123 | QCOMPARE(sheet.rowCount(), 100); |
| 124 | |
| 125 | // column modes |
| 126 | QCOMPARE(sheet.column(0)->columnMode(), AbstractColumn::ColumnMode::Integer); |
| 127 | QCOMPARE(sheet.column(1)->columnMode(), AbstractColumn::ColumnMode::Double); |
| 128 | |
| 129 | // values |
| 130 | QCOMPARE(sheet.column(0)->integerAt(0), 10); |
| 131 | QCOMPARE(sheet.column(1)->valueAt(0), 100.0); |
| 132 | QCOMPARE(sheet.column(0)->integerAt(1), 20); |
| 133 | QCOMPARE(sheet.column(1)->valueAt(1), 200.0); |
| 134 | } |
| 135 | |
| 136 | /*! |
| 137 | Properly handle empty values in the tab separated data. |
nothing calls this directly
no test coverage detected