Fix bug #11669: "[widgGetNumTabMajor] couldn't find tabbed form from id" after completing any research

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5021 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2008-05-10 16:54:38 +00:00
parent 6085531f3b
commit a5628c83d9
1 changed files with 22 additions and 22 deletions

View File

@ -878,35 +878,35 @@ static void intDoScreenRefresh(void)
}
// set the tabs again
if (objMajor >= widgGetNumTabMajor(psWScreen, IDOBJ_TABFORM))
{
objMajor = 0; // reset
objMinor = 0;
debug(LOG_ERROR, "Reset tabs since objMajor is too big");
}
else if (objMinor >= widgGetNumTabMinor(psWScreen, IDOBJ_TABFORM, objMajor))
{
objMinor = 0; // reset minor only
debug(LOG_ERROR, "Reset minor tabs since objMinor is too big");
}
if (widgGetFromID(psWScreen, IDOBJ_TABFORM) != NULL)
{
if (objMajor >= widgGetNumTabMajor(psWScreen, IDOBJ_TABFORM))
{
objMajor = 0; // reset
objMinor = 0;
debug(LOG_ERROR, "Reset tabs since objMajor is too big");
}
else if (objMinor >= widgGetNumTabMinor(psWScreen, IDOBJ_TABFORM, objMajor))
{
objMinor = 0; // reset minor only
debug(LOG_ERROR, "Reset minor tabs since objMinor is too big");
}
widgSetTabs(psWScreen, IDOBJ_TABFORM, objMajor, objMinor);
}
if (statMajor >= widgGetNumTabMajor(psWScreen, IDSTAT_TABFORM))
{
statMajor = 0; // reset
statMinor = 0;
debug(LOG_ERROR, "Reset tabs since statMajor is too big");
}
else if (statMinor >= widgGetNumTabMinor(psWScreen, IDSTAT_TABFORM, statMajor))
{
statMinor = 0; // reset minor only
debug(LOG_ERROR, "Reset minor tabs since statMinor is too big");
}
if (widgGetFromID(psWScreen,IDSTAT_TABFORM) != NULL )
{
if (statMajor >= widgGetNumTabMajor(psWScreen, IDSTAT_TABFORM))
{
statMajor = 0; // reset
statMinor = 0;
debug(LOG_ERROR, "Reset tabs since statMajor is too big");
}
else if (statMinor >= widgGetNumTabMinor(psWScreen, IDSTAT_TABFORM, statMajor))
{
statMinor = 0; // reset minor only
debug(LOG_ERROR, "Reset minor tabs since statMinor is too big");
}
widgSetTabs(psWScreen, IDSTAT_TABFORM, statMajor, statMinor);
}