| 899 | } |
| 900 | |
| 901 | void InputEditorModel::pasteInputsInRange(int row, int count) |
| 902 | { |
| 903 | /* Rewind to past frame if needed */ |
| 904 | if (row < static_cast<int>(context->framecount)) { |
| 905 | bool ret = rewind(row); |
| 906 | if (!ret) { |
| 907 | startHighlight(row, row+count-1, 0, columnCount()-1, false); |
| 908 | return; |
| 909 | } |
| 910 | } |
| 911 | |
| 912 | QClipboard *clipboard = QGuiApplication::clipboard(); |
| 913 | std::istringstream inputString(clipboard->text().toStdString()); |
| 914 | |
| 915 | std::vector<AllInputs> paste_ais; |
| 916 | InputSerialization::readInputs(inputString, paste_ais); |
| 917 | |
| 918 | if (paste_ais.empty()) |
| 919 | return; |
| 920 | |
| 921 | /* Update the movie by ranges of pasted inputs */ |
| 922 | for (int i = 0; i < count; i+=paste_ais.size()) { |
| 923 | size_t range_size = std::min(paste_ais.size(), (size_t)(count-i)); |
| 924 | movie->inputs->editInputs(paste_ais, row+i, range_size); |
| 925 | } |
| 926 | } |
| 927 | |
| 928 | int InputEditorModel::pasteInsertInputs(int row) |
| 929 | { |
no test coverage detected