Mercurial > clickerconvert
comparison src/converter.cpp @ 75:92139cc60121
Treat everything from the start of the document as the first question
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 04 Oct 2016 17:12:28 +0200 |
parents | 9a2e35a7c19c |
children | 1e6e7699f0b8 |
comparison
equal
deleted
inserted
replaced
74:9a2e35a7c19c | 75:92139cc60121 |
---|---|
217 /* Should not happen without misconfiguration. */ | 217 /* Should not happen without misconfiguration. */ |
218 mErrors << "Internal parser error."; | 218 mErrors << "Internal parser error."; |
219 return; | 219 return; |
220 } | 220 } |
221 foundSomething = true; | 221 foundSomething = true; |
222 QString question = match.captured(1).trimmed(); | 222 /* For some reason the regular expression used is not |
223 * greedy enough if there are multiple question lines | |
224 * before the first Answer. */ | |
225 QString question = input.left(match.capturedStart() + | |
226 match.captured(1).size()); | |
223 unescapeString(question); | 227 unescapeString(question); |
228 qDebug() << "First question: " << question; | |
224 const QString answerLine = match.captured(2).trimmed(); | 229 const QString answerLine = match.captured(2).trimmed(); |
225 xlsx.write(row, 2, QString(" "), mQuestionFmt); | 230 xlsx.write(row, 2, QString(" "), mQuestionFmt); |
226 xlsx.write(row, 3, QString(" "), mQuestionFmt); | 231 xlsx.write(row, 3, QString(" "), mQuestionFmt); |
227 xlsx.write(row++, 1, question, mQuestionFmt); | 232 xlsx.write(row++, 1, question, mQuestionFmt); |
228 html << mQuestionStyle.arg(question.toHtmlEscaped()); | 233 html << mQuestionStyle.arg(question.toHtmlEscaped()); |