mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
Added extra check in IPhreeqc::GetSelectedOutputValue
git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@8195 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
7eda614aac
commit
fef2ebd9db
18
IPhreeqc.cpp
18
IPhreeqc.cpp
@ -420,6 +420,8 @@ const char* IPhreeqc::GetSelectedOutputStringLine(int n)
|
||||
{
|
||||
return empty;
|
||||
}
|
||||
// don't need to check CurrentSelectedOutputUserNumber since
|
||||
// GetSelectedOutputStringLineCount will catch
|
||||
return this->SelectedOutputLinesMap[this->CurrentSelectedOutputUserNumber][n].c_str();
|
||||
}
|
||||
|
||||
@ -430,7 +432,7 @@ int IPhreeqc::GetSelectedOutputStringLineCount(void)const
|
||||
{
|
||||
return (int) (*cit).second.size();
|
||||
}
|
||||
return (int)0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool IPhreeqc::GetSelectedOutputStringOn(void)const
|
||||
@ -440,6 +442,7 @@ bool IPhreeqc::GetSelectedOutputStringOn(void)const
|
||||
|
||||
VRESULT IPhreeqc::GetSelectedOutputValue(int row, int col, VAR* pVAR)
|
||||
{
|
||||
VRESULT v;
|
||||
this->ErrorReporter->Clear();
|
||||
if (!pVAR)
|
||||
{
|
||||
@ -448,7 +451,10 @@ VRESULT IPhreeqc::GetSelectedOutputValue(int row, int col, VAR* pVAR)
|
||||
return VR_INVALIDARG;
|
||||
}
|
||||
|
||||
VRESULT v = this->SelectedOutputMap[this->CurrentSelectedOutputUserNumber]->Get(row, col, pVAR);
|
||||
std::map< int, CSelectedOutput* >::const_iterator ci = this->SelectedOutputMap.find(this->CurrentSelectedOutputUserNumber);
|
||||
if (ci != this->SelectedOutputMap.end())
|
||||
{
|
||||
v = this->SelectedOutputMap[this->CurrentSelectedOutputUserNumber]->Get(row, col, pVAR);
|
||||
switch (v)
|
||||
{
|
||||
case VR_OK:
|
||||
@ -469,6 +475,14 @@ VRESULT IPhreeqc::GetSelectedOutputValue(int row, int col, VAR* pVAR)
|
||||
this->AddError("GetSelectedOutputValue: VR_INVALIDCOL Column index out of range.\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
char buffer[120];
|
||||
v = VR_INVALIDARG;
|
||||
::sprintf(buffer, "GetSelectedOutputValue: VR_INVALIDARG Invalid selected-output user number %d.\n", this->CurrentSelectedOutputUserNumber);
|
||||
this->AddError(buffer);
|
||||
}
|
||||
this->update_errors();
|
||||
return v;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user