Merge remote-tracking branch 'origin/12.0'

Conflicts:
	src/plugins/clangformat/clangformatconfigwidget.cpp

Change-Id: I84fba4e6f952e9aca606951e7fb7763b451e35d9
This commit is contained in:
Eike Ziller
2024-01-03 13:05:56 +01:00
4 changed files with 24 additions and 3 deletions

View File

@@ -772,7 +772,8 @@ void ClangFormatBaseIndenter::autoIndent(const QTextCursor &cursor,
}
}
clang::format::FormatStyle overrideStyle(const Utils::FilePath &fileName)
clang::format::FormatStyle ClangFormatBaseIndenter::overrideStyle(
const Utils::FilePath &fileName) const
{
const ProjectExplorer::Project *projectForFile
= ProjectExplorer::ProjectManager::projectForFile(fileName);
@@ -782,6 +783,9 @@ clang::format::FormatStyle overrideStyle(const Utils::FilePath &fileName)
? projectForFile->editorConfiguration()->codeStyle("Cpp")->currentPreferences()
: TextEditor::TextEditorSettings::codeStyle("Cpp")->currentPreferences();
if (m_overriddenPreferences)
preferences = m_overriddenPreferences->currentPreferences();
Utils::FilePath filePath = filePathToCurrentSettings(preferences);
if (!filePath.exists())
@@ -844,4 +848,9 @@ const clang::format::FormatStyle &ClangFormatBaseIndenter::styleForFile() const
return m_cachedStyle.style;
}
void ClangFormatBaseIndenter::setOverriddenPreferences(TextEditor::ICodeStylePreferences *preferences)
{
m_overriddenPreferences = preferences;
}
} // namespace ClangFormat