#2418 : Import of text grid model fails when comments is on same line as keyword

This commit is contained in:
Magne Sjaastad 2018-01-28 21:29:40 +01:00
parent ca3bb02c57
commit aa12ac743a

View File

@ -342,7 +342,17 @@ void RifEclipseInputFileTools::findKeywordsOnFile(const QString &fileName, std::
filepos = data.pos() - lineLength;
keyPos.filePos = filepos;
keyPos.keyword = line.trimmed();
QString keywordCandidate = line;
int commentStart = keywordCandidate.indexOf("--");
if (commentStart > 0)
{
keywordCandidate = keywordCandidate.left(commentStart);
}
keywordCandidate = keywordCandidate.trimmed();
keyPos.keyword = keywordCandidate;
keywords->push_back(keyPos);
//qDebug() << keyPos.keyword << " - " << keyPos.filePos;
}