From 80acdb50f1fe30a208f513f51de34b533361ebba Mon Sep 17 00:00:00 2001
From: Samuel Jackson <samueljackson@outlook.com>
Date: Wed, 17 Aug 2016 08:51:04 +0100
Subject: [PATCH] Refs #16962 Correct namespaces for non-clang builds

We need to add the export macro to TSVSerialiser's class definition and
update the namespaces
---
 MantidPlot/src/Graph.cpp                      | 10 +++++-----
 MantidPlot/src/Graph3D.cpp                    | 12 +++++------
 MantidPlot/src/Graph3D.h                      | 10 ++++++----
 MantidPlot/src/Grid.cpp                       |  2 +-
 .../InstrumentWidget/InstrumentWindow.cpp     |  4 ++--
 MantidPlot/src/Matrix.cpp                     |  4 ++--
 MantidPlot/src/MatrixModel.cpp                |  2 +-
 MantidPlot/src/MultiLayer.cpp                 |  6 +++---
 MantidPlot/src/Note.cpp                       |  4 ++--
 MantidPlot/src/ScriptingWindow.cpp            |  2 +-
 MantidPlot/src/Spectrogram.cpp                | 12 +++++------
 MantidPlot/src/Table.cpp                      |  6 +++---
 MantidPlot/src/TableStatistics.cpp            |  4 ++--
 MantidQt/API/inc/MantidQtAPI/TSVSerialiser.h  |  8 +++++++-
 MantidQt/API/src/TSVSerialiser.cpp            |  2 ++
 .../src/InstrumentView/ColorMapWidget.cpp     |  6 +++---
 .../src/InstrumentView/InstrumentActor.cpp    |  4 ++--
 .../InstrumentWidgetMaskTab.cpp               |  8 ++++----
 .../InstrumentWidgetPickTab.cpp               |  7 +++----
 .../InstrumentWidgetRenderTab.cpp             |  8 ++++----
 .../InstrumentWidgetTreeTab.cpp               |  7 +++----
 .../src/InstrumentView/MaskBinsData.cpp       |  8 ++++----
 .../src/InstrumentView/Projection3D.cpp       |  4 ++--
 .../src/InstrumentView/ProjectionSurface.cpp  |  4 ++--
 .../src/InstrumentView/Shape2D.cpp            | 20 +++++++++----------
 .../src/InstrumentView/Shape2DCollection.cpp  |  4 ++--
 .../src/InstrumentView/UnwrappedSurface.cpp   |  4 ++--
 .../src/InstrumentView/Viewport.cpp           |  4 ++--
 28 files changed, 92 insertions(+), 84 deletions(-)

diff --git a/MantidPlot/src/Graph.cpp b/MantidPlot/src/Graph.cpp
index 5caf29ec857..9c03c6a7753 100644
--- a/MantidPlot/src/Graph.cpp
+++ b/MantidPlot/src/Graph.cpp
@@ -5642,7 +5642,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app,
 
   enableAutoscaling(app->autoscale2DPlots);
 
-  TSVSerialiser tsv(lines);
+  MantidQt::API::TSVSerialiser tsv(lines);
 
   if (tsv.selectSection("Antialiasing")) {
     int aa;
@@ -6183,7 +6183,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app,
 
     std::vector<std::string> specSections = tsv.sections("spectrogram");
     for (auto it = specSections.begin(); it != specSections.end(); ++it) {
-      TSVSerialiser specTSV(*it);
+      MantidQt::API::TSVSerialiser specTSV(*it);
 
       if (specTSV.selectLine("workspace")) {
         std::string wsName;
@@ -6308,7 +6308,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app,
 }
 
 std::string Graph::saveToProject() {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
 
   tsv.writeLine("ggeometry") << pos().x() << pos().y()
                              << frameGeometry().width()
@@ -6620,7 +6620,7 @@ std::string Graph::saveCurve(int i) {
 }
 
 std::string Graph::saveScale() {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
   for (int i = 0; i < 4; i++) {
     tsv.writeLine("scale") << i;
 
@@ -6664,7 +6664,7 @@ std::string Graph::saveScale() {
 }
 
 std::string Graph::saveMarkers() {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
   for (int i = 0; i < d_images.size(); ++i) {
     auto mrkI = dynamic_cast<ImageMarker *>(d_plot->marker(d_images[i]));
     if (!mrkI)
diff --git a/MantidPlot/src/Graph3D.cpp b/MantidPlot/src/Graph3D.cpp
index da3a323c735..abf4e4f3641 100644
--- a/MantidPlot/src/Graph3D.cpp
+++ b/MantidPlot/src/Graph3D.cpp
@@ -2516,7 +2516,7 @@ IProjectSerialisable *Graph3D::loadFromProject(const std::string &lines,
 
   const std::string tsvLines = boost::algorithm::join(lineVec, "\n");
 
-  TSVSerialiser tsv(tsvLines);
+  MantidQt::API::TSVSerialiser tsv(tsvLines);
 
   if (tsv.selectLine("SurfaceFunction")) {
     auto params = graph->readSurfaceFunction(tsv);
@@ -2784,7 +2784,7 @@ void Graph3D::setupMatrixPlot3D(ApplicationWindow *app, const QString &caption,
 }
 
 void Graph3D::setupMantidMatrixPlot3D(ApplicationWindow *app,
-                                      TSVSerialiser &tsv) {
+                                      MantidQt::API::TSVSerialiser &tsv) {
   using MantidQt::API::PlotAxis;
   MantidMatrix *matrix = readWorkspaceForPlot(app, tsv);
   int style = read3DPlotStyle(tsv);
@@ -2835,7 +2835,7 @@ void Graph3D::setupMantidMatrixPlot3D(ApplicationWindow *app,
 }
 
 MantidMatrix *Graph3D::readWorkspaceForPlot(ApplicationWindow *app,
-                                            TSVSerialiser &tsv) {
+                                            MantidQt::API::TSVSerialiser &tsv) {
   MantidMatrix *m = nullptr;
   if (tsv.selectLine("title")) {
     std::string wsName = tsv.asString(1);
@@ -2851,7 +2851,7 @@ MantidMatrix *Graph3D::readWorkspaceForPlot(ApplicationWindow *app,
   return m;
 }
 
-int Graph3D::read3DPlotStyle(TSVSerialiser &tsv) {
+int Graph3D::read3DPlotStyle(MantidQt::API::TSVSerialiser &tsv) {
   int style = Qwt3D::WIREFRAME;
   if (tsv.selectLine("Style"))
     tsv >> style;
@@ -2859,7 +2859,7 @@ int Graph3D::read3DPlotStyle(TSVSerialiser &tsv) {
 }
 
 Graph3D::SurfaceFunctionParams
-Graph3D::readSurfaceFunction(TSVSerialiser &tsv) {
+Graph3D::readSurfaceFunction(MantidQt::API::TSVSerialiser &tsv) {
   SurfaceFunctionParams params;
   tsv >> params.formula;
   params.type = readSurfaceFunctionType(params.formula);
@@ -2928,7 +2928,7 @@ Graph3D::readSurfaceFunctionType(const std::string &formula) {
 }
 
 std::string Graph3D::saveToProject(ApplicationWindow *app) {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
   tsv.writeRaw("<SurfacePlot>");
   tsv.writeLine(name().toStdString()) << birthDate();
   tsv.writeRaw(app->windowGeometryInfo(this));
diff --git a/MantidPlot/src/Graph3D.h b/MantidPlot/src/Graph3D.h
index 565cb62a570..108b3658b9b 100644
--- a/MantidPlot/src/Graph3D.h
+++ b/MantidPlot/src/Graph3D.h
@@ -416,13 +416,15 @@ signals:
   void modified();
 
 private:
-  Graph3D::SurfaceFunctionParams readSurfaceFunction(TSVSerialiser &tsv);
+  Graph3D::SurfaceFunctionParams
+  readSurfaceFunction(MantidQt::API::TSVSerialiser &tsv);
   Graph3D::SurfaceFunctionType
   readSurfaceFunctionType(const std::string &formula);
   MantidMatrix *readWorkspaceForPlot(ApplicationWindow *app,
-                                     TSVSerialiser &tsv);
-  int read3DPlotStyle(TSVSerialiser &tsv);
-  void setupMantidMatrixPlot3D(ApplicationWindow *app, TSVSerialiser &tsv);
+                                     MantidQt::API::TSVSerialiser &tsv);
+  int read3DPlotStyle(MantidQt::API::TSVSerialiser &tsv);
+  void setupMantidMatrixPlot3D(ApplicationWindow *app,
+                               MantidQt::API::TSVSerialiser &tsv);
   void setupPlot3D(ApplicationWindow *app, const QString &caption,
                    const SurfaceFunctionParams &params);
   void setupPlotXYZ(ApplicationWindow *app, const QString &caption,
diff --git a/MantidPlot/src/Grid.cpp b/MantidPlot/src/Grid.cpp
index 94f7095353a..e8b2969547a 100644
--- a/MantidPlot/src/Grid.cpp
+++ b/MantidPlot/src/Grid.cpp
@@ -261,7 +261,7 @@ void Grid::copy(Grid *grid) {
 }
 
 std::string Grid::saveToString() {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
   tsv.writeLine("grid");
 
   tsv << xEnabled() << xMinEnabled();
diff --git a/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp b/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp
index afd8b4b583b..b46452ba581 100644
--- a/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp
+++ b/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp
@@ -49,7 +49,7 @@ IProjectSerialisable *InstrumentWindow::loadFromProject(
     const std::string &lines, ApplicationWindow *app, const int fileVersion) {
   Q_UNUSED(fileVersion);
 
-  TSVSerialiser tsv(lines);
+  MantidQt::API::TSVSerialiser tsv(lines);
 
   if (!tsv.selectLine("WorkspaceName"))
     return nullptr;
@@ -103,7 +103,7 @@ IProjectSerialisable *InstrumentWindow::loadFromProject(
  * @return a string representing the state of the instrument window
  */
 std::string InstrumentWindow::saveToProject(ApplicationWindow *app) {
-  TSVSerialiser tsv, window;
+  MantidQt::API::TSVSerialiser tsv, window;
   window.writeRaw(app->windowGeometryInfo(this));
   auto widgetContents = m_instrumentWidget->saveToProject();
   window.writeRaw(widgetContents);
diff --git a/MantidPlot/src/Matrix.cpp b/MantidPlot/src/Matrix.cpp
index fb3b7fdd692..e574a618d05 100644
--- a/MantidPlot/src/Matrix.cpp
+++ b/MantidPlot/src/Matrix.cpp
@@ -1534,7 +1534,7 @@ IProjectSerialisable *Matrix::loadFromProject(const std::string &lines,
   Mantid::Kernel::Strings::convert<int>(values[1], rows);
   Mantid::Kernel::Strings::convert<int>(values[2], cols);
 
-  TSVSerialiser tsv(newLines);
+  MantidQt::API::TSVSerialiser tsv(newLines);
   std::string gStr;
   if (tsv.hasLine("geometry")) {
     gStr = tsv.lineAsString("geometry");
@@ -1642,7 +1642,7 @@ IProjectSerialisable *Matrix::loadFromProject(const std::string &lines,
 }
 
 std::string Matrix::saveToProject(ApplicationWindow *app) {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
 
   tsv.writeRaw("<matrix>");
   tsv.writeLine(objectName().toStdString()) << numRows() << numCols()
diff --git a/MantidPlot/src/MatrixModel.cpp b/MantidPlot/src/MatrixModel.cpp
index 81fa3fddeeb..041461401c9 100644
--- a/MantidPlot/src/MatrixModel.cpp
+++ b/MantidPlot/src/MatrixModel.cpp
@@ -1014,7 +1014,7 @@ void MatrixModel::pasteData(double *clipboardBuffer, int topRow, int leftCol,
 MatrixModel::~MatrixModel() { free(d_data); }
 
 std::string MatrixModel::saveToProject() {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
 
   for (int row = 0; row < d_rows; ++row) {
     // Index to the first element of each row
diff --git a/MantidPlot/src/MultiLayer.cpp b/MantidPlot/src/MultiLayer.cpp
index b576628f5f0..a8d7523ed45 100644
--- a/MantidPlot/src/MultiLayer.cpp
+++ b/MantidPlot/src/MultiLayer.cpp
@@ -1758,7 +1758,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines,
 
   auto multiLayer = new MultiLayer(app, 0, rows, cols);
 
-  TSVSerialiser tsv(lines);
+  MantidQt::API::TSVSerialiser tsv(lines);
 
   multiLayer->blockSignals(true);
 
@@ -1805,7 +1805,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines,
     for (auto it = graphSections.cbegin(); it != graphSections.cend(); ++it) {
       auto graphLines = *it;
 
-      TSVSerialiser gtsv(graphLines);
+      MantidQt::API::TSVSerialiser gtsv(graphLines);
 
       if (gtsv.selectLine("ggeometry")) {
         int x = 0, y = 0, w = 0, h = 0;
@@ -1833,7 +1833,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines,
 }
 
 std::string MultiLayer::saveToProject(ApplicationWindow *app) {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
 
   tsv.writeRaw("<multiLayer>");
 
diff --git a/MantidPlot/src/Note.cpp b/MantidPlot/src/Note.cpp
index 2ba8c91c19c..6b4533f2493 100644
--- a/MantidPlot/src/Note.cpp
+++ b/MantidPlot/src/Note.cpp
@@ -155,7 +155,7 @@ IProjectSerialisable *Note::loadFromProject(const std::string &lines,
   app->setListViewDate(name, date);
   note->setBirthDate(date);
 
-  TSVSerialiser tsv(lines);
+  MantidQt::API::TSVSerialiser tsv(lines);
 
   if (tsv.hasLine("geometry")) {
     const QString geometry =
@@ -186,7 +186,7 @@ IProjectSerialisable *Note::loadFromProject(const std::string &lines,
 }
 
 std::string Note::saveToProject(ApplicationWindow *app) {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
   tsv.writeRaw("<note>");
   tsv.writeLine(name().toStdString()) << birthDate();
   tsv.writeRaw(app->windowGeometryInfo(this));
diff --git a/MantidPlot/src/ScriptingWindow.cpp b/MantidPlot/src/ScriptingWindow.cpp
index db7d991673f..39000594e54 100644
--- a/MantidPlot/src/ScriptingWindow.cpp
+++ b/MantidPlot/src/ScriptingWindow.cpp
@@ -435,7 +435,7 @@ void ScriptingWindow::loadFromProject(const std::string &lines,
                                       const int fileVersion) {
   Q_UNUSED(fileVersion);
 
-  TSVSerialiser sTSV(lines);
+  MantidQt::API::TSVSerialiser sTSV(lines);
   QStringList files;
 
   setWindowTitle("MantidPlot: " + app->scriptingEnv()->languageName() +
diff --git a/MantidPlot/src/Spectrogram.cpp b/MantidPlot/src/Spectrogram.cpp
index 20fb1e87ae7..125a7ccf528 100644
--- a/MantidPlot/src/Spectrogram.cpp
+++ b/MantidPlot/src/Spectrogram.cpp
@@ -1015,7 +1015,7 @@ QImage Spectrogram::renderImage(const QwtScaleMap &xMap,
 void Spectrogram::loadFromProject(const std::string &lines) {
   using namespace Mantid::Kernel;
 
-  TSVSerialiser tsv(lines);
+  MantidQt::API::TSVSerialiser tsv(lines);
 
   if (tsv.hasSection("ColorPolicy")) {
     std::string policyStr = tsv.sections("ColorPolicy").front();
@@ -1027,7 +1027,7 @@ void Spectrogram::loadFromProject(const std::string &lines) {
       setDefaultColorMap();
   } else if (tsv.hasSection("ColorMap")) {
     const std::string cmStr = tsv.sections("ColorMap").front();
-    TSVSerialiser cm(cmStr);
+    MantidQt::API::TSVSerialiser cm(cmStr);
 
     std::string filename;
     if (cm.selectLine("FileName"))
@@ -1073,7 +1073,7 @@ void Spectrogram::loadFromProject(const std::string &lines) {
 
   if (tsv.hasSection("ColorBar")) {
     const std::string cbStr = tsv.sections("ColorBar").front();
-    TSVSerialiser cb(cbStr);
+    MantidQt::API::TSVSerialiser cb(cbStr);
 
     std::string axisStr = cb.sections("axis")[0];
     std::string widthStr = cb.sections("width")[0];
@@ -1105,7 +1105,7 @@ void Spectrogram::loadFromProject(const std::string &lines) {
 
 std::string Spectrogram::saveToProject() {
   using namespace Mantid::Kernel;
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
   tsv.writeRaw("<spectrogram>");
   if (!d_wsName.empty())
     tsv.writeLine("workspace") << d_wsName;
@@ -1116,7 +1116,7 @@ std::string Spectrogram::saveToProject() {
     tsv.writeInlineSection("ColorPolicy",
                            Strings::toString<int>(color_map_policy));
   else {
-    TSVSerialiser cm;
+    MantidQt::API::TSVSerialiser cm;
     if (!mCurrentColorMap.isEmpty())
       cm.writeLine("FileName") << mCurrentColorMap.toStdString();
     cm.writeInlineSection("Mode", Strings::toString<int>(color_map.mode()));
@@ -1143,7 +1143,7 @@ std::string Spectrogram::saveToProject() {
 
   QwtScaleWidget *colorAxis = plot()->axisWidget(color_axis);
   if (colorAxis && colorAxis->isColorBarEnabled()) {
-    TSVSerialiser cb;
+    MantidQt::API::TSVSerialiser cb;
     cb.writeInlineSection("axis", Strings::toString<int>(color_axis));
     cb.writeInlineSection("width",
                           Strings::toString<int>(colorAxis->colorBarWidth()));
diff --git a/MantidPlot/src/Table.cpp b/MantidPlot/src/Table.cpp
index 2ee301d7842..578e5f26540 100644
--- a/MantidPlot/src/Table.cpp
+++ b/MantidPlot/src/Table.cpp
@@ -638,7 +638,7 @@ void Table::updateValues(Table *t, const QString &columnName) {
 }
 
 std::string Table::saveToProject(ApplicationWindow *app) {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
 
   tsv.writeRaw("<table>");
   tsv.writeLine(objectName().toStdString())
@@ -3036,7 +3036,7 @@ IProjectSerialisable *Table::loadFromProject(const std::string &lines,
     }
   }
 
-  TSVSerialiser tsv(lines);
+  MantidQt::API::TSVSerialiser tsv(lines);
 
   if (tsv.selectLine("geometry"))
     app->restoreWindowGeometry(
@@ -3176,7 +3176,7 @@ IProjectSerialisable *Table::loadFromProject(const std::string &lines,
 }
 
 std::string Table::saveTableMetadata() {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
   tsv.writeLine("header");
   for (int j = 0; j < d_table->columnCount(); j++) {
     QString val = colLabel(j);
diff --git a/MantidPlot/src/TableStatistics.cpp b/MantidPlot/src/TableStatistics.cpp
index c694c51c5b8..dbd20622a4f 100644
--- a/MantidPlot/src/TableStatistics.cpp
+++ b/MantidPlot/src/TableStatistics.cpp
@@ -293,7 +293,7 @@ IProjectSerialisable *TableStatistics::loadFromProject(const std::string &lines,
   const std::string type = firstLineVec[2];
   QString birthDate = QString::fromStdString(firstLineVec[3]);
 
-  TSVSerialiser tsv(lines);
+  MantidQt::API::TSVSerialiser tsv(lines);
 
   if (!tsv.hasLine("Targets"))
     return nullptr;
@@ -406,7 +406,7 @@ IProjectSerialisable *TableStatistics::loadFromProject(const std::string &lines,
 }
 
 std::string TableStatistics::saveToProject(ApplicationWindow *app) {
-  TSVSerialiser tsv;
+  MantidQt::API::TSVSerialiser tsv;
   tsv.writeRaw("<TableStatistics>");
 
   tsv.writeLine(objectName().toStdString());
diff --git a/MantidQt/API/inc/MantidQtAPI/TSVSerialiser.h b/MantidQt/API/inc/MantidQtAPI/TSVSerialiser.h
index a261f219fac..314bd4f4472 100644
--- a/MantidQt/API/inc/MantidQtAPI/TSVSerialiser.h
+++ b/MantidQt/API/inc/MantidQtAPI/TSVSerialiser.h
@@ -1,6 +1,7 @@
 #ifndef MANTID_TSVSERIALISER_H_
 #define MANTID_TSVSERIALISER_H_
 
+#include "DllOption.h"
 #include "MantidKernel/CaseInsensitiveMap.h"
 
 #include <map>
@@ -39,7 +40,10 @@
   File change history is stored at: <https://github.com/mantidproject/mantid>
 */
 
-class TSVSerialiser {
+namespace MantidQt {
+namespace API {
+
+class EXPORT_OPT_MANTIDQT_API TSVSerialiser {
 public:
   TSVSerialiser();
 
@@ -108,5 +112,7 @@ private:
   std::stringstream m_output;
   bool m_midLine;
 };
+}
+}
 
 #endif
diff --git a/MantidQt/API/src/TSVSerialiser.cpp b/MantidQt/API/src/TSVSerialiser.cpp
index db5f268e722..986142edae8 100644
--- a/MantidQt/API/src/TSVSerialiser.cpp
+++ b/MantidQt/API/src/TSVSerialiser.cpp
@@ -10,6 +10,8 @@ namespace {
 Mantid::Kernel::Logger g_log("TSVSerialiser");
 }
 
+using namespace MantidQt::API;
+
 TSVSerialiser::TSVSerialiser() : m_curIndex(0), m_midLine(false) {}
 
 TSVSerialiser::TSVSerialiser(const std::string &lines)
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/ColorMapWidget.cpp b/MantidQt/MantidWidgets/src/InstrumentView/ColorMapWidget.cpp
index b8e7f33aedd..7b6f8275647 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/ColorMapWidget.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/ColorMapWidget.cpp
@@ -327,7 +327,7 @@ void ColorMapWidget::mouseReleaseEvent(QMouseEvent * /*e*/) {
  * @return string representing the current state of the color map widget.
  */
 std::string ColorMapWidget::saveToProject() const {
-  TSVSerialiser tsv, cm;
+  API::TSVSerialiser tsv, cm;
   cm.writeLine("ScaleType") << getScaleType();
   cm.writeLine("Power") << getNth_power();
   cm.writeLine("MinValue") << getMinValue();
@@ -342,11 +342,11 @@ std::string ColorMapWidget::saveToProject() const {
  * widget.
  */
 void ColorMapWidget::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
   if (tsv.selectSection("colormap")) {
     std::string colorMapLines;
     tsv >> colorMapLines;
-    TSVSerialiser cm(colorMapLines);
+    API::TSVSerialiser cm(colorMapLines);
 
     int scaleType;
     double min, max, power;
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp
index 363eb68e4ef..2d46267da8a 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp
@@ -1289,7 +1289,7 @@ bool FindComponentVisitor::visit(GLActor *actor) {
  * @return string representing the current state of the instrumet actor.
  */
 std::string InstrumentActor::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   const std::string currentColorMap = getCurrentColorMap().toStdString();
 
   if (!currentColorMap.empty())
@@ -1304,7 +1304,7 @@ std::string InstrumentActor::saveToProject() const {
  * @param lines :: string representing the current state of the instrumet actor.
  */
 void InstrumentActor::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
   if (tsv.selectLine("FileName")) {
     QString filename;
     tsv >> filename;
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp
index c6afbda0932..24d926a82f9 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp
@@ -1186,14 +1186,14 @@ void InstrumentWidgetMaskTab::changedIntegrationRange(double, double) {
  * @param lines :: lines from the project file to load state from
  */
 void InstrumentWidgetMaskTab::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
 
   if (!tsv.selectSection("masktab"))
     return;
 
   std::string tabLines;
   tsv >> tabLines;
-  TSVSerialiser tab(tabLines);
+  API::TSVSerialiser tab(tabLines);
 
   std::vector<QPushButton *> buttons{
       m_move,         m_pointer,        m_ellipse,  m_rectangle,
@@ -1297,8 +1297,8 @@ InstrumentWidgetMaskTab::loadMask(const std::string &fileName) {
  * @return a string representing the state of the mask tab
  */
 std::string InstrumentWidgetMaskTab::saveToProject() const {
-  TSVSerialiser tsv;
-  TSVSerialiser tab;
+  API::TSVSerialiser tsv;
+  API::TSVSerialiser tab;
 
   std::vector<QPushButton *> buttons{
       m_move,         m_pointer,        m_ellipse,  m_rectangle,
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp
index 571bfc04953..f604ed4bc0b 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp
@@ -700,14 +700,14 @@ void InstrumentWidgetPickTab::savePlotToWorkspace() {
  * @param lines :: lines from the project file to load state from
  */
 void InstrumentWidgetPickTab::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
 
   if (!tsv.selectSection("picktab"))
     return;
 
   std::string tabLines;
   tsv >> tabLines;
-  TSVSerialiser tab(tabLines);
+  API::TSVSerialiser tab(tabLines);
 
   // load active push button
   std::vector<QPushButton *> buttons{
@@ -726,8 +726,7 @@ void InstrumentWidgetPickTab::loadFromProject(const std::string &lines) {
  * @return a string representing the state of the pick tab
  */
 std::string InstrumentWidgetPickTab::saveToProject() const {
-  TSVSerialiser tsv;
-  TSVSerialiser tab;
+  API::TSVSerialiser tsv, tab;
 
   // save active push button
   std::vector<QPushButton *> buttons{
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetRenderTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetRenderTab.cpp
index 1a8e6167024..abb0a2e9ac5 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetRenderTab.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetRenderTab.cpp
@@ -734,7 +734,7 @@ QPointF InstrumentWidgetRenderTab::getUCorrection() const {
  */
 std::string
 MantidQt::MantidWidgets::InstrumentWidgetRenderTab::saveToProject() const {
-  TSVSerialiser tab;
+  API::TSVSerialiser tab;
 
   tab.writeLine("AxesView") << mAxisCombo->currentIndex();
   tab.writeLine("AutoScaling") << m_autoscaling->isChecked();
@@ -757,7 +757,7 @@ MantidQt::MantidWidgets::InstrumentWidgetRenderTab::saveToProject() const {
   const auto colorMap = m_colorMapWidget->saveToProject();
   tab.writeRaw(colorMap);
 
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   tsv.writeSection("rendertab", tab.outputLines());
   return tsv.outputLines();
 }
@@ -767,14 +767,14 @@ MantidQt::MantidWidgets::InstrumentWidgetRenderTab::saveToProject() const {
  * @param lines :: lines defining the state of the render tab
  */
 void InstrumentWidgetRenderTab::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
 
   if (!tsv.selectSection("rendertab"))
     return;
 
   std::string tabLines;
   tsv >> tabLines;
-  TSVSerialiser tab(tabLines);
+  API::TSVSerialiser tab(tabLines);
 
   bool autoScaling, displayAxes, flipView, displayDetectorsOnly,
       displayWireframe, displayLighting, useOpenGL, useUCorrection;
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetTreeTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetTreeTab.cpp
index 49a87889887..21e2c8be065 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetTreeTab.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetTreeTab.cpp
@@ -65,14 +65,14 @@ void InstrumentWidgetTreeTab::showEvent(QShowEvent *) {
  * @param lines :: lines from the project file to load state from
  */
 void InstrumentWidgetTreeTab::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
 
   if (!tsv.selectSection("treetab"))
     return;
 
   std::string tabLines;
   tsv >> tabLines;
-  TSVSerialiser tab(tabLines);
+  API::TSVSerialiser tab(tabLines);
 
   std::string componentName;
   if (tab.selectLine("SelectedComponent")) {
@@ -85,8 +85,7 @@ void InstrumentWidgetTreeTab::loadFromProject(const std::string &lines) {
  * @return a string representing the state of the tree tab
  */
 std::string InstrumentWidgetTreeTab::saveToProject() const {
-  TSVSerialiser tsv;
-  TSVSerialiser tab;
+  API::TSVSerialiser tsv, tab;
 
   auto index = m_instrumentTree->currentIndex();
   auto model = index.model();
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/MaskBinsData.cpp b/MantidQt/MantidWidgets/src/InstrumentView/MaskBinsData.cpp
index 2e69849a1f7..02fbfed1c51 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/MaskBinsData.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/MaskBinsData.cpp
@@ -62,9 +62,9 @@ void MaskBinsData::clear() { m_masks.clear(); }
  * @param lines :: lines from the project file to load state from
  */
 void MaskBinsData::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
   for (auto &maskLines : tsv.sections("Mask")) {
-    TSVSerialiser mask(maskLines);
+    API::TSVSerialiser mask(maskLines);
     mask.selectLine("Range");
     double start, end;
     mask >> start >> end;
@@ -85,9 +85,9 @@ void MaskBinsData::loadFromProject(const std::string &lines) {
  * @return a string representing the state of the mask bins
  */
 std::string MaskBinsData::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   for (const auto &binMask : m_masks) {
-    TSVSerialiser mask;
+    API::TSVSerialiser mask;
     mask.writeLine("Range") << binMask.start << binMask.end;
     mask.writeLine("Spectra");
     for (const int spectrum : binMask.spectra) {
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/Projection3D.cpp b/MantidQt/MantidWidgets/src/InstrumentView/Projection3D.cpp
index 43a732e4e9b..a7ecee99229 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/Projection3D.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/Projection3D.cpp
@@ -467,7 +467,7 @@ void Projection3D::setLightingModel(bool picking) const {
  */
 void Projection3D::loadFromProject(const std::string &lines) {
   ProjectionSurface::loadFromProject(lines);
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
 
   if (tsv.selectSection("Viewport")) {
     std::string viewportLines;
@@ -480,7 +480,7 @@ void Projection3D::loadFromProject(const std::string &lines) {
  * @return a string representing the state of the 3D projection
  */
 std::string Projection3D::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   tsv.writeRaw(ProjectionSurface::saveToProject());
   tsv.writeSection("Viewport", m_viewport.saveToProject());
   return tsv.outputLines();
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp b/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp
index 6349bce5cbf..b440b32c6dd 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp
@@ -722,7 +722,7 @@ QStringList ProjectionSurface::getPeaksWorkspaceNames() const {
  * @param lines :: lines from the project file to load state from
  */
 void ProjectionSurface::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
 
   if (tsv.selectLine("BackgroundColor")) {
     tsv >> m_backgroundColor;
@@ -739,7 +739,7 @@ void ProjectionSurface::loadFromProject(const std::string &lines) {
  * @return a string representing the state of the projection surface
  */
 std::string ProjectionSurface::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   tsv.writeLine("BackgroundColor") << m_backgroundColor;
   tsv.writeSection("shapes", m_maskShapes.saveToProject());
   return tsv.outputLines();
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/Shape2D.cpp b/MantidQt/MantidWidgets/src/InstrumentView/Shape2D.cpp
index c1e08874c9c..07e6f3ba7f9 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/Shape2D.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/Shape2D.cpp
@@ -160,7 +160,7 @@ bool Shape2D::isMasked(const QPointF &p) const {
  * @return a new shape2D with old state applied
  */
 Shape2D *Shape2D::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
 
   if (!tsv.selectLine("Type"))
     return nullptr;
@@ -225,7 +225,7 @@ Shape2D *Shape2D::loadShape2DFromType(const std::string &type,
  * @return a string representing the state of the shape 2D
  */
 std::string Shape2D::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   bool props[]{m_scalable, m_editing, m_selected, m_visible};
 
   tsv.writeLine("Properties");
@@ -353,7 +353,7 @@ void Shape2DEllipse::setPoint(const QString &prop, const QPointF &value) {
  * @return a new shape2D in the shape of a ellipse
  */
 Shape2D *Shape2DEllipse::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
   tsv.selectLine("Parameters");
   double radius1, radius2, x, y;
   tsv >> radius1 >> radius2 >> x >> y;
@@ -364,7 +364,7 @@ Shape2D *Shape2DEllipse::loadFromProject(const std::string &lines) {
  * @return a string representing the state of the shape 2D
  */
 std::string Shape2DEllipse::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   double radius1 = getDouble("radius1");
   double radius2 = getDouble("radius2");
   auto centre = getPoint("centre");
@@ -417,7 +417,7 @@ void Shape2DRectangle::addToPath(QPainterPath &path) const {
  * @return a new shape2D in the shape of a rectangle
  */
 Shape2D *Shape2DRectangle::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
   tsv.selectLine("Parameters");
   double x0, y0, x1, y1;
   tsv >> x0 >> y0 >> x1 >> y1;
@@ -430,7 +430,7 @@ Shape2D *Shape2DRectangle::loadFromProject(const std::string &lines) {
  * @return a string representing the state of the shape 2D
  */
 std::string Shape2DRectangle::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   auto x0 = m_boundingRect.x0();
   auto x1 = m_boundingRect.x1();
   auto y0 = m_boundingRect.y0();
@@ -586,7 +586,7 @@ void Shape2DRing::setColor(const QColor &color) {
  * @return a new shape2D in the shape of a ring
  */
 Shape2D *Shape2DRing::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
   tsv.selectLine("Parameters");
   double xWidth, yWidth;
   tsv >> xWidth >> yWidth;
@@ -603,7 +603,7 @@ Shape2D *Shape2DRing::loadFromProject(const std::string &lines) {
  * @return a string representing the state of the shape 2D
  */
 std::string Shape2DRing::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   auto xWidth = getDouble("xwidth");
   auto yWidth = getDouble("ywidth");
   auto baseShape = getOuterShape();
@@ -754,7 +754,7 @@ void Shape2DFree::subtractPolygon(const QPolygonF &polygon) {
  * @return a new freefrom shape2D
  */
 Shape2D *Shape2DFree::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
   QPolygonF polygon;
 
   size_t paramCount = tsv.values("Parameters").size() - 1;
@@ -773,7 +773,7 @@ Shape2D *Shape2DFree::loadFromProject(const std::string &lines) {
  * @return a string representing the state of the shape 2D
  */
 std::string Shape2DFree::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
 
   tsv.writeLine("Type") << "free";
   tsv.writeLine("Parameters");
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/Shape2DCollection.cpp b/MantidQt/MantidWidgets/src/InstrumentView/Shape2DCollection.cpp
index 0abbe62468c..e9240f8787d 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/Shape2DCollection.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/Shape2DCollection.cpp
@@ -669,7 +669,7 @@ void Shape2DCollection::eraseFree(const QPolygonF &polygon) {
  * @param lines :: lines from the project file to load state from
  */
 void Shape2DCollection::loadFromProject(const std::string &lines) {
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
   for (auto shapeLines : tsv.sections("shape")) {
     Shape2D *shape = Shape2D::loadFromProject(shapeLines);
     addShape(shape, false);
@@ -680,7 +680,7 @@ void Shape2DCollection::loadFromProject(const std::string &lines) {
  * @return a string representing the state of the shape 2D collection
  */
 std::string Shape2DCollection::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   for (auto shape : m_shapes) {
     tsv.writeSection("shape", shape->saveToProject());
   }
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp b/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp
index ebec8df7298..930732bec1e 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp
@@ -722,7 +722,7 @@ void UnwrappedSurface::calcSize(UnwrappedDetector &udet) {
  */
 void UnwrappedSurface::loadFromProject(const std::string &lines) {
   ProjectionSurface::loadFromProject(lines);
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
 
   if (tsv.selectLine("Zoom")) {
     double x0, y0, x1, y1;
@@ -772,7 +772,7 @@ UnwrappedSurface::retrievePeaksWorkspace(const std::string &name) const {
  * @return a string representing the state of the surface
  */
 std::string UnwrappedSurface::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   tsv.writeRaw(ProjectionSurface::saveToProject());
 
   tsv.writeLine("Zoom");
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/Viewport.cpp b/MantidQt/MantidWidgets/src/InstrumentView/Viewport.cpp
index efe2f53695a..a6ce37776f3 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/Viewport.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/Viewport.cpp
@@ -471,7 +471,7 @@ void Viewport::transform(Mantid::Kernel::V3D &pos) const {
 
 void Viewport::loadFromProject(const std::string &lines) {
   reset();
-  TSVSerialiser tsv(lines);
+  API::TSVSerialiser tsv(lines);
 
   tsv.selectLine("Translation");
   double xTrans, yTrans;
@@ -491,7 +491,7 @@ void Viewport::loadFromProject(const std::string &lines) {
 }
 
 std::string Viewport::saveToProject() const {
-  TSVSerialiser tsv;
+  API::TSVSerialiser tsv;
   tsv.writeLine("Translation") << m_xTrans << m_yTrans;
   tsv.writeLine("Zoom") << m_zoomFactor;
 
-- 
GitLab