MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / replace

Method replace

src/plugins/codeeditor/find/editordocumentfind.cpp:236–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void 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
251void EditorDocumentFind::replaceFind(const QString &before, const QString &after)
252{

Callers 6

isHtmlContentEmptyMethod · 0.45
drawTextMethod · 0.45
replaceRangeMethod · 0.45
setValueMethod · 0.45
uchardetCodeMethod · 0.45

Calls 5

isReadOnlyMethod · 0.80
isEmptyMethod · 0.45
selectedTextMethod · 0.45
replaceSelectedTextMethod · 0.45

Tested by

no test coverage detected