mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CComponentsFooter: fix possible error with non-POD element type
affected is struct type 'button_label_cc'
This commit is contained in:
@@ -251,7 +251,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con
|
|||||||
void CComponentsFooter::setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& chain_width, const int& label_width)
|
void CComponentsFooter::setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& chain_width, const int& label_width)
|
||||||
{
|
{
|
||||||
//conversion for compatibility with older paintButtons() methode, find in /gui/widget/buttons.h
|
//conversion for compatibility with older paintButtons() methode, find in /gui/widget/buttons.h
|
||||||
button_label_cc buttons[label_count];
|
button_label_cc *buttons = new button_label_cc[label_count];
|
||||||
for (size_t i = 0; i< label_count; i++){
|
for (size_t i = 0; i< label_count; i++){
|
||||||
buttons[i].button = content[i].button;
|
buttons[i].button = content[i].button;
|
||||||
buttons[i].locale = content[i].locale;
|
buttons[i].locale = content[i].locale;
|
||||||
@@ -262,12 +262,13 @@ void CComponentsFooter::setButtonLabels(const struct button_label * const conten
|
|||||||
buttons[i].btn_alias = -1;
|
buttons[i].btn_alias = -1;
|
||||||
}
|
}
|
||||||
setButtonLabels(buttons, label_count, chain_width, label_width);
|
setButtonLabels(buttons, label_count, chain_width, label_width);
|
||||||
|
delete[] buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CComponentsFooter::setButtonLabels(const vector<button_label_cc> &v_content, const int& chain_width, const int& label_width)
|
void CComponentsFooter::setButtonLabels(const vector<button_label_cc> &v_content, const int& chain_width, const int& label_width)
|
||||||
{
|
{
|
||||||
size_t label_count = v_content.size();
|
size_t label_count = v_content.size();
|
||||||
button_label_cc buttons[label_count];
|
button_label_cc *buttons = new button_label_cc[label_count];
|
||||||
|
|
||||||
for (size_t i= 0; i< label_count; i++){
|
for (size_t i= 0; i< label_count; i++){
|
||||||
buttons[i].button = v_content[i].button;
|
buttons[i].button = v_content[i].button;
|
||||||
@@ -277,8 +278,8 @@ void CComponentsFooter::setButtonLabels(const vector<button_label_cc> &v_content
|
|||||||
buttons[i].btn_result = v_content[i].btn_result;
|
buttons[i].btn_result = v_content[i].btn_result;
|
||||||
buttons[i].btn_alias = v_content[i].btn_alias;
|
buttons[i].btn_alias = v_content[i].btn_alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
setButtonLabels(buttons, label_count, chain_width, label_width);
|
setButtonLabels(buttons, label_count, chain_width, label_width);
|
||||||
|
delete[] buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CComponentsFooter::setButtonLabel( const char *button_icon,
|
void CComponentsFooter::setButtonLabel( const char *button_icon,
|
||||||
|
Reference in New Issue
Block a user