This commit is contained in:
jst%mozilla.jstenback.com 2003-09-27 05:06:31 +00:00
Родитель 5037b2a4a2
Коммит cd0fc71ec1
1 изменённых файлов: 14 добавлений и 22 удалений

Просмотреть файл

@ -581,11 +581,9 @@ nsEventStatus nsMenuX::MenuConstruct(
return nsEventStatus_eIgnore;
// Iterate over the kids
PRInt32 count;
menuPopup->ChildCount(count);
for ( PRInt32 i = 0; i < count; ++i ) {
nsCOMPtr<nsIContent> child;
menuPopup->ChildAt(i, getter_AddRefs(child));
PRUint32 count = menuPopup->GetChildCount();
for ( PRUint32 i = 0; i < count; ++i ) {
nsIContent *child = menuPopup->GetChildAt(i);
if ( child ) {
// depending on the type, create a menu item, separator, or submenu
nsCOMPtr<nsIAtom> tag;
@ -627,11 +625,9 @@ nsEventStatus nsMenuX::HelpMenuConstruct(
return nsEventStatus_eIgnore;
// Iterate over the kids
PRInt32 count;
menuPopup->ChildCount(count);
for ( PRInt32 i = 0; i < count; ++i ) {
nsCOMPtr<nsIContent> child;
menuPopup->ChildAt(i, getter_AddRefs(child));
PRUint32 count = menuPopup->GetChildCount();
for ( PRUint32 i = 0; i < count; ++i ) {
nsIContent *child = menuPopup->GetChildAt(i);
if ( child ) {
// depending on the type, create a menu item, separator, or submenu
nsCOMPtr<nsIAtom> tag;
@ -1025,14 +1021,12 @@ nsMenuX::OnCreate()
if (popupContent) {
nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(popupContent->GetDocument()));
PRInt32 count;
popupContent->ChildCount(count);
for (PRInt32 i = 0; i < count; i++) {
nsCOMPtr<nsIContent> grandChild;
popupContent->ChildAt(i, getter_AddRefs(grandChild));
PRUint32 count = popupContent->GetChildCount();
for (PRUint32 i = 0; i < count; i++) {
nsIContent *grandChild = popupContent->GetChildAt(i);
nsCOMPtr<nsIAtom> tag;
grandChild->GetTag(getter_AddRefs(tag));
if (tag.get() == nsWidgetAtoms::menuitem) {
if (tag == nsWidgetAtoms::menuitem) {
// See if we have a command attribute.
nsAutoString command;
grandChild->GetAttr(kNameSpaceID_None, nsWidgetAtoms::command, command);
@ -1219,17 +1213,15 @@ nsMenuX::GetMenuPopupContent(nsIContent** aResult)
if ( !xblService )
return;
PRInt32 count;
mMenuContent->ChildCount(count);
PRUint32 count = mMenuContent->GetChildCount();
for (PRInt32 i = 0; i < count; i++) {
PRInt32 dummy;
nsCOMPtr<nsIContent> child;
mMenuContent->ChildAt(i, getter_AddRefs(child));
nsIContent *child = mMenuContent->GetChildAt(i);
nsCOMPtr<nsIAtom> tag;
xblService->ResolveTag(child, &dummy, getter_AddRefs(tag));
if (tag && tag.get() == nsWidgetAtoms::menupopup) {
*aResult = child.get();
if (tag == nsWidgetAtoms::menupopup) {
*aResult = child;
NS_ADDREF(*aResult);
return;
}