From acf653ddc0894221860fcc6fd77cbe947024cd16 Mon Sep 17 00:00:00 2001 From: Rustam Vishnyakov Date: Wed, 28 Mar 2012 13:24:28 +0400 Subject: [PATCH] Fixed IDEA-79468 Code Style: saving Project scheme to global list: if switch to new scheme is rejected, irrelevant scheme is shown in the combobox --- .../options/codeStyle/CodeStyleSchemesPanel.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleSchemesPanel.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleSchemesPanel.java index 65e521cafd2c..10c487e25cdf 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleSchemesPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleSchemesPanel.java @@ -115,7 +115,12 @@ public class CodeStyleSchemesPanel{ schemes.addAll(myModel.getAllSortedSchemes()); DefaultComboBoxModel model = new DefaultComboBoxModel(schemes.toArray()); myCombo.setModel(model); - myCombo.setSelectedItem(myModel.getSelectedGlobalScheme()); + if (myModel.isUsePerProjectSettings()) { + myCombo.setSelectedItem(myModel.getProjectScheme()); + } + else { + myCombo.setSelectedItem(myModel.getSelectedGlobalScheme()); + } } finally { myIsReset = false;