Skip to content

Commit

Permalink
No longer looking for index2spectra map that does not exist in some c…
Browse files Browse the repository at this point in the history
…ases.

Fixed.  Refs #4127.
  • Loading branch information
PeterParker committed Nov 21, 2011
1 parent b30cb1f commit ed29738
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions Code/Mantid/MantidPlot/src/Mantid/MantidWSIndexDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ void MantidWSIndexDialog::init()
initWorkspaceBox();
initButtons();
setLayout(m_outer);

//setFocus(Qt::PopupFocusReason);
}

void MantidWSIndexDialog::initWorkspaceBox()
Expand All @@ -165,13 +163,11 @@ void MantidWSIndexDialog::initWorkspaceBox()
m_wsField = new QLineEdit();

m_wsField->setValidator(new IntervalListValidator(this, m_wsIndexIntervals));
//m_wsField->setPlaceholderText(tr("E.g. \"3-5,10-17,20\" would work for indices 1-30"));
m_wsBox->add(m_wsMessage);
m_wsBox->add(m_wsField);
m_outer->addItem(m_wsBox);

connect(m_wsField, SIGNAL(textEdited(const QString &)), this, SLOT(editedWsField()));
//connect(m_wsField, SIGNAL(returnPressed()), this, SLOT(plot()));
}

void MantidWSIndexDialog::initSpectraBox()
Expand All @@ -182,14 +178,12 @@ void MantidWSIndexDialog::initSpectraBox()
m_orMessage = new QLabel(tr("<br>Or"));

m_spectraField->setValidator(new IntervalListValidator(this, m_spectraIdIntervals));
//m_spectraField->setPlaceholderText(tr("E.g. \"3-5,10-17,20\" would work for IDs 1-30"));
m_spectraBox->add(m_spectraMessage);
m_spectraBox->add(m_spectraField);
m_spectraBox->add(m_orMessage);
if(m_spectra) m_outer->addItem(m_spectraBox);

connect(m_spectraField, SIGNAL(textEdited(const QString &)), this, SLOT(editedSpectraField()));
//connect(m_spectraField, SIGNAL(returnPressed()), this, SLOT(plot()));
}

void MantidWSIndexDialog::initButtons()
Expand Down Expand Up @@ -249,12 +243,8 @@ void MantidWSIndexDialog::generateWsIndexIntervals()
{
Mantid::API::MatrixWorkspace_const_sptr ws = boost::dynamic_pointer_cast<const Mantid::API::MatrixWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve((*it).toStdString()));
if ( NULL == ws ) continue;
Mantid::index2spec_map * index2spec = ws->getWorkspaceIndexToSpectrumMap();

Mantid::index2spec_map::const_iterator end = index2spec->end();
end--;

const int endWs = static_cast<int> (end->first);

const int endWs = static_cast<int>(ws->getNumberHistograms() - 1);//= static_cast<int> (end->first);

Interval interval(0,endWs);
// If no interval has been added yet, just add it ...
Expand Down

0 comments on commit ed29738

Please sign in to comment.