Skip to content

Commit

Permalink
Refs #11355 Make projection table checking saner
Browse files Browse the repository at this point in the history
The actual order of the columns doesn't matter, so don't require an
arbitrary order.
  • Loading branch information
Harry Jeffery committed Mar 30, 2015
1 parent b89aa8c commit b155db6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Code/Mantid/Framework/MDAlgorithms/src/CutMD.cpp
Expand Up @@ -294,9 +294,13 @@ void CutMD::exec() {
// Check Projection format
if (haveProjection) {
auto colNames = projection->getColumnNames();
if (colNames.size() != 4 || colNames[0] != "name" ||
colNames[1] != "value" || colNames[2] != "offset" ||
colNames[3] != "type")
if (colNames.size() != 4 ||
std::find(colNames.begin(), colNames.end(), "name") == colNames.end() ||
std::find(colNames.begin(), colNames.end(), "value") ==
colNames.end() ||
std::find(colNames.begin(), colNames.end(), "offset") ==
colNames.end() ||
std::find(colNames.begin(), colNames.end(), "type") == colNames.end())
throw std::runtime_error(
"Invalid Projection supplied. Please check column names.");
if (projection->rowCount() < 3)
Expand Down

0 comments on commit b155db6

Please sign in to comment.