forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -158,8 +158,6 @@ CppEditor::CppCodeStyleSettings ClangFormatFile::toCppCodeStyleSettings(
|
|||||||
settings.indentSwitchLabels = style.IndentCaseLabels;
|
settings.indentSwitchLabels = style.IndentCaseLabels;
|
||||||
#if LLVM_VERSION_MAJOR >= 11
|
#if LLVM_VERSION_MAJOR >= 11
|
||||||
settings.indentBlocksRelativeToSwitchLabels = style.IndentCaseBlocks;
|
settings.indentBlocksRelativeToSwitchLabels = style.IndentCaseBlocks;
|
||||||
settings.indentStatementsRelativeToSwitchLabels = style.IndentCaseBlocks;
|
|
||||||
settings.indentControlFlowRelativeToSwitchLabels = style.IndentCaseBlocks;
|
|
||||||
#endif
|
#endif
|
||||||
if (style.DerivePointerAlignment
|
if (style.DerivePointerAlignment
|
||||||
&& ClangFormatSettings::instance().mode() == ClangFormatSettings::Mode::Formatting) {
|
&& ClangFormatSettings::instance().mode() == ClangFormatSettings::Mode::Formatting) {
|
||||||
@@ -200,9 +198,7 @@ void ClangFormatFile::fromCppCodeStyleSettings(const CppEditor::CppCodeStyleSett
|
|||||||
|
|
||||||
m_style.IndentCaseLabels = settings.indentSwitchLabels;
|
m_style.IndentCaseLabels = settings.indentSwitchLabels;
|
||||||
#if LLVM_VERSION_MAJOR >= 11
|
#if LLVM_VERSION_MAJOR >= 11
|
||||||
m_style.IndentCaseBlocks = settings.indentBlocksRelativeToSwitchLabels
|
m_style.IndentCaseBlocks = settings.indentBlocksRelativeToSwitchLabels;
|
||||||
|| settings.indentStatementsRelativeToSwitchLabels
|
|
||||||
|| settings.indentControlFlowRelativeToSwitchLabels;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (settings.extraPaddingForConditionsIfConfusingAlign)
|
if (settings.extraPaddingForConditionsIfConfusingAlign)
|
||||||
|
Reference in New Issue
Block a user