mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 10:45:37 +02:00
bug 291869: Index out of bounds exception- if try to add DiscoveryOptionsBlock tab-cdt 6.0.1
This commit is contained in:
parent
9ee66f7728
commit
271832d5e4
1 changed files with 10 additions and 5 deletions
|
@ -170,7 +170,9 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock {
|
||||||
((GridData)scEnabledButton.getLayoutData()).horizontalSpan = numColumns;
|
((GridData)scEnabledButton.getLayoutData()).horizontalSpan = numColumns;
|
||||||
((GridData)scEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true;
|
((GridData)scEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true;
|
||||||
// VMIR* old projects will have discovery disabled by default
|
// 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() {
|
scEnabledButton.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
enableAllControls();
|
enableAllControls();
|
||||||
|
@ -246,9 +248,12 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock {
|
||||||
* @see org.eclipse.cdt.make.ui.dialogs.AbstractDiscoveryOptionsBlock#getCurrentProfileId()
|
* @see org.eclipse.cdt.make.ui.dialogs.AbstractDiscoveryOptionsBlock#getCurrentProfileId()
|
||||||
*/
|
*/
|
||||||
protected String getCurrentProfileId() {
|
protected String getCurrentProfileId() {
|
||||||
String selectedProfileName = profileComboBox.getItem(profileComboBox.getSelectionIndex());
|
int pos = profileComboBox.getSelectionIndex();
|
||||||
String selectedProfileId = getDiscoveryProfileId(selectedProfileName);
|
if (pos >= 0) {
|
||||||
return selectedProfileId;
|
String selectedProfileName = profileComboBox.getItem(pos);
|
||||||
|
return getDiscoveryProfileId(selectedProfileName);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -369,7 +374,7 @@ public class DiscoveryOptionsBlock extends AbstractDiscoveryOptionsBlock {
|
||||||
|
|
||||||
private void restoreFromBuildinfo(IScannerConfigBuilderInfo2 buildInfo) {
|
private void restoreFromBuildinfo(IScannerConfigBuilderInfo2 buildInfo) {
|
||||||
if (buildInfo != null) {
|
if (buildInfo != null) {
|
||||||
scEnabledButton.setSelection(buildInfo.isAutoDiscoveryEnabled());
|
scEnabledButton.setSelection(buildInfo.isAutoDiscoveryEnabled() && !buildInfo.getSelectedProfileId().equals(ScannerConfigProfileManager.NULL_PROFILE_ID));
|
||||||
String profileId = buildInfo.getSelectedProfileId();
|
String profileId = buildInfo.getSelectedProfileId();
|
||||||
profileComboBox.setText(getDiscoveryProfileName(profileId));
|
profileComboBox.setText(getDiscoveryProfileName(profileId));
|
||||||
scProblemReportingEnabledButton.setSelection(buildInfo.isProblemReportingEnabled());
|
scProblemReportingEnabledButton.setSelection(buildInfo.isProblemReportingEnabled());
|
||||||
|
|
Loading…
Add table
Reference in a new issue