| 234 | } |
| 235 | |
| 236 | void EditorDocumentFind::replace(const QString &before, const QString &after) |
| 237 | { |
| 238 | if (before.isEmpty()) |
| 239 | return; |
| 240 | |
| 241 | auto w = d->autoAdjustCurrentEditor(); |
| 242 | auto editor = qobject_cast<TextEditor *>(w); |
| 243 | if (!editor || editor->isReadOnly()) |
| 244 | return; |
| 245 | |
| 246 | const auto &selText = editor->selectedText(); |
| 247 | if (!selText.isEmpty() && selText == before) |
| 248 | editor->replaceSelectedText(after); |
| 249 | } |
| 250 | |
| 251 | void EditorDocumentFind::replaceFind(const QString &before, const QString &after) |
| 252 | { |
no test coverage detected