forked from qt-creator/qt-creator
CppEditor: Fix tests
Amends 35fcd96b85
.
Change-Id: I0fe016f0d801922d847858de374e1a95f7a2bb0c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <cpptools/cppsemanticinfo.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cplusplus/CppDocument.h>
|
||||
#include <texteditor/storagesettings.h>
|
||||
|
||||
#include <QDir>
|
||||
|
||||
@@ -96,8 +97,12 @@ void TestCase::setUseClangd()
|
||||
bool TestCase::openCppEditor(const QString &fileName, CppEditor **editor, CppEditorWidget **editorWidget)
|
||||
{
|
||||
if (CppEditor *e = dynamic_cast<CppEditor *>(Core::EditorManager::openEditor(fileName))) {
|
||||
if (editor)
|
||||
if (editor) {
|
||||
*editor = e;
|
||||
TextEditor::StorageSettings s = e->textDocument()->storageSettings();
|
||||
s.m_addFinalNewLine = false;
|
||||
e->textDocument()->setStorageSettings(s);
|
||||
}
|
||||
if (editorWidget) {
|
||||
if (CppEditorWidget *w = dynamic_cast<CppEditorWidget *>(e->editorWidget())) {
|
||||
*editorWidget = w;
|
||||
|
Reference in New Issue
Block a user