mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00: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
|
recordings in main menu
|
||||||
- fixed bug that parameters with both dynamic tokens and relative width,
|
- fixed bug that parameters with both dynamic tokens and relative width,
|
||||||
height, posx or posy values are not parsed correctly
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReplaceWidthFunctions();
|
bool replacedWidth = ReplaceWidthFunctions();
|
||||||
ReplaceHeightFunctions();
|
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) {
|
int cTemplateLoopFunction::GetLoopElementsWidth(void) {
|
||||||
@ -132,7 +149,8 @@ int cTemplateLoopFunction::GetLoopElementsHeight(void) {
|
|||||||
return maxHeight;
|
return maxHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cTemplateLoopFunction::ReplaceWidthFunctions(void) {
|
bool cTemplateLoopFunction::ReplaceWidthFunctions(void) {
|
||||||
|
bool replaced = false;
|
||||||
InitIterator();
|
InitIterator();
|
||||||
cTemplateFunction *func = NULL;
|
cTemplateFunction *func = NULL;
|
||||||
while(func = GetNextFunction()) {
|
while(func = GetNextFunction()) {
|
||||||
@ -153,14 +171,18 @@ void cTemplateLoopFunction::ReplaceWidthFunctions(void) {
|
|||||||
func->SetWidth(type, label, funcWidth);
|
func->SetWidth(type, label, funcWidth);
|
||||||
if (func->Updated()) {
|
if (func->Updated()) {
|
||||||
func->CompleteParameters();
|
func->CompleteParameters();
|
||||||
|
} else {
|
||||||
|
replaced = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return replaced;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cTemplateLoopFunction::ReplaceHeightFunctions(void) {
|
bool cTemplateLoopFunction::ReplaceHeightFunctions(void) {
|
||||||
|
bool replaced = false;
|
||||||
InitIterator();
|
InitIterator();
|
||||||
cTemplateFunction *func = NULL;
|
cTemplateFunction *func = NULL;
|
||||||
while(func = GetNextFunction()) {
|
while(func = GetNextFunction()) {
|
||||||
@ -181,11 +203,14 @@ void cTemplateLoopFunction::ReplaceHeightFunctions(void) {
|
|||||||
func->SetHeight(type, label, funcHeight);
|
func->SetHeight(type, label, funcHeight);
|
||||||
if (func->Updated()) {
|
if (func->Updated()) {
|
||||||
func->CompleteParameters();
|
func->CompleteParameters();
|
||||||
|
} else {
|
||||||
|
replaced = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return replaced;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cTemplateLoopFunction::Ready(void) {
|
bool cTemplateLoopFunction::Ready(void) {
|
||||||
|
@ -11,8 +11,8 @@ class cTemplateLoopFunction : public cTemplateFunction {
|
|||||||
private:
|
private:
|
||||||
vector<cTemplateFunction*> functions;
|
vector<cTemplateFunction*> functions;
|
||||||
vector<cTemplateFunction*>::iterator funcIt;
|
vector<cTemplateFunction*>::iterator funcIt;
|
||||||
void ReplaceWidthFunctions(void);
|
bool ReplaceWidthFunctions(void);
|
||||||
void ReplaceHeightFunctions(void);
|
bool ReplaceHeightFunctions(void);
|
||||||
public:
|
public:
|
||||||
cTemplateLoopFunction(void);
|
cTemplateLoopFunction(void);
|
||||||
virtual ~cTemplateLoopFunction(void);
|
virtual ~cTemplateLoopFunction(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user