fixed bugwith empty loop functions

This commit is contained in:
louis 2016-05-01 06:22:52 +02:00
parent 8d4a1b12b3
commit f45af8f826
3 changed files with 15 additions and 4 deletions

View File

@ -562,9 +562,7 @@ bool cNumericExpr::CacheStatic(void) {
expr = ReplacePercentValue(expr); expr = ReplacePercentValue(expr);
//replace {areawidth} and {areaheight} //replace {areawidth} and {areaheight}
if (container->Width() >= 0) { if (container->Width() >= 0) {
//esyslog("skindesigner: replacing areawidth %s", expr);
expr = ReplaceTokens(expr, "{areawidth}", container->Width()); expr = ReplaceTokens(expr, "{areawidth}", container->Width());
//esyslog("skindesigner: replaced areawidth %s", expr);
} }
if (container->Height() >= 0) if (container->Height() >= 0)
expr = ReplaceTokens(expr, "{areaheight}", container->Height()); expr = ReplaceTokens(expr, "{areaheight}", container->Height());

View File

@ -1228,11 +1228,14 @@ void cFuncLoop::Render(cPixmap *p, int x0, int y0, int cw, int rh) {
return; return;
} }
int numRows = tokenContainer->NumLoops(loopIndex); int numRows = tokenContainer->NumLoops(loopIndex);
if (numRows < 1)
return;
int columnWidth = GetValue((int)eLoopAttribs::columnwidth); int columnWidth = GetValue((int)eLoopAttribs::columnwidth);
int rowHeight = GetValue((int)eLoopAttribs::rowheight); int rowHeight = GetValue((int)eLoopAttribs::rowheight);
int maxItems = GetValue((int)eLoopAttribs::maxitems); int maxItems = GetValue((int)eLoopAttribs::maxitems);
eOrientation orientation = (eOrientation)GetValue((int)eLoopAttribs::orientation); eOrientation orientation = (eOrientation)GetValue((int)eLoopAttribs::orientation);
eOverflowType overflow = (eOverflowType)GetValue((int)eLoopAttribs::overflow); eOverflowType overflow = (eOverflowType)GetValue((int)eLoopAttribs::overflow);
int loopWidth = Width(); int loopWidth = Width();
if (loopWidth <= 0) if (loopWidth <= 0)
loopWidth = container.Width(); loopWidth = container.Width();
@ -1300,6 +1303,9 @@ int cFuncLoop::FuncWidth(void) {
return 0; return 0;
} }
int numLoops = tokenContainer->NumLoops(loopIndex); int numLoops = tokenContainer->NumLoops(loopIndex);
if (numLoops < 1)
return 0;
int columnWidth = GetValue((int)eLoopAttribs::columnwidth); int columnWidth = GetValue((int)eLoopAttribs::columnwidth);
if (columnWidth <=0) if (columnWidth <=0)
columnWidth = ColumnWidth(); columnWidth = ColumnWidth();
@ -1321,6 +1327,9 @@ int cFuncLoop::FuncHeight(void) {
return 0; return 0;
} }
int numLoops = tokenContainer->NumLoops(loopIndex); int numLoops = tokenContainer->NumLoops(loopIndex);
if (numLoops < 1)
return 0;
int rowHeight = GetValue((int)eLoopAttribs::rowheight); int rowHeight = GetValue((int)eLoopAttribs::rowheight);
if (rowHeight <=0) if (rowHeight <=0)
rowHeight = RowHeight(); rowHeight = RowHeight();

View File

@ -1122,14 +1122,18 @@ bool cCeMenuChannels::Parse(bool forced) {
if (schedule) { if (schedule) {
for (const cEvent *e = schedule->GetPresentEvent(); e; e = schedule->Events()->Next(e)) { for (const cEvent *e = schedule->GetPresentEvent(); e; e = schedule->Events()->Next(e)) {
eventsAvailable++; eventsAvailable++;
if (eventsAvailable == 10) if (eventsAvailable == 12)
break; break;
} }
} }
eventsAvailable -= 2;
if (eventsAvailable < 0)
eventsAvailable = 0;
loopInfo.push_back(eventsAvailable); loopInfo.push_back(eventsAvailable);
tokenContainer->CreateLoopTokenContainer(&loopInfo); tokenContainer->CreateLoopTokenContainer(&loopInfo);
if (schedule) { if (schedule && eventsAvailable > 0) {
int num = 0; int num = 0;
for (const cEvent *e = schedule->GetPresentEvent(); e; e = schedule->Events()->Next(e)) { for (const cEvent *e = schedule->GetPresentEvent(); e; e = schedule->Events()->Next(e)) {
if (num < 2) { if (num < 2) {