From 35c62efdb74b02cc00c51249e4d85b92860594d2 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Thu, 2 Oct 2014 15:08:16 +0100 Subject: [PATCH] Refs #10302 Make inserted use new group ids --- .../CustomInterfaces/src/ReflMainViewPresenter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp index 37ff2ec74281..cb116329664c 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp @@ -424,7 +424,10 @@ namespace MantidQt std::vector rows = m_view->getSelectedRowIndexes(); if (rows.size() == 0) { + const int groupId = getUnusedGroup(); + const size_t row = m_model->rowCount(); m_model->appendRow(); + m_model->Int(row, COL_GROUP) = groupId; } else { @@ -433,7 +436,9 @@ namespace MantidQt std::sort (rows.begin(), rows.end()); for (size_t idx = rows.size(); 0 < idx; --idx) { - m_model->insertRow(rows.at(0)); + const int groupId = getUnusedGroup(); + const size_t row = m_model->insertRow(rows.at(0)); + m_model->Int(row, COL_GROUP) = groupId; } }