summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2016-05-01 06:22:52 +0200
committerlouis <louis.braun@gmx.de>2016-05-01 06:22:52 +0200
commitf45af8f826ffe31ed273b9bb3319c4c5fff343a4 (patch)
tree370470372001a03aa6463db4cdf0c7b2cd25c970
parent8d4a1b12b3d3ec3275e1fd0e54cc0ac4b543c6c7 (diff)
downloadvdr-plugin-skindesigner-f45af8f826ffe31ed273b9bb3319c4c5fff343a4.tar.gz
vdr-plugin-skindesigner-f45af8f826ffe31ed273b9bb3319c4c5fff343a4.tar.bz2
fixed bugwith empty loop functions
-rw-r--r--coreengine/complextypes.c2
-rw-r--r--coreengine/functions.c9
-rw-r--r--coreengine/listelements.c8
3 files changed, 15 insertions, 4 deletions
diff --git a/coreengine/complextypes.c b/coreengine/complextypes.c
index 41feafd..bcc1a50 100644
--- a/coreengine/complextypes.c
+++ b/coreengine/complextypes.c
@@ -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());
diff --git a/coreengine/functions.c b/coreengine/functions.c
index 1b089bc..dd5ecfe 100644
--- a/coreengine/functions.c
+++ b/coreengine/functions.c
@@ -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();
diff --git a/coreengine/listelements.c b/coreengine/listelements.c
index ccf84af..1d9d015 100644
--- a/coreengine/listelements.c
+++ b/coreengine/listelements.c
@@ -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) {