Behaviour SwRS-MDOKFSTUDIO-TABLE-120
A spreadsheet paste into a table cell fills the cells from that cell
When the writer pastes into a cell text box a text that holds a tab, the extension SHALL write its values into the cells from the open cell rightwards and downwards, add the missing columns at the right and the missing rows at the end, save the table in one edit and reopen the editor in that cell.
Part of StRS-MDOKFSTUDIO-TABLE-001, outside the paths drawn on its map.
Scenarios 7
The situations the tests check; open one to read it.
nominalTwo spreadsheet rows pasted into a cell
Givena table of three columns whose last row is "| Five | row five | erin |" with the cell "row five" open, and the clipboard holds "a\tb\tc\n1\t2\t3\n"
Whenthe writer pastes
Thenthe row reads "| Five | a | b | c |" (one column is added at the right, with an empty header cell), a new last row reads "| | 1 | 2 | 3 |", no tab character is written, the table is saved in one edit and the editor reopens in the second cell of the "Five" row showing "a"
nominalA grid that fits the table
Givena table of two columns and two body rows, the first body cell open, and the clipboard holds "p\tq\nr\ts"
Whenthe writer pastes
Thenthe four cells hold the four values, no row or column is added and no cell outside the grid changes
boundaryStart in the header row
Giventhe header cell of the first column open and a pasted grid of two lines
Whenthe writer pastes
Thenthe first line fills the header row, the second line fills the first body row and the delimiter row is never written
boundaryLine endings, empty values and pipes
| Pasted text | Outcome |
|---|---|
| a final line break ("\n", "\r\n" or "\r") | not a row of its own |
| CRLF or lone CR between lines | a line break like "\n" |
| "a\t\tc" | the middle cell is empty |
| spaces around a value | trimmed |
| a value with a pipe | written | by the usual cell writing (SwRS-MDOKFSTUDIO-TABLE-091) |
| a line shorter than the others | only its own values are written |
boundaryOne undo step
Givena grid paste that adds a row and a column
Whenthe writer undoes once in the source
Thenthe source holds the table as it was before the paste
refusalA single value or a text without a tab
Giventhe clipboard holds "x", or "a\nb" (several lines, no tab)
Whenthe writer pastes into the cell text box
Thenthe paste is native: it is not intercepted, nothing is saved by it and the line breaks of "a\nb" become spaces as before (SwRS-MDOKFSTUDIO-TABLE-091)
boundaryA list-table
Givena plain {list-table} opened in the cell editor and a pasted grid wider than its columns
Whenthe writer pastes
Thenits rows and columns are added and the table is saved as a list-table in one edit