small changes to clients of string converting APIs

git-svn-id: svn://10.0.0.236/trunk@64168 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
scc%netscape.com 2000-03-26 10:18:25 +00:00
parent d88198c611
commit c342abbc24
4 changed files with 18 additions and 18 deletions

View File

@ -562,7 +562,7 @@ void nsContextMenu::LoadMenuItem(
pnsMenuItem->SetDOMElement(domElement);
pnsMenuItem->SetDOMNode(menuitemNode);
if(disabled == NS_STRING_TRUE )
if(disabled.Equals(NS_STRING_TRUE) )
::DisableMenuItem(mMacMenuHandle, menuitemIndex + 1);
else
::EnableMenuItem(mMacMenuHandle, menuitemIndex + 1);

View File

@ -219,7 +219,7 @@ NS_METHOD nsMenu::SetLabel(const nsString &aText)
if(mDOMElement) {
nsString menuIDstring;
mDOMElement->GetAttribute(nsAutoString("id"), menuIDstring);
if(menuIDstring == "menu_Help") {
if(menuIDstring.Equals("menu_Help")) {
mIsHelpMenu = PR_TRUE;
::HMGetHelpMenuHandle(&mMacMenuHandle);
mMacMenuID = kHMHelpMenuID;
@ -316,7 +316,7 @@ NS_METHOD nsMenu::AddMenuItem(nsIMenuItem * aMenuItem)
// I want to be internationalized too!
nsString keyEquivalent = " ";
aMenuItem->GetShortcutChar(keyEquivalent);
if(keyEquivalent != " ") {
if(!keyEquivalent.Equals(" ")) {
keyEquivalent.ToUpperCase();
char keyStr[2];
keyEquivalent.ToCString(keyStr, sizeof(keyStr));
@ -1268,40 +1268,40 @@ void nsMenu::LoadMenuItem(
nsAutoString xulkey;
keyElement->GetAttribute("xulkey", xulkey);
if (xulkey == "true")
if (xulkey.Equals("true"))
modifiers |= knsMenuItemCommandModifier;
if(keyChar != " ")
if(!keyChar.Equals(" "))
pnsMenuItem->SetShortcutChar(keyChar);
if(shiftValue == "true")
if(shiftValue.Equals("true"))
modifiers |= knsMenuItemShiftModifier;
if(altValue == "true")
if(altValue.Equals("true"))
modifiers |= knsMenuItemAltModifier;
if(commandValue == "true")
if(commandValue.Equals("true"))
modifiers |= knsMenuItemCommandModifier;
if(controlValue == "true")
if(controlValue.Equals("true"))
modifiers |= knsMenuItemControlModifier;
pnsMenuItem->SetModifiers(modifiers);
}
if(disabled == NS_STRING_TRUE)
if(disabled.Equals(NS_STRING_TRUE))
pnsMenuItem->SetEnabled(PR_FALSE);
else
pnsMenuItem->SetEnabled(PR_TRUE);
if(checked == NS_STRING_TRUE)
if(checked.Equals(NS_STRING_TRUE))
pnsMenuItem->SetChecked(PR_TRUE);
else
pnsMenuItem->SetChecked(PR_FALSE);
if(type == "checkbox")
if(type.Equals("checkbox"))
pnsMenuItem->SetMenuItemType(nsIMenuItem::eCheckbox);
else if ( type == "radio" )
else if ( type.Equals("radio") )
pnsMenuItem->SetMenuItemType(nsIMenuItem::eRadio);
nsISupports * supports = nsnull;
@ -1338,7 +1338,7 @@ void nsMenu::LoadSubMenu(
// set if it's enabled or disabled
nsAutoString disabled;
menuElement->GetAttribute(nsAutoString("disabled"), disabled);
if ( disabled == "true" )
if ( disabled.Equals("true") )
pnsMenu->SetEnabled ( PR_FALSE );
else
pnsMenu->SetEnabled ( PR_TRUE );
@ -1452,7 +1452,7 @@ nsMenu::AttributeChanged(
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(aContent));
nsString valueString;
element->GetAttribute("disabled", valueString);
if(valueString == "true")
if(valueString.Equals("true"))
SetEnabled(PR_FALSE);
else
SetEnabled(PR_TRUE);

View File

@ -289,7 +289,7 @@ nsEventStatus nsMenuBar::MenuConstruct(
nsString menuIDstring;
menuElement->GetAttribute(nsAutoString("id"), menuIDstring);
if(menuIDstring == "menu_Help") {
if(menuIDstring.Equals("menu_Help")) {
nsMenuEvent event;
MenuHandle handle;
#ifndef RHAPSODY

View File

@ -889,7 +889,7 @@ static PRBool debug_GetCachedBoolPref(const char * aPrefName)
for (PRUint32 i = 0; i < debug_NumPrefValues; i++)
{
if (nsAutoString(debug_PrefValues[i].name) == aPrefName)
if (nsAutoString(debug_PrefValues[i].name).Equals(aPrefName))
{
return debug_PrefValues[i].value;
}
@ -904,7 +904,7 @@ static void debug_SetCachedBoolPref(const char * aPrefName,PRBool aValue)
for (PRUint32 i = 0; i < debug_NumPrefValues; i++)
{
if (nsAutoString(debug_PrefValues[i].name) == aPrefName)
if (nsAutoString(debug_PrefValues[i].name).Equals(aPrefName))
{
debug_PrefValues[i].value = aValue;