From 571e47d8ea6b680c9c13bc41bb5b3c71e9130e90 Mon Sep 17 00:00:00 2001
From: Elliot Oram <Elliot.Oram@stfc.ac.uk>
Date: Fri, 23 Oct 2015 13:57:27 +0100
Subject: [PATCH] Only ask about rebinning when shift is not used

Refs #14090
---
 .../src/Indirect/ContainerSubtraction.cpp     | 35 +++++++++++--------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp b/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
index c008d22bafa..4b58e356c90 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
@@ -94,21 +94,26 @@ void ContainerSubtraction::run() {
   }
 
   // Check for same binning across sample and container
-  if (!checkWorkspaceBinningMatches(sampleWs, canCloneWs)) {
-    QString text = "Binning on sample and container does not match."
-                   "Would you like to rebin the sample to match the container?";
-
-    int result = QMessageBox::question(NULL, tr("Rebin sample?"), tr(text),
-                                       QMessageBox::Yes, QMessageBox::No,
-                                       QMessageBox::NoButton);
-
-    if (result == QMessageBox::Yes) {
-		addRebinStep(canCloneName, sampleWsName);
-    } else {
-      m_batchAlgoRunner->clearQueue();
-      g_log.error("Cannot apply absorption corrections using a sample and "
-                  "container with different binning.");
-      return;
+  if (m_uiForm.ckShiftCan->isChecked()) {
+    addRebinStep(canCloneName, sampleWsName);
+  } else {
+    if (!checkWorkspaceBinningMatches(sampleWs, canCloneWs)) {
+      QString text =
+          "Binning on sample and container does not match."
+          "Would you like to rebin the sample to match the container?";
+
+      int result = QMessageBox::question(NULL, tr("Rebin sample?"), tr(text),
+                                         QMessageBox::Yes, QMessageBox::No,
+                                         QMessageBox::NoButton);
+
+      if (result == QMessageBox::Yes) {
+        addRebinStep(canCloneName, sampleWsName);
+      } else {
+        m_batchAlgoRunner->clearQueue();
+        g_log.error("Cannot apply absorption corrections using a sample and "
+                    "container with different binning.");
+        return;
+      }
     }
   }
 
-- 
GitLab