From d3388b3eb09d331cc1da44a9a6c7731a4ae705e5 Mon Sep 17 00:00:00 2001
From: "Zhang, Chen" <zhangc@ornl.gov>
Date: Wed, 24 Mar 2021 17:40:07 -0400
Subject: [PATCH] easy fix to make sort work for leanpws

---
 Framework/Crystal/src/SortPeaksWorkspace.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/Framework/Crystal/src/SortPeaksWorkspace.cpp b/Framework/Crystal/src/SortPeaksWorkspace.cpp
index 830f9c5ecda..595975f6dba 100644
--- a/Framework/Crystal/src/SortPeaksWorkspace.cpp
+++ b/Framework/Crystal/src/SortPeaksWorkspace.cpp
@@ -37,10 +37,10 @@ const std::string SortPeaksWorkspace::category() const {
 /** Initialize the algorithm's properties.
  */
 void SortPeaksWorkspace::init() {
-  declareProperty(std::make_unique<WorkspaceProperty<PeaksWorkspace>>(
+  declareProperty(std::make_unique<WorkspaceProperty<IPeaksWorkspace>>(
                       "InputWorkspace", "", Direction::Input),
                   "An input workspace.");
-  declareProperty(std::make_unique<WorkspaceProperty<PeaksWorkspace>>(
+  declareProperty(std::make_unique<WorkspaceProperty<IPeaksWorkspace>>(
                       "OutputWorkspace", "", Direction::Output),
                   "An output workspace.");
 
@@ -58,8 +58,8 @@ void SortPeaksWorkspace::init() {
 void SortPeaksWorkspace::exec() {
   const std::string columnToSortBy = getProperty("ColumnNameToSortBy");
   const bool sortAscending = getProperty("SortAscending");
-  PeaksWorkspace_sptr inputWS = getProperty("InputWorkspace");
-  PeaksWorkspace_sptr outputWS = getProperty("OutputWorkspace");
+  IPeaksWorkspace_sptr inputWS = getProperty("InputWorkspace");
+  IPeaksWorkspace_sptr outputWS = getProperty("OutputWorkspace");
 
   // Try to get the column. This will throw if the column does not exist.
   inputWS->getColumn(columnToSortBy);
@@ -68,7 +68,6 @@ void SortPeaksWorkspace::exec() {
     outputWS = inputWS->clone();
   }
 
-  // Perform the sorting.
   std::vector<PeaksWorkspace::ColumnAndDirection> sortCriteria;
   sortCriteria.emplace_back(columnToSortBy, sortAscending);
   outputWS->sort(sortCriteria);
-- 
GitLab