CppEditor: Fix "testInsertAndFormatDefsFromDecls" test

Amends 240748c106.

Change-Id: I13a4eb28737636dbb5f5f5c1c7ab771a4518a701
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Christian Kandeler
2023-12-07 14:05:36 +01:00
parent fbe054116a
commit 0e04f40fa7
2 changed files with 6 additions and 11 deletions

View File

@@ -7,9 +7,6 @@
#include <coreplugin/icore.h>
#include <cppeditor/cppcodestylepreferences.h>
#include <cppeditor/cpptoolssettings.h>
#include <projectexplorer/editorconfiguration.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectmanager.h>
@@ -565,14 +562,6 @@ Utils::ChangeSet ClangFormatBaseIndenter::replacements(QByteArray buffer,
Utils::EditOperations ClangFormatBaseIndenter::format(const TextEditor::RangesInLines &rangesInLines,
FormattingMode mode)
{
bool doFormatting = mode == FormattingMode::Forced || formatCodeInsteadOfIndent();
#ifdef WITH_TESTS
doFormatting = doFormatting || CppEditor::CppToolsSettings::cppCodeStyle()
->codeStyleSettings().forceFormatting;
#endif
if (!doFormatting)
return {};
QTC_ASSERT(!m_fileName.isEmpty(), return {});
if (rangesInLines.empty())
return {};