From 69116784ff342ba72e74945997b9f2ef07b28e3e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 16 May 2017 13:36:14 +0200 Subject: [PATCH] Refactoring to be able to compile on Linux --- ...RicWellPathExportCompletionDataFeature.cpp | 31 +++++++++---------- .../RifEclipseOutputTableFormatter.cpp | 2 ++ .../RifEclipseOutputTableFormatter.h | 13 +++++--- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp index 768818d63e..c70d278d8a 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp @@ -132,22 +132,21 @@ void RicWellPathExportCompletionDataFeature::exportToFolder(RimWellPath* wellPat // COMPDAT { - std::vector header = { - RifEclipseOutputTableColumn{"Well", LEFT}, - RifEclipseOutputTableColumn{"I", LEFT}, - RifEclipseOutputTableColumn{"J", LEFT}, - RifEclipseOutputTableColumn{"K1", LEFT}, - RifEclipseOutputTableColumn{"K2", LEFT}, - RifEclipseOutputTableColumn{"Status", LEFT}, - RifEclipseOutputTableColumn{"SAT", LEFT}, - RifEclipseOutputTableColumn{"TR", LEFT}, - RifEclipseOutputTableColumn{"DIAM", LEFT}, - RifEclipseOutputTableColumn{"KH", LEFT}, - RifEclipseOutputTableColumn{"S", LEFT}, - RifEclipseOutputTableColumn{"Df", LEFT}, - RifEclipseOutputTableColumn{"DIR", LEFT}, - RifEclipseOutputTableColumn{"r0", LEFT} - }; + std::vector header; + header.push_back(RifEclipseOutputTableColumn("Well", LEFT)); + header.push_back(RifEclipseOutputTableColumn("I", LEFT)); + header.push_back(RifEclipseOutputTableColumn("J", LEFT)); + header.push_back(RifEclipseOutputTableColumn("K1", LEFT)); + header.push_back(RifEclipseOutputTableColumn("K2", LEFT)); + header.push_back(RifEclipseOutputTableColumn("Status", LEFT)); + header.push_back(RifEclipseOutputTableColumn("SAT", LEFT)); + header.push_back(RifEclipseOutputTableColumn("TR", LEFT)); + header.push_back(RifEclipseOutputTableColumn("DIAM", LEFT)); + header.push_back(RifEclipseOutputTableColumn("KH", LEFT)); + header.push_back(RifEclipseOutputTableColumn("S", LEFT)); + header.push_back(RifEclipseOutputTableColumn("Df", LEFT)); + header.push_back(RifEclipseOutputTableColumn("DIR", LEFT)); + header.push_back(RifEclipseOutputTableColumn("r0", LEFT)); formatter.keyword("COMPDAT"); formatter.header(header); diff --git a/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.cpp b/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.cpp index dce671233e..d7ed079af4 100644 --- a/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.cpp +++ b/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.cpp @@ -18,6 +18,8 @@ #include "RifEclipseOutputTableFormatter.h" +#include "cvfAssert.h" + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.h b/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.h index d387f88190..217e10a58e 100644 --- a/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.h +++ b/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.h @@ -18,8 +18,6 @@ #pragma once -#include "cvfObject.h" - #include #include @@ -57,16 +55,23 @@ struct RifEclipseOutputTableLine //================================================================================================== struct RifEclipseOutputTableColumn { + RifEclipseOutputTableColumn(const QString& title, RifEclipseOutputTableAlignment alignment) + : title(title), + alignment(alignment), + width(-1) + { + } + QString title; RifEclipseOutputTableAlignment alignment; - int width = -1; + int width; }; //================================================================================================== // //================================================================================================== -class RifEclipseOutputTableFormatter : public cvf::Object +class RifEclipseOutputTableFormatter { public: RifEclipseOutputTableFormatter(QTextStream& out);