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);
//replace {areawidth} and {areaheight}
if (container->Width() >= 0) {
//esyslog("skindesigner: replacing areawidth %s", expr);
expr = ReplaceTokens(expr, "{areawidth}", container->Width());
//esyslog("skindesigner: replaced areawidth %s", expr);
}
if (container->Height() >= 0)
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;
}
int numRows = tokenContainer->NumLoops(loopIndex);
if (numRows < 1)
return;
int columnWidth = GetValue((int)eLoopAttribs::columnwidth);
int rowHeight = GetValue((int)eLoopAttribs::rowheight);
int maxItems = GetValue((int)eLoopAttribs::maxitems);
eOrientation orientation = (eOrientation)GetValue((int)eLoopAttribs::orientation);
eOverflowType overflow = (eOverflowType)GetValue((int)eLoopAttribs::overflow);
int loopWidth = Width();
if (loopWidth <= 0)
loopWidth = container.Width();
@ -1300,6 +1303,9 @@ int cFuncLoop::FuncWidth(void) {
return 0;
}
int numLoops = tokenContainer->NumLoops(loopIndex);
if (numLoops < 1)
return 0;
int columnWidth = GetValue((int)eLoopAttribs::columnwidth);
if (columnWidth <=0)
columnWidth = ColumnWidth();
@ -1321,6 +1327,9 @@ int cFuncLoop::FuncHeight(void) {
return 0;
}
int numLoops = tokenContainer->NumLoops(loopIndex);
if (numLoops < 1)
return 0;
int rowHeight = GetValue((int)eLoopAttribs::rowheight);
if (rowHeight <=0)
rowHeight = RowHeight();

View File

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