Commit bb85fcdb authored by Aurindam Jana's avatar Aurindam Jana
Browse files

CustomWizardParameters: Parsing of replacement fields



Parse each possible pair of %%.

Change-Id: If1f504c16cd7c3b171a1df62efd2927fd28ab4fa
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent ef5d3796
...@@ -850,14 +850,13 @@ bool replaceFieldHelper(ValueStringTransformation transform, ...@@ -850,14 +850,13 @@ bool replaceFieldHelper(ValueStringTransformation transform,
int nextPos = s->indexOf(delimiter, pos + 1); int nextPos = s->indexOf(delimiter, pos + 1);
if (nextPos == -1) if (nextPos == -1)
break; break;
nextPos++; // Point past 2nd delimiter if (nextPos == pos + 1) {
if (nextPos == pos + 2) {
pos = nextPos; // Skip '%%' pos = nextPos; // Skip '%%'
continue; continue;
} }
// Evaluate field specification for modifiers // Evaluate field specification for modifiers
// "%field:l%" // "%field:l%"
QString fieldSpec = s->mid(pos + 1, nextPos - pos - 2); QString fieldSpec = s->mid(pos + 1, nextPos - pos - 1);
const int fieldSpecSize = fieldSpec.size(); const int fieldSpecSize = fieldSpec.size();
char modifier = '\0'; char modifier = '\0';
if (fieldSpecSize >= 3 && fieldSpec.at(fieldSpecSize - 2) == modifierDelimiter) { if (fieldSpecSize >= 3 && fieldSpec.at(fieldSpecSize - 2) == modifierDelimiter) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment