From 76c7b7e96243e9a14ea8178c882cca77213bf6dc Mon Sep 17 00:00:00 2001 From: Arturs Bekasovs Date: Tue, 10 Dec 2013 10:53:44 +0000 Subject: [PATCH] Refs #8550. Human-readable ranges when loading from nexus. --- .../Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp index 561d6863436e..b00acd81fbde 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp @@ -3630,9 +3630,13 @@ void MuonAnalysis::setGrouping(ITableWorkspace_sptr detGroupingTable) { for ( size_t row = 0; row < detGroupingTable->rowCount(); ++row ) { - const std::vector& detectors = detGroupingTable->cell< std::vector >(row,0); + std::vector detectors = detGroupingTable->cell< std::vector >(row,0); - const std::string& detectorRange = Strings::join(detectors.begin(), detectors.end(), ","); + // toString() expects the sequence to be sorted + std::sort( detectors.begin(), detectors.end() ); + + // Convert to a range string, i.e. 1-5,6-8,9 + const std::string& detectorRange = Strings::toString(detectors); m_uiForm.groupTable->setItem( static_cast(row), 0, new QTableWidgetItem( QString::number(row + 1) ) );