mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed bug that global tokens were not parsed correctly
This commit is contained in:
parent
15ad84bccf
commit
17497de3c3
1
HISTORY
1
HISTORY
@ -190,3 +190,4 @@ Version 0.2.0
|
|||||||
|
|
||||||
Version 0.2.1
|
Version 0.2.1
|
||||||
|
|
||||||
|
- fixed bug that global tokens were not parsed correctly
|
||||||
|
@ -73,12 +73,15 @@ void cGlobals::ReplaceIntVars(string &value) {
|
|||||||
stringstream sToken;
|
stringstream sToken;
|
||||||
sToken << "{" << it->first << "}";
|
sToken << "{" << it->first << "}";
|
||||||
string token = sToken.str();
|
string token = sToken.str();
|
||||||
size_t foundToken = value.find(token);
|
size_t foundToken = string::npos;
|
||||||
|
do {
|
||||||
|
foundToken = value.find(token);
|
||||||
if (foundToken != string::npos) {
|
if (foundToken != string::npos) {
|
||||||
stringstream st;
|
stringstream st;
|
||||||
st << it->second;
|
st << it->second;
|
||||||
value = value.replace(foundToken, token.size(), st.str());
|
value = value.replace(foundToken, token.size(), st.str());
|
||||||
}
|
}
|
||||||
|
} while (foundToken != string::npos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +110,9 @@ void cGlobals::ReplaceDoubleVars(string &value) {
|
|||||||
stringstream sToken;
|
stringstream sToken;
|
||||||
sToken << "{" << it->first << "}";
|
sToken << "{" << it->first << "}";
|
||||||
string token = sToken.str();
|
string token = sToken.str();
|
||||||
size_t foundToken = value.find(token);
|
size_t foundToken = string::npos;
|
||||||
|
do {
|
||||||
|
foundToken = value.find(token);
|
||||||
if (foundToken != string::npos) {
|
if (foundToken != string::npos) {
|
||||||
stringstream st;
|
stringstream st;
|
||||||
st << it->second;
|
st << it->second;
|
||||||
@ -119,6 +124,7 @@ void cGlobals::ReplaceDoubleVars(string &value) {
|
|||||||
}
|
}
|
||||||
value = value.replace(foundToken, token.size(), doubleVal);
|
value = value.replace(foundToken, token.size(), doubleVal);
|
||||||
}
|
}
|
||||||
|
} while (foundToken != string::npos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user