aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Tillmanns <marcus.tillmanns@qt.io>2023-06-06 11:58:11 +0200
committerMarcus Tillmanns <marcus.tillmanns@qt.io>2023-06-07 07:16:23 +0000
commit07374a7114474db3581edb6242abdb8f75d90c3a (patch)
tree94a15a85b6bd3e3e2de92db72699531583e2113c
parent2934e30ad0dbdc58b4f6fcb54dbf58ecc8465316 (diff)
ClangFormat: Do not change incompatible settings
Fixes: QTCREATORBUG-29190 Change-Id: I81730f59f05c8aba718a60deebfeb2b1b3aa0d7f Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/plugins/clangformat/clangformatfile.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/plugins/clangformat/clangformatfile.cpp b/src/plugins/clangformat/clangformatfile.cpp
index f0c4809913..fc1659b976 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)