From fc5313569dfd64de4c67b66f6b10c1ac77684b41 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Thu, 3 Aug 2000 22:09:00 +0000 Subject: [PATCH] part of fix for 46001, support |collapsed| attribute in addition to |hidden| to hide mac menus. --- widget/src/mac/nsMenu.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/widget/src/mac/nsMenu.cpp b/widget/src/mac/nsMenu.cpp index 441374139bd4..8aec3d87c583 100644 --- a/widget/src/mac/nsMenu.cpp +++ b/widget/src/mac/nsMenu.cpp @@ -1381,10 +1381,10 @@ nsMenu::GetNextVisibleMenu(nsIMenu** outNextVisibleMenu) nsCOMPtr menuElement = do_QueryInterface(menuNode); if (!menuElement) continue; - nsAutoString valueString; - menuElement->GetAttribute(NS_ConvertASCIItoUCS2("hidden"), valueString); - - if (! valueString.EqualsWithConversion("true")) + nsAutoString hiddenValue, collapsedValue; + menuElement->GetAttribute(NS_ConvertASCIItoUCS2("hidden"), hiddenValue); + menuElement->GetAttribute(NS_ConvertASCIItoUCS2("collapsed"), collapsedValue); + if (! hiddenValue.EqualsWithConversion("true") && ! collapsedValue.EqualsWithConversion("true")) { NS_IF_ADDREF(*outNextVisibleMenu = thisMenu); break; @@ -1426,6 +1426,7 @@ nsMenu::AttributeChanged(nsIDocument *aDocument, PRInt32 aNameSpaceID, nsIAtom * nsCOMPtr disabledAtom = NS_NewAtom("disabled"); nsCOMPtr valueAtom = NS_NewAtom("value"); nsCOMPtr hiddenAtom = NS_NewAtom("hidden"); + nsCOMPtr collapsedAtom = NS_NewAtom("collapsed"); nsCOMPtr domElement = do_QueryInterface(mDOMNode); if(!domElement) { @@ -1494,11 +1495,12 @@ nsMenu::AttributeChanged(nsIDocument *aDocument, PRInt32 aNameSpaceID, nsIAtom * #endif } - else if(aAttribute == hiddenAtom.get()) // hidden + else if(aAttribute == hiddenAtom.get() || aAttribute == collapsedAtom.get()) // hidden of collapsed { - nsAutoString valueString; - domElement->GetAttribute(NS_ConvertASCIItoUCS2("hidden"), valueString); - if(valueString.EqualsWithConversion("true")) { + nsAutoString hiddenValue, collapsedValue; + domElement->GetAttribute(NS_ConvertASCIItoUCS2("hidden"), hiddenValue); + domElement->GetAttribute(NS_ConvertASCIItoUCS2("collapsed"), collapsedValue); + if(hiddenValue.EqualsWithConversion("true") || collapsedValue.EqualsWithConversion("true")) { // hide this menu ::DeleteMenu(mMacMenuID); }