Hi,
the function checks if there is *any* child of type WORKWINDOW and *any*
child of type MENUBARWINDOW.
the status of the former child is not overwritten as it is only changed
if the Type matches, not in any case.
Cheers
Gregor
Zhu Lihua schrieb:
Hi all,
From the following code, I can see only if the last child of pWin is a
WORKWINDOW *as well as* a MENUBARWINDOW, the function will return TRUE.
All the status of the former child will be overwrite by the last one. Is
this the thing the function do? If so, why use a loop to read the status
of the former children and overwrite it with the status of the latter
one?
And what is a WORKWINDOW?
Thank you very much.
The following code are copied from OOoSrc/automation/server/sta_list.cxx
<quote>
// a Doc Frame is a Document or the Backing Window
BOOL StatementList::IsDocFrame( Window* pWin )
{
if ( pWin && pWin->IsVisible() && pWin->GetType() ==
WINDOW_BORDERWINDOW )
{
USHORT nCount;
BOOL bHasWorkWindow = FALSE;
BOOL bHasMenuBar = FALSE;
/* #91724# it is now necessary to sort out the IME WIndow in Solaris as
well. so now we check for existence of WINDOW_WORKWINDOW and newly for
WINDOW_MENUBARWINDOW which contains the Menu and the close/min/max
buttons*/
for ( nCount = 0 ; nCount < pWin->GetChildCount() ; nCount++ )
{
if ( pWin->GetChild( nCount )->GetType() ==
WINDOW_WORKWINDOW )
bHasWorkWindow = TRUE;
if ( pWin->GetChild( nCount )->GetType() ==
WINDOW_MENUBARWINDOW )
bHasMenuBar = TRUE;
}
return bHasWorkWindow && bHasMenuBar;
}
return FALSE;
}
</quote>
--
Sun Microsystems GmbH Gregor Hartmann
Nagelsweg 55
D-20097 Hamburg Phone: (+49 40)23646 892
http://www.sun.de mailto:gregor.hartm...@sun.com
Sitz der Gesellschaft: Sun Microsystems GmbH, Sonnenallee 1,
D-85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Haering
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@framework.openoffice.org
For additional commands, e-mail: dev-h...@framework.openoffice.org