diff --git a/Source/exehead/components.c b/Source/exehead/components.c index 45d32863..ed2b02b1 100644 --- a/Source/exehead/components.c +++ b/Source/exehead/components.c @@ -34,17 +34,17 @@ void NSISCALL SectionFlagsChanged(unsigned int index) { } } -static unsigned int NSISCALL _RefreshSectionGroups(unsigned int i, int first_call) { +unsigned int NSISCALL _RefreshSectionGroups(unsigned int i, int not_first_call) { unsigned int selected = 0; unsigned int not_selected = 0; section *sections = g_sections; - unsigned int sec = i; + section *sec = §ions[i]; - if (sections[sec].flags & SF_SECGRP) { - if (!first_call) { - sections[sec].flags &= ~(SF_SELECTED | SF_PSELECTED); + if (sec->flags & SF_SECGRP) { + if (not_first_call) { + sec->flags &= ~(SF_SELECTED | SF_PSELECTED); i++; } } @@ -54,17 +54,17 @@ static unsigned int NSISCALL _RefreshSectionGroups(unsigned int i, int first_cal int ni = i + 1; if (flags & SF_SECGRP) { - ni = _RefreshSectionGroups(i, 0); + ni = _RefreshSectionGroups(i, 1); flags = sections[i].flags; } if (flags & SF_SECGRPEND) { if (selected) { if (not_selected) { - sections[sec].flags |= SF_PSELECTED; + sec->flags |= SF_PSELECTED; } else { - sections[sec].flags |= SF_SELECTED; - sections[sec].flags &= ~SF_TOGGLED; + sec->flags |= SF_SELECTED; + sec->flags &= ~SF_TOGGLED; } } @@ -87,10 +87,6 @@ static unsigned int NSISCALL _RefreshSectionGroups(unsigned int i, int first_cal return 0; } -void NSISCALL RefreshSectionGroups() { - _RefreshSectionGroups(0, 1); -} - #ifdef NSIS_CONFIG_COMPONENTPAGE void NSISCALL SetInstType(int inst_type) { diff --git a/Source/exehead/components.h b/Source/exehead/components.h index 870f2acb..09003533 100644 --- a/Source/exehead/components.h +++ b/Source/exehead/components.h @@ -2,7 +2,8 @@ #define ___COMPONENTS_H___ void NSISCALL SectionFlagsChanged(unsigned int index); -void NSISCALL RefreshSectionGroups(); +#define RefreshSectionGroups() _RefreshSectionGroups(0, 0) +unsigned int NSISCALL _RefreshSectionGroups(unsigned int i, int not_first_call); #ifdef NSIS_CONFIG_COMPONENTPAGE void NSISCALL SetInstType(int inst_type); unsigned int NSISCALL GetInstType(HTREEITEM *items);