mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed bug also for loops
This commit is contained in:
parent
10e551d760
commit
1ba2ae905a
2
HISTORY
2
HISTORY
@ -243,3 +243,5 @@ Version 0.3.3
|
||||
recordings in main menu
|
||||
- fixed bug that parameters with both dynamic tokens and relative width,
|
||||
height, posx or posy values are not parsed correctly
|
||||
- fixed bug also for loops
|
||||
|
||||
|
@ -95,8 +95,25 @@ void cTemplateLoopFunction::ParseDynamicParameters(map <string,string> *tokens)
|
||||
return;
|
||||
}
|
||||
|
||||
ReplaceWidthFunctions();
|
||||
ReplaceHeightFunctions();
|
||||
bool replacedWidth = ReplaceWidthFunctions();
|
||||
bool replacedHeight = ReplaceHeightFunctions();
|
||||
|
||||
if (!replacedWidth && !replacedHeight)
|
||||
return;
|
||||
|
||||
InitIterator();
|
||||
func = NULL;
|
||||
while(func = GetNextFunction()) {
|
||||
if (func->ParsedCompletely())
|
||||
continue;
|
||||
func->SetStringTokens(tokens);
|
||||
func->SetIntTokens(&intTokens);
|
||||
func->ParseParameters();
|
||||
if (func->Updated())
|
||||
func->CompleteParameters();
|
||||
func->UnsetIntTokens();
|
||||
func->UnsetStringTokens();
|
||||
}
|
||||
}
|
||||
|
||||
int cTemplateLoopFunction::GetLoopElementsWidth(void) {
|
||||
@ -132,7 +149,8 @@ int cTemplateLoopFunction::GetLoopElementsHeight(void) {
|
||||
return maxHeight;
|
||||
}
|
||||
|
||||
void cTemplateLoopFunction::ReplaceWidthFunctions(void) {
|
||||
bool cTemplateLoopFunction::ReplaceWidthFunctions(void) {
|
||||
bool replaced = false;
|
||||
InitIterator();
|
||||
cTemplateFunction *func = NULL;
|
||||
while(func = GetNextFunction()) {
|
||||
@ -153,14 +171,18 @@ void cTemplateLoopFunction::ReplaceWidthFunctions(void) {
|
||||
func->SetWidth(type, label, funcWidth);
|
||||
if (func->Updated()) {
|
||||
func->CompleteParameters();
|
||||
} else {
|
||||
replaced = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return replaced;
|
||||
}
|
||||
|
||||
void cTemplateLoopFunction::ReplaceHeightFunctions(void) {
|
||||
bool cTemplateLoopFunction::ReplaceHeightFunctions(void) {
|
||||
bool replaced = false;
|
||||
InitIterator();
|
||||
cTemplateFunction *func = NULL;
|
||||
while(func = GetNextFunction()) {
|
||||
@ -181,11 +203,14 @@ void cTemplateLoopFunction::ReplaceHeightFunctions(void) {
|
||||
func->SetHeight(type, label, funcHeight);
|
||||
if (func->Updated()) {
|
||||
func->CompleteParameters();
|
||||
} else {
|
||||
replaced = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return replaced;
|
||||
}
|
||||
|
||||
bool cTemplateLoopFunction::Ready(void) {
|
||||
|
@ -11,8 +11,8 @@ class cTemplateLoopFunction : public cTemplateFunction {
|
||||
private:
|
||||
vector<cTemplateFunction*> functions;
|
||||
vector<cTemplateFunction*>::iterator funcIt;
|
||||
void ReplaceWidthFunctions(void);
|
||||
void ReplaceHeightFunctions(void);
|
||||
bool ReplaceWidthFunctions(void);
|
||||
bool ReplaceHeightFunctions(void);
|
||||
public:
|
||||
cTemplateLoopFunction(void);
|
||||
virtual ~cTemplateLoopFunction(void);
|
||||
|
Loading…
Reference in New Issue
Block a user