From 42e719518508b36b3db7d64ca8e2dd7f1095cfb7 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 3 Jun 2022 10:50:59 +0200 Subject: [PATCH] CppEditor: Remove unused functions Change-Id: I392930920b536813c9f8fb4969e7f486960aa0cb Reviewed-by: Jarek Kobus --- src/plugins/cppeditor/cppeditorwidget.cpp | 51 ----------------------- 1 file changed, 51 deletions(-) diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index f6409bdbd1c..9eaed9a9291 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -663,57 +663,6 @@ void CppEditorWidget::onIfdefedOutBlocksUpdated(unsigned revision, textDocument()->setIfdefedOutBlocks(ifdefedOutBlocks); } -static QString getDocumentLine(QTextDocument *document, int line) -{ - if (document) - return document->findBlockByNumber(line - 1).text(); - - return {}; -} - -static std::unique_ptr getCurrentDocument(const QString &path) -{ - const QTextCodec *defaultCodec = Core::EditorManager::defaultTextCodec(); - QString contents; - Utils::TextFileFormat format; - QString error; - if (Utils::TextFileFormat::readFile(Utils::FilePath::fromString(path), - defaultCodec, - &contents, - &format, - &error) - != Utils::TextFileFormat::ReadSuccess) { - qWarning() << "Error reading file " << path << " : " << error; - return {}; - } - - return std::make_unique(contents); -} - -static void onReplaceUsagesClicked(const QString &text, - const QList &items, - bool preserveCase) -{ - CppModelManager *modelManager = CppModelManager::instance(); - if (!modelManager) - return; - - const FilePaths filePaths = TextEditor::BaseFileFind::replaceAll(text, items, preserveCase); - if (!filePaths.isEmpty()) { - modelManager->updateSourceFiles(Utils::transform(filePaths, &FilePath::toString)); - SearchResultWindow::instance()->hide(); - } -} - -static QTextDocument *getOpenDocument(const QString &path) -{ - const IDocument *document = DocumentModel::documentForFilePath(FilePath::fromString(path)); - if (document) - return qobject_cast(document)->document(); - - return {}; -} - void CppEditorWidget::findUsages() { findUsages(textCursor());