| 85 | } |
| 86 | |
| 87 | QString OutputDocumentFind::findString() const |
| 88 | { |
| 89 | QTextCursor cursor = d->textCursor(); |
| 90 | if (cursor.hasSelection() && cursor.block() != cursor.document()->findBlock(cursor.anchor())) |
| 91 | return QString(); // multi block selection |
| 92 | |
| 93 | if (cursor.hasSelection()) |
| 94 | return cursor.selectedText(); |
| 95 | |
| 96 | if (!cursor.atBlockEnd() && !cursor.hasSelection()) { |
| 97 | cursor.movePosition(QTextCursor::StartOfWord); |
| 98 | cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); |
| 99 | QString s = cursor.selectedText(); |
| 100 | for (const QChar c : s) { |
| 101 | if (!c.isLetterOrNumber() && c != QLatin1Char('_')) { |
| 102 | s.clear(); |
| 103 | break; |
| 104 | } |
| 105 | } |
| 106 | return s; |
| 107 | } |
| 108 | |
| 109 | return QString(); |
| 110 | } |
| 111 | |
| 112 | void OutputDocumentFind::findNext(const QString &txt) |
| 113 | { |
nothing calls this directly
no test coverage detected