mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed bug in printf function
This commit is contained in:
parent
e258e9d9a6
commit
80ac260751
@ -981,6 +981,13 @@ void cTemplateFunction::ParseConditionalTextToken(string &value, size_t start, s
|
|||||||
|
|
||||||
void cTemplateFunction::ParsePrintfTextToken(string &value, size_t start, size_t end) {
|
void cTemplateFunction::ParsePrintfTextToken(string &value, size_t start, size_t end) {
|
||||||
cTextToken token;
|
cTextToken token;
|
||||||
|
if (start > 0) {
|
||||||
|
string constString = value.substr(0, start);
|
||||||
|
value = value.replace(0, start, "");
|
||||||
|
token.type = ttConstString;
|
||||||
|
token.value = constString;
|
||||||
|
textTokens.push_back(token);
|
||||||
|
} else {
|
||||||
token.type = ttPrintfToken;
|
token.type = ttPrintfToken;
|
||||||
//fetch parameter list from printf
|
//fetch parameter list from printf
|
||||||
string printfParams = value.substr(start + 8, end - start - 9);
|
string printfParams = value.substr(start + 8, end - start - 9);
|
||||||
@ -996,6 +1003,7 @@ void cTemplateFunction::ParsePrintfTextToken(string &value, size_t start, size_t
|
|||||||
for (int i=1; i < numParams; i++) {
|
for (int i=1; i < numParams; i++) {
|
||||||
token.parameters.push_back(trim(flds[i]));
|
token.parameters.push_back(trim(flds[i]));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
textTokens.push_back(token);
|
textTokens.push_back(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1588,6 +1596,8 @@ void cTemplateFunction::Debug(void) {
|
|||||||
tokType = "Token: ";
|
tokType = "Token: ";
|
||||||
else if (tokenType == ttConditionalToken)
|
else if (tokenType == ttConditionalToken)
|
||||||
tokType = "Conditional Token: ";
|
tokType = "Conditional Token: ";
|
||||||
|
else if (tokenType == ttPrintfToken)
|
||||||
|
tokType = "PrintF Token: ";
|
||||||
esyslog("skindesigner: %s %d = \"%s\"", tokType.c_str(), i++, (*it).value.c_str());
|
esyslog("skindesigner: %s %d = \"%s\"", tokType.c_str(), i++, (*it).value.c_str());
|
||||||
if (tokenType == ttConditionalToken) {
|
if (tokenType == ttConditionalToken) {
|
||||||
for (vector<cTextToken>::iterator it2 = (*it).subTokens.begin(); it2 != (*it).subTokens.end(); it2++) {
|
for (vector<cTextToken>::iterator it2 = (*it).subTokens.begin(); it2 != (*it).subTokens.end(); it2++) {
|
||||||
@ -1600,6 +1610,11 @@ void cTemplateFunction::Debug(void) {
|
|||||||
esyslog("skindesigner: %s \"%s\"", tokTypeCond.c_str(), (*it2).value.c_str());
|
esyslog("skindesigner: %s \"%s\"", tokTypeCond.c_str(), (*it2).value.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (tokenType == ttPrintfToken) {
|
||||||
|
for (vector<string>::iterator it2 = (*it).parameters.begin(); it2 != (*it).parameters.end(); it2++) {
|
||||||
|
esyslog("skindesigner: Printf parameter: %s", (*it2).c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fontName.size() > 0) {
|
if (fontName.size() > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user