From 07374a7114474db3581edb6242abdb8f75d90c3a Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 6 Jun 2023 11:58:11 +0200 Subject: [PATCH] ClangFormat: Do not change incompatible settings Fixes: QTCREATORBUG-29190 Change-Id: I81730f59f05c8aba718a60deebfeb2b1b3aa0d7f Reviewed-by: Artem Sokolovskii Reviewed-by: Christian Kandeler --- src/plugins/clangformat/clangformatfile.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/clangformat/clangformatfile.cpp b/src/plugins/clangformat/clangformatfile.cpp index f0c48099131..fc1659b976c 100644 --- a/src/plugins/clangformat/clangformatfile.cpp +++ b/src/plugins/clangformat/clangformatfile.cpp @@ -158,8 +158,6 @@ CppEditor::CppCodeStyleSettings ClangFormatFile::toCppCodeStyleSettings( settings.indentSwitchLabels = style.IndentCaseLabels; #if LLVM_VERSION_MAJOR >= 11 settings.indentBlocksRelativeToSwitchLabels = style.IndentCaseBlocks; - settings.indentStatementsRelativeToSwitchLabels = style.IndentCaseBlocks; - settings.indentControlFlowRelativeToSwitchLabels = style.IndentCaseBlocks; #endif if (style.DerivePointerAlignment && ClangFormatSettings::instance().mode() == ClangFormatSettings::Mode::Formatting) { @@ -200,9 +198,7 @@ void ClangFormatFile::fromCppCodeStyleSettings(const CppEditor::CppCodeStyleSett m_style.IndentCaseLabels = settings.indentSwitchLabels; #if LLVM_VERSION_MAJOR >= 11 - m_style.IndentCaseBlocks = settings.indentBlocksRelativeToSwitchLabels - || settings.indentStatementsRelativeToSwitchLabels - || settings.indentControlFlowRelativeToSwitchLabels; + m_style.IndentCaseBlocks = settings.indentBlocksRelativeToSwitchLabels; #endif if (settings.extraPaddingForConditionsIfConfusingAlign)