From b155db6fd4e3e8ffc9184c65cfdab020f6e30e90 Mon Sep 17 00:00:00 2001
From: Harry Jeffery <henry.jeffery@stfc.ac.uk>
Date: Mon, 30 Mar 2015 15:23:03 +0100
Subject: [PATCH] Refs #11355 Make projection table checking saner

The actual order of the columns doesn't matter, so don't require an
arbitrary order.
---
 Code/Mantid/Framework/MDAlgorithms/src/CutMD.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Code/Mantid/Framework/MDAlgorithms/src/CutMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/CutMD.cpp
index f98f2f0d3b8..f1eed1174fe 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/CutMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/CutMD.cpp
@@ -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)
-- 
GitLab