summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--complexcontent.c7
-rw-r--r--displaymenu.c23
2 files changed, 20 insertions, 10 deletions
diff --git a/complexcontent.c b/complexcontent.c
index 621f00da..4be08db1 100644
--- a/complexcontent.c
+++ b/complexcontent.c
@@ -152,15 +152,18 @@ void cComplexContent::AddImageWithFloatedText(cImage *image, int imageAlignment,
AddImage(image, ImagePos);
} else {
int NumChars = 0;
- for( int i = 0; i < Lines && i <= FloatLines; i++) {
+ for( int i = 0; i < Lines && i < FloatLines; i++) {
NumChars += strlen(WrapperFloat.GetLine(i));
}
-
+ // detect end of last word
+ for(; text[NumChars] != ' ' && text[NumChars] != '\0'; NumChars++)
+ ;
char *FloatedText;
FloatedText = new char[NumChars+1];
memset(FloatedText, '\0', NumChars+1);
strncpy(FloatedText, text, NumChars);
+ NumChars++;
char *SecondText;
SecondText = new char[strlen(text) - NumChars + 2];
memset(SecondText, '\0', strlen(text) - NumChars + 2);
diff --git a/displaymenu.c b/displaymenu.c
index 85d2d5a2..06504e59 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -2030,9 +2030,12 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) {
mediaPath = call.posters[0].path;
}
for( unsigned int i = 0; i < call.actors.size(); i++ ) {
- actors_path.push_back(call.actors[i].thumb.path);
- actors_name.push_back(call.actors[i].name);
- actors_role.push_back(call.actors[i].role);
+ cImage *img = imgLoader.LoadFile(call.actors[i].thumb.path.c_str(), 100, 100);
+ if( img ) {
+ actors_path.push_back(call.actors[i].thumb.path);
+ actors_name.push_back(call.actors[i].name);
+ actors_role.push_back(call.actors[i].role);
+ }
}
}
}
@@ -2099,11 +2102,12 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) {
ComplexContent.AddImage(img, cRect(x, y, 0, 0));
std::string name = actors_name[actor];
std::stringstream sstrRole;
- sstrRole << "\"" << actors_role[actor] << "\"";
+ if( actors_role[actor].length() > 0 )
+ sstrRole << "\"" << actors_role[actor] << "\"";
std::string role = sstrRole.str();
ComplexContent.AddText(name.c_str(), false, cRect(x, y + img->Height() + marginItem, actorWidth, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, actorWidth, fontSmlHeight, taCenter);
ComplexContent.AddText(role.c_str(), false, cRect(x, y + img->Height() + marginItem + fontSmlHeight, actorWidth, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, actorWidth, fontSmlHeight, taCenter);
- }
+ }
x += actorWidth + actorMargin;
actor++;
}
@@ -2802,9 +2806,12 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) {
mediaPath = call.posters[0].path;
}
for( unsigned int i = 0; i < call.actors.size(); i++ ) {
- actors_path.push_back(call.actors[i].thumb.path);
- actors_name.push_back(call.actors[i].name);
- actors_role.push_back(call.actors[i].role);
+ cImage *img = imgLoader.LoadFile(call.actors[i].thumb.path.c_str(), 100, 100);
+ if( img ) {
+ actors_path.push_back(call.actors[i].thumb.path);
+ actors_name.push_back(call.actors[i].name);
+ actors_role.push_back(call.actors[i].role);
+ }
}
}
}