| 431 | } |
| 432 | |
| 433 | void SpreadsheetTest::testCopyPasteUtf8() { |
| 434 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 435 | sheet.setColumnCount(2); |
| 436 | sheet.setRowCount(100); |
| 437 | |
| 438 | const QString str = QString::fromUtf8("тест1 1\nтест2 2"); |
| 439 | |
| 440 | QApplication::clipboard()->setText(str); |
| 441 | |
| 442 | SpreadsheetView view(&sheet, false); |
| 443 | view.pasteIntoSelection(); |
| 444 | |
| 445 | // data types |
| 446 | QCOMPARE(sheet.column(0)->columnMode(), AbstractColumn::ColumnMode::Text); |
| 447 | QCOMPARE(sheet.column(1)->columnMode(), AbstractColumn::ColumnMode::Integer); |
| 448 | |
| 449 | // values |
| 450 | QCOMPARE(sheet.column(0)->textAt(0), QString::fromUtf8("тест1")); |
| 451 | QCOMPARE(sheet.column(1)->integerAt(0), 1); |
| 452 | |
| 453 | QCOMPARE(sheet.column(0)->textAt(1), QString::fromUtf8("тест2")); |
| 454 | QCOMPARE(sheet.column(1)->integerAt(1), 2); |
| 455 | } |
| 456 | /*! |
| 457 | insert the data at the edge of the spreadsheet and paste the data. |
| 458 | the spreadsheet has to be extended accordingly |
nothing calls this directly
no test coverage detected