* CComponentsText: Use 'std::string' instead of 'const char*' for ct_text

This commit is contained in:
Michael Liebmann
2013-04-20 02:07:11 +02:00
parent 48c4142a24
commit 3a19edda45
3 changed files with 13 additions and 13 deletions

View File

@@ -43,7 +43,7 @@ CComponentsText::CComponentsText()
}
CComponentsText::CComponentsText( const int x_pos, const int y_pos, const int w, const int h,
const char* text, const int mode, Font* font_text,
std::string text, const int mode, Font* font_text,
bool has_shadow,
fb_pixel_t color_text, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
{
@@ -88,7 +88,7 @@ void CComponentsText::initVarText()
ct_font = NULL;
ct_box = NULL;
ct_textbox = NULL;
ct_text = NULL;
ct_text = "";
ct_text_mode = CTextBox::AUTO_WIDTH;
ct_col_text = COL_MENUCONTENT;
ct_text_sent = false;
@@ -164,9 +164,7 @@ void CComponentsText::setText(neutrino_locale_t locale_text, int mode, Font* fon
void CComponentsText::setText(const char* ctext, const int mode, Font* font_text)
{
ct_text = ctext;
ct_text_mode = mode;
ct_font = font_text;
setText((string)ctext, mode, font_text);
#ifdef DEBUG_CC
printf(" [CComponentsText] [%s - %d] text: %s \n", __FUNCTION__, __LINE__, ctext);
#endif
@@ -174,9 +172,11 @@ void CComponentsText::setText(const char* ctext, const int mode, Font* font_text
void CComponentsText::setText(const std::string& stext, const int mode, Font* font_text)
{
setText(stext.c_str(), mode, font_text);
ct_text = stext;
ct_text_mode = mode;
ct_font = font_text;
#ifdef DEBUG_CC
printf(" [CComponentsText] [%s - %d] ct_text: %s \n", __FUNCTION__, __LINE__, ct_text);
printf(" [CComponentsText] [%s - %d] ct_text: %s \n", __FUNCTION__, __LINE__, ct_text.c_str());
#endif
}
@@ -185,7 +185,7 @@ void CComponentsText::setText(const int digit, const int mode, Font* font_text)
string s_digit = iToString(digit);
setText(s_digit, mode, font_text);
#ifdef DEBUG_CC
printf(" [CComponentsText] [%s - %d] ct_text: %s \n", __FUNCTION__, __LINE__, ct_text);
printf(" [CComponentsText] [%s - %d] ct_text: %s \n", __FUNCTION__, __LINE__, ct_text.c_str());
#endif
}