| 543 | } |
| 544 | |
| 545 | QString TabWidget::rangeText(const QString &fileName, const dpfservice::Edit::Range &range, bool &found) |
| 546 | { |
| 547 | if (auto editor = d->findEditor(fileName)) { |
| 548 | found = true; |
| 549 | int startPos = editor->positionFromLineIndex(range.start.line, |
| 550 | range.start.column == -1 |
| 551 | ? 0 |
| 552 | : range.start.column); |
| 553 | int endPos = range.end.column == -1 |
| 554 | ? editor->SendScintilla(TextEditor::SCI_GETLINEENDPOSITION, range.end.line) |
| 555 | : editor->positionFromLineIndex(range.end.line, range.end.column); |
| 556 | if (startPos == -1 || endPos == -1) |
| 557 | return {}; |
| 558 | |
| 559 | return editor->text(startPos, endPos); |
| 560 | } |
| 561 | |
| 562 | found = false; |
| 563 | return {}; |
| 564 | } |
| 565 | |
| 566 | Edit::Range TabWidget::selectionRange(const QString &fileName, bool &found) |
| 567 | { |
no test coverage detected