From c6030d9e70d1bef2cd92b752b820465bd4ed0801 Mon Sep 17 00:00:00 2001
From: Elliot Oram <Elliot.Oram@stfc.ac.uk>
Date: Tue, 8 Sep 2015 11:32:19 +0100
Subject: [PATCH] Chnaged form of outputname to be more descriptive

Refs #13110
---
 .../src/Indirect/ContainerSubtraction.cpp            | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
index 490fe65842f..1b8dcbaa707 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
@@ -87,12 +87,16 @@ void ContainerSubtraction::run() {
   }
 
   // Generate output workspace name
-  int nameCutIndex = sampleWsName.lastIndexOf("_");
-  if (nameCutIndex == -1)
-    nameCutIndex = sampleWsName.length();
+  QString containerWsName = m_uiForm.dsContainer->getCurrentDataName();
+  int sampleNameCutIndex = sampleWsName.lastIndexOf("_");
+  if (sampleNameCutIndex == -1)
+    sampleNameCutIndex = sampleWsName.length();
+  int containerNameCutIndex = containerWsName.indexOf("_");
+  if(containerNameCutIndex == -1)
+	  containerNameCutIndex = containerWsName.length();
 
   const QString outputWsName =
-      sampleWsName.left(nameCutIndex)+"_Corrected";
+      sampleWsName.left(sampleNameCutIndex)+"_Subtract_"+containerWsName.left(containerNameCutIndex);
 
   applyCorrAlg->setProperty("OutputWorkspace", outputWsName.toStdString());
 
-- 
GitLab