From 7257281b55355950dc39a72b763cc517b526b2de Mon Sep 17 00:00:00 2001 From: David L Parkhurst Date: Thu, 5 Jan 2012 17:06:45 +0000 Subject: [PATCH] Fixed bug in read_gas_phase_modify, appended components already in list. Removed #SKIP from basicsubs.cpp, gases.cpp, input.cpp. git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5979 1feff8c3-07ed-0310-ac33-dd36852eb9cd --- GasPhase.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/GasPhase.cxx b/GasPhase.cxx index c663b408..529973a1 100644 --- a/GasPhase.cxx +++ b/GasPhase.cxx @@ -403,7 +403,19 @@ cxxGasPhase::read_raw(CParser & parser, bool check) } else { - this->gas_comps.push_back(gc); + size_t i; + for (i = 0; i < this->gas_comps.size(); i++) + { + if (this->gas_comps[i].Get_phase_name() == gc.Get_phase_name()) + { + this->gas_comps[i] = gc; + break; + } + } + if (i >= this->gas_comps.size()) + { + this->gas_comps.push_back(gc); + } } //opt_save = 4; useLastLine = true;