mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CComponentsText: fix possible segfault
segfault happens on left empty text CComponentsInfoBox: inherit ct_textbox CComponentsInfoBox: inherit ct_box CComponentsInfoBox: inherit ct_box
This commit is contained in:
@@ -218,17 +218,19 @@ class CComponentsPicture : public CComponentsItem
|
||||
|
||||
class CComponentsText : public CComponentsItem
|
||||
{
|
||||
private:
|
||||
Font* ct_font;
|
||||
CBox * ct_box;
|
||||
CTextBox * ct_textbox;
|
||||
protected:
|
||||
CTextBox * ct_textbox;
|
||||
CBox * ct_box;
|
||||
Font * ct_font;
|
||||
|
||||
void initVarText();
|
||||
private:
|
||||
const char* ct_text;
|
||||
int ct_text_mode; //see textbox.h for possible modes
|
||||
fb_pixel_t ct_col_text;
|
||||
bool ct_text_sended;
|
||||
|
||||
void initVarText();
|
||||
|
||||
void initText();
|
||||
|
||||
public:
|
||||
@@ -249,9 +251,7 @@ class CComponentsInfoBox : public CComponentsText
|
||||
const char* text;
|
||||
int text_mode; //see textbox.h for possible modes
|
||||
int x_text, x_offset;
|
||||
Font* font;
|
||||
CBox * box;
|
||||
CTextBox * textbox;
|
||||
|
||||
CComponentsPicture * pic;
|
||||
std::string pic_default_name;
|
||||
|
||||
@@ -269,11 +269,11 @@ class CComponentsInfoBox : public CComponentsText
|
||||
|
||||
~CComponentsInfoBox();
|
||||
|
||||
inline void setText(const char* info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text; text_mode = mode, font = font_text;};
|
||||
inline void setText(const std::string& info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text.c_str(); text_mode = mode, font = font_text;};
|
||||
inline void setText(const char* info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text; text_mode = mode, ct_font = font_text;};
|
||||
inline void setText(const std::string& info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text.c_str(); text_mode = mode, ct_font = font_text;};
|
||||
void setText(neutrino_locale_t locale_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL);
|
||||
inline void setTextMode(const int mode){text_mode = mode;};//see textbox.h for possible modes
|
||||
inline void setTextFont(Font* font_text){font = font_text;};
|
||||
inline void setTextFont(Font* font_text){ct_font = font_text;};
|
||||
inline void setTextColor(fb_pixel_t color_text){ ibox_col_text = color_text;};
|
||||
inline void setSpaceOffset(const int offset){x_offset = offset;};
|
||||
inline void setPicture(const std::string& picture_name){pic_name = picture_name;};
|
||||
|
Reference in New Issue
Block a user