forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/12.0'
Conflicts: src/plugins/clangformat/clangformatconfigwidget.cpp Change-Id: I84fba4e6f952e9aca606951e7fb7763b451e35d9
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user