diff options
author | Andrew Gvozdev | 2009-10-13 03:38:34 +0000 |
---|---|---|
committer | Andrew Gvozdev | 2009-10-13 03:38:34 +0000 |
commit | 271832d5e470d23455cc1e9c364997a645574d85 (patch) | |
tree | 99dd56e52e94d82071e7d724da59fcde791c3448 /build | |
parent | 9ee66f7728db673d8cb69db24d952797a6318cdb (diff) | |
download | org.eclipse.cdt-271832d5e470d23455cc1e9c364997a645574d85.tar.gz org.eclipse.cdt-271832d5e470d23455cc1e9c364997a645574d85.tar.xz org.eclipse.cdt-271832d5e470d23455cc1e9c364997a645574d85.zip |
bug 291869: Index out of bounds exception- if try to add DiscoveryOptionsBlock tab-cdt 6.0.1
Diffstat (limited to 'build')
-rw-r--r-- | build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java index b27640fbf4e..a0323494914 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveryOptionsBlock.java @@ -170,7 +170,9 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock { ((GridData)scEnabledButton.getLayoutData()).horizontalSpan = numColumns; ((GridData)scEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true; // VMIR* old projects will have discovery disabled by default - scEnabledButton.setSelection(needsSCNature ? false : getBuildInfo().isAutoDiscoveryEnabled()); + scEnabledButton.setSelection(needsSCNature ? false + : (getBuildInfo().isAutoDiscoveryEnabled() + && !getBuildInfo().getSelectedProfileId().equals(ScannerConfigProfileManager.NULL_PROFILE_ID))); scEnabledButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { enableAllControls(); @@ -246,9 +248,12 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock { * @see org.eclipse.cdt.make.ui.dialogs.AbstractDiscoveryOptionsBlock#getCurrentProfileId() */ protected String getCurrentProfileId() { - String selectedProfileName = profileComboBox.getItem(profileComboBox.getSelectionIndex()); - String selectedProfileId = getDiscoveryProfileId(selectedProfileName); - return selectedProfileId; + int pos = profileComboBox.getSelectionIndex(); + if (pos >= 0) { + String selectedProfileName = profileComboBox.getItem(pos); + return getDiscoveryProfileId(selectedProfileName); + } + return null; } /* (non-Javadoc) @@ -369,7 +374,7 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock { private void restoreFromBuildinfo(IScannerConfigBuilderInfo2 buildInfo) { if (buildInfo != null) { - scEnabledButton.setSelection(buildInfo.isAutoDiscoveryEnabled()); + scEnabledButton.setSelection(buildInfo.isAutoDiscoveryEnabled() && !buildInfo.getSelectedProfileId().equals(ScannerConfigProfileManager.NULL_PROFILE_ID)); String profileId = buildInfo.getSelectedProfileId(); profileComboBox.setText(getDiscoveryProfileName(profileId)); scProblemReportingEnabledButton.setSelection(buildInfo.isProblemReportingEnabled()); |