size optimization

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4253 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-09-09 14:29:12 +00:00
parent 8b91e361ca
commit 0bca3c8255
2 changed files with 11 additions and 14 deletions

View file

@ -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 selected = 0;
unsigned int not_selected = 0; unsigned int not_selected = 0;
section *sections = g_sections; section *sections = g_sections;
unsigned int sec = i; section *sec = &sections[i];
if (sections[sec].flags & SF_SECGRP) { if (sec->flags & SF_SECGRP) {
if (!first_call) { if (not_first_call) {
sections[sec].flags &= ~(SF_SELECTED | SF_PSELECTED); sec->flags &= ~(SF_SELECTED | SF_PSELECTED);
i++; i++;
} }
} }
@ -54,17 +54,17 @@ static unsigned int NSISCALL _RefreshSectionGroups(unsigned int i, int first_cal
int ni = i + 1; int ni = i + 1;
if (flags & SF_SECGRP) { if (flags & SF_SECGRP) {
ni = _RefreshSectionGroups(i, 0); ni = _RefreshSectionGroups(i, 1);
flags = sections[i].flags; flags = sections[i].flags;
} }
if (flags & SF_SECGRPEND) { if (flags & SF_SECGRPEND) {
if (selected) { if (selected) {
if (not_selected) { if (not_selected) {
sections[sec].flags |= SF_PSELECTED; sec->flags |= SF_PSELECTED;
} else { } else {
sections[sec].flags |= SF_SELECTED; sec->flags |= SF_SELECTED;
sections[sec].flags &= ~SF_TOGGLED; sec->flags &= ~SF_TOGGLED;
} }
} }
@ -87,10 +87,6 @@ static unsigned int NSISCALL _RefreshSectionGroups(unsigned int i, int first_cal
return 0; return 0;
} }
void NSISCALL RefreshSectionGroups() {
_RefreshSectionGroups(0, 1);
}
#ifdef NSIS_CONFIG_COMPONENTPAGE #ifdef NSIS_CONFIG_COMPONENTPAGE
void NSISCALL SetInstType(int inst_type) { void NSISCALL SetInstType(int inst_type) {

View file

@ -2,7 +2,8 @@
#define ___COMPONENTS_H___ #define ___COMPONENTS_H___
void NSISCALL SectionFlagsChanged(unsigned int index); 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 #ifdef NSIS_CONFIG_COMPONENTPAGE
void NSISCALL SetInstType(int inst_type); void NSISCALL SetInstType(int inst_type);
unsigned int NSISCALL GetInstType(HTREEITEM *items); unsigned int NSISCALL GetInstType(HTREEITEM *items);