MCPcopy Create free account
hub / github.com/KDE/labplot / testCopyPasteColumnMode07

Method testCopyPasteColumnMode07

tests/spreadsheet/SpreadsheetTest.cpp:314–334  ·  view source on GitHub ↗

! insert one column with whitespaces surrounding the actual values. the whitespaces have to be removed, one single column is processed only. */

Source from the content-addressed store, hash-verified

312 the whitespaces have to be removed, one single column is processed only.
313*/
314void SpreadsheetTest::testCopyPasteColumnMode07() {
315 QLocale::setDefault(QLocale::C); // . as decimal separator
316 Spreadsheet sheet(QStringLiteral("test"), false);
317 sheet.setColumnCount(1);
318 sheet.setRowCount(100);
319
320 const QString str = QStringLiteral(" 10 \n 20 \n");
321 QApplication::clipboard()->setText(str);
322
323 SpreadsheetView view(&sheet, false);
324 view.pasteIntoSelection();
325
326 // spreadsheet size and column mode
327 QCOMPARE(sheet.columnCount(), 1);
328 QCOMPARE(sheet.rowCount(), 100);
329 QCOMPARE(sheet.column(0)->columnMode(), AbstractColumn::ColumnMode::Integer);
330
331 // values
332 QCOMPARE(sheet.column(0)->integerAt(0), 10);
333 QCOMPARE(sheet.column(0)->integerAt(1), 20);
334}
335
336//**********************************************************
337//********* Handling of spreadsheet size changes ***********

Callers

nothing calls this directly

Calls 9

setColumnCountMethod · 0.45
setRowCountMethod · 0.45
setTextMethod · 0.45
pasteIntoSelectionMethod · 0.45
columnCountMethod · 0.45
rowCountMethod · 0.45
columnModeMethod · 0.45
columnMethod · 0.45
integerAtMethod · 0.45

Tested by

no test coverage detected